diff --git a/FormalConjectures/Arxiv/1102.4662/AtiyahSutcliffe.lean b/FormalConjectures/Arxiv/1102.4662/AtiyahSutcliffe.lean index 308121d..7c042db 100644 --- a/FormalConjectures/Arxiv/1102.4662/AtiyahSutcliffe.lean +++ b/FormalConjectures/Arxiv/1102.4662/AtiyahSutcliffe.lean @@ -80,10 +80,10 @@ theorem linearFactor_directionLift_ne_zero (v : Point) : rw [directionLift] split · intro h - have := congrArg (MvPolynomial.coeff (Finsupp.single 0 1)) h + have := congrArg (fun p : MvPolynomial (Fin 2) ℂ => p.coeff (Finsupp.single 0 1)) h simp [linearFactor, coeff_X] at this · intro h - have := congrArg (MvPolynomial.coeff (Finsupp.single 1 1)) h + have := congrArg (fun p : MvPolynomial (Fin 2) ℂ => p.coeff (Finsupp.single 1 1)) h simp [linearFactor, coeff_X, Finsupp.single_eq_single_iff] at this @[category test, AMS 51 70] diff --git a/FormalConjectures/Arxiv/2303.01089/FurstenbergTimesPTimesQ.lean b/FormalConjectures/Arxiv/2303.01089/FurstenbergTimesPTimesQ.lean index c0d32d5..5a9c0f0 100644 --- a/FormalConjectures/Arxiv/2303.01089/FurstenbergTimesPTimesQ.lean +++ b/FormalConjectures/Arxiv/2303.01089/FurstenbergTimesPTimesQ.lean @@ -92,7 +92,7 @@ theorem conjecture_1_4 : ∀ p q : ℕ, 2 <= p → 2 <= q → MultiplicativelyIndependent p q → ∀ μ : ProbabilityMeasure 𝕋, MeasureTheory.IsAtomLess μ.1 → MeasurePreserving (Tn p) μ μ → - Tendsto (fun n : ℕ => μ.map (Tn_continuous (q ^ n)).aemeasurable) atTop + Tendsto (fun n : ℕ => μ.map (Tn (q ^ n))) atTop (𝓝 UnitAddCircle.ProbabilityMeasure) := by sorry diff --git a/FormalConjectures/ErdosProblems/1002.lean b/FormalConjectures/ErdosProblems/1002.lean index 67dd4d5..71cbe12 100644 --- a/FormalConjectures/ErdosProblems/1002.lean +++ b/FormalConjectures/ErdosProblems/1002.lean @@ -13,9 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module - -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1002 @@ -25,6 +25,8 @@ import FormalConjecturesUtil - [Ke60] Kesten, Harry, Uniform distribution {${\rm mod}\,1$}. Ann. of Math. (2) (1960), 445--471. -/ +@[expose] public section + open Real Set Filter Finset MeasureTheory Topology namespace Erdos1002 @@ -36,16 +38,15 @@ For any $0<\alpha<1$, let $f(\alpha,n)=\frac{1}{\log n}\sum_{1\leq k\leq n}(\tfr In other words, is there a non-decreasing function $g$ such that $g(-\infty)=0$, $g(\infty)=1$, and $\lim_{n\to \infty}\lvert \{ \alpha\in (0,1): f(\alpha,n)\leq c\}\rvert=g(c)$? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1002 : - answer(sorry) ↔ - ∃ g : ℝ → ℝ, Monotone g ∧ - Tendsto g atBot (𝓝 0) ∧ - Tendsto g atTop (𝓝 1) ∧ - letI f := fun (α : ℝ) (n : ℕ) ↦ - (1 / log n) * ∑ k ∈ Icc (1 : ℕ) n, (1 / 2 - Int.fract (α * k)) - ∀ c : ℝ, Tendsto (fun (n : ℕ) ↦ (volume { α | α ∈ Ioo (0 : ℝ) 1 ∧ f α n ≤ c }).toReal) - atTop (𝓝 (g c)) := by + ∃ g : ℝ → ℝ, Monotone g ∧ + Tendsto g atBot (𝓝 0) ∧ + Tendsto g atTop (𝓝 1) ∧ + letI f := fun (α : ℝ) (n : ℕ) ↦ + (1 / log n) * ∑ k ∈ Icc (1 : ℕ) n, (1 / 2 - Int.fract (α * k)) + ∀ c : ℝ, Tendsto (fun (n : ℕ) ↦ (volume { α | α ∈ Ioo (0 : ℝ) 1 ∧ f α n ≤ c }).toReal) + atTop (𝓝 (g c)) := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/1004.lean b/FormalConjectures/ErdosProblems/1004.lean index d51de47..12a3da3 100644 --- a/FormalConjectures/ErdosProblems/1004.lean +++ b/FormalConjectures/ErdosProblems/1004.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1004 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/1004](https://www.erdosproblems.com/1004) -/ +@[expose] public section + open Filter Real Nat namespace Erdos1004 @@ -35,9 +38,9 @@ For any fixed c > 0, if x is sufficiently large then there exists n ≤ x such t the values of φ(n+k) are all distinct for 1 ≤ k ≤ (log x)^c. This is an open problem. -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1004 : - answer(sorry) ↔ ∀ c > (0 : ℝ), ∀ᶠ x in atTop, ∃ n ≤ x, + ∀ c > (0 : ℝ), ∀ᶠ x in atTop, ∃ n ≤ x, IsDistinctTotientRun n ⌊(Real.log (x : ℝ)) ^ c⌋₊ := by sorry @@ -46,9 +49,9 @@ Erdős, Pomerance, and Sárközy [EPS87] proved that if φ(n+k) are all distinct K ≤ n / exp(c (log n)^{1/3}) for some constant c > 0. Here we state the existence of such a constant c. -/ -@[category research solved, AMS 11] +@[category research solved, question, AMS 11] theorem erdos_1004.variants.le_of_isDistinctTotientRun : - answer(True) ↔ ∃ (c : ℝ) (hc : c > 0), + ∃ (c : ℝ) (hc : c > 0), ∀ᶠ n in atTop, ∀ (K : ℕ), IsDistinctTotientRun n K → (K : ℝ) ≤ (n : ℝ) / Real.exp (c * (Real.log n) ^ (1/3 : ℝ)) := by sorry diff --git a/FormalConjectures/ErdosProblems/101.lean b/FormalConjectures/ErdosProblems/101.lean index 313c56b..1af1a3a 100644 --- a/FormalConjectures/ErdosProblems/101.lean +++ b/FormalConjectures/ErdosProblems/101.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 101 @@ -22,19 +23,14 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/101](https://www.erdosproblems.com/101) -/ +@[expose] public section + namespace Erdos101 open EuclideanGeometry Filter Asymptotics -/-- -The set of lines in $\mathbb{R}^2$ containing exactly $k$ points from a given set $S$. --/ -private noncomputable def linesWithPointsFor (k : ℕ) (S : Set ℝ²) : Set (AffineSubspace ℝ ℝ²) := - let determined_lines := { affineSpan ℝ {p, q} | (p ∈ S) (q ∈ S) (_ : p ≠ q) } - { L ∈ determined_lines | (↑L ∩ S).ncard = k } - /-- The maximum number of lines containing exactly $4$ points among all sets $S$ of $n$ points in $\mathbb{R}^2$ satisfying the condition that no five points are collinear. diff --git a/FormalConjectures/ErdosProblems/1013.lean b/FormalConjectures/ErdosProblems/1013.lean new file mode 100644 index 0000000..a188dab --- /dev/null +++ b/FormalConjectures/ErdosProblems/1013.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1013 + +*References:* +- [erdosproblems.com/1013](https://www.erdosproblems.com/1013) +- [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. +- [GrYa68] Graver, J. E. and Yackel, J., *Some graph theoretic results associated with Ramsey's + theorem*. J. Combinatorial Theory 4 (1968), 125-175. +- [DaIl22] Davies, E. and Illingworth, F., *The $\chi$-Ramsey problem for triangle-free graphs*. + SIAM J. Discrete Math. 36 (2022), 1124-1134. +- [HHKP25] Hefty, Z., Horn, P., King, D. and Pfender, F., *Improving $R(3,k)$ in just two bites*. + [arXiv:2510.19718](https://arxiv.org/abs/2510.19718) (2025). +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos1013 + +/-- $h_3(k)$ is the least $n$ such that some triangle-free graph on $n$ vertices has chromatic +number $k$. Triangle-free graphs of every chromatic number exist (Mycielski), so the set is +nonempty and `sInf` is a true minimum. -/ +noncomputable def h3 (k : ℕ) : ℕ := + sInf {n : ℕ | ∃ G : SimpleGraph (Fin n), G.CliqueFree 3 ∧ G.chromaticNumber = k} + +/-- A triangle-free graph on $m$ vertices with chromatic number $k$ gives $h_3(k) \leq m$. -/ +@[category API, AMS 5] +theorem h3_le {k m : ℕ} (G : SimpleGraph (Fin m)) (hG : G.CliqueFree 3) + (hk : G.chromaticNumber = k) : h3 k ≤ m := + Nat.sInf_le ⟨G, hG, hk⟩ + +/-- The graph on one vertex is triangle-free with chromatic number $1$, so $h_3(1) \leq 1$. -/ +@[category test, AMS 5] +theorem h3_one_le : h3 1 ≤ 1 := + h3_le (⊥ : SimpleGraph (Fin 1)) (SimpleGraph.cliqueFree_bot (by norm_num)) + (by exact_mod_cast SimpleGraph.chromaticNumber_bot (V := Fin 1)) + +def erdos_1013.parts.i.answer : ℕ → ℝ := sorry + +/-- +Let $h_3(k)$ be the minimal $n$ such that there exists a triangle-free graph on $n$ vertices with +chromatic number $k$. Find an asymptotic for $h_3(k)$, and also prove +$$\lim_{k\to \infty}\frac{h_3(k+1)}{h_3(k)}=1.$$ + +This is the first part. +-/ +@[category research open, question value, AMS 5] +theorem erdos_1013.parts.i : + (fun k ↦ (h3 k : ℝ)) ~[atTop] erdos_1013.parts.i.answer := by + sorry + +/-- +Let $h_3(k)$ be the minimal $n$ such that there exists a triangle-free graph on $n$ vertices with +chromatic number $k$. Find an asymptotic for $h_3(k)$, and also prove +$$\lim_{k\to \infty}\frac{h_3(k+1)}{h_3(k)}=1.$$ + +This is the second part. +-/ +@[category research open, AMS 5] +theorem erdos_1013.parts.ii : + Tendsto (fun k : ℕ ↦ (h3 (k + 1) : ℝ) / h3 k) atTop (nhds 1) := by + sorry + +/-- +Graver and Yackel [GrYa68] proved +$$h_3(k)\gg \frac{\log k}{\log\log k}k^2.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_1013.variants.graver_yackel : + ∃ c > (0 : ℝ), ∀ᶠ k : ℕ in atTop, + c * (Real.log k / Real.log (Real.log k)) * k ^ 2 ≤ (h3 k : ℝ) := by + sorry + +/-- +The upper bound $f(n) \leq (2+o(1))(n/\log n)^{1/2}$ of Davies and Illingworth [DaIl22] for the +function $f$ of [1104] gives +$$\left(\frac{1}{2}-o(1)\right)k^2\log k\leq h_3(k).$$ +-/ +@[category research solved, AMS 5] +theorem erdos_1013.variants.lower : + ∀ ε > (0 : ℝ), ∀ᶠ k : ℕ in atTop, + (1 / 2 - ε) * k ^ 2 * Real.log k ≤ (h3 k : ℝ) := by + sorry + +/-- +The lower bound $f(n) \geq (1-o(1))(n/\log n)^{1/2}$ for the function $f$ of [1104], which follows +from the construction of Hefty, Horn, King, and Pfender [HHKP25], gives +$$h_3(k) \leq (2+o(1))k^2\log k.$$ +The site states $(1+o(1))k^2\log k$, but the bounds recorded in [1104] give only $2+o(1)$. +-/ +@[category research solved, AMS 5] +theorem erdos_1013.variants.upper : + ∀ ε > (0 : ℝ), ∀ᶠ k : ℕ in atTop, + (h3 k : ℝ) ≤ (2 + ε) * k ^ 2 * Real.log k := by + sorry + +end Erdos1013 diff --git a/FormalConjectures/ErdosProblems/1017.lean b/FormalConjectures/ErdosProblems/1017.lean new file mode 100644 index 0000000..e6aa0f6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1017.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1017 + +*References:* +- [erdosproblems.com/1017](https://www.erdosproblems.com/1017) +- [EGP66] Erdős, Paul and Goodman, A. W. and Pósa, Lajos, + *The representation of a graph by set intersections*. Canadian J. Math. (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. +- [GyKe17] Győri, Ervin and Keszegh, Balázs, + *On the number of edge-disjoint triangles in $K_4$-free graphs*. + Combinatorica (2017), 1113–1124. +- [Lo68] Lovász, L., *On covering of graphs*. + Theory of Graphs (Proc. Colloq., Tihany, 1966) (1968), 231–236. +-/ + +@[expose] public section + +namespace Erdos1017 + +open SimpleGraph + +/-- The least uniform bound on the number of cliques in an edge partition of an +$n$-vertex, $k$-edge graph. For infeasible parameters the value is zero. -/ +noncomputable def f (n k : ℕ) : ℕ := + sInf {m : ℕ | ∀ G : SimpleGraph (Fin n), G.edgeSet.ncard = k → + ∃ P : Finset (Finset (Fin n)), G.IsCliqueEdgePartition P ∧ P.card ≤ m} + +/-- Partitioning into individual edges gives the bound $f(n,k) \le k$. -/ +@[category API, AMS 5] +theorem f_le (n k : ℕ) : f n k ≤ k := by + classical + apply Nat.sInf_le + intro G hG + obtain ⟨P, hP, hcard⟩ := G.exists_isCliqueEdgePartition_card_eq + refine ⟨P, hP, ?_⟩ + simpa [hcard, ← SimpleGraph.coe_edgeFinset, Set.ncard_coe_finset] using hG.le + +/-- The infimum defining $f$ is an attained uniform bound. -/ +@[category API, AMS 5] +theorem partition_card_le_f (n k : ℕ) (G : SimpleGraph (Fin n)) + (hG : G.edgeSet.ncard = k) : + ∃ P : Finset (Finset (Fin n)), G.IsCliqueEdgePartition P ∧ P.card ≤ f n k := by + classical + have hne : {m : ℕ | ∀ H : SimpleGraph (Fin n), H.edgeSet.ncard = k → + ∃ P : Finset (Finset (Fin n)), H.IsCliqueEdgePartition P ∧ P.card ≤ m}.Nonempty := by + refine ⟨k, ?_⟩ + intro H hH + obtain ⟨P, hP, hcard⟩ := H.exists_isCliqueEdgePartition_card_eq + refine ⟨P, hP, ?_⟩ + simpa [hcard, ← SimpleGraph.coe_edgeFinset, Set.ncard_coe_finset] using hH.le + exact Nat.sInf_mem hne G hG + +/-- A graph with no edges needs no cliques in its edge partition. -/ +@[category test, AMS 5] +theorem f_zero (n : ℕ) : f n 0 = 0 := Nat.eq_zero_of_le_zero (f_le n 0) + +/-- A proposed uniform bound is valid exactly when it is at least $f(n,k)$. -/ +@[category API, AMS 5] +theorem f_le_iff (n k m : ℕ) : f n k ≤ m ↔ + ∀ G : SimpleGraph (Fin n), G.edgeSet.ncard = k → + ∃ P : Finset (Finset (Fin n)), G.IsCliqueEdgePartition P ∧ P.card ≤ m := by + constructor + · intro h G hG + obtain ⟨P, hP, hcard⟩ := partition_card_le_f n k G hG + exact ⟨P, hP, hcard.trans h⟩ + · intro h + apply Nat.sInf_le + exact h + +/-- Impossible edge counts give the vacuous value zero and are excluded from the question. -/ +@[category test, AMS 5] +theorem f_eq_zero_of_infeasible (n k : ℕ) (hk : n.choose 2 < k) : f n k = 0 := by + classical + apply Nat.eq_zero_of_le_zero + rw [f_le_iff] + intro G hG + have hcard := G.card_edgeFinset_le_card_choose_two + have : G.edgeFinset.card = k := by + simpa [← SimpleGraph.coe_edgeFinset, Set.ncard_coe_finset] using hG + simp only [Fintype.card_fin, this] at hcard + omega + +def erdos_1017.lower_bound.answer (n k : ℕ) : ℕ := by sorry + +/-- 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$. -/ +@[category research open, question value, AMS 5] +theorem erdos_1017.lower_bound : + ∀ n k : ℕ, k ≤ n.choose 2 → n * n < 4 * k → + erdos_1017.lower_bound.answer n k ≤ f n k := by + sorry + +def erdos_1017.upper_bound.answer (n k : ℕ) : ℕ := by sorry + +/-- Estimate an upper bound for $f(n,k)$, the worst-case number of complete subgraphs +needed to partition the edges of an $n$-vertex, $k$-edge graph, for +$n^2/4 < k \le \binom{n}{2}$. -/ +@[category research open, question value, AMS 5] +theorem erdos_1017.upper_bound : + ∀ n k : ℕ, k ≤ n.choose 2 → n * n < 4 * k → + f n k ≤ erdos_1017.upper_bound.answer n k := by + sorry + +end Erdos1017 diff --git a/FormalConjectures/ErdosProblems/102.lean b/FormalConjectures/ErdosProblems/102.lean new file mode 100644 index 0000000..99f870b --- /dev/null +++ b/FormalConjectures/ErdosProblems/102.lean @@ -0,0 +1,151 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 102 + +*Reference:* [erdosproblems.com/102](https://www.erdosproblems.com/102) +-/ + +@[expose] public section + +namespace Erdos102 + +open EuclideanGeometry Filter + +open scoped Classical in +/-- The number of points of `P` that lie on `L`. -/ +noncomputable def pointsOn (P : Finset ℝ²) (L : AffineSubspace ℝ ℝ²) : ℕ := + (P.filter (· ∈ L)).card + +/-- The number of lines that contain more than three points of `P`. -/ +noncomputable def richLineCount (P : Finset ℝ²) : ℕ := + {L : AffineSubspace ℝ ℝ² | IsLine L ∧ 3 < pointsOn P L}.ncard + +/-- `P` has $n$ points and at least $c n^2$ lines that each contain more than three points +of `P`. -/ +def Admissible (c : ℝ) (n : ℕ) (P : Finset ℝ²) : Prop := + P.card = n ∧ c * (n : ℝ) ^ 2 ≤ richLineCount P + +/-- The largest number of points of `P` on a single line. -/ +noncomputable def maxCollinear (P : Finset ℝ²) : ℕ := + sSup {k : ℕ | ∃ L, IsLine L ∧ pointsOn P L = k} + +/-- $h_c(n)$: the minimum of `maxCollinear P` over all admissible `P`. It is `⊤` when no +admissible configuration exists. + +Two distinct lines share at most one pair of points, and a line with more than three points of +`P` contains at least $\binom{4}{2} = 6$ pairs. Hence `richLineCount P` $< n^2 / 12$, so for +$c \geq 1/12$ and $n \geq 1$ no configuration is admissible and $h_c(n) = \top$. The problem is +only meaningful for small $c > 0$; the statements below either quantify over all $c > 0$ (where +small $c$ govern the truth value) or restrict to sufficiently small $c$. -/ +noncomputable def h (c : ℝ) (n : ℕ) : ℕ∞ := + ⨅ (P : Finset ℝ²) (_ : Admissible c n P), (maxCollinear P : ℕ∞) + +/-- The plane contains a line. -/ +@[category API, AMS 52] +theorem exists_line : ∃ L : AffineSubspace ℝ ℝ², IsLine L := by + refine ⟨AffineSubspace.mk' 0 (Submodule.span ℝ {EuclideanSpace.single 0 1}), ?_⟩ + unfold IsLine + rw [AffineSubspace.direction_mk'] + apply finrank_span_singleton + simp + +/-- `M ≤ maxCollinear P` exactly when some line contains at least `M` points of `P`. -/ +@[category API, AMS 52] +theorem le_maxCollinear_iff (P : Finset ℝ²) (M : ℕ) : + M ≤ maxCollinear P ↔ ∃ L, IsLine L ∧ M ≤ pointsOn P L := by + have hbdd : BddAbove {k : ℕ | ∃ L, IsLine L ∧ pointsOn P L = k} := by + refine ⟨P.card, ?_⟩ + rintro k ⟨L, -, rfl⟩ + classical + exact Finset.card_filter_le _ _ + have hne : {k : ℕ | ∃ L, IsLine L ∧ pointsOn P L = k}.Nonempty := by + obtain ⟨L, hL⟩ := exists_line + exact ⟨_, L, hL, rfl⟩ + constructor + · intro hM + obtain ⟨L, hL, hk⟩ := Nat.sSup_mem hne hbdd + exact ⟨L, hL, hk ▸ hM⟩ + · rintro ⟨L, hL, hM⟩ + exact hM.trans (le_csSup hbdd ⟨L, hL, rfl⟩) + +/-- `M ≤ h c n` exactly when every admissible configuration of $n$ points has a line that +contains at least `M` of its points. -/ +@[category API, AMS 52] +theorem le_h_iff (c : ℝ) (n M : ℕ) : + (M : ℕ∞) ≤ h c n ↔ + ∀ P : Finset ℝ², Admissible c n P → ∃ L, IsLine L ∧ M ≤ pointsOn P L := by + simp only [h, le_iInf_iff, Nat.cast_le] + refine forall_congr' fun P => imp_congr_right fun _ => ?_ + exact le_maxCollinear_iff P M + +/-- The statement $h_c(n) \to \infty$, written without $h_c$. -/ +@[category API, AMS 52] +theorem tendsto_h_iff (c : ℝ) : + (∀ M : ℕ, ∀ᶠ n in atTop, (M : ℕ∞) ≤ h c n) ↔ + ∀ M : ℕ, ∀ᶠ n in atTop, ∀ P : Finset ℝ², P.card = n → + c * (n : ℝ) ^ 2 ≤ richLineCount P → ∃ L, IsLine L ∧ M ≤ pointsOn P L := by + refine forall_congr' fun M => eventually_congr (Eventually.of_forall fun n => ?_) + rw [le_h_iff] + exact forall_congr' fun P => ⟨fun hP hcard hrich => hP ⟨hcard, hrich⟩, + fun hP hadm => hP hadm.1 hadm.2⟩ + +/-- +Let $c > 0$ and let $h_c(n)$ be such that for any $n$ points in $\mathbb{R}^2$ with at least +$cn^2$ lines that each contain more than three of the points, some line contains $h_c(n)$ of +the points. Is it true that, for fixed $c > 0$, $h_c(n) \to \infty$? +-/ +@[category research open, question, AMS 52] +theorem erdos_102 : + ∀ c > 0, ∀ M : ℕ, ∀ᶠ n in atTop, (M : ℕ∞) ≤ h c n := by + sorry + +/-- +It is not known whether $h_c(n) \geq 5$ for all sufficiently large $n$. +-/ +@[category research open, question, AMS 52] +theorem erdos_102.variants.five : + ∀ c > 0, ∀ᶠ n in atTop, (5 : ℕ∞) ≤ h c n := by + sorry + +/-- +It is easy to see that $h_c(n) \ll_c n^{1/2}$: for all sufficiently small $c > 0$ there are +admissible configurations (e.g. grids) in which no line contains more than $C_c n^{1/2}$ points. +-/ +@[category research solved, AMS 52, formal_proof using lean4 at "https://github.com/anatoliiohorodnyk/lean-fc-proofs/blob/eee8e904a0eb8511302bc809b9486116ec079e69/Proofs/T_Erdos102_erdos_102_variants_upper_sqrt.lean#L1100"] +theorem erdos_102.variants.upper_sqrt : + ∃ c₀ > (0 : ℝ), ∀ c ∈ Set.Ioc 0 c₀, ∃ C : ℝ, ∀ᶠ n in atTop, + h c n ≤ (⌈C * Real.sqrt n⌉₊ : ℕ∞) := by + sorry + +/-- +Erdős [Er95] suggested that perhaps $h_c(n) \gg_c n^{1/2}$. Zach Hunter pointed out that this is +false: the points of $\{1, \dots, m\}^d$ with $n \approx m^d$, randomly projected to +$\mathbb{R}^2$, meet every line in $\ll_d n^{1/d}$ points and determine $\gg_d n^2$ lines with +more than three points. This gives $h_c(n) \ll n^{1 / \log(1/c)}$; we state the underlying form: +for every $d \geq 1$ there is $c > 0$ with $h_c(n) \ll_d n^{1/d}$. +-/ +@[category research solved, AMS 52, formal_proof using lean4 at "https://github.com/anatoliiohorodnyk/lean-fc-proofs/blob/eee8e904a0eb8511302bc809b9486116ec079e69/Proofs/T_Erdos102_erdos_102_variants_hunter.lean#L1113"] +theorem erdos_102.variants.hunter : + ∀ d : ℕ, 1 ≤ d → ∃ c > (0 : ℝ), ∃ C : ℝ, ∀ᶠ n in atTop, + h c n ≤ (⌈C * (n : ℝ) ^ (1 / (d : ℝ))⌉₊ : ℕ∞) := by + sorry + +end Erdos102 diff --git a/FormalConjectures/ErdosProblems/1020.lean b/FormalConjectures/ErdosProblems/1020.lean new file mode 100644 index 0000000..9842171 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1020.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1020 + +*References:* +- [erdosproblems.com/1020](https://www.erdosproblems.com/1020) +- [BDE76] Bollobás, B. and Daykin, D. E. and Erdős, P., *Sets of independent edges of a hypergraph*. + Quart. J. Math. Oxford Ser. (2) (1976), 25--32. +- [Er65d] Erdős, P., *A problem on independent {$r$}-tuples*. Ann. Univ. Sci. Budapest. Eötvös Sect. + Math. (1965), 93--95. +- [ErGa59] Erdős, P. and Gallai, T., *On maximal paths and circuits of graphs*. Acta Math. Acad. + Sci. Hungar. (1959), 337-356 (unbound insert). +- [FLM12] Frankl, Peter and Łuczak, Tomasz and Mieczkowska, Katarzyna, *On matchings in + hypergraphs*. Electron. J. Combin. (2012), Paper 42, 5. +- [FRR12] Frankl, Peter and Rödl, Vojtech and Ruciński, Andrzej, *On the maximum number of edges in + a triple system not containing a disjoint family of a given size*. Combin. Probab. Comput. (2012), + 141--148. +- [Fr17] Frankl, Peter, *Proof of the {E}rdős matching conjecture in a new range*. Israel J. Math. + (2017), 421--430. +- [Fr87] Frankl, Peter, *The shifting technique in extremal set theory*. (1987), 81--110. +- [HLS12] Huang, Hao and Loh, Po-Shen and Sudakov, Benny, *The size of a hypergraph and its matching + number*. Combin. Probab. Comput. (2012), 442--450. +- [Kl68] Kleitman, Daniel J., *Maximal number of subsets of a finite set no {$k$} of which are + pairwise disjoint*. J. Combinatorial Theory (1968), 157--163. +- [KoKu23] Kolupaev, Dmitriy and Kupavskii, Andrey, *Erdős matching conjecture for almost perfect + matchings*. Discrete Math. (2023), Paper No. 113304, 9. +- [LuMi14] Łuczak, Tomasz and Mieczkowska, Katarzyna, *On {E}rdős' extremal problem on matchings in + hypergraphs*. J. Combin. Theory Ser. A (2014), 178--194. +-/ + +@[expose] public section + +namespace Erdos1020 + +/-- The maximum number of edges in an `r`-uniform hypergraph on `n` vertices containing no +matching of size `k` (i.e. no `k` pairwise vertex-disjoint edges). -/ +noncomputable def f (n r k : ℕ) : ℕ := + Hypergraph.extremalNumber n r fun H ↦ ¬ H.HasHypergraphMatching k + +/-- +Let $f(n;r,k)$ be the maximal number of edges in an $r$-uniform hypergraph which contains no set of $k$ many independent edges. + +For all $r\geq 3$, $$f(n;r,k)=\max\left(\binom{rk-1}{r}, \binom{n}{r}-\binom{n-k+1}{r}\right).$$ + +Note: the source states the formula with no range on `n` or `k`, but some restriction +is needed: e.g. for `r = 3`, `k = 2`, `n = 4` no two disjoint triples fit in `4` +vertices, so the left-hand side is `4.choose 3 = 4` while the right-hand side is +`5.choose 3 = 10`. We require `k ≥ 1` and `n ≥ r*k - 1`: this is the smallest `n` +accommodating the construction counted by the first term (all `r`-subsets of a fixed +`(r*k - 1)`-set), and at `n = r*k - 1` the equality holds trivially, since the complete +`r`-uniform hypergraph has no `k`-matching. The source's commentary likewise calls the +case `n < k*r` trivial. +-/ +@[category research open, AMS 5] +theorem erdos_1020 (r : ℕ) (hr : 3 ≤ r) (n k : ℕ) (hk : 0 < k) + (hrk : r * k - 1 ≤ n) : + f n r k = max ((r * k - 1).choose r) + (n.choose r - (n - k + 1).choose r) := by + sorry + +end Erdos1020 diff --git a/FormalConjectures/ErdosProblems/1029.lean b/FormalConjectures/ErdosProblems/1029.lean new file mode 100644 index 0000000..1822dfa --- /dev/null +++ b/FormalConjectures/ErdosProblems/1029.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1029 + +*References:* +- [erdosproblems.com/1029](https://www.erdosproblems.com/1029) +- [Er93] Erdős, Paul, Some of my favorite solved and unsolved problems in graph theory. + Quaestiones Math. (1993), 333-350. +- [ErSz35] Erdős, P. and Szekeres, G., A combinatorial problem in geometry. Compos. Math. (1935), + 463-470. +- [Sp75] Spencer, J., Ramsey's theorem - a new lower bound. J. Combin. Theory Ser. A (1975), + 108-115. +-/ + +@[expose] public section + +open Filter + +namespace Erdos1029 + +/-- +If $R(k)$ is 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$, then +$$\frac{R(k)}{k2^{k/2}}\to \infty.$$ + +In [Er93] Erdős offers $100 for a proof of this and $1000 for a disproof, but says 'this last offer +is to some extent phoney: I am sure that this is true (but I have been wrong before).' +-/ +@[category research open, AMS 5] +theorem erdos_1029 : + Tendsto (fun k : ℕ ↦ (SimpleGraph.diagonalRamsey k : ℝ) / + ((k : ℝ) * (2 : ℝ) ^ ((k : ℝ) / 2))) atTop atTop := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos1029 diff --git a/FormalConjectures/ErdosProblems/103.lean b/FormalConjectures/ErdosProblems/103.lean new file mode 100644 index 0000000..16ce733 --- /dev/null +++ b/FormalConjectures/ErdosProblems/103.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 103 + +*References:* +- [erdosproblems.com/103](https://www.erdosproblems.com/103) +-/ + +@[expose] public section + +open Filter EuclideanGeometry + +namespace Erdos103 + +/-- The sets of $n$ points in $\mathbb{R}^2$ whose pairwise distances are all at least $1$. -/ +def separatedSets (n : ℕ) : Set (Finset ℝ²) := + {B | B.card = n ∧ Metric.IsSeparated' 1 (B : Set ℝ²)} + +/-- `A` is a *minimiser* for `n` if it is a separated set of `n` points whose diameter is at +most the diameter of every separated set of `n` points (compare `Erdos99.erdos_99`). -/ +def IsMinimiser (n : ℕ) (A : Finset ℝ²) : Prop := + A ∈ separatedSets n ∧ + IsMinOn (fun B : Finset ℝ² => Metric.diam (B : Set ℝ²)) (separatedSets n) A + +/-- Two finite sets of points are *congruent* if an isometry of the plane maps one onto the +other. -/ +def Congruent (A B : Finset ℝ²) : Prop := + ∃ f : ℝ² ≃ᵢ ℝ², f '' A = B + +/-- `h n` is the number of congruence classes of minimisers for `n` points, as an element of +`ℕ∞`: the supremum of the cardinalities of finite families of pairwise incongruent minimisers, +which is `⊤` when there are infinitely many classes. -/ +noncomputable def h (n : ℕ) : ℕ∞ := + ⨆ (S : Finset (Finset ℝ²)) (_ : (∀ A ∈ S, IsMinimiser n A) ∧ + ∀ A ∈ S, ∀ B ∈ S, A ≠ B → ¬ Congruent A B), (S.card : ℕ∞) + +/-- +Let $h(n)$ count the number of incongruent sets of $n$ points in $\mathbb{R}^2$ which minimise +the diameter subject to the constraint that $d(x,y)\geq 1$ for all points $x\neq y$. Is it true +that $h(n)\to \infty$? +-/ +@[category research open, question, AMS 52] +theorem erdos_103 : Tendsto h atTop (nhds ⊤) := by + sorry + +/-- +It is not even known whether $h(n)\geq 2$ for all large $n$. +-/ +@[category research open, question, AMS 52] +theorem erdos_103.variants.two_le : ∀ᶠ n in atTop, 2 ≤ h n := by + sorry + +end Erdos103 diff --git a/FormalConjectures/ErdosProblems/1030.lean b/FormalConjectures/ErdosProblems/1030.lean new file mode 100644 index 0000000..6d661ba --- /dev/null +++ b/FormalConjectures/ErdosProblems/1030.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1030 + +*References:* +- [erdosproblems.com/1030](https://www.erdosproblems.com/1030) +- [BEFS89] Burr, S. and Erdős, P. and Faudree, R. J. and Schelp, R. H., On the difference between + consecutive Ramsey numbers. Utilitas Math. (1989), 115-118. +-/ + +@[expose] public section + +open Filter + +namespace Erdos1030 + +/-- +Let $R(k,l)$ be the usual Ramsey number: the smallest $n$ such that if the edges of $K_n$ are +coloured red and blue then there exists either a red $K_k$ or a blue $K_l$. + +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. +-/ +@[category research open, AMS 5] +theorem erdos_1030 : + ∃ c > (0 : ℝ), ∃ L : ℝ, + Tendsto (fun k : ℕ ↦ + (SimpleGraph.classicalRamsey (k + 1) k : ℝ) / + (SimpleGraph.classicalRamsey k k : ℝ)) atTop (nhds L) ∧ + L > 1 + c := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos1030 diff --git a/FormalConjectures/ErdosProblems/1035.lean b/FormalConjectures/ErdosProblems/1035.lean index 0929230..adc4fc7 100644 --- a/FormalConjectures/ErdosProblems/1035.lean +++ b/FormalConjectures/ErdosProblems/1035.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1035 @@ -25,6 +26,8 @@ import FormalConjecturesUtil Quaestiones Math. (1993), 333-350. -/ +@[expose] public section + namespace Erdos1035 /-- @@ -35,8 +38,8 @@ This is Erdős's question [Er93, p. 345]. See also [576] for the extremal number of edges that guarantee a $Q_n$. -/ -@[category research open, AMS 5] -theorem erdos_1035 : answer(sorry) ↔ +@[category research open, question, AMS 5] +theorem erdos_1035 : ∃ c > 0, ∀ n : ℕ, ∀ (G : SimpleGraph (Fin (2 ^ n))) [DecidableRel G.Adj], (∀ v, (G.degree v : ℝ) > (1 - c) * 2 ^ n) → (SimpleGraph.hypercube n).IsContained G := by diff --git a/FormalConjectures/ErdosProblems/1038.lean b/FormalConjectures/ErdosProblems/1038.lean index 2aaf346..33c6aa8 100644 --- a/FormalConjectures/ErdosProblems/1038.lean +++ b/FormalConjectures/ErdosProblems/1038.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1038 @@ -23,17 +24,24 @@ import FormalConjecturesUtil - [erdosproblems.com/1038](https://www.erdosproblems.com/1038) - [Tao25] Tao, Terence. Sublevel Sets of Logarithmic Potentials. Terry Tao’s Blog, Dec. 2025 (https://terrytao.wordpress.com/wp-content/uploads/2025/12/erdos-1038-1.pdf) + - [EHP58] Erdős, P., Herzog, F., Piranian, G. Metric properties of polynomials. + J. Analyse Math. 6 (1958), 125--148. + -/ +@[expose] public section + open scoped Real ENNReal -open MeasureTheory +open MeasureTheory Set namespace Erdos1038 +def erdos_1038.parts.i.answer : ℝ≥0∞ := sorry + /-- What is the infimum of `|{x ∈ ℝ : |f x| < 1}|` over all nonconstant monic polynomials `f` such that all of its roots are real and contained in `[-1,1]`? -/ -@[category research open, AMS 28] -theorem erdos_1038.parts.i (n : ℕ) : answer(sorry) = +@[category research open, question value, AMS 28] +theorem erdos_1038.parts.i : erdos_1038.parts.i.answer = ⨅ f : {f : Polynomial ℝ // f.Monic ∧ f ≠ 1 ∧ (f.roots.filter fun x => x ∈ Set.Icc (-1 : ℝ) 1).card = f.natDegree}, volume {x | |f.1.eval x| < 1} := by @@ -43,7 +51,7 @@ theorem erdos_1038.parts.i (n : ℕ) : answer(sorry) = all of its roots are real and contained in `[-1,1]` is `2 * 2 ^ (1 / 2)`. This is proved in [Tao25]. -/ @[category research solved, AMS 28] -theorem erdos_1038.parts.ii (n : ℕ) : 2 * 2 ^ (1 / 2 : ℝ) = +theorem erdos_1038.parts.ii : 2 * 2 ^ (1 / 2 : ℝ) = ⨆ f : {f : Polynomial ℝ // f.Monic ∧ (f.roots.filter fun x => x ∈ Set.Icc (-1 : ℝ) 1).card = f.natDegree}, volume {x | |f.1.eval x| < 1} := by @@ -52,7 +60,7 @@ theorem erdos_1038.parts.ii (n : ℕ) : 2 * 2 ^ (1 / 2 : ℝ) = /-- The infimum of `|{x ∈ ℝ : |f x| < 1}|` over all nonconstant monic polynomials `f` such that all of its roots are real and contained in `[-1,1]` is `< 1.835`. -/ @[category research solved, AMS 28] -theorem erdos_1038.variants.inf_upperBound (n : ℕ) : ⨅ f : {f : Polynomial ℝ // f.Monic ∧ f ≠ 1 ∧ +theorem erdos_1038.variants.inf_upperBound : ⨅ f : {f : Polynomial ℝ // f.Monic ∧ f ≠ 1 ∧ (f.roots.filter fun x => x ∈ Set.Icc (-1 : ℝ) 1).card = f.natDegree}, volume {x | |f.1.eval x| < 1} < 1.835 := by sorry @@ -60,10 +68,141 @@ theorem erdos_1038.variants.inf_upperBound (n : ℕ) : ⨅ f : {f : Polynomial /-- The infimum of `|{x ∈ ℝ : |f x| < 1}|` over all nonconstant monic polynomials `f` such that all of its roots are real and contained in `[-1,1]` is `≥ 2 ^ (4 / 3) - 1`. -/ @[category research solved, AMS 28] -theorem erdos_1038.varaints.inf_lowerBound (n : ℕ) : 2 ^ (4 / 3 : ℝ) - 1 ≤ +theorem erdos_1038.variants.inf_lowerBound : 2 ^ (4 / 3 : ℝ) - 1 ≤ ⨅ f : {f : Polynomial ℝ // f.Monic ∧ f ≠ 1 ∧ (f.roots.filter fun x => x ∈ Set.Icc (-1 : ℝ) 1).card = f.natDegree}, volume {x | |f.1.eval x| < 1} := by sorry + +/-- For a monic quadratic with roots at distance at most two, the sublevel measure +is $2\sqrt{1+d^2}$, where $2|d|$ is the distance between the roots. This gives +the degree-two case of the sublevel-set problem in [Tao25]. -/ +@[category textbook, AMS 28] +theorem erdos_1038.variants.quadratic_sublevel_formula (m d : ℝ) (hd : |d| ≤ 1) : + volume {x : ℝ | |(x - m) ^ 2 - d ^ 2| < 1} = + ENNReal.ofReal (2 * Real.sqrt (1 + d ^ 2)) := by + have hd2 : d ^ 2 ≤ 1 := by nlinarith [abs_le.mp hd |>.1, abs_le.mp hd |>.2] + have hs : 0 < Real.sqrt (1 + d ^ 2) := Real.sqrt_pos.2 (by positivity) + have hsq : Real.sqrt (1 + d ^ 2) ^ 2 = 1 + d ^ 2 := Real.sq_sqrt (by positivity) + let I := Ioo (m - Real.sqrt (1 + d ^ 2)) (m + Real.sqrt (1 + d ^ 2)) + have hupper : {x : ℝ | |(x - m) ^ 2 - d ^ 2| < 1} ⊆ I := by + intro x hx + change |(x-m)^2-d^2| < 1 at hx + obtain ⟨hlo, hhi⟩ := abs_lt.mp hx + constructor + · nlinarith [sq_nonneg (x - m + Real.sqrt (1 + d ^ 2))] + · nlinarith [sq_nonneg (x - m - Real.sqrt (1 + d ^ 2))] + have hlower : I \ {m} ⊆ {x : ℝ | |(x - m) ^ 2 - d ^ 2| < 1} := by + rintro x ⟨⟨hlo, hhi⟩, hne⟩ + have hpos : 0 < (x - m) ^ 2 := sq_pos_of_ne_zero (sub_ne_zero.mpr hne) + have hlt : (x - m) ^ 2 < 1 + d ^ 2 := by + nlinarith [mul_pos (sub_pos.mpr hhi) (sub_pos.mpr hlo)] + change |(x-m)^2-d^2| < 1 + exact abs_lt.mpr ⟨by linarith, by linarith⟩ + have hI : volume I = ENNReal.ofReal (2 * Real.sqrt (1 + d ^ 2)) := by + rw [Real.volume_Ioo] + congr 1 + ring + apply le_antisymm + · calc + _ ≤ volume I := measure_mono hupper + _ = _ := hI + · have h : volume (I \ {m}) ≤ volume {x : ℝ | |(x-m)^2-d^2| < 1} := + measure_mono hlower + rwa [measure_sdiff_null (by simp), hI] at h + +/-- The degree-two case of the supremum bound in [Tao25]: if $a,b\in[-1,1]$, +the sublevel set of $(x-a)(x-b)$ has measure at most $2\sqrt{2}$. -/ +@[category textbook, AMS 28] +theorem erdos_1038.variants.quadratic_upperBound (a b : ℝ) (ha : |a| ≤ 1) (hb : |b| ≤ 1) : + volume {x : ℝ | |(x-a)*(x-b)| < 1} ≤ ENNReal.ofReal (2 * Real.sqrt 2) := by + have hd : |(a-b)/2| ≤ 1 := by + rw [abs_le] + constructor <;> linarith [abs_le.mp ha |>.1, abs_le.mp ha |>.2, + abs_le.mp hb |>.1, abs_le.mp hb |>.2] + have hpoly (x : ℝ) : (x-a)*(x-b) = (x-(a+b)/2)^2 - ((a-b)/2)^2 := by ring + simp_rw [hpoly] + rw [erdos_1038.variants.quadratic_sublevel_formula ((a+b)/2) ((a-b)/2) hd] + apply ENNReal.ofReal_le_ofReal + have hd2 : ((a-b)/2)^2 ≤ 1 := by nlinarith [abs_le.mp hd |>.1, abs_le.mp hd |>.2] + have h := Real.sqrt_le_sqrt (show 1 + ((a-b)/2)^2 ≤ 2 by linarith) + linarith + + +/-- The admissible quadratic $x^2-1$, with roots $-1$ and $1$, attains the supremum +value $2\sqrt{2}$ in [Tao25]. -/ +@[category textbook, AMS 28] +theorem erdos_1038.variants.quadratic_extremizer : + volume {x : ℝ | |x ^ 2 - 1| < 1} = ENNReal.ofReal (2 * Real.sqrt 2) := by + convert erdos_1038.variants.quadratic_sublevel_formula 0 1 (by norm_num) using 1 <;> + norm_num + +open Polynomial in +/-- The lower half of `erdos_1038.parts.ii`: the supremum is at least $2\sqrt{2}$, because the +admissible polynomial $x^2-1$ has sublevel measure exactly $2\sqrt{2}$. The matching upper bound +is proved in [Tao25]. -/ +@[category textbook, AMS 28] +theorem erdos_1038.variants.sup_lowerBound : 2 * 2 ^ (1 / 2 : ℝ) ≤ + ⨆ f : {f : Polynomial ℝ // f.Monic ∧ + (f.roots.filter fun x => x ∈ Set.Icc (-1 : ℝ) 1).card = f.natDegree}, + volume {x | |f.1.eval x| < 1} := by + have hroots : (X ^ 2 - C 1 : ℝ[X]).roots = {-1, 1} := nthRoots_two_one + refine le_iSup_of_le ⟨X ^ 2 - C 1, monic_X_pow_sub_C 1 two_ne_zero, ?_⟩ ?_ + · rw [hroots, natDegree_X_pow_sub_C] + norm_num [Multiset.filter_singleton] + · simp only [eval_sub, eval_pow, eval_X, eval_C] + rw [erdos_1038.variants.quadratic_extremizer, ENNReal.ofReal_mul zero_le_two, + Real.sqrt_eq_rpow, ← ENNReal.ofReal_rpow_of_nonneg zero_le_two (by norm_num)] + norm_num + +open Polynomial in +/-- The infimum in `erdos_1038.parts.i` is strictly less than $2$, as observed in [EHP58]: +for $f(x)=(x+1)(x-1)^3$ the sublevel set $\{x : |f(x)| < 1\}$ is contained in +$(-1.108,-0.835)\cup(0,1.718)$, whose total length is $1.991$. -/ +@[category textbook, AMS 28] +theorem erdos_1038.variants.inf_lt_two : ⨅ f : {f : Polynomial ℝ // f.Monic ∧ f ≠ 1 ∧ + (f.roots.filter fun x => x ∈ Set.Icc (-1 : ℝ) 1).card = f.natDegree}, + volume {x | |f.1.eval x| < 1} < 2 := by + have hmonic : ((X + C 1) * (X - C 1) ^ 3 : ℝ[X]).Monic := + (monic_X_add_C 1).mul ((monic_X_sub_C 1).pow 3) + have hdeg : ((X + C 1) * (X - C 1) ^ 3 : ℝ[X]).natDegree = 4 := by + rw [(monic_X_add_C 1).natDegree_mul ((monic_X_sub_C 1).pow 3), + (monic_X_sub_C 1).natDegree_pow, natDegree_X_add_C, natDegree_X_sub_C] + have hne : ((X + C 1) * (X - C 1) ^ 3 : ℝ[X]) ≠ 1 := fun h => by + rw [h, natDegree_one] at hdeg + exact absurd hdeg (by norm_num) + have hcard : (((X + C 1) * (X - C 1) ^ 3 : ℝ[X]).roots.filter + fun x => x ∈ Set.Icc (-1 : ℝ) 1).card = ((X + C 1) * (X - C 1) ^ 3 : ℝ[X]).natDegree := by + rw [roots_mul hmonic.ne_zero, roots_X_add_C, roots_pow, roots_X_sub_C, hdeg] + norm_num [Multiset.filter_singleton, Multiset.filter_nsmul] + refine lt_of_le_of_lt (iInf_le _ ⟨(X + C 1) * (X - C 1) ^ 3, hmonic, hne, hcard⟩) ?_ + simp only [eval_mul, eval_add, eval_sub, eval_pow, eval_X, eval_C] + have hsub : {x : ℝ | |(x + 1) * (x - 1) ^ 3| < 1} ⊆ + Ioo (-277 / 250) (-167 / 200) ∪ Ioo 0 (859 / 500) := by + intro x (hx : |(x + 1) * (x - 1) ^ 3| < 1) + obtain ⟨hlo, hhi⟩ := abs_lt.mp hx + rcases le_or_gt x (-277 / 250) with h1 | h1 + · have ht : 0 ≤ -277 / 250 - x := by linarith + nlinarith [pow_nonneg ht 2, pow_nonneg ht 3, pow_nonneg ht 4] + rcases lt_or_ge x (-167 / 200) with h2 | h2 + · exact Or.inl ⟨h1, h2⟩ + rcases le_or_gt x 0 with h3 | h3 + · have hs : 0 ≤ x + 167 / 200 := by linarith + have hp : 0 ≤ x ^ 3 - 2 * x ^ 2 + 2 := by + nlinarith [mul_nonneg hs (neg_nonneg.mpr h3), pow_nonneg hs 3] + nlinarith [mul_nonneg (neg_nonneg.mpr h3) hp] + rcases lt_or_ge x (859 / 500) with h4 | h4 + · exact Or.inr ⟨h3, h4⟩ + · have ht : 0 ≤ x - 859 / 500 := by linarith + nlinarith [pow_nonneg ht 2, pow_nonneg ht 3, pow_nonneg ht 4] + calc volume {x : ℝ | |(x + 1) * (x - 1) ^ 3| < 1} + ≤ volume (Ioo (-277 / 250 : ℝ) (-167 / 200) ∪ Ioo 0 (859 / 500)) := measure_mono hsub + _ ≤ volume (Ioo (-277 / 250 : ℝ) (-167 / 200)) + volume (Ioo (0 : ℝ) (859 / 500)) := + measure_union_le _ _ + _ < 2 := by + rw [Real.volume_Ioo, Real.volume_Ioo, ← ENNReal.ofReal_add (by norm_num) (by norm_num), + ENNReal.ofReal_lt_iff_lt_toReal (by norm_num) (by norm_num)] + norm_num + end Erdos1038 diff --git a/FormalConjectures/ErdosProblems/104.lean b/FormalConjectures/ErdosProblems/104.lean new file mode 100644 index 0000000..8e9e218 --- /dev/null +++ b/FormalConjectures/ErdosProblems/104.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 104 + +*References:* +- [erdosproblems.com/104](https://www.erdosproblems.com/104) +- [El84] Elekes, G., *{$n$} points in the plane can determine $n^{3/2}$ unit circles*. Combinatorica + (1984), 131. +- [Er75h] Erdős, P., *Some problems on elementary geometry*. Austral. Math. Soc. Gaz. (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ál, *Some Unsolved problems in Geometry, Number Theory and Combinatorics*. Eureka + (1992), 44-48. +- [HaMe86] Harborth, Heiko and Mengersen, Ingrid, *Point sets with many unit circles*. Discrete + Math. (1986), 193--197. +-/ + +@[expose] public section + +open Filter +open scoped EuclideanGeometry + +namespace Erdos104 + +open EuclideanGeometry + +/-- The number of distinct unit circles containing at least three points of `P`. -/ +noncomputable def unitCircleCount (P : Finset ℝ²) : ℕ := + Set.ncard {s : Sphere ℝ² | s.radius = 1 ∧ 3 ≤ {p ∈ (P : Set ℝ²) | p ∈ s}.ncard} + +/-- The set of unit-circle counts attained by configurations of `n` points in the plane. -/ +noncomputable def possibleUnitCircleCounts (n : ℕ) : Set ℕ := + {k | ∃ P : Finset ℝ², P.card = n ∧ unitCircleCount P = k} + +/-- The maximum number of qualifying unit circles attained by a configuration of `n` points. -/ +noncomputable def maxUnitCircleCount (n : ℕ) : ℕ := + sSup (possibleUnitCircleCounts n) + +/-- +Given $n$ points in $\mathbb{R}^2$ the number of distinct unit circles containing at least three points is $o(n^2)$. +-/ +@[category research open, AMS 52] +theorem erdos_104 : + (fun n : ℕ => (maxUnitCircleCount n : ℝ)) =o[atTop] (fun n : ℕ => (n : ℝ) ^ 2) := by + sorry + +end Erdos104 diff --git a/FormalConjectures/ErdosProblems/1041.lean b/FormalConjectures/ErdosProblems/1041.lean index 0bd296d..052725d 100644 --- a/FormalConjectures/ErdosProblems/1041.lean +++ b/FormalConjectures/ErdosProblems/1041.lean @@ -14,7 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil + +@[expose] public section /-! # Erdős Problem 1041 diff --git a/FormalConjectures/ErdosProblems/1044.lean b/FormalConjectures/ErdosProblems/1044.lean index 2ab2580..9440280 100644 --- a/FormalConjectures/ErdosProblems/1044.lean +++ b/FormalConjectures/ErdosProblems/1044.lean @@ -13,9 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil -import FormalConjectures.ErdosProblems.«1041» +public import FormalConjecturesUtil +public import FormalConjectures.ErdosProblems.«1041» /-! # Erdős Problem 1044 @@ -28,6 +29,8 @@ import FormalConjectures.ErdosProblems.«1041» [github.com/QuanyuTang/erdos-problem-1044](https://github.com/QuanyuTang/erdos-problem-1044). -/ +@[expose] public section + open Polynomial ENNReal namespace Erdos1044 @@ -48,6 +51,8 @@ noncomputable def maxBoundaryLength (f : ℂ[X]) : ℝ≥0∞ := ⨆ z ∈ {w : ℂ | ‖f.eval w‖ < 1}, Erdos1041.length (frontier (connectedComponentIn {w : ℂ | ‖f.eval w‖ < 1} z)) +def erdos_1044.answer : ℝ≥0∞ := 2 + /-- Let $f(z)=\prod_{i=1}^n(z-z_i)\in\mathbb{C}[x]$ where $\lvert z_i\rvert\leq 1$ for all $i$. If $\Lambda(f)$ is the maximum of the lengths of the boundaries of the connected components of @@ -61,9 +66,9 @@ A problem of Erdős, Herzog, and Piranian [EHP58]. This has been resolved by Tang, who proved that the infimum of $\Lambda(f)$ over all such $f$ is $2$. -/ -@[category research solved, AMS 30, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.29.1/ErdosProblems/Erdos1044.lean"] +@[category research solved, question value, AMS 30, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.29.1/ErdosProblems/Erdos1044.lean"] theorem erdos_1044 : - IsGLB {L : ℝ≥0∞ | ∃ f : ℂ[X], IsAdmissible f ∧ maxBoundaryLength f = L} answer(2) := by + IsGLB {L : ℝ≥0∞ | ∃ f : ℂ[X], IsAdmissible f ∧ maxBoundaryLength f = L} erdos_1044.answer := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/1050.lean b/FormalConjectures/ErdosProblems/1050.lean index ae9fff5..d8c8975 100644 --- a/FormalConjectures/ErdosProblems/1050.lean +++ b/FormalConjectures/ErdosProblems/1050.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1050 @@ -36,6 +37,8 @@ A formal Lean proof is given in an external repository, Claude Code and Harmonic's Aristotle. -/ +@[expose] public section + namespace Erdos1050 /-- **Erdős Problem 1050.** The series $\sum_{n=1}^\infty \frac{1}{2^n - 3}$ is irrational. @@ -77,11 +80,10 @@ stronger than the irrationality established by Borwein [Bo91]. This remains open Two exclusions make the series well-posed and the claim non-vacuous, exactly as in Borwein's theorem: $t \ne -2^n$ for all $n \ge 1$ (so no denominator vanishes), and $t \ne 0$ (at $t = 0$ the series is the rational $\sum_{n \ge 1} 2^{-n} = 1$, hence not transcendental). -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1050.variants.transcendental : - answer(sorry) ↔ - ∀ t : ℤ, t ≠ 0 → (∀ n : ℕ, 1 ≤ n → t ≠ -(2 : ℤ) ^ n) → - Transcendental ℚ (∑' n : ℕ, (1 : ℝ) / ((2 : ℝ) ^ (n + 1) + (t : ℝ))) := by + ∀ t : ℤ, t ≠ 0 → (∀ n : ℕ, 1 ≤ n → t ≠ -(2 : ℤ) ^ n) → + Transcendental ℚ (∑' n : ℕ, (1 : ℝ) / ((2 : ℝ) ^ (n + 1) + (t : ℝ))) := by sorry end Erdos1050 diff --git a/FormalConjectures/ErdosProblems/1052.lean b/FormalConjectures/ErdosProblems/1052.lean index 7cad758..8532701 100644 --- a/FormalConjectures/ErdosProblems/1052.lean +++ b/FormalConjectures/ErdosProblems/1052.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1052 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/1052](https://www.erdosproblems.com/1052) -/ +@[expose] public section + namespace Erdos1052 /-- A proper unitary divisor of $n$ is a divisor $d$ of $n$ @@ -35,9 +38,9 @@ def IsUnitaryPerfect (n : ℕ) : Prop := /-- Are there only finitely many unitary perfect numbers? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1052 : - answer(sorry) ↔ {n | IsUnitaryPerfect n}.Finite := by + {n | IsUnitaryPerfect n}.Finite := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/1053.lean b/FormalConjectures/ErdosProblems/1053.lean new file mode 100644 index 0000000..cc21eee --- /dev/null +++ b/FormalConjectures/ErdosProblems/1053.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1053 + +*References:* +- [erdosproblems.com/1053](https://www.erdosproblems.com/1053) +- [Gu04] Guy, Richard K., Unsolved problems in number theory. Springer-Verlag, New York (2004). +-/ + +@[expose] public section + +open ArithmeticFunction Filter +open scoped ArithmeticFunction.sigma + +namespace Erdos1053 + +/-- +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 [Gu04]. +The little-$o$ relation is taken as $n \to \infty$ within the positive integers for which +$\sigma(n) = kn$ for some $k$; on this set, $\sigma(n)/n$ is precisely that multiplier $k$. +-/ +@[category research open, question, AMS 11] +theorem erdos_1053 : + (fun n : ℕ ↦ (σ 1 n : ℝ) / (n : ℝ)) =o[atTop ⊓ 𝓟 {n : ℕ | ∃ k, Nat.IsPerfectFor n 1 k}] + (fun n : ℕ ↦ Real.log (Real.log (n : ℝ))) := by + sorry + +/-- +Guy further writes 'It has even been suggested that there may be only finitely many $k$-perfect +numbers with $k\geq 3$.' +-/ +@[category research open, AMS 11] +theorem erdos_1053.variants.guy : + ∀ k ≥ 3, {n : ℕ | Nat.IsPerfectFor n 1 k}.Finite := by + sorry + +end Erdos1053 diff --git a/FormalConjectures/ErdosProblems/1055.lean b/FormalConjectures/ErdosProblems/1055.lean index 4348f2f..5e6d7ac 100644 --- a/FormalConjectures/ErdosProblems/1055.lean +++ b/FormalConjectures/ErdosProblems/1055.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1055 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/1055](https://www.erdosproblems.com/1055) -/ +@[expose] public section + namespace Erdos1055 /-- A prime $p$ is in class $1$ if the only prime divisors of $p+1$ are diff --git a/FormalConjectures/ErdosProblems/1057.lean b/FormalConjectures/ErdosProblems/1057.lean index ad2169c..15f45ea 100644 --- a/FormalConjectures/ErdosProblems/1057.lean +++ b/FormalConjectures/ErdosProblems/1057.lean @@ -43,7 +43,7 @@ namespace Erdos1057 Let $C(x)$ count the number of Carmichael numbers in the interval $[1,x]$. -/ noncomputable def carmichaelCounting (x : ℝ) : ℝ := - ({n : ℕ | IsCarmichael n ∧ (n : ℝ) ≤ x}.ncard : ℝ) + ({n : ℕ | _root_.IsCarmichael n ∧ (n : ℝ) ≤ x}.ncard : ℝ) /-- Is it true that $C(x)=x^{1-o(1)}$? diff --git a/FormalConjectures/ErdosProblems/1059.lean b/FormalConjectures/ErdosProblems/1059.lean index 901c566..113bf34 100644 --- a/FormalConjectures/ErdosProblems/1059.lean +++ b/FormalConjectures/ErdosProblems/1059.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1059 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/1059](https://www.erdosproblems.com/1059) -/ +@[expose] public section + namespace Erdos1059 def IsFactorial (d : ℕ) : Prop := @@ -34,9 +37,9 @@ def AllFactorialSubtractionsComposite (n : ℕ) : Prop := ∀d ∈ factorialsLessThanN n, (n - d).Composite /-- Are there infinitely many primes $p$ such that $p - k!$ is composite for each $k$ such that $1 ≤ k! < p$? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1059 : - answer(sorry) ↔ Set.Infinite {p | p.Prime ∧ AllFactorialSubtractionsComposite p} := by + Set.Infinite {p | p.Prime ∧ AllFactorialSubtractionsComposite p} := by sorry abbrev DecidableIsFactorial (d : ℕ) : Prop := diff --git a/FormalConjectures/ErdosProblems/1061.lean b/FormalConjectures/ErdosProblems/1061.lean index e52951b..54fc67c 100644 --- a/FormalConjectures/ErdosProblems/1061.lean +++ b/FormalConjectures/ErdosProblems/1061.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1061 @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [Gu04] Guy, Richard K., _Unsolved problems in number theory_. (2004), Problem B15. -/ +@[expose] public section + open Filter Asymptotics open scoped ArithmeticFunction.sigma @@ -42,8 +45,8 @@ noncomputable abbrev S (x : ℝ) : ℝ := How many (ordered) solutions are there to `σ(a) + σ(b) = σ(a + b)` with `a + b ≤ x`? Is it true that this number is asymptotic to `c * x` for some constant `c > 0`? -/ -@[category research open, AMS 11] -theorem erdos_1061 : answer(sorry) ↔ ∃ c : ℝ, 0 < c ∧ S ~[atTop] (fun x : ℝ ↦ c * x) := by +@[category research open, question, AMS 11] +theorem erdos_1061 : ∃ c : ℝ, 0 < c ∧ S ~[atTop] (fun x : ℝ ↦ c * x) := by sorry end Erdos1061 diff --git a/FormalConjectures/ErdosProblems/1063.lean b/FormalConjectures/ErdosProblems/1063.lean index bda13fc..d4fbd6b 100644 --- a/FormalConjectures/ErdosProblems/1063.lean +++ b/FormalConjectures/ErdosProblems/1063.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1063 @@ -25,8 +26,14 @@ import FormalConjecturesUtil * [Gu04] Guy, Richard K., _Unsolved problems in number theory_. (2004), Problem B31. * [Mo85] Monier, Jean-Marie, _Problems and Solutions: Solutions of Advanced Problems: 6447_. Amer. Math. Monthly **92** (1985), 435-436. + * [Ku+26] Kung, P.-N., Song, L., Hwang, D., Yoon, J., Li, C.-L., Severini, S., Olšák, M., + Lockhart, E., Le, Q. V., Gokturk, B., Luong, T., Pfister, T., & Peng, N. (2026). _LEAP: + Supercharging LLMs for Formal Mathematics with Agentic Frameworks_. + [arXiv:2606.03303](https://arxiv.org/abs/2606.03303). -/ +@[expose] public section + open Filter Real open scoped Nat Topology @@ -40,6 +47,8 @@ noncomputable def n (k : ℕ) : ℕ := sInf {m | 2 * k ≤ m ∧ ∃ i0 < k, ¬ (m - i0) ∣ m.choose k ∧ ∀ i < k, i ≠ i0 → (m - i) ∣ m.choose k} +def erdos_1063.better_upper.answer : ℕ → ℝ := sorry + /-- Estimate $n_k$ by finding a better upper bound than Cambie's $n_k \leq k \cdot \operatorname{lcm}(1, \dotsc, k-1)$. @@ -48,9 +57,27 @@ The comparator takes its least common multiple in `ℕ` and casts the result. Wr ascription as `((… ).lcm (fun n : ℕ => n) : ℝ)` instead puts it on the `Finset.lcm` application, so the coercion lands on `n` and the `lcm` is taken in `ℝ`, where `lcm` of non-zero elements is `1` and the whole comparator collapses to `k`. -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_1063.better_upper : - let upper_bound : ℕ → ℝ := answer(sorry) + (fun k => (n k : ℝ)) =O[atTop] erdos_1063.better_upper.answer ∧ + erdos_1063.better_upper.answer =o[atTop] fun k => + (k : ℝ) * (((Finset.Icc 1 (k - 1)).lcm id : ℕ) : ℝ) := by + sorry + +/-- +An improved upper bound +$n_k \ll \exp\left(\frac{k}{\log k}(\log \log k + \log \log \log k + \log 2)\right)$, +which is $o\bigl(k \cdot \operatorname{lcm}(1, \dotsc, k - 1)\bigr)$, was formally proved in +Lean 4 by the LEAP prover agent [Ku+26] (see the linked `formal_proof`). +This is an improvement over another upper bound propsed [here](https://github.com/pw/erdos1063-upper-bound/blob/a28481f5b4bda374086533397269c5b550c759b8/README.md). + -/ +@[category research solved, AMS 11, + formal_proof using formal_conjectures at + "https://github.com/lfsong-google/formal-conjectures/blob/ff33e501bb78a90ae4703e22e052f8bb38e10146/FormalConjectures/ErdosProblems/1063.lean#L5524"] +theorem erdos_1063.variants.subexponential_upper_bound : + let upper_bound : ℕ → ℝ := fun k => + Real.exp ((k : ℝ) / Real.log k * + (Real.log (Real.log k) + Real.log (Real.log (Real.log k)) + Real.log 2)) (fun k => (n k : ℝ)) =O[atTop] upper_bound ∧ upper_bound =o[atTop] fun k => (k : ℝ) * (((Finset.Icc 1 (k - 1)).lcm id : ℕ) : ℝ) := by @@ -60,7 +87,9 @@ theorem erdos_1063.better_upper : Erdős and Selfridge noted that, for $n \ge 2k$ with $k \ge 2$, at least one of the numbers $n - i$ for $0 \le i < k$ fails to divide $\binom{n}{k}$ ([ErSe83]). -/ -@[category research solved, AMS 11] +@[category research solved, AMS 11, + formal_proof using formal_conjectures at + "https://github.com/lfsong-google/formal-conjectures/blob/ff33e501bb78a90ae4703e22e052f8bb38e10146/FormalConjectures/ErdosProblems/1063.lean#L5533"] theorem erdos_1063.variants.exists_exception {n k : ℕ} (hk : 2 ≤ k) (h : 2 * k ≤ n) : ∃ i < k, ¬ (n - i) ∣ n.choose k := by sorry @@ -108,7 +137,9 @@ theorem erdos_1063.variants.small_values : by $k! - i$ for $1 \le i < k$. The hypothesis `3 ≤ k` is necessary. At $k = 2$ the bound is false: $n_2 = 4$ and $2! = 2$. -/ -@[category research solved, AMS 11] +@[category research solved, AMS 11, + formal_proof using formal_conjectures at + "https://github.com/lfsong-google/formal-conjectures/blob/ff33e501bb78a90ae4703e22e052f8bb38e10146/FormalConjectures/ErdosProblems/1063.lean#L5537"] theorem erdos_1063.variants.monier_upper_bound {k : ℕ} (hk : 3 ≤ k) : n k ≤ k ! := by sorry @@ -121,13 +152,17 @@ $2 \cdot \operatorname{lcm}(1) = 2$, while $n_2 = 4$. The source writes the bound as $k[2, 3, \dotsc, k-1]$. That agrees with the range used here, because including $1$ does not change a least common multiple. -/ -@[category research solved, AMS 11] +@[category research solved, AMS 11, + formal_proof using formal_conjectures at + "https://github.com/lfsong-google/formal-conjectures/blob/ff33e501bb78a90ae4703e22e052f8bb38e10146/FormalConjectures/ErdosProblems/1063.lean#L5541"] theorem erdos_1063.variants.cambie_upper_bound {k : ℕ} (hk : 3 ≤ k) : n k ≤ k * (Finset.Icc 1 (k - 1)).lcm id := by sorry /-- The least common multiple bound implies $n_k \le \exp((1 + o(1))k)$. -/ -@[category research solved, AMS 11] +@[category research solved, AMS 11, + formal_proof using formal_conjectures at + "https://github.com/lfsong-google/formal-conjectures/blob/ff33e501bb78a90ae4703e22e052f8bb38e10146/FormalConjectures/ErdosProblems/1063.lean#L5545"] theorem erdos_1063.variants.exp_upper_bound : ∃ f : ℕ → ℝ, Tendsto f atTop (𝓝 0) ∧ ∀ k, (n k : ℝ) ≤ exp ((1 + f k) * k) := by diff --git a/FormalConjectures/ErdosProblems/1065.lean b/FormalConjectures/ErdosProblems/1065.lean index 1a37e49..bb84c6b 100644 --- a/FormalConjectures/ErdosProblems/1065.lean +++ b/FormalConjectures/ErdosProblems/1065.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1065 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/1065](https://www.erdosproblems.com/1065) -/ +@[expose] public section + namespace Erdos1065 /-- @@ -32,17 +35,17 @@ This is mentioned as B46 in [Unsolved Problems in Number Theory](https://doi.org/10.1007/978-0-387-26677-0) by *Richard K. Guy* -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1065.parts.i : - answer(sorry) ↔ Set.Infinite {p | ∃ q k, p.Prime ∧ q.Prime ∧ p = 2^k * q + 1} := by + Set.Infinite {p | ∃ q k, p.Prime ∧ q.Prime ∧ p = 2^k * q + 1} := by sorry /-- Are there infinitely many primes $p$ such that $p = 2^k 3^l q + 1$ for some prime $q$ and $k ≥ 0$, $l ≥ 0$? -/ -@[category research open, AMS 11] -theorem erdos_1065.parts.ii : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_1065.parts.ii : Set.Infinite {p | ∃ q k l, p.Prime ∧ q.Prime ∧ p = 2^k * 3^l * q + 1} := by sorry diff --git a/FormalConjectures/ErdosProblems/1066.lean b/FormalConjectures/ErdosProblems/1066.lean new file mode 100644 index 0000000..8fcad4c --- /dev/null +++ b/FormalConjectures/ErdosProblems/1066.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1066 + +*References:* +- [erdosproblems.com/1066](https://www.erdosproblems.com/1066) +- [Cs98] Csizmadia, G., *On the independence number of minimum distance graphs*. + Discrete Comput. Geom. 20 (1998), 179-187. +- [Er87b] Erdős, P., *Some combinatorial and metric problems in geometry*. + Intuitive geometry (Siófok, 1985) (1987), 167-177. +- [PaTo96] Pach, J. and Tóth, G., *On the independence number of coin graphs*. + Geombinatorics 6 (1996), 30-33. +- [Po85] Pollack, R., *Increasing the minimum distance of a set of points*. + J. Combin. Theory Ser. A 40 (1985), 450. +- [Sw02] Swanepoel, K. J., *Independence numbers of planar contact graphs*. + Discrete Comput. Geom. 28 (2002), 649-670. +-/ + +@[expose] public section + +open Filter SimpleGraph +open scoped EuclideanGeometry Topology + +namespace Erdos1066 + +/-- $g(n)$: the largest $m$ such that, for every set $X$ of $n$ points of $\mathbb{R}^2$ with any +two distinct points at distance at least $1$, the graph on $X$ joining points at distance exactly +$1$ has an independent set with at least $m$ vertices. The set of such $m$ contains $0$ and is +bounded by $n$, so `sSup` is a true maximum. -/ +noncomputable def g (n : ℕ) : ℕ := + sSup {m : ℕ | ∀ X : Finset ℝ², X.card = n → + (X : Set ℝ²).Pairwise (fun x y ↦ 1 ≤ dist x y) → + m ≤ (UnitDistancePlaneGraph (X : Set ℝ²)).indepNum} + +/-- For every admissible point set `X`, $g(|X|)$ is at most the independence number of its unit +distance graph. -/ +@[category API, AMS 5 52] +theorem g_le (X : Finset ℝ²) (hX : (X : Set ℝ²).Pairwise (fun x y ↦ 1 ≤ dist x y)) : + g X.card ≤ (UnitDistancePlaneGraph (X : Set ℝ²)).indepNum := by + refine csSup_le ⟨0, fun _ _ _ => Nat.zero_le _⟩ ?_ + intro m hm + exact hm X rfl hX + +/-- $g_d(n)$: the largest $m$ such that every set $X$ of $n$ points of $\mathbb{R}^d$ with any two +distinct points at distance at least $1$ contains at least $m$ points with pairwise distances +greater than $1$. For $d \geq 1$ the set of such $m$ contains $0$ and is bounded by $n$, so `sSup` +is a true maximum. -/ +noncomputable def gDim (d n : ℕ) : ℕ := + sSup {m : ℕ | ∀ X : Finset (ℝ^d), X.card = n → + (X : Set (ℝ^d)).Pairwise (fun x y ↦ 1 ≤ dist x y) → + ∃ Y ⊆ X, m ≤ Y.card ∧ (Y : Set (ℝ^d)).Pairwise (fun x y ↦ 1 < dist x y)} + +def erdos_1066.answer : ℝ := sorry + +/-- +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 \frac{g(n)}{n}$. + +We ask for $\lim g(n)/n$. The limit exists by Fekete's lemma, since placing two configurations far +apart shows $g(a+b) \leq g(a)+g(b)$. +-/ +@[category research open, question value, AMS 5 52] +theorem erdos_1066 : + Tendsto (fun n : ℕ ↦ (g n : ℝ) / n) atTop (𝓝 erdos_1066.answer) := by + sorry + +/-- +Such graphs are always planar. Pollack [Po85] noted that the Four colour theorem implies +$g(n)\geq n/4$, since the graph is planar. +-/ +@[category research solved, AMS 5 52] +theorem erdos_1066.variants.pollack (n : ℕ) : (n : ℝ) / 4 ≤ (g n : ℝ) := by + sorry + +/-- +This lower bound has been improved to $\frac{9}{35}n$ by Csizmadia [Cs98] and then +$\frac{8}{31}n$ by Swanepoel [Sw02]. +-/ +@[category research solved, AMS 5 52] +theorem erdos_1066.variants.swanepoel (n : ℕ) : (8 / 31 : ℝ) * n ≤ (g n : ℝ) := by + sorry + +/-- +Erdős initially thought that $g(n)=n/3$, but Chung and Graham, and independently Pach, gave a +construction that shows $g(n)\leq \frac{6}{19}n$. Pach and Tóth [PaTo96] improved this to +$g(n)\leq \frac{5}{16}n$. + +Since $g(1) = 1$, the bound cannot hold for all $n$, so it is stated for infinitely many $n$, +with $5/16$ replaced by $5/16+\varepsilon$ for every $\varepsilon > 0$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_1066.variants.pach_toth : + ∀ ε > (0 : ℝ), ∃ᶠ n : ℕ in atTop, (g n : ℝ) ≤ (5 / 16 + ε) * n := by + sorry + +/-- +Pollack [Po85] also reports a letter from Erdős which poses the more general problem of, given +$n$ points in $\mathbb{R}^d$ with minimum distance $1$, let $g_d(n)$ be maximal such that there +always exist at least $g_d(n)$ many points which have minimum distance $>1$. Is it true that +$g_d(n) \gg n/d$ in general? + +We read this with a constant independent of $d$ and $n$. +-/ +@[category research open, question, AMS 52] +theorem erdos_1066.variants.higher_dim : + ∃ c > (0 : ℝ), ∀ d n : ℕ, 1 ≤ d → c * n / d ≤ (gDim d n : ℝ) := by + sorry + +end Erdos1066 diff --git a/FormalConjectures/ErdosProblems/107.lean b/FormalConjectures/ErdosProblems/107.lean index 92f4552..d9c5299 100644 --- a/FormalConjectures/ErdosProblems/107.lean +++ b/FormalConjectures/ErdosProblems/107.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 107 @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [Wikipedia](https://en.wikipedia.org/wiki/Happy_ending_problem) -/ +@[expose] public section + open Filter open EuclideanGeometry diff --git a/FormalConjectures/ErdosProblems/1074.lean b/FormalConjectures/ErdosProblems/1074.lean index 8911a74..0e3735a 100644 --- a/FormalConjectures/ErdosProblems/1074.lean +++ b/FormalConjectures/ErdosProblems/1074.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1074 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/1074](https://www.erdosproblems.com/1074) -/ +@[expose] public section + namespace Erdos1074 open scoped Nat @@ -53,17 +56,19 @@ $$ \lim\frac{|S\cap[1, x]|}{x} $$ exist? -/ -@[category research open, AMS 11] -theorem erdos_1074.parts.i : answer(sorry) ↔ ∃ c, EHSNumbers.HasDensity c := by +@[category research open, question, AMS 11] +theorem erdos_1074.parts.i : ∃ c, EHSNumbers.HasDensity c := by sorry +def erdos_1074.parts.ii.answer : ℝ := sorry + /-- Let $S$ be the set of all $m\geq 1$ such that there exists a prime $p\not\equiv 1\pmod{m}$ such that $m! + 1 \equiv 0\pmod{p}$. What is $$ \lim\frac{|S\cap[1, x]|}{x}? $$ -/ -@[category research open, AMS 11] -theorem erdos_1074.parts.ii : EHSNumbers.HasDensity answer(sorry) := by +@[category research open, question value, AMS 11] +theorem erdos_1074.parts.ii : EHSNumbers.HasDensity erdos_1074.parts.ii.answer := by sorry /-- Similarly, if $P$ is the set of all primes $p$ such that there exists an $m$ with @@ -72,18 +77,20 @@ $$ \lim\frac{|P\cap[1, x]|}{\pi(x)} $$ exist? -/ -@[category research open, AMS 11] -theorem erdos_1074.parts.iii : answer(sorry) ↔ ∃ c, PillaiPrimes.HasDensity c {p | p.Prime} := by +@[category research open, question, AMS 11] +theorem erdos_1074.parts.iii : ∃ c, PillaiPrimes.HasDensity c {p | p.Prime} := by sorry +def erdos_1074.parts.iv.answer : ℝ := sorry + /-- Similarly, if $P$ is the set of all primes $p$ such that there exists an $m$ with $p\not\equiv 1\pmod{m}$ such that $m! + 1 \equiv 0\pmod{p}$, then what is $$ \lim\frac{|P\cap[1, x]|}{\pi(x)}? $$ -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_1074.parts.iv : - PillaiPrimes.HasDensity answer(sorry) {p | p.Prime} := by + PillaiPrimes.HasDensity erdos_1074.parts.iv.answer {p | p.Prime} := by sorry /-- Pillai [Pi30] raised the question of whether there exist any primes in $P$. This was answered @@ -104,7 +111,7 @@ theorem erdos_1074.variants.EHSNumbers_infinite : EHSNumbers.Infinite := by sorry /-- Erdős, Hardy, and Subbarao proved that $P$ is infinite. -/ -@[category research solved, AMS 11] +@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/anatoliiohorodnyk/lean-fc-proofs/blob/5da9642575b26c2c816a49bcb56b33fed5456619/Proofs/T_Erdos1074_erdos_1074_variants_PillaiPrimes_infinite.lean#L178"] theorem erdos_1074.variants.PillaiPrimes_infinite : PillaiPrimes.Infinite := by sorry @@ -121,9 +128,12 @@ theorem erdos_1074.variants.PillaiPrimes_init : sorry /-- Regarding the first question, Hardy and Subbarao computed all EHS numbers up to $2^{10}$, and -write "...if this trend conditions we expect [the limit] to be around 0.5, if it exists." -/ +write "...if this trend conditions we expect [the limit] to be around 0.5, if it exists. The +frequency with which the EHS numbers occur - most often in long sequences of consecutive integers - +makes us believe that their asymptotic density exists and is unity. Erdős, though initially +hesitant, later agreed with this view." That is, the conjecture is that $S$ has density $1$. -/ @[category research open, AMS 11] -theorem erdos_1074.variants.EHSNumbers_one_half : EHSNumbers.HasDensity (1 / 2) := by +theorem erdos_1074.variants.EHSNumbers_one : EHSNumbers.HasDensity 1 := by sorry end Erdos1074 diff --git a/FormalConjectures/ErdosProblems/1075.lean b/FormalConjectures/ErdosProblems/1075.lean new file mode 100644 index 0000000..c1a204d --- /dev/null +++ b/FormalConjectures/ErdosProblems/1075.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1075 + +*References:* +- [erdosproblems.com/1075](https://www.erdosproblems.com/1075) +- [Er64f] Erdős, P., On extremal problems of graphs and generalized graphs. Israel J. Math. (1964), + 183--190. +-/ + +@[expose] public section + +namespace Erdos1075 + +open Filter Asymptotics + +/-- +Let $r\geq 3$. There exists $c_r>r^{-r}$ such that, for any $\epsilon>0$, if $n$ is sufficiently +large, the following holds. Any $r$-uniform hypergraph on $n$ vertices with at least +$(1+\epsilon)(n/r)^r$ many edges contains a subgraph on $m$ vertices with at least $c_rm^r$ edges, +where $m=m(n)\to \infty$ as $n\to \infty$. +-/ +@[category research open, AMS 5] +theorem erdos_1075 : + ∀ r : ℕ, 3 ≤ r → ∃ c : ℝ, (r : ℝ)⁻¹ ^ r < c ∧ + ∀ ε : ℝ, 0 < ε → ∃ m : ℕ → ℕ, Tendsto m atTop atTop ∧ + ∀ᶠ n : ℕ in atTop, ∀ H : Finset (Finset (Fin n)), + H.IsUniform r → (1 + ε) * ((n : ℝ) / r) ^ r ≤ H.card → + ∃ S : Finset (Fin n), S.card = m n ∧ + c * (S.card : ℝ) ^ r ≤ (H.hypergraphInduce S).card := by + sorry + +end Erdos1075 diff --git a/FormalConjectures/ErdosProblems/1083.lean b/FormalConjectures/ErdosProblems/1083.lean new file mode 100644 index 0000000..25936d4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1083.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1083 + +*References:* +- [erdosproblems.com/1083](https://www.erdosproblems.com/1083) +- [APST04] Aronov, Boris and Pach, János and Sharir, Micha and Tardos, Gábor, *Distinct distances in + three and higher dimensions*. Combin. Probab. Comput. (2004), 283--293. +- [CEGSW90] Clarkson, Kenneth L. and Edelsbrunner, Herbert and Guibas, Leonidas J. and Sharir, Micha + and Welzl, Emo, *Combinatorial complexity bounds for arrangements of curves and spheres*. Discrete + Comput. Geom. (1990), 99--160. +- [Er46b] Erdős, P., *On sets of distances of {$n$} points*. Amer. Math. Monthly (1946), 248--250. +- [SoVu08] Solymosi, József and Vu, Van H., *Near optimal bounds for the {E}rdős distinct distances + problem in high dimensions*. Combinatorica (2008), 113--125. +-/ + +@[expose] public section + +open Filter +open scoped EuclideanGeometry + +namespace Erdos1083 + +/-- +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. Estimate $f_d(n)$ - in particular, is it true that $$f_d(n)=n^{\frac{2}{d}-o(1)}?$$ +-/ +@[category research open, question, AMS 52] +theorem erdos_1083 : + ∀ d : ℕ, 3 ≤ d → ∃ o : ℕ → ℝ, o =o[atTop] (1 : ℕ → ℝ) ∧ + ∀ᶠ n : ℕ in atTop, + (minimalDistinctDistancesIn (ℝ^d) n : ℝ) = (n : ℝ) ^ ((2 : ℝ) / (d : ℝ) - o n) := by + sorry + +end Erdos1083 diff --git a/FormalConjectures/ErdosProblems/1086.lean b/FormalConjectures/ErdosProblems/1086.lean new file mode 100644 index 0000000..5bbae54 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1086.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1086 + +*References:* +- [erdosproblems.com/1086](https://www.erdosproblems.com/1086) +- [ErPu71] Erdős, P. and Purdy, G., *Some extremal problems in geometry*. J. Combinatorial Theory + Ser. A 10 (1971), 246-252. +- [RaSh17] Raz, O. E. and Sharir, M., *The number of unit-area triangles in the plane: theme and + variations*. Combinatorica 37 (2017), 1221-1240. + [arXiv:1501.00379](https://arxiv.org/abs/1501.00379) +-/ + +@[expose] public section + +open Filter Asymptotics +open scoped EuclideanGeometry + +namespace Erdos1086 + +open scoped Classical in +/-- The number of triangles with vertices in `P` and area `a`: the `3`-element subsets of `P` +whose vertices `p, q, r` satisfy `|triangle_area p q r| = a`. -/ +noncomputable def triangleAreaCount (P : Finset ℝ²) (a : ℝ) : ℕ := + ((P.powersetCard 3).filter fun T => + ∃ p q r : ℝ², T = {p, q, r} ∧ |EuclideanGeometry.triangle_area p q r| = a).card + +/-- $g(n)$: the maximum, over all sets of $n$ points in the plane and all areas $a > 0$, of the +number of triangles of area $a$ with vertices in the set. Only positive areas count, since every +collinear triple has area $0$. The set of values is nonempty and bounded by $\binom{n}{3}$, so +`sSup` is a true maximum. -/ +noncomputable def g (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ (P : Finset ℝ²) (a : ℝ), P.card = n ∧ 0 < a ∧ triangleAreaCount P a = m} + +/-- A set of `n` points has at most $\binom{n}{3}$ triangles of any given area. -/ +@[category API, AMS 52] +theorem triangleAreaCount_le (P : Finset ℝ²) (a : ℝ) : + triangleAreaCount P a ≤ P.card.choose 3 := by + classical + unfold triangleAreaCount + exact (Finset.card_filter_le _ _).trans (Finset.card_powersetCard 3 P).le + +/-- A set of points has at most `g n` triangles of any given positive area. -/ +@[category API, AMS 52] +theorem triangleAreaCount_le_g (P : Finset ℝ²) {a : ℝ} (ha : 0 < a) : + triangleAreaCount P a ≤ g P.card := by + refine le_csSup ⟨P.card.choose 3, ?_⟩ ⟨P, a, rfl, ha, rfl⟩ + rintro m ⟨Q, b, hQ, -, rfl⟩ + exact hQ ▸ triangleAreaCount_le Q b + +def erdos_1086.answer : ℕ → ℝ := sorry + +/-- +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. Estimate $g(n)$. + +Only triangles of positive area are counted. +-/ +@[category research open, question value, AMS 52] +theorem erdos_1086 : (fun n : ℕ ↦ (g n : ℝ)) =Θ[atTop] erdos_1086.answer := by + sorry + +/-- +Erdős and Purdy [ErPu71] proved +$$n^2\log\log n \ll g(n) \ll n^{5/2}.$$ + +This is the lower bound. +-/ +@[category research solved, AMS 52] +theorem erdos_1086.variants.erdos_purdy_lower : + (fun n : ℕ ↦ (n : ℝ) ^ 2 * Real.log (Real.log n)) =O[atTop] fun n : ℕ ↦ (g n : ℝ) := by + sorry + +/-- +The upper bound of Erdős and Purdy [ErPu71] has been improved a number of times. The best known +bound is $g(n) \ll n^{20/9}$ by Raz and Sharir [RaSh17]. +-/ +@[category research solved, AMS 52] +theorem erdos_1086.variants.raz_sharir : + (fun n : ℕ ↦ (g n : ℝ)) =O[atTop] fun n : ℕ ↦ (n : ℝ) ^ (20 / 9 : ℝ) := by + sorry + +end Erdos1086 diff --git a/FormalConjectures/ErdosProblems/1087.lean b/FormalConjectures/ErdosProblems/1087.lean new file mode 100644 index 0000000..19faf9d --- /dev/null +++ b/FormalConjectures/ErdosProblems/1087.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1087 + +*References:* +- [erdosproblems.com/1087](https://www.erdosproblems.com/1087) +- [ErPu71] Erdős, P. and Purdy, G., *Some extremal problems in geometry*. J. Combinatorial Theory + Ser. A 10 (1971), 246-252. +-/ + +@[expose] public section + +open Filter Asymptotics +open scoped EuclideanGeometry + +namespace Erdos1087 + +/-- A finite set of points has a repeated distance if two of its pairs of points are the same +distance apart, that is, if it determines fewer distinct distances than it has pairs. -/ +def HasRepeatedDistance (S : Finset ℝ²) : Prop := + distinctDistances S < S.card.choose 2 + +open scoped Classical in +/-- The number of degenerate four-element subsets of `P`, that is, those in which two of the six +pairwise distances are equal. -/ +noncomputable def degenerateCount (P : Finset ℝ²) : ℕ := + ((P.powersetCard 4).filter HasRepeatedDistance).card + +/-- $f(n)$: the maximum, over all sets of $n$ points in the plane, of the number of degenerate +four-element subsets. The set of values is nonempty and bounded by $\binom{n}{4}$, so `sSup` is +a true maximum. -/ +noncomputable def f (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ P : Finset ℝ², P.card = n ∧ degenerateCount P = m} + +/-- A set of `n` points has at most $\binom{n}{4}$ degenerate four-element subsets. -/ +@[category API, AMS 52] +theorem degenerateCount_le (P : Finset ℝ²) : degenerateCount P ≤ P.card.choose 4 := by + classical + unfold degenerateCount + exact (Finset.card_filter_le _ _).trans (Finset.card_powersetCard 4 P).le + +/-- A set of points has at most `f n` degenerate four-element subsets. -/ +@[category API, AMS 52] +theorem degenerateCount_le_f (P : Finset ℝ²) : degenerateCount P ≤ f P.card := by + refine le_csSup ⟨P.card.choose 4, ?_⟩ ⟨P, rfl, rfl⟩ + rintro m ⟨Q, hQ, rfl⟩ + exact hQ ▸ degenerateCount_le Q + +/-- +Let $f(n)$ be minimal such that every set of $n$ points in $\mathbb{R}^2$ contains at most $f(n)$ +many sets of four points which are 'degenerate' in the sense that some pair are the same distance +apart. Estimate $f(n)$ - in particular, is it true that $f(n)\leq n^{3+o(1)}$? + +Here a set of four points is degenerate if two of its six pairwise distances are equal, and +$f(n)\leq n^{3+o(1)}$ is read as $f(n) \ll n^{3+\varepsilon}$ for every $\varepsilon > 0$. +-/ +@[category research open, question, AMS 52] +theorem erdos_1087 : + ∀ ε > (0 : ℝ), (fun n : ℕ ↦ (f n : ℝ)) =O[atTop] fun n : ℕ ↦ (n : ℝ) ^ (3 + ε) := by + sorry + +/-- +Erdős and Purdy [ErPu71] proved +$$n^3\log n \ll f(n) \ll n^{7/2}.$$ + +This is the lower bound. +-/ +@[category research solved, AMS 52] +theorem erdos_1087.variants.lower : + (fun n : ℕ ↦ (n : ℝ) ^ 3 * Real.log n) =O[atTop] fun n : ℕ ↦ (f n : ℝ) := by + sorry + +/-- +Erdős and Purdy [ErPu71] proved +$$n^3\log n \ll f(n) \ll n^{7/2}.$$ + +This is the upper bound. +-/ +@[category research solved, AMS 52] +theorem erdos_1087.variants.upper : + (fun n : ℕ ↦ (f n : ℝ)) =O[atTop] fun n : ℕ ↦ (n : ℝ) ^ (7 / 2 : ℝ) := by + sorry + +end Erdos1087 diff --git a/FormalConjectures/ErdosProblems/1088.lean b/FormalConjectures/ErdosProblems/1088.lean index 6d24fdb..7d4930e 100644 --- a/FormalConjectures/ErdosProblems/1088.lean +++ b/FormalConjectures/ErdosProblems/1088.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1088 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/1088](https://www.erdosproblems.com/1088) -/ +@[expose] public section + open Filter open scoped EuclideanGeometry @@ -66,11 +69,10 @@ as $d \to \infty$? The little-$o$ condition is stated after taking the base-$2$ logarithm. -/ -@[category research open, AMS 51] +@[category research open, question, AMS 51] theorem erdos_1088 : - answer(sorry) ↔ - ∀ n ≥ 3, - (fun d : ℕ ↦ Real.logb 2 (f d n : ℝ)) =o[atTop] (fun d : ℕ ↦ (d : ℝ)) := by + ∀ n ≥ 3, + (fun d : ℕ ↦ Real.logb 2 (f d n : ℝ)) =o[atTop] (fun d : ℕ ↦ (d : ℝ)) := by sorry end Erdos1088 diff --git a/FormalConjectures/ErdosProblems/1093.lean b/FormalConjectures/ErdosProblems/1093.lean index 846eebf..73532ab 100644 --- a/FormalConjectures/ErdosProblems/1093.lean +++ b/FormalConjectures/ErdosProblems/1093.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1093 @@ -22,22 +23,28 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/1093](https://www.erdosproblems.com/1093) -/ +@[expose] public section + namespace Erdos1093 open Finset Nat /-- -If defined, the deficiency is the count of $0 \le i < k$ such that $n - i$ is $k$-smooth. +If defined, the deficiency is the count of $0 \le i < k$ such that $n - i$ is $k$-smooth, +that is, divisible only by primes $\le k$. + +`Nat.smoothNumbers m` is the set of positive naturals all of whose prime factors are +$< m$, so "$k$-smooth" in the sense above is `Nat.smoothNumbers (k + 1)`. -/ noncomputable def deficiency (n k : ℕ) : ℕ := - #{i ∈ range k | n - i ∈ smoothNumbers k} + #{i ∈ range k | n - i ∈ smoothNumbers (k + 1)} /-- Are there infinitely many binomial coefficients with deficiency 1? -/ -@[category research open, AMS 5] +@[category research open, question, AMS 5] theorem erdos_1093.parts.i : - answer(sorry) ↔ {x : ℕ × ℕ | let k := x.1; let n := x.2; 2 * k ≤ n ∧ deficiency n k = 1 ∧ + {x : ℕ × ℕ | let k := x.1; let n := x.2; 2 * k ≤ n ∧ deficiency n k = 1 ∧ ∀ p, p.Prime → (p ∣ choose n k) → k < p}.Infinite := by sorry diff --git a/FormalConjectures/ErdosProblems/1095.lean b/FormalConjectures/ErdosProblems/1095.lean index cf2e26b..58d819c 100644 --- a/FormalConjectures/ErdosProblems/1095.lean +++ b/FormalConjectures/ErdosProblems/1095.lean @@ -52,10 +52,8 @@ theorem erdos_1095.variants.lower_solved : ∃ c > 0, (fun k : ℕ ↦ exp (c * log k ^ 2)) =O[atTop] fun k ↦ (g k : ℝ) := by sorry -/-- -Ecklund, Erdős, and Selfridge [EES74] conjectured $g(k)\leq \exp((1+o(1))k)$. --/ -@[category research open, AMS 11] +/-- Ecklund, Erdős, and Selfridge [EES74] proved $g(k)\leq \exp((1+o(1))k)$. -/ +@[category research solved, AMS 11] theorem erdos_1095.variants.upper_conjecture : ∃ f : ℕ → ℝ, Tendsto f atTop (𝓝 0) ∧ ∀ᶠ k in atTop, g k ≤ exp (k * (1 + f k)) := by sorry @@ -72,7 +70,8 @@ theorem erdos_1095.variants.lower_conjecture : ∃ c > 0, ∀ᶠ k in atTop, g k Sorenson, Sorenson, and Webster [SSWE20] give heuristic evidence that $\log g(k) \asymp \frac{k}{\log k}$. -/ @[category research open, AMS 11] -theorem erdos_1095.variants.log_equivalent : (fun k ↦ log (g k)) ~[atTop] (fun k ↦ k / log k) := by +theorem erdos_1095.variants.log_isTheta : + (fun k ↦ log (g k)) =Θ[atTop] (fun k ↦ k / log k) := by sorry end Erdos1095 diff --git a/FormalConjectures/ErdosProblems/1101.lean b/FormalConjectures/ErdosProblems/1101.lean index 54bcf3c..ba63af8 100644 --- a/FormalConjectures/ErdosProblems/1101.lean +++ b/FormalConjectures/ErdosProblems/1101.lean @@ -53,15 +53,15 @@ def IsGood (u : ℕ → ℕ) : Prop := ∀ k, A u k < x → (A u (k + 1) : ℝ) - A u k < (1 + ε) * (t u x : ℝ) * (∏' i : ℕ, (1 - 1 / (u i : ℝ)))⁻¹ -/-- 1. There is NO good sequence with polynomial growth. -/ +/-- 1. Is there a good sequence with polynomial growth? -/ @[category research open, AMS 11] -theorem erdos_1101.parts.i : - ¬ ∃ u, IsGood u ∧ ∃ k : ℕ, (fun n => (u n : ℝ)) =O[atTop] (fun n => (n : ℝ) ^ k) := by +theorem erdos_1101.parts.i : answer(sorry) ↔ + ∃ u, IsGood u ∧ ∃ k : ℕ, (fun n => (u n : ℝ)) =O[atTop] (fun n => (n : ℝ) ^ k) := by sorry -/-- 2. There is a good sequence with sub-exponential growth. -/ +/-- 2. Is there a good sequence with sub-exponential growth? -/ @[category research open, AMS 11] -theorem erdos_1101.parts.ii : +theorem erdos_1101.parts.ii : answer(sorry) ↔ ∃ u, IsGood u ∧ (fun n => Real.log (u n : ℝ)) =o[atTop] (fun n => (n : ℝ)) := by sorry diff --git a/FormalConjectures/ErdosProblems/1109.lean b/FormalConjectures/ErdosProblems/1109.lean index bcd64d4..34cc64c 100644 --- a/FormalConjectures/ErdosProblems/1109.lean +++ b/FormalConjectures/ErdosProblems/1109.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1109 @@ -31,6 +32,8 @@ import FormalConjecturesUtil (1992), 271--282. -/ +@[expose] public section + open Filter Asymptotics open scoped Pointwise @@ -51,18 +54,18 @@ $f(N)\leq N^{o(1)}$, or even $f(N) \leq (\log N)^{O(1)}$? This theorem formalizes the subpolynomial bound as `f(N) = O(N^ε)` for every `ε > 0`. -/ -@[category research open, AMS 5 11] +@[category research open, question, AMS 5 11] theorem erdos_1109 : - answer(sorry) ↔ ∀ ε > (0 : ℝ), + ∀ ε > (0 : ℝ), (fun N : ℕ => (f N : ℝ)) ≪ fun N : ℕ => (N : ℝ) ^ ε := by sorry /-- Is the stronger polylogarithmic bound $f(N) \leq (\log N)^{O(1)}$ true? -/ -@[category research open, AMS 5 11] +@[category research open, question, AMS 5 11] theorem erdos_1109.variants.polylog : - answer(sorry) ↔ ∃ C > (0 : ℝ), + ∃ C > (0 : ℝ), (fun N : ℕ => (f N : ℝ)) ≪ fun N : ℕ => (Real.log N) ^ C := by sorry diff --git a/FormalConjectures/ErdosProblems/111.lean b/FormalConjectures/ErdosProblems/111.lean new file mode 100644 index 0000000..f70ecff --- /dev/null +++ b/FormalConjectures/ErdosProblems/111.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 111 + +*References:* +- [erdosproblems.com/111](https://www.erdosproblems.com/111) +- [Er81] Erdős, P., On the combinatorial problems which I would most like to see solved. (1981) +- [EHS82] Erdős, P., Hajnal, A., and Szemerédi, E., On almost bipartite large chromatic graphs. + Theory and practice of combinatorics (1982), 117–123. +- [Er87] Erdős, P., Some problems on finite and infinite graphs. (1987) +- [Er90] Erdős, P., Some of my favourite unsolved problems. (1990) +- [Er97d] Erdős, P., Some recent problems and results in graph theory. (1997) +- [Er97f] Erdős, P., Some unsolved problems. (1997) + +See also Erdős Problem [74]. + +## Formalization notes + +- **`bipartiteDistance G`**: the minimum number of edges to delete from a (finite) simple graph $G$ + to make it bipartite. Defined as the infimum over all spanning subgraphs $H \leq G$ with + `H.IsBipartite` of the number of edges in `G.edgeSet \ H.edgeSet`. + +- **`hG G n`**: for a graph $G$ on vertex type $V$, `hG G n` is the supremum over all sets $S$ of + vertices of cardinality $n$ of `bipartiteDistance (G.induce S)`. This matches the problem's + formulation: "any subgraph of $G$ on $n$ vertices can be made bipartite after deleting at most + $h_G(n)$ edges." +-/ + +@[expose] public section + +open Filter Asymptotics Cardinal SimpleGraph Set + +namespace Erdos111 + +/-- The **bipartite distance** of a finite simple graph `G`: the minimum number of edges +that must be deleted from `G` to make it bipartite. + +Formally, this is the infimum of `Set.ncard (G.edgeSet \ H.edgeSet)` over all spanning +subgraphs `H ≤ G` (as relations on the same vertex set) such that `H` is bipartite. -/ +noncomputable def bipartiteDistance {V : Type*} (G : SimpleGraph V) : ℕ := + sInf {k : ℕ | ∃ H : SimpleGraph V, H ≤ G ∧ H.IsBipartite ∧ + Set.ncard (G.edgeSet \ H.edgeSet) = k} + +/-- The function $h_G(n)$: for a graph $G$ on vertex type $V$, `hG G n` is the supremum over +all sets $S \subseteq V$ with $|S| = n$ of the bipartite distance of the induced subgraph on $S$. + +This captures the problem's notion: "any subgraph of $G$ on $n$ vertices can be made bipartite +after deleting at most $h_G(n)$ edges." -/ +noncomputable def hG {V : Type*} (G : SimpleGraph V) (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ S : Set V, S.ncard = n ∧ bipartiteDistance (G.induce S) = k} + +/- ## Main open problem -/ + +/-- +**Erdős Problem 111** (Erdős, Hajnal, Szemerédi [EHS82]): + +If $G$ is a graph with chromatic number $\aleph_1$, is it true that $h_G(n)/n \to \infty$? + +Formally: for every graph $G$ (on a type $V$) with chromatic cardinal $\aleph_1$, the ratio +$h_G(n)/n$ tends to infinity: for every constant $C$, all sufficiently large $n$ satisfy +$h_G(n) > C \cdot n$. +-/ +@[category research open, question, AMS 5] +theorem erdos_111 : + ∀ (V : Type) (G : SimpleGraph V), G.chromaticCardinal = ℵ_ 1 → + Filter.Tendsto (fun n : ℕ => (hG G n : ℝ) / n) Filter.atTop Filter.atTop := by + sorry + +/- ## Variants and known partial results -/ + +/-- +**Linear lower bound (ZFC, [EHS82])**: Every graph $G$ with chromatic number $\aleph_1$ has +$h_G(n) \geq c \cdot n$ for some positive constant $c > 0$ and all sufficiently large $n$ +(i.e., the *linear* lower bound $h_G(n) \gg n$ is known). + +This follows from the fact that every graph with uncountable chromatic number contains +$\aleph_1$ vertex-disjoint odd cycles of some fixed odd length $\ell$: any induced subgraph +on $n$ vertices containing $\gg n / \ell$ such cycles requires removing $\gg n$ edges to +become bipartite. + +This is a *strictly weaker* statement than the headline `erdos_111`, which asks for +$h_G(n)/n \to \infty$ (i.e., $h_G(n)$ grows *super-linearly* — the constant `c` could be +taken arbitrarily large for a fixed graph $G$). Whether the linear lower bound can be +improved to super-linear remains the open question. +-/ +@[category research solved, AMS 5] +theorem erdos_111.variants.lower_bound : + ∀ (V : Type) (G : SimpleGraph V), G.chromaticCardinal = ℵ_ 1 → + ∃ c : ℝ, 0 < c ∧ + ∀ᶠ n : ℕ in Filter.atTop, c * n ≤ hG G n := by + sorry + +/-- +**Upper bound existence (Erdős-Hajnal-Szemerédi [EHS82])**: There exists a graph $G$ with +chromatic number $\aleph_1$ such that $h_G(n) \ll n^{3/2}$, i.e., there is a constant $C > 0$ +with $h_G(n) \leq C \cdot n^{3/2}$ for all $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_111.variants.upper_bound_existence : + ∃ (V : Type) (G : SimpleGraph V), G.chromaticCardinal = ℵ_ 1 ∧ + (fun n : ℕ => (hG G n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ) ^ (3 / 2 : ℝ)) := by + sorry + +/-- +Erdős conjectured [Er81] that for every $\varepsilon > 0$ there is a graph $G$ with +$\chi(G) = \aleph_1$ such that $h_G(n) \ll n^{1+\varepsilon}$. +The graph is chosen after $\varepsilon$. +-/ +@[category research open, AMS 5] +theorem erdos_111.variants.erdos_conjecture : + ∀ ε : ℝ, 0 < ε → ∃ (V : Type) (G : SimpleGraph V), + G.chromaticCardinal = ℵ_ 1 ∧ + (fun n : ℕ => (hG G n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ) ^ (1 + ε)) := by + sorry + +end Erdos111 diff --git a/FormalConjectures/ErdosProblems/1110.lean b/FormalConjectures/ErdosProblems/1110.lean index b707b76..fc1b001 100644 --- a/FormalConjectures/ErdosProblems/1110.lean +++ b/FormalConjectures/ErdosProblems/1110.lean @@ -13,9 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil -import FormalConjectures.ErdosProblems.«246» +public import FormalConjecturesUtil +public import FormalConjectures.ErdosProblems.«246» /-! # Erdős Problem 1110 @@ -23,6 +24,8 @@ import FormalConjectures.ErdosProblems.«246» *Reference:* [Erdős Problem 1110](https://www.erdosproblems.com/1110) -/ +@[expose] public section + namespace Erdos1110 /-- @@ -40,13 +43,15 @@ Let $p>q\geq 2$ be two coprime integers. We call $n$ representable if it is the integers of the form $p^kq^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? +numbers? Are there infinitely many coprime non-representable numbers, that is, an infinite +family of pairwise coprime non-representable integers? -/ -@[category research open, AMS 5 11] +@[category research open, question, AMS 5 11] theorem erdos_1110 : - answer(sorry) ↔ ∀ (p q : ℕ), q < p → 2 ≤ q → + ∀ (p q : ℕ), q < p → 2 ≤ q → Nat.Coprime p q → ¬(p = 3 ∧ q = 2) → - Set.Infinite {n : ℕ | Nat.Coprime n (p * q) ∧ ¬Representable p q n} := by + ∃ A : Set ℕ, A.Infinite ∧ A.Pairwise Nat.Coprime ∧ + ∀ n ∈ A, ¬Representable p q n := by sorry end Erdos1110 diff --git a/FormalConjectures/ErdosProblems/1111.lean b/FormalConjectures/ErdosProblems/1111.lean new file mode 100644 index 0000000..de06f6b --- /dev/null +++ b/FormalConjectures/ErdosProblems/1111.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1111 + +*References:* +- [erdosproblems.com/1111](https://www.erdosproblems.com/1111) +- [ElEr85] El-Zahar, M. and Erdős, P., *On the existence of two non-neighboring subgraphs in a + graph*. Combinatorica 5 (1985), 295-300. +- [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. [arXiv:2303.13449](https://arxiv.org/abs/2303.13449) +- [Wa80b] Wagon, S., *A bound on the chromatic number of graphs without certain induced + subgraphs*. J. Combin. Theory Ser. B 29 (1980), 345-346. +-/ + +@[expose] public section + +namespace Erdos1111 + +/-- Two sets `A` and `B` of vertices of `G` are *anticomplete* if they are disjoint and `G` has +no edge between `A` and `B`. -/ +def Anticomplete {V : Type*} (G : SimpleGraph V) (A B : Set V) : Prop := + Disjoint A B ∧ ∀ a ∈ A, ∀ b ∈ B, ¬ G.Adj a b + +/-- Anticomplete sets stay anticomplete when the two sets are swapped. -/ +@[category API, AMS 5] +theorem Anticomplete.symm {V : Type*} {G : SimpleGraph V} {A B : Set V} + (h : Anticomplete G A B) : Anticomplete G B A := by + obtain ⟨hd, h⟩ := h + exact ⟨hd.symm, fun b hb a ha hba ↦ h a ha b hb hba.symm⟩ + +/-- +If $G$ is a finite graph and $A,B$ are disjoint sets of vertices then we call $A,B$ anticomplete +if there are no edges between $A$ and $B$. + +If $t,c\geq 1$ then there exists $d\geq 1$ such that if $\chi(G)\geq d$ and $\omega(G)0$, and if $f(p)$ does not have very large values (in a certain technical sense). + +See also `erdos_491`. +-/ +@[category research open, question, AMS 11] +theorem erdos_1122 : ∀ f : ℕ → ℝ, + (∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) → + {n | 1 ≤ n ∧ f (n + 1) < f n}.HasDensity 0 → + ∃ c : ℝ, ∀ n > 0, f n = c * Real.log n := by + sorry + +/-- +Erdős [Er46] proved that $f(n)=c\log n$ for some $c\in\mathbb{R}$ if $A$ is empty, that is, if +$f(n) \leq f(n+1)$ for all $n \geq 1$. +-/ +@[category research solved, AMS 11] +theorem erdos_1122.variants.monotone (f : ℕ → ℝ) + (hf : ∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) + (hmono : ∀ n ≥ 1, f n ≤ f (n + 1)) : + ∃ c : ℝ, ∀ n > 0, f n = c * Real.log n := by + sorry + +/-- +Erdős [Er46] proved that $f(n)=c\log n$ for some $c\in\mathbb{R}$ if $f(n+1)-f(n)=o(1)$. +-/ +@[category research solved, AMS 11] +theorem erdos_1122.variants.sub_tendsto_zero (f : ℕ → ℝ) + (hf : ∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) + (hdiff : Tendsto (fun n ↦ f (n + 1) - f n) atTop (𝓝 0)) : + ∃ c : ℝ, ∀ n > 0, f n = c * Real.log n := by + sorry + +/-- +For $c \geq 0$ the function $c \log n$ is additive and $A$ is empty, so it satisfies the +hypotheses of `erdos_1122`. +-/ +@[category test, AMS 11] +theorem const_mul_log (c : ℝ) (hc : 0 ≤ c) (f : ℕ → ℝ) (hf : ∀ n, f n = c * Real.log n) : + (∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) ∧ + {n | 1 ≤ n ∧ f (n + 1) < f n}.HasDensity 0 := by + refine ⟨fun a ha b hb _ ↦ ?_, ?_⟩ + · simp only [hf, Nat.cast_mul] + rw [Real.log_mul (by positivity) (by positivity), mul_add] + · convert Set.HasDensity.empty + refine Set.eq_empty_of_forall_notMem fun n ⟨hn, hlt⟩ ↦ hlt.not_ge ?_ + simp only [hf] + gcongr + simp + +end Erdos1122 diff --git a/FormalConjectures/ErdosProblems/1139.lean b/FormalConjectures/ErdosProblems/1139.lean index 1ce0967..d76d12e 100644 --- a/FormalConjectures/ErdosProblems/1139.lean +++ b/FormalConjectures/ErdosProblems/1139.lean @@ -13,14 +13,17 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1139 *Reference:* [erdosproblems.com/1139](https://www.erdosproblems.com/1139) -/ +@[expose] public section + open Nat Filter open scoped ArithmeticFunction.Omega open scoped Topology @@ -31,11 +34,10 @@ namespace Erdos1139 Let $1\leq u_1 < u_2 < \cdots$ be the sequence of integers with at most $2$ prime factors. Is it true that $$\limsup_{k \to \infty} \frac{u_{k+1}-u_k}{\log k}=\infty?$$ -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1139 : - answer(sorry) ↔ - letI u := Nat.nth (fun n ↦ 0 < n ∧ Ω n ≤ 2) - atTop.limsup (fun k : ℕ ↦ (((u (k + 1) : ℝ) - (u k : ℝ)) / Real.log (↑k + 1) : EReal)) = ⊤ := by + letI u := Nat.nth (fun n ↦ 0 < n ∧ Ω n ≤ 2) + atTop.limsup (fun k : ℕ ↦ (((u (k + 1) : ℝ) - (u k : ℝ)) / Real.log (↑k + 1) : EReal)) = ⊤ := by sorry end Erdos1139 diff --git a/FormalConjectures/ErdosProblems/114.lean b/FormalConjectures/ErdosProblems/114.lean new file mode 100644 index 0000000..238b2b5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/114.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 114 + +*References:* +- [erdosproblems.com/114](https://www.erdosproblems.com/114) +- [EHP58] Erdős, P., Herzog, F. and Piranian, G., *Metric properties of polynomials*. + J. Analyse Math. (1958), 125-148. +- [ErHa99] Eremenko, A. and Hayman, W., *On the length of lemniscates*. Michigan Math. J. (1999), + 409-415. [arXiv:0805.2295](https://arxiv.org/abs/0805.2295) +- [Ta25] Tao, T., *The maximal length of the Erdős–Herzog–Piranian lemniscate in high degree* + (2025). [arXiv:2512.12455](https://arxiv.org/abs/2512.12455) +-/ + +@[expose] public section + +open Polynomial MeasureTheory Filter + +namespace Erdos114 + +/-- The lemniscate $\{z \in \mathbb{C} : \lvert p(z)\rvert = 1\}$ of a complex polynomial $p$. -/ +def lemniscate (p : ℂ[X]) : Set ℂ := {z | ‖p.eval z‖ = 1} + +/-- The length of the lemniscate of $p$, as its one-dimensional Hausdorff measure. -/ +noncomputable def lemniscateLength (p : ℂ[X]) : ENNReal := μH[1] (lemniscate p) + +/-- +If $p(z) \in \mathbb{C}[z]$ is a monic polynomial of degree $n$, is the length of the curve +$\{z \in \mathbb{C} : \lvert p(z)\rvert = 1\}$ maximised when $p(z) = z^n - 1$? + +We require $n \geq 1$. For $n = 0$ the only monic polynomial is $1$, whose level set is all of +$\mathbb{C}$, while $z^0 - 1 = 0$ has an empty level set. +-/ +@[category research open, question, AMS 28 30] +theorem erdos_114 : + ∀ n : ℕ, 1 ≤ n → ∀ p : ℂ[X], p.Monic → p.natDegree = n → + lemniscateLength p ≤ lemniscateLength (X ^ n - 1) := by + sorry + +/-- +Tao [Ta25] proved that $z^n - 1$ maximises the length of the lemniscate for all sufficiently +large $n$. +-/ +@[category research solved, AMS 28 30] +theorem erdos_114.variants.large_n : ∀ᶠ n in atTop, ∀ p : ℂ[X], p.Monic → p.natDegree = n → + lemniscateLength p ≤ lemniscateLength (X ^ n - 1) := by + sorry + +/-- Eremenko and Hayman [ErHa99] proved the case $n = 2$. -/ +@[category research solved, AMS 28 30] +theorem erdos_114.variants.two (p : ℂ[X]) (hp : p.Monic) (hdeg : p.natDegree = 2) : + lemniscateLength p ≤ lemniscateLength (X ^ 2 - 1) := by + sorry + +/-- +The case $n = 1$. A monic linear polynomial is $z - a$. Its lemniscate is a translate of the +lemniscate of $z - 1$, and translations preserve Hausdorff measure. +-/ +@[category textbook, AMS 28 30] +theorem erdos_114.variants.one (p : ℂ[X]) (hp : p.Monic) (hdeg : p.natDegree = 1) : + lemniscateLength p ≤ lemniscateLength (X ^ 1 - 1) := by + have hpe : p = X + C (p.coeff 0) := by + have := hp.as_sum + rw [hdeg] at this + simpa [Finset.sum_range_one] using this + have hset : lemniscate p = + (IsometryEquiv.addRight (1 + p.coeff 0)) ⁻¹' lemniscate (X ^ 1 - 1) := by + ext z + rw [hpe] + simp [lemniscate] + ring_nf + rw [lemniscateLength, lemniscateLength, hset, IsometryEquiv.hausdorffMeasure_preimage] + +end Erdos114 diff --git a/FormalConjectures/ErdosProblems/1145.lean b/FormalConjectures/ErdosProblems/1145.lean index 3cf6a2e..d57dd85 100644 --- a/FormalConjectures/ErdosProblems/1145.lean +++ b/FormalConjectures/ErdosProblems/1145.lean @@ -13,9 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil -import FormalConjectures.ErdosProblems.«28» +public import FormalConjecturesUtil +public import FormalConjectures.ErdosProblems.«28» /-! # Erdős Problem 1145 @@ -25,6 +26,8 @@ import FormalConjectures.ErdosProblems.«28» - [erdosproblems.com/1145](https://www.erdosproblems.com/1145) -/ +@[expose] public section + open Set Filter Pointwise Topology AdditiveCombinatorics namespace Erdos1145 @@ -58,8 +61,8 @@ $\limsup 1_A\ast 1_B(n)=\infty$? A conjecture of Erdős and Sárközy. -/ -@[category research open, AMS 5] -theorem erdos_1145 : answer(sorry) ↔ Erdos1145Prop := by +@[category research open, question, AMS 5] +theorem erdos_1145 : Erdos1145Prop := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/1146.lean b/FormalConjectures/ErdosProblems/1146.lean index e9ad5b3..82485e1 100644 --- a/FormalConjectures/ErdosProblems/1146.lean +++ b/FormalConjectures/ErdosProblems/1146.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1146 @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [Ru99] Ruzsa, I., Erdős and the Integers. Journal of Number Theory (1999), 115-163. -/ +@[expose] public section + open scoped Pointwise namespace Erdos1146 @@ -47,9 +50,9 @@ In [Ru99] Ruzsa states "The simplest set with a chance to be an essential compon collection of numbers in the form $2^m3^n$ and Erdős often asked whether it is an essential component or not; I do not even have a plausible guess." -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1146 : - answer(sorry) ↔ IsEssentialComponent { k | ∃ m n : ℕ, k = 2 ^ m * 3 ^ n } := by + IsEssentialComponent { k | ∃ m n : ℕ, k = 2 ^ m * 3 ^ n } := by sorry end Erdos1146 diff --git a/FormalConjectures/ErdosProblems/1154.lean b/FormalConjectures/ErdosProblems/1154.lean new file mode 100644 index 0000000..8fe9811 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1154.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1154 + +*References:* +- [erdosproblems.com/1154](https://www.erdosproblems.com/1154) +- [ErVo66] Erdős, Paul and Volkmann, Bodo, Additive Gruppen mit vorgegebener Hausdorffscher + Dimension. J. Reine Angew. Math. (1966), 203--208. +- [EdMi01] Edgar, G. A. and Miller, Chris, Hausdorff dimension, analytic sets and transcendence. + Real Anal. Exchange (2001/02), 335--339. +- [EdMi03] Edgar, G. A. and Miller, Chris, Borel subrings of the reals. Proc. Amer. Math. Soc. + (2003), 1121--1129. +- [Ma16b] Mauldin, R. Daniel, Subfields of ℝ with arbitrary Hausdorff dimension. Math. + Proc. Cambridge Philos. Soc. (2016), 157--165. + +-/ + +@[expose] public section + +open scoped ENNReal Cardinal +open Set MeasureTheory + +namespace Erdos1154 + +/-- +Does there exist, for every $\alpha \in [0, 1]$, a ring in $\mathbb{R}$ with Hausdorff dimension +$\alpha$? +-/ +@[category research open, question, AMS 28] +theorem erdos_1154.parts.i : + ∀ a ∈ Icc (0 : ℝ≥0∞) 1, ∃ R : Subring ℝ, dimH (R : Set ℝ) = a := by + sorry + +/-- +Does there exist, for every $\alpha \in [0, 1]$, a field in $\mathbb{R}$ with Hausdorff dimension +$\alpha$? +-/ +@[category research open, question, AMS 28] +theorem erdos_1154.parts.ii : + ∀ a ∈ Icc (0 : ℝ≥0∞) 1, ∃ R : Subfield ℝ, dimH (R : Set ℝ) = a := by + sorry + +/-- +For every $\alpha \in [0, 1]$, there exists an additive group in $\mathbb{R}$ with Hausdorff +dimension $\alpha$. This is proved in [ErVo66]. +-/ +@[category research solved, AMS 28] +theorem erdos_1154.variants.group {a : ℝ≥0∞} (ha : a ∈ Icc 0 1) : + ∃ R : AddSubgroup ℝ, dimH (R : Set ℝ) = a := by + sorry + +/-- +If a subring is analytic, then it is either equal to $\mathbb{R}$ or its Hausdorff dimension is +equal to $0$. This is proved in [EdMi03], superseding the earlier result of [EdMi01] that a real +closed analytic subfield of $\mathbb{R}$ has Hausdorff dimension $0$ or $1$. +-/ +@[category research solved, AMS 28] +theorem erdos_1154.variants.analytic_ring {R : Subring ℝ} (hR : AnalyticSet (R : Set ℝ)) : + R = ⊤ ∨ dimH (R : Set ℝ) = 0 := by + sorry + +/-- +Assume the continuum hypothesis, then for every $\alpha \in [0, 1]$, there exists a field in +$\mathbb{R}$ with Hausdorff dimension $\alpha$. This is proved in [Ma16b]. +-/ +@[category research solved, AMS 28] +theorem erdos_1154.variants.continuumHypothesis_field {a : ℝ≥0∞} (ha : a ∈ Icc 0 1) + [Fact (ℵ₁ = 𝔠)] : + ∃ R : Subfield ℝ, dimH (R : Set ℝ) = a := by + sorry + +/-- The endpoint $\alpha = 0$ of `erdos_1154.parts.ii` is witnessed by $\mathbb{Q}$. -/ +@[category test, AMS 28] +theorem erdos_1154.variants.exists_subfield_dimH_eq_zero : + ∃ R : Subfield ℝ, dimH (R : Set ℝ) = 0 := by + refine ⟨⊥, Set.Countable.dimH_zero <| (countable_range ((↑) : ℚ → ℝ)).mono ?_⟩ + simpa using SetLike.coe_subset_coe.2 (bot_le : ⊥ ≤ (Rat.castHom ℝ).fieldRange) + +/-- The endpoint $\alpha = 1$ of `erdos_1154.parts.ii` is witnessed by $\mathbb{R}$. -/ +@[category test, AMS 28] +theorem erdos_1154.variants.exists_subfield_dimH_eq_one : + ∃ R : Subfield ℝ, dimH (R : Set ℝ) = 1 := by + refine ⟨⊤, ?_⟩ + rw [Subfield.coe_top] + exact Real.dimH_univ + +end Erdos1154 diff --git a/FormalConjectures/ErdosProblems/1157.lean b/FormalConjectures/ErdosProblems/1157.lean new file mode 100644 index 0000000..e0d7ce3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1157.lean @@ -0,0 +1,48 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1157 + +*References:* +- [erdosproblems.com/1157](https://www.erdosproblems.com/1157) +- [BES73] Brown, W. G. and Erdős, P. and S\'os, V. T., Some extremal problems on {$r$}-graphs. + (1973), 53--63. +-/ + +@[expose] public section + +namespace Erdos1157 + +open Filter Asymptotics + +def erdos_1157.answer : ℕ → ℕ → ℕ → ℕ → ℕ := sorry + +/-- +Let $s,k,r\geq 2$. Let $\mathcal{F}$ be the family of all $r$-uniform hypergraphs with $k$ vertices +and $s$ edges. Determine +$$\mathrm{ex}_r(n,\mathcal{F}).$$ +-/ +@[category research open, question value, AMS 5] +theorem erdos_1157 : + ∀ r k s : ℕ, 2 ≤ r → 2 ≤ k → 2 ≤ s → ∀ n : ℕ, + Hypergraph.configurationExtremalNumber n r k s = erdos_1157.answer n r k s := by + sorry + +end Erdos1157 diff --git a/FormalConjectures/ErdosProblems/1158.lean b/FormalConjectures/ErdosProblems/1158.lean new file mode 100644 index 0000000..1920aae --- /dev/null +++ b/FormalConjectures/ErdosProblems/1158.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1158 + +*References:* +- [erdosproblems.com/1158](https://www.erdosproblems.com/1158) +- [Er64f] Erdős, P., On extremal problems of graphs and generalized graphs. Israel J. Math. (1964), + 183--190. +-/ + +@[expose] public section + +namespace Erdos1158 + +open Filter Asymptotics + +/-- +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\geq 2$? The restriction $r\geq 2$ excludes forbidding a single edge. +-/ +@[category research open, question, AMS 5] +theorem erdos_1158 : + ∀ t r : ℕ, 2 ≤ t → 2 ≤ r → + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, + (n : ℝ) ^ ((t : ℝ) - (r : ℝ) ^ (1 - (t : ℝ)) - ε) ≤ + (Hypergraph.partiteExtremalNumber n t r : ℝ) := by + sorry + +end Erdos1158 diff --git a/FormalConjectures/ErdosProblems/1159.lean b/FormalConjectures/ErdosProblems/1159.lean new file mode 100644 index 0000000..f93b45e --- /dev/null +++ b/FormalConjectures/ErdosProblems/1159.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1159 + +*References:* +- [erdosproblems.com/1159](https://www.erdosproblems.com/1159) +- [ESS83] Erdős, P. and Silverman, R. and Stein, A., *Intersection properties of families containing + sets of nearly the same size*. Ars Combin. (1983), 247--259. +- [Er81] Erdős, P., *On the combinatorial problems which I would most like to see solved*. + Combinatorica (1981), 25-42. +-/ + +@[expose] public section + +open Configuration + +namespace Erdos1159 + +/-- +Determine whether there exists a constant $C>1$ such that the following holds. + +Let $P$ be a finite [projective plane](https://en.wikipedia.org/wiki/Projective_plane). Must there exist a set of points $S$ such that $1\leq \lvert S\cap \ell\rvert \leq C$ for all lines $\ell$? +-/ +@[category research open, question, AMS 5 51] +theorem erdos_1159 : + ∃ C : ℕ, 1 < C ∧ + ∀ (P L : Type) (_ : Membership P L) (_ : Fintype P) (_ : Fintype L), + ∀ _ : ProjectivePlane P L, ∃ S : Set P, ∀ l : L, + 1 ≤ (S ∩ {p : P | p ∈ l}).ncard ∧ (S ∩ {p : P | p ∈ l}).ncard ≤ C := by + sorry + +end Erdos1159 diff --git a/FormalConjectures/ErdosProblems/1162.lean b/FormalConjectures/ErdosProblems/1162.lean new file mode 100644 index 0000000..48a0b74 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1162.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1162 + +*References:* +- [erdosproblems.com/1162](https://www.erdosproblems.com/1162) +- [Va99] Various, *Some of Paul's favorite problems*. Booklet produced for the conference + "Paul Erdős and his mathematics", Budapest, July 1999 (1999). +- [Py93] Pyber, L., *Asymptotic results for permutation groups*. Groups and computation + (New Brunswick, NJ, 1991), DIMACS Ser. Discrete Math. Theoret. Comput. Sci. 11 (1993), + 197-219. +- [RoTr25] Roney-Dougal, C. M. and Tracey, G., *Subgroups of symmetric groups: enumeration and + asymptotic properties*. [arXiv:2503.05416](https://arxiv.org/abs/2503.05416) (2025). +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos1162 + +/-- `f n` is the number of subgroups of the symmetric group $S_n$, realised as +`Equiv.Perm (Fin n)`. All subgroups are counted, not only conjugacy classes. -/ +noncomputable def f (n : ℕ) : ℕ := Nat.card (Subgroup (Equiv.Perm (Fin n))) + +/-- `f n` is positive. In particular `Real.log (f n)` is not the junk value `Real.log 0`. -/ +@[category API, AMS 5 20] +theorem f_pos (n : ℕ) : 0 < f n := by + unfold f + exact Nat.card_pos + +def erdos_1162.answer : ℕ → ℝ := sorry + +/-- +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]. We state the first question: `erdos_1162.answer` is a +function asymptotically equivalent to the number $f(n)$ of subgroups of $S_n$ (an explicit +formula is intended, not $f$ itself). The second question is too vague to state. +-/ +@[category research open, question value, AMS 5 20] +theorem erdos_1162 : + (fun n : ℕ ↦ (f n : ℝ)) ~[atTop] erdos_1162.answer := by + sorry + +/-- +Pyber [Py93] proved that +$$\log f(n)\asymp n^2.$$ +-/ +@[category research solved, AMS 5 20] +theorem erdos_1162.variants.pyber : + (fun n : ℕ ↦ Real.log (f n : ℝ)) =Θ[atTop] fun n : ℕ ↦ (n : ℝ) ^ 2 := by + sorry + +/-- +Roney-Dougal and Tracey [RoTr25] have proved that +$$\log f(n)=\left(\frac{1}{16}+o(1)\right)n^2.$$ +Here $\log$ is the logarithm to base $2$, as in [RoTr25]. +-/ +@[category research solved, AMS 5 20] +theorem erdos_1162.variants.roney_dougal_tracey : + (fun n : ℕ ↦ Real.logb 2 (f n : ℝ)) ~[atTop] fun n : ℕ ↦ (n : ℝ) ^ 2 / 16 := by + sorry + +/-- +Roney-Dougal and Tracey [RoTr25, Theorem 1] proved that there are absolute constants +$\alpha>0$ and $\beta$ such that for all integers $n>1$ +$$2^{n^2/16+\alpha n\log n}\leq f(n)\leq 2^{n^2/16+\beta n^{3/2}},$$ +where $\log$ is the logarithm to base $2$. This implies the previous variant. +-/ +@[category research solved, AMS 5 20] +theorem erdos_1162.variants.roney_dougal_tracey_bounds : + ∃ α > (0 : ℝ), ∃ β : ℝ, ∀ n : ℕ, 1 < n → + (2 : ℝ) ^ ((n : ℝ) ^ 2 / 16 + α * n * Real.logb 2 n) ≤ f n ∧ + (f n : ℝ) ≤ (2 : ℝ) ^ ((n : ℝ) ^ 2 / 16 + β * (n : ℝ) ^ ((3 : ℝ) / 2)) := by + sorry + +end Erdos1162 diff --git a/FormalConjectures/ErdosProblems/1167.lean b/FormalConjectures/ErdosProblems/1167.lean index c81f108..adbf727 100644 --- a/FormalConjectures/ErdosProblems/1167.lean +++ b/FormalConjectures/ErdosProblems/1167.lean @@ -13,20 +13,30 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1167 -*Reference:* [erdosproblems.com/1167](https://www.erdosproblems.com/1167) +*References:* +- [erdosproblems.com/1167](https://www.erdosproblems.com/1167) +- [EHMR84] P. Erdős, A. Hajnal, A. Máté and R. Rado, *Combinatorial set theory: partition + relations for cardinals*. Studies in Logic and the Foundations of Mathematics 106, + North-Holland (1984). The original Erdős–Hajnal problem list gives the additional conditions $\gamma \geq 2$, $r < \omega$, and $\kappa_\alpha > r$. Without $\gamma \geq 2$, the statement is false: taking $\gamma = 1$ and $\kappa_0 = \aleph_1$ with $\lambda = \aleph_0$ gives a counterexample, since the partition relation with one color degenerates to a cardinality comparison (see `erdos_1167.unrestricted_is_false`). +Without $\kappa_\alpha > r$ it is also false: with $r = 2$, $\lambda = \aleph_0$ and targets +$(2, \aleph_1)$, the premise $2^{\aleph_0} \to (3, \aleph_1)^3$ holds, but a constant colouring +of the pairs of $\aleph_0$ has neither a red pair nor a blue set of size $\aleph_1$. -/ +@[expose] public section + open Cardinal Ordinal Combinatorics namespace Erdos1167 @@ -35,7 +45,7 @@ universe u /-- **Erdős Problem 1167.** Let $r \geq 2$ be finite, $\gamma \geq 2$, and $\lambda$ be an infinite -cardinal. Let $\kappa_\alpha$ be cardinals for all $\alpha < \gamma$. Is it true +cardinal. Let $\kappa_\alpha > r$ be cardinals for all $\alpha < \gamma$. Is it true that $$2^\lambda \to (\kappa_\alpha + 1)_{\alpha < \gamma}^{r+1}$$ implies @@ -45,12 +55,12 @@ if $\kappa_\alpha$ is infinite. A problem of Erdős, Hajnal, and Rado. -/ -@[category research open, AMS 5] -theorem erdos_1167 : answer(sorry) ↔ +@[category research open, question, AMS 5] +theorem erdos_1167 : ∀ (r : ℕ), 2 ≤ r → ∀ (lam : Cardinal.{u}), ℵ₀ ≤ lam → ∀ (γ : Ordinal.{u}), 2 ≤ γ → - ∀ (κ : γ.ToType → Cardinal.{u}), + ∀ (κ : γ.ToType → Cardinal.{u}), (∀ α, (r : Cardinal.{u}) < κ α) → cardinalPartitionRel ((2 : Cardinal.{u}) ^ lam) (r + 1) γ (fun α => κ α + 1) → cardinalPartitionRel lam r γ κ := by sorry @@ -60,8 +70,14 @@ namespace erdos_1167.variants /-- **Finite-target case.** When all $\kappa_\alpha$ are finite, $\kappa_\alpha + 1$ is the ordinary natural-number successor. Special case of `erdos_1167`. + +This case was proved by Erdős, Hajnal, Máté and Rado [EHMR84], using the Erdős–Rado tree +argument and the negative stepping-up lemma. The statement omits the condition $n_\alpha > r$. +This is harmless, since a colouring that witnesses +$\lambda \not\to (n_\alpha)^r_{\alpha < \gamma}$ can only use colours $\alpha$ with $n_\alpha > r$. -/ -@[category research open, AMS 5] +@[category research solved, AMS 5, formal_proof using lean4 at + "https://github.com/mnn31/erdos-lean/blob/5cb725981b3ad137103ef908eb6ecff9e7ed9bdf/ErdosLean/Erdos1167.lean#L990"] theorem finite_targets (r : ℕ) (hr : 2 ≤ r) (lam : Cardinal.{u}) (hlam : ℵ₀ ≤ lam) (γ : Ordinal.{u}) (hγ : 2 ≤ γ) (n : γ.ToType → ℕ) : cardinalPartitionRel ((2 : Cardinal.{u}) ^ lam) (r + 1) γ @@ -74,7 +90,7 @@ theorem finite_targets (r : ℕ) (hr : 2 ≤ r) (lam : Cardinal.{u}) (hlam : ℵ -/ @[category research open, AMS 5] theorem binary_colors (r : ℕ) (hr : 2 ≤ r) (lam : Cardinal.{u}) (hlam : ℵ₀ ≤ lam) - (κ : (2 : Ordinal.{u}).ToType → Cardinal.{u}) : + (κ : (2 : Ordinal.{u}).ToType → Cardinal.{u}) (hκ : ∀ α, (r : Cardinal.{u}) < κ α) : cardinalPartitionRel ((2 : Cardinal.{u}) ^ lam) (r + 1) 2 (fun α => κ α + 1) → cardinalPartitionRel lam r 2 κ := by sorry @@ -105,7 +121,8 @@ Erdős–Rado stepping-up/down theorem for pairs. -/ @[category research open, AMS 5] theorem r_eq_two (lam : Cardinal.{u}) (hlam : ℵ₀ ≤ lam) - (γ : Ordinal.{u}) (hγ : 2 ≤ γ) (κ : γ.ToType → Cardinal.{u}) : + (γ : Ordinal.{u}) (hγ : 2 ≤ γ) (κ : γ.ToType → Cardinal.{u}) + (hκ : ∀ α, (2 : Cardinal.{u}) < κ α) : cardinalPartitionRel ((2 : Cardinal.{u}) ^ lam) 3 γ (fun α => κ α + 1) → cardinalPartitionRel lam 2 γ κ := by sorry diff --git a/FormalConjectures/ErdosProblems/1168.lean b/FormalConjectures/ErdosProblems/1168.lean new file mode 100644 index 0000000..e4e0b3d --- /dev/null +++ b/FormalConjectures/ErdosProblems/1168.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1168 + +*References:* +* [erdosproblems.com/1168](https://www.erdosproblems.com/1168) +* [EHR65] Erdős, P., Hajnal, A. and Rado, R., *Partition relations for cardinal numbers*. + Acta Math. Acad. Sci. Hungar. (1965), pp. 93–196. +-/ + +@[expose] public section + +open Cardinal Ordinal SimpleGraph + +namespace Erdos1168 + +/-- +**Erdős Problem 1168.** Prove that +$$\aleph_{\omega+1} \not\to (\aleph_{\omega+1}, \underbrace{3, 3, \ldots}_{\aleph_0})^2_{\aleph_0}$$ +without assuming the generalized continuum hypothesis. + +A problem of Erdős, Hajnal, and Rado [EHR65]: the negative arrow is known under GCH; +the open problem asks for a ZFC proof. Here `ω = Ordinal.omega0`, so `ℵ_ (ω + 1)` is +the successor cardinal of the singular `ℵ_ω`. +-/ +@[category research open, AMS 5] +theorem erdos_1168 : ¬ CardinalCountableColorRamsey (ℵ_ (ω + 1)) := by + sorry + +namespace erdos_1168.variants + +/-- +**Erdős–Hajnal–Rado theorem under GCH** [EHR65]: the negative partition relation +$\aleph_{\omega+1} \not\to (\aleph_{\omega+1}, 3, 3, \ldots)^2_{\aleph_0}$ holds +assuming GCH. +-/ +@[category research solved, AMS 5] +theorem under_GCH (hGCH : GCH) : ¬ CardinalCountableColorRamsey (ℵ_ (ω + 1)) := by + sorry + +/-- `ℵ_{ω+1}` is strictly greater than `ℵ₀`. -/ +@[category test, AMS 5] +example : ℵ₀ < ℵ_ (ω + 1) := by + rw [← aleph_zero] + apply aleph_lt_aleph.mpr + exact omega0_pos.trans_le le_self_add + +/-- `ℵ_ω < ℵ_{ω+1}`: the cardinal `ℵ_{ω+1}` is the successor of the singular `ℵ_ω`. -/ +@[category test, AMS 5] +example : ℵ_ ω < ℵ_ (ω + 1) := by + exact aleph_lt_aleph.mpr (lt_add_one ω) + +/-- **GCH implies `2^(ℵ_ω) = ℵ_{ω+1}`** — the arithmetic fact used in the +Erdős–Hajnal–Rado [EHR65] proof. Direct from the Jech-style formulation of GCH. -/ +@[category test, AMS 5] +theorem GCH_implies_power_aleph_omega (hGCH : GCH) : + (2 : Cardinal.{0}) ^ ℵ_ ω = ℵ_ (ω + 1) := by + have h := hGCH ω + rwa [show Order.succ (ω : Ordinal.{0}) = ω + 1 from (Order.succ_eq_add_one ω)] at h + +/-- `ℵ_{ω+1} = Order.succ (ℵ_ω)`: a structural fact used in partition calculus. -/ +@[category test, AMS 5] +theorem aleph_omega_succ_is_successor : ℵ_ (ω + 1) = Order.succ (ℵ_ ω) := by + exact (succ_aleph ω).symm + +end erdos_1168.variants + +end Erdos1168 diff --git a/FormalConjectures/ErdosProblems/1169.lean b/FormalConjectures/ErdosProblems/1169.lean new file mode 100644 index 0000000..12bc01f --- /dev/null +++ b/FormalConjectures/ErdosProblems/1169.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1169 + +*Reference:* [erdosproblems.com/1169](https://www.erdosproblems.com/1169) + +*References:* +- [Ha71] Hajnal, A. *A negative partition relation.* Proc. Nat. Acad. Sci. U.S.A. 68 (1971), + pp. 142–144. +-/ + +@[expose] public section + +open Cardinal Ordinal +open scoped Cardinal + +namespace Erdos1169 + +universe u + +/- ### The main open problem -/ + +/-- +Is it true that $\omega_1^2 \not\to (\omega_1^2, 3)^2$? + +A problem of Erdős and Hajnal. Hajnal [Ha71] proved this assuming the continuum hypothesis. +The source's displayed relation has blue target $3$; its introductory $k$ does not occur +in that relation. See also [erdosproblems.com/592](https://www.erdosproblems.com/592). +-/ +@[category research open, question, AMS 3] +theorem erdos_1169 : + ¬ OrdinalRamsey ((ω_ 1) ^ (2 : ℕ)) ((ω_ 1) ^ (2 : ℕ)) (3 : Ordinal) := by + sorry + +/- ### Variants and known results -/ + +namespace erdos_1169.variants + +/-- +The finite-blue-target form asks whether $\omega_1^2 \not\to (\omega_1^2, k)^2$ +for every $k \ge 3$. The restriction excludes $k \le 2$, where the positive relation holds. +A colouring witnessing the negative relation with blue target $3$ also witnesses this form. +-/ +@[category research open, question, AMS 3] +theorem finite_blue_target : + ∀ k : ℕ, 3 ≤ k → + ¬ OrdinalRamsey ((ω_ 1) ^ (2 : ℕ)) ((ω_ 1) ^ (2 : ℕ)) (k : Ordinal) := by + sorry + +/-- +**Hajnal (1971), assuming CH.** Under the Continuum Hypothesis, +$\omega_1^2 \not\to (\omega_1^2, k)^2$ holds for every finite $k \ge 3$. +-/ +@[category research solved, AMS 3] +theorem hajnal_under_ch (hCH : 𝔠 = ℵ_ 1) : + ∀ k : ℕ, 3 ≤ k → ¬ OrdinalRamsey ((ω_ 1) ^ (2 : ℕ)) ((ω_ 1) ^ (2 : ℕ)) (k : Ordinal) := by + sorry + +end erdos_1169.variants + +/- ### Sanity checks -/ + +/-- **Monotonicity in the blue side.** If the ordinal Ramsey relation holds with blue +target $\gamma$, it holds with any smaller blue target $\gamma' \le \gamma$. -/ +@[category test, AMS 3] +theorem ordinalRamsey_mono_blue {α β γ γ' : Ordinal.{u}} + (h : OrdinalRamsey α β γ) (hγ : γ' ≤ γ) : + OrdinalRamsey α β γ' := by + intro red blue hCompl + obtain (⟨s, hred, htype⟩ | ⟨s, hblue, htype⟩) := h red blue hCompl + · exact Or.inl ⟨s, hred, htype⟩ + · -- s has type γ; find a sub-clique of type γ' ≤ γ. + rw [← Ordinal.type_toType γ'] at hγ + obtain ⟨g⟩ := Ordinal.type_le_iff'.mp (htype ▸ hγ) + let t : Set α.ToType := Set.range (Subtype.val ∘ g) + refine Or.inr ⟨t, ?_, ?_⟩ + · -- t is a blue clique + rintro _ ⟨a, rfl⟩ _ ⟨b, rfl⟩ hne + apply hblue (g a).2 (g b).2 + intro h + apply hne + simp [h] + · -- typeLT t = γ' + let emb : (· < · : γ'.ToType → γ'.ToType → Prop) ↪r (· < · : ↑t → ↑t → Prop) := + { toFun := fun a => ⟨(g a).val, a, rfl⟩ + inj' := fun a b heq => + g.injective (Subtype.ext (congr_arg (fun x : ↑t => x.val) heq)) + map_rel_iff' := g.map_rel_iff } + have hsurj : Function.Surjective emb := + fun ⟨_, hy⟩ => ⟨hy.choose, Subtype.ext hy.choose_spec⟩ + exact (Ordinal.type_eq.mpr ⟨RelIso.ofSurjective emb hsurj |>.symm⟩).trans + (Ordinal.type_toType γ') + +end Erdos1169 diff --git a/FormalConjectures/ErdosProblems/1171.lean b/FormalConjectures/ErdosProblems/1171.lean new file mode 100644 index 0000000..7c47765 --- /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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1171 + +*Reference:* [erdosproblems.com/1171](https://www.erdosproblems.com/1171) +-/ + +@[expose] public section + +open Cardinal Ordinal SimpleGraph + +namespace Erdos1171 + +/-- +**Erdős Problem 1171.** Is it true that for all finite $k < \omega$, +$$\omega_1^2 \to (\omega_1 \cdot \omega, \underbrace{3, \ldots, 3}_{k})^2_{k+1}?$$ + +In any $(k+1)$-coloring of the pairs of the complete graph on $\omega_1^2$, either +there is a color-0 set of order type $\omega_1 \cdot \omega$, or there is a +monochromatic triangle $K_3$ in some non-zero color. The case $k = 1$ +(`erdos_1171.variants.k_one`) is the Erdős–Hajnal theorem [EH74]. +-/ +@[category research open, question, AMS 5] +theorem erdos_1171 : + ∀ k : ℕ, OrdinalMultiColorRamsey (ω_ 1 ^ 2) (ω_ 1 * ω) 3 k := by + sorry + +namespace erdos_1171.variants + +/-- +**Erdős–Hajnal theorem** [EH74]: the case $k = 1$, +$\omega_1^2 \to (\omega_1 \cdot \omega, 3)^2$. +-/ +@[category research solved, AMS 5] +theorem k_one : OrdinalMultiColorRamsey (ω_ 1 ^ 2) (ω_ 1 * ω) 3 1 := by + sorry + +/-- +`OrdinalMultiColorRamsey` is monotone in the number of non-zero colors: +a witness for the `k`-color version yields one for any `j ≤ k`. +-/ +@[category API, AMS 5] +theorem mono_k {j k : ℕ} (hjk : j ≤ k) + (hk : OrdinalMultiColorRamsey (ω_ 1 ^ 2) (ω_ 1 * ω) 3 k) : + OrdinalMultiColorRamsey (ω_ 1 ^ 2) (ω_ 1 * ω) 3 j := by + sorry + +/- **Baumgartner under MA (currently deferred)** [Ba89b]: assuming a form of Martin's +Axiom, the binary partition relation `ω₁·ω → (ω₁·ω, 3)²` holds. We omit the Lean +statement for now because faithfully encoding the exact form of MA requires more work; +stating the result as `True → ...` would effectively make it unconditional. To be +restored once an appropriate MA predicate is available in the formalization. -/ + +end erdos_1171.variants + +end Erdos1171 diff --git a/FormalConjectures/ErdosProblems/1173.lean b/FormalConjectures/ErdosProblems/1173.lean new file mode 100644 index 0000000..d52baa9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1173.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1173 + +*Reference:* [erdosproblems.com/1173](https://www.erdosproblems.com/1173) +-/ + +@[expose] public section + +open Cardinal Ordinal + +open scoped Cardinal Ordinal + +namespace Erdos1173 + +/-- The **set mapping condition** for `f : ω_{ω+1} → 𝒫(ω_{ω+1})`: +self-avoidance (`α ∉ f α`), image bound (`#(f α) ≤ ℵ_ω`), and almost-disjoint +images (`#(f α ∩ f β) < ℵ_ω` for `α ≠ β`). -/ +def IsSetMapping (f : (ω_ (ω + 1)).ToType → Set (ω_ (ω + 1)).ToType) : Prop := + (∀ α : (ω_ (ω + 1)).ToType, α ∉ f α) ∧ + (∀ α : (ω_ (ω + 1)).ToType, #(f α) ≤ ℵ_ ω) ∧ + (∀ α β : (ω_ (ω + 1)).ToType, α ≠ β → #(f α ∩ f β : Set (ω_ (ω + 1)).ToType) < ℵ_ ω) + +/-- A set `Y ⊆ ω_{ω+1}` is **free** for `f` if for all distinct `α, β ∈ Y`, +`β ∉ f α`. -/ +def IsFreeSet (f : (ω_ (ω + 1)).ToType → Set (ω_ (ω + 1)).ToType) + (Y : Set (ω_ (ω + 1)).ToType) : Prop := + ∀ α ∈ Y, ∀ β ∈ Y, α ≠ β → β ∉ f α + +/-- +**Erdős–Hajnal Problem 1173** [EH74]. Assume GCH. 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}$? +-/ +@[category research open, question, AMS 3] +theorem erdos_1173 : + GCH → + ∀ f : (ω_ (ω + 1)).ToType → Set (ω_ (ω + 1)).ToType, + IsSetMapping f → + ∃ Y : Set (ω_ (ω + 1)).ToType, IsFreeSet f Y ∧ #Y = ℵ_ (ω + 1) := by + sorry + +/-- The initial ordinal `ω_{ω+1}` has cardinality `ℵ_{ω+1}`. -/ +@[category test, AMS 3] +theorem erdos_1173.sanity.card_domain : + #(ω_ (ω + 1)).ToType = ℵ_ (ω + 1) := by + rw [mk_toType, Ordinal.card_omega] + +/-- `ℵ_ω < ℵ_{ω+1}`: free-set size is strictly above the image-bound, making +the problem non-trivial. -/ +@[category test, AMS 3] +theorem erdos_1173.sanity.aleph_omega_lt_succ : ℵ_ ω < ℵ_ (ω + 1) := by + exact Cardinal.aleph_lt_aleph.mpr (Order.lt_succ ω) + +/-- The empty set is always free for any `f`. -/ +@[category test, AMS 3] +theorem erdos_1173.sanity.empty_is_free + (f : (ω_ (ω + 1)).ToType → Set (ω_ (ω + 1)).ToType) : + IsFreeSet f ∅ := by + intro _ hα + simp at hα + +/-- A singleton `{α}` is always free for any `f` (the `α ≠ β` premise is vacuous). -/ +@[category test, AMS 3] +theorem erdos_1173.sanity.singleton_is_free + (f : (ω_ (ω + 1)).ToType → Set (ω_ (ω + 1)).ToType) + (α : (ω_ (ω + 1)).ToType) : + IsFreeSet f {α} := by + intro a ha b hb hab + simp only [Set.mem_singleton_iff] at ha hb + exact absurd (ha ▸ hb ▸ rfl) hab + +/-- Free sets are downward-closed under inclusion. -/ +@[category textbook, AMS 3] +theorem erdos_1173.variants.free_set_mono + (f : (ω_ (ω + 1)).ToType → Set (ω_ (ω + 1)).ToType) + {Y Z : Set (ω_ (ω + 1)).ToType} + (hYZ : Z ⊆ Y) (hY : IsFreeSet f Y) : IsFreeSet f Z := by + intro α hα β hβ hne + exact hY α (hYZ hα) β (hYZ hβ) hne + +/-- Under `IsSetMapping f`, each image has cardinality `< ℵ_{ω+1}`. -/ +@[category textbook, AMS 3] +theorem erdos_1173.variants.image_lt_aleph_succ + (f : (ω_ (ω + 1)).ToType → Set (ω_ (ω + 1)).ToType) + (hf : IsSetMapping f) + (α : (ω_ (ω + 1)).ToType) : + #(f α) < ℵ_ (ω + 1) := by + exact (hf.2.1 α).trans_lt (Cardinal.aleph_lt_aleph.mpr (Order.lt_succ ω)) + +end Erdos1173 diff --git a/FormalConjectures/ErdosProblems/1174.lean b/FormalConjectures/ErdosProblems/1174.lean new file mode 100644 index 0000000..e7a3b79 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1174.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1174 + +*References:* +- [erdosproblems.com/1174](https://www.erdosproblems.com/1174) +- [Va99] Various, *Some of Paul's favorite problems*. Booklet produced for the conference + "Paul Erdős and his mathematics", Budapest, July 1999 (1999), problem 7.91. +-/ + +@[expose] public section + +open Cardinal +open scoped Cardinal + +namespace Erdos1174 + +/-- +**Erdős Problem 1174, part (i)** [Va99, 7.91]. A problem of Erdős and Hajnal: +does there exist a graph $G$ with no $K_4$ such that every edge colouring of $G$ +with countably many colours contains a monochromatic $K_3$? + +For simplicity the colourings are given on all unordered pairs $\operatorname{Sym}_2(V)$; +only the values on the edges of $G$ matter, since a monochromatic triangle is witnessed by +edges alone. + +Shelah proved that a graph with this property can consistently exist, so the +problem is not disprovable in ZFC; whether such a graph exists outright remains open. +-/ +@[category research open, question, AMS 3 5] +theorem erdos_1174.parts.i : + ∃ (V : Type) (G : SimpleGraph V), G.CliqueFree 4 ∧ + ∀ c : Sym2 V → ℕ, ∃ x y z : V, + G.Adj x y ∧ G.Adj y z ∧ G.Adj x z ∧ + c s(x, y) = c s(y, z) ∧ c s(y, z) = c s(x, z) := by + sorry + +/-- +**Erdős Problem 1174, part (ii)** [Va99, 7.91]. A problem of Erdős and Hajnal: +does there exist a graph $G$ with no $K_{\aleph_1}$ (that is, every clique of $G$ +is countable) such that every edge colouring of $G$ with countably many colours +contains a monochromatic $K_{\aleph_0}$ (an infinite clique all of whose edges +receive the same colour)? + +For simplicity the colourings are given on all unordered pairs $\operatorname{Sym}_2(V)$; +only the values on the edges of $G$ matter. + +Shelah proved that a graph with this property can consistently exist, so the +problem is not disprovable in ZFC; whether such a graph exists outright remains open. +-/ +@[category research open, question, AMS 3 5] +theorem erdos_1174.parts.ii : + ∃ (V : Type) (G : SimpleGraph V), + (∀ S : Set V, G.IsClique S → #S ≤ ℵ₀) ∧ + ∀ c : Sym2 V → ℕ, ∃ S : Set V, G.IsClique S ∧ S.Infinite ∧ + ∃ k : ℕ, ∀ x ∈ S, ∀ y ∈ S, x ≠ y → c s(x, y) = k := by + sorry + +/- +**Shelah's consistency result.** Shelah proved that a graph with either property — +a $K_4$-free graph forcing a monochromatic $K_3$ in every countable edge colouring, +or a $K_{\aleph_1}$-free graph forcing a monochromatic $K_{\aleph_0}$ — can +*consistently* exist (i.e. in some model of ZFC). Hence neither question above can +be answered negatively in ZFC: the problem is "not disprovable". Formalizing the +consistency statement itself is out of scope here, since it cannot be stated in +plain ZFC (cf. the prose remark on Larson's MA result in Erdős Problem 601). +-/ + +/- ### Sanity checks -/ + +/-- The complete graph on $\mathbb{N}$ is *not* $K_4$-free, so it is not a candidate +for part (i). -/ +@[category test, AMS 5] +theorem top_not_cliqueFree_four : ¬ (⊤ : SimpleGraph ℕ).CliqueFree 4 := + SimpleGraph.IsContained.not_cliqueFree + ⟨SimpleGraph.Embedding.toCopy (⟨Fin.valEmbedding, by simp [Fin.val_injective.ne_iff]⟩ : + SimpleGraph.completeGraph (Fin 4) ↪g (⊤ : SimpleGraph ℕ))⟩ + +/-- The empty graph on $\mathbb{N}$ is trivially $K_4$-free but fails the colouring +property of part (i): it has no triangles at all, so the $K_4$-free condition alone +is not enough. -/ +@[category test, AMS 5] +theorem bot_fails_colouring_property : + ¬ ∀ c : Sym2 ℕ → ℕ, ∃ x y z : ℕ, + (⊥ : SimpleGraph ℕ).Adj x y ∧ (⊥ : SimpleGraph ℕ).Adj y z ∧ + (⊥ : SimpleGraph ℕ).Adj x z ∧ + c s(x, y) = c s(y, z) ∧ c s(y, z) = c s(x, z) := by + simp + +end Erdos1174 diff --git a/FormalConjectures/ErdosProblems/1176.lean b/FormalConjectures/ErdosProblems/1176.lean index 9d8e709..d25bc7e 100644 --- a/FormalConjectures/ErdosProblems/1176.lean +++ b/FormalConjectures/ErdosProblems/1176.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1176 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/1176](https://www.erdosproblems.com/1176) -/ +@[expose] public section + open Cardinal namespace Erdos1176 @@ -33,9 +36,9 @@ exists a vertex colour containing all edge colours? A problem of Erdős, Galvin, and Hajnal. The consistency of this was proved by Hajnal and Komjáth. -/ -@[category research open, AMS 3 5] +@[category research open, question, AMS 3 5] theorem erdos_1176 : - answer(sorry) ↔ ∀ {V : Type*} (G : SimpleGraph V), G.chromaticCardinal = aleph 1 → + ∀ {V : Type*} (G : SimpleGraph V), G.chromaticCardinal = aleph 1 → ∃ (EColor : Type) (_ : mk EColor = aleph 1) (c_edge : G.edgeSet → EColor), ∀ (VColor : Type) (_ : mk VColor ≤ aleph 0) (c_vert : V → VColor), ∃ (vc : VColor), diff --git a/FormalConjectures/ErdosProblems/1178.lean b/FormalConjectures/ErdosProblems/1178.lean new file mode 100644 index 0000000..46205e4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1178.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1178 + +*References:* +- [erdosproblems.com/1178](https://www.erdosproblems.com/1178) +- [BES73] Brown, W. G. and Erdős, P. and S\'os, V. T., Some extremal problems on {$r$}-graphs. + (1973), 53--63. +- [CGLS23] Conlon, David and Gishboliner, Lior and Levanzov, Yevgeny and Shapira, Asaf, A new bound + for the {B}rown-{E}rd\H os-S\'os problem. J. Combin. Theory Ser. B (2023), 1--35. +- [EFR86] Erdős, P. and Frankl, P. and Rödl, V., The asymptotic number of graphs not containing a + fixed subgraph and a problem for hypergraphs having no exponent. Graphs Combin. (1986), 113-121. +- [Er75b] Erdős, Paul, Problems and results in combinatorial number theory. Journ\'{e}es + Arithm\'{e}tiques de Bordeaux (Conf., Univ. Bordeaux, Bordeaux, 1974) (1975), 295-310. +- [RuSz78] Ruzsa, I. Z. and Szemer\'{e}di, E., Triple systems with no six points carrying three + triangles. Combinatorics (Proc. Fifth Hungarian Colloq., Keszthely, 1976), Vol. II (1978), 939-945. +- [SaSe05] Sárk\"ozy, Gábor N. and Selkow, Stanley, An extension of the {R}uzsa-Szemer\'edi theorem + . Combinatorica (2005), 77--84. +- [SoSo17] Solymosi, David and Solymosi, Jozsef, Small cores in 3-uniform hypergraphs. J. Combin. + Theory Ser. B (2017), 897--910. +-/ + +@[expose] public section + +namespace Erdos1178 + +open Filter Asymptotics + +/-- +For $r\geq 3$ let $d_r(e)$ be the minimal $d$ such that +$$\mathrm{ex}_r(n,\mathcal{F})=o(n^2),$$ +where $\mathcal{F}$ is the family of $r$-uniform hypergraphs on $d$ vertices with $e$ edges. Prove +that +$$d_r(e)=(r-2)e+3$$ +for all $r,e\geq 3$. +-/ +@[category research open, AMS 5] +theorem erdos_1178 : + ∀ r e : ℕ, 3 ≤ r → 3 ≤ e → + Hypergraph.sparseConfigurationThreshold r e = (((r - 2) * e + 3 : ℕ) : ℕ∞) := by + sorry + +end Erdos1178 diff --git a/FormalConjectures/ErdosProblems/1180.lean b/FormalConjectures/ErdosProblems/1180.lean new file mode 100644 index 0000000..3646edf --- /dev/null +++ b/FormalConjectures/ErdosProblems/1180.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1180 + +*References:* +- [erdosproblems.com/1180](https://www.erdosproblems.com/1180) +- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number + theory*. Monographies de L'Enseignement Mathematique (1980). +- [Sh02] Shparlinski, Igor E., *On a question of Erdős and Graham*. Arch. Math. (Basel) (2002), + 445-448. +- [Gl06] Glibichuk, A. A., *Combinatorial properties of sets of residues modulo a prime and the + Erdős-Graham problem*. Mat. Zametki (2006), 384-395. +- [PALOMAR-2026-10-12-000005](https://palomar-registry.org/entry.html?id=PALOMAR-2026-10-12-000005&version=1) +-/ + +@[expose] public section + +open Filter + +namespace Erdos1180 + +/-- +`Represents ε p a s` says that the multiset `s` of denominators `n` with `1 ≤ n ≤ p^ε` and +`n` coprime to `p` has `∑ n⁻¹ = a` in `ZMod p`. +-/ +def Represents (ε : ℝ) (p : ℕ) (a : ZMod p) (s : Multiset ℕ) : Prop := + (∀ n ∈ s, 1 ≤ n ∧ (n : ℝ) ≤ (p : ℝ) ^ ε ∧ n.Coprime p) ∧ + (s.map fun n : ℕ ↦ (n : ZMod p)⁻¹).sum = a + +/-- +`C ε` is the least `C` such that, for all primes `p`, every residue modulo `p` is the sum of at +most `C` elements of `{n⁻¹ : 1 ≤ n ≤ p^ε}` (or `0` if no such `C` exists). +-/ +noncomputable def C (ε : ℝ) : ℕ := + sInf {C | ∀ p : ℕ, p.Prime → ∀ a : ZMod p, ∃ s : Multiset ℕ, s.card ≤ C ∧ Represents ε p a s} + +/-- +Let $\epsilon>0$. Does there exist a constant $C_\epsilon$ such that, for all primes $p$, every +residue modulo $p$ is the sum of at most $C_\epsilon$ many elements of +$$\{ n^{-1} : 1\leq n\leq p^\epsilon\}$$ +where $n^{-1}$ denotes the inverse of $n$ modulo $p$? + +The original question was answered in the affirmative by Shparlinski [Sh02], who proved that +$\ll \epsilon^{-3}$ summands suffice for all sufficiently large primes. This was improved to +$\ll \epsilon^{-2}$ by Glibichuk [Gl06]. It is trivial that at least $\gg \epsilon^{-1}$ +summands are required, and it may be that $C_\epsilon\leq \epsilon^{-1-o(1)}$ is possible. + +See also [540](https://www.erdosproblems.com/540). +-/ +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos1180.lean#L1249"] +theorem erdos_1180 : ∀ ε : ℝ, 0 < ε → ∃ C : ℕ, ∀ p : ℕ, p.Prime → ∀ a : ZMod p, + ∃ s : Multiset ℕ, s.card ≤ C ∧ Represents ε p a s := by + sorry + +/-- +Shparlinski [Sh02] proved that $\ll \epsilon^{-3}$ summands suffice for every residue modulo +every sufficiently large prime, where the threshold on $p$ may depend on $\epsilon$. No bound +polynomial in $\epsilon^{-1}$ can hold for all primes, since when $p^\epsilon < 2$ the only +admissible denominator is $1$. +-/ +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/ba96303b34a95ac458958c1eb0bbdee54733484a/erdos-1180/Solution.lean#L89"] +theorem erdos_1180.variants.shparlinski : ∃ K : ℝ, ∀ ε : ℝ, 0 < ε → ε ≤ 1 → + ∃ P : ℕ, ∀ p : ℕ, P ≤ p → p.Prime → ∀ a : ZMod p, + ∃ s : Multiset ℕ, (s.card : ℝ) ≤ K * ε⁻¹ ^ 3 ∧ Represents ε p a s := by + sorry + +/-- +Glibichuk [Gl06] improved the bound to $\ll \epsilon^{-2}$ summands, again for every +sufficiently large prime. +-/ +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/ba96303b34a95ac458958c1eb0bbdee54733484a/erdos-1180/Solution.lean#L83"] +theorem erdos_1180.variants.glibichuk : ∃ K : ℝ, ∀ ε : ℝ, 0 < ε → ε ≤ 1 → + ∃ P : ℕ, ∀ p : ℕ, P ≤ p → p.Prime → ∀ a : ZMod p, + ∃ s : Multiset ℕ, (s.card : ℝ) ≤ K * ε⁻¹ ^ 2 ∧ Represents ε p a s := by + sorry + +/-- It is trivial that at least $\gg \epsilon^{-1}$ summands are required. -/ +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/ba96303b34a95ac458958c1eb0bbdee54733484a/erdos-1180/Solution.lean#L95"] +theorem erdos_1180.variants.lower_bound : ∃ K : ℝ, 0 < K ∧ ∀ ε : ℝ, 0 < ε → ε ≤ 1 → + K * ε⁻¹ ≤ C ε := by + sorry + +/-- +Is $C_\epsilon\leq \epsilon^{-1-o(1)}$? Here $C_\epsilon$ is the number of summands needed for +every sufficiently large prime, as in `erdos_1180.variants.shparlinski` and +`erdos_1180.variants.glibichuk`. For all primes no such bound holds, since when $p^\epsilon < 2$ +the only admissible denominator is $1$. +-/ +@[category research open, question, AMS 11] +theorem erdos_1180.variants.optimal : ∀ δ : ℝ, 0 < δ → + ∀ᶠ ε : ℝ in nhdsWithin 0 (Set.Ioi 0), ∃ P : ℕ, ∀ p : ℕ, P ≤ p → p.Prime → ∀ a : ZMod p, + ∃ s : Multiset ℕ, (s.card : ℝ) ≤ ε⁻¹ ^ (1 + δ) ∧ Represents ε p a s := by + sorry + +end Erdos1180 diff --git a/FormalConjectures/ErdosProblems/1186.lean b/FormalConjectures/ErdosProblems/1186.lean new file mode 100644 index 0000000..de48b59 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1186.lean @@ -0,0 +1,133 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1186 + +*References:* +- [erdosproblems.com/1186](https://www.erdosproblems.com/1186) +- [Er80] Erdős, Paul, *A survey of problems in combinatorial number theory*. Ann. Discrete Math. + (1980), 89-115. [PDF](https://www.renyi.hu/~p_erdos/1980-03.pdf) +- [PRS08] Parrilo, Pablo A. and Robertson, Aaron and Saracino, Dan, *On the asymptotic minimum + number of monochromatic 3-term arithmetic progressions*. J. Combin. Theory Ser. A (2008), + 185-192. [arXiv:math/0609532](https://arxiv.org/abs/math/0609532) +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos1186 + +/-- +`monoCount k n c` is the number of monochromatic $k$-term arithmetic progressions in +$\{1,\ldots,n\}$ under the $2$-colouring `c`. The progression $a, a+d, \ldots, a+(k-1)d$ with first +term $a$ and common difference $d \geq 1$ is the pair `(a, d)`, with $a \geq 1$ and +$a + (k-1)d \leq n$. Each progression is counted once. + +This is the count of [Er80, p. 93]: there are $\sim n^2/(2(k-1))$ progressions, and the upper bound +in (7) there is their number times the probability $2^{1-k}$ that a random colouring makes one of +them monochromatic. The definition is meant for $k \geq 2$. +-/ +def monoCount (k n : ℕ) (c : ℕ → Bool) : ℕ := + ((Finset.Icc 1 n ×ˢ Finset.Icc 1 n).filter fun p : ℕ × ℕ => + p.1 + (k - 1) * p.2 ≤ n ∧ ∀ i < k, c (p.1 + i * p.2) = c p.1).card + +/-- +`minMonoCount k n` is the least number of monochromatic $k$-term arithmetic progressions in a +$2$-colouring of $\{1,\ldots,n\}$. This is $A(n;k)$ in [Er80, p. 93]. The set of values contains +`monoCount k n (fun _ => true)`, so `sInf` is a true minimum. +-/ +noncomputable def minMonoCount (k n : ℕ) : ℕ := + sInf {m : ℕ | ∃ c : ℕ → Bool, monoCount k n c = m} + +/-- +`δ k` is the largest constant $\delta_k$ such that every $2$-colouring of $\{1,\ldots,n\}$ has at +least $(\delta_k - o(1))n^2$ monochromatic $k$-term arithmetic progressions, that is, +$\liminf_{n\to\infty} A(n;k)/n^2$. + +The quotient `minMonoCount k n / n ^ 2` lies in $[0,1]$, so this `liminf` is not a junk value. +Convergence of the quotient is not assumed. If it converges, `δ k` is its limit. +-/ +noncomputable def δ (k : ℕ) : ℝ := + atTop.liminf (fun n : ℕ ↦ (minMonoCount k n : ℝ) / (n : ℝ) ^ 2) + +/-- Any $2$-colouring gives an upper bound for `minMonoCount`. -/ +@[category API, AMS 5] +theorem minMonoCount_le (k n : ℕ) (c : ℕ → Bool) : minMonoCount k n ≤ monoCount k n c := + Nat.sInf_le ⟨c, rfl⟩ + +/-- In $\{1,\ldots,5\}$ the $3$-term progressions are $\{a,a+1,a+2\}$ for $a \in \{1,2,3\}$ and +$\{1,3,5\}$. -/ +@[category test, AMS 5] +theorem monoCount_three_five : monoCount 3 5 (fun _ => true) = 4 := by + decide + +def erdos_1186.answer : ℕ → ℝ := sorry + +/-- +Let $\delta_k$ be such that in any $2$-colouring of $\{1,\ldots,n\}$ there exist at least +$(\delta_k+o(1))n^2$ many monochromatic $k$-term arithmetic progressions. Give reasonable bounds +(or even an asymptotic formula) for $\delta_k$. + +We read "reasonable bounds" as determining the order of magnitude of $\delta_k$ as $k \to \infty$. +-/ +@[category research open, question value, AMS 5 11] +theorem erdos_1186 : δ =Θ[atTop] erdos_1186.answer := by + sorry + +/-- +Van der Waerden's theorem implies $\delta_k\gg_k 1$. + +For fixed $k$ this says $\delta_k > 0$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1186.variants.van_der_waerden (k : ℕ) (hk : 2 ≤ k) : 0 < δ k := by + sorry + +/-- +The probabilistic method implies +$$\delta_k \leq \frac{1}{(k-1)2^{k}}.$$ +-/ +@[category research solved, AMS 5 11] +theorem erdos_1186.variants.probabilistic (k : ℕ) (hk : 2 ≤ k) : + δ k ≤ 1 / (((k : ℝ) - 1) * 2 ^ k) := by + sorry + +/-- +Parrilo, Robertson, and Saracino [PRS08] have proved +$$0.0511\approx \frac{1675}{32768}\leq \delta_3 \leq \frac{117}{2192}\approx 0.0533,$$ +and conjectured the upper bound is correct. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1186.variants.prs_bounds : 1675 / 32768 ≤ δ 3 ∧ δ 3 ≤ 117 / 2192 := by + sorry + +/-- +Parrilo, Robertson, and Saracino [PRS08] have proved +$$0.0511\approx \frac{1675}{32768}\leq \delta_3 \leq \frac{117}{2192}\approx 0.0533,$$ +and conjectured the upper bound is correct. + +This is the conjecture $\delta_3 = \frac{117}{2192}$. +-/ +@[category research open, AMS 5 11] +theorem erdos_1186.variants.prs_conjecture : δ 3 = 117 / 2192 := by + sorry + +end Erdos1186 diff --git a/FormalConjectures/ErdosProblems/1189.lean b/FormalConjectures/ErdosProblems/1189.lean new file mode 100644 index 0000000..b55fe42 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1189.lean @@ -0,0 +1,198 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1189 + +*References:* +- [erdosproblems.com/1189](https://www.erdosproblems.com/1189) +- [Er80] Erdős, P., *A survey of problems in combinatorial number theory*. Ann. Discrete Math. 6 + (1980), 89-115. [PDF](https://www.renyi.hu/~p_erdos/1980-03.pdf) +- [Si85] Simpson, R. J., *Regular coverings of the integers by arithmetic progressions*. Acta Arith. + 45 (1985), 145-152. +- [Su07] Sun, Z.-W., *On covering numbers*. Combinatorial Number Theory, de Gruyter (2007), + 443-453. [arXiv:math/0601017](https://arxiv.org/abs/math/0601017) +- [BBMST24] Balister, P., Bollobás, B., Morris, R., Sahasrabudhe, J. and Tiba, M., *The structure + and number of Erdős covering systems*. J. Eur. Math. Soc. 26 (2024), 75-109. + [arXiv:1904.04806](https://arxiv.org/abs/1904.04806) + +See also [erdosproblems.com/1188](https://www.erdosproblems.com/1188), which counts minimal +covering systems with bounded moduli. +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos1189 + +/-- `M` is a covering set: all its elements are $> 1$ and some choice of residues +`a m (mod m)`, one for each `m ∈ M`, is such that every integer satisfies at least one of the +congruences. -/ +def IsCoveringSet (M : Finset ℕ) : Prop := + (∀ m ∈ M, 1 < m) ∧ ∃ a : ℕ → ℤ, ∀ z : ℤ, ∃ m ∈ M, z ≡ a m [ZMOD m] + +/-- `M` is an irreducible covering set: it is a covering set and no proper subset of it is. -/ +def IsIrreducibleCoveringSet (M : Finset ℕ) : Prop := + IsCoveringSet M ∧ ∀ N : Finset ℕ, N ⊂ M → ¬ IsCoveringSet N + +/-- The empty set is not a covering set, since the integer `0` satisfies no congruence. -/ +@[category test, AMS 11] +theorem not_isCoveringSet_empty : ¬ IsCoveringSet ∅ := by + rintro ⟨-, a, ha⟩ + obtain ⟨m, hm, -⟩ := ha 0 + simp at hm + +/-- $I(k)$ is the number of irreducible covering sets of size `k`. There are only finitely many +[Er80, p. 95], so `ncard` is the true count. It is `0` if there are none. -/ +noncomputable def irreducibleCount (k : ℕ) : ℕ := + {M : Finset ℕ | IsIrreducibleCoveringSet M ∧ M.card = k}.ncard + +/-- The values taken by the largest modulus $n_k$ over the irreducible covering sets of size +`k`. -/ +def largestModulus (k : ℕ) : Set ℕ := + {n | ∃ M : Finset ℕ, IsIrreducibleCoveringSet M ∧ M.card = k ∧ IsGreatest (M : Set ℕ) n} + +/-- The maximum of $\sum 1/n_i$ over the irreducible covering sets $\{n_1, \ldots, n_k\}$ of size +`k`. There are only finitely many such sets, so the `sSup` is a maximum, except that it is `0` if +there are none. -/ +noncomputable def maxReciprocalSum (k : ℕ) : ℝ := + sSup {s : ℝ | ∃ M : Finset ℕ, IsIrreducibleCoveringSet M ∧ M.card = k ∧ + s = ∑ m ∈ M, (m : ℝ)⁻¹} + +def erdos_1189.parts.i.answer : ℕ → ℝ := sorry + +/-- +Call a set of distinct integers $11$) form an irreducible +covering set? + +This is the fourth part. Sun [Su07, Theorem 1.4(i) and Corollary 1.3] proved that the answer is +yes: see `erdos_1189.variants.sun`. +-/ +@[category research solved, question, AMS 11] +theorem erdos_1189.parts.iv : + {n : ℕ | IsIrreducibleCoveringSet (n.divisors.filter (1 < ·))}.Infinite := by + sorry + +/-- +The divisors of $12$ (which are $>1$) are an example of an irreducible covering set. Sun [Su07] +proved more generally that, for any odd prime $p$, the divisors (which are $>1$) of $2^{p-1}p$ +form an irreducible covering set, settling the final question. + +That $n=12$ is an example is already noted in [Er80, p. 95]. +-/ +@[category research solved, AMS 11] +theorem erdos_1189.variants.sun (p : ℕ) (hp : p.Prime) (hodd : Odd p) : + IsIrreducibleCoveringSet ((2 ^ (p - 1) * p).divisors.filter (1 < ·)) := by + sorry + +/-- +Simpson [Si85] proved $n_k\leq 2^{k-1}$. + +Here $n_k$ is the largest element of an irreducible covering set of size $k$. The bound follows +from Simpson's theorem [Si85] (see [BBMST24, Theorem 2.4]), as stated in [BBMST24, Section 1]. +-/ +@[category research solved, AMS 11] +theorem erdos_1189.variants.simpson (M : Finset ℕ) (hM : IsIrreducibleCoveringSet M) : + ∀ n ∈ M, n ≤ 2 ^ (M.card - 1) := by + sorry + +/-- The constant $\tau = \sum_{t \geq 1} \log^2\left(\frac{t+1}{t}\right)$ of [BBMST24]. -/ +noncomputable def bbmstTau : ℝ := + ∑' t : ℕ, Real.log (((t : ℝ) + 2) / ((t : ℝ) + 1)) ^ 2 + +/-- +Let $I(k)$ count the number of irreducible covering sets of size $k$. Balister, Bollobás, Morris, +Sahasrabudhe, and Tiba [BBMST24] proved that +$$I(k) \leq \exp\left((c+o(1))\frac{k^{3/2}}{(\log k)^{1/2}}\right)$$ +by proving that the right-hand side is an asymptotic for the number of minimal covering systems +on $k$ moduli. + +Here $c = 4\sqrt{\tau}/3$ [BBMST24, Theorem 1.1]. The bound for $I(k)$ follows because each +irreducible covering set is the set of moduli of a minimal covering system. The $o(1)$ is stated +with an arbitrary $\varepsilon > 0$. +-/ +@[category research solved, AMS 11] +theorem erdos_1189.variants.bbmst (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ k : ℕ in atTop, (irreducibleCount k : ℝ) ≤ + Real.exp ((4 * Real.sqrt bbmstTau / 3 + ε) * + ((k : ℝ) ^ (3 / 2 : ℝ) / Real.sqrt (Real.log k))) := by + sorry + +end Erdos1189 diff --git a/FormalConjectures/ErdosProblems/1191.lean b/FormalConjectures/ErdosProblems/1191.lean new file mode 100644 index 0000000..c002268 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1191.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1191 + +*References:* +- [erdosproblems.com/1191](https://www.erdosproblems.com/1191) +- [Er80] Erdős, Paul, *A survey of problems in combinatorial number theory*. Ann. Discrete Math. + (1980), 89-115. +- [HaRo66] Halberstam, H. and Roth, K. F., *Sequences. Vol. I*. (1966), xx+291. +-/ + +@[expose] public section + +open Filter Real + +namespace Erdos1191 + +/-- +Let $A\subset\mathbb{N}$ be an infinite Sidon set. Is it true that +$$\liminf_{x\to \infty} \frac{\lvert A\cap [1,x]\rvert}{x^{1/2}}(\log x)^{1/2}=0?$$ + +Here $x$ runs over $\mathbb{N}$ and the $\liminf$ is taken in `ℝ≥0∞`, so that it is $\infty$ +rather than $0$ when the sequence tends to infinity. +-/ +@[category research open, question, AMS 5 11] +theorem erdos_1191.parts.i : ∀ A : Set ℕ, A.Infinite → IsSidon A → + liminf (fun x : ℕ ↦ ENNReal.ofReal + ((A ∩ .Icc 1 x).ncard / (x : ℝ) ^ (1 / 2 : ℝ) * log x ^ (1 / 2 : ℝ))) atTop = 0 := by + sorry + +/-- +Does there exist an infinite Sidon set $A$ such that +$$\liminf_{x\to \infty} \frac{\lvert A\cap [1,x]\rvert}{x^{1/2}}(\log x)^c>0$$ +for some $c>0$? + +A positive answer would also give a positive answer to Erdős Problem 39. +-/ +@[category research open, question, AMS 5 11] +theorem erdos_1191.parts.ii : ∃ A : Set ℕ, A.Infinite ∧ IsSidon A ∧ + ∃ c > (0 : ℝ), 0 < liminf (fun x : ℕ ↦ ENNReal.ofReal + ((A ∩ .Icc 1 x).ncard / (x : ℝ) ^ (1 / 2 : ℝ) * log x ^ c)) atTop := by + sorry + +/-- +Erdős proved (see for example [HaRo66]) that if $A$ is an infinite Sidon set then +$$\liminf_{x\to \infty} \frac{\lvert A\cap [1,x]\rvert}{x^{1/2}}(\log x)^{1/2}\leq c$$ +for some constant $c>0$. See also `erdos_158.variants.isSidon'`. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1191.variants.liminf_le {A : Set ℕ} (hAinf : A.Infinite) (hAsid : IsSidon A) : + ∃ c > (0 : ℝ), liminf (fun x : ℕ ↦ ENNReal.ofReal + ((A ∩ .Icc 1 x).ncard / (x : ℝ) ^ (1 / 2 : ℝ) * log x ^ (1 / 2 : ℝ))) atTop ≤ + ENNReal.ofReal c := by + sorry + +end Erdos1191 diff --git a/FormalConjectures/ErdosProblems/1199.lean b/FormalConjectures/ErdosProblems/1199.lean index c536db9..aac49a1 100644 --- a/FormalConjectures/ErdosProblems/1199.lean +++ b/FormalConjectures/ErdosProblems/1199.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1199 @@ -26,6 +27,8 @@ import FormalConjecturesUtil - [Ow74] J. Owings, E2494. Amer. Math. Monthly (1974), 902. -/ +@[expose] public section + open Pointwise namespace Erdos1199 @@ -36,9 +39,8 @@ such that all elements of $A+A$ are the same colour? A conjecture of Owings [Ow74]. -/ -@[category research open, AMS 5] +@[category research open, question, AMS 5] theorem erdos_1199 : - answer(sorry) ↔ ∀ (color : ℕ → Fin 2), ∃ (A : Set ℕ), A.Infinite ∧ ∀ n ∈ (A+A), ∀ m ∈ (A+A), color n = color m := by sorry diff --git a/FormalConjectures/ErdosProblems/12.lean b/FormalConjectures/ErdosProblems/12.lean index 9c8858c..a14ad25 100644 --- a/FormalConjectures/ErdosProblems/12.lean +++ b/FormalConjectures/ErdosProblems/12.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 12 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/12](https://www.erdosproblems.com/12) -/ +@[expose] public section + open Filter Set namespace Erdos12 @@ -53,9 +56,9 @@ $\liminf \frac{|A \cap \{1, \dotsc, N\}|}{N^{1/2}} > 0$ ? The DeepMind prover agent has found a formal proof of this statement. -/ -@[category research solved, AMS 11, +@[category research solved, question, AMS 11, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/8d872b465955e46e2d28bc165d186ea41fd0da9e/FormalConjectures/ErdosProblems/12.lean#L810"] -theorem erdos_12.parts.i : answer(True) ↔ ∃ (A : Set ℕ), IsGood A ∧ +theorem erdos_12.parts.i : ∃ (A : Set ℕ), IsGood A ∧ (0 : ℝ) < Filter.atTop.liminf (fun N => (A ∩ Icc 1 N).ncard / (N : ℝ).sqrt) := by sorry @@ -68,9 +71,9 @@ with $|A \cap \{1, \dotsc, N\}| < N^{1−c}$? The DeepMind prover agent has found a formal disproof of this statement. -/ -@[category research solved, AMS 11, +@[category research solved, question, AMS 11, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/118a6a60df73a9f47d6c89f3cdb3786eaa2e8d0a/FormalConjectures/ErdosProblems/12.lean#L740"] -theorem erdos_12.parts.ii : answer(False) ↔ ∃ c > (0 : ℝ), ∀ (A : Set ℕ), IsGood A → +theorem erdos_12.parts.ii : ¬ ∃ c > (0 : ℝ), ∀ (A : Set ℕ), IsGood A → {N : ℕ| (A ∩ Icc 1 N).ncard < (N : ℝ) ^ (1 - c)}.Infinite := by sorry @@ -78,9 +81,9 @@ theorem erdos_12.parts.ii : answer(False) ↔ ∃ c > (0 : ℝ), ∀ (A : Set Let $A$ be an infinite set such that there are no distinct $a,b,c \in A$ such that $a \mid (b+c)$ and $b,c > a$. Is it true that $∑_{n \in A} \frac{1}{n} < \infty$? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_12.parts.iii : - answer(sorry) ↔ ∀ (A : Set ℕ), IsGood A → Summable (fun (n : A) ↦ (1 / n : ℝ)) := by + ∀ (A : Set ℕ), IsGood A → Summable (fun (n : A) ↦ (1 / n : ℝ)) := by sorry /-- @@ -119,20 +122,23 @@ theorem erdos_12.variants.example (A : Set ℕ) Let $A$ be a set of natural numbers with the property that there are no distinct $a,b,c \in A$ such that $a \mid (b+c)$ and $b,c > a$. If all elements in $A$ are pairwise coprime then $$\lvert A\cap\{1,\ldots,N\}\rvert \ll N^{2/3}$$ +for infinitely many $N$. -/ @[category research solved, AMS 11] theorem erdos_12.variants.schoen (A : Set ℕ) (hA : IsGood A) (hA' : A.Pairwise Nat.Coprime) : - (fun N ↦ ((A ∩ Icc 1 N).ncard : ℝ)) =O[atTop] (fun N ↦ (N : ℝ) ^ (2 / 3 : ℝ)) := by + ∃ C > (0 : ℝ), {N : ℕ | (A ∩ Icc 1 N).ncard ≤ C * (N : ℝ) ^ (2 / 3 : ℝ)}.Infinite := by sorry /-- Let $A$ be a set of natural numbers with the property that there are no distinct $a,b,c \in A$ such that $a \mid (b+c)$ and $b,c > a$. If all elements in $A$ are pairwise coprime then $$\lvert A\cap\{1,\ldots,N\}\rvert \ll N^{2/3}/\log N$$ +for infinitely many $N$. -/ @[category research solved, AMS 11] theorem erdos_12.variants.baier (A : Set ℕ) (hA : IsGood A) (hA' : A.Pairwise Nat.Coprime) : - (fun N ↦ ((A ∩ Icc 1 N).ncard : ℝ)) =O[atTop] (fun N ↦ (N : ℝ) ^ (2 / 3 : ℝ) / (N : ℝ).log) := by + ∃ C > (0 : ℝ), + {N : ℕ | (A ∩ Icc 1 N).ncard ≤ C * (N : ℝ) ^ (2 / 3 : ℝ) / (N : ℝ).log}.Infinite := by sorry end Erdos12 diff --git a/FormalConjectures/ErdosProblems/1201.lean b/FormalConjectures/ErdosProblems/1201.lean index dcd3888..9d75270 100644 --- a/FormalConjectures/ErdosProblems/1201.lean +++ b/FormalConjectures/ErdosProblems/1201.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1201 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/1201](https://www.erdosproblems.com/1201) -/ +@[expose] public section + open Nat Filter Finset namespace Erdos1201 @@ -40,12 +43,11 @@ Is it true that for every $\epsilon,\eta>0$ there exists a $k$ such that the den for which $P(n(n+1)\cdots(n+k))>n^{1-\epsilon}$ is at least $1-\eta$ (where $P(m)$ is the greatest prime divisor of $m$)? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1201 : - answer(sorry) ↔ - ∀ ε > 0, ∀ η > 0, ∃ k : ℕ, - atTop.liminf (fun x : ℕ ↦ - (((count (· ∈ Erdos1201Set ε k) x : ℝ) / (x : ℝ)) : EReal)) ≥ (1 - η : EReal) := by + ∀ ε > 0, ∀ η > 0, ∃ k : ℕ, + atTop.liminf (fun x : ℕ ↦ + (((count (· ∈ Erdos1201Set ε k) x : ℝ) / (x : ℝ)) : EReal)) ≥ (1 - η : EReal) := by sorry open scoped Classical in diff --git a/FormalConjectures/ErdosProblems/1204.lean b/FormalConjectures/ErdosProblems/1204.lean new file mode 100644 index 0000000..c819836 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1204.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1204 + +*References:* +- [erdosproblems.com/1204](https://www.erdosproblems.com/1204) +- [El65] Elliott, P. D. T. A., *On sequences of integers*. Quart. J. Math. Oxford Ser. (2) 16 + (1965), 35-45. +- [Er80] Erdős, P., *A survey of problems in combinatorial number theory*. Ann. Discrete Math. 6 + (1980), 89-115. +- [Po14c] Polymath, D. H. J., *Variants of the Selberg sieve, and bounded intervals containing + many primes*. Res. Math. Sci. 1 (2014), Art. 12. + [arXiv:1407.4897](https://arxiv.org/abs/1407.4897) +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos1204 + +/-- A finite set `S` of natural numbers is *admissible* if it misses at least one residue class +modulo every prime. A sequence $0\leq a_1<\cdots (0 : ℝ), ∀ᶠ k : ℕ in atTop, (1 / 2 - ε) * k * Real.log k ≤ (A k : ℝ) := by + sorry + +/-- +It is known that $A(k)\leq (1+o(1))k\log k$, by taking the $k$ smallest primes $>k$. +-/ +@[category research solved, AMS 11] +theorem erdos_1204.variants.A_upper : + ∀ ε > (0 : ℝ), ∀ᶠ k : ℕ in atTop, (A k : ℝ) ≤ (1 + ε) * k * Real.log k := by + sorry + +/-- +Taking the first $k$ primes which are $>k$ implies $B(k)\leq (1/2+o(1))k\log k$. +-/ +@[category research solved, AMS 11] +theorem erdos_1204.variants.B_upper : + ∀ ε > (0 : ℝ), ∀ᶠ k : ℕ in atTop, B k ≤ (1 / 2 + ε) * k * Real.log k := by + sorry + +end Erdos1204 diff --git a/FormalConjectures/ErdosProblems/1206.lean b/FormalConjectures/ErdosProblems/1206.lean new file mode 100644 index 0000000..145a183 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1206.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 1206 + +*References:* +- [erdosproblems.com/1206](https://www.erdosproblems.com/1206) +- [Er80] Erdős, Paul, *A survey of problems in combinatorial number theory*. Ann. Discrete Math. + (1980), 89-115. +- [GGK26] M. Garaev, F. Garayev, and S. Konyagin, *On Sidon sets with squares, cubes, and quartics + in short intervals*. arXiv:2602.08807 (2026). +- [GaKo24] Gabdullin, M. R. and Konyagin, S. V., *Trigonometric polynomials with frequencies in the + set of cubes*. Math. Notes (2024), 336--340. +-/ + +@[expose] public section + +namespace Erdos1206 + +/-- +Does $\{1,2^3,\ldots,N^3\}$ contain a Sidon set of size $\gg N$? +-/ +@[category research open, question, AMS 5 11] +theorem erdos_1206.parts.i : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ N in Filter.atTop, ∃ S : Finset ℕ, + S ⊆ (Finset.Icc 1 N).image (fun n => n ^ 3) ∧ + IsSidon (S : Set ℕ) ∧ c * (N : ℝ) ≤ (S.card : ℝ) := by + sorry + +/-- +Is there an infinite set $A\subset \mathbb{N}$ of positive density such that $\{a^3 : a\in A\}$ is a Sidon set? +-/ +@[category research open, question, AMS 5 11] +theorem erdos_1206.parts.ii : + ∃ A : Set ℕ, A.Infinite ∧ 0 < A.lowerDensity ∧ + IsSidon ((fun a : ℕ => a ^ 3) '' A) := by + sorry + +end Erdos1206 diff --git a/FormalConjectures/ErdosProblems/1210.lean b/FormalConjectures/ErdosProblems/1210.lean index caad8dd..b545d68 100644 --- a/FormalConjectures/ErdosProblems/1210.lean +++ b/FormalConjectures/ErdosProblems/1210.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 1210 @@ -27,6 +28,8 @@ import FormalConjecturesUtil (1980), 89-115. -/ +@[expose] public section + open Finset namespace Erdos1210 @@ -35,9 +38,8 @@ namespace Erdos1210 Let $A\subseteq [1,n)$ be a set of integers such that $(a,b)=1$ for all distinct $a,b\in A$. Is it true that $\sum_{a\in A}\frac{1}{n-a}\leq \sum_{p < n}\frac{1}{p}+O(1)$? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1210 : - answer(sorry) ↔ ∃ C : ℝ, ∀ n : ℕ, ∀ A : Finset ℕ, (∀ a ∈ A, 1 ≤ a ∧ a < n) → (∀ a ∈ A, ∀ b ∈ A, a ≠ b → a.Coprime b) → @@ -49,9 +51,8 @@ In [Er80] he claims he "did not state this quite correctly" in [Er77c]. The prob Erdős is presumably referring to states that if $n < q_1 < \cdots < q_k\leq m$ is the set of primes in $(n,m]$ then $\sum \frac{1}{q_i-n} < \sum_{p < m-n}\frac{1}{p}+O(1)$. -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_1210.variants.er80_correction : - answer(sorry) ↔ ∃ C : ℝ, ∀ n m : ℕ, n < m → ∑ q ∈ (Ioc n m).filter Prime, (1 / ((q : ℝ) - n)) < (∑ p ∈ (range (m - n)).filter Prime, (1 / (p : ℝ))) + C := by diff --git a/FormalConjectures/ErdosProblems/123.lean b/FormalConjectures/ErdosProblems/123.lean index 32f2175..19928d3 100644 --- a/FormalConjectures/ErdosProblems/123.lean +++ b/FormalConjectures/ErdosProblems/123.lean @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil /-! # Erdős Problem 123 @@ -32,6 +34,8 @@ import FormalConjecturesUtil (2016), 1--12. -/ +@[expose] public section + open Filter open Submonoid open scoped Pointwise @@ -82,9 +86,9 @@ The main problem was resolved in the affirmative by GPT 5.6 (prompted by Snyder) This was formalized in Lean by Alexeev. -/ -@[category research solved, AMS 11, formal_proof using lean4 at +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/a28a04b6b8ce43d5260a7466677c1f23833bfc38/src/latest/ErdosProblems/Erdos123.lean"] -theorem erdos_123 : answer(True) ↔ ∀ a > 1, ∀ b > 1, ∀ c > 1, PairwiseCoprime a b c → +theorem erdos_123 : ∀ a > 1, ∀ b > 1, ∀ c > 1, PairwiseCoprime a b c → IsDComplete (↑(powers a) * ↑(powers b) * ↑(powers c)) := by sorry /-- @@ -111,9 +115,9 @@ In [Er92b] Erdős makes the stronger conjecture (for $a=2$, $b=3$, and $c=5$) th $\epsilon>0$, all large integers $n$ can be written as the sum of distinct integers $b_1<\cdots 0, ∀ᶠ n in atTop, + ∀ ε > 0, ∀ᶠ n in atTop, ∃ A : Finset ℕ, (A : Set ℕ) ⊆ ↑(powers 2) * ↑(powers 3) * ↑(powers 5) ∧ IsSnug ε A ∧ ∑ x ∈ A, x = n := by sorry diff --git a/FormalConjectures/ErdosProblems/125.lean b/FormalConjectures/ErdosProblems/125.lean index deaa10b..1325f8f 100644 --- a/FormalConjectures/ErdosProblems/125.lean +++ b/FormalConjectures/ErdosProblems/125.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 125 @@ -28,6 +29,8 @@ There are four possibilities for the density of $A+B$: 4. $A+B$ has positive upper and lower density that are unequal (and hence no density). -/ +@[expose] public section + open Nat Pointwise namespace Erdos125 @@ -58,10 +61,10 @@ Does $A + B$ have positive upper and lower density that are equal? This is the literal interpretation of "positive density" which was falsified. -/ -@[category research solved, AMS 11, +@[category research solved, question, AMS 11, formal_proof using formal_conjectures at "https://github.com/google-deepmind/formal-conjectures/blob/300bf771bdbef43d7b9aa2521e633a50fd54dd28/FormalConjectures/ErdosProblems/125.lean"] theorem erdos_125 : - answer(False) ↔ (A + B).HasPosDensity := by + ¬ (A + B).HasPosDensity := by sorry /-- @@ -70,10 +73,10 @@ Does $A + B$ have positive lower density? This has been falsified. -/ -@[category research solved, AMS 11, +@[category research solved, question, AMS 11, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/c27415379b5dbe34105d1fdd707994540c4c6fc7/FormalConjectures/ErdosProblems/125.lean#L468"] theorem erdos_125.variants.positive_lower_density : - answer(False) ↔ 0 < (A + B).lowerDensity := by + ¬ 0 < (A + B).lowerDensity := by sorry @@ -81,27 +84,27 @@ theorem erdos_125.variants.positive_lower_density : Literature question: Does $A + B$ have positive upper density? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_125.variants.positive_upper_density : - answer(sorry) ↔ 0 < (A + B).upperDensity := by + 0 < (A + B).upperDensity := by sorry /-- Case 1: Does $A + B$ have zero upper and lower density? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_125.variants.zero_density : - answer(sorry) ↔ (A + B).upperDensity = 0 ∧ (A + B).lowerDensity = 0 := by + (A + B).upperDensity = 0 ∧ (A + B).lowerDensity = 0 := by sorry /-- Case 2: Does $A + B$ have zero lower density, but positive upper density? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_125.variants.zero_lower_positive_upper_density : - answer(sorry) ↔ (A + B).lowerDensity = 0 ∧ 0 < (A + B).upperDensity := by + (A + B).lowerDensity = 0 ∧ 0 < (A + B).upperDensity := by sorry /-- @@ -110,10 +113,10 @@ Does $A + B$ have positive upper and lower density that are unequal? This follows from the disproof `erdos_125.variants.positive_lower_density` above. -/ -@[category research solved, AMS 11, formal_proof using formal_conjectures at +@[category research solved, question, AMS 11, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/0bc740d2351c53713e66d9340e83f7d2c1ddecab/FormalConjectures/ErdosProblems/125.lean#L860"] theorem erdos_125.variants.positive_unequal_density : - answer(False) ↔ 0 < (A + B).lowerDensity ∧ (A + B).lowerDensity < (A + B).upperDensity := by + ¬ (0 < (A + B).lowerDensity ∧ (A + B).lowerDensity < (A + B).upperDensity) := by sorry end Erdos125 diff --git a/FormalConjectures/ErdosProblems/13.lean b/FormalConjectures/ErdosProblems/13.lean index 6cf89c9..2f6c8d6 100644 --- a/FormalConjectures/ErdosProblems/13.lean +++ b/FormalConjectures/ErdosProblems/13.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 13 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/13](https://www.erdosproblems.com/13) -/ +@[expose] public section + open Finset Nat namespace Erdos13 @@ -40,7 +43,8 @@ $a < \min(b,c)$, then $|A| \le N/3 + O(1)$. This has been solved by Bedert [Be23 [Be23] Bedert, B., _On a problem of Erdős and Sárközy about sequences with no term dividing the sum of two larger terms_. arXiv:2301.07065 (2023). -/ -@[category research solved, AMS 5 11] +@[category research solved, AMS 5 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos13.lean#L8261"] theorem erdos_13 : ∃ C : ℝ, ∀ N : ℕ, ∀ A ⊆ Icc 1 N, IsForbiddenTripleFree A → (A.card : ℝ) ≤ (N : ℝ) / 3 + C := by sorry @@ -51,8 +55,8 @@ $A \subseteq \{1, ..., N\}$ has no $a \in A$ and $b_1, ..., b_r \in A$ such that $a | (b_1 + ... + b_r)$ and $a < \min(b_1, ..., b_r)$, then is it true that $|A| \le N/(r+1) + O(1)$? -/ -@[category research open, AMS 5 11] -theorem erdos_13.variants.general : answer(sorry) ↔ ∀ r : ℕ, ∃ C : ℝ, ∀ N : ℕ, +@[category research open, question, AMS 5 11] +theorem erdos_13.variants.general : ∀ r : ℕ, ∃ C : ℝ, ∀ N : ℕ, ∀ A ⊆ Icc 1 N, (∀ a ∈ A, ∀ (b : Fin r → ℕ), (∀ i, b i ∈ A) → (∀ i, a < b i) → ¬ (a ∣ ∑ i, b i)) → diff --git a/FormalConjectures/ErdosProblems/133.lean b/FormalConjectures/ErdosProblems/133.lean new file mode 100644 index 0000000..2b01d5b --- /dev/null +++ b/FormalConjectures/ErdosProblems/133.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 133 + +*References:* +- [erdosproblems.com/133](https://www.erdosproblems.com/133) +- [Er97b] Erdős, Paul, *Some old and new problems in various branches of combinatorics*. Discrete + Math. (1997), 227-231. +- [HaSe84] Hanson, D. and Seyffarth, K., *$k$-saturated graphs of prescribed maximum degree*. + Congr. Numer. (1984), 169-182. +- [FuSe94] Füredi, Zoltán and Seress, Ákos, *Maximal triangle-free graphs with restrictions on the + degrees*. J. Graph Theory (1994), 11-24. +- [HaLe18] Haviv, Ishay and Levy, Dan, *Symmetric complete sum-free sets in cyclic groups*. Israel + J. Math. (2018), 931-956. +-/ + +@[expose] public section + +open Filter Asymptotics SimpleGraph + +namespace Erdos133 + +open scoped Classical in +/-- +`f n` is the least possible maximum degree of a triangle-free graph on `n` vertices with +diameter `2`, i.e. the largest `f` such that every such graph has a vertex of degree `≥ f`. +-/ +noncomputable def f (n : ℕ) : ℕ := + sInf {d | ∃ G : SimpleGraph (Fin n), G.CliqueFree 3 ∧ G.diam = 2 ∧ ∀ v, G.degree v ≤ d} + +/-- +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)$. What is the order of growth of $f(n)$? Does +$f(n)/\sqrt{n}\to \infty$? + +Asked by Erdős and Pach. The lower bound $f(n)\geq (1-o(1))\sqrt{n}$ follows from the fact that +a graph with maximum degree $d$ and diameter $2$ has at most $1+d+d(d-1)=d^2+1$ many vertices. + +Hanson and Seyffarth [HaSe84] proved that $f(n)\leq (\sqrt{2}+o(1))\sqrt{n}$ using a Cayley graph +on $\mathbb{Z}/n\mathbb{Z}$, with the generating set given by some symmetric complete sum-free set +of size $\sim \sqrt{n}$. An alternative construction of such a complete sum-free set was given by +Haviv and Levy [HaLe18]. Füredi and Seress [FuSe94] proved that +$f(n)\leq (\frac{2}{\sqrt{3}}+o(1))\sqrt{n}$. In particular $f(n)/\sqrt{n}\not\to\infty$. + +The precise asymptotics of $f(n)$ are unknown; Alon believes that the truth is $f(n)\sim \sqrt{n}$. +-/ +@[category research solved, question, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos133.lean#L597"] +theorem erdos_133 : ¬ Tendsto (fun n : ℕ ↦ (f n : ℝ) / √n) atTop atTop := by + sorry + +/-- The order of growth of $f(n)$ is $\sqrt{n}$. -/ +@[category research solved, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos133.lean#L597"] +theorem erdos_133.variants.isTheta : (fun n : ℕ ↦ (f n : ℝ)) =Θ[atTop] fun n ↦ √n := by + sorry + +/-- +The lower bound $f(n)\geq (1-o(1))\sqrt{n}$ follows from the fact that a graph with maximum degree +$d$ and diameter $2$ has at most $d^2+1$ many vertices. +-/ +@[category research solved, AMS 5] +theorem erdos_133.variants.lower_bound : ∀ ε : ℝ, 0 < ε → + ∀ᶠ n : ℕ in atTop, (1 - ε) * √n ≤ f n := by + sorry + +/-- Hanson and Seyffarth [HaSe84] proved that $f(n)\leq (\sqrt{2}+o(1))\sqrt{n}$. -/ +@[category research solved, AMS 5] +theorem erdos_133.variants.hanson_seyffarth : ∀ ε : ℝ, 0 < ε → + ∀ᶠ n : ℕ in atTop, (f n : ℝ) ≤ (√2 + ε) * √n := by + sorry + +/-- Füredi and Seress [FuSe94] proved that $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, (f n : ℝ) ≤ (2 / √3 + ε) * √n := by + sorry + +/-- Is $f(n)\sim \sqrt{n}$? Alon believes that this is the truth. -/ +@[category research open, question, AMS 5] +theorem erdos_133.variants.asymptotic : + (fun n : ℕ ↦ (f n : ℝ)) ~[atTop] fun n ↦ √n := by + sorry + +end Erdos133 diff --git a/FormalConjectures/ErdosProblems/137.lean b/FormalConjectures/ErdosProblems/137.lean index 6d61b9a..2549d48 100644 --- a/FormalConjectures/ErdosProblems/137.lean +++ b/FormalConjectures/ErdosProblems/137.lean @@ -55,7 +55,7 @@ $p\mid m(m+1)\cdots (m+n)$ and yet $p^2$ does not divide the right hand side. @[category research open, AMS 11] theorem erdos_137.variants.multiple_powerful_factors (k : ℕ) : ∀ᶠ n in Filter.atTop, ∀ (m : ℕ) (hm : 0 < m), - letI N := ∏ x ∈ Finset.Ioc m (m + n), x + letI N := ∏ x ∈ Finset.Icc m (m + n), x ∃ P : Finset ℕ, P.card = k ∧ ∀ p ∈ P, p.Prime ∧ p ∣ N ∧ ¬ p ^ 2 ∣ N := by sorry diff --git a/FormalConjectures/ErdosProblems/138.lean b/FormalConjectures/ErdosProblems/138.lean index 061c7b6..ca2d17f 100644 --- a/FormalConjectures/ErdosProblems/138.lean +++ b/FormalConjectures/ErdosProblems/138.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! @@ -26,8 +27,17 @@ import FormalConjecturesUtil - [Er80] Erdős, Paul, 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 (1981), 25-42. - [Go01] Gowers, W. T., A new proof of Szemerédi's theorem. Geom. Funct. Anal. (2001), 465-588. +- [arxiv/2605.22763](https://arxiv.org/abs/2605.22763) *Advancing Mathematics Research with AI-Driven + Formal Proof Search* by George Tsoukalas et al. +- [CFS26] Campos, M., Fox, J. and Schildkraut, C., A new lower bound for two-color van der Waerden + numbers. [arXiv:2608.20824](https://arxiv.org/abs/2608.20824) (2026). +- [OAI26] OpenAI, *Quantitative Superexponential Bounds for van der Waerden Numbers*. OpenAI Math + Release preprint (2026). + https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/Quantitative-Superexponential-Bounds-for-van-der-Waerden-Numbers-September-23-2026/paper.pdf -/ +@[expose] public section + open Nat Filter namespace Erdos138 @@ -67,21 +77,25 @@ must contain a monochromatic arithmetic progression of length `k`. noncomputable abbrev W : ℕ → ℕ := monoAPNumber 2 @[category test, AMS 11, -formal_proof using formal_conjectures at "https://github.com/XC0R/formal-conjectures/blob/6c7a16e8998d1c597fa2a5c6329bc9301fcc56e2/FormalConjectures/ErdosProblems/138.lean#L79"] +formal_proof using formal_conjectures at "https://github.com/XC0R/formal-conjectures/blob/55a6458d655c56201904e417d25d7289dc7c5306/FormalConjectures/ErdosProblems/138.lean#L79"] theorem monoAPNumber_two_one : W 1 = 1 := by sorry @[category test, AMS 11, -formal_proof using formal_conjectures at "https://github.com/XC0R/formal-conjectures/blob/6c7a16e8998d1c597fa2a5c6329bc9301fcc56e2/FormalConjectures/ErdosProblems/138.lean#L142"] +formal_proof using formal_conjectures at "https://github.com/XC0R/formal-conjectures/blob/55a6458d655c56201904e417d25d7289dc7c5306/FormalConjectures/ErdosProblems/138.lean#L142"] theorem monoAPNumber_two_two : W 2 = 3 := by sorry /-- In [Er80] Erdős asks whether $$ \lim_{k \to \infty} (W(k))^{1/k} = \infty $$ + +Yes. This was proved by an internal OpenAI model in September 2026 [OAI26], which shows +$W(k) > k^{k/100000}$ for all large $k$; see the linked Lean proof. -/ -@[category research open, AMS 11] -theorem erdos_138 : answer(sorry) ↔ atTop.Tendsto (fun k => (W k : ℝ)^(1/(k : ℝ))) atTop := by +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Combinatorics/ProgressionColoring/Main.lean#L12"] +theorem erdos_138 : atTop.Tendsto (fun k => (W k : ℝ)^(1/(k : ℝ))) atTop := by sorry @@ -102,9 +116,9 @@ theorem erdos_138.variants.upper (k : ℕ) : W k ≤ 2 ^ (2 ^ (2 ^ 2 ^ 2 ^ (k + /-- In [Er81] Erdős asks whether $\frac{W(k+1)}{W(k)} \to \infty$. -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_138.variants.quotient : - answer(sorry) ↔ atTop.Tendsto (fun k => ((W (k + 1) : ℚ)/(W k))) atTop := by + atTop.Tendsto (fun k => ((W (k + 1) : ℚ)/(W k))) atTop := by sorry /-- @@ -112,16 +126,27 @@ In [Er81] Erdős asks whether $W(k+1) - W(k) \to \infty$. The DeepMind prover agent has found a formal proof of this statement. -/ -@[category research solved, AMS 11, formal_proof using formal_conjectures at +@[category research solved, question, AMS 11, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/6ac8d0cbe1a85e71747c62c1391a84788015ebc1/FormalConjectures/ErdosProblems/138.lean#L844"] theorem erdos_138.variants.difference : - answer(True) ↔ atTop.Tendsto (fun k => (W (k + 1) - W k)) atTop := by + atTop.Tendsto (fun k => (W (k + 1) - W k)) atTop := by sorry /-- In [Er80] Erdős asks whether $W(k)/2^k\to \infty$. + +Campos, Fox and Schildkraut [CFS26] independently prove $W(k) \geq (1 - o(1)) k 2^{k-1}$, which +implies this; they report that their proof was generated with ChatGPT. (The related variant +`erdos_138.variants.difference`, $W(k+1) - W(k) \to \infty$, was solved separately in +[arxiv/2605.22763].) + +Solved: a Lean 4 proof, derived from the Atlas proofs in +[facebookresearch/atlas-lean](https://github.com/facebookresearch/atlas-lean), is linked in +`formal_proof`. -/ -@[category research open, AMS 11] +@[category research solved, question, AMS 11, + formal_proof using lean4 at + "https://github.com/niketp03/atlas-fc-verified/blob/15e4b3a7584e218cec531aeaf71cce72a8a9ecb1/AtlasFCSolutions/Erdos138.lean#L1033"] theorem erdos_138.variants.dvd_two_pow : - answer(sorry) ↔ atTop.Tendsto (fun k => ((W k : ℚ)/ (2 ^ k))) atTop := by + atTop.Tendsto (fun k => ((W k : ℚ)/ (2 ^ k))) atTop := by sorry diff --git a/FormalConjectures/ErdosProblems/142.lean b/FormalConjectures/ErdosProblems/142.lean index 0dd0979..67269e5 100644 --- a/FormalConjectures/ErdosProblems/142.lean +++ b/FormalConjectures/ErdosProblems/142.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 142 @@ -22,19 +23,23 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/142](https://www.erdosproblems.com/142) -/ -open Filter +@[expose] public section +open Asymptotics Filter namespace Erdos142 noncomputable abbrev r := Set.IsAPOfLengthFree.maxCard +def erdos_142.answer : ℕ → ℝ := sorry + /-- Prove an asymptotic formula for $r_k(N)$, the largest possible size of a subset of $\{1, \dots, N\}$ that does not contain any non-trivial $k$-term arithmetic progression. +That is, find $f_k$ with $r_k(N) / f_k(N) \to 1$ as $N \to \infty$. -/ -@[category research open, AMS 11] -theorem erdos_142 (k : ℕ) : (fun N => (r k N : ℝ)) =Θ[atTop] (answer(sorry) : ℕ → ℝ) := by +@[category research open, question value, AMS 11] +theorem erdos_142 (k : ℕ) : (fun N => (r k N : ℝ)) ~[atTop] erdos_142.answer := by sorry /-- @@ -47,24 +52,31 @@ theorem erdos_142.variants.lower (k : ℕ) (hk : 1 < k) : sorry +def erdos_142.variants.isTheta.answer : ℕ → ℝ := sorry + /-- -Find functions $f_k$, such that $r_k(N) = O_k(f_k)$, where $r_k(N)$ the largest possible size of a -subset of $\{1, \dots, N\}$ that does not contain any non-trivial $k$-term arithmetic progression. +Determine the order of magnitude of $r_k(N)$, the largest possible size of a subset +of $\{1, \dots, N\}$ that does not contain any non-trivial $k$-term arithmetic progression. +That is, find $f_k$ with $r_k(N) \asymp_k f_k(N)$. -/ -@[category research open, AMS 11] -theorem erdos_142.variants.upper (k : ℕ) : - (fun N => (r k N : ℝ)) =O[atTop] (answer(sorry) : ℕ → ℝ) := by +@[category research open, question value, AMS 11] +theorem erdos_142.variants.isTheta (k : ℕ) : + (fun N => (r k N : ℝ)) =Θ[atTop] erdos_142.variants.isTheta.answer := by sorry -- TODO(firsching): at known upper bounds for small k +def erdos_142.variants.three.answer : ℕ → ℝ := sorry + /-- Prove an asymptotic formula for $r_3(N)$, the largest possible size of a subset of $\{1, \dots, N\}$ that does not contain any non-trivial $3$-term arithmetic progression. +That is, find $f$ with $r_3(N) / f(N) \to 1$ as $N \to \infty$. -/ -@[category research open, AMS 11] -theorem erdos_142.variants.three : (fun N => (r 3 N : ℝ)) =Θ[atTop] (answer(sorry) : ℕ → ℝ) := by +@[category research open, question value, AMS 11] +theorem erdos_142.variants.three : (fun N => (r 3 N : ℝ)) ~[atTop] erdos_142.variants.three.answer + := by sorry end Erdos142 diff --git a/FormalConjectures/ErdosProblems/147.lean b/FormalConjectures/ErdosProblems/147.lean new file mode 100644 index 0000000..5d64b55 --- /dev/null +++ b/FormalConjectures/ErdosProblems/147.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 147 + +*References:* +- [erdosproblems.com/147](https://www.erdosproblems.com/147) +- [ErSi84] Erdős, P. and Simonovits, M., *Cube-supersaturated graphs and related problems*. + Progress in graph theory (Waterloo, Ont., 1982) (1984), 203-218. +- [Er93] Erdős, Paul, *Some of my favorite solved and unsolved problems in graph theory*. + Quaestiones Math. (1993), 333-350. +- [Er97c] Erdős, Paul, *Some of my favorite problems and results*. The mathematics of Paul Erdős, + I (1997), 47-67. +- [Ja23] Janzer, Oliver, *Rainbow Turán number of even cycles, repeated patterns and blow-ups of + cycles*. Israel J. Math. (2023), 813--840. +- [Ja23b] Janzer, Oliver, *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. +-/ + +@[expose] public section + +open Filter Asymptotics SimpleGraph + +namespace Erdos147 + +/-- +If $H$ is bipartite with minimum degree $r$ then there exists $\epsilon=\epsilon(H)>0$ such that +$$\mathrm{ex}(n;H) \gg n^{2-\frac{1}{r-1}+\epsilon}.$$ + +Conjectured by Erdős and Simonovits [ErSi84]. A probabilistic argument shows that there exists +some $\epsilon=\epsilon(H)>0$ such that $\mathrm{ex}(n;H) \gg n^{2-\frac{2}{r}+\epsilon}$. + +This conjecture was disproved by Janzer [Ja23] for even $r\geq 4$. The case $r=3$ was disproved +by Janzer [Ja23b], who constructed, for any $\epsilon>0$, a $3$-regular bipartite graph $H$ such +that $\mathrm{ex}(n;H)\ll n^{\frac{4}{3}+\epsilon}$. + +In [Ja23] Janzer conjectures that the above lower bound is sharp, in that for any $r\geq 3$ and +$\epsilon>0$ there exists an $r$-regular graph $H$ such that +$\mathrm{ex}(n;H) \ll n^{2-\frac{2}{r}+\epsilon}$. Janzer's result proves this for even +$r\geq 4$. + +See also [113](https://www.erdosproblems.com/113), [146](https://www.erdosproblems.com/146), and +[714](https://www.erdosproblems.com/714). + +The conjecture is stated for minimum degree $r \geq 2$ (for $r = 1$ the exponent +$2 - \frac{1}{r-1}$ is not meaningful). +-/ +@[category research solved, question, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos147.lean#L799"] +theorem erdos_147 : + ¬ ∀ (V : Type) [Fintype V] [Nonempty V] (H : SimpleGraph V) [DecidableRel H.Adj], + H.IsBipartite → 2 ≤ H.minDegree → ∃ ε : ℝ, 0 < ε ∧ + (fun n : ℕ => (n : ℝ) ^ (2 - 1 / ((H.minDegree : ℝ) - 1) + ε)) =O[atTop] + fun n : ℕ => (extremalNumber n H : ℝ) := by + sorry + +open scoped Classical in +/-- +Janzer [Ja23] disproved the conjecture for even $r\geq 4$: for any even $r \geq 4$ and +$\epsilon>0$ there exists a nonempty $r$-regular bipartite graph $H$ such that +$\mathrm{ex}(n;H) \ll n^{2-\frac{2}{r}+\epsilon}$. +-/ +@[category research solved, AMS 5] +theorem erdos_147.variants.janzer_even (r : ℕ) (hr : 4 ≤ r) (heven : Even r) (ε : ℝ) + (hε : 0 < ε) : + ∃ (q : ℕ) (H : SimpleGraph (Fin q)), 0 < q ∧ H.IsBipartite ∧ H.IsRegularOfDegree r ∧ + (fun n : ℕ => (extremalNumber n H : ℝ)) =O[atTop] + fun n : ℕ => (n : ℝ) ^ (2 - 2 / (r : ℝ) + ε) := by + sorry + +open scoped Classical in +/-- +Janzer [Ja23b] constructed, for any $\epsilon>0$, a nonempty $3$-regular bipartite graph $H$ +such that $\mathrm{ex}(n;H)\ll n^{\frac{4}{3}+\epsilon}$. +-/ +@[category research solved, AMS 5] +theorem erdos_147.variants.cubic (ε : ℝ) (hε : 0 < ε) : + ∃ (q : ℕ) (H : SimpleGraph (Fin q)), 0 < q ∧ H.IsBipartite ∧ H.IsRegularOfDegree 3 ∧ + (fun n : ℕ => (extremalNumber n H : ℝ)) =O[atTop] + fun n : ℕ => (n : ℝ) ^ (4 / 3 + ε : ℝ) := by + sorry + +open scoped Classical in +/-- +Janzer [Ja23] conjectures that for any $r\geq 3$ and $\epsilon>0$ there exists a nonempty +$r$-regular graph $H$ such that $\mathrm{ex}(n;H) \ll n^{2-\frac{2}{r}+\epsilon}$. +-/ +@[category research open, question, AMS 5] +theorem erdos_147.variants.janzer_conjecture : ∀ r : ℕ, 3 ≤ r → ∀ ε : ℝ, 0 < ε → + ∃ (q : ℕ) (H : SimpleGraph (Fin q)), 0 < q ∧ H.IsRegularOfDegree r ∧ + (fun n : ℕ => (extremalNumber n H : ℝ)) =O[atTop] + fun n : ℕ => (n : ℝ) ^ (2 - 2 / (r : ℝ) + ε) := by + sorry + +end Erdos147 diff --git a/FormalConjectures/ErdosProblems/148.lean b/FormalConjectures/ErdosProblems/148.lean new file mode 100644 index 0000000..6a3ae1f --- /dev/null +++ b/FormalConjectures/ErdosProblems/148.lean @@ -0,0 +1,214 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 148 + +*References:* +- [erdosproblems.com/148](https://www.erdosproblems.com/148) +- [ElPl21] Elsholtz, Christian and Planitzer, Stefan, *Sums of four and more unit fractions and + approximate parametrizations*. Bull. Lond. Math. Soc. (2021), 695-709. +- [Ko14] Konyagin, S. V., *Double exponential lower bound for the number of representations of + unity by Egyptian fractions*. Math. Notes (2014), 277-281. +- [OEIS A006585](https://oeis.org/A006585) +-/ + +@[expose] public section + +open Filter Real + +namespace Erdos148 + +/-- `F k` is the number of solutions to $1 = \frac{1}{n_1} + \cdots + \frac{1}{n_k}$ with +$1 \leq n_1 < \cdots < n_k$, that is, the number of $k$-element sets of positive integers whose +reciprocals sum to $1$. -/ +noncomputable def F (k : ℕ) : ℕ := + {S : Finset ℕ | S.card = k ∧ 0 ∉ S ∧ ∑ n ∈ S, (1 : ℚ) / n = 1}.ncard + +/-- The sequence $u_0 = 1$, $u_{n+1} = u_n(u_n + 1)$ of [ElPl21, Corollary 3]: +$1, 2, 6, 42, 1806, \ldots$, a shifted copy of Sylvester's sequence. This is the sequence +`Erdos315.u` of Erdős Problem 315. -/ +def u : ℕ → ℕ + | 0 => 1 + | n + 1 => u n * (u n + 1) + +/-- The constant $c_0 = \lim_{n \to \infty} u_n^{2^{-n}} = 1.5979102\ldots$ of +[ElPl21, Corollary 3]. The sequence $u_n^{2^{-n}}$ is increasing and bounded by $2$ +[ElPl21, Remark 3], so the limit is its supremum. This constant is the square of the Vardi +constant $1.26408\ldots$, which is `Erdos315.c₀`. -/ +noncomputable def c₀ : ℝ := ⨆ n : ℕ, (u n : ℝ) ^ ((1 : ℝ) / 2 ^ n) + +/-- The only representation of $1$ as a single unit fraction is $1 = \frac{1}{1}$. -/ +@[category test, AMS 11] +theorem F_one : F 1 = 1 := by + have h : {S : Finset ℕ | S.card = 1 ∧ 0 ∉ S ∧ ∑ n ∈ S, (1 : ℚ) / n = 1} = + {{1}} := by + ext S + simp only [Set.mem_ofPred_eq, Set.mem_singleton_iff, Finset.card_eq_one] + constructor + · rintro ⟨⟨a, rfl⟩, -, hsum⟩ + simp only [Finset.sum_singleton, one_div, inv_eq_one, Nat.cast_eq_one] at hsum + rw [hsum] + · rintro rfl + exact ⟨⟨1, rfl⟩, by simp, by simp⟩ + rw [F, h, Set.ncard_singleton] + +/-- $1$ is not a sum of two distinct unit fractions. -/ +@[category test, AMS 11] +theorem F_two : F 2 = 0 := by + have h : {S : Finset ℕ | S.card = 2 ∧ 0 ∉ S ∧ ∑ n ∈ S, (1 : ℚ) / n = 1} = ∅ := by + ext S + simp only [Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false, not_and] + intro hS h0 hsum + obtain ⟨x, y, hxy, rfl⟩ := Finset.card_eq_two.mp hS + simp only [Finset.mem_insert, Finset.mem_singleton, not_or] at h0 + rw [Finset.sum_pair hxy] at hsum + have hx : (x : ℚ) ≠ 0 := by exact_mod_cast Ne.symm h0.1 + have hy : (y : ℚ) ≠ 0 := by exact_mod_cast Ne.symm h0.2 + rw [div_add_div _ _ hx hy, div_eq_one_iff_eq (mul_ne_zero hx hy)] at hsum + have e : y + x = x * y := by + exact_mod_cast (by linear_combination hsum : (y : ℚ) + x = x * y) + rcases Nat.lt_or_ge x 3 with hx3 | hx3 + · interval_cases x <;> omega + rcases Nat.lt_or_ge y 3 with hy3 | hy3 + · interval_cases y <;> omega + nlinarith + rw [F, h, Set.ncard_empty] + +/-- If $0 < x < y < z$ and $1 = \frac{1}{x} + \frac{1}{y} + \frac{1}{z}$, then +$(x, y, z) = (2, 3, 6)$. -/ +@[category API, AMS 11] +private lemma eq_two_three_six {x y z : ℕ} (hx : 0 < x) (hxy : x < y) (hyz : y < z) + (h : (1 : ℚ) / x + 1 / y + 1 / z = 1) : x = 2 ∧ y = 3 ∧ z = 6 := by + have hx' : (x : ℚ) ≠ 0 := by exact_mod_cast hx.ne' + have hy' : (y : ℚ) ≠ 0 := by exact_mod_cast (by omega : y ≠ 0) + have hz' : (z : ℚ) ≠ 0 := by exact_mod_cast (by omega : z ≠ 0) + rw [div_add_div _ _ hx' hy', div_add_div _ _ (mul_ne_zero hx' hy') hz', + div_eq_one_iff_eq (mul_ne_zero (mul_ne_zero hx' hy') hz')] at h + have e : y * z + x * z + x * y = x * y * z := by + exact_mod_cast (by linear_combination h : (y * z + x * z + x * y : ℚ) = x * y * z) + rcases Nat.lt_or_ge x 3 with hx3 | hx3 + · interval_cases x + · nlinarith + · rcases Nat.lt_or_ge y 4 with hy4 | hy4 + · interval_cases y + exact ⟨rfl, rfl, by omega⟩ + · nlinarith + · have h1 : x * z < y * z := Nat.mul_lt_mul_of_pos_right hxy (by omega) + have h2 : x * y < y * z := by nlinarith + have h3 : 3 * (y * z) ≤ x * (y * z) := Nat.mul_le_mul_right _ hx3 + nlinarith + +/-- The only representation of $1$ as a sum of three distinct unit fractions is +$1 = \frac{1}{2} + \frac{1}{3} + \frac{1}{6}$. -/ +@[category test, AMS 11] +theorem F_three : F 3 = 1 := by + have h : {S : Finset ℕ | S.card = 3 ∧ 0 ∉ S ∧ ∑ n ∈ S, (1 : ℚ) / n = 1} = + {{2, 3, 6}} := by + ext S + simp only [Set.mem_ofPred_eq, Set.mem_singleton_iff] + constructor + · rintro ⟨hS, h0, hsum⟩ + obtain ⟨x, y, z, hxy, hxz, hyz, rfl⟩ := Finset.card_eq_three.mp hS + simp only [Finset.mem_insert, Finset.mem_singleton, not_or] at h0 + rw [Finset.sum_insert (by simp [hxy, hxz]), Finset.sum_pair hyz] at hsum + have hx : 0 < x := by omega + have hy : 0 < y := by omega + have hz : 0 < z := by omega + rcases lt_or_gt_of_ne hxy with h1 | h1 <;> rcases lt_or_gt_of_ne hxz with h2 | h2 <;> + rcases lt_or_gt_of_ne hyz with h3 | h3 + · obtain ⟨rfl, rfl, rfl⟩ := eq_two_three_six hx h1 h3 (by linarith); decide + · obtain ⟨rfl, rfl, rfl⟩ := eq_two_three_six hx h2 h3 (by linarith); decide + · omega + · obtain ⟨rfl, rfl, rfl⟩ := eq_two_three_six hz h2 h1 (by linarith); decide + · obtain ⟨rfl, rfl, rfl⟩ := eq_two_three_six hy h1 h2 (by linarith); decide + · omega + · obtain ⟨rfl, rfl, rfl⟩ := eq_two_three_six hy h3 h2 (by linarith); decide + · obtain ⟨rfl, rfl, rfl⟩ := eq_two_three_six hz h3 h1 (by linarith); decide + · rintro rfl + refine ⟨by decide, by decide, ?_⟩ + rw [Finset.sum_insert (by decide), Finset.sum_pair (by decide)] + norm_num + rw [F, h, Set.ncard_singleton] + +/-- The values $F(1), \ldots, F(8)$ are $1, 0, 1, 6, 72, 2320, 245765, 151182379$ +([OEIS A006585](https://oeis.org/A006585)). $F(8)$ is due to John Dethridge (2004). +It was recomputed independently in the +[erdosproblems.com forum](https://www.erdosproblems.com/forum/thread/148). -/ +@[category test, AMS 11] +theorem F_first_values : + F 1 = 1 ∧ F 2 = 0 ∧ F 3 = 1 ∧ F 4 = 6 ∧ F 5 = 72 ∧ F 6 = 2320 ∧ F 7 = 245765 ∧ + F 8 = 151182379 := by + refine ⟨F_one, F_two, F_three, ?_⟩ + sorry + +/-- The first values of the sequence are $1, 2, 6, 42, 1806$. -/ +@[category test, AMS 11] +theorem u_first_values : u 0 = 1 ∧ u 1 = 2 ∧ u 2 = 6 ∧ u 3 = 42 ∧ u 4 = 1806 := by + decide + +def erdos_148.answer : ℕ → ℝ := sorry + +/-- +Let $F(k)$ be the number of solutions to +$$ 1= \frac{1}{n_1}+\cdots+\frac{1}{n_k},$$ +where $1\leq n_1<\cdots0$ is some absolute constant and $c_0=1.5979102\ldots$ is the square of the 'Vardi +constant' $1.26408\cdots$. The lower bound is due to Konyagin [Ko14] and the upper bound to +Elsholtz and Planitzer [ElPl21]. (erdosproblems.com gives $c_0=1.26408\cdots$; +[ElPl21, Remark 3] gives $c_0=1.5979102\ldots$.) + +[Ko14, Theorem 1] states the lower bound in the explicit form +$$F(k) \geq \exp\left(\exp\left(\left(\frac{(\log 2)(\log 3)}{3}+o(1)\right) +\frac{k}{\log k}\right)\right) \quad (k \to \infty),$$ +which is the statement formalised here. +-/ +@[category research solved, AMS 11] +theorem erdos_148.variants.lower_bound : + ∃ o : ℕ → ℝ, o =o[atTop] (1 : ℕ → ℝ) ∧ ∀ᶠ k : ℕ in atTop, + exp (exp ((log 2 * log 3 / 3 + o k) * ((k : ℝ) / log k))) ≤ F k := by + sorry + +/-- +The current best bounds known are +$$2^{c^{\frac{k}{\log k}}}\leq F(k) \leq c_0^{(\frac{1}{5}+o(1))2^k},$$ +where $c>0$ is some absolute constant and $c_0=1.5979102\ldots$ is the square of the 'Vardi +constant' $1.26408\cdots$. The lower bound is due to Konyagin [Ko14] and the upper bound to +Elsholtz and Planitzer [ElPl21]. (erdosproblems.com gives $c_0=1.26408\cdots$; +[ElPl21, Remark 3] gives $c_0=1.5979102\ldots$.) + +[ElPl21, Corollary 3(2)] shows that for every $\varepsilon > 0$ and all $k \geq k(\varepsilon)$, +the number $f_k(1,1) \geq F(k)$ of solutions with $n_1 \leq \cdots \leq n_k$ is less than +$c_0^{(\frac{2}{5}+\varepsilon)2^{k-1}} = c_0^{(\frac{1}{5}+\frac{\varepsilon}{2})2^k}$. +-/ +@[category research solved, AMS 11] +theorem erdos_148.variants.upper_bound : + ∃ o : ℕ → ℝ, o =o[atTop] (1 : ℕ → ℝ) ∧ ∀ᶠ k : ℕ in atTop, + (F k : ℝ) ≤ c₀ ^ ((1 / 5 + o k) * 2 ^ k) := by + sorry + +end Erdos148 diff --git a/FormalConjectures/ErdosProblems/15.lean b/FormalConjectures/ErdosProblems/15.lean index 20e1006..a6e6fbe 100644 --- a/FormalConjectures/ErdosProblems/15.lean +++ b/FormalConjectures/ErdosProblems/15.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 15: Convergence of Series with Primes @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/15](https://www.erdosproblems.com/15) -/ +@[expose] public section + namespace Erdos15 open Filter Topology @@ -32,10 +35,15 @@ where $p_n$ is the sequence of primes? Note: In the problem statement, $p_n$ is the $n$-th prime, indexed such that $p_1=2, p_2=3, \ldots$. We 0-index here to reflect how Nat.nth works. + +Note: convergence here is convergence of the sequence of partial sums, which is what the +problem asks about. `Summable` would be the wrong notion: it is unconditional summability, +equivalent over $\mathbb{R}$ to absolute convergence, and $\sum_n n/p_n$ diverges. -/ -@[category research open, AMS 11] -theorem erdos_15 : answer(sorry) ↔ - Summable (fun k : ℕ => (-1 : ℚ) ^ (k + 1) * (k + 1) / (k.nth Nat.Prime)) := by +@[category research open, question, AMS 11] +theorem erdos_15 : + ∃ l : ℝ, Tendsto (fun N => ∑ k ∈ Finset.range N, + (-1 : ℝ) ^ (k + 1) * (k + 1) / (k.nth Nat.Prime)) atTop (𝓝 l) := by sorry diff --git a/FormalConjectures/ErdosProblems/151.lean b/FormalConjectures/ErdosProblems/151.lean new file mode 100644 index 0000000..28f7fd3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/151.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 151 + +*References:* +- [erdosproblems.com/151](https://www.erdosproblems.com/151) +- [Er88] Erdős, P., *Problems and results in combinatorial analysis and graph theory*. + Discrete Math. (1988), 81-92. +- [EGT92] Erdős, P. and Gallai, T. and Tuza, Zs., *Covering the cliques of a graph with + vertices*. Discrete Math. (1992), 279-289. +-/ + +@[expose] public section + +namespace Erdos151 + +open SimpleGraph + +variable {V : Type*} + +/-- `s` is a maximal clique of `G` with at least two vertices. -/ +def IsBigMaximalClique (G : SimpleGraph V) (s : Finset V) : Prop := + Maximal (fun t : Finset V ↦ G.IsClique (t : Set V)) s ∧ 2 ≤ s.card + +/-- `T` meets every maximal clique of `G` with at least two vertices. -/ +def IsCliqueTransversal (G : SimpleGraph V) (T : Finset V) : Prop := + ∀ s, IsBigMaximalClique G s → ∃ v ∈ s, v ∈ T + +/-- The clique transversal number $\tau(G)$: the minimal number of vertices that meet every +maximal clique of `G` with at least two vertices. -/ +noncomputable def cliqueTransversalNumber (G : SimpleGraph V) : ℕ := + sInf {k | ∃ T : Finset V, IsCliqueTransversal G T ∧ T.card = k} + +/-- $H(n)$: the largest `k` such that every triangle-free graph on `n` vertices contains an +independent set on `k` vertices. -/ +noncomputable def H (n : ℕ) : ℕ := + sSup {k | ∀ G : SimpleGraph (Fin n), G.CliqueFree 3 → ∃ s, G.IsNIndepSet k s} + +/-- +For a graph $G$, let $\tau(G)$ denote the minimal number of vertices that include at least one +from each maximal clique of $G$ on at least two vertices. Let $H(n)$ be maximal such that every +triangle-free graph on $n$ vertices contains an independent set on $H(n)$ vertices. + +If $G$ is a graph on $n$ vertices, is $\tau(G)\leq n-H(n)$? + +Erdős remarked that this is perhaps completely wrongheaded [Er88]. +-/ +@[category research open, question, AMS 5] +theorem erdos_151 : + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), cliqueTransversalNumber G ≤ n - H n := by + sorry + +/-- +Erdős and Gallai made no progress on the question even when $G$ is $K_4$-free [Er88]. +-/ +@[category research open, question, AMS 5] +theorem erdos_151.variants.cliqueFree_four : + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), G.CliqueFree 4 → + cliqueTransversalNumber G ≤ n - H n := by + sorry + +/-- +If $G$ is triangle-free, then $\tau(G)\leq n-H(n)$: the complement of an independent set meets +every edge. +-/ +@[category research solved, AMS 5] +theorem erdos_151.variants.cliqueFree_three (n : ℕ) (G : SimpleGraph (Fin n)) + (hG : G.CliqueFree 3) : cliqueTransversalNumber G ≤ n - H n := by + sorry + +/-- +It is easy to see that $\tau(G)\leq n-\sqrt{n}$. We state this with $\lfloor\sqrt{n}\rfloor$: +with the real square root the bound fails for a single edge ($n = 2$, $\tau = 1$). +-/ +@[category research solved, AMS 5] +theorem erdos_151.variants.sqrt_bound (n : ℕ) (G : SimpleGraph (Fin n)) : + cliqueTransversalNumber G ≤ n - Nat.sqrt n := by + sorry + +end Erdos151 diff --git a/FormalConjectures/ErdosProblems/159.lean b/FormalConjectures/ErdosProblems/159.lean new file mode 100644 index 0000000..9b5d253 --- /dev/null +++ b/FormalConjectures/ErdosProblems/159.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 159 + +*References:* +- [erdosproblems.com/159](https://www.erdosproblems.com/159) +- [Er78] Erdős, P., Problems and results in combinatorial analysis and combinatorial number + theory. Proc. Ninth Southeastern Conf. Combinatorics, Graph Theory and Computing (1978), 29-40. +- [Sp77] Spencer, J., Asymptotic lower bounds for Ramsey functions. Discrete Math. (1977), 69-76. +-/ + +@[expose] public section + +namespace Erdos159 + +/-- +There exists some constant $c>0$ such that +$$R(C_4,K_n) \ll n^{2-c}.$$ + +The prize of $100 is offered in [Er78] for a proof or disproof. + +This problem is #17 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, AMS 5] +theorem erdos_159 : + ∃ (c : ℝ) (_ : 0 < c) (C : ℝ), + ∀ (n : ℕ), 1 ≤ n → + (SimpleGraph.graphRamsey (SimpleGraph.cycleGraph 4) + (SimpleGraph.completeGraph (Fin n)) : ℝ) ≤ C * (n : ℝ) ^ (2 - c) := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos159 diff --git a/FormalConjectures/ErdosProblems/160.lean b/FormalConjectures/ErdosProblems/160.lean index 99cd2ba..526875b 100644 --- a/FormalConjectures/ErdosProblems/160.lean +++ b/FormalConjectures/ErdosProblems/160.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 160 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/160](https://www.erdosproblems.com/160) -/ +@[expose] public section + namespace Erdos160 /-- @@ -48,26 +51,29 @@ theorem erdos_160.known_upper : open Real +def erdos_160.better_upper.answer : ℕ → ℝ := sorry + /-- Estimate $h(n)$ by finding a better upper bound. -/ -@[category research open, AMS 5 51] +@[category research open, question value, AMS 5 51] theorem erdos_160.better_upper : - let upper_bound : ℕ → ℝ := answer(sorry) - (fun n => (erdos_160.h n : ℝ)) =O[atTop] upper_bound ∧ - upper_bound =o[atTop] fun n => (n : ℝ) ^ ((2 : ℝ) / 3) := by + (fun n => (erdos_160.h n : ℝ)) =O[atTop] erdos_160.better_upper.answer ∧ + erdos_160.better_upper.answer =o[atTop] fun n => (n : ℝ) ^ ((2 : ℝ) / 3) := by sorry +def erdos_160.better_lower.answer : ℕ → ℝ := sorry + /-- Estimate $h(n)$ by finding a better lower bound. -/ -@[category research open, AMS 5 51] +@[category research open, question value, AMS 5 51] theorem erdos_160.better_lower: - let lower_bound : ℕ → ℝ := answer(sorry) - (lower_bound =O[atTop] fun n => (erdos_160.h n : ℝ)) ∧ + (erdos_160.better_lower.answer =O[atTop] fun n => (erdos_160.h n : ℝ)) ∧ ∀ c > 0, (fun (n : ℕ) => exp (c * log n ^ ((1 : ℝ) / 12))) =O[atTop] (fun n => (erdos_160.h n : ℝ)) → - ∀ c > 0, (fun (n : ℕ) => exp (c * log n ^ ((1 : ℝ) / 12))) =o[atTop] lower_bound := by + ∀ c > 0, (fun (n : ℕ) => exp (c * log n ^ ((1 : ℝ) / 12))) =o[atTop] + erdos_160.better_lower.answer := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/161.lean b/FormalConjectures/ErdosProblems/161.lean new file mode 100644 index 0000000..942c676 --- /dev/null +++ b/FormalConjectures/ErdosProblems/161.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 161 + +*References:* +- [erdosproblems.com/161](https://www.erdosproblems.com/161) +- [CFS11] Conlon, David and Fox, Jacob and Sudakov, Benny, Large almost monochromatic subsets in + hypergraphs. Israel J. Math. (2011), 423--432. +- [Er90b] Erdős, Paul, Problems and results on graphs and hypergraphs: similarities and differences + . Mathematics of Ramsey theory (1990), 12-28. +-/ + +@[expose] public section + +namespace Erdos161 + +open Filter Asymptotics + +def erdos_161.parts.i.answer : ℕ → Set (ℝ × ℝ) := sorry + +/-- +Let $\alpha\in[0,1/2)$ and $n,t\geq 1$. Let $F^{(t)}(n,\alpha)$ be the smallest $m$ such that we can +$2$-colour the edges of the complete $t$-uniform hypergraph on $n$ vertices such that if $X\subseteq +[n]$ with $\lvert X\rvert \geq m$ then there are at least $\alpha \binom{\lvert X\rvert}{t}$ many +$t$-subsets of $X$ of each colour. For fixed $n,t$ as we change $\alpha$ from $0$ to $1/2$ does +$F^{(t)}(n,\alpha)$ increase continuously or are there jumps? Only one jump? + +Here growth is compared up to constant factors as $n\to\infty$. At $\alpha=0$, +each color must occur, following the source's Ramsey convention. +-/ +@[category research open, question value, AMS 5] +theorem erdos_161.parts.i : + ∀ t : ℕ, 1 ≤ t → + {p | p.1 ∈ Set.Ico (0 : ℝ) (1 / 2) ∧ p.2 ∈ Set.Ico (0 : ℝ) (1 / 2) ∧ + (fun n ↦ (Hypergraph.balancedColoringThreshold n t p.1 : ℝ)) =Θ[atTop] + (fun n ↦ (Hypergraph.balancedColoringThreshold n t p.2 : ℝ))} = + erdos_161.parts.i.answer t := by + sorry + +/-- +For fixed $t\geq 3$, do all positive densities below $1/2$ give the same asymptotic order? +-/ +@[category research open, question, AMS 5] +theorem erdos_161.parts.ii : + ∀ t : ℕ, 3 ≤ t → ∀ α β : ℝ, + 0 < α → α < 1 / 2 → 0 < β → β < 1 / 2 → + (fun n ↦ (Hypergraph.balancedColoringThreshold n t α : ℝ)) =Θ[atTop] + (fun n ↦ (Hypergraph.balancedColoringThreshold n t β : ℝ)) := by + sorry + +end Erdos161 diff --git a/FormalConjectures/ErdosProblems/162.lean b/FormalConjectures/ErdosProblems/162.lean new file mode 100644 index 0000000..30b8e7e --- /dev/null +++ b/FormalConjectures/ErdosProblems/162.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 162 + +*References:* +- [erdosproblems.com/162](https://www.erdosproblems.com/162) +- [Er90b] Erdős, Paul, *Problems and results on graphs and hypergraphs: similarities and + differences*. Mathematics of Ramsey theory (1990), 12-28. +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos162 + +/-- The number of edges of $K_n$ inside `H` that get colour `b` under the colouring `c`. -/ +def colourEdgeCount {n : ℕ} (c : Sym2 (Fin n) → Bool) (H : Finset (Fin n)) (b : Bool) : ℕ := + (H.sym2.filter (fun e ↦ ¬ e.IsDiag ∧ c e = b)).card + +/-- Every set `H` of at least `k` vertices contains more than $\alpha\binom{|H|}{2}$ edges of +each colour under `c`. -/ +def IsBalancedAbove (n : ℕ) (α : ℝ) (c : Sym2 (Fin n) → Bool) (k : ℕ) : Prop := + ∀ H : Finset (Fin n), k ≤ H.card → ∀ b : Bool, + α * (H.card.choose 2 : ℝ) < colourEdgeCount c H b + +/-- $F(n, \alpha)$: the smallest `k` such that some 2-colouring of $K_n$ satisfies +`IsBalancedAbove n α c k`. + +The source says "largest `k`". Read literally, every `k > n` works vacuously, so no largest `k` +exists. The smallest `k` is the reading consistent with the stated $\Theta(\log n)$ growth. -/ +noncomputable def F (n : ℕ) (α : ℝ) : ℕ := + sInf {k : ℕ | ∃ c : Sym2 (Fin n) → Bool, IsBalancedAbove n α c k} + +/-- +Let $\alpha > 0$ and $n \geq 1$. Let $F(n,\alpha)$ be the largest $k$ such that there exists some +2-colouring of the edges of $K_n$ in which any induced subgraph $H$ on at least $k$ vertices +contains more than $\alpha\binom{|H|}{2}$ many edges of each colour. + +Prove that for every fixed $0 \leq \alpha \leq 1/2$, as $n \to \infty$, +$F(n,\alpha) \sim c_\alpha \log n$ for some constant $c_\alpha$. + +We require $\alpha < 1/2$: at $\alpha = 1/2$ no colouring works for any `k ≤ n` +(see `erdos_162.variants.half`). +-/ +@[category research open, AMS 5] +theorem erdos_162 (α : ℝ) (h0 : 0 ≤ α) (h1 : α < 1 / 2) : + ∃ c : ℝ, (fun n : ℕ ↦ (F n α : ℝ)) ~[atTop] (fun n : ℕ ↦ c * Real.log n) := by + sorry + +/-- +It is easy to show with the probabilistic method that there exist $c_1(\alpha), c_2(\alpha)$ such +that $c_1(\alpha)\log n < F(n,\alpha) < c_2(\alpha)\log n$. +-/ +@[category research solved, AMS 5] +theorem erdos_162.variants.bounds (α : ℝ) (h0 : 0 ≤ α) (h1 : α < 1 / 2) : + ∃ c₁ c₂ : ℝ, 0 < c₁ ∧ c₁ < c₂ ∧ ∀ᶠ n : ℕ in atTop, + c₁ * Real.log n < F n α ∧ (F n α : ℝ) < c₂ * Real.log n := by + sorry + +/-- +At $\alpha = 1/2$ the two colour counts in $H$ add up to $\binom{|H|}{2}$, so both cannot exceed +half of it. Hence $F(n, 1/2) = n + 1$, and the claim fails at $\alpha = 1/2$. +-/ +@[category textbook, AMS 5] +theorem erdos_162.variants.half (n : ℕ) : F n (1 / 2) = n + 1 := by + have hvac : ∀ c : Sym2 (Fin n) → Bool, IsBalancedAbove n (1 / 2) c (n + 1) := by + intro c H hH + have := H.card_le_univ + simp at this + omega + refine le_antisymm (Nat.sInf_le ⟨fun _ ↦ true, hvac _⟩) ?_ + refine le_csInf ⟨n + 1, fun _ ↦ true, hvac _⟩ ?_ + rintro k ⟨c, hc⟩ + by_contra! hk + have ht := hc Finset.univ (by simp; omega) true + have hf := hc Finset.univ (by simp; omega) false + have hsum : colourEdgeCount c Finset.univ true + colourEdgeCount c Finset.univ false = + n.choose 2 := by + have h1 := Finset.card_filter_add_card_filter_not + (s := (Finset.univ : Finset (Fin n)).sym2.filter fun e ↦ ¬ e.IsDiag) (fun e ↦ c e = true) + simp only [Finset.filter_filter, Bool.not_eq_true] at h1 + rw [colourEdgeCount, colourEdgeCount, h1, Finset.sym2_univ, ← Fintype.card_subtype, + Sym2.card_subtype_not_diag, Fintype.card_fin] + simp only [Finset.card_univ, Fintype.card_fin] at ht hf + have : (colourEdgeCount c Finset.univ true : ℝ) + colourEdgeCount c Finset.univ false = + n.choose 2 := by exact_mod_cast hsum + linarith + +/-- `k = n + 1` always works, since no vertex set has more than `n` elements. -/ +@[category API, AMS 5] +theorem isBalancedAbove_succ (n : ℕ) (α : ℝ) (c : Sym2 (Fin n) → Bool) : + IsBalancedAbove n α c (n + 1) := by + intro H hH + have := H.card_le_univ + simp at this + omega + +/-- $F(n, \alpha)$ is at most `n + 1`. -/ +@[category API, AMS 5] +theorem F_le_succ (n : ℕ) (α : ℝ) : F n α ≤ n + 1 := + Nat.sInf_le ⟨fun _ ↦ true, isBalancedAbove_succ n α _⟩ + +end Erdos162 diff --git a/FormalConjectures/ErdosProblems/165.lean b/FormalConjectures/ErdosProblems/165.lean new file mode 100644 index 0000000..8a3347c --- /dev/null +++ b/FormalConjectures/ErdosProblems/165.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 165 + +*References:* +- [erdosproblems.com/165](https://www.erdosproblems.com/165) +- [Er61] Erdős, P., *Graph theory and probability. II*. Canad. J. Math. (1961), 346-352. +- [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. +- [Er90b] Erdős, Paul, *Problems and results on graphs and hypergraphs: similarities and + differences*. Mathematics of Ramsey theory (1990), 12-28. +- [Er93] Erdős, Paul, *Some of my favorite solved and unsolved problems in graph theory*. + Quaestiones Math. (1993), 333-350. +- [Er97c] Erdős, Paul, *Some of my favorite problems and results*. The mathematics of Paul Erdős, + I (1997), 47-67. +- [Sh83] Shearer, J. B., *A note on the independence number of triangle-free graphs*. Discrete + Math. (1983), 83-87. +- [Ki95] Kim, J. H., *The Ramsey number $R(3,t)$ has order of magnitude $t^2/\log t$*. Random + Structures Algorithms (1995), 173-207. +- [CJMS25] Campos, M. and Jenssen, M. and Michelen, M. and Sahasrabudhe, J., *A new lower bound + for the Ramsey numbers $R(3,k)$*. arXiv:2505.13371 (2025). +- [HHKP25] Hefty, Z. and Horn, P. and King, D. and Pfender, F., *Improving $R(3,k)$ in just two + bites*. arXiv:2510.19718 (2025). +-/ + +@[expose] public section + +open Filter + +open scoped Asymptotics + +namespace Erdos165 + +local notation "R(" k ", " l ")" => SimpleGraph.classicalRamsey k l + +def erdos_165.answer : ℕ → ℝ := sorry + +/-- +Give an asymptotic formula for $R(3,k)$. +-/ +@[category research open, question value, AMS 5] +theorem erdos_165 : + (fun k : ℕ ↦ (R(3, k) : ℝ)) ~[atTop] erdos_165.answer := by + sorry + +/-- +Campos, Jenssen, Michelen and Sahasrabudhe [CJMS25] and Hefty, Horn, King and Pfender [HHKP25] +conjecture that $R(3,k) \sim \frac{k^2}{2\log k}$. +-/ +@[category research open, AMS 5] +theorem erdos_165.variants.conjecture : + (fun k : ℕ ↦ (R(3, k) : ℝ)) ~[atTop] (fun k : ℕ ↦ (k : ℝ) ^ 2 / (2 * Real.log k)) := by + sorry + +/-- +Shearer [Sh83] proved $R(3,k) \leq (1+o(1))\frac{k^2}{\log k}$. +-/ +@[category research solved, AMS 5] +theorem erdos_165.variants.upper : + ∀ ε > (0 : ℝ), ∀ᶠ k : ℕ in atTop, + (R(3, k) : ℝ) ≤ (1 + ε) * (k : ℝ) ^ 2 / Real.log k := by + sorry + +/-- +Hefty, Horn, King and Pfender [HHKP25] proved $R(3,k) \geq (1/2+o(1))\frac{k^2}{\log k}$, +improving earlier bounds of Kim [Ki95] and Campos, Jenssen, Michelen and Sahasrabudhe [CJMS25]. +-/ +@[category research solved, AMS 5] +theorem erdos_165.variants.lower : + ∀ ε > (0 : ℝ), ∀ᶠ k : ℕ in atTop, + (1 / 2 - ε) * (k : ℝ) ^ 2 / Real.log k ≤ (R(3, k) : ℝ) := by + sorry + +end Erdos165 diff --git a/FormalConjectures/ErdosProblems/170.lean b/FormalConjectures/ErdosProblems/170.lean index 9fe34ed..0f080e5 100644 --- a/FormalConjectures/ErdosProblems/170.lean +++ b/FormalConjectures/ErdosProblems/170.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 170 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/170](https://www.erdosproblems.com/170) -/ +@[expose] public section + open scoped Topology namespace Erdos170 @@ -53,9 +56,11 @@ def F (N : ℕ) : ℕ := Finset.min' (Finset.image Finset.card (PerfectRulersLengthN N)) (Finset.image_nonempty.mpr ⟨TrivialRuler N, trivial_ruler_is_perfect N⟩) +def erdos170.answer : ℝ := sorry + /-- The problem is to determine the limit of the sequence $\frac{F(N)}{\sqrt{N}}$ as $N \to \infty$. -/ -@[category research open, AMS 5] -lemma erdos170 : Filter.Tendsto (fun N => F N / √N) Filter.atTop (𝓝 answer(sorry)) := by sorry +@[category research open, question value, AMS 5] +lemma erdos170 : Filter.Tendsto (fun N => F N / √N) Filter.atTop (𝓝 erdos170.answer) := by sorry /-- A known lower bound to the limit by Leech [Le56], which is $1.56\dots$. -/ noncomputable abbrev lower_bound := √(sSup {2 * (1 - Real.sin θ / θ) | θ ≠ 0}) diff --git a/FormalConjectures/ErdosProblems/173.lean b/FormalConjectures/ErdosProblems/173.lean new file mode 100644 index 0000000..4cb6cbb --- /dev/null +++ b/FormalConjectures/ErdosProblems/173.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 173 + +*References:* +- [erdosproblems.com/173](https://www.erdosproblems.com/173) +- [Sh76] Shader, L. E., *All right triangles are Ramsey in $E^2$!*. J. Combin. Theory Ser. A + (1976), 385-389. +-/ + +@[expose] public section + +open Affine +open scoped Congruent EuclideanGeometry + +namespace Erdos173 + +/-- +The colouring `c` contains a monochromatic triangle congruent to `T`. + +Since `T'` is arbitrary, relabellings and reflections of `T` are allowed. Rescaling is not. +-/ +def HasMonochromaticCopy (c : ℝ² → Fin 2) (T : Triangle ℝ ℝ²) : Prop := + ∃ T' : Triangle ℝ ℝ², (T'.points ≅ T.points) ∧ ∃ i, ∀ j, c (T'.points j) = i + +/-- +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$. + +The colouring is arbitrary. No measurability is assumed. `≅` compares vertices with the same +label, so the conclusion allows a relabelling `σ`. +-/ +@[category research open, question, AMS 5 51] +theorem erdos_173 : ∀ (c : ℝ² → Fin 2) (T₁ T₂ : Triangle ℝ ℝ²), + ¬ HasMonochromaticCopy c T₁ → ¬ HasMonochromaticCopy c T₂ → + ∃ σ : Equiv.Perm (Fin 3), T₁.points ∘ σ ≅ T₂.points := by + sorry + +/-- +Shader [Sh76] proved that in any $2$-colouring of $\mathbb{R}^2$, every right-angled triangle +has a monochromatic congruent copy. +-/ +@[category research solved, AMS 5 51] +theorem erdos_173.variants.right_triangle (c : ℝ² → Fin 2) (T : Triangle ℝ ℝ²) + (hT : ∠ (T.points 0) (T.points 1) (T.points 2) = Real.pi / 2) : + HasMonochromaticCopy c T := by + sorry + +/-- +The exceptional triangle can exist: colouring the plane in alternating half-open strips of +suitable width gives no monochromatic copy of some equilateral triangle. +-/ +@[category research solved, AMS 5 51] +theorem erdos_173.variants.equilateral_exception : ∃ (c : ℝ² → Fin 2) (T : Triangle ℝ ℝ²), + dist (T.points 0) (T.points 1) = dist (T.points 1) (T.points 2) ∧ + dist (T.points 1) (T.points 2) = dist (T.points 2) (T.points 0) ∧ + ¬ HasMonochromaticCopy c T := by + sorry + +end Erdos173 diff --git a/FormalConjectures/ErdosProblems/174.lean b/FormalConjectures/ErdosProblems/174.lean new file mode 100644 index 0000000..95dbb29 --- /dev/null +++ b/FormalConjectures/ErdosProblems/174.lean @@ -0,0 +1,149 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 174 + +*References:* +- [erdosproblems.com/174](https://www.erdosproblems.com/174) +- [EGMRSS73] Erdős, P. and Graham, R. L. and Montgomery, P. and Rothschild, B. L. and Spencer, + J. and Straus, E. G., *Euclidean Ramsey Theorems I*. J. Comb. Th. A (1973), 341-363. + [PDF](https://www.renyi.hu/~p_erdos/1973-08.pdf) +- [Er75f] Erdős, Paul, *On some problems of elementary and combinatorial geometry*. Ann. Mat. Pura + Appl. (4) (1975), 99-108. [PDF](https://www.renyi.hu/~p_erdos/1975-25.pdf) +- [FrRo90] Frankl, P. and Rödl, V., *A partition property of simplices in Euclidean space*. + J. Amer. Math. Soc. (1990), 1-7. +- [Kr92] Kříž, Igor, *All trapezoids are Ramsey*. Discrete Math. (1992), 59-62. +- [LRW12] Leader, Imre and Russell, Paul A. and Walters, Mark, *Transitive sets in Euclidean + Ramsey theory*. J. Combin. Theory Ser. A (2012), 382-396. + [arXiv:1012.1350](https://arxiv.org/abs/1012.1350) +-/ + +@[expose] public section + +namespace Erdos174 + +/-- A finite set `A ⊆ ℝⁿ` is Ramsey if for every number `k ≥ 1` of colours there is a +dimension `d` such that every colouring of `ℝᵈ` with `k` colours has a monochromatic copy of +`A`. A copy of `A` is the image of a map `p : A → ℝᵈ` that preserves all distances. -/ +def IsRamsey {n : ℕ} (A : Set (EuclideanSpace ℝ (Fin n))) : Prop := + A.Finite ∧ ∀ k : ℕ, 1 ≤ k → ∃ d : ℕ, ∀ c : EuclideanSpace ℝ (Fin d) → Fin k, + ∃ p : A → EuclideanSpace ℝ (Fin d), + Congruent (fun a : A ↦ (a : EuclideanSpace ℝ (Fin n))) p ∧ ∃ i, ∀ a, c (p a) = i + +/-- A finite set `X ⊆ ℝᵐ` is transitive if its symmetry group acts transitively: any point of +`X` is mapped to any other point of `X` by an isometry of `ℝᵐ` that maps `X` onto itself +[LRW12]. -/ +def IsTransitive {m : ℕ} (X : Set (EuclideanSpace ℝ (Fin m))) : Prop := + X.Finite ∧ ∀ x ∈ X, ∀ y ∈ X, + ∃ g : EuclideanSpace ℝ (Fin m) ≃ᵢ EuclideanSpace ℝ (Fin m), g '' X = X ∧ g x = y + +/-- A set `A ⊆ ℝⁿ` is subtransitive if it is congruent to a subset of a finite transitive set in +some `ℝᵐ`; the dimension `m` may be larger than `n` [LRW12]. -/ +def IsSubtransitive {n : ℕ} (A : Set (EuclideanSpace ℝ (Fin n))) : Prop := + ∃ (m : ℕ) (Y : Set (EuclideanSpace ℝ (Fin m))), IsTransitive Y ∧ + ∃ p : A → EuclideanSpace ℝ (Fin m), + Congruent (fun a : A ↦ (a : EuclideanSpace ℝ (Fin n))) p ∧ ∀ a, p a ∈ Y + +/-- A single point is a Ramsey set. -/ +@[category test, AMS 5 52] +theorem isRamsey_singleton {n : ℕ} (x : EuclideanSpace ℝ (Fin n)) : IsRamsey {x} := + ⟨Set.finite_singleton x, fun _ _ ↦ ⟨0, fun c ↦ + ⟨fun _ ↦ 0, Congruent.of_subsingleton_index, c 0, fun _ ↦ rfl⟩⟩⟩ + +def erdos_174.answer (n : ℕ) : Set (Set (EuclideanSpace ℝ (Fin n))) := sorry + +/-- +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$. + +A copy of $A$ is a set congruent to $A$, as in [EGMRSS73, p. 344]. +-/ +@[category research open, question value, AMS 5 52] +theorem erdos_174 (n : ℕ) : + {A : Set (EuclideanSpace ℝ (Fin n)) | IsRamsey A} = erdos_174.answer n := by + sorry + +/-- +Erdős, Graham, Montgomery, Rothschild, Spencer, and Straus [EGMRSS73] proved that every Ramsey +set is 'spherical': it lies on the surface of some sphere. +-/ +@[category research solved, AMS 5 52] +theorem erdos_174.variants.spherical {n : ℕ} (A : Set (EuclideanSpace ℝ (Fin n))) + (hA : IsRamsey A) : EuclideanGeometry.Cospherical A := by + sorry + +/-- +Graham has conjectured that every spherical set is Ramsey. +-/ +@[category research open, AMS 5 52] +theorem erdos_174.variants.graham {n : ℕ} (A : Set (EuclideanSpace ℝ (Fin n))) + (hA : A.Finite) (hs : EuclideanGeometry.Cospherical A) : IsRamsey A := by + sorry + +/-- +Leader, Russell, and Walters [LRW12] have alternatively conjectured that a set is Ramsey if and +only if it is 'subtransitive': it can be embedded in some higher-dimensional set on which +rotations act transitively. + +We use the definition of [LRW12]: a subset of a finite set whose symmetry group acts +transitively. +-/ +@[category research open, AMS 5 52] +theorem erdos_174.variants.leader_russell_walters {n : ℕ} + (A : Set (EuclideanSpace ℝ (Fin n))) (hA : A.Finite) : + IsRamsey A ↔ IsSubtransitive A := by + sorry + +/-- +Sets known to be Ramsey include vertices of $k$-dimensional rectangles [EGMRSS73]. + +This is the case of the vertices `{x | ∀ i, x i = 0 ∨ x i = a i}` of a rectangular +parallelepiped [EGMRSS73, Cor. 21]; some $a_i$ may be $0$ [EGMRSS73, Cor. 22]. +-/ +@[category research solved, AMS 5 52] +theorem erdos_174.variants.brick {n : ℕ} (a : Fin n → ℝ) : + IsRamsey {x : EuclideanSpace ℝ (Fin n) | ∀ i, x i = 0 ∨ x i = a i} := by + sorry + +/-- +Sets known to be Ramsey include non-degenerate simplices [FrRo90]. + +A non-degenerate simplex is a set of affinely independent points. +-/ +@[category research solved, AMS 5 52] +theorem erdos_174.variants.simplex {n : ℕ} (A : Set (EuclideanSpace ℝ (Fin n))) + (hA : AffineIndependent ℝ (Subtype.val : A → EuclideanSpace ℝ (Fin n))) : + IsRamsey A := by + sorry + +/-- +Sets known to be Ramsey include trapezoids [Kr92]. + +We state it for isosceles trapezoids with vertices $(\pm s, 0)$ and $(\pm t, h)$, $h\neq 0$. +A trapezoid that is not isosceles is not spherical, so it is not Ramsey by [EGMRSS73]. +-/ +@[category research solved, AMS 5 52] +theorem erdos_174.variants.trapezoid (s t h : ℝ) (hh : h ≠ 0) : + IsRamsey ({!₂[-s, 0], !₂[s, 0], !₂[-t, h], !₂[t, h]} : + Set (EuclideanSpace ℝ (Fin 2))) := by + sorry + +end Erdos174 diff --git a/FormalConjectures/ErdosProblems/183.lean b/FormalConjectures/ErdosProblems/183.lean index f6ad547..8b9cb25 100644 --- a/FormalConjectures/ErdosProblems/183.lean +++ b/FormalConjectures/ErdosProblems/183.lean @@ -14,7 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil + +@[expose] public section /-! # Erdős Problem 183 diff --git a/FormalConjectures/ErdosProblems/188.lean b/FormalConjectures/ErdosProblems/188.lean index bbaa800..b58b1de 100644 --- a/FormalConjectures/ErdosProblems/188.lean +++ b/FormalConjectures/ErdosProblems/188.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 188 @@ -27,6 +28,8 @@ import FormalConjecturesUtil Paper No. 4.35, 9. -/ +@[expose] public section + namespace Erdos188 /-- @@ -37,12 +40,14 @@ def s := { k : ℕ | ∃ blue : Set ℂ, (Set.univ \ blue).Pairwise (fun c₁ c₂ => dist c₁ c₂ ≠ 1) ∧ ¬ (∃ᵉ (bs ⊆ blue) (z) (d), ‖d‖ = 1 ∧ bs.IsAPOfLengthWith k z d) } +def erdos_188.answer : ℕ := sorry + /-- What is the smallest $k$ such that $\mathbb{R}^2$ can be red/blue coloured with no pair of red points unit distance apart, and no $k$-term arithmetic progression of blue points with distance 1? -/ -@[category research open, AMS 5] -theorem erdos_188 : IsLeast s answer(sorry) := by +@[category research open, question value, AMS 5] +theorem erdos_188 : IsLeast s erdos_188.answer := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/189.lean b/FormalConjectures/ErdosProblems/189.lean index 11765f5..e2ee76d 100644 --- a/FormalConjectures/ErdosProblems/189.lean +++ b/FormalConjectures/ErdosProblems/189.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 189 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/189](https://www.erdosproblems.com/189) -/ +@[expose] public section + open Affine EuclideanGeometry namespace Erdos189 @@ -49,9 +52,9 @@ monochromatic region is Lebesgue measurable and has measure zero). This was formalized in Lean by Alexeev and Kovac using Aristotle. -/ -@[category research solved, AMS 5 51, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.24.0/ErdosProblems/Erdos189.lean"] +@[category research solved, question, AMS 5 51, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.24.0/ErdosProblems/Erdos189.lean"] theorem erdos_189 : - answer(False) ↔ Erdos189For + ¬ Erdos189For (fun a b c d ↦ line[ℝ, a, b].direction ⟂ line[ℝ, b, c].direction ∧ line[ℝ, b, c].direction ⟂ line[ℝ, c, d].direction ∧ diff --git a/FormalConjectures/ErdosProblems/19.lean b/FormalConjectures/ErdosProblems/19.lean new file mode 100644 index 0000000..1e32ea6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/19.lean @@ -0,0 +1,252 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 19 + +The Erdős–Faber–Lovász conjecture: if $G$ is an edge-disjoint union of $n$ copies of $K_n$, +is $\chi(G) = n$? + +We model $G$ by a family of $n$ vertex sets of size $n$ (the copies of $K_n$) which pairwise +share at most one vertex and which cover the vertex type. Two copies of $K_n$ are +edge-disjoint exactly when their vertex sets share at most one vertex. + +*References:* +* [erdosproblems.com/19](https://www.erdosproblems.com/19) +* [Hi81] Hindman, N., *On a conjecture of Erdős, Faber, and Lovász about $n$-colorings*. + Canad. J. Math. (1981). +* [Ka92] Kahn, J., *Coloring nearly-disjoint hypergraphs with $n + o(n)$ colors*. + J. Combin. Theory Ser. A (1992). +* [KKKMO21] Kang, D. Y., Kelly, T., Kühn, D., Methuku, A. and Osthus, D., *A proof of the + Erdős–Faber–Lovász conjecture*. Ann. of Math. (2023). + [arXiv:2101.04698](https://arxiv.org/abs/2101.04698) +-/ + +@[expose] public section + +open Filter + +namespace Erdos19 + +open scoped Classical in +/-- A configuration of `n` pairwise edge-disjoint copies of $K_n$ covering the vertex type `V`. -/ +structure EFLConfig (V : Type*) (n : ℕ) where + /-- The vertex sets of the `n` cliques. -/ + A : Fin n → Finset V + /-- Each clique has exactly `n` vertices. -/ + card_eq : ∀ i, (A i).card = n + /-- Two different cliques share at most one vertex, i.e. they are edge-disjoint. -/ + inter_le : ∀ i j, i ≠ j → (A i ∩ A j).card ≤ 1 + /-- Every vertex lies in one of the cliques. -/ + cover : ∀ v, ∃ i, v ∈ A i + +namespace EFLConfig + +variable {V : Type*} {n : ℕ} (C : EFLConfig V n) + +/-- The union graph: distinct vertices are adjacent iff they lie in a common clique. -/ +def graph : SimpleGraph V where + Adj u v := u ≠ v ∧ ∃ i, u ∈ C.A i ∧ v ∈ C.A i + symm := ⟨fun _ _ ⟨h, i, hu, hv⟩ => ⟨h.symm, i, hv, hu⟩⟩ + loopless := ⟨fun _ h => h.1 rfl⟩ + +/-- A vertex is *shared* if it lies in two different cliques. -/ +def IsShared (v : V) : Prop := ∃ i j, i ≠ j ∧ v ∈ C.A i ∧ v ∈ C.A j + +open scoped Classical in +/-- The finite set of shared vertices. -/ +noncomputable def sharedSet : Finset V := + ((Finset.univ : Finset (Fin n)).biUnion C.A).filter C.IsShared + +/-- The graph $G$ contains a copy of $K_n$, so $n \le \chi(G)$. -/ +@[category textbook, AMS 5] +theorem le_chromaticNumber : (n : ℕ∞) ≤ C.graph.chromaticNumber := by + rcases Nat.eq_zero_or_pos n with rfl | hn + · simp + have hcl : C.graph.IsClique (C.A ⟨0, hn⟩ : Set V) := by + intro u hu v hv huv + exact ⟨huv, ⟨0, hn⟩, hu, hv⟩ + have := hcl.card_le_chromaticNumber + rwa [C.card_eq] at this + +/-- A vertex that is not shared lies in exactly one clique. -/ +@[category API, AMS 5] +lemma eq_of_not_shared {v : V} (hv : ¬ C.IsShared v) {i j : Fin n} + (hi : v ∈ C.A i) (hj : v ∈ C.A j) : i = j := by + by_contra h + exact hv ⟨i, j, h, hi, hj⟩ + +open scoped Classical in +/-- If the shared vertices can be coloured with $n$ colours so that shared vertices in a common +clique get distinct colours, then $G$ is $n$-colourable. -/ +@[category textbook, AMS 5] +theorem colorable_of_sharedColoring (c : V → Fin n) + (hc : ∀ i u v, u ∈ C.A i → v ∈ C.A i → C.IsShared u → C.IsShared v → c u = c v → u = v) : + C.graph.Colorable n := by + -- private vertices and free colours of each clique + let P : Fin n → Finset V := fun i => (C.A i).filter (fun v => ¬ C.IsShared v) + let U : Fin n → Finset V := fun i => (C.A i).filter C.IsShared + let F : Fin n → Finset (Fin n) := fun i => Finset.univ \ (U i).image c + have hcard : ∀ i, (P i).card ≤ (F i).card := by + intro i + have h1 : (U i).card + (P i).card = n := by + rw [← C.card_eq i]; exact Finset.card_filter_add_card_filter_not _ + have h2 : ((U i).image c).card ≤ (U i).card := Finset.card_image_le + have h3 : (F i).card = n - ((U i).image c).card := by + simp [F, Finset.card_sdiff] + omega + have hne : ∀ i, Nonempty (P i ↪ F i) := fun i => + Function.Embedding.nonempty_of_card_le (by simpa using hcard i) + let e : ∀ i, P i ↪ F i := fun i => Classical.choice (hne i) + let idx : V → Fin n := fun v => Classical.choose (C.cover v) + have hidx : ∀ v, v ∈ C.A (idx v) := fun v => Classical.choose_spec (C.cover v) + let col : V → Fin n := fun v => + if h : C.IsShared v then c v + else ((e (idx v) ⟨v, Finset.mem_filter.2 ⟨hidx v, h⟩⟩ : F (idx v)) : Fin n) + have col_priv : ∀ v (hv : ¬ C.IsShared v) j (hj : v ∈ C.A j), + col v = ((e j ⟨v, Finset.mem_filter.2 ⟨hj, hv⟩⟩ : F j) : Fin n) := by + intro v hv j hj + have key : ∀ i (hi : i = j) (p : v ∈ P i), ((e i ⟨v, p⟩ : F i) : Fin n) = + ((e j ⟨v, Finset.mem_filter.2 ⟨hj, hv⟩⟩ : F j) : Fin n) := by + rintro i rfl p; rfl + simp only [col, dite_eq_right hv] + exact key _ (C.eq_of_not_shared hv (hidx v) hj) _ + have col_free : ∀ v (hv : ¬ C.IsShared v) j (hj : v ∈ C.A j), col v ∈ F j := by + intro v hv j hj + rw [col_priv v hv j hj]; exact Subtype.property _ + refine ⟨SimpleGraph.Coloring.mk col ?_⟩ + rintro u v ⟨huv, j, hu, hv⟩ heq + by_cases su : C.IsShared u <;> by_cases sv : C.IsShared v + · have : col u = c u := dite_eq_left su + have : col v = c v := dite_eq_left sv + exact huv (hc j u v hu hv su sv (by simp_all)) + · have h1 := col_free v sv j hv + have : col u = c u := dite_eq_left su + simp only [F, Finset.mem_sdiff, Finset.mem_univ, true_and, Finset.mem_image] at h1 + exact h1 ⟨u, Finset.mem_filter.2 ⟨hu, su⟩, by rw [← this, heq]⟩ + · have h1 := col_free u su j hu + have : col v = c v := dite_eq_left sv + simp only [F, Finset.mem_sdiff, Finset.mem_univ, true_and, Finset.mem_image] at h1 + exact h1 ⟨v, Finset.mem_filter.2 ⟨hv, sv⟩, by rw [← this, ← heq]⟩ + · rw [col_priv u su j hu, col_priv v sv j hv] at heq + have := (e j).injective (Subtype.ext heq) + exact huv (congrArg Subtype.val this) + +open scoped Classical in +/-- There are at most $\binom{n}{2}$ shared vertices, since two cliques share at most one +vertex. -/ +@[category textbook, AMS 5] +theorem card_sharedSet_le : C.sharedSet.card ≤ n.choose 2 := by + -- assign to each shared vertex a pair of cliques containing it + let f : V → Finset (Fin n) := fun v => + if h : C.IsShared v then {Classical.choose h, Classical.choose (Classical.choose_spec h)} + else ∅ + have hf : ∀ v ∈ C.sharedSet, f v ∈ (Finset.univ : Finset (Fin n)).powersetCard 2 ∧ + ∀ x ∈ f v, v ∈ C.A x := by + intro v hv + have hs : C.IsShared v := (Finset.mem_filter.1 hv).2 + obtain ⟨hij, hi, hj⟩ := Classical.choose_spec (Classical.choose_spec hs) + simp only [f, dite_eq_left hs] + refine ⟨Finset.mem_powersetCard.2 ⟨Finset.subset_univ _, Finset.card_pair hij⟩, ?_⟩ + intro x hx + rcases Finset.mem_insert.1 hx with rfl | hx + · exact hi + · rw [Finset.mem_singleton.1 hx]; exact hj + have hinj : Set.InjOn f C.sharedSet := by + intro u hu v hv huv + obtain ⟨hpu, hu'⟩ := hf u hu + obtain ⟨hpv, hv'⟩ := hf v hv + obtain ⟨a, b, hab, hfab⟩ := Finset.card_eq_two.1 (Finset.mem_powersetCard.1 hpu).2 + have ha : a ∈ f u := by rw [hfab]; simp + have hb : b ∈ f u := by rw [hfab]; simp + have hle := C.inter_le a b hab + have hu2 : u ∈ C.A a ∩ C.A b := Finset.mem_inter.2 ⟨hu' a ha, hu' b hb⟩ + have hv2 : v ∈ C.A a ∩ C.A b := + Finset.mem_inter.2 ⟨hv' a (huv ▸ ha), hv' b (huv ▸ hb)⟩ + exact Finset.card_le_one.1 hle u hu2 v hv2 + have := Finset.card_le_card_of_injOn f (t := (Finset.univ : Finset (Fin n)).powersetCard 2) + (fun v hv => (hf v hv).1) hinj + simpa [Finset.card_powersetCard] using this + +end EFLConfig + +open EFLConfig + +/-- +If $G$ is an edge-disjoint union of $n$ copies of $K_n$, then is $\chi(G) = n$? +-/ +@[category research open, question, AMS 5] +theorem erdos_19 : + ∀ (V : Type) (n : ℕ) (C : EFLConfig V n), C.graph.chromaticNumber = n := by + sorry + +open scoped Classical in +/-- +The Erdős–Faber–Lovász conjecture holds for $n \le 3$. +-/ +@[category test, AMS 5] +theorem erdos_19.variants.le_three {V : Type*} {n : ℕ} (C : EFLConfig V n) (hn : n ≤ 3) : + C.graph.chromaticNumber = n := by + refine le_antisymm ?_ C.le_chromaticNumber + apply SimpleGraph.Colorable.chromaticNumber_le + have hS : C.sharedSet.card ≤ n := by + have h1 := C.card_sharedSet_le + have h2 : n.choose 2 ≤ n := by interval_cases n <;> decide + omega + -- colour the shared vertices injectively + let c : V → Fin n := fun v => + if h : v ∈ C.sharedSet then Fin.castLE hS (C.sharedSet.equivFin ⟨v, h⟩) + else ⟨0, by + obtain ⟨i, hi⟩ := C.cover v + rw [← C.card_eq i]; exact Finset.card_pos.2 ⟨v, hi⟩⟩ + refine C.colorable_of_sharedColoring c ?_ + intro i u v hu hv su sv huv + have mu : u ∈ C.sharedSet := Finset.mem_filter.2 ⟨Finset.mem_biUnion.2 ⟨i, by simp, hu⟩, su⟩ + have mv : v ∈ C.sharedSet := Finset.mem_filter.2 ⟨Finset.mem_biUnion.2 ⟨i, by simp, hv⟩, sv⟩ + simp only [c, dite_eq_left mu, dite_eq_left mv] at huv + have := C.sharedSet.equivFin.injective (Fin.castLE_injective hS huv) + exact congrArg Subtype.val this + +/-- +Hindman [Hi81] proved the Erdős–Faber–Lovász conjecture for $n < 10$. +-/ +@[category research solved, AMS 5] +theorem erdos_19.variants.lt_ten : + ∀ (V : Type) (n : ℕ) (C : EFLConfig V n), n < 10 → C.graph.chromaticNumber = n := by + sorry + +/-- +Kahn [Ka92] proved that $\chi(G) \le (1 + o(1))n$. +-/ +@[category research solved, AMS 5] +theorem erdos_19.variants.kahn : + ∀ ε > (0 : ℝ), ∀ᶠ n in atTop, ∀ (V : Type) (C : EFLConfig V n), + C.graph.Colorable ⌊(1 + ε) * n⌋₊ := by + sorry + +/-- +Kang, Kelly, Kühn, Methuku and Osthus [KKKMO21] proved the Erdős–Faber–Lovász conjecture for +all sufficiently large $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_19.variants.large_n : + ∀ᶠ n in atTop, ∀ (V : Type) (C : EFLConfig V n), C.graph.chromaticNumber = n := by + sorry + +end Erdos19 diff --git a/FormalConjectures/ErdosProblems/195.lean b/FormalConjectures/ErdosProblems/195.lean index 468d1d3..b226644 100644 --- a/FormalConjectures/ErdosProblems/195.lean +++ b/FormalConjectures/ErdosProblems/195.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 195 @@ -27,15 +28,24 @@ import FormalConjecturesUtil integers. Discrete Math. (2019), 1489-1491. -/ +@[expose] public section + namespace Erdos195 +def erdos_195.answer : ℕ := sorry + /-- What is the largest $k$ such that in any permutation of $\mathbb{Z}$ there must exist a monotone $k$-term arithmetic progression $x_1 < \cdots < x_k$? + +Here a permutation of $\mathbb{Z}$ is a one-sided arrangement $a_1, a_2, a_3, \ldots$ of the +integers, i.e. a bijection $\mathbb{N} \to \mathbb{Z}$, and a monotone $k$-term arithmetic +progression is a subsequence $a_{i_1}, \ldots, a_{i_k}$ with $i_1 < \cdots < i_k$ forming an +increasing or decreasing arithmetic progression. -/ -@[category research open, AMS 5] +@[category research open, question value, AMS 5] theorem erdos_195 : - answer(sorry) = sSup {k : ℕ | ∀ f : ℤ ≃ ℤ, HasMonotoneAP f k} := by + erdos_195.answer = sSup {k : ℕ | ∀ f : ℕ ≃ ℤ, HasMonotoneAP f k} := by sorry /-- @@ -43,7 +53,7 @@ Geneson [Ge19] proved that k ≤ 5. -/ @[category research solved, AMS 5] theorem erdos_195.variants.leq_5_bound : - 5 ≥ sSup {k : ℕ | ∀ f : ℤ ≃ ℤ, HasMonotoneAP f k} := by + 5 ≥ sSup {k : ℕ | ∀ f : ℕ ≃ ℤ, HasMonotoneAP f k} := by sorry /-- @@ -51,7 +61,7 @@ Adenwalla [Ad22] proved that k ≤ 4. -/ @[category research solved, AMS 5] theorem erdos_195.variants.leq_4_bound : - 4 ≥ sSup {k : ℕ | ∀ f : ℤ ≃ ℤ, HasMonotoneAP f k} := by + 4 ≥ sSup {k : ℕ | ∀ f : ℕ ≃ ℤ, HasMonotoneAP f k} := by sorry end Erdos195 diff --git a/FormalConjectures/ErdosProblems/197.lean b/FormalConjectures/ErdosProblems/197.lean index 4940b7c..7265783 100644 --- a/FormalConjectures/ErdosProblems/197.lean +++ b/FormalConjectures/ErdosProblems/197.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 197 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/197](https://www.erdosproblems.com/197) -/ +@[expose] public section + open Set namespace Erdos197 @@ -30,9 +33,9 @@ namespace Erdos197 Can $\mathbb{N}$ be partitioned into two sets, each of which can be permuted to avoid monotone 3-term arithmetic progressions? -/ -@[category research open, AMS 5] +@[category research open, question, AMS 5] theorem erdos_197 : - answer(sorry) ↔ ∃ A B : Set ℕ, IsCompl A B ∧ + ∃ A B : Set ℕ, IsCompl A B ∧ (∃ f : ℕ ≃ A, ¬HasMonotoneAP (Subtype.val ∘ f) 3) ∧ (∃ g : ℕ ≃ B, ¬HasMonotoneAP (Subtype.val ∘ g) 3) := by sorry diff --git a/FormalConjectures/ErdosProblems/20.lean b/FormalConjectures/ErdosProblems/20.lean index 7dcb05e..2351b47 100644 --- a/FormalConjectures/ErdosProblems/20.lean +++ b/FormalConjectures/ErdosProblems/20.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 20 @@ -26,6 +27,8 @@ import FormalConjecturesUtil J. London Math. Soc. 35 (1960), 85--90. -/ + +@[expose] public section namespace Erdos20 /-- @@ -47,8 +50,8 @@ theorem f_0_1 : f 0 1 = 1 := by /-- Is it true that $f(n,k) < c_k^n$ for some constant $c_k>0$ and for all $n > 0$? -/ -@[category research open, AMS 5] -theorem erdos_20 : answer(sorry) ↔ ∃ (c : ℕ → ℕ), ∀ n k, n > 0 → f n k < (c k) ^ n := by +@[category research open, question, AMS 5] +theorem erdos_20 : ∃ (c : ℕ → ℕ), ∀ n k, n > 0 → f n k < (c k) ^ n := by sorry -- TODO(firsching): add the various known bounds as variants. diff --git a/FormalConjectures/ErdosProblems/203.lean b/FormalConjectures/ErdosProblems/203.lean index 2bc9f5f..737658a 100644 --- a/FormalConjectures/ErdosProblems/203.lean +++ b/FormalConjectures/ErdosProblems/203.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 203 @@ -22,14 +23,16 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/203](https://www.erdosproblems.com/203) -/ +@[expose] public section + namespace Erdos203 /-- Is there an integer $m$ with $(m, 6) = 1$ such that none of $2^k \cdot 3^\ell \cdot m + 1$ are prime, for any $k, \ell \ge 0$? -/ -@[category research open, AMS 5] -theorem erdos_203 : answer(sorry) ↔ ∃ m, m.Coprime 6 ∧ ∀ k l, ¬ (2^k * 3^l * m + 1).Prime := by +@[category research open, question, AMS 5] +theorem erdos_203 : ∃ m, m.Coprime 6 ∧ ∀ k l, ¬ (2^k * 3^l * m + 1).Prime := by sorry -- TODO(rdivyanshu): add statements about covering system and odd integers `m` such that none of 2^k*m + 1 is prime diff --git a/FormalConjectures/ErdosProblems/205.lean b/FormalConjectures/ErdosProblems/205.lean index 5d78bf1..f73c76c 100644 --- a/FormalConjectures/ErdosProblems/205.lean +++ b/FormalConjectures/ErdosProblems/205.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 205 @@ -27,6 +28,8 @@ import FormalConjecturesUtil 668-678. -/ +@[expose] public section + open Asymptotics Filter open scoped ArithmeticFunction.Omega @@ -51,9 +54,9 @@ for all $k$ with $2^k Real.log (Real.log m)) n := by +@[category research solved, question, AMS 11] +theorem erdos_205.parts.i : + ¬ ∀ᶠ n : ℕ in atTop, IsRepresentable (fun m => Real.log (Real.log m)) n := by sorry /-- @@ -64,9 +67,9 @@ multiplicity.) What about $<\epsilon \log\log m$? Barreto and Leeham, using ChatGPT and Aristotle, have proved a negative answer, which was quantified by Tao and Alexeev (see the comments). -/ -@[category research solved, AMS 11] -theorem erdos_205.parts.ii : answer(False) ↔ - ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, +@[category research solved, question, AMS 11] +theorem erdos_205.parts.ii : + ¬ ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, IsRepresentable (fun m => ε * Real.log (Real.log m)) n := by sorry @@ -78,9 +81,9 @@ multiplicity.) Or some more slowly growing function? Barreto and Leeham, using ChatGPT and Aristotle, have proved a negative answer, which was quantified by Tao and Alexeev (see the comments). -/ -@[category research solved, AMS 11] -theorem erdos_205.parts.iii : answer(False) ↔ - ∃ f : ℕ → ℝ, f =o[atTop] (fun m : ℕ => Real.log (Real.log m)) ∧ +@[category research solved, question, AMS 11] +theorem erdos_205.parts.iii : + ¬ ∃ f : ℕ → ℝ, f =o[atTop] (fun m : ℕ => Real.log (Real.log m)) ∧ ∀ᶠ n : ℕ in atTop, IsRepresentable f n := by sorry @@ -99,8 +102,8 @@ theorem erdos_205.variants.many_prime_factors : ∃ c > (0 : ℝ), The $n$ constructed in this way are divisible by a large power of $2$. It remains open whether there exist arbitrarily large odd counterexamples. -/ -@[category research open, AMS 11] -theorem erdos_205.variants.odd_counterexamples : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_205.variants.odd_counterexamples : {n : ℕ | Odd n ∧ ¬ IsRepresentable (fun m => Real.log (Real.log m)) n}.Infinite := by sorry diff --git a/FormalConjectures/ErdosProblems/21.lean b/FormalConjectures/ErdosProblems/21.lean new file mode 100644 index 0000000..935cadc --- /dev/null +++ b/FormalConjectures/ErdosProblems/21.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 21 + +*References:* +- [erdosproblems.com/21](https://www.erdosproblems.com/21) +- [Er81] Erdős, P., *On the combinatorial problems which I would most like to see solved*. + Combinatorica (1981), 25-42. +- [Er90] Erdős, Paul, *Some of my favourite unsolved problems*. A tribute to Paul Erdős (1990), + 467-478. +- [Er92b] Erdős, Paul, *Some of my favourite problems in various branches of combinatorics*. + Matematiche (Catania) (1992), 231-240. +- [Er97f] Erdős, Paul, *Some unsolved problems*. Combinatorics, geometry and probability + (Cambridge, 1993) (1997), 1-10. +- [ErLo75] Erdős, P. and Lovász, L., *Problems and results on $3$-chromatic hypergraphs and some + related questions*. (1975), 609--627. +- [Ka92b] Kahn, Jeff, *On a problem of Erdős and Lovász: random lines in a projective plane*. + Combinatorica (1992), 417-423. +- [Ka94] Kahn, Jeff, *On a problem of Erdős and Lovász. II. $n(r)=O(r)$*. J. Amer. Math. Soc. + (1994), 125-143. +- [Tr14] A. Tripathi, *A result on intersecting families with maximum transversal size*. + arXiv:1409.4610 (2014). +- [BaWa21] J. Barát and I. M. Wanless, *Intersecting and 2-intersecting hypergraphs with maximal + covering number: the Erdős-Lovász theme revisited*. J. Combin. Des. (2021), 260-286. +-/ + +@[expose] public section + +open Filter + +namespace Erdos21 + +/-- An Erdős–Lovász family of order `n`: an intersecting family of `n`-sets such that every set +of size at most `n - 1` is disjoint from some member. -/ +def IsErdosLovaszFamily (n : ℕ) (F : Finset (Finset ℕ)) : Prop := + (∀ A ∈ F, A.card = n) ∧ (∀ A ∈ F, ∀ B ∈ F, (A ∩ B).Nonempty) ∧ + ∀ S : Finset ℕ, S.card ≤ n - 1 → ∃ A ∈ F, Disjoint S A + +/-- `f n` is the minimal size of an Erdős–Lovász family of order `n`. -/ +noncomputable def f (n : ℕ) : ℕ := + sInf {m : ℕ | ∃ F : Finset (Finset ℕ), IsErdosLovaszFamily n F ∧ F.card = m} + +/-- +Let $f(n)$ be minimal such that there is an intersecting family $\mathcal{F}$ of sets of size $n$ +(so $A\cap B\neq\emptyset$ for all $A,B\in \mathcal{F}$) with $\lvert \mathcal{F}\rvert=f(n)$ +such that any set $S$ with $\lvert S\rvert \leq n-1$ is disjoint from at least one +$A\in \mathcal{F}$. + +Is it true that +$$f(n) \ll n?$$ + +Conjectured by Erdős and Lovász [ErLo75], who proved that +$$\frac{8}{3}n-3\leq f(n) \ll n^{3/2}\log n$$ +for all $n$. The upper bound was improved by Kahn [Ka92b] to $f(n) \ll n\log n$. (The upper +bound constructions in both cases are formed by taking a random set of lines from a projective +plane of order $n-1$, assuming $n-1$ is a prime power.) + +This problem was solved by Kahn [Ka94] who proved the upper bound $f(n) \ll n$. The Erdős-Lovász +lower bound of $\frac{8}{3}n-O(1)$ has not been improved, and it has been speculated (see e.g. +[Ka94]) that the correct answer is $3n+O(1)$. + +It is trivial that $f(1)=1$ and $f(2)=3$. The values $f(3)=6$ and $f(4)=9$ were established by +Tripathi [Tr14]. Barát and Wanless [BaWa21] proved that $f(5)=13$, and that $13\leq f(6)\leq 18$. +-/ +@[category research solved, question, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos21.lean#L13036"] +theorem erdos_21 : ∃ C : ℕ, ∀ᶠ n : ℕ in atTop, f n ≤ C * n := by + sorry + +/-- Erdős and Lovász [ErLo75] proved that $\frac{8}{3}n-3\leq f(n)$ for all $n$. -/ +@[category research solved, AMS 5] +theorem erdos_21.variants.lower (n : ℕ) : (8 / 3 : ℝ) * n - 3 ≤ f n := by + sorry + +/-- It has been speculated (see e.g. [Ka94]) that the correct answer is $3n+O(1)$. -/ +@[category research open, question, AMS 5] +theorem erdos_21.variants.three_n : ∃ C : ℕ, ∀ᶠ n : ℕ in atTop, + f n ≤ 3 * n + C ∧ 3 * n ≤ f n + C := by + sorry + +/-- $f(1)=1$, $f(2)=3$, $f(3)=6$ [Tr14], $f(4)=9$ [Tr14] and $f(5)=13$ [BaWa21]. -/ +@[category research solved, AMS 5] +theorem erdos_21.variants.small_values : f 1 = 1 ∧ f 2 = 3 ∧ f 3 = 6 ∧ f 4 = 9 ∧ f 5 = 13 := by + sorry + +end Erdos21 diff --git a/FormalConjectures/ErdosProblems/211.lean b/FormalConjectures/ErdosProblems/211.lean new file mode 100644 index 0000000..a405de8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/211.lean @@ -0,0 +1,274 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 211 + +*References:* +- [erdosproblems.com/211](https://www.erdosproblems.com/211) +- [Be83] Beck, József, *On the lattice property of the plane and some problems of Dirac, + Motzkin and Erdős in combinatorial geometry*. Combinatorica (1983), 281-297. +- [SzTr83] Szemerédi, Endre and Trotter, Jr., William T., *Extremal problems in discrete + geometry*. Combinatorica (1983), 381-392. +- [Er84] Erdős, P., *Research problems*. Period. Math. Hungar. (1984), 101-103. +- [BGS74] Burr, Stefan A. and Grünbaum, Branko 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. +-/ + +@[expose] public section + +namespace Erdos211 + +open EuclideanGeometry Filter + +open scoped Classical in +/-- Distinct lines containing two distinct points of the configuration. -/ +noncomputable def determinedLines (s : Finset ℝ²) : Finset (AffineSubspace ℝ ℝ²) := + s.offDiag.image fun p => line[ℝ, p.1, p.2] + +open scoped Classical in +/-- The uniform Erdős–Beck lower bound. -/ +def MainBound : Prop := + ∃ c : ℝ, 0 < c ∧ ∀ (n k : ℕ), 1 ≤ k → k < n → + ∀ s : Finset ℝ², s.card = n → + (∀ L : AffineSubspace ℝ ℝ², IsLine L → (s.filter fun p => p ∈ L).card ≤ n - k) → + c * (k : ℝ) * (n : ℝ) ≤ ((determinedLines s).card : ℝ) + +open scoped Classical in +/-- The quadratic lower bound for configurations with at most half the points on a line. -/ +def QuadraticBound : Prop := + ∃ c : ℝ, 0 < c ∧ ∀ n : ℕ, 1 ≤ n → + ∀ s : Finset ℝ², s.card = 2 * n → + (∀ L : AffineSubspace ℝ ℝ², IsLine L → (s.filter fun p => p ∈ L).card ≤ n) → + c * (n : ℝ) ^ 2 ≤ ((determinedLines s).card : ℝ) + +open scoped Classical in +/-- Erdős speculates that there are at least $(1+o(1))kn/6$ determined lines [Er84]. +The asymptotic bound is uniform over $1 \leq k < n$. -/ +@[category research open, AMS 5 52] +theorem erdos_211.variants.one_sixth : + ∀ ε : ℝ, 0 < ε → ∃ N : ℕ, ∀ (n k : ℕ), N ≤ n → 1 ≤ k → k < n → + ∀ s : Finset ℝ², s.card = n → + (∀ L : AffineSubspace ℝ ℝ², IsLine L → (s.filter fun p => p ∈ L).card ≤ n - k) → + (1 - ε) / 6 * (k : ℝ) * (n : ℝ) ≤ ((determinedLines s).card : ℝ) := by + sorry + +open scoped Classical in +/-- There are arbitrarily large configurations with no four collinear points and +$\sim n^2/6$ three-point lines, constructed by Burr, Grünbaum, and Sloane [BGS74] +and Füredi and Palásti [FuPa84]. The index need not equal the number of points. -/ +@[category research solved, AMS 5 52] +theorem erdos_211.variants.sharpness : + ∃ s : ℕ → Finset ℝ², + Tendsto (fun i => (s i).card) atTop atTop ∧ + (∀ (i : ℕ) (L : AffineSubspace ℝ ℝ²), IsLine L → + ((s i).filter fun p => p ∈ L).card ≤ 3) ∧ + Tendsto (fun i => + (((determinedLines (s i)).filter fun L => ((s i).filter fun p => p ∈ L).card = 3).card : ℝ) / + ((s i).card : ℝ) ^ 2) atTop (nhds (1 / 6 : ℝ)) := by + sorry + +/-- Membership means that two distinct points of the configuration generate the line. -/ +@[category API, AMS 5 52] +theorem mem_determinedLines {s : Finset ℝ²} {L : AffineSubspace ℝ ℝ²} : + L ∈ determinedLines s ↔ ∃ a ∈ s, ∃ b ∈ s, a ≠ b ∧ line[ℝ, a, b] = L := by + classical + simp only [determinedLines, Finset.mem_image, Finset.mem_offDiag] + aesop + +/-- A span of two distinct points is a geometric line. -/ +@[category API, AMS 5 52] +theorem isLine_pair {a b : ℝ²} (hab : a ≠ b) : IsLine (line[ℝ, a, b]) := by + unfold IsLine + rw [direction_affineSpan, vectorSpan_pair] + exact finrank_span_singleton (vsub_ne_zero.mpr hab) + +/-- Two distinct points on a geometric line span the whole line. -/ +@[category API, AMS 5 52] +theorem line_pair_eq {a b : ℝ²} {L : AffineSubspace ℝ ℝ²} + (hL : IsLine L) (ha : a ∈ L) (hb : b ∈ L) (hab : a ≠ b) : + line[ℝ, a, b] = L := by + apply (AffineSubspace.eq_iff_direction_eq_of_mem (left_mem_affineSpan_pair ℝ a b) ha).mpr + apply Submodule.eq_of_le_of_finrank_eq + · exact AffineSubspace.direction_le (affineSpan_pair_le_of_mem_of_mem ha hb) + · exact (isLine_pair hab).trans hL.symm + +/-- Every determined line is one-dimensional. -/ +@[category API, AMS 5 52] +theorem isLine_of_mem_determinedLines {s : Finset ℝ²} {L : AffineSubspace ℝ ℝ²} + (hL : L ∈ determinedLines s) : IsLine L := by + obtain ⟨a, _, b, _, hab, rfl⟩ := mem_determinedLines.mp hL + exact isLine_pair hab + +/-- The finite image counts precisely all geometric lines containing at least two points. -/ +@[category API, AMS 5 52] +theorem determinedLines_eq {s : Finset ℝ²} {L : AffineSubspace ℝ ℝ²} : + L ∈ determinedLines s ↔ IsLine L ∧ 2 ≤ ((s : Set ℝ²) ∩ (L : Set ℝ²)).ncard := by + classical + have hcard : ((s : Set ℝ²) ∩ (L : Set ℝ²)).ncard = + (s.filter fun p => p ∈ L).card := by + rw [← Set.ncard_coe_finset] + congr 1 + ext p + simp + rw [hcard] + constructor + · intro h + obtain ⟨a, ha, b, hb, hab, heq⟩ := mem_determinedLines.mp h + refine ⟨isLine_of_mem_determinedLines h, ?_⟩ + apply Nat.succ_le_iff.mpr + apply Finset.one_lt_card.mpr + exact ⟨a, Finset.mem_filter.mpr ⟨ha, heq ▸ left_mem_affineSpan_pair ℝ a b⟩, + b, Finset.mem_filter.mpr ⟨hb, heq ▸ right_mem_affineSpan_pair ℝ a b⟩, hab⟩ + · rintro ⟨hL, hcard⟩ + obtain ⟨a, ha, b, hb, hab⟩ := Finset.one_lt_card.mp (Nat.lt_of_succ_le hcard) + exact mem_determinedLines.mpr ⟨a, (Finset.mem_filter.mp ha).1, + b, (Finset.mem_filter.mp hb).1, + hab, line_pair_eq hL (Finset.mem_filter.mp ha).2 (Finset.mem_filter.mp hb).2 hab⟩ + +open scoped Classical in +/-- The fiber over a geometric line consists of the ordered pairs of distinct incident points. -/ +@[category API, AMS 5 52] +theorem pair_fiber_eq {s : Finset ℝ²} {L : AffineSubspace ℝ ℝ²} (hL : IsLine L) : + (s.offDiag.filter fun p => line[ℝ, p.1, p.2] = L) = + (s.filter fun p => p ∈ L).offDiag := by + classical + ext p + simp only [Finset.mem_filter, Finset.mem_offDiag] + constructor + · rintro ⟨⟨ha, hb, hab⟩, heq⟩ + exact ⟨⟨ha, heq ▸ left_mem_affineSpan_pair ℝ p.1 p.2⟩, + ⟨hb, heq ▸ right_mem_affineSpan_pair ℝ p.1 p.2⟩, hab⟩ + · rintro ⟨⟨ha, haL⟩, ⟨hb, hbL⟩, hab⟩ + exact ⟨⟨ha, hb, hab⟩, line_pair_eq hL haL hbL hab⟩ + +open scoped Classical in +/-- Exact double counting: each ordered pair belongs to its unique determined line. -/ +@[category API, AMS 5 52] +theorem ordered_pair_count (s : Finset ℝ²) : + s.card * (s.card - 1) = ∑ L ∈ determinedLines s, + (s.filter fun p => p ∈ L).card * ((s.filter fun p => p ∈ L).card - 1) := by + classical + have h := Finset.card_eq_sum_card_image (fun p : ℝ² × ℝ² => line[ℝ, p.1, p.2]) s.offDiag + have hoff : s.offDiag.card = s.card * (s.card - 1) := by + rw [Finset.offDiag_card, Nat.mul_sub_left_distrib, Nat.mul_one] + rw [hoff] at h + calc + s.card * (s.card - 1) = _ := h + _ = _ := by + apply Finset.sum_congr rfl + intro L hL + rw [pair_fiber_eq (isLine_of_mem_determinedLines hL), Finset.offDiag_card, Nat.mul_sub_left_distrib, Nat.mul_one] + +open scoped Classical in +/-- Elementary bound when no line contains more than $r$ points. +This is weaker than the Erdős–Beck bound and is not a proof of `erdos_211`. -/ +@[category API, AMS 5 52] +theorem pair_count_bound {s : Finset ℝ²} {r : ℕ} + (hr : ∀ L : AffineSubspace ℝ ℝ², IsLine L → (s.filter fun p => p ∈ L).card ≤ r) : + s.card * (s.card - 1) ≤ (determinedLines s).card * (r * (r - 1)) := by + classical + rw [ordered_pair_count] + calc + _ ≤ ∑ _L ∈ determinedLines s, r * (r - 1) := by + apply Finset.sum_le_sum + intro L hL + have h := hr L (isLine_of_mem_determinedLines hL) + exact Nat.mul_le_mul h (Nat.sub_le_sub_right h 1) + _ = _ := by simp + +open scoped Classical in +/-- In a configuration with no three collinear points, every unordered pair gives a line. -/ +@[category API, AMS 5 52] +theorem line_count_no_three {s : Finset ℝ²} + (hs : ∀ L : AffineSubspace ℝ ℝ², IsLine L → (s.filter fun p => p ∈ L).card ≤ 2) : + s.card * (s.card - 1) = 2 * (determinedLines s).card := by + classical + rw [ordered_pair_count] + calc + _ = ∑ _L ∈ determinedLines s, 2 := by + apply Finset.sum_congr rfl + intro L hL + have hlo := (determinedLines_eq.mp hL).2 + have hc : ((s : Set ℝ²) ∩ (L : Set ℝ²)).ncard = + (s.filter fun p => p ∈ L).card := by + rw [← Set.ncard_coe_finset] + congr 1 + ext p + simp + rw [hc] at hlo + have heq := Nat.le_antisymm (hs L (isLine_of_mem_determinedLines hL)) hlo + simp [heq] + _ = _ := by simp [Nat.mul_comm] + +open scoped Classical in +/-- With at most three points on each line, double counting gives the sharp +leading coefficient $1/6$ in a quadratic lower bound. -/ +@[category API, AMS 5 52] +theorem six_mul_lines_no_four {s : Finset ℝ²} + (hs : ∀ L : AffineSubspace ℝ ℝ², IsLine L → (s.filter fun p => p ∈ L).card ≤ 3) : + s.card * (s.card - 1) ≤ 6 * (determinedLines s).card := by + simpa [Nat.mul_comm] using pair_count_bound hs + +open scoped Classical in +/-- The real-valued form of the preceding bound, including empty configurations. -/ +@[category API, AMS 5 52] +theorem real_lower_bound_no_four {s : Finset ℝ²} + (hs : ∀ L : AffineSubspace ℝ ℝ², IsLine L → (s.filter fun p => p ∈ L).card ≤ 3) : + (s.card : ℝ) * ((s.card : ℝ) - 1) / 6 ≤ ((determinedLines s).card : ℝ) := by + have h := six_mul_lines_no_four hs + by_cases hzero : s.card = 0 + · simp [hzero] + · have hone : 1 ≤ s.card := by omega + have hreal : (s.card : ℝ) * ((s.card : ℝ) - 1) ≤ + 6 * ((determinedLines s).card : ℝ) := by + exact_mod_cast h + linarith + +/-- The quadratic special case follows with twice the constant in the main bound. -/ +@[category API, AMS 5 52] +theorem quadratic_of_erdos_211 (h : MainBound) : QuadraticBound := by + obtain ⟨c, hc, h⟩ := h + refine ⟨2 * c, by positivity, ?_⟩ + intro n hn s hs hcap + have hkn : n < 2 * n := by omega + have hb := h (2 * n) n hn hkn s hs (by + intro L hL + have := hcap L hL + omega) + push_cast at hb + nlinarith + +/-- Let $1\leq k0$ excludes the empty configuration, since the +requested number $n-1$ of distances is nonnegative. -/ +@[category research open, question value, AMS 5 52] +theorem erdos_217 : erdos_217.answer = {n : ℕ | 0 < n ∧ ∃ P : Finset ℝ², + P.card = n ∧ InGeneralPosition (P : Set ℝ²) ∧ + (distanceSet P).card = n - 1 ∧ + (distanceSet P).image (distanceMultiplicity P) = Finset.Icc 1 (n - 1)} := by + sorry + +end Erdos217 diff --git a/FormalConjectures/ErdosProblems/235.lean b/FormalConjectures/ErdosProblems/235.lean new file mode 100644 index 0000000..482f3ac --- /dev/null +++ b/FormalConjectures/ErdosProblems/235.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 235 + +*References:* +- [erdosproblems.com/235](https://www.erdosproblems.com/235) +- [Ho65] Hooley, Christopher, _On the difference between consecutive numbers prime to $n$_. II. + Publ. Math. Debrecen (1965), 39--49. +-/ + +@[expose] public section + +open Filter +open scoped Topology + +namespace Erdos235 + +/-- The product of the first `k + 1` primes. +On [erdosproblems.com/235](https://www.erdosproblems.com/235) this is $N_{k+1}=2\cdot 3\cdots p_{k+1}$. +The limit as $k\to\infty$ is the same for either indexing. -/ +noncomputable def N (k : ℕ) : ℕ := + primorial (Nat.nth Nat.Prime k) + +/-- The increasing list of integers `< n` that are coprime to `n`. -/ +def coprimeList (n : ℕ) : List ℕ := + ({a ∈ Finset.range n | n.Coprime a}).sort (· ≤ ·) + +/-- The gaps $a_i - a_{i-1}$ between consecutive entries of `coprimeList n`. -/ +def gaps (n : ℕ) : List ℕ := + (coprimeList n).zipWith (fun a b ↦ b - a) (coprimeList n).tail + +/-- The number of gaps of size at most $c \cdot n / \varphi(n)$. -/ +noncomputable def countGaps (n : ℕ) (c : ℝ) : ℕ := + (gaps n).countP fun g ↦ decide ((g : ℝ) ≤ c * (n : ℝ) / (n.totient : ℝ)) + +/-- The proportion appearing in `erdos_235`, for the primorial `N k`. -/ +noncomputable def proportion (k : ℕ) (c : ℝ) : ℝ := + (countGaps (N k) c : ℝ) / ((N k).totient : ℝ) + +/-- `N 0` is the primorial of $2$. -/ +@[category test, AMS 11] +theorem N_zero : N 0 = 2 := by + simp [N, Nat.nth_prime_zero_eq_two, primorial_two] + +/-- `N 1` is the primorial of $3$. -/ +@[category test, AMS 11] +theorem N_one : N 1 = 6 := by + simp [N, Nat.nth_prime_one_eq_three] + decide + +/-- `coprimeList n` has length $\varphi(n)$. -/ +@[category test, AMS 11] +theorem coprimeList_length (n : ℕ) : (coprimeList n).length = n.totient := by + rw [coprimeList, Finset.length_sort (· ≤ ·), Nat.totient_eq_card_coprime] + +/-- $\varphi(N_k)$ is positive, so the proportion is not a division by zero. -/ +@[category test, AMS 11] +theorem totient_N_pos (k : ℕ) : 0 < (N k).totient := by + rw [Nat.totient_pos] + exact primorial_pos (Nat.nth Nat.Prime k) + +/-- +Let $N_k=2\cdot 3\cdots p_k$ and $\{a_1 (a k) / (2 ^ (a k) : ℚ)) ∧ + x = ∑' k, (a k) / (2 ^ (a k) : ℚ) + +/-- For every positive integer $m$, if $n = 2^{m+1} - m - 2$, then +$$\frac{n}{2^n} = \sum_{n < k \le n + m} \frac{k}{2^k}.$$ + +This construction is due to Borwein and Loring [BoLo90]. -/ +@[category textbook, AMS 11, formal_proof using lean4 at "https://github.com/linrock/math-proofs/blob/b53791ff6294b4b90e3653970367f127a52fd16e/erdos-261/Solution.lean#L73"] +theorem erdos_261.variants.borwein_loring (m : ℕ) (hm : 0 < m) : + let n := 2 ^ (m + 1) - m - 2 + n / (2 ^ n : ℚ) = ∑ k ∈ Finset.Ioc n (n + m), k / (2 ^ k : ℚ) := by + sorry + +/-- The Borwein--Loring construction gives the required property when $m \ge 2$. This lower +bound ensures that the representation contains at least two terms. -/ +@[category textbook, AMS 11, formal_proof using lean4 at "https://github.com/linrock/math-proofs/blob/b53791ff6294b4b90e3653970367f127a52fd16e/erdos-261/Solution.lean#L78"] +theorem erdos_261.variants.borwein_loring_property (m : ℕ) (hm : 2 ≤ m) : + Erdos261Prop (2 ^ (m + 1) - m - 2) := by + sorry + +/-- Are there infinitely many positive integers $n$ such that there exist some $t \ge 2$ and +distinct integers $a_1, \ldots, a_t \ge 1$ satisfying +$$\frac{n}{2^n} = \sum_{1 \le k \le t} \frac{a_k}{2^{a_k}}?$$ + +In [Er88c], Erdős notes that Cusick had a simple proof that infinitely many such $n$ exist. -/ +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/anatoliiohorodnyk/lean-fc-proofs/blob/5da9642575b26c2c816a49bcb56b33fed5456619/Proofs/T_Erdos261_erdos_261_parts_i.lean#L102"] +theorem erdos_261.parts.i : {n : ℕ | 0 < n ∧ Erdos261Prop n}.Infinite := by + sorry + +/-- Tengely, Ulas, and Zygadlo [TUZ20] verified that every positive integer $n \le 10000$ has +the required property. -/ +@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/linrock/math-proofs/blob/b53791ff6294b4b90e3653970367f127a52fd16e/erdos-261/Solution.lean#L85"] +theorem erdos_261.variants.le_10000 {n : ℕ} (hn_pos : 0 < n) (hn : n ≤ 10000) : + Erdos261Prop n := by + sorry + +/-- Do all positive integers $n$ have the required property? -/ +@[category research open, question, AMS 11] +theorem erdos_261.parts.ii : ∀ n > 0, Erdos261Prop n := by + sorry + +/-- Is there a rational number $x$ such that +$$x = \sum_{k=1}^{\infty} \frac{a_k}{2^{a_k}}$$ +has at least $2^{\aleph_0}$ representations by pairwise distinct positive integers $a_k$? -/ +@[category research open, question, AMS 11] +theorem erdos_261.parts.iii : ∃ x : ℚ, + 𝔠 ≤ #{a : ℕ → ℕ | Erdos261InfiniteRepresentation x a} := by + sorry + +/-- In [Er88c], Erdős asks the weaker question of whether there exists a rational $x$ with at +least two representations +$$x = \sum_{k=1}^{\infty} \frac{a_k}{2^{a_k}}$$ +by pairwise distinct positive integers $a_k$. + +The answer is yes: Z. Rafik (erdosproblems.com forum, 27 Apr 2026) observed that +$4/2^4 = 5/2^5 + 6/2^6$ and $\sum_{m \ge 1} m/2^m = 2$, so $7/4$ is represented both by +$\mathbb{N}_{>0} \setminus \{4\}$ and by $\mathbb{N}_{>0} \setminus \{5, 6\}$. It is generally believed that +"two" here is a misprint for $2^{\aleph_0}$ (see `erdos_261.parts.iii`, which remains open). -/ +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/g8r-b8/erdos261-lean/blob/976bddf21eafc93ea86a7a1bfd92b847070a6f31/Erdos261.lean#L87"] +theorem erdos_261.variants.two_representations : ∃ x : ℚ, + 2 ≤ #{a : ℕ → ℕ | Erdos261InfiniteRepresentation x a} := by + sorry + +end Erdos261 diff --git a/FormalConjectures/ErdosProblems/267.lean b/FormalConjectures/ErdosProblems/267.lean index 9a58018..c1bedc4 100644 --- a/FormalConjectures/ErdosProblems/267.lean +++ b/FormalConjectures/ErdosProblems/267.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 267 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/267](https://www.erdosproblems.com/267) -/ +@[expose] public section + namespace Erdos267 /-- @@ -29,8 +32,8 @@ Let $F_1=F_2=1$ and $F_{n+1} = F_n + F_{n-1}$ be the Fibonacci sequence. Let $n_1 < n_2 < \dots$ be an infinite sequence with $\frac{n_{k+1}}{n_k} \ge c > 1$. Must $\sum_k \frac 1 {F_{n_k}}$ be irrational? -/ -@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-267/Research/Basic.lean"] -theorem erdos_267 : answer(True) ↔ ∀ᵉ (n : ℕ → ℕ) (c > (1 : ℚ)), StrictMono n → (∀ k, c ≤ n (k+1) / n k) → +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-267/Research/Basic.lean"] +theorem erdos_267 : ∀ᵉ (n : ℕ → ℕ) (c > (1 : ℚ)), StrictMono n → (∀ k, c ≤ n (k+1) / n k) → Irrational (∑' k, 1 / (Nat.fib <| n k)) := by sorry @@ -39,8 +42,8 @@ Let $F_1=F_2=1$ and $F_{n+1} = F_n + F_{n-1}$ be the Fibonacci sequence. Let $n_1 < n_2 < \dots$ be an infinite sequence with $\frac {n_k}{k} \to \infty$. Must $\sum_k \frac 1 {F_{n_k}}$ be irrational? -/ -@[category research open, AMS 11] -theorem erdos_267.variants.generalisation_ratio_limit_to_infinity : answer(sorry) ↔ ∀ (n : ℕ → ℕ), +@[category research open, question, AMS 11] +theorem erdos_267.variants.generalisation_ratio_limit_to_infinity : ∀ (n : ℕ → ℕ), StrictMono n → Filter.Tendsto (fun k => (n (k+1) / k.succ : ℝ)) Filter.atTop Filter.atTop → Irrational (∑' k, 1 / (Nat.fib <| n k)) := by sorry diff --git a/FormalConjectures/ErdosProblems/270.lean b/FormalConjectures/ErdosProblems/270.lean new file mode 100644 index 0000000..f1a8fb9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/270.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 270 + +*References:* +- [erdosproblems.com/270](https://www.erdosproblems.com/270) +- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number + theory*. Monographies de L'Enseignement Mathematique (1980). +- [Ha75] Hansen, E. R., *A Table of Series and Products*. Prentice-Hall (1975), 87. +- [CrKo25] T. Crmarić and V. Kovač, *On the irrationality of certain super-polynomially decaying + series*. arXiv:2504.18712 (2025). +- [Ko26] V. Kovač, [solution of the linear case](https://www.erdosproblems.com/forum/thread/270#post-7469) + (2026). +-/ + +@[expose] public section + +open Filter + +namespace Erdos270 + +/-- The series $\sum_{n\geq 1} \frac{1}{(n+1)\cdots (n+f(n))}$, indexed from $0$. -/ +noncomputable def series (f : ℕ → ℕ) : ℝ := + ∑' n : ℕ, (∏ i ∈ Finset.Icc (n + 2) (n + 1 + f (n + 1)), (i : ℝ))⁻¹ + +/-- +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? + +Erdős and Graham [ErGr80] write 'the answer is almost surely in the affirmative if $f(n)$ is +assumed to be nondecreasing'. The case $f(n)=n$ was subsequently settled by Crmarić and Kovač +[Ko26]. Hansen [Ha75] has +shown that +$$\sum_n \frac{1}{\binom{2n}{n}}=\sum_n \frac{n!}{(n+1)\cdots (n+n)}=\frac{1}{3}+\frac{2\pi}{3^{5/2}}$$ +is transcendental. + +Crmarić and Kovač [CrKo25] have shown that the answer to this question is no in a strong sense: +for any $\alpha \in (0,\infty)$ there exists a function $f:\mathbb{N}\to\mathbb{N}$ such that +$f(n)\to \infty$ as $n\to\infty$ and +$$\sum_{n\geq 1} \frac{1}{(n+1)\cdots (n+f(n))}=\alpha.$$ +-/ +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos270.lean#L1027"] +theorem erdos_270 : + ¬ ∀ f : ℕ → ℕ, Tendsto f atTop atTop → Irrational (series f) := by + sorry + +/-- +Crmarić and Kovač [CrKo25]: for any $\alpha \in (0,\infty)$ there exists a function +$f:\mathbb{N}\to\mathbb{N}$ such that $f(n)\to \infty$ as $n\to\infty$ and +$$\sum_{n\geq 1} \frac{1}{(n+1)\cdots (n+f(n))}=\alpha.$$ +-/ +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos270.lean#L1009"] +theorem erdos_270.variants.every_value (α : ℝ) (hα : 0 < α) : + ∃ f : ℕ → ℕ, Tendsto f atTop atTop ∧ + HasSum (fun n : ℕ => (∏ i ∈ Finset.Icc (n + 2) (n + 1 + f (n + 1)), (i : ℝ))⁻¹) α := by + sorry + +/-- +It is still possible that this sum is always irrational if $f$ is assumed to be non-decreasing; +Crmarić and Kovač [CrKo25] show that the set of the possible values of such a sum has Lebesgue +measure zero. +-/ +@[category research open, question, AMS 11] +theorem erdos_270.variants.monotone : + ∀ f : ℕ → ℕ, Monotone f → Tendsto f atTop atTop → Irrational (series f) := by + sorry + +/-- The case $f(n)=n$ has a positive answer, as observed by Crmarić and Kovač [Ko26]: +$\sum_{n\geq 1} n!/(2n)!$ is irrational. -/ +@[category research solved, question, AMS 11] +theorem erdos_270.variants.linear : Irrational (series id) := by + sorry + +end Erdos270 diff --git a/FormalConjectures/ErdosProblems/273.lean b/FormalConjectures/ErdosProblems/273.lean index b1776b8..d6497d7 100644 --- a/FormalConjectures/ErdosProblems/273.lean +++ b/FormalConjectures/ErdosProblems/273.lean @@ -13,29 +13,32 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 273 *Reference:* [erdosproblems.com/273](https://www.erdosproblems.com/273) -/ +@[expose] public section + namespace Erdos273 /-- Is there a covering system all of whose moduli are of the form $p-1$ for some primes $p \geq 5$? -/ -@[category research open, AMS 5 11] -theorem erdos_273 : answer(sorry) ↔ ∃ c : StrictCoveringSystem ℤ, ∀ i, ∃ (p : ℕ), p.Prime ∧ 5 ≤ p ∧ +@[category research open, question, AMS 5 11] +theorem erdos_273 : ∃ c : StrictCoveringSystem ℤ, ∀ i, ∃ (p : ℕ), p.Prime ∧ 5 ≤ p ∧ c.moduli i = Ideal.span {↑(p - 1)} := by sorry /-- Is there a covering system all of whose moduli are of the form $p-1$ for some primes $p \geq 3$? -/ -@[category research solved, AMS 5 11] -theorem erdos_273.variants.three : answer(True) ↔ ∃ c : StrictCoveringSystem ℕ, ∀ i, ∃ p, p.Prime ∧ 3 ≤ p ∧ +@[category research solved, question, AMS 5 11] +theorem erdos_273.variants.three : ∃ c : StrictCoveringSystem ℕ, ∀ i, ∃ p, p.Prime ∧ 3 ≤ p ∧ c.moduli i = Ideal.span {↑(p - 1)} := by -- TODO(Paul-Lez): find reference for this and perhaps formalize the proof? sorry diff --git a/FormalConjectures/ErdosProblems/276.lean b/FormalConjectures/ErdosProblems/276.lean index 74e9481..ac825d6 100644 --- a/FormalConjectures/ErdosProblems/276.lean +++ b/FormalConjectures/ErdosProblems/276.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 276 @@ -23,6 +24,8 @@ import FormalConjecturesUtil [erdosproblems.com/276](https://www.erdosproblems.com/276) -/ +@[expose] public section + namespace Erdos276 /-- @@ -42,8 +45,8 @@ Is there an infinite Lucas sequence $a_0, a_1, \ldots$ where $a_{n+2} = a_{n+1} $n \ge 0$ such that all $a_k$ are composite, and yet no integer has a common factor with every term of the sequence? -/ -@[category research open, AMS 11] -theorem erdos_276 : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_276 : ∃ (a : ℕ → ℕ), IsLucasSequence a ∧ (∀ k, (a k).Composite) ∧ (∀ n > 1, ∃ k, Nat.gcd n (a k) = 1) := by sorry diff --git a/FormalConjectures/ErdosProblems/279.lean b/FormalConjectures/ErdosProblems/279.lean index e62a02a..a76ca4d 100644 --- a/FormalConjectures/ErdosProblems/279.lean +++ b/FormalConjectures/ErdosProblems/279.lean @@ -13,14 +13,17 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 279 *Reference:* [erdosproblems.com/279](https://www.erdosproblems.com/279) -/ +@[expose] public section + namespace Erdos279 /-- @@ -28,8 +31,8 @@ Let $k\geq 3$. Is there a choice of congruence classes $a_p\pmod{p}$ for every p such that all sufficiently large integers can be written as $a_p+tp$ for some prime $p$ and integer $t\geq k$? -/ -@[category research open, AMS 11] -theorem erdos_279 : answer(sorry) ↔ ∀ k : Nat, k ≥ 3 → +@[category research open, question, AMS 11] +theorem erdos_279 : ∀ k : Nat, k ≥ 3 → ∃ a : Nat → Nat, ∃ N : Nat, (∀ p : Nat, p.Prime → a p < p) ∧ ∀ n ≥ N, ∃ p : Nat, ∃ t ≥ k, p.Prime ∧ n = a p + t * p := by sorry diff --git a/FormalConjectures/ErdosProblems/28.lean b/FormalConjectures/ErdosProblems/28.lean index 23339f8..2ca644a 100644 --- a/FormalConjectures/ErdosProblems/28.lean +++ b/FormalConjectures/ErdosProblems/28.lean @@ -14,7 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil + +@[expose] public section /-! # Erdős Problem 28 diff --git a/FormalConjectures/ErdosProblems/282.lean b/FormalConjectures/ErdosProblems/282.lean index 0d1686a..deea2ad 100644 --- a/FormalConjectures/ErdosProblems/282.lean +++ b/FormalConjectures/ErdosProblems/282.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 282 @@ -22,26 +23,29 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/282](https://www.erdosproblems.com/282) -/ +@[expose] public section + open Filter Real namespace Erdos282 /-- Let $A\subseteq \mathbb{N}$ be an infinite set and consider the following -greedy algorithm for a rational $x$: choose the minimal $n\in A$ such +greedy algorithm for a rational $x$: choose the minimal $n\in A$ not used so far such that $n\geq 1/x$ and repeat with $x$ replaced by $x-\frac{1}{n}$. This process of subtracting unit fractions is modelled in `greedyUnitFractionRem`. At each step `t : ℕ`, the function `greedyUnitFractionRem A x t` returns the remainder -of `x` with respect to the first `t + 1` unit fractions, with denominators taken from `A`. -If this process ever reaches `0` then it terminates. This corresponds to producing a -representation of `x` as the sum of distinct unit fractions with denominators from `A`, -however this function does not return this representation. -/ -noncomputable def greedyUnitFractionRem (A : Set ℕ) (x : ℚ) : ℕ → ℚ - | 0 => x - 1 / sInf { n | n ∈ A ∧ 1 / x ≤ n } - | t + 1 => - let prev := greedyUnitFractionRem A x t - if prev ≤ 0 then 0 else - prev - 1 / sInf { n | n ∈ A ∧ 1 / prev ≤ n } +of `x` with respect to the first `t + 1` unit fractions, with distinct denominators taken +from `A`. Once the remainder reaches `0` it stays `0`, and the process terminates. This +corresponds to producing a representation of `x` as the sum of distinct unit fractions with +denominators from `A`, however this function does not return this representation. -/ +noncomputable def greedyUnitFractionRem (A : Set ℕ) (x : ℚ) (t : ℕ) : ℚ := + if x ≤ 0 then 0 else + let n := sInf { n | n ∈ A ∧ 1 / x ≤ n } + let rem := x - 1 / n + match t with + | 0 => rem + | t + 1 => greedyUnitFractionRem (A \ {n}) rem t @[category test, AMS 5] theorem greedyUnitFractionRem_zero (n : ℕ) : greedyUnitFractionRem .univ (1 / n) 0 = 0 := by @@ -49,12 +53,11 @@ theorem greedyUnitFractionRem_zero (n : ℕ) : greedyUnitFractionRem .univ (1 / @[category test, AMS 5] theorem greedyUnitFractionRem_one (n : ℕ) : greedyUnitFractionRem .univ (1 / n) 1 = 0 := by - rw [greedyUnitFractionRem, greedyUnitFractionRem_zero] - simp + simp [greedyUnitFractionRem, Set.Ici_def] /-- Let $A\subseteq \mathbb{N}$ be an infinite set and consider the following -greedy algorithm for a rational $x\in (0,1)$: choose the minimal $n\in A$ such -that $n\geq 1/x$ and repeat with $x$ replaced by $x-\frac{1}{n}$. If this +greedy algorithm for a rational $x\in (0,1)$: choose the minimal $n\in A$ not used +so far such that $n\geq 1/x$ and repeat with $x$ replaced by $x-\frac{1}{n}$. If this terminates after finitely many steps then this produces a representation of $x$ as the sum of distinct unit fractions with denominators from $A$. @@ -65,10 +68,12 @@ theorem erdos_282 {x : ℚ} (hx : x ∈ Set.Ioo 0 1) (hx_den : Odd x.den) : greedyUnitFractionRem { n | Odd n } x =ᶠ[atTop] 0 := by sorry +def erdos_282.variants.general.answer : Set (ℚ × Set ℕ) := sorry + /-- More generally, for which pairs $x$ and $A$ does this process terminate? -/ -@[category research open, AMS 5] +@[category research open, question value, AMS 5] theorem erdos_282.variants.general (x : ℚ) (A : Set ℕ) : - greedyUnitFractionRem A x =ᶠ[atTop] 0 ↔ (x, A) ∈ (answer(sorry) : Set (ℚ × Set ℕ)) := by + greedyUnitFractionRem A x =ᶠ[atTop] 0 ↔ (x, A) ∈ erdos_282.variants.general.answer := by sorry /-- In 1202 Fibonacci observed that this process terminates for any $x$ when $A=\mathbb{N}$. -/ @@ -84,10 +89,11 @@ $$\left(\frac{n}{(n,a,d)},\frac{d}{(a,d)}\right)=1.$$ Does the greedy algorithm always terminate in such cases? -/ -@[category research open, AMS 5] -theorem erdos_282.variants.graham {x : ℚ} (hx : x ∈ Set.Ioo 0 1) {a d : ℕ} (hd : 1 < d) - (h : (x.den / x.den.gcd (a.gcd d)).gcd (d / a.gcd d) = 1) : - (greedyUnitFractionRem { n | n ≡ a [MOD d] } x =ᶠ[atTop] 0) ↔ answer(sorry) := by +@[category research open, question, AMS 5] +theorem erdos_282.variants.graham : + ∀ x : ℚ, x ∈ Set.Ioo 0 1 → ∀ a d : ℕ, 1 < d → + (x.den / x.den.gcd (a.gcd d)).gcd (d / a.gcd d) = 1 → + greedyUnitFractionRem { n | n ≡ a [MOD d] } x =ᶠ[atTop] 0 := by sorry @[category test, AMS 5] @@ -101,9 +107,9 @@ square denominators if and only if $x\in [0,\pi^2/6-1)\cup [1,\pi^2/6)$. Does th greedy algorithm for this always terminate? Erdős and Graham believe not - indeed, perhaps it fails to terminate almost always. -/ -@[category research open, AMS 5] +@[category research open, question, AMS 5] theorem erdos_282.variants.sq : - answer(sorry) ↔ ∀ x : ℚ, (x : ℝ) ∈ Set.Ico 0 (π ^ 2 / 6 - 1) ∪ Set.Ico 1 (π ^ 2 / 6) → + ∀ x : ℚ, (x : ℝ) ∈ Set.Ico 0 (π ^ 2 / 6 - 1) ∪ Set.Ico 1 (π ^ 2 / 6) → greedyUnitFractionRem { n | IsSquare n } x =ᶠ[atTop] 0 := by sorry diff --git a/FormalConjectures/ErdosProblems/288.lean b/FormalConjectures/ErdosProblems/288.lean index 738afcb..bbde222 100644 --- a/FormalConjectures/ErdosProblems/288.lean +++ b/FormalConjectures/ErdosProblems/288.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 288 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/288](https://www.erdosproblems.com/288) -/ +@[expose] public section + namespace Erdos288 /-- @@ -30,8 +33,8 @@ $$ \sum_{n_1 \in I_1} \frac{1}{n_1} + \sum_{n_2 \in I_2} \frac{1}{n_2} \in \mathbb{N}? $$ -/ -@[category research open, AMS 11] -theorem erdos_288 : answer(sorry) ↔ Set.Finite { I : Fin 2 → ℕ+ × ℕ+ | +@[category research open, question, AMS 11] +theorem erdos_288 : Set.Finite { I : Fin 2 → ℕ+ × ℕ+ | ∀ j, (I j).1 ≤ (I j).2 ∧ ∃ n : ℕ+, (∑ j : Fin 2, ∑ nⱼ ∈ Set.Icc (I j).1 (I j).2, (nⱼ⁻¹ : ℚ)) = n } := by sorry @@ -39,16 +42,16 @@ theorem erdos_288 : answer(sorry) ↔ Set.Finite { I : Fin 2 → ℕ+ × ℕ+ | /-- This is still open even if $|I_2| = 1$. -/ -@[category research open, AMS 11] -theorem erdos_288.variants.i2_card_eq_1 : answer(sorry) ↔ Set.Finite { (I, n₂) : (ℕ+ × ℕ+) × ℕ+ | +@[category research open, question, AMS 11] +theorem erdos_288.variants.i2_card_eq_1 : Set.Finite { (I, n₂) : (ℕ+ × ℕ+) × ℕ+ | I.1 ≤ I.2 ∧ ∃ n : ℕ+, ∑ n₁ ∈ Set.Icc I.1 I.2, (n₁⁻¹ : ℚ) + (n₂⁻¹ : ℚ) = n } := by sorry /-- It is perhaps true with two intervals replaced by any $k$ intervals. -/ -@[category research open, AMS 11] -theorem erdos_288.variants.k_intervals : answer(sorry) ↔ ∀ k, Set.Finite { I : Fin k → ℕ+ × ℕ+ | +@[category research open, question, AMS 11] +theorem erdos_288.variants.k_intervals : ∀ k, Set.Finite { I : Fin k → ℕ+ × ℕ+ | ∀ j, (I j).1 ≤ (I j).2 ∧ ∃ n : ℕ+, (∑ j : Fin k, ∑ nⱼ ∈ Set.Icc (I j).1 (I j).2, (nⱼ⁻¹ : ℚ)) = n } := by sorry @@ -56,8 +59,8 @@ theorem erdos_288.variants.k_intervals : answer(sorry) ↔ ∀ k, Set.Finite { I /-- Is it true for any $k > 2$ that only finitely many $k$ intervals satisfy this condition? -/ -@[category research open, AMS 11] -theorem erdos_288.variants.exists_k_gt_2 : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_288.variants.exists_k_gt_2 : ∃ k > 2, Set.Finite { I : Fin k → ℕ+ × ℕ+ | ∀ j, (I j).1 ≤ (I j).2 ∧ ∃ n : ℕ+, (∑ j : Fin k, ∑ nⱼ ∈ Set.Icc (I j).1 (I j).2, (nⱼ⁻¹ : ℚ)) = n } := by diff --git a/FormalConjectures/ErdosProblems/295.lean b/FormalConjectures/ErdosProblems/295.lean index 2257a8d..ed24c06 100644 --- a/FormalConjectures/ErdosProblems/295.lean +++ b/FormalConjectures/ErdosProblems/295.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 295 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/295](https://www.erdosproblems.com/295) -/ +@[expose] public section + open scoped Real namespace Erdos295 @@ -31,17 +34,18 @@ Helper lemma: for each $N$, there exists $k$ and $n_1 < ... < n_k$ such that $N ≤ n_1 < ⋯ < n_k$ with $\frac 1 {n_1} + ... + \frac 1 {n_k} = 1$. -/ @[category textbook, AMS 5 11] -lemma exists_k (N : ℕ) : ∃ (k : ℕ) (n : Fin k.succ → ℕ), +lemma exists_k (N : ℕ) : ∃ (k : ℕ) (n : Fin k → ℕ), (∀ i, N ≤ n i) ∧ StrictMono n ∧ ∑ i, (1 / n i : ℝ) = 1 := by sorry /-- Let $k(N)$ denote the smallest $k$ such that there exists $N ≤ n_1 < ⋯ < n_k$ with $\frac 1 {n_1} + ... + \frac 1 {n_k} = 1$. + +Such a $k$ exists by `exists_k`. -/ noncomputable abbrev k (N : ℕ) : ℕ := - open scoped Classical in - Nat.find (exists_k N) + sInf {k | ∃ n : Fin k → ℕ, (∀ i, N ≤ n i) ∧ StrictMono n ∧ ∑ i, (1 / n i : ℝ) = 1} /-- @@ -50,9 +54,9 @@ $N ≤ n_1 < ⋯ < n_k$ with $\frac 1 {n_1} + ... + \frac 1 {n_k} = 1$ Is it true that $\lim_{N \to \infty} k(N) - (e - 1)N = \infty$? -/ -@[category research open, AMS 5 11] +@[category research open, question, AMS 5 11] theorem erdos_295 : - answer(sorry) ↔ Filter.atTop.Tendsto (fun N => k N - (rexp 1 - 1)*N) Filter.atTop := by + Filter.atTop.Tendsto (fun N => k N - (rexp 1 - 1)*N) Filter.atTop := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/302.lean b/FormalConjectures/ErdosProblems/302.lean index 3c40672..515b735 100644 --- a/FormalConjectures/ErdosProblems/302.lean +++ b/FormalConjectures/ErdosProblems/302.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 302 @@ -28,6 +29,8 @@ import FormalConjecturesUtil - [va25](https://github.com/Woett/Mathematical-shorts/blob/main/Two-colouring%20and%20density%20lead%20to%20solutions%20to%20an%20equation%20in%20unit%20fractions.pdf) -/ +@[expose] public section + open Filter Finset open scoped Topology @@ -48,6 +51,8 @@ $\frac{1}{a} = \frac{1}{b} + \frac{1}{c}$ with distinct $a, b, c ∈ A$. def IsMaxNoTripleCard (N m : ℕ) : Prop := IsGreatest {k | ∃ A ⊆ Finset.Icc 1 N, NoUnitFractionTriple A ∧ A.card = k} m +def erdos_302.parts.i.answer : ℝ := sorry + /-- Let $f(N)$ be the size of the largest $A\subseteq \{1,\ldots,N\}$ such that there are no solutions to @@ -56,9 +61,9 @@ with distinct $a,b,c\in A$? Estimate $f(N)$. The colouring version of this is [303], which was solved by Brown and Rödl [BrRo91]. -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_302.parts.i (f : ℕ → ℕ) (hf : ∀ N, IsMaxNoTripleCard N (f N)) : - Tendsto (fun N : ℕ => (f N : ℝ) / N) atTop (𝓝 answer(sorry)) := by + Tendsto (fun N : ℕ => (f N : ℝ) / N) atTop (𝓝 erdos_302.parts.i.answer) := by sorry /-- @@ -80,7 +85,38 @@ $f(N)\geq (1/2+o(1))N$. theorem erdos_302.variants.lower_half (f : ℕ → ℕ) (hf : ∀ N, IsMaxNoTripleCard N (f N)) (ε : ℝ) (hε : 0 < ε) : ∀ᶠ N : ℕ in atTop, ((1 : ℝ) / 2 - ε) * N ≤ f N := by - sorry + refine Filter.Eventually.of_forall fun N => ?_ + set A : Finset ℕ := (Finset.range ((N + 1) / 2)).image (fun x => 2 * x + 1) with hA + have hsub : A ⊆ Finset.Icc 1 N := by + intro a ha + obtain ⟨x, hx, rfl⟩ := Finset.mem_image.1 ha + rw [Finset.mem_range] at hx + rw [Finset.mem_Icc] + omega + have hno : NoUnitFractionTriple A := by + intro a ha b hb c hc _ _ _ h + obtain ⟨x, -, rfl⟩ := Finset.mem_image.1 ha + obtain ⟨y, -, rfl⟩ := Finset.mem_image.1 hb + obtain ⟨z, -, rfl⟩ := Finset.mem_image.1 hc + have hx : ((2 * x + 1 : ℕ) : ℚ) ≠ 0 := by positivity + have hy : ((2 * y + 1 : ℕ) : ℚ) ≠ 0 := by positivity + have hz : ((2 * z + 1 : ℕ) : ℚ) ≠ 0 := by positivity + field_simp at h + have h' : (2 * y + 1) * (2 * z + 1) = (2 * x + 1) * (2 * z + 1 + (2 * y + 1)) := by + exact_mod_cast h + have := congrArg (· % 2) h' + simp [Nat.mul_mod, Nat.add_mod] at this + have hcard : A.card = (N + 1) / 2 := by + rw [hA, Finset.card_image_of_injective _ (fun x y hxy => by simpa using hxy), + Finset.card_range] + have hle : (N + 1) / 2 ≤ f N := by + rw [← hcard] + exact (hf N).2 ⟨A, hsub, hno, rfl⟩ + have h1 : (N : ℝ) ≤ 2 * ((N + 1) / 2 : ℕ) := by + exact_mod_cast (by omega : N ≤ 2 * ((N + 1) / 2)) + have h2 : (((N + 1) / 2 : ℕ) : ℝ) ≤ f N := by exact_mod_cast hle + have hN : (0 : ℝ) ≤ N := Nat.cast_nonneg N + nlinarith /-- Stijn Cambie has observed that @@ -103,4 +139,17 @@ theorem erdos_302.variants.upper_nine_tenths (f : ℕ → ℕ) (hf : ∀ N, IsMa ∀ᶠ N : ℕ in atTop, (f N : ℝ) ≤ ((9 : ℝ) / 10 + ε) * N := by sorry +/-- +Kenta Kitamura (KitaKen1 on GitHub) has given a Lean proof +([erdos-302-upper-bound](https://github.com/KitaKen1/erdos-302-upper-bound)) that +$$f(N) \leq (0.8461739827964010+o(1))N.$$ +-/ +@[category research solved, AMS 11, + formal_proof using lean4 at + "https://github.com/KitaKen1/erdos-302-upper-bound/blob/9447ceb/lean/Erdos302ReflectiveUpperFC.lean#L92-L99"] +theorem erdos_302.variants.upper_0_8461739827964010 (f : ℕ → ℕ) + (hf : ∀ N, IsMaxNoTripleCard N (f N)) (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ N : ℕ in atTop, (f N : ℝ) ≤ ((8461739827964010 : ℝ) / 10000000000000000 + ε) * N := by + sorry + end Erdos302 diff --git a/FormalConjectures/ErdosProblems/308.lean b/FormalConjectures/ErdosProblems/308.lean new file mode 100644 index 0000000..5f22470 --- /dev/null +++ b/FormalConjectures/ErdosProblems/308.lean @@ -0,0 +1,115 @@ +/- +Copyright 2025 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 308 + +*References:* +- [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, III, Ernest S., _On some questions of Erdős and Graham about Egyptian + fractions_. Mathematika (1999), 359-372. +-/ + +@[expose] public section + +open Filter Real + +namespace Erdos308 + +/-- `k` is representable as a sum of distinct unit fractions with denominators from +`{1, …, N}`. -/ +def IsRepresentable (N k : ℕ) : Prop := + ∃ A ⊆ Finset.Icc 1 N, ∑ n ∈ A, (1 : ℚ) / n = k + +/-- The set of positive integers representable as a sum of distinct unit fractions with +denominators from `{1, …, N}`. -/ +def representable (N : ℕ) : Set ℕ := {k | 0 < k ∧ IsRepresentable N k} + +/-- `f N` is the smallest positive integer which is not representable as a sum of distinct unit +fractions with denominators from `{1, …, N}`. -/ +noncomputable def f (N : ℕ) : ℕ := sInf {k | 0 < k ∧ ¬ IsRepresentable N k} + +/-- `m N = ⌊∑_{n ≤ N} 1/n⌋`. -/ +def m (N : ℕ) : ℕ := ⌊harmonic N⌋₊ + +/-- +Let $N\geq 1$. What is the smallest integer not representable as the sum of distinct unit +fractions with denominators from $\{1,\ldots,N\}$? + +This was essentially solved by Croot [Cr99] (see `erdos_308.variants.croot`); in particular, +for all sufficiently large $N$, the smallest such integer is either $m_N$ or $m_N+1$, where +$m_N=\lfloor \sum_{n\leq N}\frac{1}{n}\rfloor$. +-/ +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos308.lean#L458"] +theorem erdos_308.parts.i : ∀ᶠ N : ℕ in atTop, f N = m N ∨ f N = m N + 1 := by + sorry + +/-- +Let $N\geq 1$. Is it true that the set of integers representable as the sum of distinct unit +fractions with denominators from $\{1,\ldots,N\}$ has the shape $\{1,\ldots,m\}$ for some $m$? + +It follows from Croot's bounds [Cr99] that this holds for all sufficiently large $N$. +-/ +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos308.lean#L458"] +theorem erdos_308.parts.ii : + ∀ᶠ N : ℕ in atTop, ∃ m, representable N = Set.Icc 1 m := by + sorry + +/-- +If $m_N=\lfloor \sum_{n\leq N}\frac{1}{n}\rfloor$, then the set of integers representable is, for +all $N$ sufficiently large, either $\{1,\ldots,m_N-1\}$ or $\{1,\ldots,m_N\}$. +-/ +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos308.lean#L458"] +theorem erdos_308.variants.shape : ∀ᶠ N : ℕ in atTop, + representable N = Set.Icc 1 (m N - 1) ∨ representable N = Set.Icc 1 (m N) := by + sorry + +/-- +Croot [Cr99] bounded $\eta(N)$, the largest integer such that every integer in +$\{1,\ldots,\eta(N)\}$ is representable; this is $f(N)-1$, so his bounds read +$$\left\lfloor\sum_{n\leq N}\frac{1}{n}-\frac{9}{2}(1+o(1))\frac{(\log\log N)^2}{\log N} +\right\rfloor + 1 \leq f(N)$$ +and +$$f(N)\leq \left\lfloor\sum_{n\leq N}\frac{1}{n}-\frac{1}{2}(1+o(1)) +\frac{(\log\log N)^2}{\log N}\right\rfloor + 1.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_308.variants.croot : + ∃ o₁ o₂ : ℕ → ℝ, Tendsto o₁ atTop (nhds 0) ∧ Tendsto o₂ atTop (nhds 0) ∧ + ∀ᶠ N : ℕ in atTop, + ⌊(harmonic N : ℝ) - 9 / 2 * (1 + o₁ N) * (log (log N)) ^ 2 / log N⌋₊ + 1 ≤ f N ∧ + f N ≤ ⌊(harmonic N : ℝ) - 1 / 2 * (1 + o₂ N) * (log (log N)) ^ 2 / log N⌋₊ + 1 := by + sorry + +/-- +Is it true that, for every $N\geq 1$, the set of integers representable as the sum of distinct +unit fractions with denominators from $\{1,\ldots,N\}$ has the shape $\{1,\ldots,m\}$ for some +$m$? +-/ +@[category research open, question, AMS 11] +theorem erdos_308.variants.all_N : + ∀ N ≥ 1, ∃ m, representable N = Set.Icc 1 m := by + sorry + +end Erdos308 diff --git a/FormalConjectures/ErdosProblems/311.lean b/FormalConjectures/ErdosProblems/311.lean new file mode 100644 index 0000000..92b0817 --- /dev/null +++ b/FormalConjectures/ErdosProblems/311.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 311 + +*References:* +- [erdosproblems.com/311](https://www.erdosproblems.com/311) +- [ErGr80] P. Erdős and R. L. Graham, *Old and new problems and results in combinatorial number + theory*. Monographies de L'Enseignement Mathématique (1980), p. 40. +-/ + +@[expose] public section + +namespace Erdos311 + +open Finset Filter Topology + +/-- +`delta N` is the minimal non-zero value of $\lvert 1-\sum_{n\in A}\frac{1}{n}\rvert$ as $A$ +ranges over all subsets of $\{1,\ldots,N\}$. The empty set gives the value $1$, so the set +below is nonempty for every $N$. +-/ +noncomputable def delta (N : ℕ) : ℝ := + sInf {x : ℝ | x ≠ 0 ∧ ∃ A ⊆ Icc 1 N, x = |1 - ∑ n ∈ A, (1 : ℝ) / n|} + +/-- +Let $\delta(N)$ be the minimal non-zero value of $\lvert 1-\sum_{n\in A}\frac{1}{n}\rvert$ as $A$ +ranges over all subsets of $\{1,\ldots,N\}$. Is it true that +$$\delta(N)=e^{-(c+o(1))N}$$ +for some constant $c\in (0,1)$? + +The formulation in [ErGr80] has the additional condition that $A$ contains no $S$ with +$\sum_{n\in S}\frac{1}{n}=1$; Kovac (in the comments on the problem page) showed that the +formulation above is equivalent. We state $\delta(N)=e^{-(c+o(1))N}$ as +$-\log \delta(N) / N \to c$. +-/ +@[category research open, question, AMS 11] +theorem erdos_311 : + ∃ c ∈ Set.Ioo (0 : ℝ) 1, + Tendsto (fun N : ℕ => -Real.log (delta N) / N) atTop (𝓝 c) := by + sorry + +/-- +The trivial lower bound: every non-zero value of $1 - \sum_{n \in A} 1/n$ is a non-zero rational +with denominator dividing $[1, \ldots, N]$, so $\delta(N) \geq 1/[1,\ldots,N]$. +-/ +@[category textbook, AMS 11] +theorem delta_ge_inv_lcm (N : ℕ) : 1 / (((Icc 1 N).lcm id : ℕ) : ℝ) ≤ delta N := by + sorry + +/-- Since $[1, \ldots, N] = e^{(1+o(1))N}$, the trivial bound gives $\delta(N) \ge e^{-(1+o(1))N}$. -/ +@[category textbook, AMS 11] +theorem delta_ge_exp : ∀ ε > 0, ∀ᶠ N : ℕ in atTop, Real.exp (-(1 + ε) * N) ≤ delta N := by + sorry + +/-- For $N = 1$ the only non-zero value is $\lvert 1-0\rvert = 1$ (from $A = \emptyset$), +so $\delta(1) = 1$. -/ +@[category test, AMS 11] +theorem delta_one : delta 1 = 1 := by + have hset : {x : ℝ | x ≠ 0 ∧ ∃ A ⊆ Icc (1 : ℕ) 1, x = |1 - ∑ n ∈ A, (1 : ℝ) / n|} = {1} := by + ext x + simp only [Set.mem_ofPred_eq, Set.mem_singleton_iff] + constructor + · rintro ⟨hx, A, hA, rfl⟩ + rw [Icc_self, subset_singleton_iff] at hA + rcases hA with rfl | rfl + · simp + · simp at hx + · rintro rfl + exact ⟨one_ne_zero, ∅, empty_subset _, by simp⟩ + unfold delta + rw [hset, csInf_singleton] + +end Erdos311 diff --git a/FormalConjectures/ErdosProblems/312.lean b/FormalConjectures/ErdosProblems/312.lean index 6324d3b..982f73a 100644 --- a/FormalConjectures/ErdosProblems/312.lean +++ b/FormalConjectures/ErdosProblems/312.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 312 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/312](https://www.erdosproblems.com/312) -/ +@[expose] public section + namespace Erdos312 /-- @@ -29,9 +32,8 @@ Does there exist a constant `c > 0` such that, for any `K > 1`, whenever `A` is finite multiset of integers with $\sum_{n \in A} 1/n > K$ there exists some $S \subseteq A$ such that $1 - \exp(-(c*K)) < \sum_{n \in S} 1/n \le 1$? -/ -@[category research open, AMS 5 11] +@[category research open, question, AMS 5 11] theorem erdos_312 : - answer(sorry) ↔ ∃ (c : ℝ), 0 < c ∧ ∀ (K : ℝ), 1 < K → ∃ (N₀ : ℕ), diff --git a/FormalConjectures/ErdosProblems/319.lean b/FormalConjectures/ErdosProblems/319.lean index ca55809..718fe9d 100644 --- a/FormalConjectures/ErdosProblems/319.lean +++ b/FormalConjectures/ErdosProblems/319.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 319 @@ -22,12 +23,16 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/319](https://www.erdosproblems.com/319) -/ +@[expose] public section + open Filter open scoped Topology Finset Real namespace Erdos319 +def erdos_319.answer : ℕ := sorry + /-- What is the size of the largest $A\subseteq\{1, \dots, N\}$ such that there is a function $\delta : A \to \{-1, 1\}$ such that $$ @@ -38,57 +43,18 @@ $$ \sum_{n\in A'}\frac{\delta n}{n} \neq 0 $$ for all non-empty $A'\subsetneq A$. -/ -@[category research open, AMS 5] +@[category research open, question value, AMS 5] theorem erdos_319 (N : ℕ) : IsGreatest { #A | (A) (_ : A ⊆ Finset.Icc 1 N) (_ : ∃ δ : ℕ → ℤˣ, ∑ n ∈ A, (δ n : ℚ) / n = 0 ∧ ∀ A' ⊂ A, A'.Nonempty → ∑ n ∈ A', (δ n : ℚ) / n ≠ 0) } - answer(sorry) := by + erdos_319.answer := by sorry -- Formalisation note: it's possible that solution to `erdos_319` 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. -/-- Let $c(N)$ be the size of the largest $A\subseteq\{1, \dots, N\}$ such that there is a function -$\delta : A \to \{-1, 1\}$ such that -$$ - \sum_{n\in A} \frac{\delta n}{n} = 0 -$$ -and -$$ - \sum_{n\in A'}\frac{\delta n}{n} \neq 0 -$$ -for all non-empty $A'\subsetneq A$. What is $\Theta(c(N))$?-/ -@[category research open, AMS 5] -theorem erdos_319.variants.isTheta (N : ℕ) (c : ℕ → ℝ) - (h : ∀ N, IsGreatest - { (#A : ℝ) | (A) (_ : A ⊆ Finset.Icc 1 N) - (_ : ∃ δ : ℕ → ℤˣ, ∑ n ∈ A, (δ n : ℚ) / n = 0 ∧ - ∀ A' ⊂ A, A'.Nonempty → ∑ n ∈ A', (δ n : ℚ) / n ≠ 0) } (c N)) : - c =Θ[atTop] (answer(sorry) : ℕ → ℝ) := by - sorry +-- expressed asymptotically. To handle this we include an `IsTheta` variant below. -/-- Let $c(N)$ be the size of the largest $A\subseteq\{1, \dots, N\}$ such that there is a function -$\delta : A \to \{-1, 1\}$ such that -$$ - \sum_{n\in A} \frac{\delta n}{n} = 0 -$$ -and -$$ - \sum_{n\in A'}\frac{\delta n}{n} \neq 0 -$$ -for all non-empty $A'\subsetneq A$. Find the simplest $g(N)$ such that $c(N) = O(g(N))$. -/ -@[category research open, AMS 5] -theorem erdos_319.variants.isBigO (N : ℕ) (c : ℕ → ℝ) - (h : ∀ N, IsGreatest - { (#A : ℝ) | (A) (_ : A ⊆ Finset.Icc 1 N) - (_ : ∃ δ : ℕ → ℤˣ, ∑ n ∈ A, (δ n : ℚ) / n = 0 ∧ - ∀ A' ⊂ A, A'.Nonempty → ∑ n ∈ A', (δ n : ℚ) / n ≠ 0) } (c N)) : - c =O[atTop] (answer(sorry) : ℕ → ℝ) := by - sorry +def erdos_319.variants.isTheta.answer : ℕ → ℝ := fun N ↦ (N : ℝ) /-- Let $c(N)$ be the size of the largest $A\subseteq\{1, \dots, N\}$ such that there is a function $\delta : A \to \{-1, 1\}$ such that @@ -99,14 +65,17 @@ and $$ \sum_{n\in A'}\frac{\delta n}{n} \neq 0 $$ -for all non-empty $A'\subsetneq A$. Find the simplest $g(N)$ such that $c(N) = o(g(N))$. -/ -@[category research open, AMS 5] -theorem erdos_319.variants.isLittleO (N : ℕ) (c : ℕ → ℝ) +for all non-empty $A'\subsetneq A$. What is $\Theta(c(N))$? + +Trivially $c(N) \leq N$, and `erdos_319.variants.lb` gives $c(N) \geq (1 - \frac{1}{e} + o(1))N$, +so $c(N) = \Theta(N)$. -/ +@[category research solved, question value, AMS 5] +theorem erdos_319.variants.isTheta (N : ℕ) (c : ℕ → ℝ) (h : ∀ N, IsGreatest { (#A : ℝ) | (A) (_ : A ⊆ Finset.Icc 1 N) (_ : ∃ δ : ℕ → ℤˣ, ∑ n ∈ A, (δ n : ℚ) / n = 0 ∧ ∀ A' ⊂ A, A'.Nonempty → ∑ n ∈ A', (δ n : ℚ) / n ≠ 0) } (c N)) : - c =o[atTop] (answer(sorry) : ℕ → ℝ) := by + c =Θ[atTop] erdos_319.variants.isTheta.answer := by sorry /-- Adenwalla has observed that a lower bound (on the maximum size of $A$) of diff --git a/FormalConjectures/ErdosProblems/321.lean b/FormalConjectures/ErdosProblems/321.lean index e58fa81..abc4f3c 100644 --- a/FormalConjectures/ErdosProblems/321.lean +++ b/FormalConjectures/ErdosProblems/321.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 321 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/321](https://www.erdosproblems.com/321) -/ +@[expose] public section + open Filter Real open scoped Finset @@ -36,47 +39,55 @@ noncomputable def R (N : ℕ) : ℕ := sSup { #A | (A) (_ : A ⊆ Finset.Icc 1 N) (_ : Set.InjOn (fun (S : Finset ℕ) ↦ ∑ n ∈ S, (1 : ℚ) / n) A.powerset) } +def erdos_321.answer : ℕ := sorry + /-- Let $R(N)$ be the size of the largest $A\subseteq\{1, ..., N\}$ such that all sums $\sum_{n\in S} \frac{1}{n}$ are distinct for $S\subseteq A$. What is $R(N)$? -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_321 (N : ℕ) : - R N = answer(sorry) := by + R N = erdos_321.answer := by sorry /- Formalisation note: it's possible that solution to `erdos_321` 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 +the use of an `answer` definition left as `sorry`. 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. -/ +def erdos_321.variants.isTheta.answer : ℕ → ℝ := sorry + /-- Let $R(N)$ be the size of the largest $A\subseteq\{1, ..., N\}$ such that all sums $\sum_{n\in S} \frac{1}{n}$ are distinct for $S\subseteq A$. What is $\Theta(R(N))$? -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_321.variants.isTheta : - (fun N ↦ (R N : ℝ)) =Θ[atTop] (answer(sorry) : ℕ → ℝ) := by + (fun N ↦ (R N : ℝ)) =Θ[atTop] erdos_321.variants.isTheta.answer := by sorry +def erdos_321.variants.isBigO.answer : ℕ → ℝ := sorry + /-- Let $R(N)$ be the size of the largest $A\subseteq\{1, ..., N\}$ such that all sums $\sum_{n\in S} \frac{1}{n}$ are distinct for $S\subseteq A$. Find the simplest $g(N)$ such that $R(N) = O(g(N))$. -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_321.variants.isBigO : - (fun N ↦ (R N : ℝ)) =O[atTop] (answer(sorry) : ℕ → ℝ) := by + (fun N ↦ (R N : ℝ)) =O[atTop] erdos_321.variants.isBigO.answer := by sorry +def erdos_321.variants.isLittleO.answer : ℕ → ℝ := sorry + /-- Let $R(N)$ be the size of the largest $A\subseteq\{1, ..., N\}$ such that all sums $\sum_{n\in S} \frac{1}{n}$ are distinct for $S\subseteq A$. Find the simplest $g(N)$ such that $R(N) = o(g(N))$. -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_321.variants.isLittleO : - (fun N ↦ (R N : ℝ)) =o[atTop] (answer(sorry) : ℕ → ℝ) := by + (fun N ↦ (R N : ℝ)) =o[atTop] erdos_321.variants.isLittleO.answer := by sorry /-- @@ -101,11 +112,15 @@ R(N) \le \frac{1}{\log 2} \log_r N \left( \frac{N}{\log N} \prod_{i=3}^{r} \log_ $$ valid for any $k \ge 4$ with $\log_k N \ge k$ and any $r \ge 1$ with $\log_{2r} N \ge 1$. (In these bounds $\log_i n$ denotes the $i$-fold iterated logarithm.) +Since `Real.log` is defined on all of $\mathbb{R}$, the condition $\log_{2r} N \ge 1$ is +formalised as $\log_i N \ge 1$ for all $i \le 2r$, which is equivalent to it for the +genuine iterated logarithm and ensures that every intermediate iterate is positive. + [BlEr75] Bleicher, M. N. and Erdős, P., _The number of distinct subsums of $\sum \sb{1}\spN\,1/i$_. Math. Comp. (1975), 29-42. [BlEr76b] Bleicher, Michael N. and Erdős, Paul, _Denominators of Egyptian fractions. II_. Illinois J. Math. (1976), 598-613. -/ @[category research solved, AMS 11] -theorem erdos_321.variants.upper (N r : ℕ) (hr : 1 ≤ r) (hrN : 1 ≤ log^[2 * r] N) : +theorem erdos_321.variants.upper (N r : ℕ) (hr : 1 ≤ r) (hrN : ∀ i ≤ 2 * r, 1 ≤ log^[i] N) : R N ≤ 1 / log 2 * log^[r] N * N / log N * ∏ i ∈ Finset.Icc 3 r, (log^[i] N) := by sorry diff --git a/FormalConjectures/ErdosProblems/322.lean b/FormalConjectures/ErdosProblems/322.lean new file mode 100644 index 0000000..be1e722 --- /dev/null +++ b/FormalConjectures/ErdosProblems/322.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 322 + +*References:* +- [erdosproblems.com/322](https://www.erdosproblems.com/322) +- [Er36] Erdős, Paul, *On the Representation of an Integer as the Sum of k k-th Powers*. J. London + Math. Soc. (1936), 133-136. +- [Er65b] Erdős, Paul, *Some recent advances and current problems in number theory*. Lectures on + Modern Mathematics, Vol. III (1965), 196-244. +- [Gu04] Guy, Richard K., *Unsolved problems in number theory*. (2004), xviii+437. +- [Ma36] Mahler, Kurt, *Note on Hypothesis K of Hardy and Littlewood*. J. London Math. Soc. (1936), + 136-138. +-/ + +@[expose] public section + +namespace Erdos322 + +/-- For `k ≥ 3`, the number of ordered representations of `n` as a sum of `k` many `k`th +powers of positive integers. The bases can be restricted to the interval from `1` to `n`, +since `x ≤ x ^ k` for positive `x`. -/ +def representationCount (k n : ℕ) : ℕ := + ((Finset.univ : Finset (Fin k → Fin (n + 1))).filter + (fun a ↦ (∀ i, 0 < (a i : ℕ)) ∧ ∑ i, (a i : ℕ) ^ k = n)).card + +/-- +Let $k\geq 3$ and $A\subset \mathbb{N}$ be the set of $k$th powers. What is the order of growth of $1_A^{(k)}(n)$, i.e. the number of representations of $n$ as the sum of $k$ many $k$th powers? Does there exist some $c>0$ and infinitely many $n$ such that $$1_A^{(k)}(n) >n^c?$$ +-/ +@[category research open, question, AMS 11] +theorem erdos_322 : + ∀ k : ℕ, 3 ≤ k → ∃ c > (0 : ℝ), + {n : ℕ | (n : ℝ) ^ c < representationCount k n}.Infinite := by + sorry + +end Erdos322 diff --git a/FormalConjectures/ErdosProblems/326.lean b/FormalConjectures/ErdosProblems/326.lean index 1b3712b..94234ff 100644 --- a/FormalConjectures/ErdosProblems/326.lean +++ b/FormalConjectures/ErdosProblems/326.lean @@ -13,15 +13,23 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 326 -*Reference:* [erdosproblems.com/326](https://www.erdosproblems.com/326) +*References:* +- [erdosproblems.com/326](https://www.erdosproblems.com/326) +- [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), p. 47. +- [Ca57] Cassels, J. W. S., *Über Basen der natürlichen Zahlenreihe*. + Abh. Math. Sem. Univ. Hamburg (1957), 247-257. -/ +@[expose] public section + open Filter open scoped Topology @@ -29,19 +37,26 @@ open scoped Topology namespace Erdos326 /-- -Let $A \subset \mathbb{N}$ be an additive basis of order 2. +Does there exist $A = \{a_1 < a_2 < \cdots\} \subset \mathbb{N}$ which is a minimal basis of +order $2$ (i.e. every large integer is the sum of $2$ elements from $A$, and no proper subset of +$A$ has this property), such that +$$\lim_{k\to\infty} \frac{a_k}{k^2} = c$$ +for some $c \neq 0$? + +Erdős and Graham conjectured a negative answer to this question [ErGr80]. -Must there exist $B = \{b_1 < b_2 < \dots\} \subseteq A$ which is also a basis such that -$\lim_{k\to\infty} \frac{b_k}{k^2}$ does not exist? +"Minimal basis of order $2$" is formalised as `Minimal` for the predicate +`Set.IsAsymptoticAddBasisOfOrder · 2` on sets of naturals ordered by inclusion. -/ -@[category research open, AMS 5 11] -theorem erdos_326 : answer(sorry) ↔ ∀ (A : Set ℕ), A.IsAddBasisOfOrder 2 → - ∃ (b : ℕ → ℕ), StrictMono b ∧ ∀ n, b n ∈ A ∧ (Set.range b).IsAddBasis ∧ - ∀ (x : ℝ), ¬ Tendsto (fun n ↦ (b n : ℝ) / n ^ 2) atTop (𝓝 x) := by +@[category research open, question, AMS 5 11] +theorem erdos_326 : ∃ (a : ℕ → ℕ), StrictMono a ∧ + Minimal (fun A : Set ℕ ↦ A.IsAsymptoticAddBasisOfOrder 2) (Set.range a) ∧ + ∃ (c : ℝ), c ≠ 0 ∧ Tendsto (fun n ↦ (a n : ℝ) / n ^ 2) atTop (𝓝 c) := by sorry /-- -Erdős originally asked whether this was true with `A = B`, but this was disproved by Cassels. +Erdős originally asked this for any basis (not necessarily minimal); such a basis was constructed +by Cassels [Ca57]. -/ -- Formalisation note: This is trivially true for `x = 0` by taking `a = id`. Cassels' proof -- shows it for `0 < x` which is more interesting. diff --git a/FormalConjectures/ErdosProblems/329.lean b/FormalConjectures/ErdosProblems/329.lean index b03c4b6..3706e2a 100644 --- a/FormalConjectures/ErdosProblems/329.lean +++ b/FormalConjectures/ErdosProblems/329.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 329: Maximum Density of Sidon Sets @@ -25,6 +26,8 @@ import FormalConjecturesUtil - [Ha47] Hall, Jr., Marshall, Cyclic projective planes. Duke Math. J. (1947), 1079--1090. -/ +@[expose] public section + open Function Set Filter namespace Erdos329 @@ -40,15 +43,17 @@ noncomputable def sqrtPartialDensity (A : Set ℕ) (N : ℕ) : ℝ := noncomputable def sidonUpperDensity (A : Set ℕ) : ℝ := limsup (fun N => sqrtPartialDensity A N) atTop +def erdos_329.answer : ℝ := sorry + /-- **Erdős Problem 329.** Let `A ⊆ ℕ` be a Sidon set. How large can `lim sup_{N → ∞} |A ∩ {1,…,N}| / N^{1/2}` be? -/ -@[category research open, AMS 5 11] +@[category research open, question value, AMS 5 11] theorem erdos_329 : sSup {sidonUpperDensity A | (A : Set ℕ) (_ : IsSidon A)} = - answer(sorry) := by + erdos_329.answer := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/33.lean b/FormalConjectures/ErdosProblems/33.lean index 9396e1a..10f5c9e 100644 --- a/FormalConjectures/ErdosProblems/33.lean +++ b/FormalConjectures/ErdosProblems/33.lean @@ -13,14 +13,17 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 33 *Reference:* [erdosproblems.com/33](https://www.erdosproblems.com/33) -/ + +@[expose] public section variable {α : Type} [AddCommMonoid α] open Set open scoped goldenRatio @@ -34,21 +37,27 @@ and `n ≥ 0`. -/ def AdditiveBasisCondition (A : Set ℕ) : Prop := ∀ (k : ℕ), ∃ (n : ℕ) (a : ℕ), a ∈ A ∧ k = a + n^2 +def erdos_33.answer : EReal := sorry + /-- Let `A ⊆ ℕ` be a set such that every integer can be written as `n^2 + a` for some `a` in `A` and `n ≥ 0`. What is the smallest possible value of `lim sup n → ∞ |A ∩ {1, …, N}| / N^(1/2)`? -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_33 : ⨅ A : {A : Set ℕ | AdditiveBasisCondition A}, Filter.atTop.limsup (fun N => - (A.1 ∩ Icc 1 N).ncard / (√N : EReal)) = answer(sorry) := by + (A.1 ∩ Icc 1 N).ncard / (√N : EReal)) = erdos_33.answer := by sorry /-- -Erdos observed that this value is finite and > 1. +Erdos observed that this value is finite and > 1. This records the lower bound `> 1`, +i.e. that `1` is a strict lower bound for every admissible `A`; the finiteness is +`erdos_33.variants.vanDoorn`. -/ -@[category research solved, AMS 11] -theorem erdos_33.variants.one_mem_lowerBounds : ∃ A, AdditiveBasisCondition A ∧ - 1 < Filter.atTop.limsup (fun N => (A ∩ Icc 1 N).ncard / √N) := by +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/8c9a8ab727c1f06935b48a5ab4db145572cab9e9/erdos-33/Solution.lean#L70"] +theorem erdos_33.variants.one_mem_lowerBounds : + 1 < ⨅ A : {A : Set ℕ | AdditiveBasisCondition A}, Filter.atTop.limsup (fun N => + (A.1 ∩ Icc 1 N).ncard / (√N : EReal)) := by sorry /-- @@ -56,7 +65,8 @@ The smallest possible value of `lim sup n → ∞ |A ∩ {1, …, N}| / N^(1/2 is at most `2φ^(5/2) ≈ 6.66`, with `φ` equal to the golden ratio. Proven by Wouter van Doorn. -/ -@[category research solved, AMS 11] +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/8c9a8ab727c1f06935b48a5ab4db145572cab9e9/erdos-33/Solution.lean#L75"] theorem erdos_33.variants.vanDoorn : ⨅ A : {A : Set ℕ | AdditiveBasisCondition A}, Filter.atTop.limsup (fun N => (A.1 ∩ Icc 1 N).ncard / (√N : EReal)) ≤ ↑(2 * (φ ^ ((5 : ℝ) / 2))) := by diff --git a/FormalConjectures/ErdosProblems/332.lean b/FormalConjectures/ErdosProblems/332.lean index cd66b30..f9203b1 100644 --- a/FormalConjectures/ErdosProblems/332.lean +++ b/FormalConjectures/ErdosProblems/332.lean @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil /-! # Erdős Problem 332 @@ -21,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/332](https://www.erdosproblems.com/332) -/ +@[expose] public section + namespace Erdos332 open Set @@ -38,17 +42,19 @@ bound $M$ such that every interval of length $M$ contains an element of $S$. def HasBoundedGaps (S : Set ℤ) : Prop := ∃ M : ℕ, M > 0 ∧ ∀ z : ℤ, ∃ s ∈ S, z ≤ s ∧ s < z + (M : ℤ) +def erdos_332.answer : Set ℕ → Prop := sorry + /-- Let $A\subseteq \mathbb{N}$ and $D(A)$ be the set of those numbers which occur infinitely often as $a_1 - a_2$ with $a_1, a_2\in A$. What conditions on $A$ are sufficient to ensure $D(A)$ has bounded gaps? -This is formalised here using the `answer(sorry)` mechanism. In order to solve this problem one +The sufficient conditions are the unknown `erdos_332.answer`. In order to solve this problem one has to provide what the sufficient conditions are, and proof that they imply the desired condition. If the condition is a solution to the problem is up to human judgement. -/ -@[category research open, AMS 11] -theorem erdos_332 (A : Set ℕ) : (answer(sorry) : Set ℕ → Prop) A → HasBoundedGaps (D_A A) := by +@[category research open, question value, AMS 11] +theorem erdos_332 (A : Set ℕ) : erdos_332.answer A → HasBoundedGaps (D_A A) := by sorry -- TODO(firsching): formalize additional statements diff --git a/FormalConjectures/ErdosProblems/338.lean b/FormalConjectures/ErdosProblems/338.lean new file mode 100644 index 0000000..fde887f --- /dev/null +++ b/FormalConjectures/ErdosProblems/338.lean @@ -0,0 +1,218 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 338 + +*References:* +- [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). +- [ErGr80b] Erdős, P. and Graham, R. L., *On bases with an exact order*. Acta Arith. (1980), + 201-207. +- [HHP07] Hegyvári, Norbert and Hennecart, François and Plagne, Alain, *Answer to a question by + Burr and Erdős on restricted addition, and related results*. Combin. Probab. Comput. (2007), + 747--756. +- [He05] Hennecart, François, *On the restricted order of asymptotic bases of order two*. + Ramanujan J. (2005), 123--130. +- [Ke57] Kelly, John B., *Restricted bases*. Amer. J. Math. (1957), 258-264. +- [Pa33] Pall, Gordon, *On Sums of Squares*. Amer. Math. Monthly (1933), 10-18. +- [Sc54] Schinzel, A., *Sur la décomposition des nombres naturels en sommes de nombres + triangulaires distincts*. Bull. Acad. Polon. Sci. Cl. III. (1954), 409-410. +-/ + +@[expose] public section + +namespace Erdos338 + +open Filter + +/-- `HasOrder A h` means that $A$ is a basis of order $h$: every sufficiently large natural number +is a sum of at most $h$ elements of $A$, with repetition allowed. + +The summands form a `Multiset`, so repetition is allowed. Allowing at most $h$ summands makes the +notion independent of whether $0 \in A$. With exactly $h$ summands, as in +`Set.IsAsymptoticAddBasisOfOrder`, this notion is `(insert 0 A).IsAsymptoticAddBasisOfOrder h`. -/ +def HasOrder (A : Set ℕ) (h : ℕ) : Prop := + ∀ᶠ m in atTop, ∃ S : Multiset ℕ, (∀ x ∈ S, x ∈ A) ∧ S.card ≤ h ∧ S.sum = m + +/-- `HasRestrictedOrder A t` means that every sufficiently large natural number is a sum of at most +$t$ distinct elements of $A$. + +The summands form a `Finset`, so they are distinct. A summand $0$ never helps, so the notion does +not depend on whether $0 \in A$. -/ +def HasRestrictedOrder (A : Set ℕ) (t : ℕ) : Prop := + ∀ᶠ m in atTop, ∃ S : Finset ℕ, (∀ x ∈ S, x ∈ A) ∧ S.card ≤ t ∧ ∑ x ∈ S, x = m + +/-- The order of $A$: the least $h$ with `HasOrder A h`, or `⊤` if $A$ is not a basis. -/ +noncomputable def basisOrder (A : Set ℕ) : ℕ∞ := + ⨅ (h : ℕ) (_ : HasOrder A h), (h : ℕ∞) + +/-- The restricted order of $A$: the least $t$ with `HasRestrictedOrder A t`, or `⊤` if no such +$t$ exists. -/ +noncomputable def restrictedOrder (A : Set ℕ) : ℕ∞ := + ⨅ (t : ℕ) (_ : HasRestrictedOrder A t), (t : ℕ∞) + +def erdos_338.answer : Set ℕ → Prop := sorry + +/-- +The restricted order of a basis $A$ is the least integer $t$ (if it exists) such that every large +integer is the sum of at most $t$ distinct summands from $A$. What are necessary and sufficient +conditions that this exists? + +A solution must fill in `Erdos338.erdos_338.answer` with the condition and prove the +equivalence. Whether a condition is a satisfactory answer is up to human judgement. +-/ +@[category research open, question value, AMS 11] +theorem erdos_338 : + ∀ A : Set ℕ, (∃ h, HasOrder A h) → ((∃ t, HasRestrictedOrder A t) ↔ erdos_338.answer A) := by + sorry + +/-- +Can the restricted order of a basis be bounded (when it exists) in terms of the order of the +basis? + +`HasOrder A h` only says that the order of $A$ is at most $h$. This gives the same question, +since $f$ can be replaced by its running maximum. Kelly [Ke57] showed that $f(2) = 4$ works, and +Hennecart [He05] showed that $4$ is optimal. Hegyvári, Hennecart and Plagne [HHP07] showed that +any such $f$ has $f(k) \geq 2^{k-2}+k-1$ for $k \geq 3$. +-/ +@[category research open, question, AMS 11] +theorem erdos_338.variants.bounded_by_order : + ∃ f : ℕ → ℕ, ∀ (A : Set ℕ) (h : ℕ), HasOrder A h → + (∃ t, HasRestrictedOrder A t) → HasRestrictedOrder A (f h) := by + sorry + +def erdos_338.variants.eq_order.answer : Set ℕ → Prop := sorry + +/-- +What are necessary and sufficient conditions that the restricted order of a basis $A$ is equal to +the order of $A$? + +For a basis, `basisOrder A` is finite, so the equality also says that the restricted order exists. +The condition is `Erdos338.erdos_338.variants.eq_order.answer`, as in `Erdos338.erdos_338`. +-/ +@[category research open, question value, AMS 11] +theorem erdos_338.variants.eq_order : + ∀ A : Set ℕ, (∃ h, HasOrder A h) → + (restrictedOrder A = basisOrder A ↔ erdos_338.variants.eq_order.answer A) := by + sorry + +/-- +Is it true that if $A \setminus F$ is a basis for all finite sets $F$ then $A$ must have a +restricted order? +-/ +@[category research open, question, AMS 11] +theorem erdos_338.variants.basis_after_finite_removal : + ∀ A : Set ℕ, (∀ F : Set ℕ, F.Finite → ∃ h, HasOrder (A \ F) h) → + ∃ t, HasRestrictedOrder A t := by + sorry + +/-- +Is it true that if the sets $A \setminus F$, for all finite sets $F$, are bases of the same order, +then $A$ must have a restricted order? + +We read "the same order" literally: every $A \setminus F$ has the same exact order $h$. This is +equivalent to asking that the orders of the sets $A \setminus F$ are bounded. Removing elements can +only raise the order, so if the orders are bounded, their maximum is attained at some $F_0$, and +$A \setminus F_0 \subseteq A$ satisfies the literal hypothesis. +-/ +@[category research open, question, AMS 11] +theorem erdos_338.variants.same_order_after_finite_removal : + ∀ A : Set ℕ, + (∃ h : ℕ, ∀ F : Set ℕ, F.Finite → basisOrder (A \ F) = (h : ℕ∞)) → + ∃ t, HasRestrictedOrder A t := by + sorry + +/-- +Bateman observed that for $h \geq 3$ the set $A = \{1\} \cup \{x > 0 : h \mid x\}$ is a basis of +order $h$ with no restricted order. +-/ +@[category research solved, AMS 11] +theorem erdos_338.variants.bateman (h : ℕ) (hh : 3 ≤ h) : + basisOrder (insert 1 {x : ℕ | 0 < x ∧ h ∣ x}) = h ∧ + ¬ ∃ t, HasRestrictedOrder (insert 1 {x : ℕ | 0 < x ∧ h ∣ x}) t := by + sorry + +/-- +Kelly [Ke57] showed that any basis of order $2$ has restricted order at most $4$. +-/ +@[category research solved, AMS 11] +theorem erdos_338.variants.kelly (A : Set ℕ) (hA : HasOrder A 2) : HasRestrictedOrder A 4 := by + sorry + +/-- +Kelly [Ke57] showed that any basis of order $2$ with positive lower density has restricted order +at most $3$. +-/ +@[category research solved, AMS 11] +theorem erdos_338.variants.kelly_lowerDensity (A : Set ℕ) (hA : HasOrder A 2) + (hd : 0 < A.lowerDensity) : HasRestrictedOrder A 3 := by + sorry + +/-- +Kelly [Ke57] conjectured that any basis of order $2$ has restricted order at most $3$. + +This was disproved by Hennecart [He05], who constructed a basis of order $2$ with restricted +order $4$. +-/ +@[category research solved, question, AMS 11] +theorem erdos_338.variants.kelly_conjecture : + ¬ ∀ A : Set ℕ, HasOrder A 2 → HasRestrictedOrder A 3 := by + sorry + +/-- +The set of squares has order $4$ and restricted order $5$ (see [Pa33]). + +Here $0$ is a square. The order is $4$ by Lagrange's four-square theorem, and is not $3$ because +no integer $\equiv 7 \pmod 8$ is a sum of three squares. +-/ +@[category research solved, AMS 11] +theorem erdos_338.variants.squares : + basisOrder (Set.range fun k : ℕ ↦ k ^ 2) = 4 ∧ + restrictedOrder (Set.range fun k : ℕ ↦ k ^ 2) = 5 := by + sorry + +/-- +The set of triangular numbers has order $3$ and restricted order $3$ (see [Sc54]). + +Here $0$ is a triangular number. +-/ +@[category research solved, AMS 11] +theorem erdos_338.variants.triangular : + basisOrder (Set.range fun k : ℕ ↦ k * (k + 1) / 2) = 3 ∧ + restrictedOrder (Set.range fun k : ℕ ↦ k * (k + 1) / 2) = 3 := by + sorry + +/-- +Hegyvári, Hennecart and Plagne [HHP07] showed that for all $k \geq 2$ there exists a basis of +order $k$ which has restricted order at least $2^{k-2}+k-1$. + +The basis built in the proof of Theorem 4 of [HHP07] (for $k \geq 3$) has order exactly $k$ and a +finite restricted order, equal to $2^{k-2}+k-1$. The finiteness matters: without it, Bateman's +example `Erdos338.erdos_338.variants.bateman` would already give the bound. For $k = 2$ the bound +is $2$, and $A = \{1\} \cup \{x : 2 \mid x\}$ works. +-/ +@[category research solved, AMS 11] +theorem erdos_338.variants.hegyvari_hennecart_plagne : + ∀ k : ℕ, 2 ≤ k → ∃ A : Set ℕ, + basisOrder A = k ∧ restrictedOrder A = (2 ^ (k - 2) + k - 1 : ℕ) := by + sorry + +end Erdos338 diff --git a/FormalConjectures/ErdosProblems/342.lean b/FormalConjectures/ErdosProblems/342.lean index db37275..18ee8ce 100644 --- a/FormalConjectures/ErdosProblems/342.lean +++ b/FormalConjectures/ErdosProblems/342.lean @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil /-! # Erdős Problem 342 @@ -25,6 +27,8 @@ import FormalConjecturesUtil - [Gu04] Guy, Richard K., *Unsolved problems in number theory* (2004), xviii+437. -/ +@[expose] public section + open Nat Set Filter open scoped Topology @@ -107,32 +111,29 @@ theorem erdos_342.test.a3 : ∀ a : ℕ → ℕ, IsUlamSequence a → a 3 = 4 := /-- Do infinitely many pairs $(a, a+2)$ occur in Ulam's sequence? -/ -@[category research open, AMS 5 11 40] +@[category research open, question, AMS 5 11 40] theorem erdos_342.parts.i : - answer(sorry) ↔ - ∀ a : ℕ → ℕ, IsUlamSequence a → - Set.Infinite {n : ℕ | ∃ m, a m = a n + 2} := by + ∀ a : ℕ → ℕ, IsUlamSequence a → + Set.Infinite {n : ℕ | ∃ m, a m = a n + 2} := by sorry /-- Does Ulam's sequence eventually have periodic differences? That is, is $a(n+1) - a(n)$ eventually periodic? -/ -@[category research open, AMS 5 11 40] +@[category research open, question, AMS 5 11 40] theorem erdos_342.parts.ii : - answer(sorry) ↔ - ∀ a : ℕ → ℕ, IsUlamSequence a → - let d (n : ℕ) : ℤ := a (n + 1) - a n - ∃ p > 0, ∀ᶠ m in atTop, d (m + p) = d m := by + ∀ a : ℕ → ℕ, IsUlamSequence a → + let d (n : ℕ) : ℤ := a (n + 1) - a n + ∃ p > 0, ∀ᶠ m in atTop, d (m + p) = d m := by sorry /-- Part (iii), is the density of the sequence 0? -/ -@[category research open, AMS 5 11 40] +@[category research open, question, AMS 5 11 40] theorem erdos_342.parts.iii : - answer(sorry) ↔ - ∀ a : ℕ → ℕ, IsUlamSequence a → - Set.upperDensity (Set.range a) = 0 := by + ∀ a : ℕ → ℕ, IsUlamSequence a → + Set.upperDensity (Set.range a) = 0 := by sorry end Erdos342 diff --git a/FormalConjectures/ErdosProblems/344.lean b/FormalConjectures/ErdosProblems/344.lean new file mode 100644 index 0000000..fdd82d5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/344.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 344 + +*References:* +- [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 Mathematique (1980). +- [Er61b] Erdős, P., *On the representation of large integers as sums of distinct summands + taken from a fixed set*. Acta Arith. (1961/62), 345-354. +- [Fo66] Folkman, J., *On the representation of integers as sums of distinct terms from a + fixed sequence*. Canadian J. Math. 18 (1966), 643-655. +- [SzVu06] Szemerédi, E. and Vu, V., *Long arithmetic progressions in sumsets: thresholds and + bounds*. J. Amer. Math. Soc. 19 (2006), 119-169. +- [SzVu06b] Szemerédi, E. and Vu, V., *Finite and infinite arithmetic progressions in sumsets*. + Ann. of Math. 163 (2006), 1-35. +-/ + +@[expose] public section + +open Filter + +namespace Erdos344 + +/-- +If $A\subseteq \mathbb{N}$ is a set of integers such that +$$\lvert A\cap \{1,\ldots,N\}\rvert\gg N^{1/2}$$ +for all $N$ then must $A$ be subcomplete? That is, must +$$P(A) = \left\{\sum_{n\in B}n : B\subseteq A\textrm{ finite }\right\}$$ +contain an infinite arithmetic progression? + +This is true, and was proved by Szemerédi and Vu [SzVu06]. + +The implied constant is absolute, as in [SzVu06b, Corollary 1.4]. +-/ +@[category research solved, question, AMS 5 11, + formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos344.lean#L8994"] +theorem erdos_344 : + ∃ C : ℝ, 0 < C ∧ ∀ A : Set ℕ, + (∀ᶠ N : ℕ in atTop, C * Real.sqrt N ≤ A.countUpTo N) → IsSubcomplete A := by + sorry + +/-- +The stronger conjecture that this is true under +$$\lvert A\cap \{1,\ldots,N\}\rvert\geq (2N)^{1/2}$$ +seems to be still open (this would be best possible as shown by [Er61b]). + +The bound is required for all sufficiently large $N$: at $N=1$, it is impossible since +$\lvert A\cap\{1\}\rvert\leq 1<\sqrt{2}$. +-/ +@[category research open, question, AMS 5 11] +theorem erdos_344.variants.sqrt_two : + ∀ A : Set ℕ, (∀ᶠ N : ℕ in atTop, Real.sqrt (2 * N) ≤ A.countUpTo N) → + IsSubcomplete A := by + sorry + +/-- Folkman proved this under the stronger assumption that +$$\lvert A\cap \{1,\ldots,N\}\rvert\gg N^{1/2+\epsilon}$$ +for some $\epsilon>0$ [Fo66]. -/ +@[category research solved, AMS 5 11] +theorem erdos_344.variants.folkman : + ∀ ε : ℝ, 0 < ε → ∀ c : ℝ, 0 < c → ∀ A : Set ℕ, + (∀ᶠ N : ℕ in atTop, c * (N : ℝ) ^ ((1 : ℝ) / 2 + ε) ≤ A.countUpTo N) → + IsSubcomplete A := by + obtain ⟨C, _, h⟩ := erdos_344 + intro ε hε c hc A hA + refine h A ?_ + have hpow : Tendsto (fun N : ℕ ↦ (N : ℝ) ^ ε) atTop atTop := + (tendsto_rpow_atTop hε).comp tendsto_natCast_atTop_atTop + filter_upwards [hA, hpow.eventually_ge_atTop (C / c)] with N hN hNe + have hsplit : (N : ℝ) ^ ((1 : ℝ) / 2 + ε) = Real.sqrt N * (N : ℝ) ^ ε := by + rw [Real.rpow_add' (Nat.cast_nonneg N) (by positivity), Real.sqrt_eq_rpow] + calc C * Real.sqrt N = c * (C / c) * Real.sqrt N := by field_simp + _ ≤ c * (N : ℝ) ^ ε * Real.sqrt N := by gcongr + _ = c * (N : ℝ) ^ ((1 : ℝ) / 2 + ε) := by rw [hsplit]; ring + _ ≤ A.countUpTo N := hN + +@[category test, AMS 5 11] +theorem univ_density (C : ℝ) : + ∀ᶠ N : ℕ in atTop, C * Real.sqrt N ≤ (Set.univ : Set ℕ).countUpTo N := by + have hlim : Tendsto (fun N : ℕ ↦ Real.sqrt N) atTop atTop := + Real.tendsto_sqrt_atTop.comp tendsto_natCast_atTop_atTop + filter_upwards [hlim.eventually_ge_atTop C] with N hN + have hc : (Set.univ : Set ℕ).countUpTo N = N := by simp [Set.countUpTo] + rw [hc] + calc C * Real.sqrt N ≤ Real.sqrt N * Real.sqrt N := by gcongr + _ = N := Real.mul_self_sqrt (Nat.cast_nonneg N) + +end Erdos344 diff --git a/FormalConjectures/ErdosProblems/345.lean b/FormalConjectures/ErdosProblems/345.lean new file mode 100644 index 0000000..3b3dd82 --- /dev/null +++ b/FormalConjectures/ErdosProblems/345.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 345 + +*References:* +- [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), p. 55. +- [Ki17] Kim, D., *On the largest integer that is not a sum of distinct positive nth powers*. + Journal of Integer Sequences 20 (2017), Article 17.7.5. + [arXiv:1610.02439](https://arxiv.org/abs/1610.02439) +-/ + +@[expose] public section + +namespace Erdos345 + +open IsAddComplete + +/-- The set of $k$-th powers of positive integers. -/ +def kthPowers (k : ℕ) : Set ℕ := + {x | ∃ n : ℕ, 0 < n ∧ n ^ k = x} + +/-- +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\geq m$ are in +$$P(A) = \left\{\sum_{n\in B}n : B\subseteq A\textrm{ finite }\right\}$$ +(the existence of $T(A)$ is guaranteed by completeness). + +Is it true that there are infinitely many $k$ such that $T(n^k)>T(n^{k+1})$? + +Here $T(n^k)$ means the threshold of the positive $k$-th powers. Least-threshold witnesses +ensure that the thresholds exist. We restrict to $k\geq 1$, since the zeroth powers form +$\{1\}$, which is incomplete. Positive powers are complete [Ki17]. +-/ +@[category research open, question, AMS 5 11] +theorem erdos_345 : + {k : ℕ | 0 < k ∧ ∃ a b : ℕ, IsLeast (thresholds (kthPowers k)) a ∧ + IsLeast (thresholds (kthPowers (k + 1))) b ∧ b < a}.Infinite := by + sorry + +/-- Every set of positive $k$-th powers with $k\geq 1$ is complete [Ki17]. -/ +@[category research solved, AMS 5 11] +theorem kthPowers_isAddComplete : ∀ k : ℕ, 0 < k → IsAddComplete (kthPowers k) := by + sorry + +/-- Under the convention $0\in\mathbb{N}$, the threshold of the first powers is $0$: +the empty sum represents $0$, and every positive integer is a singleton sum. -/ +@[category test, AMS 5 11] +theorem isLeast_thresholds_one : IsLeast (thresholds (kthPowers 1)) 0 := by + refine ⟨fun n _ ↦ ?_, fun m _ ↦ Nat.zero_le m⟩ + rcases Nat.eq_zero_or_pos n with rfl | hn + · exact ⟨∅, by simp, by simp⟩ + · refine ⟨{n}, ?_, by simp⟩ + intro x hx + simp only [Finset.coe_singleton, Set.mem_singleton_iff] at hx + exact ⟨n, hn, by simp [hx]⟩ + +@[category test, AMS 5 11] +theorem threshold_one : threshold (kthPowers 1) = 0 := + threshold_eq_of_isLeast isLeast_thresholds_one + +end Erdos345 diff --git a/FormalConjectures/ErdosProblems/349.lean b/FormalConjectures/ErdosProblems/349.lean index 1960bac..d7bef8f 100644 --- a/FormalConjectures/ErdosProblems/349.lean +++ b/FormalConjectures/ErdosProblems/349.lean @@ -13,14 +13,17 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 349 *Reference:* [erdosproblems.com/349](https://www.erdosproblems.com/349) -/ +@[expose] public section + namespace Erdos349 open Set Filter Real Nat Function @@ -33,13 +36,15 @@ is the sequence $\lfloor t\alpha^n\rfloor$ complete? def IsGoodPair (t α : ℝ) : Prop := IsAddComplete (range (fun n ↦ ⌊t * α ^ n⌋)) +def erdos_349.answer : Set (ℝ × ℝ) := sorry + /-- For what values of $t,\alpha \in (0,\infty)$ is the sequence $\lfloor t\alpha^n\rfloor$ complete (that is, all sufficiently large integers are the sum of distinct integers of the form $\lfloor t\alpha^n\rfloor$)? -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_349 : - {(t, α) | 0 < t ∧ 0 < α ∧ IsGoodPair t α} = answer(sorry) := by + {(t, α) | 0 < t ∧ 0 < α ∧ IsGoodPair t α} = erdos_349.answer := by sorry /-- @@ -52,32 +57,32 @@ theorem complete_for_alpha_in_Ioo_one_to_goldenRatio (t α : ℝ) (ht : 0 < t) sorry /-- -For any $k$ there exists some $t_k\in (0,1)$ such that the set of $\alpha$ +For any $k$ there exists some $t_k\in (0,1)$ such that the set of $\alpha > 0$ such that the sequence $\lfloor t_k\alpha^n\rfloor$ is complete consists of at least $k$ -disjoint line segments. +disjoint line segments, that is, it has at least $k$ connected components. -/ @[category research solved, AMS 11] theorem exists_t_for_k_disjoint_segments (k : ℕ) : - ∃ t ∈ Ioo 0 1, ∃ (ι : Type), k ≤ (Set.univ : Set ι).encard ∧ ∃ I : ι → Set ℝ, - (∀ i, 2 ≤ (I i).encard ∧ (I i).Nonempty ∧ IsConnected (I i)) ∧ - Pairwise (Disjoint on I) ∧ (⋃ i, I i) ⊆ {α | α > 0 ∧ IsGoodPair t α} := by + ∃ t ∈ Ioo 0 1, + let S := {α | 0 < α ∧ IsGoodPair t α} + k ≤ (connectedComponentIn S '' S).encard := by sorry /-- Is it true that the terms of the sequence $\lfloor (3/2)^n\rfloor$ are odd infinitely often and even infinitely often? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_349.variants.floor_3_halves_odd : - answer(sorry) ↔ {n | Odd ⌊(3/2 : ℝ) ^ n⌋}.Infinite := by + {n | Odd ⌊(3/2 : ℝ) ^ n⌋}.Infinite := by sorry /-- Is it true that the terms of the sequence $\lfloor (3/2)^n\rfloor$ are even infinitely often? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_349.variants.floor_3_halves_even : - answer(sorry) ↔ {n | Even ⌊(3/2 : ℝ) ^ n⌋}.Infinite := by + {n | Even ⌊(3/2 : ℝ) ^ n⌋}.Infinite := by sorry /-- For $\alpha > 2$ and any $t > 0$, the sequence $\lfloor t\alpha^n\rfloor$ is not additively @@ -99,17 +104,18 @@ and no large integer can be a subset sum. A partial result on the open Erdős Pr complementing the $2 < \alpha$ and integer-coefficient cases. -/ @[category research solved, AMS 11, formal_proof using formal_conjectures at - "https://github.com/cepadugato/formal-conjectures/blob/erdos-349-integer-characterization-proof/FormalConjectures/ErdosProblems/349.lean"] + "https://github.com/cepadugato/formal-conjectures/blob/19e39e33be27d46713a423263d38312fe40c9e78/FormalConjectures/ErdosProblems/349.lean"] theorem alpha_le_one_not_isGoodPair (t α : ℝ) (ht : 0 < t) (hα0 : 0 < α) (hα1 : α ≤ 1) : ¬ IsGoodPair t α := by sorry /-- **Binary expansion.** Every natural number $k$ is a sum of distinct powers of two: there is a finite set $E$ of exponents with $k = \sum_{i \in E} 2^i$. Proved by strong induction: -subtract the largest power $2^m \le k$, recurse on the remainder. -/ -@[category research solved, AMS 11, +subtract the largest power $2^m \le k$, recurse on the remainder. A textbook-level building +block for `one_two_isGoodPair` below; it says nothing about `IsGoodPair` itself. -/ +@[category textbook, AMS 11, formal_proof using formal_conjectures at - "https://github.com/cepadugato/formal-conjectures/blob/erdos-349-integer-characterization-proof/FormalConjectures/ErdosProblems/349.lean"] + "https://github.com/cepadugato/formal-conjectures/blob/19e39e33be27d46713a423263d38312fe40c9e78/FormalConjectures/ErdosProblems/349.lean#L319"] theorem exists_finsetSum_two_pow (k : ℕ) : ∃ E : Finset ℕ, k = ∑ i ∈ E, 2 ^ i := by sorry @@ -118,7 +124,7 @@ theorem exists_finsetSum_two_pow (k : ℕ) : additively complete set: every $k \ge 1$ is a finite sum of distinct powers of two. -/ @[category research solved, AMS 11, formal_proof using formal_conjectures at - "https://github.com/cepadugato/formal-conjectures/blob/erdos-349-integer-characterization-proof/FormalConjectures/ErdosProblems/349.lean"] + "https://github.com/cepadugato/formal-conjectures/blob/19e39e33be27d46713a423263d38312fe40c9e78/FormalConjectures/ErdosProblems/349.lean"] theorem one_two_isGoodPair : IsGoodPair 1 2 := by sorry @@ -128,7 +134,7 @@ the exact power $2^m$, so its range contains all powers of two, which already fo complete set. Uses monotonicity `IsAddComplete.mono`. -/ @[category research solved, AMS 11, formal_proof using formal_conjectures at - "https://github.com/cepadugato/formal-conjectures/blob/erdos-349-integer-characterization-proof/FormalConjectures/ErdosProblems/349.lean"] + "https://github.com/cepadugato/formal-conjectures/blob/19e39e33be27d46713a423263d38312fe40c9e78/FormalConjectures/ErdosProblems/349.lean"] theorem dyadic_two_isGoodPair (k : ℕ) : IsGoodPair (1 / 2 ^ k) 2 := by sorry @@ -139,7 +145,7 @@ cannot both be multiples of $t$. Generalizes the parity obstruction ($t = 2$). A on Erdős Problem 349. -/ @[category research solved, AMS 11, formal_proof using formal_conjectures at - "https://github.com/cepadugato/formal-conjectures/blob/erdos-349-integer-characterization-proof/FormalConjectures/ErdosProblems/349.lean"] + "https://github.com/cepadugato/formal-conjectures/blob/19e39e33be27d46713a423263d38312fe40c9e78/FormalConjectures/ErdosProblems/349.lean"] theorem int_coeff_ge_two_not_isGoodPair (t : ℤ) (ht : 2 ≤ t) (α : ℤ) : ¬ IsGoodPair (t : ℝ) (α : ℝ) := by sorry @@ -151,9 +157,23 @@ good, $\alpha \le 1$ fails, $2 < \alpha$ fails (`alpha_gt_two_not_isGoodPair`), $t \ge 2$ fails. -/ @[category research solved, AMS 11, formal_proof using formal_conjectures at - "https://github.com/cepadugato/formal-conjectures/blob/erdos-349-integer-characterization-proof/FormalConjectures/ErdosProblems/349.lean"] + "https://github.com/cepadugato/formal-conjectures/blob/19e39e33be27d46713a423263d38312fe40c9e78/FormalConjectures/ErdosProblems/349.lean"] theorem integer_isGoodPair_iff (t α : ℤ) (ht : 1 ≤ t) (hα : 1 ≤ α) : IsGoodPair (t : ℝ) (α : ℝ) ↔ t = 1 ∧ α = 2 := by sorry +/-- **The pair $(3/2, 2)$ is NOT good.** The negative companion of `dyadic_two_isGoodPair`: +while every dyadic coefficient $1/2^k$ gives a good pair at $\alpha = 2$, the non-dyadic rational +$t = 3/2$ does not. The sequence $\lfloor (3/2)\cdot 2^n\rfloor = 1, 3, 6, 12, 24, \ldots$ is not +additively complete because every term but the first $\lfloor 3/2\rfloor = 1$ is a multiple of +$3$ (namely $\lfloor (3/2)\cdot 2^{n+1}\rfloor = 3\cdot 2^n$), so every subset sum is +$\equiv 0$ or $1 \pmod 3$; the infinitely many integers $\equiv 2 \pmod 3$ are never reached. +A partial result on Erdős Problem 349 in the same divisibility family as +`int_coeff_ge_two_not_isGoodPair` (here the modulus is $3$). -/ +@[category research solved, AMS 11, + formal_proof using formal_conjectures at + "https://github.com/cepadugato/formal-conjectures/blob/erdos-349-three-halves-fiber-proof/FormalConjectures/ErdosProblems/349.lean"] +theorem three_halves_two_not_isGoodPair : ¬ IsGoodPair (3 / 2) 2 := by + sorry + end Erdos349 diff --git a/FormalConjectures/ErdosProblems/352.lean b/FormalConjectures/ErdosProblems/352.lean index 32df5e5..e6d9808 100644 --- a/FormalConjectures/ErdosProblems/352.lean +++ b/FormalConjectures/ErdosProblems/352.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 352 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/352](https://www.erdosproblems.com/352) -/ +@[expose] public section + open scoped EuclideanGeometry open scoped ProbabilityTheory @@ -31,9 +34,9 @@ namespace Erdos352 Is there some $c > 0$ such that every measurable $A \subseteq \mathbb{R}^2$ of measure $\geq c$ contains the vertices of a triangle of area 1? -/ -@[category research open, AMS 51] +@[category research open, question, AMS 51] theorem erdos_352 : - answer(sorry) ↔ ∃ c > (0: ℝ), ∀ A : Set ℝ², MeasurableSet A → ℙ A ≥ c.toEReal + ∃ c > (0: ℝ), ∀ A : Set ℝ², MeasurableSet A → ℙ A ≥ c.toEReal → (∃ t : Affine.Triangle ℝ ℝ², (∀ p : Fin 3, t.points p ∈ A) ∧ EuclideanGeometry.triangle_area (t.points 0) (t.points 1) (t.points 2) = 1) := by diff --git a/FormalConjectures/ErdosProblems/357.lean b/FormalConjectures/ErdosProblems/357.lean index dd19517..c5f1b3d 100644 --- a/FormalConjectures/ErdosProblems/357.lean +++ b/FormalConjectures/ErdosProblems/357.lean @@ -133,7 +133,7 @@ noncomputable def g (n : ℕ) : ℕ := /-- Let $g(n)$ be the maximal $k$ such that there exist integers $1 \le a_1, \dotsc, a_k \le n$ such that all sums of the shape $\sum_{u \le i \le v} a_i$ are distinct. It is known that $$\left(\frac 1 3 + o(1) \right)n \leq g(n) \leq \left(\frac 2 3 + o(1) \right)n.$$ -/ -@[category research open, AMS 11] +@[category research solved, AMS 11] theorem erdos_357.variants.hegyvari : ∃ (o o' : ℕ → ℝ), o =o[atTop] (1 : ℕ → ℝ) ∧ o' =o[atTop] (1 : ℕ → ℝ) ∧ ∀ᶠ n in atTop, (g n : ℝ) ∈ Set.Icc ((1 / 3 + o n) * n) ((2 / 3 + o' n)*n) := by diff --git a/FormalConjectures/ErdosProblems/358.lean b/FormalConjectures/ErdosProblems/358.lean index d6b16b3..f5016fa 100644 --- a/FormalConjectures/ErdosProblems/358.lean +++ b/FormalConjectures/ErdosProblems/358.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 358 @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [Ta26] T. Tao, [Erdős problem 358](https://terrytao.wordpress.com/wp-content/uploads/2026/02/erdos-358-2.pdf) (2026) -/ +@[expose] public section + namespace Erdos358 open Filter Finset @@ -70,9 +73,9 @@ Is there such an $A$ for which $f(n)\to \infty$ as $n\to \infty$? Tao [Ta26] constructed such a sequence with $f(n) \gg \log n$ for all sufficiently large $n$. -/ -@[category research solved, AMS 5 11] +@[category research solved, question, AMS 5 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/1268917deaaaa0d674f651287027baa26cea9920/src/latest/ErdosProblems/Erdos358.lean#L9111"] theorem erdos_358.parts.i : - answer(True) ↔ ∃ A, StrictMono A ∧ atTop.Tendsto (f A) atTop := by + ∃ A, StrictMono A ∧ atTop.Tendsto (f A) atTop := by sorry /-- @@ -82,9 +85,9 @@ Is there an $A$ such that $f(n)\geq 2$ for all large $n$? This also follows from Tao's construction with $f(n) \gg \log n$ [Ta26]. -/ -@[category research solved, AMS 5 11] +@[category research solved, question, AMS 5 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/1268917deaaaa0d674f651287027baa26cea9920/src/latest/ErdosProblems/Erdos358.lean#L9115"] theorem erdos_358.parts.ii : - answer(True) ↔ ∃ A, StrictMono A ∧ ∀ᶠ n in atTop, 2 ≤ f A n := by + ∃ A, StrictMono A ∧ ∀ᶠ n in atTop, 2 ≤ f A n := by sorry /-- @@ -106,14 +109,68 @@ theorem erdos_358.variants.prime_set_density_representation : sorry /-- -It is conjectured that if $A =\{a_1 < \cdots\}$ and $g$ counts the number of representations -$$n=\sum_{u\leq i\leq v}a_i$$ such that the sum has at least two terms, then for all $n$ we have -$1 \leq g(n)$ for sufficiently large $n$. +If $A$ is strictly increasing then any $n > 0$ has at most one representation +$$n=\sum_{u\leq i\leq v}a_i$$ with a single term, so discarding the single-term representations +loses at most one solution. -/ -@[category research open, AMS 5 11] +@[category API, AMS 5 11] +theorem one_le_g_of_two_le_f {A : ℕ → ℕ} (hA : StrictMono A) {n : ℕ} (hn : 0 < n) + (hf : 2 ≤ f A n) : 1 ≤ g A n := by + classical + have hfin : (intervalRepresentations A n).Finite := by + rcases Set.finite_or_infinite (intervalRepresentations A n) with h | h + · exact h + · rw [f, @Nat.card_eq_zero_of_infinite _ h.to_subtype] at hf + omega + have hsub : intervalRepresentationsNonTrivial A n ⊆ intervalRepresentations A n := by + rintro ⟨u, v⟩ hr + simp only [intervalRepresentationsNonTrivial, Set.mem_ofPred_eq] at hr + simp only [intervalRepresentations, Set.mem_ofPred_eq] + exact ⟨hr.1, hr.2.1, hr.2.2.2⟩ + refine (Set.ncard_pos (hfin.subset hsub)).mpr ?_ + by_contra hempty + rw [Set.not_nonempty_iff_eq_empty] at hempty + -- Without a representation of length at least two, every representation is a single term. + have key : ∀ r ∈ intervalRepresentations A n, r.1 = r.2 ∧ A r.1 = n := by + rintro ⟨u, v⟩ hr + simp only [intervalRepresentations, Set.mem_ofPred_eq] at hr + obtain ⟨hu, hv, hsum⟩ := hr + have hle : u ≤ v := by + by_contra hc + rw [Finset.Icc_eq_empty hc, Finset.sum_empty] at hsum + omega + have huv : u = v := by + rcases eq_or_lt_of_le hle with h | h + · exact h + · exact absurd (Set.eq_empty_iff_forall_notMem.mp hempty (u, v) + (by simp only [intervalRepresentationsNonTrivial, Set.mem_ofPred_eq] + exact ⟨hu, hv, h, hsum⟩)) (by simp) + subst huv + exact ⟨rfl, by simpa using hsum.symm⟩ + -- Injectivity of `A` then makes that single term unique, contradicting `2 ≤ f A n`. + have := hfin.to_subtype + obtain ⟨p, hp, q, hq, hpq⟩ := Set.one_lt_ncard_iff_nontrivial.mp hf + obtain ⟨hp₁, hpn⟩ := key p hp + obtain ⟨hq₁, hqn⟩ := key q hq + exact hpq (Prod.ext (hA.injective (hpn.trans hqn.symm)) + (by rw [← hp₁, ← hq₁]; exact hA.injective (hpn.trans hqn.symm))) + +/-- +In [ErGr80] Erdős and Graham further asked whether there is an $A$ with $f(n)\geq 1$ for all +large $n$. Egami observed that this holds trivially for $a_n=n$, so they may have intended to +count only those representations $$n=\sum_{u\leq i\leq v}a_i$$ that use at least two consecutive +terms, which is what $g$ counts. + +This follows from Tao's construction [Ta26], which gives $f(n)\gg\log n$: see +`erdos_358.parts.ii` and `one_le_g_of_two_le_f`. +-/ +@[category research solved, AMS 5 11] theorem erdos_358.variants.one_le : ∃ A, StrictMono A ∧ ∀ᶠ n in atTop, 1 ≤ g A n := by - sorry + obtain ⟨A, hA, hf⟩ := erdos_358.parts.ii + refine ⟨A, hA, ?_⟩ + filter_upwards [hf, eventually_gt_atTop 0] with n hn hn₀ + exact one_le_g_of_two_le_f hA hn₀ hn end Erdos358 diff --git a/FormalConjectures/ErdosProblems/36.lean b/FormalConjectures/ErdosProblems/36.lean index 1b33c95..82ee4ad 100644 --- a/FormalConjectures/ErdosProblems/36.lean +++ b/FormalConjectures/ErdosProblems/36.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 36 @@ -23,6 +24,9 @@ import FormalConjecturesUtil - [erdosproblems.com/36](https://www.erdosproblems.com/36) - [Wikipedial: Minimum overlap problem](https://en.wikipedia.org/wiki/Minimum_overlap_problem) -/ + +@[expose] public section + open scoped Topology open Filter namespace Erdos36 @@ -140,6 +144,7 @@ private lemma maxOverlap_eq_maxOverlapC (A B : Finset ℤ) : /-- The `n`-element subsets of `{1, …, 2n}`. -/ private def parts (n : ℕ) : Finset (Finset ℤ) := + letI : Preorder ℤ := Int.instLinearOrder.toPreorder (Finset.Icc (1 : ℤ) (2 * n)).powerset.filter fun A => A.card = n @[category API, AMS 5 11] @@ -259,9 +264,10 @@ A lower bound of $\frac 1 4$. See [Some remarks on number theory (in Hebrew)](https://users.renyi.hu/~p_erdos/1955-13.pdf) by *Paul Erdős*, Riveon Lematematika 9, p.45-48,1955 -/ -@[category textbook, AMS 5 11] +@[category textbook, AMS 5 11, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/22db103d7b6109baca46f2623a7287b965a56936/erdos-36/Solution.lean#L52"] theorem minimum_overlap.variants.lower.erdos_1955 : - (1 : ℝ) / 4 < atTop.liminf MinOverlapQuotient := by + (1 : ℝ) / 4 ≤ atTop.liminf MinOverlapQuotient := by sorry /-- @@ -270,7 +276,8 @@ Scherk (written communication), see [On the minimal overlap problem of Erdös](https://eudml.org/doc/206397) by *Leo Moser*, Аста Аrithmetica V, p. 117-119, 1959 -/ -@[category research solved, AMS 5 11] +@[category research solved, AMS 5 11, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/22db103d7b6109baca46f2623a7287b965a56936/erdos-36/Solution.lean#L56"] theorem minimum_overlap.variants.lower.scherk_1955 : 1 - (√2)⁻¹ < atTop.liminf MinOverlapQuotient := by sorry @@ -281,7 +288,8 @@ See [On the intersection of a linear set with the translation of its complement] by *Stanisław Świerczkowski1*, Colloquium Mathematicum 5(2), p. 185-197, 1958 -/ -@[category research solved, AMS 5 11] +@[category research solved, AMS 5 11, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/22db103d7b6109baca46f2623a7287b965a56936/erdos-36/Solution.lean#L60"] theorem minimum_overlap.variants.lower.swierczkowski_1958 : (4 - 6 ^ ((1 : ℝ) / 2)) / 5 < atTop.liminf MinOverlapQuotient := by sorry @@ -295,19 +303,21 @@ theorem minimum_overlap.variants.lower.haugland_1996 : sorry /-- -A lower bound of $0.379005$. +A lower bound of $0.379005$: the minimum overlap constant is at least $0.379005$. See [Erdős' minimum overlap problem](https://arxiv.org/abs/2201.05704) by *Ethan Patrick White*, 2022 -/ @[category research solved, AMS 5 11] -theorem minimum_overlap.variants.lower.white_2022 : 0.379005 < atTop.liminf MinOverlapQuotient := by +theorem minimum_overlap.variants.lower.white_2022 : + 0.379005 ≤ atTop.liminf MinOverlapQuotient := by sorry /-- The example (with $N$ even), $A = \{\frac N 2 + 1, \dots, \frac{3N}{2}\}$ shows an upper bound of $\frac 1 2$. -/ -@[category research solved, AMS 5 11] +@[category research solved, AMS 5 11, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/22db103d7b6109baca46f2623a7287b965a56936/erdos-36/Solution.lean#L68"] theorem minimum_overlap.variants.upper.erdos_1955 : atTop.limsup MinOverlapQuotient ≤ (1 : ℝ) / 2 := by sorry @@ -342,20 +352,26 @@ by *Jan Kristian Haugland* theorem minimum_overlap.variants.upper.haugland_2022 : atTop.limsup MinOverlapQuotient ≤ 0.3809268534330870 := by sorry +def erdos_36.variants.lower.answer : ℝ := sorry + /-- Find a better lower bound! -/ -@[category research open, AMS 5 11] +@[category research open, question value, AMS 5 11] theorem erdos_36.variants.lower: - ∃ (c : ℝ), 0.379005 < c ∧ c ≤ atTop.liminf MinOverlapQuotient ∧ c = answer(sorry) := by + ∃ (c : ℝ), 0.379005 < c ∧ c ≤ atTop.liminf MinOverlapQuotient ∧ c = + erdos_36.variants.lower.answer := by sorry +def erdos_36.variants.upper.answer : ℝ := sorry + /-- Find a better upper bound! -/ -@[category research open, AMS 5 11] +@[category research open, question value, AMS 5 11] theorem erdos_36.variants.upper : - ∃ (c : ℝ), c < 0.380926853433087 ∧ atTop.limsup MinOverlapQuotient ≤ c ∧ c = answer(sorry) := by + ∃ (c : ℝ), c < 0.380926853433087 ∧ atTop.limsup MinOverlapQuotient ≤ c ∧ c = + erdos_36.variants.upper.answer := by sorry /-- @@ -365,11 +381,13 @@ The limit of `MinOverlapQuotient` exists and it is less than $0.385694$. theorem erdos_36.variants.exists : ∃ c, atTop.Tendsto MinOverlapQuotient (𝓝 c) ∧ c < 0.385694 := by sorry +def erdos_36.answer : ℝ := sorry + /-- Find the value of the limit of `MinOverlapQuotient`! -/ -@[category research open, AMS 5 11] -theorem erdos_36 : atTop.Tendsto MinOverlapQuotient (𝓝 answer(sorry)) := by +@[category research open, question value, AMS 5 11] +theorem erdos_36 : atTop.Tendsto MinOverlapQuotient (𝓝 erdos_36.answer) := by sorry end Erdos36 diff --git a/FormalConjectures/ErdosProblems/361.lean b/FormalConjectures/ErdosProblems/361.lean index 395a6cb..6937fa1 100644 --- a/FormalConjectures/ErdosProblems/361.lean +++ b/FormalConjectures/ErdosProblems/361.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 361 @@ -22,7 +23,7 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/361](https://www.erdosproblems.com/361) -/ -open Filter +@[expose] public section namespace Erdos361 @@ -58,24 +59,16 @@ its subset $\{1, 3\}$ sums to $4$. theorem maxSubsetSumAvoidingCard_three_four : maxSubsetSumAvoidingCard 3 4 = 2 := by native_decide +def erdos_361.answer : ℕ → ℕ := sorry + /-- Let $c > 0$ and $n$ be some large integer. What is the size of the largest set $A \subseteq \{1, \ldots, \lfloor c n \rfloor\}$ such that $n$ is not a sum of a subset of $A$? Does this depend on $n$ in an irregular way? -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_361 (c : ℝ) (hc : 0 < c) : - subsetSumAvoidanceNumber c = answer(sorry) := by - sorry - -/-- -Asymptotic version of Erdős Problem 361: determine the order of growth of the largest cardinality -as $n \to \infty$. --/ -@[category research open, AMS 11] -theorem erdos_361.asymptotic (c : ℝ) (hc : 0 < c) : - (fun n ↦ (subsetSumAvoidanceNumber c n : ℝ)) =Θ[atTop] - (answer(sorry) : ℕ → ℝ) := by + subsetSumAvoidanceNumber c = erdos_361.answer := by sorry end Erdos361 diff --git a/FormalConjectures/ErdosProblems/365.lean b/FormalConjectures/ErdosProblems/365.lean new file mode 100644 index 0000000..e6eb808 --- /dev/null +++ b/FormalConjectures/ErdosProblems/365.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 365 + +*References:* +- [erdosproblems.com/365](https://www.erdosproblems.com/365) +- [Go70] Golomb, S. W., *Powerful numbers*. Amer. Math. Monthly (1970), 848-855. +- [Gu04] Guy, R. K., *Unsolved problems in number theory* (2004), Problem B16. +- [Wa76] Walker, D. T., *Consecutive integer pairs of powerful numbers and related + Diophantine equations*. Fibonacci Quart. (1976), 111-116. +-/ + +@[expose] public section + +namespace Erdos365 + +/-- Golomb's consecutive powerful pair $12167=23^3$ and $12168=2^3 3^2 13^2$. +Neither number is a square [Go70]. -/ +@[category test, AMS 11] +theorem golomb_pair : + Nat.Powerful 12167 ∧ Nat.Powerful 12168 ∧ + ¬ IsSquare (12167 : ℕ) ∧ ¬ IsSquare (12168 : ℕ) := by + have hA : Nat.Powerful 12167 := by + intro p hp + obtain ⟨hp, hd, _⟩ := Nat.mem_primeFactors.mp hp + have hpow : p ∣ (23 : ℕ) ^ 3 := by norm_num at hd ⊢; exact hd + have heq : p = 23 := Nat.prime_eq_prime_of_dvd_pow hp (by norm_num) hpow + subst p + norm_num + have hB : Nat.Powerful 12168 := by + intro p hp + obtain ⟨hp, hd, _⟩ := Nat.mem_primeFactors.mp hp + have hprod : p ∣ (2 : ℕ) ^ 3 * 3 ^ 2 * 13 ^ 2 := by norm_num at hd ⊢; exact hd + rcases hp.dvd_mul.mp hprod with hab | hc + · rcases hp.dvd_mul.mp hab with ha | hb + · have heq : p = 2 := Nat.prime_eq_prime_of_dvd_pow hp (by norm_num) ha + subst p + norm_num + · have heq : p = 3 := Nat.prime_eq_prime_of_dvd_pow hp (by norm_num) hb + subst p + norm_num + · have heq : p = 13 := Nat.prime_eq_prime_of_dvd_pow hp (by norm_num) hc + subst p + norm_num + have hns : ∀ n : ℕ, 12100 < n → n < 12321 → ¬ IsSquare n := by + intro n hlo hhi ⟨r, hr⟩ + have hrlo : 110 < r := by nlinarith + have hrhi : r < 111 := by nlinarith + omega + exact ⟨hA, hB, hns _ (by norm_num) (by norm_num), hns _ (by norm_num) (by norm_num)⟩ + +/-- +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? + +The answer to the first question is no: Golomb [Go70] observed that both $12167=23^3$ and +$12168=2^3 3^2 13^2$ are powerful. + +We require $n>0$ since `Nat.Powerful` also includes $0$. +-/ +@[category research solved, question, AMS 11] +theorem erdos_365.parts.i : + ¬ ∀ n : ℕ, 0 < n → Nat.Powerful n → Nat.Powerful (n + 1) → + IsSquare n ∨ IsSquare (n + 1) := by + intro h + obtain ⟨hA, hB, hnA, hnB⟩ := golomb_pair + rcases h 12167 (by norm_num) hA hB with hs | hs + · exact hnA hs + · exact hnB hs + +/-- Is the number of positive $n\leq x$ such that $n$ and $n+1$ are both powerful bounded +by $(\log x)^{O(1)}$? -/ +@[category research open, question, AMS 11] +theorem erdos_365.parts.ii : + ∃ C : ℝ, 0 < C ∧ ∃ k : ℕ, ∀ᶠ x : ℕ in Filter.atTop, + ({n : ℕ | 0 < n ∧ n ≤ x ∧ Nat.Powerful n ∧ Nat.Powerful (n + 1)}.ncard : ℝ) ≤ + C * (Real.log x) ^ k := by + sorry + +end Erdos365 diff --git a/FormalConjectures/ErdosProblems/367.lean b/FormalConjectures/ErdosProblems/367.lean index 6a6686a..76db763 100644 --- a/FormalConjectures/ErdosProblems/367.lean +++ b/FormalConjectures/ErdosProblems/367.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 367 @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [ErGr80] P. Erdős and R. L. Graham, *Old and New Problems and Results in Combinatorial Number Theory*, L'Enseignement Mathématique (1980). -/ +@[expose] public section + open Asymptotics Filter namespace Erdos367 @@ -39,8 +42,8 @@ Let $B_2(n)$ be the $2$-full part of $n$ (that is, $B_2(n)=n/n'$ where $n'$ is t primes that divide $n$ exactly once). Is it true that, for every fixed $k \geq 1$, $\prod_{n \leq m < n+k} B_2(m) \ll n^{2+o(1)}$? -/ -@[category research open, AMS 11] -theorem erdos_367.parts.i : answer(sorry) ↔ ∀ k : ℕ, 1 ≤ k → +@[category research open, question, AMS 11] +theorem erdos_367.parts.i : ∀ k : ℕ, 1 ≤ k → ∃ e : ℕ → ℝ, e =o[atTop] (1 : ℕ → ℝ) ∧ ∀ᶠ n in atTop, @@ -52,8 +55,8 @@ Or perhaps even $\prod_{n \leq m < n+k} B_2(m) \ll_k n^2$? van Doorn notes in the comments that this fails for all $k \geq 3$. -/ -@[category research solved, AMS 11] -theorem erdos_367.parts.ii : answer(False) ↔ ∀ k : ℕ, 1 ≤ k → +@[category research solved, question, AMS 11] +theorem erdos_367.parts.ii : ¬ ∀ k : ℕ, 1 ≤ k → (fun n ↦ ((∏ m ∈ .Ico n (n + k), B 2 m : ℕ) : ℝ)) =O[atTop] fun n ↦ (n : ℝ) ^ (2 : ℝ) := by sorry @@ -83,12 +86,24 @@ theorem erdos_367.variants.k_ge_three_lower : It would also be interesting to find upper and lower bounds for the analogous product with $B_r$ for $r \geq 3$, where $B_r(n)$ is the $r$-full part of $n$ (that is, the product of prime powers $p^a \mid n$ such that $p^{a+1} \nmid n$ and $a \geq r$). Is it true that, for every fixed -$r,k \geq 2$ and $\epsilon > 0$, -$\limsup \frac{\prod_{n \leq m < n+k} B_r(m)}{n^{1+\epsilon}} \to \infty$? +$r \geq 3$ and $k \geq 2$, there is some $\epsilon = \epsilon(r, k) > 0$ with +$\limsup \frac{\prod_{n \leq m < n+k} B_r(m)}{n^{1+\epsilon}} = \infty$? + +The webpage writes "for every fixed $r,k \geq 2$ and $\epsilon > 0$", but van Doorn observes in +the [comments](https://www.erdosproblems.com/forum/thread/367#post-1766) that the intended +reading lets $\epsilon$ depend on $r$ and $k$. Since $B_r(m) \mid m$, the product is at most +$\prod_{n \leq m < n+k} m$, so the reading with $\epsilon$ universally quantified is false. + +The answer is yes: $\epsilon = 1/(2r)$ works. For $j \geq r$ let $x = 2^j + 1$ and $n = x^r - 1$; +then $B_r(n+1) = x^r$ and $2^j \mid n$ gives $B_r(n) \geq 2^j$, so the product over $[n, n+k)$ is at +least $2^j x^r \geq (\sqrt{x}/2)\, n^{1 + 1/(2r)}$, which is unbounded. A stronger exponent +(any $\epsilon < (r+1)/r^2$) is claimed in the [forum](https://www.erdosproblems.com/forum/thread/367) +but is not formalised. -/ -@[category research open, AMS 11] -theorem erdos_367.variants.higher_full_parts : answer(sorry) ↔ - ∀ r k : ℕ, 3 ≤ r → 2 ≤ k → ∀ ε : ℝ, 0 < ε → +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/kusasyu36/erdos367-higher-full-parts/blob/9c995fbb1ec62bd675ac9bc162f9e2337d6db4f9/Erdos367HigherFullParts.lean#L57"] +theorem erdos_367.variants.higher_full_parts : + ∀ r k : ℕ, 3 ≤ r → 2 ≤ k → ∃ ε : ℝ, 0 < ε ∧ atTop.limsup (fun n ↦ ((∏ m ∈ .Ico n (n + k), B r m : ℕ) / (n : ℝ) ^ (1 + ε) |>.toEReal)) = ⊤ := by sorry diff --git a/FormalConjectures/ErdosProblems/368.lean b/FormalConjectures/ErdosProblems/368.lean new file mode 100644 index 0000000..5ae4205 --- /dev/null +++ b/FormalConjectures/ErdosProblems/368.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 368 + +*References:* +- [erdosproblems.com/368](https://www.erdosproblems.com/368) +- [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 (1976), 25–44. +- [Po18] Pólya, Georg, Zur arithmetischen Untersuchung der Polynome. + Math. Z. (1918), 143–148. +- [Sc67b] Schinzel, A., On two theorems of Gelfond and some of their applications. + Acta Arith. (1967/68), 177–236. +-/ + +@[expose] public section + +namespace Erdos368 + +open Filter + +/-- The largest prime factor of $n(n+1)$. -/ +def F (n : ℕ) : ℕ := (n * (n + 1)).maxPrimeFac + +/-- +How large is the largest prime factor of $n(n+1)$? +The truth is probably $F(n)\gg (\log n)^2$ for all $n$. +-/ +@[category research open, AMS 11] +theorem erdos_368.lower_bound : + ∃ c : ℝ, 0 < c ∧ ∀ n : ℕ, 1 ≤ n → c * Real.log n ^ 2 ≤ (F n : ℝ) := by + sorry + +/-- +Erdős [Er76d] conjectured that, for every $\epsilon>0$, there are infinitely many $n$ +such that $F(n)<(\log n)^{2+\epsilon}$. +-/ +@[category research open, AMS 11] +theorem erdos_368.upper_bound : + ∀ ε : ℝ, 0 < ε → ∃ᶠ n : ℕ in atTop, (F n : ℝ) < Real.log n ^ (2 + ε) := by + sorry + +/-- Pólya [Po18] proved that $F(n)\to\infty$ as $n\to\infty$. -/ +@[category research solved, AMS 11] +theorem erdos_368.variants.tendsto : Tendsto F atTop atTop := by + sorry + +/-- +For every $\delta>0$, there are infinitely many $n$ with $F(n)\leq n^\delta$. +This follows from Schinzel's [Sc67b] observation that, for infinitely many $n$, +$F(n)\leq n^{O(1/\log\log\log n)}$. +-/ +@[category research solved, AMS 11] +theorem erdos_368.variants.subpower : + ∀ δ : ℝ, 0 < δ → ∃ᶠ n : ℕ in atTop, (F n : ℝ) ≤ (n : ℝ) ^ δ := by + sorry + +@[category test, AMS 11] +example : F 1 = 2 := by decide +kernel + +@[category test, AMS 11] +example : F 8 = 3 := by decide +kernel + +@[category test, AMS 11] +example : F 80 = 5 := by decide +kernel + +@[category test, AMS 11] +example : F 4374 = 7 := by decide +kernel + +end Erdos368 diff --git a/FormalConjectures/ErdosProblems/377.lean b/FormalConjectures/ErdosProblems/377.lean index 83c32ad..799e61e 100644 --- a/FormalConjectures/ErdosProblems/377.lean +++ b/FormalConjectures/ErdosProblems/377.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 377 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/377](https://www.erdosproblems.com/377) -/ +@[expose] public section + open Filter open scoped Topology @@ -42,8 +45,8 @@ $$ $$ for all $n$? -/ -@[category research open, AMS 11] -theorem erdos_377 : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_377 : ∃ C > (0 : ℝ), ∀ (n : ℕ), sumInvPrimesNotDvdCentralBinom n ≤ C := by sorry @@ -103,14 +106,14 @@ and $$ \gamma_0 = \sum_{k = 2}^{\infty} \frac{\log k}{2^k} $$ -then for almost all integers $f(m) = \gamma_0 + o(1)$. +then for almost all integers $f(m) = \gamma_0 + o(1)$, i.e. for every $\varepsilon > 0$ the set of +$n$ with $|f(n) - \gamma_0| < \varepsilon$ has natural density one. [EGRS75] Erdős, P. and Graham, R. L. and Ruzsa, I. Z. and Straus, E. G., _On the prime factors of $\binom{2n}{n}$_. Math. Comp. (1975), 83-92. -/ @[category research solved, AMS 11] theorem erdos_377.variants.ae (γ₀ : ℝ) (hγ₀ : γ₀ = ∑' (k : ℕ), (k + 2 : ℝ).log / 2 ^ (k + 2)) : - ∃ (o : ℕ → ℝ) (_ : Tendsto o atTop (𝓝 0)), - ∀ᶠ n in cofinite, sumInvPrimesNotDvdCentralBinom n = γ₀ + o n := by + ∀ ε > (0 : ℝ), {n : ℕ | |sumInvPrimesNotDvdCentralBinom n - γ₀| < ε}.HasDensity 1 := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/382.lean b/FormalConjectures/ErdosProblems/382.lean new file mode 100644 index 0000000..ea66565 --- /dev/null +++ b/FormalConjectures/ErdosProblems/382.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 382 + +*References:* +- [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). +-/ + +@[expose] public section + +open Filter + +namespace Erdos382 + +/-- `LargestPrimeRepeated u v` means that $1 \leq u \leq v$ and the largest prime $p$ dividing +$\prod_{u \leq m \leq v} m$ appears in it with exponent at least $2$, that is $p^2$ divides the +product. + +We require $u \geq 1$, since for $u = 0$ the product is $0$ and `Nat.maxPrimeFac 0 = 0`. We also +require $v \geq 2$: the only other pair is $u = v = 1$, where the product is $1$, which has no +prime factor, and the junk value `Nat.maxPrimeFac 1 = 1` would make the condition hold. -/ +def LargestPrimeRepeated (u v : ℕ) : Prop := + 1 ≤ u ∧ u ≤ v ∧ 2 ≤ v ∧ + Nat.maxPrimeFac (∏ m ∈ Finset.Icc u v, m) ^ 2 ∣ ∏ m ∈ Finset.Icc u v, m + +/-- The pair $(48, 50)$ satisfies the condition: $48 \cdot 49 \cdot 50 = 2^5 \cdot 3 \cdot 5^2 +\cdot 7^2$, and the largest prime $7$ appears with exponent $2$. -/ +@[category test, AMS 11] +theorem largestPrimeRepeated_48_50 : LargestPrimeRepeated 48 50 := by + unfold LargestPrimeRepeated + decide +kernel + +/-- If the condition holds, then $v < 2u$. + +Otherwise $2u \leq v$, and by Bertrand's postulate there is a prime $q$ with $v/2 < q \leq v$, so +$u \leq q \leq v$. The largest prime $p$ of the product satisfies $p \geq q > v/2$. Hence $p$ +divides exactly one factor $m \in [u, v]$, namely $m = p$, and $p$ appears with exponent $1$. -/ +@[category textbook, AMS 11] +theorem lt_two_mul_of_largestPrimeRepeated {u v : ℕ} (h : LargestPrimeRepeated u v) : + v < 2 * u := by + obtain ⟨hu, -, hv, hdvd⟩ := h + by_contra! hle + have hP0 : ∏ m ∈ Finset.Icc u v, m ≠ 0 := + Finset.prod_ne_zero_iff.2 fun m hm ↦ by have := (Finset.mem_Icc.1 hm).1; omega + -- Bertrand's postulate gives a prime `q` with `v / 2 < q ≤ v`, so `u ≤ q ≤ v`. + obtain ⟨q, hq, hq1, hq2⟩ := Nat.exists_prime_lt_and_le_two_mul (v / 2) (by omega) + have hqP : q ∣ ∏ m ∈ Finset.Icc u v, m := + Finset.dvd_prod_of_mem _ (Finset.mem_Icc.2 ⟨by omega, by omega⟩) + have hP1 : 1 < ∏ m ∈ Finset.Icc u v, m := + lt_of_lt_of_le hq.one_lt (Nat.le_of_dvd (Nat.pos_of_ne_zero hP0) hqP) + -- The largest prime factor `p` satisfies `q ≤ p`, so `v < 2 * p`. + set p := Nat.maxPrimeFac (∏ m ∈ Finset.Icc u v, m) + have hp : p.Prime := Nat.prime_maxPrimeFac_of_one_lt hP1 + have hpq : q ≤ p := Nat.le_maxPrimeFac hP0 hq hqP + have hv2 : v < 2 * p := by omega + -- Hence `p` is the only multiple of `p` in `[u, v]`. + have key : ∀ m ∈ Finset.Icc u v, p ∣ m → m = p := by + rintro m hm ⟨k, rfl⟩ + have hm' := Finset.mem_Icc.1 hm + rcases Nat.lt_or_ge k 2 with hk | hk + · interval_cases k <;> omega + · have := Nat.mul_le_mul_left p hk + linarith [hm'.2] + have hpmem : p ∈ Finset.Icc u v := by + obtain ⟨m, hm, hpm⟩ := (Prime.dvd_finsetProd_iff hp.prime _).1 + (Nat.maxPrimeFac_dvd (n := ∏ m ∈ Finset.Icc u v, m)) + rwa [← key m hm hpm] + -- Write the product as `p * R`. Then `p ^ 2` divides it only if `p ∣ R`, which is impossible. + rw [← Finset.mul_prod_erase _ _ hpmem, pow_two] at hdvd + obtain ⟨m, hm, hpm⟩ := (Prime.dvd_finsetProd_iff hp.prime _).1 + ((mul_dvd_mul_iff_left hp.ne_zero).1 hdvd) + exact (Finset.mem_erase.1 hm).1 (key m (Finset.mem_of_mem_erase hm) hpm) + +/-- +Let $u \leq v$ be such that the largest prime dividing $\prod_{u \leq m \leq v} m$ appears with +exponent at least $2$. Is it true that $v - u = v^{o(1)}$? + +We read this as: for every $\epsilon > 0$, every such pair with $v$ large enough satisfies +$v - u \leq v^{\epsilon}$. Cambie observed that this question reduces to old conjectures on gaps +between primes; for example, it follows from Cramér's conjecture. See also Erdős Problems 380 and +383. +-/ +@[category research open, question, AMS 11] +theorem erdos_382.parts.i : + ∀ ε > (0 : ℝ), ∀ᶠ v : ℕ in atTop, ∀ u : ℕ, LargestPrimeRepeated u v → + ((v - u : ℕ) : ℝ) ≤ (v : ℝ) ^ ε := by + sorry + +/-- +Let $u \leq v$ be such that the largest prime dividing $\prod_{u \leq m \leq v} m$ appears with +exponent at least $2$. Can $v - u$ be arbitrarily large? + +That is, for every $k$, is there such a pair with $v - u \geq k$? Cambie gives a heuristic that +suggests the answer is yes. +-/ +@[category research open, question, AMS 11] +theorem erdos_382.parts.ii : + ∀ k : ℕ, ∃ u v : ℕ, LargestPrimeRepeated u v ∧ k ≤ v - u := by + sorry + +/-- +Erdős and Graham [ErGr80] report that it follows from results of Ramachandra that +$v - u \leq v^{1/2+o(1)}$ for every pair $u \leq v$ as in `Erdos382.erdos_382.parts.i`. + +That is, for every $\epsilon > 0$, every such pair with $v$ large enough satisfies +$v - u \leq v^{1/2+\epsilon}$. +-/ +@[category research solved, AMS 11] +theorem erdos_382.variants.ramachandra : + ∀ ε > (0 : ℝ), ∀ᶠ v : ℕ in atTop, ∀ u : ℕ, LargestPrimeRepeated u v → + ((v - u : ℕ) : ℝ) ≤ (v : ℝ) ^ ((1 : ℝ) / 2 + ε) := by + sorry + +end Erdos382 diff --git a/FormalConjectures/ErdosProblems/387.lean b/FormalConjectures/ErdosProblems/387.lean index 6264984..d4fba67 100644 --- a/FormalConjectures/ErdosProblems/387.lean +++ b/FormalConjectures/ErdosProblems/387.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 387 @@ -35,6 +36,8 @@ import FormalConjecturesUtil divisors avoiding an interval. arXiv:2605.21221 (2026). -/ +@[expose] public section + open Filter namespace Erdos387 @@ -45,8 +48,8 @@ $\binom{n}{k}$ has a divisor in $(cn, n]$? Bui, Naprienko, Pratt, and Zaharescu [BNPZ26] answered this negatively. -/ -@[category research solved, AMS 11] -theorem erdos_387 : answer(False) ↔ ∃ c : ℝ, 0 < c ∧ ∀ n k : ℕ, 1 ≤ k → k < n → +@[category research solved, question, AMS 11] +theorem erdos_387 : ¬ ∃ c : ℝ, 0 < c ∧ ∀ n k : ℕ, 1 ≤ k → k < n → ∃ d : ℕ, (d : ℝ) ∈ Set.Ioc (c * n) n ∧ d ∣ n.choose k := by sorry @@ -55,8 +58,8 @@ example : ∀ i < 15, ¬ 99215 - i ∣ Nat.choose 99215 15 := fun i hi => by interval_cases i <;> native_decide /-- The following is Schinzel's conjecture, which appears in [Gu04]. -/ -@[category research open, AMS 11] -theorem erdos_387.variants.schinzel : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_387.variants.schinzel : ∀ᶠ k in atTop, ¬ IsPrimePow k → ∃ n : ℕ, ∀ i < k, ¬ n - i ∣ n.choose k := by sorry @@ -81,8 +84,8 @@ $\binom{n}{k}$ has a divisor in $(cn, n]$? This variant appears in [Gu04]. Bui, Naprienko, Pratt, and Zaharescu [BNPZ26] answered it negatively. -/ -@[category research solved, AMS 11] -theorem erdos_387.variants.guy : answer(False) ↔ ∀ c : ℝ, c < 1 → ∀ᶠ n : ℕ in atTop, ∀ k : ℕ, 1 ≤ k → +@[category research solved, question, AMS 11] +theorem erdos_387.variants.guy : ¬ ∀ c : ℝ, c < 1 → ∀ᶠ n : ℕ in atTop, ∀ k : ℕ, 1 ≤ k → k < n → ∃ d : ℕ, (d : ℝ) ∈ Set.Ioc (c * n) n ∧ d ∣ n.choose k := by sorry diff --git a/FormalConjectures/ErdosProblems/388.lean b/FormalConjectures/ErdosProblems/388.lean new file mode 100644 index 0000000..f27b0c4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/388.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 388 + +*References:* +- [erdosproblems.com/388](https://www.erdosproblems.com/388) +- [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. +- [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ál, *Some Unsolved problems in Geometry, Number Theory and Combinatorics*. + Eureka (1992), 44-48. +-/ + +@[expose] public section + +namespace Erdos388 + +/-- +Are there only finitely many solutions of +$$\prod_{1\leq i\leq k_1}(m_1+i)=\prod_{1\leq j\leq k_2}(m_2+j)$$ +with $k_1,k_2>3$ and $m_1+k_1\leq m_2$? + +Here $m_1, m_2 \geq 0$, so every factor is positive and the condition $m_1 + k_1 \leq m_2$ makes the +two blocks disjoint. Negative $m_1$ would give trivial solutions such as +$(-5)(-4)(-3)(-2) = 2 \cdot 3 \cdot 4 \cdot 5$. The source also asks to classify all solutions; +see `Erdos388.erdos_388.variants.classification`. +-/ +@[category research open, question, AMS 11] +theorem erdos_388 : + {(m₁, k₁, m₂, k₂) : ℕ × ℕ × ℕ × ℕ | 3 < k₁ ∧ 3 < k₂ ∧ m₁ + k₁ ≤ m₂ ∧ + ∏ i ∈ Finset.Icc 1 k₁, (m₁ + i) = ∏ j ∈ Finset.Icc 1 k₂, (m₂ + j)}.Finite := by + sorry + +def erdos_388.variants.classification.answer : Set (ℕ × ℕ × ℕ × ℕ) := sorry + +/-- +Can one classify all solutions of +$$\prod_{1\leq i\leq k_1}(m_1+i)=\prod_{1\leq j\leq k_2}(m_2+j)$$ +with $k_1,k_2>3$ and $m_1+k_1\leq m_2$? + +A solution must supply the set of all solutions $(m_1, k_1, m_2, k_2)$. Whether a description of +this set is a satisfactory classification is up to human judgement. +-/ +@[category research open, question value, AMS 11] +theorem erdos_388.variants.classification : + {(m₁, k₁, m₂, k₂) : ℕ × ℕ × ℕ × ℕ | 3 < k₁ ∧ 3 < k₂ ∧ m₁ + k₁ ≤ m₂ ∧ + ∏ i ∈ Finset.Icc 1 k₁, (m₁ + i) = ∏ j ∈ Finset.Icc 1 k₂, + (m₂ + j)} = erdos_388.variants.classification.answer := by + sorry + +/-- +More generally, if $k_1>2$ then for fixed $a$ and $b$ the equation +$$a\prod_{1\leq i\leq k_1}(m_1+i)=b\prod_{1\leq j\leq k_2}(m_2+j)$$ +should have only finitely many solutions. + +The source states no condition on $a$, $b$, $k_2$ or the position of the blocks, so this is our +reading: $a$ and $b$ are positive integers, we keep the condition $m_1+k_1\leq m_2$ of the main +problem (the $k_1$-block lies below the $k_2$-block), and we assume $k_2 > 2$ as well. Without +these conditions there are infinite families of solutions: +- for $k_2 = 1$ and $b = 1$, take $m_2 + 1 = a\prod_{1\leq i\leq k_1}(m_1+i)$; +- for $k_2 = 2$, $a = 1$ and $b = 4$, the identity $(n+1)(n+2)(n+3)(n+4) = Y(Y+2)$ with + $Y = (n+1)(n+4)$ even gives a solution with $m_2 + 1 = Y/2$ for every $n \geq 2$; +- overlapping blocks give $2\prod_{1\leq i\leq k}(k-1+i)=\prod_{1\leq j\leq k}(k+j)$ for every + $k \geq 2$. +-/ +@[category research open, AMS 11] +theorem erdos_388.variants.general (a b : ℕ) (ha : 0 < a) (hb : 0 < b) : + {(m₁, k₁, m₂, k₂) : ℕ × ℕ × ℕ × ℕ | 2 < k₁ ∧ 2 < k₂ ∧ m₁ + k₁ ≤ m₂ ∧ + a * ∏ i ∈ Finset.Icc 1 k₁, (m₁ + i) = b * ∏ j ∈ Finset.Icc 1 k₂, (m₂ + j)}.Finite := by + sorry + +end Erdos388 diff --git a/FormalConjectures/ErdosProblems/389.lean b/FormalConjectures/ErdosProblems/389.lean index 4c9999e..18f2325 100644 --- a/FormalConjectures/ErdosProblems/389.lean +++ b/FormalConjectures/ErdosProblems/389.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 389 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/389](https://www.erdosproblems.com/389) -/ +@[expose] public section + namespace Erdos389 /-- @@ -30,8 +33,8 @@ $$ n(n + 1) \cdots (n + k - 1) \mid (n + k) \cdots (n + 2k - 1)? $$ -/ -@[category research open, AMS 11] -theorem erdos_389 : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_389 : ∀ n ≥ 1, ∃ k ≥ 1, ∏ i ∈ Finset.range k, (n + i) ∣ ∏ i ∈ Finset.range k, (n + k + i) := by sorry diff --git a/FormalConjectures/ErdosProblems/390.lean b/FormalConjectures/ErdosProblems/390.lean index 1db1d63..c9f3e54 100644 --- a/FormalConjectures/ErdosProblems/390.lean +++ b/FormalConjectures/ErdosProblems/390.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 390 @@ -26,6 +27,8 @@ import FormalConjecturesUtil - -/ +@[expose] public section + open scoped Nat open Filter Asymptotics Real @@ -43,9 +46,9 @@ theorem erdos_390.variants.theta : sorry /-- Does there exists a constant `c` such that `f n - 2 * n ~ c * (n / log n)`? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_390 : - answer(sorry) ↔ ∃ c, + ∃ c, (fun n => f n - 2 * n : ℕ → ℝ) ~[atTop] (fun n => c * n / log (n : ℝ)) := by sorry diff --git a/FormalConjectures/ErdosProblems/393.lean b/FormalConjectures/ErdosProblems/393.lean new file mode 100644 index 0000000..3f104af --- /dev/null +++ b/FormalConjectures/ErdosProblems/393.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. +-/ +module + +public import FormalConjecturesUtil +public import FormalConjectures.Wikipedia.ABC + +/-! +# Erdős Problem 393 + +*References:* +- [erdosproblems.com/393](https://www.erdosproblems.com/393) +- [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, Daniel and Osgood, Charles F., *On the equation $P(x)=n!$ and a question of + Erdős*. J. Number Theory 42 (1992), 189-193. +- [BPZ23] Bui, Hung M. and Pratt, Kyle and Zaharescu, Alexandru, *Power savings for counting + solutions to polynomial-factorial equations*. Adv. Math. 422 (2023), Paper No. 109021, 32 pp. + [arXiv:2204.08423](https://arxiv.org/abs/2204.08423) +- [Lu02] Luca, Florian, *The Diophantine equation $P(x)=n!$ and a result of M. Overholt*. + Glas. Mat. Ser. III 37 (2002), 269-273. +- [OEIS A388302](https://oeis.org/A388302): the values $f(n)$ for $n \geq 2$. +-/ + +@[expose] public section + +open Filter Asymptotics +open scoped Nat + +namespace Erdos393 + +/-- +`f n` is $f(n)$, the minimal $m \geq 1$ such that $n! = a_1 \cdots a_t$ with +$a_1 < \cdots < a_t = a_1 + m$. The factors are recorded as a finite set +$s \subseteq [a, a + m]$ of natural numbers that contains $a = a_1$ and $a + m = a_t$. Since +$m \geq 1$ there are at least two factors, and they are positive because $n! \neq 0$. + +Such a factorisation exists for $n \geq 2$. For $n \leq 1$ there is none, since $n! = 1$, and +`f n` is the junk value `0`. +-/ +noncomputable def f (n : ℕ) : ℕ := + sInf {m : ℕ | 1 ≤ m ∧ ∃ a : ℕ, ∃ s ⊆ Finset.Icc a (a + m), a ∈ s ∧ a + m ∈ s ∧ + ∏ i ∈ s, i = n !} + +/-- For $n \geq 2$ the factorisation $n! = 1 \cdot 2 \cdots n$ exists, so `f n` is a true +minimum and $f(n) \geq 1$. -/ +@[category test, AMS 11] +theorem one_le_f (n : ℕ) (hn : 2 ≤ n) : 1 ≤ f n := by + have hprod : ∏ i ∈ Finset.Ico 1 (n + 1), i = n ! := Finset.prod_Ico_id_eq_factorial n + refine le_csInf ⟨n - 1, by omega, 1, Finset.Ico 1 (n + 1), ?_, ?_, ?_, hprod⟩ fun _ hm ↦ hm.1 + · intro i hi + obtain ⟨h1, h2⟩ := Finset.mem_Ico.1 hi + exact Finset.mem_Icc.2 ⟨h1, by omega⟩ + · exact Finset.mem_Ico.2 ⟨le_rfl, by omega⟩ + · exact Finset.mem_Ico.2 ⟨by omega, by omega⟩ + +/-- $3! = 2 \cdot 3$, so $f(3) = 1$. -/ +@[category test, AMS 11] +theorem f_three : f 3 = 1 := + le_antisymm (Nat.sInf_le ⟨le_rfl, 2, {2, 3}, by decide, by decide, by decide, by decide⟩) + (one_le_f 3 (by norm_num)) + +/-- The factors need not be consecutive integers: $7! = 70 \cdot 72$, so $f(7) \leq 2$. -/ +@[category test, AMS 11] +theorem f_seven_le_two : f 7 ≤ 2 := + Nat.sInf_le ⟨by norm_num, 70, {70, 72}, by decide, by decide, by decide, by decide⟩ + +/-- The factorisation $n! = 2 \cdot 3 \cdots n$ shows that $f(n) \leq n - 2$ for $n \geq 3$. -/ +@[category test, AMS 11] +theorem f_le_sub_two (n : ℕ) (hn : 3 ≤ n) : f n ≤ n - 2 := by + have hprod : ∏ i ∈ Finset.Ico 2 (n + 1), i = n ! := by + have h := Finset.prod_eq_prod_Ico_succ_bot (show 1 < n + 1 by omega) (fun i ↦ i) + rw [Finset.prod_Ico_id_eq_factorial, one_mul] at h + exact h.symm + refine Nat.sInf_le ⟨by omega, 2, Finset.Ico 2 (n + 1), ?_, ?_, ?_, hprod⟩ + · intro i hi + obtain ⟨h1, h2⟩ := Finset.mem_Ico.1 hi + exact Finset.mem_Icc.2 ⟨h1, by omega⟩ + · exact Finset.mem_Ico.2 ⟨le_rfl, by omega⟩ + · exact Finset.mem_Ico.2 ⟨by omega, by omega⟩ + +/-- $1! = 1$ is not a product of two or more distinct positive integers, so `f 1` is the junk +value `0`. -/ +@[category test, AMS 11] +theorem f_one : f 1 = 0 := by + refine Nat.sInf_eq_zero.2 (Or.inr (Set.eq_empty_of_forall_notMem ?_)) + rintro m ⟨hm, a, s, -, ha, hb, hs⟩ + have h1 : a ∣ ∏ i ∈ s, i := Finset.dvd_prod_of_mem (fun i ↦ i) ha + have h2 : a + m ∣ ∏ i ∈ s, i := Finset.dvd_prod_of_mem (fun i ↦ i) hb + rw [hs, Nat.factorial_one] at h1 h2 + have ha1 := Nat.eq_one_of_dvd_one h1 + have hb1 := Nat.eq_one_of_dvd_one h2 + omega + +/-- +Let $f(n)$ denote the minimal $m\geq 1$ such that +$$n! = a_1\cdots a_t$$ +with $a_1<\cdots 0$? -/ -@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-394/Research/FirstQuestion.lean"] +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-394/Research/FirstQuestion.lean"] theorem erdos_394.parts.i : - answer(True) ↔ - ∃ c > 0, (fun x ↦ ∑ n ∈ Icc 1 ⌊x⌋₊, - (t 2 n : ℝ)) ≪ (fun x ↦ x ^ 2 / (Real.log x) ^ c) := by + ∃ c > (0 : ℝ), (fun x ↦ ∑ n ∈ Icc 1 ⌊x⌋₊, + (t 2 n : ℝ)) ≪ (fun x ↦ x ^ 2 / (Real.log x) ^ c) := by sorry /-- Is it true that, for $k\geq 2$, $\sum_{n\leq x}t_{k+1}(n) =o\left(\sum_{n\leq x}t_k(n)\right)?$ -/ -@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-394/Research/DenseHierarchyLittleO.lean"] +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-394/Research/DenseHierarchyLittleO.lean"] theorem erdos_394.parts.ii : - answer(True) ↔ - ∀ k ≥ 2, (fun (x : ℝ) ↦ ∑ n ∈ Icc 1 ⌊x⌋₊, - (t (k + 1) n : ℝ)) =o[atTop] - (fun (x : ℝ) ↦ ∑ n ∈ Icc 1 ⌊x⌋₊, - (t k n : ℝ)) := by + ∀ k ≥ 2, (fun (x : ℝ) ↦ ∑ n ∈ Icc 1 ⌊x⌋₊, + (t (k + 1) n : ℝ)) =o[atTop] + (fun (x : ℝ) ↦ ∑ n ∈ Icc 1 ⌊x⌋₊, + (t k n : ℝ)) := by sorry /-- @@ -115,11 +116,10 @@ theorem erdos_394.variants.lower_bound : They ask about the behaviour of $t_{n-3}(n!)$ and also ask whether, for infinitely many $n$, $t_k(n!)< t_{k-1}(n!)-1$ for all $1\leq k < n$. -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_394.variants.factorial_gap_conjecture : - answer(sorry) ↔ - Set.Infinite { n : ℕ | ∀ k, 2 ≤ k → k < n → - t k (n !) < t (k - 1) (n !) - 1 } := by + Set.Infinite { n : ℕ | ∀ k, 2 ≤ k → k < n → + t k (n !) < t (k - 1) (n !) - 1 } := by sorry set_option maxRecDepth 20000 in diff --git a/FormalConjectures/ErdosProblems/398.lean b/FormalConjectures/ErdosProblems/398.lean index 0b73cb1..784320b 100644 --- a/FormalConjectures/ErdosProblems/398.lean +++ b/FormalConjectures/ErdosProblems/398.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 398 @@ -24,13 +25,15 @@ import FormalConjecturesUtil - [Wikipedia: Brocard's problem](https://en.wikipedia.org/wiki/Brocard%27s_problem) -/ +@[expose] public section + open Nat namespace Erdos398 /-- **Brocard's Problem** -Does $n! + 1 = m^2$ have integer solutions other than $n = 4, 5, 7$? +Are $n = 4, 5, 7$ the only natural numbers for which $n! + 1 = m^2$ has a natural-number solution? -/ @[category research open, AMS 11] theorem erdos_398 : answer(sorry) ↔ {n | ∃ m, n ! + 1 = m ^ 2} = {4, 5, 7} := by diff --git a/FormalConjectures/ErdosProblems/40.lean b/FormalConjectures/ErdosProblems/40.lean index 314ef82..72eec7a 100644 --- a/FormalConjectures/ErdosProblems/40.lean +++ b/FormalConjectures/ErdosProblems/40.lean @@ -13,9 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil -import FormalConjectures.ErdosProblems.«28» +public import FormalConjecturesUtil +public import FormalConjectures.ErdosProblems.«28» /-! # Erdős Problem 40 @@ -23,6 +24,8 @@ import FormalConjectures.ErdosProblems.«28» *Reference:* [erdosproblems.com/40](https://www.erdosproblems.com/40) -/ +@[expose] public section + open AdditiveCombinatorics Filter Real Set open scoped Pointwise @@ -38,59 +41,83 @@ def Erdos40For (g : ℕ → ℝ) : Prop := (fun N : ℕ ↦ √N / g N) =O[atTop] (fun N ↦ ((A ∩ .Icc 1 N).ncard : ℝ)) → limsup (fun N ↦ (sumRep A N : ℕ∞)) atTop = ⊤ +def erdos_40.answer : Set (ℕ → ℝ) := sorry + /-- -Given a set of functions $\mathbb{N} → \mathbb{R})$, we assert that for all $g$ in that set, -if $g(N) → \infty$ then +For what functions $g(N) → \infty$ is it true that $$\lvert A\cap \{1,\ldots,N\}\rvert \gg \frac{N^{1/2}}{g(N)}$$ -implies $\limsup 1_A\ast 1_A(n)=\infty$. +implies $\limsup 1_A\ast 1_A(n)=\infty$? -/ -def Erdos40ForSet (G : Set (ℕ → ℝ)) : Prop := ∀ g ∈ G, Tendsto g atTop atTop → Erdos40For g +@[category research open, question value, AMS 11] +theorem erdos_40 : + {g : ℕ → ℝ | Tendsto g atTop atTop ∧ Erdos40For g} = erdos_40.answer := by + sorry /-- -For what functions $g(N) → \infty$ is it true that +Is there any function $g(N) → \infty$ such that $$\lvert A\cap \{1,\ldots,N\}\rvert \gg \frac{N^{1/2}}{g(N)}$$ implies $\limsup 1_A\ast 1_A(n)=\infty$? + +This is a weaker form of Erdős Problem 40, which asks for all such $g$. Establishing +the implication for even one $g(N) → \infty$ already answers Erdős Problem 28 +positively, because a basis of order $2$ satisfies +$\lvert A\cap \{1,\ldots,N\}\rvert \gg N^{1/2}$. -/ -@[category research open, AMS 11] -theorem erdos_40 : Erdos40ForSet answer(sorry) := by +@[category research open, question, AMS 11] +theorem erdos_40.variants.weaker : + ∃ g : ℕ → ℝ, Tendsto g atTop atTop ∧ Erdos40For g := by sorry /-- -If we don't pose additional conditions on the functions, then this is a stronger form of the -Erdős-Turán conjecture, see Erdõs Problem 28, -(since establishing this for any function $g(N) → \infty$ would imply a positive solution to Erdős -Problem 28). +Establishing the property in Erdős Problem 40 for any one function $g(N) → \infty$ +implies the Erdős-Turán conjecture, see Erdős Problem 28. -/ @[category textbook, AMS 11] -theorem erdos_40.variants.implies_erdos_28 (h_erdos_40 : Erdos40ForSet .univ) : type_of% Erdos28.erdos_28 := by - simp only [Erdos40ForSet, Erdos40For, sumRep, sumConv, indicatorOne, mem_univ, forall_const] - at h_erdos_40 +theorem erdos_40.variants.implies_erdos_28 (g : ℕ → ℝ) (hg : Tendsto g atTop atTop) + (h_erdos_40 : Erdos40For g) : type_of% Erdos28.erdos_28 := by + classical intro A hA - apply h_erdos_40 - rotate_right - · exact fun N => (N : ℝ).sqrt - · rw [funext Real.sqrt_eq_rpow] - exact (tendsto_rpow_atTop (one_half_pos)).comp (tendsto_natCast_atTop_atTop) - · have ⟨n, hn⟩ := hA.exists_le - apply Asymptotics.IsBigO.of_bound 1 - apply Filter.eventually_atTop.mpr - use n + 1 - intro m hm - have : 0 < m := by omega - field_simp - simp only [one_mem, CStarRing.norm_of_mem_unitary, RCLike.norm_natCast, Nat.one_le_cast] - apply Nat.card_pos_iff.mpr - constructor - · by_contra h_empty - have : m ∈ (A + A)ᶜ := by - intro h - replace ⟨a, ha, b, hb, h⟩ := h - absurd h_empty - by_cases ha' : 1 ≤ a - · refine ⟨a, ha, ha', by bound⟩ - · exact ⟨b, hb, by simp only at h; omega, by bound⟩ - have := hn m this + apply h_erdos_40 A + obtain ⟨n, hn⟩ := hA.exists_le + apply Asymptotics.IsBigO.of_bound 4 + filter_upwards [eventually_ge_atTop (2 * n + 2), hg.eventually_ge_atTop 1] with N hN hgN + let k := (A ∩ Icc 1 N).ncard + let B := insert 0 (A ∩ Icc 1 N) + have hB : B.Finite := ((finite_Icc 1 N).inter_of_right A).insert 0 + have hmem : ∀ a ∈ A, a ≤ N → a ∈ B := by + intro a ha haN + by_cases ha0 : a = 0 + · exact Or.inl ha0 + · exact Or.inr ⟨ha, by omega, haN⟩ + have hsub : Icc (n + 1) N ⊆ B + B := by + intro m ⟨hmlo, hmhi⟩ + have hmA : m ∈ A + A := by + by_contra hmA + have := hn m hmA omega - · exact (Set.finite_Icc _ _).inter_of_right A + obtain ⟨a, ha, b, hb, hab⟩ := hmA + simp only at hab + exact ⟨a, hmem a ha (by omega), b, hmem b hb (by omega), hab⟩ + have hcard : N - n ≤ (k + 1) ^ 2 := calc + N - n = (Icc (n + 1) N).ncard := by simp + _ ≤ (B + B).ncard := ncard_le_ncard hsub (hB.add hB) + _ ≤ B.ncard ^ 2 := by + simpa only [Nat.card_coe_set_eq, pow_two] using (Set.natCard_add_le (s := B) (t := B)) + _ ≤ (k + 1) ^ 2 := by + gcongr + exact ncard_insert_le 0 (A ∩ Icc 1 N) + have hcard' : N ≤ n + (k + 1) ^ 2 := by omega + have hk : 1 ≤ k := by nlinarith + have hcardR : (N : ℝ) ≤ n + ((k : ℝ) + 1) ^ 2 := by exact_mod_cast hcard' + have hNR : 2 * (n : ℝ) + 2 ≤ (N : ℝ) := by exact_mod_cast hN + have hkR : 1 ≤ (k : ℝ) := by exact_mod_cast hk + have hsqrt : √(N : ℝ) ≤ 4 * (k : ℝ) := by + apply sqrt_le_iff.2 + constructor + · positivity + · nlinarith [sq_nonneg ((k : ℝ) - 1)] + rw [Real.norm_of_nonneg (div_nonneg (sqrt_nonneg _) (le_trans zero_le_one hgN)), + Real.norm_natCast] + exact (div_le_self (sqrt_nonneg _) hgN).trans hsqrt end Erdos40 diff --git a/FormalConjectures/ErdosProblems/400.lean b/FormalConjectures/ErdosProblems/400.lean index 56af919..aecbf5c 100644 --- a/FormalConjectures/ErdosProblems/400.lean +++ b/FormalConjectures/ErdosProblems/400.lean @@ -94,7 +94,7 @@ theorem erdos_400.variants.g_pos (k n : ℕ) (h: k ≥ 2) : 0 < g k n := by Finset.sum_le_sum fun i _ => Nat.self_le_factorial _ _ ≤ Finset.univ.card • n ! := by apply Finset.sum_le_card_nsmul; intro i _ - exact le_trans (Finset.single_le_prod' (fun j _ => + exact le_trans (Finset.single_le_prod (fun j _ => Nat.one_le_iff_ne_zero.mpr (Nat.factorial_ne_zero _)) (Finset.mem_univ i)) (Nat.le_of_dvd (Nat.factorial_pos n) hb) _ = (k' + 2) * n ! := by simp [smul_eq_mul] diff --git a/FormalConjectures/ErdosProblems/408.lean b/FormalConjectures/ErdosProblems/408.lean new file mode 100644 index 0000000..08abfa1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/408.lean @@ -0,0 +1,171 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 408 + +*References:* +- [erdosproblems.com/408](https://www.erdosproblems.com/408) +- [OEIS A003434](https://oeis.org/A003434): the values $f(n)$ for $n \geq 2$. +- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number + theory*. Monographies de L'Enseignement Mathématique (1980). +- [Pi29] Pillai, S. Sivasankaranarayana, *On a function connected with $\phi(n)$*. Bull. Amer. + Math. Soc. 35 (1929), 837-841. + [doi:10.1090/S0002-9904-1929-04800-6](https://doi.org/10.1090/S0002-9904-1929-04800-6) +- [Sh50] Shapiro, Harold N., *On the iterates of a certain class of arithmetic functions*. Comm. + Pure Appl. Math. 3 (1950), 259-272. +- [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. +- [Gu04] Guy, Richard K., *Unsolved problems in number theory*. Third edition, Springer (2004), + Problem B41. +- [FKL10] Ford, K., Konyagin, S. V. and Luca, F., *Prime chains and Pratt trees*. Geom. Funct. + Anal. 20 (2010), 1231-1258. [arXiv:0904.0473](https://arxiv.org/abs/0904.0473) + [doi:10.1007/s00039-010-0089-0](https://doi.org/10.1007/s00039-010-0089-0) +-/ + +@[expose] public section + +open Filter +open scoped Topology + +namespace Erdos408 + +/-- +`f n` is $f(n) = \min\{k \geq 1 : \phi_k(n) = 1\}$, where $\phi_1 = \phi$ is Euler's totient +function and $\phi_k(n) = \phi(\phi_{k-1}(n))$. As in the source, $k$ starts at $1$, so +$f(1) = 1$. Every iterate of $\phi$ at $0$ is $0$, so `sInf ∅ = 0` gives the junk value +$f(0) = 0$. +-/ +noncomputable def f (n : ℕ) : ℕ := + sInf {k : ℕ | 1 ≤ k ∧ Nat.totient^[k] n = 1} + +/-- The junk value $f(0) = 0$. -/ +@[category test, AMS 11] +theorem f_zero : f 0 = 0 := by + rw [f, Nat.sInf_eq_zero] + refine Or.inr (Set.eq_empty_iff_forall_notMem.2 fun k hk ↦ ?_) + have h := hk.2 + rw [Function.iterate_fixed Nat.totient_zero] at h + omega + +/-- $\phi(1) = 1$, so $f(1) = 1$ (the iteration count starts at $1$, not $0$). -/ +@[category test, AMS 11] +theorem f_one : f 1 = 1 := by + apply le_antisymm + · exact Nat.sInf_le ⟨le_rfl, by simp⟩ + · exact le_csInf ⟨1, le_rfl, by simp⟩ fun _ hk ↦ hk.1 + +/-- $\phi(2) = 1$, so $f(2) = 1$. -/ +@[category test, AMS 11] +theorem f_two : f 2 = 1 := by + apply le_antisymm + · exact Nat.sInf_le ⟨le_rfl, by simp⟩ + · exact le_csInf ⟨1, le_rfl, by simp⟩ fun _ hk ↦ hk.1 + +/-- Since $\phi(2^{j+1}) = 2^j$, we have $f(2^k) = k$ for every $k \geq 1$. -/ +@[category test, AMS 11] +theorem f_two_pow (k : ℕ) (hk : 1 ≤ k) : f (2 ^ k) = k := by + have key : ∀ j, j ≤ k → Nat.totient^[j] (2 ^ k) = 2 ^ (k - j) := by + intro j + induction j with + | zero => intro _; simp + | succ j ih => + intro hj + rw [Function.iterate_succ_apply', ih (by omega)] + obtain ⟨i, hi⟩ : ∃ i, k - j = i + 1 := ⟨k - j - 1, by omega⟩ + rw [hi, Nat.totient_prime_pow_succ Nat.prime_two, show k - (j + 1) = i by omega] + simp + have hk1 : Nat.totient^[k] (2 ^ k) = 1 := by rw [key k le_rfl, Nat.sub_self, pow_zero] + apply le_antisymm + · exact Nat.sInf_le ⟨hk, hk1⟩ + refine le_csInf ⟨k, hk, hk1⟩ fun j hj ↦ ?_ + by_contra hlt + have h2 : 2 ≤ 2 ^ (k - j) := Nat.le_self_pow (by omega) 2 + have h3 := hj.2 + rw [key j (by omega)] at h3 + omega + +/-- +Let $\phi(n)$ be the Euler totient function and $\phi_k(n)$ be the iterated $\phi$ function, so +that $\phi_1(n)=\phi(n)$ and $\phi_k(n)=\phi(\phi_{k-1}(n))$. Let +$$f(n) = \min\{k : \phi_k(n)=1\}.$$ +Does $f(n)/\log n$ have a distribution function? + +We ask for a distribution function $F$ (non-decreasing, with $F(-\infty) = 0$ and +$F(+\infty) = 1$) such that, for every continuity point $c$ of $F$, the set +$\{n : f(n)/\log n \leq c\}$ has natural density $F(c)$. For $n \leq 1$ the quotient is $0$ in +Lean, which does not affect densities. Erdős, Granville, Pomerance and Spiro [EGPS90] proved +that the answer is yes, conditional on a form of the Elliott–Halberstam conjecture. +-/ +@[category research open, question, AMS 11] +theorem erdos_408.parts.i : + ∃ F : ℝ → ℝ, Monotone F ∧ Tendsto F atBot (𝓝 0) ∧ Tendsto F atTop (𝓝 1) ∧ + ∀ c : ℝ, ContinuousAt F c → + {n : ℕ | (f n : ℝ) / Real.log n ≤ c}.HasDensity (F c) := by + sorry + +/-- +Is $f(n)/\log n$ almost always constant? + +We read this as: is there a constant $\alpha$ such that, for every $\epsilon > 0$, the set of +$n$ with $|f(n)/\log n - \alpha| < \epsilon$ has natural density $1$? Erdős, Granville, +Pomerance and Spiro [EGPS90] proved that, conditional on a form of the Elliott–Halberstam +conjecture, $f(n)$ has normal order $\alpha \log n$ for some constant $\alpha > 0$, so that the +answer is yes under this hypothesis. +-/ +@[category research open, question, AMS 11] +theorem erdos_408.parts.ii : + ∃ α : ℝ, ∀ ε > (0 : ℝ), + {n : ℕ | |(f n : ℝ) / Real.log n - α| < ε}.HasDensity 1 := by + sorry + +/-- +Pillai [Pi29] proved that, for all $n \geq 2$, +$$\left\lfloor \frac{\log n - \log 2}{\log 3} \right\rfloor + 1 \leq f(n) \leq + \left\lfloor \frac{\log n}{\log 2} \right\rfloor + 1.$$ +These are Theorems I and III of [Pi29]; Pillai's function $R(n)$ is the least $r$ with +$\phi_r(n) = 1$, which is $f(n)$. The lower bound is attained at $n = 2 \cdot 3^k$, and +$f(2^k) = k$ (`Erdos408.f_two_pow`), so the upper bound cannot be replaced by $f(n) < \log_2 n$. +-/ +@[category research solved, AMS 11] +theorem erdos_408.variants.pillai (n : ℕ) (hn : 2 ≤ n) : + ⌊(Real.log n - Real.log 2) / Real.log 3⌋₊ + 1 ≤ f n ∧ + f n ≤ ⌊Real.log n / Real.log 2⌋₊ + 1 := by + sorry + +/-- +The third question asks what can be said about the largest prime factor $P^+(\phi_k(n))$ when, +say, $k = \log\log n$; it is open-ended and is not formalised. The site remarks that it is likely +true that, if $k \to \infty$ however slowly with $n$, then $P^+(\phi_k(n)) \leq n^{o(1)}$ for +almost all $n$. + +Ford, Konyagin and Luca [FKL10, Theorem 5] proved that for every $\epsilon > 0$ and $\delta > 0$ +there is an integer $k$ such that, for all large $x$, at least $(1 - \epsilon)x$ integers +$n \leq x$ satisfy $P^+(\phi_k(n)) \leq x^{\delta}$. Since $P^+(\phi(m)) \leq P^+(m)$, this gives +the remark above for every $k = k(n) \to \infty$. +-/ +@[category research solved, AMS 11] +theorem erdos_408.variants.ford_konyagin_luca (ε δ : ℝ) (hε : 0 < ε) (hδ : 0 < δ) : + ∃ k : ℕ, ∀ᶠ x : ℝ in atTop, (1 - ε) * x ≤ + ((Finset.Icc 1 ⌊x⌋₊).filter fun n ↦ + ((Nat.totient^[k] n).maxPrimeFac : ℝ) ≤ x ^ δ).card := by + sorry + +end Erdos408 diff --git a/FormalConjectures/ErdosProblems/417.lean b/FormalConjectures/ErdosProblems/417.lean index 87eee6d..72cf40c 100644 --- a/FormalConjectures/ErdosProblems/417.lean +++ b/FormalConjectures/ErdosProblems/417.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 417 @@ -25,6 +26,8 @@ import FormalConjecturesUtil theory. Number theory (Eger, 1996) (1998), 169-180. -/ +@[expose] public section + open Nat Set Filter open scoped Topology @@ -34,9 +37,9 @@ namespace Erdos417 Let$$V'(x)=\#\{\phi(m) : 1\leq m\leq x\}$$and$$V(x)=\#\{\phi(m) \leq x : 1\leq m\}.$$ Does $\lim V(x)/V'(x)$ exist? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_417.parts.i : - answer(sorry) ↔ ∃ L : ENNReal, Tendsto (fun x ↦ + ∃ L : ENNReal, Tendsto (fun x ↦ ({ k | k ∈ range totient ∧ (k : ℝ) ≤ x }.ncard : ENNReal) / ((totient '' { m | 1 ≤ m ∧ (m : ℝ) ≤ x }).ncard : ENNReal)) atTop (𝓝 L) := by @@ -45,9 +48,9 @@ theorem erdos_417.parts.i : /-- Is it $>1$? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_417.parts.ii : - answer(sorry) ↔ ∃ L > (1 : ENNReal), Tendsto (fun x ↦ + ∃ L > (1 : ENNReal), Tendsto (fun x ↦ ({ k | k ∈ range totient ∧ (k : ℝ) ≤ x }.ncard : ENNReal) / ((totient '' { m | 1 ≤ m ∧ (m : ℝ) ≤ x }).ncard : ENNReal)) atTop (𝓝 L) := by diff --git a/FormalConjectures/ErdosProblems/418.lean b/FormalConjectures/ErdosProblems/418.lean index a494063..c62eb9b 100644 --- a/FormalConjectures/ErdosProblems/418.lean +++ b/FormalConjectures/ErdosProblems/418.lean @@ -13,14 +13,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 418 *References:* - [erdosproblems.com/418](https://www.erdosproblems.com/418) +- [Wikipedia: Noncototient](https://en.wikipedia.org/wiki/Noncototient) - [BaLu05] Banks, William D. and Luca, Florian, Nonaliquots and {R}obbins numbers. Colloq. Math. (2005), 27--32. - [BrSc95] Browkin, J. and Schinzel, A., On integers not of the form {$n-\phi(n)$}. Colloq. Math. @@ -34,6 +36,8 @@ import FormalConjecturesUtil function. Trans. Amer. Math. Soc. Ser. B (2016), 1-26. -/ +@[expose] public section + open scoped ArithmeticFunction.sigma namespace Erdos418 @@ -50,8 +54,8 @@ This is discussed in problem B36 of Guy's collection [Gu04]. This was formalized in Lean by Alexeev using Aristotle. -/ -@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.24.0/ErdosProblems/Erdos418.lean"] -theorem erdos_418 : answer(True) ↔ { (n - n.totient : ℕ) | n }ᶜ.Infinite := by +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.24.0/ErdosProblems/Erdos418.lean"] +theorem erdos_418 : { (n - n.totient : ℕ) | n }ᶜ.Infinite := by sorry /-- @@ -83,20 +87,39 @@ theorem erdos_418.variants.conditional linear_combination hm rwa [Nat.coprime_primes hp hq] +/-- +The **Odd Noncototient Conjecture**: every non-cototient is even. Equivalently, every odd natural +number is of the form $n - \phi(n)$ for some $n$. + +This is the unconditional form of `erdos_418.variants.conditional`, which derives the odd case from a +strengthening of the Goldbach conjecture. See [Wikipedia: Noncototient]. +-/ +@[category research open, AMS 11] +theorem erdos_418.variants.odd_noncototient : + { (n - n.totient : ℕ) | n }ᶜ ⊆ { k | Even k } := by + sorry + +/-- +A sanity check for the definition: $7$ is a cototient, since $7 = 15 - \phi(15)$ and $\phi(15) = 8$. +In particular $7$ is not a non-cototient. +-/ +@[category test, AMS 11] +theorem erdos_418.variants.seven_mem_cototient : + 7 ∈ { (n - n.totient : ℕ) | n } := + ⟨15, by decide⟩ + /-- Erdős [Er73b] has shown that a positive density set of natural numbers cannot be written as $\sigma(n)-n$ (numbers not of this form are called nonaliquot, or sometimes untouchable). -The density sits in an existential, so `HasPosDensity` is the *stronger* reading: the witness -`S` is ours to choose, and weakening it to positive lower density would claim less rather than -more. That is the opposite of the usual situation for Erdős' "positive density", where the -density is a hypothesis or a claim about a fixed set. Whether the nonaliquot numbers themselves -have a density is a separate question and is not what this states. +Here "positive density" means positive lower density: Banks and Luca [BaLu05] proved that the +set of nonaliquots has lower density at least $1/48$, Chen and Zhao [ChZh11] improved this to +$0.06$, and it is not known whether the natural density of the nonaliquots exists (Pollack and +Pomerance [PoPo16] give a heuristic predicting its value). -/ @[category research solved, AMS 11] theorem erdos_418.variants.sigma : - ∃ (S : Set ℕ) (hS : S.HasPosDensity), - S ⊆ { (σ 1 n - n : ℕ) | n }ᶜ := by + 0 < { (σ 1 n - n : ℕ) | n }ᶜ.lowerDensity := by sorry /-- @@ -109,11 +132,11 @@ theorem erdos_418.variants.soln : sorry /-- -It is open whether the set of non-cototients has positive density. +It is open whether the set of non-cototients has positive (lower) density. -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_418.variants.density : - answer(sorry) ↔ ∃ (S : Set ℕ) (hS : S.HasPosDensity), S ⊆ { (n - n.totient : ℕ) | n }ᶜ := by + 0 < { (n - n.totient : ℕ) | n }ᶜ.lowerDensity := by sorry end Erdos418 diff --git a/FormalConjectures/ErdosProblems/420.lean b/FormalConjectures/ErdosProblems/420.lean new file mode 100644 index 0000000..9f3d1c7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/420.lean @@ -0,0 +1,160 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 420 + +*References:* +- [erdosproblems.com/420](https://www.erdosproblems.com/420) +- [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. and Graham, S. W. and Ivić, A. and Pomerance, C., *On the number of divisors + of $n!$*. Analytic number theory, Vol. 1 (Allerton Park, IL, 1995), Progr. Math. 138, Birkhäuser + Boston (1996), 337-355. + +In the solved variants, $K(n)$ is the least $K \geq 1$ with $\tau((n+K)!) \geq 2\tau(n!)$, so that +$K(n) > h$ if and only if $F(h, n) < 2$. These variants state Corollaries 2 and 3 of [EGIP96] as +printed; the stronger claims on erdosproblems.com are not stated. +-/ + +@[expose] public section + +open Filter +open scoped ArithmeticFunction.sigma + +namespace Erdos420 + +/-- +`F f n` is +$$F(f,n)=\frac{\tau((n+\lfloor f(n)\rfloor)!)}{\tau(n!)},$$ +where $\tau = \sigma_0$ counts divisors. We use the natural floor `⌊f n⌋₊`, which agrees with +$\lfloor f(n) \rfloor$ when $f(n) \geq 0$ and is $0$ when $f(n) < 0$. +-/ +noncomputable def F (f : ℕ → ℝ) (n : ℕ) : ℝ := + (σ 0 (n + ⌊f n⌋₊).factorial : ℝ) / (σ 0 n.factorial : ℝ) + +/-- If $f(n) < 1$ then the natural floor `⌊f n⌋₊` is $0$, so $F(f, n) = 1$. -/ +@[category test, AMS 11] +theorem F_eq_one_of_lt_one {f : ℕ → ℝ} {n : ℕ} (hf : f n < 1) : F f n = 1 := by + have h : (σ 0 n.factorial : ℝ) ≠ 0 := by + exact_mod_cast (ArithmeticFunction.sigma_pos 0 _ (Nat.factorial_ne_zero n)).ne' + rw [F, Nat.floor_eq_zero.2 hf, add_zero, div_self h] + +/-- $n!$ divides $(n + k)!$, so $F(f, n) \geq 1$ always. -/ +@[category test, AMS 11] +theorem one_le_F (f : ℕ → ℝ) (n : ℕ) : 1 ≤ F f n := by + have h0 : (0 : ℝ) < σ 0 n.factorial := by + exact_mod_cast ArithmeticFunction.sigma_pos 0 _ (Nat.factorial_ne_zero n) + rw [F, one_le_div h0] + simp only [ArithmeticFunction.sigma_zero_apply] + exact_mod_cast Finset.card_le_card (Nat.divisors_subset_of_dvd (Nat.factorial_ne_zero _) + (Nat.factorial_dvd_factorial (Nat.le_add_right n _))) + +/-- If $p = n + 1$ is prime then $p$ does not divide $n!$, so $\tau((n+1)!) = 2\tau(n!)$ and +$F(1, n) = 2$. -/ +@[category test, AMS 11] +theorem F_one_of_prime {n : ℕ} (hn : (n + 1).Prime) : F (fun _ ↦ 1) n = 2 := by + have hcop : Nat.Coprime (n + 1) n.factorial := + (Nat.Prime.coprime_iff_not_dvd hn).2 fun h ↦ by + have := (Nat.Prime.dvd_factorial hn).1 h + omega + have h0 : (σ 0 n.factorial : ℝ) ≠ 0 := by + exact_mod_cast (ArithmeticFunction.sigma_pos 0 _ (Nat.factorial_ne_zero n)).ne' + have hp : σ 0 (n + 1) = 2 := by + simpa using ArithmeticFunction.sigma_zero_apply_prime_pow (i := 1) hn + simp only [F, Nat.floor_one, Nat.factorial_succ, + ArithmeticFunction.isMultiplicative_sigma.map_mul_of_coprime hcop, hp] + push_cast + field_simp + +/-- +If $\tau(n)$ counts the number of divisors of $n$ then let +$$F(f,n)=\frac{\tau((n+\lfloor f(n)\rfloor)!)}{\tau(n!)}.$$ +Is it true that +$$\lim_{n\to \infty}F((\log n)^C,n)=\infty$$ +for large $C$? + +"For large $C$" means for all sufficiently large real $C$. Since $(\log n)^C$ increases with $C$ +for $n \geq 3$ and $F(f,n)$ is nondecreasing in $f(n)$, this is equivalent to asking for one +such $C$. +-/ +@[category research open, question, AMS 11] +theorem erdos_420.parts.i : + ∀ᶠ C : ℝ in atTop, Tendsto (F fun m ↦ Real.log m ^ C) atTop atTop := by + sorry + +/-- +Is it true that $F(\log n,n)$ is everywhere dense in $(1,\infty)$? + +This asks that every point of $(1,\infty)$ lies in the closure of the set of values +$F(\log n, n)$. Note that $F(f,n) \geq 1$ always (`Erdos420.one_le_F`). +-/ +@[category research open, question, AMS 11] +theorem erdos_420.parts.ii : + Set.Ioi (1 : ℝ) ⊆ closure (Set.range (F fun m ↦ Real.log m)) := by + sorry + +/-- +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? + +"Everywhere dense" means dense in $(1,\infty)$, as in `Erdos420.erdos_420.parts.ii`. Asking for +$f(n) \leq \log n$ for all $n$, rather than for all large $n$, gives an equivalent question. +-/ +@[category research open, question, AMS 11] +theorem erdos_420.parts.iii : + ∀ f : ℕ → ℝ, Monotone f → (∀ n, f n ≤ Real.log n) → Tendsto f atTop atTop → + Set.Ioi (1 : ℝ) ⊆ closure (Set.range (F f)) := by + sorry + +/-- +Erdős, Graham, Ivić and Pomerance proved [EGIP96, Corollary 2] that $K(n)/\log n$ is unbounded, +with $K(n)$ as in the module docstring. Equivalently, for every $c > 0$ we have +$F(c\log n, n) < 2$ for infinitely many $n$. In particular +$\liminf F(c\log n, n) \leq 2$. +-/ +@[category research solved, AMS 11] +theorem erdos_420.variants.log_frequently_lt_two : + ∀ c > (0 : ℝ), ∃ᶠ n : ℕ in atTop, F (fun m ↦ c * Real.log m) n < 2 := by + sorry + +/-- +Erdős, Graham, Ivić and Pomerance proved [EGIP96, Corollary 2] that for infinitely many $n$, +$$K(n) > \frac{\log n \cdot \log\log n \cdot \log\log\log\log n}{9(\log\log\log n)^3},$$ +with $K(n)$ as in the module docstring. Equivalently, +$F(f,n) < 2$ for infinitely many $n$, where $f(n)$ is the right-hand side. +-/ +@[category research solved, AMS 11] +theorem erdos_420.variants.rankin_frequently_lt_two : + ∃ᶠ n : ℕ in atTop, F (fun m ↦ Real.log m * Real.log (Real.log m) * + Real.log (Real.log (Real.log (Real.log m))) / + (9 * Real.log (Real.log (Real.log m)) ^ 3)) n < 2 := by + sorry + +/-- +Erdős, Graham, Ivić and Pomerance proved [EGIP96, Corollary 3] that for all sufficiently large +$n$ we have $K(n) < n^{4/9}$, with $K(n)$ as in the module docstring. Hence +$F(n^{4/9}, n) \geq 2$ for all large $n$. +-/ +@[category research solved, AMS 11] +theorem erdos_420.variants.pow_four_ninths : + ∀ᶠ n : ℕ in atTop, 2 ≤ F (fun m ↦ (m : ℝ) ^ (4 / 9 : ℝ)) n := by + sorry + +end Erdos420 diff --git a/FormalConjectures/ErdosProblems/422.lean b/FormalConjectures/ErdosProblems/422.lean index 860ad8b..6c13bb0 100644 --- a/FormalConjectures/ErdosProblems/422.lean +++ b/FormalConjectures/ErdosProblems/422.lean @@ -13,60 +13,132 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 422 -*Reference:* [erdosproblems.com/422](https://www.erdosproblems.com/422) +*References:* +- [erdosproblems.com/422](https://www.erdosproblems.com/422) +- [OEIS A005185](https://oeis.org/A005185) -/ +@[expose] public section + namespace Erdos422 open Filter open scoped Topology /-- -Let $f(1) = f(2) = 1$ and for $n > 2$ +`IsHofstadterQ f` means that $f$ is Hofstadter's $Q$-sequence (OEIS A005185): $f(1) = f(2) = 1$ +and for $n > 2$ $$ -f(n) = f(n - f(n - 1)) + f(n - f(n - 2)). +f(n) = f(n - f(n - 1)) + f(n - f(n - 2)), $$ +where the recurrence requires $f(n - 1) < n$ and $f(n - 2) < n$, so that both arguments on the +right-hand side are positive integers. The sequence begins $1, 1, 2, 3, 3, 4, \ldots$. -Note: It is not known whether $f(n)$ is well-defined for all $n$. +At most one function satisfies this predicate. Some function satisfies it if and only if $f(n)$ is +well-defined for all $n$, which is not known. -/ -partial def f : ℕ+ → ℕ+ - | 1 => 1 - | 2 => 1 - | n => f (n - f (n - 1)) + f (n - f (n - 2)) +def IsHofstadterQ (f : ℕ+ → ℕ+) : Prop := + f 1 = 1 ∧ f 2 = 1 ∧ + ∀ n : ℕ+, 2 < n → + f (n - 1) < n ∧ f (n - 2) < n ∧ f n = f (n - f (n - 1)) + f (n - f (n - 2)) + +/-- The third term of Hofstadter's $Q$-sequence is $f(3) = f(2) + f(2) = 2$. -/ +@[category test, AMS 11] +theorem erdos_422.test.f3 : ∀ f : ℕ+ → ℕ+, IsHofstadterQ f → f 3 = 2 := by + intro f ⟨h1, h2, h⟩ + obtain ⟨-, -, h3⟩ := h 3 (by decide) + simp only [h3, show (3 : ℕ+) - 1 = 2 from rfl, show (3 : ℕ+) - 2 = 1 from rfl, h1, h2] + rfl + +/-- The fourth term of Hofstadter's $Q$-sequence is $f(4) = f(2) + f(3) = 3$. -/ +@[category test, AMS 11] +theorem erdos_422.test.f4 : ∀ f : ℕ+ → ℕ+, IsHofstadterQ f → f 4 = 3 := by + intro f hf + have h3 := erdos_422.test.f3 f hf + obtain ⟨h1, h2, h⟩ := hf + obtain ⟨-, -, h4⟩ := h 4 (by decide) + simp only [h4, show (4 : ℕ+) - 1 = 3 from rfl, show (4 : ℕ+) - 2 = 2 from rfl, h2, h3] + rfl /-- +Let $f(1) = f(2) = 1$ and for $n > 2$ +$$ +f(n) = f(n - f(n - 1)) + f(n - f(n - 2)). +$$ Does $f(n)$ miss infinitely many integers? -/ -@[category research open, AMS 11] -theorem erdos_422 : answer(sorry) ↔ Set.Infinite {n | ∀ x, f x ≠ n} := by +@[category research open, question, AMS 11] +theorem erdos_422 : + ∀ f : ℕ+ → ℕ+, IsHofstadterQ f → Set.Infinite {n | ∀ x, f x ≠ n} := by sorry /-- Is $f$ surjective? -/ -@[category research open, AMS 11] -theorem erdos_422.variants.surjective : answer(sorry) ↔ f.Surjective := by +@[category research open, question, AMS 11] +theorem erdos_422.variants.surjective : + ∀ f : ℕ+ → ℕ+, IsHofstadterQ f → f.Surjective := by sorry +def erdos_422.variants.growth_rate.answer : ℕ+ → ℝ := sorry + /-- How does $f$ grow? -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_422.variants.growth_rate : - (fun n ↦ (f n : ℝ)) =O[atTop] (answer(sorry) : ℕ+ → ℝ) := by + ∀ f : ℕ+ → ℕ+, IsHofstadterQ f → + (fun n ↦ (f n : ℝ)) =O[atTop] erdos_422.variants.growth_rate.answer := by sorry +/-- +Hofstadter's $Q$-sequence is not eventually constant: if $f(n) = c$ for all large $n$, then the +recurrence gives $c = f(n - c) + f(n - c) = 2c$. +-/ +@[category API, AMS 11] +theorem IsHofstadterQ.not_eventuallyConst {f : ℕ+ → ℕ+} (hf : IsHofstadterQ f) : + ¬ EventuallyConst f atTop := by + obtain ⟨-, -, hf⟩ := hf + intro h + obtain ⟨c, hc⟩ := eventuallyConst_iff_exists_eventuallyEq.mp h + obtain ⟨N, hN⟩ := eventually_atTop.mp hc + have hc0 := c.pos + -- Subtracting `k ≤ c + 1` from `n = N + c + 2` leaves an index that is still at least `N`. + have key (k : ℕ+) (hk : (k : ℕ) ≤ c + 1) : f (N + c + 2 - k) = c := hN _ <| by + have hlt : k < N + c + 2 := by + rw [← PNat.coe_lt_coe]; push_cast; omega + rw [← PNat.coe_le_coe, PNat.sub_coe, ite_eq_left hlt] + push_cast; omega + have hn : f (N + c + 2) = c := hN _ <| by + rw [← PNat.coe_le_coe]; push_cast; omega + obtain ⟨-, -, hrec⟩ := hf (N + c + 2) (PNat.lt_add_left 2 (N + c)) + -- The recurrence at `n` now reads `c = c + c`. + rw [hn, key 1 (Nat.le_add_left 1 c), key 2 (by push_cast; omega), key c (by omega)] at hrec + exact (PNat.lt_add_right c c).ne hrec + /-- Does $f$ become stationary at some point? + +No: see `IsHofstadterQ.not_eventuallyConst`. The statement is existential, so the answer does +not depend on whether $f(n)$ is well-defined for all $n$. +-/ +@[category textbook, AMS 11] +theorem erdos_422.variants.eventually_const : + ¬ ∃ f : ℕ+ → ℕ+, IsHofstadterQ f ∧ EventuallyConst f atTop := + fun ⟨_, hf, h⟩ ↦ hf.not_eventuallyConst h + +/-- +Is $f(n)$ well-defined for all $n$? -/ -@[category research open, AMS 11] -theorem erdos_422.variants.eventually_const : answer(sorry) ↔ EventuallyConst f atTop := by +@[category research open, question, AMS 11] +theorem erdos_422.variants.well_defined : ∃ f : ℕ+ → ℕ+, IsHofstadterQ f := by sorry end Erdos422 diff --git a/FormalConjectures/ErdosProblems/423.lean b/FormalConjectures/ErdosProblems/423.lean new file mode 100644 index 0000000..13f6b10 --- /dev/null +++ b/FormalConjectures/ErdosProblems/423.lean @@ -0,0 +1,291 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 423 + +*References:* +- [erdosproblems.com/423](https://www.erdosproblems.com/423) +- [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). +- [Cu25] Cushman, A., *A Note on the Sum-Product Problem and the Convex Sumset Problem*. + arXiv:2512.13849 (2025). +- [Ta26] Tang, Q., *The Hofstadter consecutive-sum sequence omits infinitely many positive + integers*. arXiv:2603.09939 (2026). +- [Bolan] Bolan, M., *Hofstader–Ulam Sequence*, + https://github.com/mjtb49/HofstaderUlam/blob/main/HofstaderUlamSequence.pdf +- [OEIS A005243](https://oeis.org/A005243) +-/ + +@[expose] public section + +open Finset BigOperators Filter Asymptotics + +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)\}$. The sequence begins $1, 2, 3, 5, 6, 8, 10, 11, \ldots$. -/ +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 + +/-- The third term of the Hofstadter sequence is $a(3) = 3 = a(1) + a(2) = 1 + 2$. -/ +@[category test, AMS 5 11] +theorem erdos_423.test.a3 : ∀ a : ℕ → ℕ, IsHofstadterSeq a → a 3 = 3 := by + intro a ⟨ha1, ha2, hk⟩ + obtain ⟨⟨i, j, hi, hij, hjk, hsum⟩, _, _⟩ := hk 3 (by omega) + have : i = 1 ∧ j = 2 := by omega + obtain ⟨rfl, rfl⟩ := this + simp only [show Finset.Icc 1 2 = {1, 2} from by decide, + Finset.sum_pair (show (1 : ℕ) ≠ 2 from by decide), ha1, ha2] at hsum + omega + +/-- The fourth term of the Hofstadter sequence is $a(4) = 5 = a(2) + a(3) = 2 + 3$. -/ +@[category test, AMS 5 11] +theorem erdos_423.test.a4 : ∀ a : ℕ → ℕ, IsHofstadterSeq a → a 4 = 5 := by + intro a ⟨ha1, ha2, hk⟩ + have ha3 : a 3 = 3 := erdos_423.test.a3 a ⟨ha1, ha2, hk⟩ + obtain ⟨⟨i, j, hi, hij, hjk, hsum⟩, hlt, hmin⟩ := hk 4 (by omega) + -- Since `j ≤ 3`, the possible pairs `(i, j)` are `(1, 2)`, `(2, 3)`, and `(1, 3)`. + have h_ij : (i = 1 ∧ j = 2) ∨ (i = 2 ∧ j = 3) ∨ (i = 1 ∧ j = 3) := by omega + rcases h_ij with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ + · simp only [show Finset.Icc 1 2 = {1, 2} from by decide, + Finset.sum_pair (by decide : (1 : ℕ) ≠ 2), ha1, ha2] at hsum + rw [ha3] at hlt + omega + · simp only [show Finset.Icc 2 3 = {2, 3} from by decide, + Finset.sum_pair (by decide : (2 : ℕ) ≠ 3), ha2, ha3] at hsum + omega + · rw [show Finset.Icc 1 3 = {1, 2, 3} from by decide, + Finset.sum_insert (by decide : (1 : ℕ) ∉ ({2, 3} : Finset ℕ)), + Finset.sum_pair (by decide : (2 : ℕ) ≠ 3), ha1, ha2, ha3] at hsum + rw [ha3] at hlt + have ha4_eq : a 4 = 6 := by omega + have h3_lt_5 : a 3 < 5 := by omega + have h5_lt_a4 : 5 < a 4 := by omega + exfalso + apply hmin 5 h3_lt_5 h5_lt_a4 + refine ⟨2, 3, by omega, by omega, by omega, ?_⟩ + rw [show Finset.Icc 2 3 = {2, 3} from by decide, + Finset.sum_pair (by decide : (2 : ℕ) ≠ 3), ha2, ha3] + +/-- +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. +What is the asymptotic behaviour of this sequence? It seems likely that $a_n = n + o(n)$. +-/ +@[category research open, question, AMS 5 11] +theorem erdos_423 : + ∀ a : ℕ → ℕ, IsHofstadterSeq a → + (fun n : ℕ => (a n : ℝ) - n) =o[atTop] (fun n : ℕ => (n : ℝ)) := by + sorry + +/-- +Bolan and Tang [Ta26] independently proved that $a_n-n$ is nondecreasing. +-/ +@[category research solved, AMS 5 11] +theorem erdos_423.variants.nondecreasing : + ∀ a : ℕ → ℕ, IsHofstadterSeq a → + ∀ n m : ℕ, 1 ≤ n → n ≤ m → a n - n ≤ a m - m := by + sorry + +/-- +Bolan and Tang [Ta26] independently proved that $a_n-n\to\infty$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_423.variants.unbounded : + ∀ a : ℕ → ℕ, IsHofstadterSeq a → + ∀ M : ℕ, ∀ᶠ n in atTop, M + n ≤ a n := by + sorry + +/-- +Bolan and Tang [Ta26] independently proved that infinitely many positive integers do not occur in +the Hofstadter sequence. +-/ +@[category research solved, AMS 5 11] +theorem erdos_423.variants.infinite_complement : + ∀ a : ℕ → ℕ, IsHofstadterSeq a → Set.Infinite (Set.range a)ᶜ := by + sorry + +/-- A Hofstadter sequence is strictly increasing from index `1` on. -/ +@[category API, AMS 5 11] +theorem IsHofstadterSeq.strictMono {a : ℕ → ℕ} (ha : IsHofstadterSeq a) : + StrictMono fun k => a (k + 1) := by + obtain ⟨h1, h2, hk⟩ := ha + refine strictMono_nat_of_lt_succ fun k => ?_ + show a (k + 1) < a (k + 1 + 1) + rcases Nat.eq_zero_or_pos k with rfl | hpos + · show a 1 < a 2 + omega + · have := (hk (k + 2) (by omega)).2.1 + simpa using this + +/-- A Hofstadter sequence satisfies `n ≤ a n` for `n ≥ 1`. -/ +@[category API, AMS 5 11] +theorem IsHofstadterSeq.le_apply {a : ℕ → ℕ} (ha : IsHofstadterSeq a) (n : ℕ) + (hn : 1 ≤ n) : n ≤ a n := by + have h1 := ha.1 + induction n, hn using Nat.le_induction with + | base => omega + | succ k hk ih => + have := (IsHofstadterSeq.strictMono ha) (Nat.lt_succ_self (k - 1)) + simp only [show k - 1 + 1 = k by omega, show k - 1 + 1 + 1 = k + 1 by omega] at this + omega + +/-- For indices `≥ 1`, a Hofstadter sequence preserves and reflects `<`. -/ +@[category API, AMS 5 11] +theorem IsHofstadterSeq.lt_iff_lt {a : ℕ → ℕ} (ha : IsHofstadterSeq a) {i j : ℕ} + (hi : 1 ≤ i) (hj : 1 ≤ j) : + a i < a j ↔ i < j := by + obtain ⟨i, rfl⟩ := Nat.exists_eq_add_of_le' hi + obtain ⟨j, rfl⟩ := Nat.exists_eq_add_of_le' hj + rw [(IsHofstadterSeq.strictMono ha).lt_iff_lt] + omega + +/-- If `a n - n` is unbounded, infinitely many integers are missed: when `a n ≥ N + 2 + n`, +the `n` values `a 0, …, a (n - 1)` cannot cover the `n + 1` integers in `[N + 1, a n - 1]`, and +later terms are too large. -/ +@[category API, AMS 5 11] +theorem IsHofstadterSeq.infinite_compl_of_unbounded {a : ℕ → ℕ} (ha : IsHofstadterSeq a) + (h : ∀ M : ℕ, ∀ᶠ n in atTop, M + n ≤ a n) : Set.Infinite (Set.range a)ᶜ := by + refine Set.infinite_of_forall_exists_gt fun N => ?_ + obtain ⟨n, hn⟩ := (h (N + 2)).exists_forall_of_atTop + obtain ⟨n, hn1, hn⟩ : ∃ n, 1 ≤ n ∧ N + 2 + n ≤ a n := + ⟨max n 1, by omega, hn _ (le_max_left _ _)⟩ + -- The `n` values `a 0, …, a (n - 1)` cannot cover the `n + 1` integers in `[N + 1, a n - 1]`. + have hcard : ((Finset.range n).image a).card < (Finset.Icc (N + 1) (a n - 1)).card := by + calc ((Finset.range n).image a).card ≤ n := by + simpa using Finset.card_image_le (s := Finset.range n) (f := a) + _ < (Finset.Icc (N + 1) (a n - 1)).card := by simp; omega + obtain ⟨x, hx, hxi⟩ := Finset.exists_mem_notMem_of_card_lt_card hcard + rw [Finset.mem_Icc] at hx + refine ⟨x, ?_, by omega⟩ + rintro ⟨k, rfl⟩ + rcases Nat.lt_or_ge k n with hk | hk + · exact hxi (Finset.mem_image.2 ⟨k, Finset.mem_range.2 hk, rfl⟩) + · have : a n ≤ a k := by + rcases eq_or_lt_of_le hk with rfl | hk' + · exact le_rfl + · exact ((IsHofstadterSeq.lt_iff_lt ha hn1 (by omega)).2 hk').le + omega + +/-- If infinitely many integers are missed, `a n - n` is unbounded: `M + 1` missed integers +below `n` together with `a 1, …, a n` are distinct elements of `[1, a n]`. -/ +@[category API, AMS 5 11] +theorem IsHofstadterSeq.unbounded_of_infinite_compl {a : ℕ → ℕ} (ha : IsHofstadterSeq a) + (h : Set.Infinite (Set.range a)ᶜ) : ∀ M : ℕ, ∀ᶠ n in atTop, M + n ≤ a n := by + intro M + obtain ⟨t, hts, htc⟩ := h.exists_subset_card_eq (M + 1) + -- All missed values in `t` are at most `X`. + set X := t.sup id with hX + rw [Filter.eventually_atTop] + refine ⟨X + 1, fun n hn => ?_⟩ + have hn1 : 1 ≤ n := by omega + -- `a 1, …, a n` and the positive elements of `t` are distinct integers in `[1, a n]`. + set A := (Finset.Icc 1 n).image a with hA + set T := t.filter (fun x => 1 ≤ x) with hT + have hAcard : A.card = n := by + rw [hA, Finset.card_image_of_injOn, Nat.card_Icc] + · omega + · intro i hi j hj hij + rw [Finset.coe_Icc, Set.mem_Icc] at hi hj + by_contra hne + rcases Nat.lt_or_gt_of_ne hne with hlt | hlt + · exact absurd hij ((IsHofstadterSeq.lt_iff_lt ha hi.1 hj.1).2 hlt).ne + · exact absurd hij.symm ((IsHofstadterSeq.lt_iff_lt ha hj.1 hi.1).2 hlt).ne + have hTcard : M ≤ T.card := by + have : (t.filter (fun x => ¬ 1 ≤ x)).card ≤ 1 := by + calc (t.filter (fun x => ¬ 1 ≤ x)).card ≤ ({0} : Finset ℕ).card := + Finset.card_le_card fun x hx => by + rw [Finset.mem_filter] at hx; simp; omega + _ = 1 := rfl + have := Finset.card_filter_add_card_filter_not (s := t) (fun x => 1 ≤ x) + rw [← hT] at this + omega + have hdisj : Disjoint A T := by + rw [Finset.disjoint_left] + intro x hxA hxT + obtain ⟨k, -, rfl⟩ := Finset.mem_image.1 hxA + exact hts (Finset.mem_filter.1 hxT).1 ⟨k, rfl⟩ + have hsub : A ∪ T ⊆ Finset.Icc 1 (a n) := by + intro x hx + rw [Finset.mem_union] at hx + rw [Finset.mem_Icc] + rcases hx with hx | hx + · obtain ⟨k, hk, rfl⟩ := Finset.mem_image.1 hx + rw [Finset.mem_Icc] at hk + refine ⟨IsHofstadterSeq.le_apply ha k hk.1 |>.trans' (by omega), ?_⟩ + rcases eq_or_lt_of_le hk.2 with rfl | hlt + · exact le_rfl + · exact ((IsHofstadterSeq.lt_iff_lt ha hk.1 hn1).2 hlt).le + · obtain ⟨hxt, hx1⟩ := Finset.mem_filter.1 hx + have : x ≤ X := Finset.le_sup (f := id) hxt + exact ⟨hx1, by have := IsHofstadterSeq.le_apply ha n hn1; omega⟩ + have := Finset.card_le_card hsub + rw [Finset.card_union_of_disjoint hdisj, hAcard, Nat.card_Icc] at this + omega + +/-- The unboundedness of $a_n-n$ is equivalent to the sequence omitting infinitely many positive +integers. -/ +@[category test, AMS 5 11] +theorem erdos_423.test.unbounded_iff_infinite_complement : + type_of% erdos_423.variants.unbounded ↔ + type_of% erdos_423.variants.infinite_complement := + ⟨fun h a ha => ha.infinite_compl_of_unbounded (h a ha), + fun h a ha => ha.unbounded_of_infinite_compl (h a ha)⟩ + +/-- +Tang [Ta26] proved $a_n \ll n^{1/(c-1)+o(1)}$ whenever every finite convex set $A$ satisfies +$|A-A|\geq |A|^{c-o(1)}$. Using the bound of Cushman [Cu25] gives +$a_n\ll n^{688/413+o(1)}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_423.variants.upper_bound : + ∀ a : ℕ → ℕ, IsHofstadterSeq a → + ∀ ε > (0 : ℝ), (fun n => (a n : ℝ)) =O[atTop] + (fun n => (n : ℝ) ^ ((688 : ℝ) / 413 + ε)) := by + sorry + +/-- +Tang [Ta26] proved the lower bound $a_n=n+\Omega(\log\log n)$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_423.variants.lower_bound : + ∀ a : ℕ → ℕ, IsHofstadterSeq a → + (fun n : ℕ => Real.log (Real.log n)) =O[atTop] + (fun n : ℕ => (a n : ℝ) - n) := by + sorry + +end Erdos423 diff --git a/FormalConjectures/ErdosProblems/424.lean b/FormalConjectures/ErdosProblems/424.lean index 2d30dd4..231aa34 100644 --- a/FormalConjectures/ErdosProblems/424.lean +++ b/FormalConjectures/ErdosProblems/424.lean @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil /-! # Erdős Problem 424: Sequence generated by $a_i a_j - 1$ @@ -22,8 +24,12 @@ import FormalConjecturesUtil - [erdosproblems.com/424](https://www.erdosproblems.com/424) - [A5244](https://oeis.org/A5244) - [Ben Green's Open Problem 63](https://people.maths.ox.ac.uk/greenbj/papers/open-problems.pdf#section.8 Problem 63) + - [Ko26] Korsky, S., *A problem of Erdős on the sequence $a_ia_j - 1$*, + [arXiv:2608.07910](https://arxiv.org/abs/2608.07910) -/ +@[expose] public section + namespace Erdos424 open Set @@ -50,9 +56,28 @@ def generatedSet : Set ℕ := ⋃ n : ℕ, sequenceSet n Let $a_1 = 2$ and $a_2 = 3$ and continue the sequence by appending to $a_1, \ldots, a_n$ all possible values of $a_i a_j - 1$ with $i \neq j$. Is it true that the set of integers which eventually appear has positive density? + +As explained on [erdosproblems.com/424](https://www.erdosproblems.com/424), "positive density" +here means positive *lower* density: is there $c > 0$ such that for all large $x$ at least +$cx$ of the integers in $[1, x]$ appear? See `erdos_424.variants.exact_density` for the +literal reading. + +The answer is yes: Korsky [Ko26] (with ChatGPT 5.6 Pro) proved that the set has positive lower +density. The linked formal proof (Alexeev and Codex) shows that there is `c > 0` with +`c * x ≤ #{n ∈ [1, x] | n ∈ generatedSet}` for all large `x`, which gives +`c / 2 ≤ generatedSet.lowerDensity`. +-/ +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos424.lean#L6409"] +theorem erdos_424 : 0 < generatedSet.lowerDensity := by + sorry + +/-- +A literal interpretation of "positive density": the natural density of `generatedSet` exists +(i.e. the lower and upper density agree) and is positive. -/ -@[category research open, AMS 11] -theorem erdos_424 : answer(sorry) ↔ generatedSet.HasPosDensity := by +@[category research open, question, AMS 11] +theorem erdos_424.variants.exact_density : generatedSet.HasPosDensity := by sorry -- TODO(firsching): formalize the statements from the additional material diff --git a/FormalConjectures/ErdosProblems/425.lean b/FormalConjectures/ErdosProblems/425.lean new file mode 100644 index 0000000..7f02ee3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/425.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 425 + +*Reference:* [Erdős Problem 425](https://www.erdosproblems.com/425) +-/ + +@[expose] public section + +namespace Erdos425 + +open Filter +open scoped Topology + +/-- A finite set has distinct pairwise products if $ab = cd$, for elements satisfying +$a < b$ and $c < d$, implies $(a,b) = (c,d)$. -/ +def PairProductDistinct (A : Finset ℕ) : Prop := + ∀ ⦃a b c d : ℕ⦄, + a ∈ A → b ∈ A → c ∈ A → d ∈ A → a < b → c < d → + a * b = c * d → a = c ∧ b = d + +/-- The maximum cardinality $F(n)$ of a subset of $\{1,\ldots,n\}$ with distinct +pairwise products. -/ +noncomputable def pairProductExtremal (n : ℕ) : ℕ := by + classical + exact Nat.findGreatest + (fun m => ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 n ∧ PairProductDistinct A ∧ A.card = m) n + +/-- +For `r`, all products over `r` distinct elements of `A` are distinct. We use +finite subsets of `A` of cardinality exactly `r`. +-/ +def RProductsDistinct (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 + +/-- Products of two distinct elements are distinct exactly when pairwise products are. -/ +@[category test, AMS 5 11] +theorem rProductsDistinct_two : RProductsDistinct 2 = PairProductDistinct := by + funext A + apply propext + have sorted_pair (S : Finset ℕ) (hS : S.card = 2) : + ∃ a b, a < b ∧ S = {a, b} := by + obtain ⟨a, b, hab, rfl⟩ := Finset.card_eq_two.mp hS + rcases lt_or_gt_of_ne hab with hab | hab + · exact ⟨a, b, hab, rfl⟩ + · exact ⟨b, a, hab, Finset.pair_comm a b⟩ + constructor + · intro h a b c d ha hb hc hd hab hcd hp + have heq : ({a, b} : Finset ℕ) = {c, d} := + h (by simpa only [Finset.insert_subset_iff, Finset.singleton_subset_iff] using + And.intro ha hb) + (by simpa only [Finset.insert_subset_iff, Finset.singleton_subset_iff] using + And.intro hc hd) + (Finset.card_pair hab.ne) (Finset.card_pair hcd.ne) + (by simpa [Finset.prod_pair hab.ne, Finset.prod_pair hcd.ne] using hp) + have ha' : a ∈ ({c, d} : Finset ℕ) := heq ▸ (by simp) + have hb' : b ∈ ({c, d} : Finset ℕ) := heq ▸ (by simp) + simp only [Finset.mem_insert, Finset.mem_singleton] at ha' hb' + omega + · intro h S T hSA hTA hS hT hp + obtain ⟨a, b, hab, rfl⟩ := sorted_pair S hS + obtain ⟨c, d, hcd, rfl⟩ := sorted_pair T hT + simp only [Finset.insert_subset_iff, Finset.singleton_subset_iff] at hSA hTA + obtain ⟨rfl, rfl⟩ := h hSA.1 hSA.2 hTA.1 hTA.2 hab hcd + (by simpa [Finset.prod_pair hab.ne, Finset.prod_pair hcd.ne] using hp) + rfl + +/-- Let $F(n)$ be the maximum size of a subset of $\{1,\ldots,n\}$ with distinct +pairwise products. Is there a constant $c > 0$ such that +$$F(n) = \pi(n) + (c + o(1)) n^{3/4}(\log n)^{-3/2}?$$ -/ +@[category research open, question, AMS 5 11] +theorem erdos_425.parts.i : ∃ c : ℝ, 0 < c ∧ + Tendsto + (fun n : ℕ => + ((pairProductExtremal n : ℝ) - (Nat.primeCounting n : ℝ)) / + ((n : ℝ) ^ ((3 : ℝ) / 4) * (Real.log n) ^ (-(3 : ℝ) / 2))) + atTop (𝓝 c) := by + sorry + +/-- If all products of $r$ distinct elements of $A \subseteq \{1,\ldots,n\}$ are +distinct, must +$$|A| \leq \pi(n) + O\bigl(n^{(r+1)/(2r)}\bigr)?$$ -/ +@[category research open, question, AMS 5 11] +theorem erdos_425.parts.ii : ∀ r : ℕ, 1 ≤ r → ∃ C : ℝ, 0 < C ∧ + ∀ᶠ n in atTop, ∀ A : Finset ℕ, A ⊆ Finset.Icc 1 n → RProductsDistinct r A → + (A.card : ℝ) ≤ (Nat.primeCounting n : ℝ) + + C * (n : ℝ) ^ (((r : ℝ) + 1) / (2 * r)) := by + sorry + +end Erdos425 diff --git a/FormalConjectures/ErdosProblems/430.lean b/FormalConjectures/ErdosProblems/430.lean new file mode 100644 index 0000000..9cf53b3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/430.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 430 + +*References:* +- [erdosproblems.com/430](https://www.erdosproblems.com/430) +- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number + theory*. Monographies de L'Enseignement Mathematique (1980). + +The question is equivalent to the first part of +[Erdős Problem 385](https://www.erdosproblems.com/385) (an observation of Sarosh Adenwalla +recorded on both problem pages). +-/ + +@[expose] public section + +namespace Erdos430 + +open Filter + +/-- +The terms of the sequence of Erdős Problem 430 for a given $n$: the integers $m$ with +$1 < m < n$ all of whose prime factors are $> n - m$. + +The decreasing sequence $a_1 > a_2 > \cdots$ of the problem lists the elements of this set in +decreasing order: $a_1 = n - 1$ is its largest element and $a_k$ is its largest element below +$a_{k-1}$. The integer $1$ has no prime factors and is not a term of the sequence, which stops +instead, as in the example on erdosproblems.com: for $n = 8$ the sequence is $7, 5$. +-/ +def terms (n : ℕ) : Finset ℕ := (Finset.Ioo 1 n).filter fun m => ∀ p ∈ m.primeFactors, n - m < p + +/-- For example if $n=8$ we have $a_1=7$ and $a_2=5$ and then must stop. -/ +@[category test, AMS 11] +theorem terms_eight : terms 8 = {5, 7} := by + decide +kernel + +/-- The first term of the sequence is $a_1 = n - 1$, the largest element of `terms n`. -/ +@[category API, AMS 11] +theorem isGreatest_sub_one {n : ℕ} (hn : 3 ≤ n) : IsGreatest (terms n : Set ℕ) (n - 1) := by + refine ⟨?_, fun m hm => ?_⟩ + · simp only [terms, Finset.mem_coe, Finset.mem_filter, Finset.mem_Ioo] + refine ⟨⟨by omega, by omega⟩, fun p hp => ?_⟩ + have := (Nat.prime_of_mem_primeFactors hp).one_lt + omega + · simp only [terms, Finset.mem_coe, Finset.mem_filter, Finset.mem_Ioo] at hm + omega + +/-- +Fix some integer $n$ and define a decreasing sequence in $[1,n)$ by $a_1=n-1$ and, for +$k\geq 2$, letting $a_k$ be the greatest integer in $[1,a_{k-1})$ such that all of the prime +factors of $a_k$ are $>n-a_k$. + +Is it true that, for sufficiently large $n$, not all of this sequence can be prime? +-/ +@[category research open, question, AMS 11] +theorem erdos_430 : ∀ᶠ n in atTop, ¬ ∀ m ∈ terms n, m.Prime := by + sorry + +end Erdos430 diff --git a/FormalConjectures/ErdosProblems/436.lean b/FormalConjectures/ErdosProblems/436.lean new file mode 100644 index 0000000..9205b68 --- /dev/null +++ b/FormalConjectures/ErdosProblems/436.lean @@ -0,0 +1,157 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 436 + +*References:* +- [erdosproblems.com/436](https://www.erdosproblems.com/436) +- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number + theory*. Monographies de L'Enseignement Mathematique (1980). +- [LeLe62] Lehmer, D. H. and Lehmer, Emma, *On runs of residues*. Proc. Amer. Math. Soc. (1962), + 102-106. +- [LLMS62] Lehmer, D. H. and Lehmer, E. and Mills, W. H. and Selfridge, J. L., *Machine proof of a + theorem on cubic residues*. Math. Comp. (1962), 407-415. +- [BiMi63] Bierstedt, R. G. and Mills, W. H., *On the bound for a pair of consecutive quartic + residues of a prime*. Proc. Amer. Math. Soc. (1963), 628-632. +- [LLM63] Lehmer, D. H. and Lehmer, Emma and Mills, W. H., *Pairs of consecutive power residues*. + Canadian J. Math. (1963), 172-177. +- [BLL64] Brillhart, John and Lehmer, D. H. and Lehmer, Emma, *Bounds for pairs of consecutive + seventh and higher power residues*. Math. Comp. (1964), 397-407. +- [Gr64g] Graham, R. L., *On quadruples of consecutive $k$th power residues*. Proc. Amer. Math. + Soc. (1964), 196-197. +- [Du65] Dunton, M., *Bounds for pairs of cubic residues*. Proc. Amer. Math. Soc. (1965), + 330-332. +- [Hi91] Hildebrand, Adolf, *On consecutive $k$th power residues. II*. Michigan Math. J. (1991), + 241-253. +-/ + +@[expose] public section + +open Filter + +namespace Erdos436 + +/-- `IsPowerResidue k p a` means that $a$ is a $k$th power residue modulo $p$, that is, +$p \nmid a$ and $a \equiv x^k \pmod{p}$ for some $x$. -/ +def IsPowerResidue (k p a : ℕ) : Prop := + (a : ZMod p) ≠ 0 ∧ ∃ x : ZMod p, x ^ k = a + +/-- `r k m p` is the least $r \geq 1$ such that $r, r + 1, \ldots, r + m - 1$ are all $k$th +power residues modulo $p$, or `⊤` if there is no such $r$. -/ +noncomputable def r (k m p : ℕ) : ℕ∞ := + ⨅ (n : ℕ) (_ : 1 ≤ n ∧ ∀ i < m, IsPowerResidue k p (n + i)), (n : ℕ∞) + +/-- $\Lambda(k, m) = \limsup_{p \to \infty} r(k, m, p)$, where $p$ runs over the primes. -/ +noncomputable def runLimsup (k m : ℕ) : ℕ∞ := + limsup (r k m) (atTop ⊓ 𝓟 {p | p.Prime}) + +@[inherit_doc] local notation "Λ" => runLimsup + +/-- +If $p$ is a prime 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$, and let +$\Lambda(k, m) = \limsup_{p \to \infty} r(k, m, p)$. Is $\Lambda(k, 2)$ finite for all $k$? + +A question of Lehmer and Lehmer [LeLe62]. Hildebrand [Hi91] proved that $\Lambda(k, 2)$ is finite +for all $k \geq 2$. +-/ +@[category research solved, question, AMS 11] +theorem erdos_436.parts.i : ∀ k ≥ 2, Λ k 2 < ⊤ := by + sorry + +/-- +Is $\Lambda(k, 3)$ finite for all odd $k$? + +Lehmer, Lehmer, Mills and Selfridge [LLMS62] proved $\Lambda(3, 3) = 23532$. The question is open +for odd $k \geq 5$. +-/ +@[category research open, question, AMS 11] +theorem erdos_436.parts.ii : ∀ k ≥ 3, Odd k → Λ k 3 < ⊤ := by + sorry + +/-- Lehmer and Lehmer [LeLe62] proved $\Lambda(2, 2) = 9$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.two_two : Λ 2 2 = 9 := by + sorry + +/-- Dunton [Du65] proved $\Lambda(3, 2) = 77$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.three_two : Λ 3 2 = 77 := by + sorry + +/-- Bierstedt and Mills [BiMi63] proved $\Lambda(4, 2) = 1224$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.four_two : Λ 4 2 = 1224 := by + sorry + +/-- Lehmer, Lehmer and Mills [LLM63] proved $\Lambda(5, 2) = 7888$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.five_two : Λ 5 2 = 7888 := by + sorry + +/-- Lehmer, Lehmer and Mills [LLM63] proved $\Lambda(6, 2) = 202124$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.six_two : Λ 6 2 = 202124 := by + sorry + +/-- Brillhart, Lehmer and Lehmer [BLL64] proved $\Lambda(7, 2) = 1649375$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.seven_two : Λ 7 2 = 1649375 := by + sorry + +/-- Lehmer, Lehmer, Mills and Selfridge [LLMS62] proved $\Lambda(3, 3) = 23532$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.three_three : Λ 3 3 = 23532 := by + sorry + +/-- Lehmer and Lehmer [LeLe62] proved $\Lambda(k, 3) = \infty$ for all even $k$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.even_three : ∀ k ≥ 2, Even k → Λ k 3 = ⊤ := by + sorry + +/-- Graham [Gr64g] proved $\Lambda(k, l) = \infty$ for all $k \geq 2$ and $l \geq 4$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.ge_four : ∀ k ≥ 2, ∀ l ≥ 4, Λ k l = ⊤ := by + sorry + +/-- Modulo $13$, the quadratic residues are $1, 3, 4, 9, 10, 12$, so the first pair of +consecutive quadratic residues starts at $3$. -/ +@[category test, AMS 11] +theorem r_two_two_thirteen : r 2 2 13 = 3 := by + have h2 : ¬ IsPowerResidue 2 13 2 := by + unfold IsPowerResidue + decide + apply le_antisymm + · refine iInf₂_le 3 ⟨by norm_num, ?_⟩ + intro i hi + interval_cases i + · exact ⟨by decide, 4, by decide⟩ + · exact ⟨by decide, 2, by decide⟩ + · refine le_iInf₂ ?_ + rintro n ⟨hn, h⟩ + have : 3 ≤ n := by + by_contra hlt + interval_cases n + · exact h2 (h 1 (by norm_num)) + · exact h2 (h 0 (by norm_num)) + exact_mod_cast this + +end Erdos436 diff --git a/FormalConjectures/ErdosProblems/450.lean b/FormalConjectures/ErdosProblems/450.lean index b151ab3..9435613 100644 --- a/FormalConjectures/ErdosProblems/450.lean +++ b/FormalConjectures/ErdosProblems/450.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 450 @@ -22,8 +23,7 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/450](https://www.erdosproblems.com/450) -/ -open Filter -open scoped Topology +@[expose] public section namespace Erdos450 @@ -44,18 +44,24 @@ every `y ≥ Y ε n`, the window is `ε`-sparse. -/ def IsSufficientScale (Y : ℝ → ℕ → ℕ) : Prop := ∀ ε : ℝ, 0 < ε → ∃ N : ℕ, ∀ n : ℕ, N ≤ n → ∀ y : ℕ, Y ε n ≤ y → UniformlySparse ε n y +/-- The least window length `y₀` such that every window `(x, x+y)` with `y ≥ y₀` is +`ε`-sparse, or `⊤` if no such `y₀` exists. -/ +noncomputable def windowThreshold (ε : ℝ) (n : ℕ) : ℕ∞ := + ⨅ y : {y : ℕ // ∀ z ≥ y, UniformlySparse ε n z}, (y.1 : ℕ∞) + +def erdos_450.answer : ℕ∞ := sorry + /-- How large must $y=y(\epsilon,n)$ be such that the number of integers in $(x,x+y)$ with a divisor in $(n,2n)$ is at most $\epsilon y$? -A **linear** scale is known to suffice (see `erdos_450.linear_scale_suffices`). -Whether the optimal scale is *sublinear* — a sufficient `Y` with `Y ε n = o(n)` — -is open. +The bound is required for every $x$ and every window length at least $y$, and +$y(\epsilon,n)$ is the least such threshold (or $\infty$ if there is none). +A **linear** scale $y \le C(\epsilon) n$ is known to suffice for fixed $\epsilon$ +and all large $n$ (see `erdos_450.linear_scale_suffices`). -/ -@[category research open, AMS 11] -theorem erdos_450 : answer(sorry) ↔ - ∃ Y : ℝ → ℕ → ℕ, IsSufficientScale Y ∧ - ∀ ε : ℝ, 0 < ε → Tendsto (fun n : ℕ => (Y ε n : ℝ) / n) atTop (𝓝 0) := by +@[category research open, question value, AMS 11] +theorem erdos_450 (ε : ℝ) (hε : 0 < ε) (n : ℕ) : windowThreshold ε n = erdos_450.answer := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/452.lean b/FormalConjectures/ErdosProblems/452.lean new file mode 100644 index 0000000..ed41831 --- /dev/null +++ b/FormalConjectures/ErdosProblems/452.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 452 + +*Reference:* [erdosproblems.com/452](https://www.erdosproblems.com/452) +-/ + +@[expose] public section + +namespace Erdos452 + +open scoped ArithmeticFunction.omega + +/-- The greatest length of an interval in $[x,2x]$ on which +$\omega(n) > \log\log n$ everywhere. -/ +noncomputable def largeOmegaIntervalLength (x : ℕ) : ℕ := by + classical + exact Nat.findGreatest + (fun len ↦ ∃ start, x ≤ start ∧ start + len ≤ 2 * x + 1 ∧ + ∀ n ∈ Finset.Ico start (start + len), + Real.log (Real.log (n : ℝ)) < (ω n : ℝ)) + (x + 1) + +def erdos_452.answer : ℕ → ℕ := sorry + +/-- Determine the largest length of an interval in $[x,2x]$ on which +$\omega(n) > \log\log n$ everywhere. -/ +@[category research open, question value, AMS 11] +theorem erdos_452 : largeOmegaIntervalLength = erdos_452.answer := by + sorry + +end Erdos452 diff --git a/FormalConjectures/ErdosProblems/457.lean b/FormalConjectures/ErdosProblems/457.lean index ea30eff..b25d857 100644 --- a/FormalConjectures/ErdosProblems/457.lean +++ b/FormalConjectures/ErdosProblems/457.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 457 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/457](https://www.erdosproblems.com/457) -/ +@[expose] public section + namespace Erdos457 /-- @@ -33,8 +36,8 @@ $$ This was formalized in Lean by Baretto and van Doorn using Aristotle. -/ -@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/Woett/Lean-files/blob/main/ErdosProblem457.lean"] -theorem erdos_457 : answer(True) ↔ ∃ ε > (0 : ℝ), +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/Woett/Lean-files/blob/main/ErdosProblem457.lean"] +theorem erdos_457 : ∃ ε > (0 : ℝ), { (n : ℕ) | ∀ (p : ℕ), p ≤ (2 + ε) * Real.log n → p.Prime → p ∣ ∏ i ∈ Finset.Icc 1 ⌊Real.log n⌋₊, (n + i) }.Infinite := by sorry @@ -50,11 +53,22 @@ More generally, let $q(n, k)$ denote the least prime which does not divide $\prod_{1 \le i \le k}(n + i)$. This problem asks whether $q(n, \log n) \ge (2 + \epsilon) \log n$ infinitely often. + +This follows from `erdos_457`: if every prime $p \le (2 + \epsilon) \log n$ +divides $\prod_{1 \le i \le \log n} (n + i)$, then $q(n, \log n)$, the least +prime not dividing this product, must exceed $(2 + \epsilon) \log n$. -/ -@[category research open, AMS 11] -theorem erdos_457.variants.qnk : answer(sorry) ↔ ∃ ε > (0 : ℝ), +@[category research solved, question, AMS 11] +theorem erdos_457.variants.qnk : ∃ ε > (0 : ℝ), { (n : ℕ) | (2 + ε) * Real.log n ≤ q n (Real.log n) }.Infinite := by - sorry + obtain ⟨ε, hε, hinf⟩ := erdos_457 + refine ⟨ε, hε, hinf.mono ?_⟩ + intro n hn + by_contra h + obtain ⟨hp, hndvd⟩ : (q n (Real.log n)).Prime ∧ + ¬q n (Real.log n) ∣ ∏ i ∈ Finset.Icc 1 ⌊Real.log n⌋₊, (n + i) := + Nat.find_spec (Nat.exists_prime_not_dvd (Finset.prod_ne_zero_iff.2 fun a ha => by aesop)) + exact hndvd (hn _ (not_le.1 h).le hp) /-- Taking $n$ to be the product of primes @@ -65,8 +79,8 @@ $$ Can one prove that $q(n, \log n) < (1 - \epsilon) (\log n)^2$ for all large $n$ and some $\epsilon > 0$? -/ -@[category research open, AMS 11] -theorem erdos_457.variants.one_sub : answer(sorry) ↔ ∃ ε > (0 : ℝ), +@[category research open, question, AMS 11] +theorem erdos_457.variants.one_sub : ∃ ε > (0 : ℝ), ∀ᶠ n in Filter.atTop, q n (Real.log n) < (1 - ε) * Real.log n ^ 2 := by sorry diff --git a/FormalConjectures/ErdosProblems/461.lean b/FormalConjectures/ErdosProblems/461.lean new file mode 100644 index 0000000..cae94e8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/461.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 461 + +*References:* +- [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). +-/ + +@[expose] public section + +namespace Erdos461 + +/-- The $t$-smooth component $s_t(n)$ of $n$: the product of all primes $p < t$ dividing $n$, +counted with multiplicity. -/ +def smoothComponent (t n : ℕ) : ℕ := + (n.primeFactorsList.filter (· < t)).prod + +/-- The number $f(n,t)$ of distinct values of $s_t(m)$ for $m \in [n+1, n+t]$. -/ +def f (n t : ℕ) : ℕ := + ((Finset.Icc (n + 1) (n + t)).image (smoothComponent t)).card + +/-- +Let $s_t(n)$ be the $t$-smooth component of $n$ - that is, the product of all primes $p$ (with +multiplicity) dividing $n$ such that $p simp [smoothComponent, hp.primeFactorsList_pow, h] + +/-- For $t = 0$ the interval $[n+1, n]$ is empty, so $f(n,0) = 0$ and the bound in `erdos_461` +holds trivially. -/ +@[category test, AMS 11] +theorem f_zero (n : ℕ) : f n 0 = 0 := by + simp only [f, Nat.add_zero, Finset.Icc_eq_empty_of_lt (Nat.lt_add_one n), Finset.image_empty, + Finset.card_empty] + +/-- For $t = 1$ the interval $[n+1, n+1]$ has one element, so $f(n,1) = 1$. -/ +@[category test, AMS 11] +theorem f_one (n : ℕ) : f n 1 = 1 := by + simp only [f, Finset.Icc_self, Finset.image_singleton, Finset.card_singleton] + +end Erdos461 diff --git a/FormalConjectures/ErdosProblems/462.lean b/FormalConjectures/ErdosProblems/462.lean new file mode 100644 index 0000000..e5cef5d --- /dev/null +++ b/FormalConjectures/ErdosProblems/462.lean @@ -0,0 +1,45 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 462 + +*Reference:* [erdosproblems.com/462](https://www.erdosproblems.com/462) +-/ + +@[expose] public section + +namespace Erdos462 + +open Filter +open scoped BigOperators + +/-- +Let $p(n)$ denote the least prime factor of $n$. Is there a constant $C>0$ such that +$$\sum_{x\leq n\leq x+C\sqrt{x}(\log x)^2}\frac{p(n)}{n}\gg 1$$ +for all sufficiently large $x$? +-/ +@[category research open, question, AMS 11] +theorem erdos_462 : + ∃ C c : ℝ, 0 < C ∧ 0 < c ∧ ∀ᶠ x : ℕ in atTop, + c ≤ ∑ n ∈ Finset.Icc x + ⌊(x : ℝ) + C * Real.sqrt x * (Real.log x) ^ 2⌋₊, (n.minFac : ℝ) / n := by + sorry + +end Erdos462 diff --git a/FormalConjectures/ErdosProblems/467.lean b/FormalConjectures/ErdosProblems/467.lean new file mode 100644 index 0000000..c065143 --- /dev/null +++ b/FormalConjectures/ErdosProblems/467.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 467 + +*Reference:* [erdosproblems.com/467](https://www.erdosproblems.com/467) +-/ + +@[expose] public section + +namespace Erdos467 + +open Filter + +/-- The finite set of primes at most $x$. -/ +def primesUpTo (x : ℕ) : Finset ℕ := + (Finset.Icc 2 x).filter Nat.Prime + +/-- The sets $A$ and $B$ form a disjoint nonempty decomposition of the primes up to $x$. -/ +def PrimePartitionUpTo (x : ℕ) (A B : Finset ℕ) : Prop := + A.Nonempty ∧ + B.Nonempty ∧ + A ∪ B = primesUpTo x ∧ + A ∩ B = ∅ + +/-- +The selected congruence classes cover every $n + (((Finset.Ico 1 p).image (fun k => Nat.factorial k % p)).card : ℝ) / p) + (Filter.atTop ⊓ Filter.principal {p : ℕ | p.Prime}) + (nhds (1 - 1 / Real.exp 1)) := by + sorry + +end Erdos478 diff --git a/FormalConjectures/ErdosProblems/483.lean b/FormalConjectures/ErdosProblems/483.lean new file mode 100644 index 0000000..37042fa --- /dev/null +++ b/FormalConjectures/ErdosProblems/483.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 483 + +*References:* +- [erdosproblems.com/483](https://www.erdosproblems.com/483) +- [Er61] Erdős, Paul, *Some unsolved problems*. Magyar Tud. Akad. Mat. Kutató Int. Közl. + (1961), 221-254, p.233, Problem 20. +-/ + +@[expose] public section + +namespace Erdos483 + +/-- A monochromatic solution to $a+b=c$ in $\{1,\ldots,N\}$. +Index $i$ represents $i+1$, and equal summands are allowed. -/ +def HasTriple {k N : ℕ} (χ : Fin N → Fin k) : Prop := + ∃ a b c : Fin N, (a.val + 1) + (b.val + 1) = c.val + 1 ∧ + χ a = χ b ∧ χ b = χ c + +/-- Every colouring of $\{1,\ldots,N\}$ with at most $k$ colours has a Schur triple. -/ +def Forces (k N : ℕ) : Prop := ∀ χ : Fin N → Fin k, HasTriple χ + +/-- The first one-colour forcing interval is $\{1,2\}$, using $1+1=2$. -/ +@[category test, AMS 5 11] +theorem forces_one_two : Forces 1 2 := by + unfold Forces HasTriple + decide + +/-- The interval $\{1\}$ has no Schur triple. -/ +@[category test, AMS 5 11] +theorem not_forces_one_one : ¬ Forces 1 1 := by + unfold Forces HasTriple + decide + +/-- +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$. Estimate $f(k)$. In particular, is it true +that $f(k) < c^k$ for some constant $c>0$? + +The exponential bound is stated directly: for every positive number of colours, there is +a forcing interval of length strictly below $c^k$. This is equivalent to the bound on the +least forcing threshold and avoids choosing a default value for that threshold. +-/ +@[category research open, question, AMS 5 11] +theorem erdos_483 : + ∃ C : ℝ, 0 < C ∧ ∀ k : ℕ, 0 < k → + ∃ N : ℕ, (N : ℝ) < C ^ k ∧ Forces k N := by + sorry + +end Erdos483 diff --git a/FormalConjectures/ErdosProblems/488.lean b/FormalConjectures/ErdosProblems/488.lean index eafa4b8..676e75f 100644 --- a/FormalConjectures/ErdosProblems/488.lean +++ b/FormalConjectures/ErdosProblems/488.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 488 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/488](https://www.erdosproblems.com/488) -/ +@[expose] public section + namespace Erdos488 @@ -31,8 +34,8 @@ $$B=\{ n \geq 1 : a\mid n\textrm{ for some }a\in A\}.$$ Is it true that, for every $m>n\geq \max(A)$, $$\frac{\lvert B\cap [1,m]\rvert }{m}< 2\frac{\lvert B\cap [1,n]\rvert}{n}?$$ -/ -@[category research open, AMS 5 11] -theorem erdos_488 : answer(sorry) ↔ ∀ (A : Finset ℕ), A.Nonempty → +@[category research open, question, AMS 5 11] +theorem erdos_488 : ∀ (A : Finset ℕ), A.Nonempty → -- These are needed for the reasons outlined here: https://github.com/google-deepmind/formal-conjectures/pull/256 0 ∉ A → 1 ∉ A → letI B := {n ≥ 1 | ∃ a ∈ A, a ∣ n} diff --git a/FormalConjectures/ErdosProblems/49.lean b/FormalConjectures/ErdosProblems/49.lean new file mode 100644 index 0000000..6657f3c --- /dev/null +++ b/FormalConjectures/ErdosProblems/49.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 49 + +*References:* +- [erdosproblems.com/49](https://www.erdosproblems.com/49) +- [Er95] Erdős, Paul, *Some of my favourite problems in number theory, combinatorics, and + geometry*. Resenhas (1995), 165-186. +- [Er95c] Erdős, Paul, *Some problems in number theory*. Octogon Math. Mag. (1995), 3-5. +- [Ta24d] Tao, Terence, *Monotone nondecreasing sequences of the Euler totient function*. + Matematica (2024), 793-820. +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos49 + +/-- The largest size of a set $A\subseteq\{1,\ldots,N\}$ on which Euler's totient function is +strictly increasing. -/ +noncomputable def f (N : ℕ) : ℕ := + sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ StrictMonoOn Nat.totient (A : Set ℕ) ∧ + A.card = k} + +/-- The largest size of a set $A\subseteq\{1,\ldots,N\}$ on which Euler's totient function is +non-decreasing. -/ +noncomputable def g (N : ℕ) : ℕ := + sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ MonotoneOn Nat.totient (A : Set ℕ) ∧ + A.card = k} + +/-- +Let $A=\{a_1<\cdots + (sSup {x : ℝ | ∃ A B : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ B ⊆ Finset.Icc 1 N ∧ + (∀ a₁ ∈ A, ∀ b₁ ∈ B, ∀ a₂ ∈ A, ∀ b₂ ∈ B, a₁ * b₁ = a₂ * b₂ → a₁ = a₂ ∧ b₁ = b₂) ∧ + x = A.card * B.card}) * Real.log N / N ^ 2) atTop (nhds L) := by + sorry + +end Erdos490 diff --git a/FormalConjectures/ErdosProblems/5.lean b/FormalConjectures/ErdosProblems/5.lean index e5e0680..011b028 100644 --- a/FormalConjectures/ErdosProblems/5.lean +++ b/FormalConjectures/ErdosProblems/5.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 5 @@ -45,6 +46,8 @@ import FormalConjecturesUtil teilerfremd sind*. Commentat. Phys. Math. (1931), 1-37. -/ +@[expose] public section + open Filter MeasureTheory Real Set open scoped Topology @@ -77,8 +80,8 @@ We formalise "an infinite sequence of $n_i$" as a strictly monotone sequence of $p_{n_i}$ and $p_{n_i+1}$, which is `primeGap (n i)`, and not the gap between the primes indexed by two consecutive members of the sequence. -/ -@[category research open, AMS 11] -theorem erdos_5 : answer(sorry) ↔ ∀ C : ℝ, 0 ≤ C → +@[category research open, question, AMS 11] +theorem erdos_5 : ∀ C : ℝ, 0 ≤ C → ∃ n : ℕ → ℕ, StrictMono n ∧ Tendsto (fun i => normalizedGap (n i)) atTop (𝓝 C) := by sorry @@ -89,8 +92,8 @@ $S=[0,\infty]$. Since $\infty\in S$ is known (see `erdos_5.variants.westzynthius`), the open content is the equality of the finite part of $S$ with $[0,\infty)$. -/ -@[category research open, AMS 11] -theorem erdos_5.variants.limit_point_set : answer(sorry) ↔ limitPointSet = Ici 0 := by +@[category research open, question, AMS 11] +theorem erdos_5.variants.limit_point_set : limitPointSet = Ici 0 := by sorry /-- @@ -200,8 +203,8 @@ theorem erdos_5.variants.merikoski_bounded_gaps : In [Er65b], [Er85c], and [Er97c] Erdős asks whether $S$ is everywhere dense (but Weisenberg notes that clearly $S$ is closed so this is equivalent to asking whether $S=[0,\infty]$). -/ -@[category research open, AMS 11] -theorem erdos_5.variants.dense : answer(sorry) ↔ Ici (0 : ℝ) ⊆ closure limitPointSet := by +@[category research open, question, AMS 11] +theorem erdos_5.variants.dense : Ici (0 : ℝ) ⊆ closure limitPointSet := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/500.lean b/FormalConjectures/ErdosProblems/500.lean new file mode 100644 index 0000000..c7d4ec5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/500.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 500 + +*References:* +- [erdosproblems.com/500](https://www.erdosproblems.com/500) +- [Ra10] Razborov, Alexander A., On 3-hypergraphs with forbidden 4-vertex configurations. SIAM J. + Discrete Math. (2010), 946-963. +- [BaTa11] Baber, Rahil and Talbot, John, *Hypergraphs do jump*. Combin. Probab. Comput. (2011), + 161-171. +- [Ba12] Baber, Rahil, *Turán densities of hypercubes*. arXiv:1201.3587 (2012). +- [JPILY26] Jeong, Gyeongwon and Park, Seonghun and Im, Seonghyuk and Lee, Joonkyung and Yang, + Hongseok, *A New Upper Bound for the Turán Density of the Tetrahedron*. arXiv:2609.27495 + (2026). +-/ + +@[expose] public section + +namespace Erdos500 + +open Filter Asymptotics +open scoped Topology + +def erdos_500.answer : ℕ → ℕ := sorry + +/-- +What is $\mathrm{ex}_3(n,K_4^3)$? That is, the largest number of $3$-edges which can 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. + +See also [712](https://www.erdosproblems.com/712) for the general case. +-/ +@[category research open, question value, AMS 5] +theorem erdos_500 : + (fun n ↦ Hypergraph.cliqueExtremalNumber n 3 4) = erdos_500.answer := by + sorry + +/-- +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\left(\frac{5}{9}+o(1)\right)\binom{n}{3}.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_500.variants.lower_bound (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ n : ℕ in atTop, + (5 / 9 - ε) * (n.choose 3 : ℝ) ≤ Hypergraph.cliqueExtremalNumber n 3 4 := by + sorry + +/-- +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\left(\frac{5}{9}+o(1)\right)\binom{n}{3}.$$ +This is probably the truth. +-/ +@[category research open, AMS 5] +theorem erdos_500.variants.turan_conjecture : + (fun n ↦ (Hypergraph.cliqueExtremalNumber n 3 4 : ℝ)) ~[atTop] + fun n ↦ 5 / 9 * (n.choose 3 : ℝ) := by + sorry + +/-- +The historical upper bound +$$\mathrm{ex}_3(n,K_4^3)\leq (0.561666+o(1))\binom{n}{3}$$ +is due to Razborov [Ra10]. (erdosproblems.com gives $0.5611666$ and omits the $o(1)$; without it +the bound fails at $n=4$, where $\mathrm{ex}_3(4,K_4^3)=3>0.561666\binom{4}{3}$.) + +[Ra10, (2)] gives this bound in complementary form, as a result that numerical computations +suggest, not as a theorem. [BaTa11] reproduce the computation. + +Baber [Ba12, §5.1, p. 14] gives $\pi(K_4^3)\leq 0.5615$, where $\pi(K_4^3)$ is the Turán density +of `erdos_500.variants.asymptotic`. Jeong, Park, Im, Lee and Yang [JPILY26, Theorem 1.1] prove +that $\pi(K_4^3)<0.557789$, with a formal proof in Lean 4. The bound above follows from either +result. +-/ +@[category research solved, AMS 5, formal_proof using lean4 at + "https://github.com/taeyool/tetrahedron-turan/blob/28b83b6f215cb886d2abdc89b33fdae3f17a7e3f/LeanFlagAlgebras/Core/Examples/FullSevenConverged/TetrahedronDifferential.lean#L251"] +theorem erdos_500.variants.upper_bound (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ n : ℕ in atTop, + (Hypergraph.cliqueExtremalNumber n 3 4 : ℝ) ≤ (0.561666 + ε) * (n.choose 3 : ℝ) := by + sorry + +def erdos_500.variants.asymptotic.answer : ℝ := sorry + +/-- +The asymptotic form of the question: what is the Turán density +$$\pi(K_4^3)=\lim_{n\to\infty}\frac{\mathrm{ex}_3(n,K_4^3)}{\binom{n}{3}}?$$ +By `erdos_500.variants.lower_bound`, $\pi(K_4^3)\geq\frac{5}{9}$. +Turán's conjecture says that $\pi(K_4^3)=\frac{5}{9}$. +-/ +@[category research open, question value, AMS 5] +theorem erdos_500.variants.asymptotic : + Tendsto (fun n : ℕ ↦ (Hypergraph.cliqueExtremalNumber n 3 4 : ℝ) / (n.choose 3 : ℝ)) + atTop (𝓝 erdos_500.variants.asymptotic.answer) := by + sorry + +end Erdos500 diff --git a/FormalConjectures/ErdosProblems/501.lean b/FormalConjectures/ErdosProblems/501.lean index a33bc51..04b915c 100644 --- a/FormalConjectures/ErdosProblems/501.lean +++ b/FormalConjectures/ErdosProblems/501.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 501 @@ -34,6 +35,8 @@ import FormalConjecturesUtil the closed case. Acta Math. Acad. Sci. Hungar. (1987). -/ +@[expose] public section + open Set MeasureTheory open scoped Cardinal ENNReal @@ -64,8 +67,8 @@ of size $3$? Known results: Erdős–Hajnal [ErHa60] proved the existence of arbitrarily large finite independent sets. Hechler [He72] showed the answer is **no** assuming the continuum hypothesis. -/ -@[category research open, AMS 5 28] -theorem erdos_501 : answer(sorry) ↔ +@[category research open, question, AMS 5 28] +theorem erdos_501 : ∀ (A : ℝ → Set ℝ), (∀ x, Bornology.IsBounded (A x)) → (∀ x, volume.toOuterMeasure (A x) < 1) → @@ -81,8 +84,8 @@ For every `n : ℕ` and every family `A : ℝ → Set ℝ` of bounded sets with outer measure `< 1`, there exists a finite independent set of size at least `n`. This was proved by Erdős and Hajnal [ErHa60]. -/ -@[category research solved, AMS 5 28] -theorem erdos_501.variants.erdosHajnal_finite : answer(True) ↔ +@[category research solved, question, AMS 5 28] +theorem erdos_501.variants.erdosHajnal_finite : ∀ (n : ℕ) (A : ℝ → Set ℝ), (∀ x, Bornology.IsBounded (A x)) → (∀ x, volume.toOuterMeasure (A x) < 1) → @@ -95,8 +98,8 @@ hypothesis.** Assuming CH (`ℵ₁ = 𝔠`), there exists a family `A : ℝ → Set ℝ` of bounded sets with Lebesgue outer measure `< 1` for which no infinite independent set exists. -/ -@[category research solved, AMS 5 28] -theorem erdos_501.variants.hechler_CH : answer(True) ↔ +@[category research solved, question, AMS 5 28] +theorem erdos_501.variants.hechler_CH : (ℵ₁ = 𝔠) → ∃ (A : ℝ → Set ℝ), (∀ x, Bornology.IsBounded (A x)) ∧ @@ -112,13 +115,13 @@ independent set of size 3? This is implied by the stronger theorem of Newelski–Pawlikowski–Seredyński [NPS87] below; Gladysz [Gl62] earlier proved the existence of an independent set of size 2. -/ -@[category research solved, AMS 5 28] -theorem erdos_501.variants.closed_size3 : answer(True) ↔ +@[category research solved, question, AMS 5 28, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos501.lean#L38"] +theorem erdos_501.variants.closed_size3 : ∀ (A : ℝ → Set ℝ), (∀ x, IsClosed (A x)) → (∀ x, volume (A x) < 1) → ∃ X : Set ℝ, 3 ≤ X.ncard ∧ X.Pairwise (fun x y => x ∉ A y) := by - simp only [true_iff] sorry /-- @@ -127,8 +130,9 @@ theorem erdos_501.variants.closed_size3 : answer(True) ↔ If all the sets `A x` are closed with Lebesgue measure `< 1`, then there **is** an infinite independent set. This gives a strong affirmative answer to the second question of Problem 501. -/ -@[category research solved, AMS 5 28] -theorem erdos_501.variants.newelski_pawlikowski_seredynski : answer(True) ↔ +@[category research solved, question, AMS 5 28, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos501.lean#L31"] +theorem erdos_501.variants.newelski_pawlikowski_seredynski : ∀ (A : ℝ → Set ℝ), (∀ x, IsClosed (A x)) → (∀ x, volume (A x) < 1) → @@ -143,8 +147,8 @@ distinct reals `x y` such that `x ∉ A y` and `y ∉ A x`. This is a weaker result proved by Gladysz before the full Newelski–Pawlikowski– Seredyński theorem [NPS87]. -/ -@[category research solved, AMS 5 28] -theorem erdos_501.variants.gladysz_size2 : answer(True) ↔ +@[category research solved, question, AMS 5 28] +theorem erdos_501.variants.gladysz_size2 : ∀ (A : ℝ → Set ℝ), (∀ x, IsClosed (A x)) → (∀ x, volume (A x) < 1) → diff --git a/FormalConjectures/ErdosProblems/503.lean b/FormalConjectures/ErdosProblems/503.lean index 1492224..96667cd 100644 --- a/FormalConjectures/ErdosProblems/503.lean +++ b/FormalConjectures/ErdosProblems/503.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 503 @@ -22,18 +23,22 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/503](https://www.erdosproblems.com/503) -/ +@[expose] public section + namespace Erdos503 open scoped EuclideanGeometry +def erdos_503.answer : ℕ := sorry + /-- What is the size of the largest $A \subseteq \mathbb{R}^n$ such that every three points from $A$ determine an isosceles triangle? That is, for any three points $x$, $y$, $z$ from $A$, at least two of the distances $|x - y|$, $|y - z|$, $|x - z|$ are equal. -/ -@[category research open, AMS 51] +@[category research open, question value, AMS 51] theorem erdos_503 (n : ℕ) : - IsGreatest {(A.ncard) | (A : Set (ℝ^n)) (hA : A.IsIsosceles)} answer(sorry) := by + IsGreatest {(A.ncard) | (A : Set (ℝ^n)) (hA : A.IsIsosceles)} erdos_503.answer := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/506.lean b/FormalConjectures/ErdosProblems/506.lean index 31ad68e..9565f43 100644 --- a/FormalConjectures/ErdosProblems/506.lean +++ b/FormalConjectures/ErdosProblems/506.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 506 @@ -28,6 +29,8 @@ import FormalConjecturesUtil - [PuSm] Purdy and Smith. No reference found. -/ +@[expose] public section + namespace Erdos506 open EuclideanGeometry @@ -41,6 +44,8 @@ of the non-collinear triples of `P`.) noncomputable def numCircles (P : Set ℝ²) : ℕ := Set.ncard { s : Sphere ℝ² | 3 ≤ {p ∈ P | p ∈ s}.ncard } +def erdos_506.answer : ℕ := sorry + /-- What is the minimum number of circles determined by any $n$ points in $\mathbb{R}^2$, not all on a circle? @@ -57,39 +62,43 @@ remain open for small $n$ (see `erdos_506.variants.small_n`). -- * The hypothesis `4 ≤ n` is not a restriction of the problem, but excludes the degenerate range -- where no admissible configuration exists: fewer than three points are collinear, and any three -- non-collinear points lie on a common circle, so the set below is empty for `n < 4`. -@[category research open, AMS 51 52] +@[category research open, question value, AMS 51 52] theorem erdos_506 (n : ℕ) (hn : 4 ≤ n) : IsLeast { k : ℕ | ∃ P : Finset ℝ², P.card = n ∧ ¬ Collinear ℝ (P : Set ℝ²) ∧ ¬ Cospherical (P : Set ℝ²) ∧ numCircles (P : Set ℝ²) = k } - answer(sorry) := by + erdos_506.answer := by sorry +def erdos_506.variants.large_n.answer (n : ℕ) : ℕ := (n - 1).choose 2 + 1 - (n - 1) / 2 + /-- For $n > 393$ the answer is $\binom{n-1}{2} + 1 - \left\lfloor \frac{n-1}{2} \right\rfloor$ (Elliott [El67], with the correction of Purdy and Smith [PuSm], also reported in [BaBa94]): this is both a lower bound for every such configuration and is attained, e.g. by a circle with $n - 1$ points together with a single point off the circle. -/ -@[category research solved, AMS 51 52] +@[category research solved, question value, AMS 51 52] theorem erdos_506.variants.large_n (n : ℕ) (hn : 393 < n) : IsLeast { k : ℕ | ∃ P : Finset ℝ², P.card = n ∧ ¬ Collinear ℝ (P : Set ℝ²) ∧ ¬ Cospherical (P : Set ℝ²) ∧ numCircles (P : Set ℝ²) = k } - answer((n - 1).choose 2 + 1 - (n - 1) / 2) := by + (erdos_506.variants.large_n.answer n) := by sorry +def erdos_506.variants.small_n.answer : ℕ := sorry + /-- The problem appears to remain open for small $n$: Elliott's answer is established only for $n > 393$, so the minimum number of circles determined by $n$ points, not all on a line and not all on a circle, is unknown for $n \le 393$. -/ -@[category research open, AMS 51 52] +@[category research open, question value, AMS 51 52] theorem erdos_506.variants.small_n (n : ℕ) (hn : 4 ≤ n) (hn' : n ≤ 393) : IsLeast { k : ℕ | ∃ P : Finset ℝ², P.card = n ∧ ¬ Collinear ℝ (P : Set ℝ²) ∧ ¬ Cospherical (P : Set ℝ²) ∧ numCircles (P : Set ℝ²) = k } - answer(sorry) := by + erdos_506.variants.small_n.answer := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/507.lean b/FormalConjectures/ErdosProblems/507.lean index c8d506c..893f0cb 100644 --- a/FormalConjectures/ErdosProblems/507.lean +++ b/FormalConjectures/ErdosProblems/507.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 507 @@ -31,17 +32,21 @@ import FormalConjecturesUtil Journal of the London Mathematical Society 2.3 (1981): 385-396. -/ +@[expose] public section + open Asymptotics Filter Topology open scoped EuclideanGeometry namespace Erdos507 /-- -The minimum area of a triangle determined by three distinct points in a set `S`. +The minimum (unsigned) area of a triangle determined by three distinct points in a set `S`. +Collinear triples count with area `0`. `EuclideanGeometry.triangle_area` is a signed area, so the +absolute value is taken before the infimum. -/ noncomputable def minTriangleArea (S : Finset ℝ²) : ℝ := - sInf {EuclideanGeometry.triangle_area (t.points 0) (t.points 1) (t.points 2) | - (t : Affine.Triangle ℝ ℝ²) (_ : ∀ i, t.points i ∈ S)} + sInf {abs (EuclideanGeometry.triangle_area (p 0) (p 1) (p 2)) | + (p : Fin 3 → ℝ²) (_ : Function.Injective p) (_ : ∀ i, p i ∈ S)} /-- $\alpha(n)$ is the supremum of `minTriangleArea S` over all sets `S` of $n$ points in the unit disk. @@ -60,31 +65,35 @@ The "Barrier" function: n^(-7/6) used for the best upper bound [CPZ24]. -/ noncomputable def upperBarrier (n : ℕ) : ℝ := 1 / (n : ℝ) ^ ((7 : ℝ) / 6) +def erdos_507.equivalent.answer : ℕ → ℝ := sorry + /-- Let $\alpha(n)$ be such that every set of $n$ points in the unit disk contains three points which determine a triangle of area at most $\alpha(n)$. Estimate $\alpha(n)$. -/ -@[category research open, AMS 51] +@[category research open, question value, AMS 51] theorem erdos_507.equivalent: - α ~[atTop] (answer(sorry) : ℕ → ℝ) := by + α ~[atTop] erdos_507.equivalent.answer := by sorry +def erdos_507.lower.answer : ℕ → ℝ := sorry + /-- Estimate a lower bound for$\alpha(n)$. -/ -@[category research open, AMS 51] +@[category research open, question value, AMS 51] theorem erdos_507.lower: - let ans := (answer(sorry) : ℕ → ℝ) - (lowerBest =o[atTop] ans) ∧ (ans ≪ α) := by + (lowerBest =o[atTop] erdos_507.lower.answer) ∧ (erdos_507.lower.answer ≪ α) := by sorry +def erdos_507.upper.answer : ℕ → ℝ := sorry + /-- Estimate an upper bound for$\alpha(n)$. -/ -@[category research open, AMS 51] +@[category research open, question value, AMS 51] theorem erdos_507.upper: - let ans := (answer(sorry) : ℕ → ℝ) - (α ≪ ans) ∧ (ans =o[atTop] upperBarrier) := by + (α ≪ erdos_507.upper.answer) ∧ (erdos_507.upper.answer =o[atTop] upperBarrier) := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/508.lean b/FormalConjectures/ErdosProblems/508.lean index d2db04f..b7f2163 100644 --- a/FormalConjectures/ErdosProblems/508.lean +++ b/FormalConjectures/ErdosProblems/508.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 508 @@ -26,8 +27,14 @@ or the [Golomb graph] *At least 4 colors are required:* [Moser-Spindel graph](https://de.wikipedia.org/wiki/Moser-Spindel) *At least 4 colors are required:* [Golomb graph](https://en.wikipedia.org/wiki/Golomb_graph) *At least 5 colors are required:* [de Grey 2018](https://arxiv.org/abs/1804.02385) +*At least 6 colors are required, and 7 colors suffice:* [OAI26] + +- [OAI26] OpenAI, *The Euclidean plane is not five-colorable*. OpenAI Math Release preprint (2026). + https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/The-Euclidean-plane-is-not-five-colorable-September-23-2026/paper.pdf -/ +@[expose] public section + open SimpleGraph open scoped EuclideanGeometry @@ -35,13 +42,18 @@ namespace Erdos508 scoped notation "χ(ℝ²)" => SimpleGraph.chromaticNumber (UnitDistancePlaneGraph Set.univ) +def HadwigerNelsonProblem.answer : ℕ∞ := sorry + /-- The Hadwiger–Nelson problem asks: How many colors are required to color the plane such that no two points at distance 1 from each other have the same color? + +It is known that $6 \leq \chi(\mathbb{R}^2) \leq 7$; see `HadwigerNelsonAtLeastSix` and +`HadwigerNelsonAtMostSeven`. -/ -@[category research open, AMS 52] +@[category research open, question value, AMS 52] theorem HadwigerNelsonProblem : - χ(ℝ²) = answer(sorry) := by + χ(ℝ²) = HadwigerNelsonProblem.answer := by sorry /-- @@ -56,12 +68,23 @@ theorem HadwigerNelsonAtLeastFive : 5 ≤ χ(ℝ²) := by sorry +/-- +The chromatic number of the plane is at least 6: there is no proper 5-colouring of the plane. + +This was proved by an internal OpenAI model in September 2026 [OAI26]; see the linked Lean proof. +-/ +@[category research solved, AMS 52, formal_proof using lean4 at + "https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Geometry/PlaneColoring/Five.lean#L124"] +theorem HadwigerNelsonAtLeastSix : + 6 ≤ χ(ℝ²) := by + sorry + /-- The "chromatic number of the plane" is at least 4. This can be proven by considering the [Moser-Spindel graph](https://de.wikipedia.org/wiki/Moser-Spindel) or the [Golomb graph](https://en.wikipedia.org/wiki/Golomb_graph) graph. -/ -@[category research solved, AMS 5] +@[category research solved, AMS 5, formal_proof using lean4 at "https://github.com/anatoliiohorodnyk/lean-fc-proofs/blob/394ec1c1ff92bdf2fa10f30d62ae9d0455d3ce20/Proofs/T_Erdos508_HadwigerNelsonAtLeast4.lean#L88"] theorem HadwigerNelsonAtLeast4 : 4 ≤ χ(ℝ²) := by sorry @@ -74,8 +97,11 @@ pattern. A proof can probably be found in: Soifer, Alexander (2008), The Mathematical Coloring Book: Mathematics of Coloring and the Colorful Life of its Creators, New York: Springer, ISBN 978-0-387-74640-1 An alternative approach that uses square tiling was highlighted by László Székely. + +The linked Lean proof of this bound is part of the OpenAI release [OAI26]. -/ -@[category textbook, AMS 52] +@[category textbook, AMS 52, formal_proof using lean4 at + "https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Geometry/PlaneColoring/Seven.lean#L36"] theorem HadwigerNelsonAtMostSeven : χ(ℝ²) ≤ 7 := by sorry diff --git a/FormalConjectures/ErdosProblems/509.lean b/FormalConjectures/ErdosProblems/509.lean index 579f962..3df5e78 100644 --- a/FormalConjectures/ErdosProblems/509.lean +++ b/FormalConjectures/ErdosProblems/509.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 509 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/509](https://www.erdosproblems.com/509) -/ +@[expose] public section + namespace Erdos509 open Polynomial @@ -78,8 +81,8 @@ Let $f(z) ∈ ℂ[z]$ be a monic non-constant polynomial. Can the set $\{z ∈ ℂ : |f(z)| ≤ 1\}$ be covered by a set of closed discs the sum of whose radii is $≤ 2$? -/ -@[category research open, AMS 30] -theorem erdos_509 : answer(sorry) ↔ ∀ (f : ℂ[X]), f.Monic → f.natDegree ≠ 0 → +@[category research open, question, AMS 30] +theorem erdos_509 : ∀ (f : ℂ[X]), f.Monic → f.natDegree ≠ 0 → ∃ (ι : Type), Nonempty (BoundedDiscCover {z | ‖f.eval z‖ ≤ 1} 2 ι) := by sorry @@ -92,8 +95,8 @@ See *Sur les systèmes de fonctions holomorphes à variétés linéaires lacunaires et leurs applications*, Henri Cartan, http://www.numdam.org/article/ASENS_1928_3_45__255_0.pdf -/ -@[category research solved, AMS 30] -theorem erdos_509.variants.Cartan_bound : answer(True) ↔ ∀ (f : ℂ[X]), f.Monic → f.natDegree ≠ 0 → +@[category research solved, question, AMS 30] +theorem erdos_509.variants.Cartan_bound : ∀ (f : ℂ[X]), f.Monic → f.natDegree ≠ 0 → ∃ (ι : Type), Nonempty (BoundedDiscCover {z | ‖f.eval z‖ ≤ 1} (2*rexp 1) ι) := by sorry @@ -102,8 +105,8 @@ Let $f(z) ∈ ℂ[z]$ be a monic non-constant polynomial. Can the set $\{z ∈ ℂ : |f(z)| ≤ 1\}$ be covered by a set of closed discs the sum of whose radii is $≤ 2.59$? Solution: True. This is due to Pommerenke. --/@[category research solved, AMS 30] -theorem erdos_509.variants.Pommerenke_bound : answer(True) ↔ ∀ (f : ℂ[X]), f.Monic → f.natDegree ≠ 0 → +-/@[category research solved, question, AMS 30] +theorem erdos_509.variants.Pommerenke_bound : ∀ (f : ℂ[X]), f.Monic → f.natDegree ≠ 0 → ∃ (ι : Type), Nonempty (BoundedDiscCover {z | ‖f.eval z‖ ≤ 1} 2.59 ι) := by sorry @@ -113,8 +116,8 @@ If it is connected, can the set $\{z ∈ ℂ : |f(z)| ≤ 1\}$ be covered by a set of circles the sum of whose radii is $≤ 2$? Solution: True. This is due to Pommerenke. -/ -@[category research solved, AMS 30] -theorem erdos_509.variants.Pommerenke_connected : answer(True) ↔ ∀ (f : ℂ[X]), f.Monic → f.natDegree ≠ 0 → +@[category research solved, question, AMS 30] +theorem erdos_509.variants.Pommerenke_connected : ∀ (f : ℂ[X]), f.Monic → f.natDegree ≠ 0 → IsConnected {z | ‖f.eval z‖ ≤ 1} → ∃ (ι : Type), Nonempty (BoundedDiscCover {z | ‖f.eval z‖ ≤ 1} 2 ι) := by sorry diff --git a/FormalConjectures/ErdosProblems/510.lean b/FormalConjectures/ErdosProblems/510.lean index 0d44f00..61abc92 100644 --- a/FormalConjectures/ErdosProblems/510.lean +++ b/FormalConjectures/ErdosProblems/510.lean @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil /-! # Erdős Problem 510 @@ -25,6 +27,8 @@ import FormalConjecturesUtil - [Be25c] B. Bedert, Polynomial bounds for the Chowla Cosine Problem. arXiv:2509.05260 (2025). -/ +@[expose] public section + namespace Erdos510 open Real Filter @@ -37,9 +41,9 @@ If $A\subset \mathbb{N}$ is a finite set of positive integers of size $N > 0$ th absolute constant $c>0$ and $\theta$ such that $$\sum_{n\in A}\cos(n\theta) < -cN^{1/2}?$$ -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_510 : - answer(sorry) ↔ ∃ (c : ℝ) (hc : 0 < c), + ∃ (c : ℝ) (hc : 0 < c), ∀ᶠ N in atTop, ∀ (A : Finset ℕ), 0 ∉ A → #A = N → ∃ θ, ∑ n ∈ A, cos (n * θ) < -c * sqrt N := by sorry diff --git a/FormalConjectures/ErdosProblems/513.lean b/FormalConjectures/ErdosProblems/513.lean index b0b038f..bc6fe36 100644 --- a/FormalConjectures/ErdosProblems/513.lean +++ b/FormalConjectures/ErdosProblems/513.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 513 @@ -23,8 +24,11 @@ import FormalConjecturesUtil - [erdosproblems.com/513](https://www.erdosproblems.com/513) - [ClHa64] Clunie, J. and Hayman, W. K., The maximum term of a power series. J. Analyse Math. (1964), 143-186. + - [Tao's optimization constant 51a](https://teorth.github.io/optimizationproblems/constants/51a.html) -/ +@[expose] public section + open scoped Nat Real open Filter Polynomial @@ -33,27 +37,32 @@ namespace Erdos513 noncomputable def ratio (r : ℝ) (f : ℂ → ℂ) : ℝ := (⨆ n, ‖iteratedDeriv n f 0 * (n ! : ℝ)⁻¹ * r ^ n‖) / (⨆ z : {z : ℂ // ‖z‖ = r}, ‖f z‖) +/-- The **Erdős maximum term constant** $B$: the supremum, over all transcendental entire +functions $f$, of $\liminf_{r \to \infty} \mu(r, f) / M(r, f)$. Here $\mu(r, f)$ is the maximum +term of the power series of $f$ on $|z| = r$, and $M(r, f) = \max_{|z| = r} |f(z)|$. -/ +noncomputable def maxTermConstant : ℝ := + ⨆ f : {f : ℂ → ℂ // Transcendental ℂ[X] f ∧ Differentiable ℂ f}, + liminf (fun r : ℝ => ratio r f) atTop + +def erdos_513.answer : ℝ := sorry + /-- Let `f` be a transcendental entire function. What is the greatest possible value of `liminf (fun r : ℝ => ratio r f) atTop`? -/ -@[category research open, AMS 30] -theorem erdos_513 : answer(sorry) = - ⨆ f : {f : ℂ → ℂ // Transcendental ℂ[X] f ∧ Differentiable ℂ f}, - (liminf (fun r : ℝ => ratio r f) atTop) := by +@[category research open, question value, AMS 30] +theorem erdos_513 : maxTermConstant = erdos_513.answer := by sorry -/-- For all transcendental entire function `f`, `liminf (fun r : ℝ => ratio r f) atTop ≤ 2 / π - c` -for some `c > 0`. This is proved in [ClHa64]. -/ +/-- There is `c > 0` such that `maxTermConstant ≤ 2 / π - c`. This is proved in [ClHa64]. -/ @[category research solved, AMS 30] -theorem erdos_513.variants.upper_bound : ∃ c > 0, - ⨆ f : {f : ℂ → ℂ // Transcendental ℂ[X] f ∧ Differentiable ℂ f}, - (liminf (fun r : ℝ => ratio r f) atTop) ≤ 2 / π - c := by +theorem erdos_513.variants.upper_bound : ∃ c > 0, maxTermConstant ≤ 2 / π - c := by sorry -/-- For all transcendental entire function `f`, `liminf (fun r : ℝ => ratio r f) atTop > 1 / 2`. -/ +/-- `maxTermConstant > 1 / 2`: there is a transcendental entire `f` with +`liminf (fun r : ℝ => ratio r f) atTop > 1 / 2`. This was observed by Kövári (unpublished), and +[ClHa64] proves the stronger bound `> 4 / 7`. It does not hold for every `f`: for `f = exp` the +`liminf` is `0`. -/ @[category research solved, AMS 30] -theorem erdos_513.variants.lower_bound : - ⨆ f : {f : ℂ → ℂ // Transcendental ℂ[X] f ∧ Differentiable ℂ f}, - (liminf (fun r : ℝ => ratio r f) atTop) > 1 / 2 := by +theorem erdos_513.variants.lower_bound : maxTermConstant > 1 / 2 := by sorry end Erdos513 diff --git a/FormalConjectures/ErdosProblems/536.lean b/FormalConjectures/ErdosProblems/536.lean index 2934181..b3d5c06 100644 --- a/FormalConjectures/ErdosProblems/536.lean +++ b/FormalConjectures/ErdosProblems/536.lean @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil /-! # Erdős Problem 536 @@ -21,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/536](https://www.erdosproblems.com/536) -/ +@[expose] public section + namespace Erdos536 open Finset Nat Filter @@ -31,9 +35,9 @@ size at least $\epsilon N$ then there must be distinct $a,b,c\in A$ such that $$[a, b]=[b, c]=[a, c],$$ where $[\cdot, \cdot]$ denotes the least common multiple? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_536 : - answer(sorry) ↔ ∀ᵉ (ε > (0: ℝ)), ∀ᶠ N in atTop, + ∀ᵉ (ε > (0: ℝ)), ∀ᶠ N in atTop, ∀ (A : Finset ℕ), A ⊆ Icc 1 N → (ε * (N : ℝ)) ≤ (A.card : ℝ) → ∃ᵉ (a ∈ A) (b ∈ A) (c ∈ A), # {a, b, c} = 3 ∧ a.lcm b = b.lcm c ∧ b.lcm c = a.lcm c := by diff --git a/FormalConjectures/ErdosProblems/538.lean b/FormalConjectures/ErdosProblems/538.lean index 6cb64c4..0d9341c 100644 --- a/FormalConjectures/ErdosProblems/538.lean +++ b/FormalConjectures/ErdosProblems/538.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 538 @@ -22,8 +23,9 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/538](https://www.erdosproblems.com/538) -/ -open Filter -open scoped Topology +@[expose] public section + +open Asymptotics Filter namespace Erdos538 @@ -43,26 +45,28 @@ def reciprocalMass (A : Finset ℕ) : ℚ := ∑ a ∈ A, (1 : ℚ) / a noncomputable def maxMass (r N : ℕ) : ℝ := sSup ((fun A => (reciprocalMass A : ℝ)) '' {A : Finset ℕ | Admissible r N A}) +def erdos_538.answer : ℕ → ℕ → ℝ := sorry + /-- 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}\frac{1}{n}$. -The order is known — `∑ 1/n = Θ_r(log N / loglog N)` (see `erdos_538.matching_order`) — -but the sharp constant is not. This asks whether `maxMass r N` has a well-defined -leading constant `c_r` in `c_r · log N / loglog N`. +Erdős observed that $\sum_{n\in A}\frac{1}{n}\ll r\frac{\log N}{\log\log N}$, and the +order `Θ_r(log N / loglog N)` is known (see `erdos_538.matching_order`). The best possible +upper bound is the asymptotic size of the largest reciprocal sum `maxMass r N` over +admissible `A`. -/ -@[category research open, AMS 11] -theorem erdos_538 : answer(sorry) ↔ ∀ r : ℕ, 2 ≤ r → - ∃ c : ℝ, 0 < c ∧ - Tendsto (fun N : ℕ => maxMass r N * Real.log (Real.log N) / Real.log N) atTop (𝓝 c) := by +@[category research open, question value, AMS 11] +theorem erdos_538 : + ∀ r : ℕ, 2 ≤ r → maxMass r ~[atTop] erdos_538.answer r := by sorry /-- The reciprocal sum has matching order `Θ_r(log N / loglog N)`: an explicit upper bound for every admissible `A`, together with a witnessing construction achieving the same order. This pins the order (up to the one iterated-logarithm -factor) but not the sharp constant asked for in `erdos_538`. +factor) but not the best possible upper bound asked for in `erdos_538`. -/ @[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-538/Research/FinalMatchingOrder.lean"] theorem erdos_538.matching_order (r N : ℕ) (hr : 2 ≤ r) (hN : 2 ≤ N) : diff --git a/FormalConjectures/ErdosProblems/539.lean b/FormalConjectures/ErdosProblems/539.lean index 5546c7e..d6fe4cd 100644 --- a/FormalConjectures/ErdosProblems/539.lean +++ b/FormalConjectures/ErdosProblems/539.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 539 @@ -23,7 +24,7 @@ In this problem, a function $h : \mathbb{N} \to\mathbb{N}$ is defined maximally counting property. The problem asks to estimate $h(n)$. This has been interpreted here as asking for $\Theta(h(n))$. -The principal version includes `answer(sorry)` for an unknown function. On the other hand, the best +The principal version includes the unknown function `erdos_539.answer`. On the other hand, the best known upper bound is $n^{2/3}$ and the best known lower bound is $\sqrt{n}$ so we also provide these candidates as variants. Moreover, it suffices to show $O(h(n))$ and $O(\sqrt{n})$ respectively for each, so further variants are provided for those. @@ -39,6 +40,8 @@ it is not clear whether this remains open, but we include it here either way. - [Sc+26] Schmitt, J., Gehrunger, T., Dekoninck, J., Bérczi, G., Kreitner, U., Price, L., & Holmes, D. (2026). _ProofCouncil: An LLM Agent for Solving Open Mathematical Problems_. [arXiv:2607.09474](https://arxiv.org/abs/2607.09474), Appendix A, Theorem A.1. -/ +@[expose] public section + open Filter open scoped Asymptotics Finset @@ -55,19 +58,23 @@ for $n$. -/ noncomputable def cofactorThreshold (n : ℕ) : ℕ := sSup {m | IsCofactorLowerBound n m} +def erdos_539.answer : ℕ → ℝ := sorry + /-- Let $h(n)$ be maximal such that, for any set $A\subseteq \mathbb{N}$ of size $n$, the set$$\left\{ \frac{a}{(a,b)}: a,b\in A\right\}$$has size at least $h(n)$. Estimate $h(n)$. -/ -@[category research open, AMS 5 11] +@[category research open, question value, AMS 5 11] theorem erdos_539 : - (fun n ↦ (cofactorThreshold n : ℝ)) =Θ[atTop] (answer(sorry) : ℕ → ℝ) := by + (fun n ↦ (cofactorThreshold n : ℝ)) =Θ[atTop] erdos_539.answer := by sorry /-- Let $h(n)$ be maximal such that, for any set $A\subseteq \mathbb{N}$ of size $n$, the set$$\left\{ \frac{a}{(a,b)}: a,b\in A\right\}$$has size at least $h(n)$. Is $h(n) = \Theta(\sqrt{n})$? -/ -@[category research open, AMS 5 11] +@[category research solved, question, AMS 5 11, + formal_proof using lean4 at + "https://github.com/KitaKen1/erdos-539-sqrt-disproof/blob/f4b14f9ef32c111162d3fd587e1c65b27a1524d5/lean/Erdos539SqrtFC.lean#L41-L44"] theorem erdos_539.variants.sq : - (fun n ↦ (cofactorThreshold n : ℝ)) =Θ[atTop] fun n ↦ √n := by + ¬ ((fun n ↦ (cofactorThreshold n : ℝ)) =Θ[atTop] fun n ↦ √n) := by sorry /-- Erdős and Szemerédi proved that$$n^{1/2} \ll h(n)$$. -/ @@ -76,23 +83,24 @@ theorem erdos_539.variants.sq_isBigO : (fun n : ℕ ↦ √n) =O[atTop] fun n ↦ (cofactorThreshold n : ℝ) := by sorry -/-- To prove `erdos_539.variants.sq` it suffices to show $$ h(n)\ll n^{1/2}$$. -/ -@[category research open, AMS 5 11] +/-- Is $h(n) = O(\sqrt{n})$? -/ +@[category research solved, question, AMS 5 11, + formal_proof using lean4 at + "https://github.com/KitaKen1/erdos-539-sqrt-disproof/blob/f4b14f9ef32c111162d3fd587e1c65b27a1524d5/lean/Erdos539SqrtFC.lean#L36-L39"] theorem erdos_539.variants.isBigO_sq : - (fun n ↦ (cofactorThreshold n : ℝ)) =O[atTop] fun n ↦ √n := by + ¬ ((fun n ↦ (cofactorThreshold n : ℝ)) =O[atTop] fun n ↦ √n) := by sorry /-- Let $h(n)$ be maximal such that, for any set $A\subseteq \mathbb{N}$ of size $n$, the set$$\left\{ \frac{a}{(a,b)}: a,b\in A\right\}$$has size at least $h(n)$. Is $h(n) = \Theta(n^{2/3})$? The answer is negative; see [Sc+26, Theorem A.1] and the linked Lean proof. -/ -@[category research solved, AMS 5 11, +@[category research solved, question, AMS 5 11, formal_proof using lean4 at "https://github.com/KitaKen1/erdos-539-formal-conjectures/blob/79897cf9241390eb168572f4a481e29e0e64b5f7/lean/Erdos539/FC.lean#L282-L296"] theorem erdos_539.variants.sq_cube_root : - answer(False) ↔ - ((fun n ↦ (cofactorThreshold n : ℝ)) =Θ[atTop] - fun n ↦ (n : ℝ) ^ ((2 : ℝ) / 3)) := by + ¬ ((fun n ↦ (cofactorThreshold n : ℝ)) =Θ[atTop] + fun n ↦ (n : ℝ) ^ ((2 : ℝ) / 3)) := by sorry /-- Granville and Roesler [GR99] showed that $$h(n)\ll n^{2/3}$$.-/ @@ -102,15 +110,16 @@ theorem erdos_539.variants.isBigO_sq_cube_root : sorry /-- This lower bound is false; see [Sc+26, Theorem A.1] and the linked Lean proof. -/ -@[category research solved, AMS 5 11, +@[category research solved, question, AMS 5 11, formal_proof using lean4 at "https://github.com/KitaKen1/erdos-539-formal-conjectures/blob/79897cf9241390eb168572f4a481e29e0e64b5f7/lean/Erdos539/FC.lean#L282-L296"] theorem erdos_539.variants.sq_cube_root_isBigO : - answer(False) ↔ - ((fun n : ℕ ↦ (n : ℝ) ^ ((2 : ℝ) / 3)) =O[atTop] - fun n ↦ (cofactorThreshold n : ℝ)) := by + ¬ ((fun n : ℕ ↦ (n : ℝ) ^ ((2 : ℝ) / 3)) =O[atTop] + fun n ↦ (cofactorThreshold n : ℝ)) := by sorry +noncomputable def erdos_539.variants.limit.answer : Filter ℝ := nhds ((1 : ℝ) / 2) + /-- From [Er73]: The determination of $$ \lim_{n\to\infty}\frac{\log(h(n))}{\log(n)} @@ -118,13 +127,13 @@ $$ will perhaps be not too difficult. The limit is $1/2$; see [Sc+26, Theorem A.1] and the linked Lean proof. -/ -@[category research solved, AMS 5 11, +@[category research solved, question value, AMS 5 11, formal_proof using lean4 at "https://github.com/KitaKen1/erdos-539-formal-conjectures/blob/79897cf9241390eb168572f4a481e29e0e64b5f7/lean/Erdos539/FC.lean#L282-L296"] theorem erdos_539.variants.limit : atTop.Tendsto (fun n ↦ Real.log (cofactorThreshold n) / Real.log n) - answer(nhds ((1 : ℝ) / 2)) := by + erdos_539.variants.limit.answer := by sorry end Erdos539 diff --git a/FormalConjectures/ErdosProblems/542.lean b/FormalConjectures/ErdosProblems/542.lean new file mode 100644 index 0000000..397154f --- /dev/null +++ b/FormalConjectures/ErdosProblems/542.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 542 + +*References:* +- [erdosproblems.com/542](https://www.erdosproblems.com/542) +- [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. +- [Er80] Erdős, Paul, _A survey of problems in combinatorial number theory_. Ann. Discrete Math. + (1980), 89-115. +- [Er98] Erdős, Paul, _Some of my new and almost new problems and results in combinatorial number + theory_. Number theory (Eger, 1996) (1998), 169-180. +- [ScSz59] Schinzel, A. and Szekeres, G., _Sur un problème de M. Paul Erdős_. Acta Sci. Math. + (Szeged) (1959), 221-229. +- [Ch96] Chen, Yong-Gao, _On a problem of P. Erdős_. Acta Sci. Math. (Szeged) (1996), 101--114. +-/ + +@[expose] public section + +open Filter Real + +namespace Erdos542 + +/-- A set `A ⊆ {1, …, n}` such that `lcm(a, b) > n` for all distinct `a, b ∈ A`. -/ +def IsLcmFree (n : ℕ) (A : Finset ℕ) : Prop := + A ⊆ Finset.Icc 1 n ∧ (A : Set ℕ).Pairwise fun a b ↦ n < Nat.lcm a b + +/-- The integers `1 ≤ m ≤ n` which are not divisible by any element of `A`. -/ +def uncovered (n : ℕ) (A : Finset ℕ) : Finset ℕ := + (Finset.Icc 1 n).filter fun m ↦ ∀ a ∈ A, ¬ a ∣ m + +/-- +Is it true that if $A\subseteq\{1,\ldots,n\}$ is a set such that $[a,b]>n$ for all $a\neq b$, +where $[a,b]$ is the least common multiple, then +$$\sum_{a\in A}\frac{1}{a}\leq \frac{31}{30}?$$ + +The answer is yes, proved by Schinzel and Szekeres [ScSz59]. The bound is best possible as +$A=\{2,3,5\}$ demonstrates. +-/ +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos542.lean#L2114"] +theorem erdos_542.parts.i : + ∀ (n : ℕ) (A : Finset ℕ), IsLcmFree n A → ∑ a ∈ A, (1 : ℝ) / a ≤ 31 / 30 := by + sorry + +/-- The bound $31/30$ is attained by $A=\{2,3,5\}$ (with $n=5$). -/ +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos542.lean#L2114"] +theorem erdos_542.variants.sharp : + IsLcmFree 5 {2, 3, 5} ∧ ∑ a ∈ ({2, 3, 5} : Finset ℕ), (1 : ℝ) / a = 31 / 30 := by + sorry + +/-- +Is it true that if $A\subseteq\{2,\ldots,n\}$ is a set such that $[a,b]>n$ for all $a\neq b$, +then there must be $\gg n$ many $m\leq n$ which are not divisible by any $a\in A$? + +The answer is no, proved by Schinzel and Szekeres [ScSz59]. + +The element $1$ is excluded: $A=\{1\}$ satisfies the hypothesis and leaves no such $m$, so +without this restriction the answer would be negative for a trivial reason. +-/ +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos542.lean#L2114"] +theorem erdos_542.parts.ii : + ¬ ∃ c > 0, ∀ (n : ℕ) (A : Finset ℕ), IsLcmFree n A → 1 ∉ A → + c * n ≤ ((uncovered n A).card : ℝ) := by + sorry + +/-- +Schinzel and Szekeres [ScSz59] proved that, for any $\epsilon>0$, there are sets +$A\subseteq\{2,\ldots,n\}$ as in the problem with $o(n)$ many uncovered $m\leq n$ and for which +$\sum_{a\in A}\frac{1}{a}>1-\epsilon$. +-/ +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos542.lean#L2114"] +theorem erdos_542.variants.schinzel_szekeres : + ∀ ε > 0, ∀ δ > 0, ∃ (n : ℕ) (A : Finset ℕ), IsLcmFree n A ∧ 1 ∉ A ∧ + ((uncovered n A).card : ℝ) ≤ δ * n ∧ 1 - ε < ∑ a ∈ A, (1 : ℝ) / a := by + sorry + +/-- +Schinzel and Szekeres [ScSz59] proved that there are examples $A\subseteq\{2,\ldots,n\}$ with at +most $n/(\log n)^c$ many such $m$, for some real constant $c>0$. +-/ +@[category research solved, AMS 11] +theorem erdos_542.variants.log_power : ∃ c > (0 : ℝ), ∃ᶠ n : ℕ in atTop, ∃ A : Finset ℕ, + IsLcmFree n A ∧ 1 ∉ A ∧ ((uncovered n A).card : ℝ) ≤ n / (log n) ^ c := by + sorry + +/-- +Chen [Ch96] has proved that if $n>172509$ then +$$\sum_{a\in A}\frac{1}{a}< \frac{1}{3}+\frac{1}{4}+\frac{1}{5}+\frac{1}{7}+\frac{1}{11}.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_542.variants.chen (n : ℕ) (hn : 172509 < n) (A : Finset ℕ) (hA : IsLcmFree n A) : + ∑ a ∈ A, (1 : ℝ) / a < 1 / 3 + 1 / 4 + 1 / 5 + 1 / 7 + 1 / 11 := by + sorry + +/-- +In [Er73] Erdős further speculates that in fact +$$\sum_{a\in A}\frac{1}{a}\leq 1+o(1),$$ +where the $o(1)$ term $\to 0$ as $n\to \infty$. +-/ +@[category research open, question, AMS 11] +theorem erdos_542.variants.one_add_little_o : + ∃ o : ℕ → ℝ, Tendsto o atTop (nhds 0) ∧ + ∀ (n : ℕ) (A : Finset ℕ), IsLcmFree n A → ∑ a ∈ A, (1 : ℝ) / a ≤ 1 + o n := by + sorry + +/-- +In [Er98] Erdős mentions that he, Schinzel, and Szekeres conjectured that $2,3,5$ and +$3,4,5,7,11$ are the only two sequences for which the sum is $>1$. +-/ +@[category research open, question, AMS 11] +theorem erdos_542.variants.only_two : + ∀ (n : ℕ) (A : Finset ℕ), IsLcmFree n A → 1 < ∑ a ∈ A, (1 : ℝ) / a → + A = {2, 3, 5} ∨ A = {3, 4, 5, 7, 11} := by + sorry + +end Erdos542 diff --git a/FormalConjectures/ErdosProblems/544.lean b/FormalConjectures/ErdosProblems/544.lean new file mode 100644 index 0000000..f3eab5c --- /dev/null +++ b/FormalConjectures/ErdosProblems/544.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 544 + +*References:* +- [erdosproblems.com/544](https://www.erdosproblems.com/544) +-/ + +@[expose] public section + +open Filter + +namespace Erdos544 + +/-- +Show that +$$R(3,k+1)-R(3,k)\to\infty$$ +as $k\to \infty$. + +A problem of Erdős and Sós. +This problem is #8 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, AMS 5] +theorem erdos_544.parts.i : + Tendsto (fun k : ℕ ↦ (SimpleGraph.classicalRamsey 3 (k + 1) : ℝ) - + (SimpleGraph.classicalRamsey 3 k : ℝ)) atTop atTop := by + sorry + +/-- +Similarly, prove or disprove that +$$R(3,k+1)-R(3,k)=o(k).$$ +-/ +@[category research open, question, AMS 5] +theorem erdos_544.parts.ii : + (fun k : ℕ ↦ (SimpleGraph.classicalRamsey 3 (k + 1) : ℝ) - + (SimpleGraph.classicalRamsey 3 k : ℝ)) =o[atTop] (fun k : ℕ ↦ (k : ℝ)) := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos544 diff --git a/FormalConjectures/ErdosProblems/545.lean b/FormalConjectures/ErdosProblems/545.lean new file mode 100644 index 0000000..62822ee --- /dev/null +++ b/FormalConjectures/ErdosProblems/545.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 545 + +*References:* +- [erdosproblems.com/545](https://www.erdosproblems.com/545) +- [ErGr75] Erdős, P. and Graham, R. L., On partition theorems for finite graphs. + Infinite and finite sets (1975), 515-527. +- [Er84b] Erdős, P., On some problems in graph theory, combinatorial analysis and combinatorial + number theory. Graph theory and combinatorics (Cambridge, 1983) (1984), 1-17. +-/ + +@[expose] public section + +open Filter + +namespace Erdos545 + +/-- +The graph formed by connecting a new vertex (`none`) to $t$ of the vertices of $K_n$ (`Fin n`). +-/ +def knPlusTEdges (n t : ℕ) : SimpleGraph (Option (Fin n)) where + Adj u v := match u, v with + | some x, some y => x ≠ y + | none, some y => y.val < t + | some x, none => x.val < t + | none, none => False + symm.symm u v := by + cases u <;> cases v <;> simp [ne_comm] + loopless.irrefl u := by + cases u <;> simp + +/-- +Let $m$ be sufficiently large and 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. The restriction to sufficiently large $m$ excludes the +small counterexamples recorded on the source page. + +This problem is #10 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, question, AMS 5] +theorem erdos_545 : + ∀ᶠ m : ℕ in atTop, ∀ (n t : ℕ), t < n → m = n.choose 2 + t → + ∀ (V : Type) [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj], + (∀ v, 0 < G.degree v) → + G.edgeSet.ncard = m → + SimpleGraph.diagonalGraphRamsey G ≤ + SimpleGraph.diagonalGraphRamsey (knPlusTEdges n t) := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos545 diff --git a/FormalConjectures/ErdosProblems/551.lean b/FormalConjectures/ErdosProblems/551.lean new file mode 100644 index 0000000..fd0b241 --- /dev/null +++ b/FormalConjectures/ErdosProblems/551.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 551 + +*References:* +- [erdosproblems.com/551](https://www.erdosproblems.com/551) +- [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. +-/ + +@[expose] public section + +open Filter + +namespace Erdos551 + +/-- +Prove that +$$R(C_k,K_n)=(k-1)(n-1)+1$$ +for $k\geq n\geq 3$ (except when $n=k=3$). + +Asked by Erdős, Faudree, Rousseau, and Schelp. +This problem is #18 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, AMS 5] +theorem erdos_551 : + ∀ (k n : ℕ), 3 ≤ n → n ≤ k → ¬(n = 3 ∧ k = 3) → + SimpleGraph.graphRamsey (SimpleGraph.cycleGraph k) + (SimpleGraph.completeGraph (Fin n)) = (k - 1) * (n - 1) + 1 := by + sorry + +/-- +For sufficiently large $n$ and every $k\geq n$, $R(C_k,K_n)=(k-1)(n-1)+1$. + +Keevash, Long, and Skokan [KLS21] have proved this identity when +$k\geq C\frac{\log n}{\log\log n}$ for some constant $C$, thus establishing the conjecture +for sufficiently large $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_551.variants.sufficiently_large : + ∀ᶠ n : ℕ in atTop, ∀ k : ℕ, n ≤ k → + SimpleGraph.graphRamsey (SimpleGraph.cycleGraph k) + (SimpleGraph.completeGraph (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 0000000..9ac5882 --- /dev/null +++ b/FormalConjectures/ErdosProblems/552.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 552 + +*References:* +- [erdosproblems.com/552](https://www.erdosproblems.com/552) +- [BEFRS89] Burr, S. and Erdős, P. and Faudree, R. J. and Rousseau, C. C. and Schelp, R. H., Some + complete bipartite graph-tree Ramsey numbers. Graph theory in memory of G. A. Dirac (Sandbjerg, + 1985) (1989), 79-89. +- [Ch97] Chen, G., *A result on $C_4$-star Ramsey numbers*. Discrete Mathematics **163** (1997), + 243-246. +-/ + +@[expose] public section + +namespace Erdos552 + +def erdos_552.parts.i.answer : ℕ := sorry + +/-- +Determine the Ramsey number +$$R(C_4, S_n),$$ +where $S_n=K_{1,n}$ is the star on $n+1$ vertices. + +A problem of Burr, Erdős, Faudree, Rousseau, and Schelp [BEFRS89]. + +This problem is #19 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, question value, AMS 5] +theorem erdos_552.parts.i : + ∀ (n : ℕ), + SimpleGraph.graphRamsey (SimpleGraph.cycleGraph 4) + (completeBipartiteGraph (Fin 1) (Fin n)) = + erdos_552.parts.i.answer := by + sorry + +/-- +In particular, 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?$$ +-/ +@[category research open, question, AMS 5] +theorem erdos_552.parts.ii : + ∀ (c : ℝ), 0 < c → + Set.Infinite {n : ℕ | + (SimpleGraph.graphRamsey (SimpleGraph.cycleGraph 4) + (completeBipartiteGraph (Fin 1) (Fin n)) : ℝ) ≤ (n : ℝ) + Real.sqrt n - c} := by + sorry + +/-- +Burr, Erdős, Faudree, Rousseau and Schelp also asked whether $f(n + 1) \le f(n) + 2$ for all $n$, +where $f(n) = R(C_4, S_n)$. Chen [Ch97] proved this for $n \ge 1$. It fails for $n = 0$, since +$R(C_4, S_1) = 4$ and $R(C_4, S_0) = 1$. +-/ +@[category research solved, AMS 5, formal_proof using lean4 at + "https://github.com/agnt-gg/erdos-lean/blob/8e5972f4e6787049b168e5350b1a2badc9eb8bcd/Erdos/Erdos552.lean#L292"] +theorem erdos_552.variants.succ_le_add_two (n : ℕ) (hn : 1 ≤ n) : + SimpleGraph.graphRamsey (SimpleGraph.cycleGraph 4) + (completeBipartiteGraph (Fin 1) (Fin (n + 1))) ≤ + SimpleGraph.graphRamsey (SimpleGraph.cycleGraph 4) + (completeBipartiteGraph (Fin 1) (Fin n)) + 2 := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos552 diff --git a/FormalConjectures/ErdosProblems/554.lean b/FormalConjectures/ErdosProblems/554.lean new file mode 100644 index 0000000..98da34e --- /dev/null +++ b/FormalConjectures/ErdosProblems/554.lean @@ -0,0 +1,160 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil +public import FormalConjectures.ErdosProblems.«183» + +/-! +# Erdős Problem 554 + +*References:* +- [erdosproblems.com/554](https://www.erdosproblems.com/554) +- [Er81c] Erdős, P., *Some new problems and results in graph theory and other branches of + combinatorial mathematics*. Combinatorics and graph theory (Calcutta, 1980), Lecture Notes in + Math. 885 (1981), 9-17. +- [BoEr73] Bondy, J. A. and Erdős, P., *Ramsey numbers for cycles in graphs*. J. Combin. Theory + Ser. B 14 (1973), 46-54. +- [ErGr75] Erdős, P. and Graham, R. L., *On partition theorems for finite graphs*. Infinite and + finite sets (Colloq., Keszthely, 1973), Colloq. Math. Soc. János Bolyai 10 (1975), 515-527. +- [DaJo17] Day, A. N. and Johnson, J. R., *Multicolour Ramsey numbers of odd cycles*. + J. Combin. Theory Ser. B 124 (2017), 56-63. [arXiv:1602.07607](https://arxiv.org/abs/1602.07607) +- [JeSk21] Jenssen, M. and Skokan, J., *Exact Ramsey numbers of odd cycles via nonlinear + optimisation*. Adv. Math. 376 (2021), Paper No. 107444. + [arXiv:1608.05705](https://arxiv.org/abs/1608.05705) +- [ACJMR26] 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*. J. Combin. Theory + Ser. B 179 (2026), 293-298. [arXiv:2510.17981](https://arxiv.org/abs/2510.17981) + [doi:10.1016/j.jctb.2026.04.005](https://doi.org/10.1016/j.jctb.2026.04.005) +-/ + +@[expose] public section + +open Filter SimpleGraph + +open scoped Topology + +namespace Erdos554 + +/-- $R_k(K_3)$ agrees with `Erdos183.multicolourTriangleRamsey`: a colouring has a monochromatic +triangle exactly when it is not $3$-clique-free. -/ +@[category test, AMS 5] +theorem multicolourGraphRamsey_completeGraph_three (k : ℕ) : + multicolourGraphRamsey k (completeGraph (Fin 3)) = Erdos183.multicolourTriangleRamsey k := by + simp only [multicolourGraphRamsey, Erdos183.multicolourTriangleRamsey, + Erdos183.ForcesMonochromaticTriangle, TopEdgeLabeling.CliqueFree, not_forall, + not_cliqueFree_iff_top_isContained] + +/-- The cycle $C_3$ is the triangle $K_3$, so $R_k(C_3) = R_k(K_3)$. -/ +@[category test, AMS 5] +theorem multicolourGraphRamsey_cycleGraph_three (k : ℕ) : + multicolourGraphRamsey k (cycleGraph 3) = multicolourGraphRamsey k (completeGraph (Fin 3)) := + congrArg (multicolourGraphRamsey k) cycleGraph_three_eq_top + +/-- With one colour the only colouring of $K_m$ is $K_m$ itself, and $K_m$ contains $C_5$ +exactly when $m \geq 5$. -/ +@[category test, AMS 5] +theorem multicolourGraphRamsey_one_cycleGraph_five : + multicolourGraphRamsey 1 (cycleGraph 5) = 5 := by + sorry + +/-- +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$. Show that +$$\lim_{k\to \infty}\frac{R_k(C_{2n+1})}{R_k(K_3)}=0$$ +for any $n\geq 2$. + +A problem of Erdős and Graham. The case $n = 1$ is excluded since $C_3 = K_3$. This problem is +#23 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, AMS 5] +theorem erdos_554 (n : ℕ) (hn : 2 ≤ n) : + Tendsto (fun k : ℕ ↦ (multicolourGraphRamsey k (cycleGraph (2 * n + 1)) : ℝ) / + (multicolourGraphRamsey k (completeGraph (Fin 3)) : ℝ)) atTop (𝓝 0) := by + sorry + +/-- +The problem is open even for $n = 2$: +$$\lim_{k\to \infty}\frac{R_k(C_5)}{R_k(K_3)}=0.$$ +-/ +@[category research open, AMS 5] +theorem erdos_554.variants.n_eq_two : + Tendsto (fun k : ℕ ↦ (multicolourGraphRamsey k (cycleGraph 5) : ℝ) / + (multicolourGraphRamsey k (completeGraph (Fin 3)) : ℝ)) atTop (𝓝 0) := by + sorry + +/-- +Bondy and Erdős [BoEr73] and Erdős and Graham [ErGr75] proved the lower bound +$$n2^k+1\leq R_k(C_{2n+1})$$ +for all $n, k \geq 1$. The condition $k \geq 1$ excludes the junk value $R_0(G) = 2$. +-/ +@[category research solved, AMS 5] +theorem erdos_554.variants.lower_bound : + ∀ n : ℕ, 1 ≤ n → ∀ k : ℕ, 1 ≤ k → + n * 2 ^ k + 1 ≤ multicolourGraphRamsey k (cycleGraph (2 * n + 1)) := by + sorry + +/-- +Erdős and Graham [ErGr75] (see also [BoEr73]) proved the upper bound +$$R_k(C_{2n+1})\leq 2n(k+2)!$$ +for all $n, k \geq 1$. +-/ +@[category research solved, AMS 5] +theorem erdos_554.variants.upper_bound : + ∀ n : ℕ, 1 ≤ n → ∀ k : ℕ, 1 ≤ k → + multicolourGraphRamsey k (cycleGraph (2 * n + 1)) ≤ 2 * n * (k + 2).factorial := by + sorry + +/-- +Axenovich, Cames van Batenburg, Janzer, Michel and Rundström [ACJMR26, Theorem 1.1] proved that +$$R_k(C_{2n+1}) \leq (4n-2)^k k^{k/n}+1$$ +for all $n, k \geq 1$. For $n \geq 2$ this improves the upper bound in +`Erdos554.erdos_554.variants.upper_bound`, since $k^{k/n}$ grows much more slowly than $(k+2)!$. +-/ +@[category research solved, AMS 5] +theorem erdos_554.variants.acjmr : + ∀ n : ℕ, 1 ≤ n → ∀ k : ℕ, 1 ≤ k → + (multicolourGraphRamsey k (cycleGraph (2 * n + 1)) : ℝ) ≤ + (4 * n - 2 : ℝ) ^ k * (k : ℝ) ^ ((k : ℝ) / n) + 1 := by + sorry + +/-- +Day and Johnson [DaJo17] proved that for every $n \geq 1$ there is a constant $c_n > 0$ such that +$$R_k(C_{2n+1}) > 2n(2+c_n)^{k-1}$$ +for all sufficiently large $k$. So the lower bound in `Erdos554.erdos_554.variants.lower_bound` +is not sharp for fixed $n$ and large $k$. +-/ +@[category research solved, AMS 5] +theorem erdos_554.variants.day_johnson : + ∀ n : ℕ, 1 ≤ n → ∃ c > (0 : ℝ), ∀ᶠ k : ℕ in atTop, + (2 * n : ℝ) * (2 + c) ^ (k - 1) < + (multicolourGraphRamsey k (cycleGraph (2 * n + 1)) : ℝ) := by + sorry + +/-- +Jenssen and Skokan [JeSk21] proved that the lower bound in +`Erdos554.erdos_554.variants.lower_bound` is sharp for fixed $k$ and large $n$: for every +$k \geq 2$, +$$R_k(C_{2n+1}) = n2^k+1$$ +for all sufficiently large $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_554.variants.jenssen_skokan : + ∀ k : ℕ, 2 ≤ k → ∀ᶠ n : ℕ in atTop, + multicolourGraphRamsey k (cycleGraph (2 * n + 1)) = n * 2 ^ k + 1 := by + sorry + +end Erdos554 diff --git a/FormalConjectures/ErdosProblems/555.lean b/FormalConjectures/ErdosProblems/555.lean new file mode 100644 index 0000000..1d775bb --- /dev/null +++ b/FormalConjectures/ErdosProblems/555.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 555 + +*Reference:* [erdosproblems.com/555](https://www.erdosproblems.com/555) +-/ + +@[expose] public section + +namespace Erdos555 + +/-- A symmetric edge-colouring of the complete graph on $m$ vertices with $k$ colours. -/ +structure EdgeColoring (m k : ℕ) where + color : Fin m → Fin m → Fin k + symm : ∀ u v : Fin m, color u v = color v u + +/-- The adjacency relation of the cycle $C_{2n}$ on vertices $0,\ldots,2n-1$. -/ +def EvenCycleAdj (n : ℕ) (u v : Fin (2 * n)) : Prop := + (u.val + 1) % (2 * n) = v.val ∨ (v.val + 1) % (2 * n) = u.val + +/-- A monochromatic copy of a graph with adjacency predicate `Adj`. -/ +def ContainsMonochromaticCopy {v m k : ℕ} + (Adj : Fin v → Fin v → Prop) (χ : EdgeColoring m k) : Prop := + ∃ emb : Fin v → Fin m, + Function.Injective emb ∧ + ∃ c : Fin k, + ∀ a b : Fin v, Adj a b → χ.color (emb a) (emb b) = c + +/-- The natural number $r$ is the Ramsey number $R_k(C_{2n})$, where $n\geq 2$. -/ +def IsEvenCycleRamseyNumber (k n r : ℕ) : Prop := + 2 ≤ n ∧ + IsLeast + {m : ℕ | + ∀ χ : EdgeColoring m k, ContainsMonochromaticCopy (EvenCycleAdj n) χ} + r + +/-- A function giving $R_k(C_{2n})$ for every $k\geq 1$ and $n\geq 2$. -/ +def EvenCycleRamseyFunction (R : ℕ → ℕ → ℕ) : Prop := + ∀ k n : ℕ, 1 ≤ k → 2 ≤ n → IsEvenCycleRamseyNumber k n (R k n) + +def erdos_555.answer : ℕ → ℕ → ℕ := sorry + +/-- +Let $R_k(G)$ be the least $m$ such that every $k$-colouring of the edges of $K_m$ contains a +monochromatic copy of $G$. Determine $R_k(C_{2n})$. +-/ +@[category research open, question value, AMS 5] +theorem erdos_555 : EvenCycleRamseyFunction erdos_555.answer := by + sorry + +end Erdos555 diff --git a/FormalConjectures/ErdosProblems/556.lean b/FormalConjectures/ErdosProblems/556.lean new file mode 100644 index 0000000..c96fa44 --- /dev/null +++ b/FormalConjectures/ErdosProblems/556.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 556 + +A problem of Bondy and Erdős: for the cycle $C_n$ with $n \ge 4$, the $3$-colour Ramsey number +satisfies +$$R(C_n; 3) \le 4n - 3.$$ +The triangle is excluded: $C_3 = K_3$ and $R(K_3; 3) = 17 > 9$ [Rad]. The bound is best possible for odd $n$, where equality is conjectured (and known for large odd +$n$). Łuczak proved the asymptotic bound $R(C_n; 3) \le (4 + o(1))n$, and $(3 + o(1))n$ for even +$n$; Kohayakawa, Simonovits and Skokan settled large odd $n$, and Benevides and Skokan large even +$n$, but the inequality for all $n$ remains open. + +*References:* +- [erdosproblems.com/556](https://www.erdosproblems.com/556) +- [Er81] P. Erdős, *On the combinatorial problems which I would most like to see solved*, + Combinatorica 1 (1981), 25-42. +- [Lu99] T. Łuczak, *$R(C_n, C_n, C_n) \le (4 + o(1))n$*, J. Combin. Theory Ser. B 75 (1999), + 174-187. +- [KSS05] Y. Kohayakawa, M. Simonovits, J. Skokan, *The 3-colored Ramsey number of odd cycles*, + Proceedings of GRACO2005 (2005), 397-402. +- [BeSk09] F. S. Benevides, J. Skokan, *The 3-colored Ramsey number of even cycles*, J. Combin. + Theory Ser. B 99 (2009), 690-708. +- [Rad] S. P. Radziszowski, *Small Ramsey Numbers*, Electron. J. Combin. Dynamic Survey DS1, + revision 18, [p. 61](https://www.combinatorics.org/ojs/index.php/eljc/article/download/DS1/pdf/#page=61). +-/ + +@[expose] public section + +open Filter + +namespace Erdos556 + +open SimpleGraph + +/-- +Erdős Problem 556 (Bondy–Erdős): for all $n \ge 4$, +$$R(C_n; 3) \le 4n - 3.$$ +The case $n = 3$ is excluded since $R(K_3; 3) = 17$. +-/ +@[category research open, AMS 5] +theorem erdos_556 (n : ℕ) (hn : 4 ≤ n) : + multicolourRamsey (cycleGraph n) 3 ≤ 4 * n - 3 := by + sorry + +/-- +Łuczak's asymptotic bound [Lu99]: for every $\varepsilon > 0$, for all sufficiently large $n$, +$$R(C_n; 3) \le (4 + \varepsilon)n.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_556.variants.luczak_asymptotic : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (multicolourRamsey (cycleGraph n) 3 : ℝ) ≤ (4 + ε) * n := by + sorry + +/-- +Łuczak's asymptotic bound for even $n$ [Lu99]: for every $\varepsilon > 0$, for all sufficiently +large even $n$, +$$R(C_n; 3) \le (3 + \varepsilon)n.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_556.variants.luczak_asymptotic_even : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, Even n → + (multicolourRamsey (cycleGraph n) 3 : ℝ) ≤ (3 + ε) * n := by + sorry + +/-- +For odd $n$ the bound $4n - 3$ is best possible: the $3$-colour Ramsey number is at least +$4n - 3$, so equality holds whenever the conjectured upper bound does. +-/ +@[category research solved, AMS 5] +theorem erdos_556.variants.odd_lower_bound (n : ℕ) (hn : 3 ≤ n) (hodd : Odd n) : + 4 * n - 3 ≤ multicolourRamsey (cycleGraph n) 3 := by + sorry + +/-- +Kohayakawa, Simonovits and Skokan [KSS05] settled the conjecture for large odd $n$: for all +sufficiently large odd $n$, +$$R(C_n; 3) = 4n - 3.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_556.variants.kss_large_odd : + ∀ᶠ n : ℕ in atTop, Odd n → multicolourRamsey (cycleGraph n) 3 = 4 * n - 3 := by + sorry + +/-- +Benevides and Skokan [BeSk09] settled the even case for large $n$: for all sufficiently large +even $n$, +$$R(C_n; 3) = 2n.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_556.variants.benevides_skokan_large_even : + ∀ᶠ n : ℕ in atTop, Even n → multicolourRamsey (cycleGraph n) 3 = 2 * n := by + sorry + +end Erdos556 diff --git a/FormalConjectures/ErdosProblems/560.lean b/FormalConjectures/ErdosProblems/560.lean new file mode 100644 index 0000000..af786c1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/560.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 560 + +*References:* +- [erdosproblems.com/560](https://www.erdosproblems.com/560) +- [EFRS82] Erdős, P. and Faudree, R. J. and 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. +- [ErRo93] Erdős, P. and Rousseau, C. C., The size Ramsey number of a complete bipartite graph. + Discrete Math. (1993), 259-262. +- [EFRS78b] Erdős, P. and Faudree, R. J. and Rousseau, C. C. and Schelp, R. H., The size Ramsey + number. Period. Math. Hungar. (1978), 145-161. +- [NeRo78] Nešetřil, J. and Rödl, V., The structure of critical Ramsey graphs. + Acta Math. Acad. Sci. Hungar. (1978), 295-300. +- [CFW23] Conlon, D. and Fox, J. and Wigderson, Y., Three early problems on size Ramsey numbers. + Combinatorica (2023), 743-768. +-/ + +@[expose] public section + +namespace Erdos560 + +open Filter SimpleGraph +open scoped Asymptotics + +local notation "r̂(" n ")" => + sizeRamsey (completeBipartiteGraph (Fin n) (Fin n)) + (completeBipartiteGraph (Fin n) (Fin n)) + +def erdos_560.answer : ℕ → ℕ := sorry + +/-- +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. +-/ +@[category research open, question value, AMS 5] +theorem erdos_560 : erdos_560.answer = (fun n : ℕ ↦ r̂(n)) := by + sorry + +/-- +The lower bound (which holds for $n\geq 6$) was proved by Erdős and Rousseau [ErRo93]: +$$\frac{1}{60}n^22^n<\hat{R}(K_{n,n}).$$ +-/ +@[category research solved, AMS 5] +theorem erdos_560.variants.lower_bound : + ∀ (n : ℕ), 6 ≤ n → (1 / 60 : ℝ) * (n : ℝ) ^ 2 * 2 ^ n < r̂(n) := by + sorry + +/-- +The upper bound was proved by Erdős, Faudree, Rousseau, and Schelp [EFRS78b] and Nešetřil +and Rödl [NeRo78]: +$$\hat{R}(K_{n,n})<\frac{3}{2}n^32^n.$$ +We require $n\geq 1$ because the strict inequality fails for the empty graph. +-/ +@[category research solved, AMS 5] +theorem erdos_560.variants.upper_bound : + ∀ (n : ℕ), 1 ≤ n → (r̂(n) : ℝ) < (3 / 2 : ℝ) * (n : ℝ) ^ 3 * 2 ^ n := by + sorry + +/-- +Conlon, Fox, and Wigderson [CFW23] conjecture that +$$\hat{R}(K_{s,t})\asymp s^2t2^s$$ +for all $s\leq t$, and so in particular we should have +$$\hat{R}(K_{n,n})\asymp n^32^n.$$ +-/ +@[category research open, AMS 5] +theorem erdos_560.variants.conlon_fox_wigderson : + (fun n : ℕ ↦ (r̂(n) : ℝ)) =Θ[atTop] (fun n : ℕ ↦ (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 0000000..bcbe907 --- /dev/null +++ b/FormalConjectures/ErdosProblems/561.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 561 + +*References:* +- [erdosproblems.com/561](https://www.erdosproblems.com/561) +- [BEFRS78] Burr, S. A. and Erdős, P. and Faudree, R. J. and Rousseau, C. C. and Schelp, R. H., + Ramsey-minimal graphs for multiple copies. Nederl. Akad. Wetensch. Indag. Math. (1978), 187-195. +-/ + +@[expose] public section + +namespace Erdos561 + +open SimpleGraph + +/-- `F(s,n)` is the disjoint union of the stars $K_{1,n_i}$. The vertex $(i,0)$ is the center +of component $i$; its other $n_i$ vertices are leaves. -/ +local notation "F(" s ", " n ")" => + fromRel (fun (u v : Σ i : Fin s, Fin (n i + 1)) ↦ + Sigma.fst u = Sigma.fst v ∧ + (Fin.val (Sigma.snd u) = 0 ∨ Fin.val (Sigma.snd v) = 0)) + +/-- +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$. + +Let $F_1$ and $F_2$ be the union of stars. More precisely, let +$F_1=\cup_{i\leq s}K_{1,n_i}$ and $F_2=\cup_{j\leq t}K_{1,m_j}$ with +$n_1\geq\cdots\geq n_s\geq1$ and $m_1\geq\cdots\geq m_t\geq1$. Prove that +$$\hat{R}(F_1,F_2)=\sum_{2\leq k\leq s+t}l_k$$ +where +$$l_k=\max\{n_i+m_j-1:i+j=k\}.$$ + +The unions are vertex-disjoint, and $s,t\geq1$. Lean indices start at zero, so the condition +$i+j=k$ is represented by $(i+1)+(j+1)=k$. +-/ +@[category research open, AMS 5] +theorem erdos_561 : + ∀ (s t : ℕ), 1 ≤ s → 1 ≤ t → + ∀ (n : Fin s → ℕ) (m : Fin t → ℕ), + Antitone n → Antitone m → (∀ i, 1 ≤ n i) → (∀ j, 1 ≤ m j) → + sizeRamsey F(s, n) F(t, m) = + ∑ k ∈ Finset.Icc 2 (s + t), + ((Finset.univ : Finset (Fin s × Fin t)).filter + (fun p ↦ (p.1.val + 1) + (p.2.val + 1) = k)).sup + (fun p ↦ n p.1 + m p.2 - 1) := by + sorry + +end Erdos561 diff --git a/FormalConjectures/ErdosProblems/562.lean b/FormalConjectures/ErdosProblems/562.lean index fd7acee..6456be1 100644 --- a/FormalConjectures/ErdosProblems/562.lean +++ b/FormalConjectures/ErdosProblems/562.lean @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil /-! # Erdős Problem 562 @@ -21,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/562](https://www.erdosproblems.com/562) -/ +@[expose] public section + open Combinatorics Filter Real open scoped Asymptotics @@ -35,8 +39,8 @@ Prove that, for $r \ge 3$, $$ \log_{r-1} R_r(n) \asymp_r n, $$ where $\log_{r-1}$ denotes the $(r-1)$-fold iterated logarithm. -/ -@[category research open, AMS 5] -theorem erdos_562 : answer(sorry) ↔ +@[category research open, question, AMS 5] +theorem erdos_562 : ∀ r ≥ 3, (fun n ↦ log^[r - 1] (hypergraphRamsey r n)) =Θ[atTop] (fun n ↦ (n : ℝ)) := by sorry diff --git a/FormalConjectures/ErdosProblems/563.lean b/FormalConjectures/ErdosProblems/563.lean new file mode 100644 index 0000000..d2e6ccb --- /dev/null +++ b/FormalConjectures/ErdosProblems/563.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 563 + +*References:* +- [erdosproblems.com/563](https://www.erdosproblems.com/563) +- [Er90b] Erdős, Paul, Problems and results on graphs and hypergraphs: similarities and differences. + Mathematics of Ramsey theory (1990), 12-28. +-/ + +@[expose] public section + +open Filter + +namespace Erdos563 + +open scoped Classical in +/-- +A 2-coloring of $K_n$ (represented by graph $G$ on $\mathrm{Fin}\; n$) is balanced on subsets +of size at least $m$ with parameter $\alpha$ if every $X \subseteq [n]$ with $|X| \geq m$ +contains more than $\alpha \binom{|X|}{2}$ edges of each color. +-/ +def HasBalancedSubsets (n : ℕ) (m : ℕ) (α : ℝ) (G : SimpleGraph (Fin n)) : Prop := + ∀ (X : Finset (Fin n)), m ≤ X.card → + α * (X.card.choose 2 : ℝ) < ((G.induce (X : Set (Fin n))).edgeFinset.card : ℝ) ∧ + ((G.induce (X : Set (Fin n))).edgeFinset.card : ℝ) < (1 - α) * (X.card.choose 2 : ℝ) + +open scoped Classical in +/-- +$F(n,\alpha)$ is the smallest $m$ such that there exists a 2-coloring of the edges of $K_n$ +so that every $X\subseteq [n]$ with $|X|\geq m$ contains more than $\alpha\binom{|X|}{2}$ +edges of each color. +-/ +noncomputable def F (n : ℕ) (α : ℝ) : ℕ := + sInf {m | ∃ (G : SimpleGraph (Fin n)), HasBalancedSubsets n m α G} + +/-- +Let $F(n,\alpha)$ denote the smallest $m$ such that there exists a $2$-colouring of the edges of +$K_n$ so that every $X\subseteq [n]$ with $\lvert X\rvert\geq m$ contains more than +$\alpha \binom{\lvert X\rvert}{2}$ many edges of each colour. + +Prove that, for every $0\leq \alpha < 1/2$, +$$F(n,\alpha)\sim c_\alpha\log n$$ +for some constant $c_\alpha$ depending only on $\alpha$. + +This problem is #39 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, AMS 5] +theorem erdos_563 : + ∀ (α : ℝ), 0 ≤ α → α < 1 / 2 → + ∃ (c : ℝ), 0 < c ∧ + Tendsto (fun n : ℕ => (F n α : ℝ) / Real.log n) atTop (nhds c) := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos563 diff --git a/FormalConjectures/ErdosProblems/564.lean b/FormalConjectures/ErdosProblems/564.lean index e977bbc..3e924ad 100644 --- a/FormalConjectures/ErdosProblems/564.lean +++ b/FormalConjectures/ErdosProblems/564.lean @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil /-! # Erdős Problem 564 @@ -21,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/564](https://www.erdosproblems.com/564) -/ +@[expose] public section + namespace Erdos564 open Combinatorics Real Filter @@ -33,9 +37,9 @@ hypergraph on $n$ vertices. Is there some constant $c>0$ such that $$ R_3(n) \geq 2^{2^{cn}}? $$ -/ -@[category research open, AMS 5] -theorem erdos_564 : answer(sorry) ↔ - ∃ c > 0, ∀ᶠ n in atTop, (2 : ℝ)^(2 : ℝ)^(c * n) ≤ hypergraphRamsey 3 n := by +@[category research open, question, AMS 5] +theorem erdos_564 : + ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, (2 : ℝ) ^ (2 : ℝ) ^ (c * n) ≤ hypergraphRamsey 3 n := by sorry end Erdos564 diff --git a/FormalConjectures/ErdosProblems/566.lean b/FormalConjectures/ErdosProblems/566.lean index 0db6681..5541660 100644 --- a/FormalConjectures/ErdosProblems/566.lean +++ b/FormalConjectures/ErdosProblems/566.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 566 @@ -25,28 +26,24 @@ import FormalConjecturesUtil Combin. Probab. Comput. (1993), 389-399. -/ +@[expose] public section + namespace Erdos566 open SimpleGraph /-- Let $G$ be such that any subgraph on $k$ vertices has at most $2k-3$ edges. -Is it true that, if $H$ has $m$ edges and no isolated vertices, then $\hat{r}(G,H) \ll m$? +Is it true that, if $H$ has $m$ edges and no isolated vertices, then $R(G,H) \ll m$? In other words: if $G$ is sparse (every induced subgraph on $k$ vertices has $≤ 2k-3$ edges), is $G$ Ramsey size linear? -/ -@[category research open, AMS 5] -theorem erdos_566 : answer(sorry) ↔ +@[category research open, question, AMS 5] +theorem erdos_566 : ∀ (p : ℕ) (G : SimpleGraph (Fin p)), - -- G is sparse: every induced subgraph on k ≥ 2 vertices has ≤ 2k - 3 edges (∀ S : Finset (Fin p), 2 ≤ S.card → (G.induce S).edgeSet.ncard ≤ 2 * S.card - 3) → - -- Then G is Ramsey size linear - ∃ c > (0 : ℝ), ∀ (n : ℕ) (H : SimpleGraph (Fin n)) [DecidableRel H.Adj], - -- H has no isolated vertices - (∀ v, 0 < H.degree v) → - -- r̂(G,H) ≤ c · m - (sizeRamsey G H : ℝ) ≤ c * H.edgeSet.ncard := by + G.IsRamseySizeLinear := by sorry end Erdos566 diff --git a/FormalConjectures/ErdosProblems/567.lean b/FormalConjectures/ErdosProblems/567.lean index 6b8bf6b..f7159b8 100644 --- a/FormalConjectures/ErdosProblems/567.lean +++ b/FormalConjectures/ErdosProblems/567.lean @@ -13,15 +13,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 567 Let $G$ be either $Q_3$ or $K_{3,3}$ or $H_5$ (the last formed by adding two vertex-disjoint chords to $C_5$). Is it true that, if $H$ has $m$ edges and no isolated vertices, then -$$ \hat{r}(G,H) \ll m? $$ +$$ R(G,H) \ll m? $$ In other words, is $G$ Ramsey size linear? A special case of Problem 566. @@ -31,6 +32,8 @@ In other words, is $G$ Ramsey size linear? A special case of Problem 566. Combin. Probab. Comput. (1993), 389-399. -/ +@[expose] public section + namespace Erdos567 open SimpleGraph @@ -53,8 +56,8 @@ def H5 : SimpleGraph (Fin 5) := Is $Q_3$ (the 3-dimensional hypercube) Ramsey size linear? -/ -@[category research open, AMS 5] -theorem erdos_567.parts.i : answer(sorry) ↔ IsRamseySizeLinear Q3 := by +@[category research open, question, AMS 5] +theorem erdos_567.parts.i : IsRamseySizeLinear Q3 := by sorry /-- @@ -62,8 +65,8 @@ theorem erdos_567.parts.i : answer(sorry) ↔ IsRamseySizeLinear Q3 := by Is $K_{3,3}$ Ramsey size linear? -/ -@[category research open, AMS 5] -theorem erdos_567.parts.ii : answer(sorry) ↔ IsRamseySizeLinear K33 := by +@[category research open, question, AMS 5] +theorem erdos_567.parts.ii : IsRamseySizeLinear K33 := by sorry /-- @@ -71,8 +74,8 @@ theorem erdos_567.parts.ii : answer(sorry) ↔ IsRamseySizeLinear K33 := by Is $H_5$ ($C_5$ with two vertex-disjoint chords) Ramsey size linear? -/ -@[category research open, AMS 5] -theorem erdos_567.parts.iii : answer(sorry) ↔ IsRamseySizeLinear H5 := by +@[category research open, question, AMS 5] +theorem erdos_567.parts.iii : IsRamseySizeLinear H5 := by sorry end Erdos567 diff --git a/FormalConjectures/ErdosProblems/568.lean b/FormalConjectures/ErdosProblems/568.lean new file mode 100644 index 0000000..6e825c9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/568.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 568 + +*References:* +- [erdosproblems.com/568](https://www.erdosproblems.com/568) +- [EFRS93] Erdős, P. and Faudree, R. J. and Rousseau, C. C. and Schelp, R. H., Ramsey size linear + graphs. Combin. Probab. Comput. (1993), 389-399. +-/ + +@[expose] public section + +namespace Erdos568 + +/-- +Let $G$ be a graph such that $R(G,T_n)\ll n$ for any tree $T_n$ on $n$ vertices and +$R(G,K_n)\ll n^2$. Is it true that, for any $H$ with $m$ edges and no isolated vertices, +$$R(G,H)\ll m?$$ + +In other words, is $G$ Ramsey size linear? + +This problem is #33 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, question, AMS 5] +theorem erdos_568 : + ∀ (V : Type) [Fintype V] (G : SimpleGraph V), + (∃ c₁ > (0 : ℝ), ∀ (n : ℕ) (T : SimpleGraph (Fin n)), + T.IsTree → (SimpleGraph.graphRamsey G T : ℝ) ≤ c₁ * n) → + (∃ c₂ > (0 : ℝ), ∀ (n : ℕ), + (SimpleGraph.graphRamsey G (SimpleGraph.completeGraph (Fin n)) : ℝ) ≤ c₂ * (n : ℝ) ^ 2) → + G.IsRamseySizeLinear := by + sorry + +end Erdos568 diff --git a/FormalConjectures/ErdosProblems/569.lean b/FormalConjectures/ErdosProblems/569.lean new file mode 100644 index 0000000..44b3cee --- /dev/null +++ b/FormalConjectures/ErdosProblems/569.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 569 + +*References:* +- [erdosproblems.com/569](https://www.erdosproblems.com/569) +- [EFRS93] Erdős, Paul and Faudree, R. J. and Rousseau, C. C. and Schelp, R. H., Ramsey size linear + graphs. Combin. Probab. Comput. (1993), 389-399. +-/ + +@[expose] public section + +namespace Erdos569 + +def erdos_569.answer : ℕ → ℝ := sorry + +/-- +Let $k\geq 1$. What is the best possible $c_k$ such that +$$R(C_{2k+1},H)\leq c_k m$$ +for any graph $H$ on $m$ edges without isolated vertices? + +This problem is #34 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, question value, AMS 5] +theorem erdos_569 : + ∀ (k : ℕ) (hk : 1 ≤ k), + sInf {C : ℝ | 0 < C ∧ + ∀ (m : ℕ) (W : Type) [Fintype W] (H : SimpleGraph W) [DecidableRel H.Adj], + (∀ v, 0 < H.degree v) → + H.edgeSet.ncard = m → + (SimpleGraph.graphRamsey (SimpleGraph.cycleGraph (2 * k + 1)) H : ℝ) ≤ C * m} = + erdos_569.answer k := by + sorry + +end Erdos569 diff --git a/FormalConjectures/ErdosProblems/572.lean b/FormalConjectures/ErdosProblems/572.lean new file mode 100644 index 0000000..96ce570 --- /dev/null +++ b/FormalConjectures/ErdosProblems/572.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 572 + +*References:* +- [erdosproblems.com/572](https://www.erdosproblems.com/572) +- [Er64c] Erdős, P., Extremal problems in graph theory. Theory of Graphs and its + Applications (1964), 29-36. +- [BoSi74] Bondy, J. A. and Simonovits, M., Cycles of even length in graphs. + J. Combin. Theory Ser. B (1974), 97-105. +- [LUW95] Lazebnik, F., Ustimenko, V. A. and Woldar, A. J., A new series of dense graphs + of high girth. Bull. Amer. Math. Soc. (N.S.) (1995), 73-79. +-/ + +@[expose] public section + +open Filter + +namespace Erdos572 + +/-- +Show that for $k\geq 3$ +$$\mathrm{ex}(n;C_{2k})\gg n^{1+\frac{1}{k}}.$$ + +This problem is #46 in Extremal Graph Theory in the graphs problem collection. +-/ +@[category research open, AMS 5] +theorem erdos_572 (k : ℕ) (hk : 3 ≤ k) : + ∃ c > (0 : ℝ), ∀ᶠ (n : ℕ) in atTop, + c * (n : ℝ) ^ (1 + 1 / (k : ℝ)) ≤ + (SimpleGraph.extremalNumber n (SimpleGraph.cycleGraph (2 * k)) : ℝ) := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos572 diff --git a/FormalConjectures/ErdosProblems/573.lean b/FormalConjectures/ErdosProblems/573.lean new file mode 100644 index 0000000..4deef41 --- /dev/null +++ b/FormalConjectures/ErdosProblems/573.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 573 + +*References:* +- [erdosproblems.com/573](https://www.erdosproblems.com/573) +- [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. +- [Er75] Erdős, P., *Some recent progress on extremal problems in graph theory*. Congr. Numer. + (1975), 3-14. +- [ErSi82] Erdős, P. and Simonovits, M., *Compactness results in extremal graph theory*. + Combinatorica (1982), 275-288. +- [Er93] Erdős, Paul, *Some of my favorite solved and unsolved problems in graph theory*. + Quaestiones Math. (1993), 333-350. +- [KST54] Kővári, T. and Sós, V. T. and Turán, P., *On a problem of K. Zarankiewicz*. + Colloq. Math. (1954), 50-57. +-/ + +@[expose] public section + +open Filter Asymptotics SimpleGraph + +namespace Erdos573 + +open scoped Classical in +/-- $\mathrm{ex}(n;\{C_k : k \in L\})$: the greatest number of edges of a simple graph on `n` +vertices that contains no cycle $C_k$ with $k \in L$ as a (not necessarily induced) subgraph. + +`cycleGraph k` is the cycle on `Fin k`. The definition is meaningful only for sets `L` of +lengths `k ≥ 3`, which are the only ones used below: `cycleGraph 0` and `cycleGraph 1` have no +edges, and `cycleGraph 2` is a single edge. -/ +noncomputable def cycleExtremalNumber (L : Set ℕ) (n : ℕ) : ℕ := + (Finset.univ.filter fun G : SimpleGraph (Fin n) => ∀ k ∈ L, (cycleGraph k).Free G).sup + fun G => G.edgeFinset.card + +/-- +Is it true that +$$\mathrm{ex}(n;\{C_3,C_4\})\sim (n/2)^{3/2}?$$ + +A problem of Erdős and Simonovits. This problem is asking whether the threshold is the same as +for forbidding $C_4$ and all odd cycles (see `erdos_573.variants.kst`) if one only forbids the odd +cycle of length $3$. See also [574] for the general case, and [765] for $\mathrm{ex}(n;C_4)$. + +This problem is #48 in Extremal Graph Theory in the graphs problem collection. +-/ +@[category research open, question, AMS 5] +theorem erdos_573 : + (fun n : ℕ ↦ (cycleExtremalNumber {3, 4} n : ℝ)) ~[atTop] + fun n : ℕ ↦ ((n : ℝ) / 2) ^ (3 / 2 : ℝ) := by + sorry + +/-- +Erdős and Simonovits [ErSi82] proved that +$$\mathrm{ex}(n;\{C_4,C_5\})=(n/2)^{3/2}+O(n).$$ + +The source writes an equality; only the upper bound is stated here. +-/ +@[category research solved, AMS 5] +theorem erdos_573.variants.c4_c5 : + ∃ C : ℝ, ∀ᶠ n : ℕ in atTop, + (cycleExtremalNumber {4, 5} n : ℝ) ≤ ((n : ℝ) / 2) ^ (3 / 2 : ℝ) + C * n := by + sorry + +/-- +Kővári, Sós, and Turán [KST54] proved that the extremal number of edges for containing either +$C_4$ or an odd cycle of any length is $\sim (n/2)^{3/2}$, that is, +$$\mathrm{ex}(n;\{C_4, C_3, C_5, C_7, \ldots\})\sim (n/2)^{3/2}.$$ +Equivalently, the maximum number of edges of a bipartite $C_4$-free graph on $n$ vertices is +$\sim (n/2)^{3/2}$. The attribution follows erdosproblems.com; the matching lower bound comes from +finite-geometry constructions. +-/ +@[category research solved, AMS 5] +theorem erdos_573.variants.kst : + (fun n : ℕ ↦ (cycleExtremalNumber ({4} ∪ {k | Odd k ∧ 3 ≤ k}) n : ℝ)) ~[atTop] + fun n : ℕ ↦ ((n : ℝ) / 2) ^ (3 / 2 : ℝ) := by + sorry + +end Erdos573 diff --git a/FormalConjectures/ErdosProblems/583.lean b/FormalConjectures/ErdosProblems/583.lean new file mode 100644 index 0000000..5edd5ed --- /dev/null +++ b/FormalConjectures/ErdosProblems/583.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 583 + +*References:* +- [erdosproblems.com/583](https://www.erdosproblems.com/583) +- [AnBa23] Anto, Nevil and Basavaraju, Manu, *Gallai's path decomposition for 2-degenerate graphs*. + Discrete Math. Theor. Comput. Sci. (2023), Paper No. 16, 11. +- [BBB21] A. Blanché, M. Bonamy, and N. Bonichon, *Gallai's path decomposition in planar graphs*. + arXiv:2110.08870 (2021). +- [BoPe19] Bonamy, Marthe and Perrett, Thomas J., *Gallai's path decomposition conjecture for graphs + of small maximum degree*. Discrete Math. (2019), 1293--1299. +- [CFZ26] Chu, Yanan and Fan, Genghua and Zhou, Chuixiang, *Gallai's conjecture and the path number + of odd semi-cliques*. Discrete Math. (2026), Paper No. 114725, 6. +- [Ch78] Chung, F. R. K., *On partitions of graphs into trees*. Discrete Math. (1978), 23-30. +- [DeKo00] Dean, Nathaniel and Kouider, Mekkia, *Gallai's conjecture for disconnected graphs*. + Discrete Math. (2000), 43--54. +- [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. +- [Fa02] Fan, Genghua, *Subgraph coverings and edge switchings*. J. Combin. Theory Ser. B (2002), + 54-83. +- [Lo68] Lovász, L., *On covering of graphs*. Theory of Graphs (Proc. Colloq., Tihany, 1966) (1968), + 231-236. +- [Py96] Pyber, L., *Covering the edges of a connected graph by paths*. J. Combin. Theory Ser. B + (1996), 152-159. +-/ + +@[expose] public section + +open SimpleGraph + +namespace Erdos583 + +/-- +A subgraph `H` of `G` is a path subgraph if it is the subgraph traced out by a path in `G`, +i.e. a walk with no repeated vertices. +-/ +def IsPathSubgraph {V : Type*} {G : SimpleGraph V} (H : G.Subgraph) : Prop := + ∃ (u v : V) (p : G.Walk u v), p.IsPath ∧ H = p.toSubgraph + +/-- +Every connected graph on $n$ vertices can be partitioned into at most $\lceil n/2\rceil$ +edge-disjoint paths. + +A problem of Erdős and Gallai. +-/ +@[category research open, AMS 5] +theorem erdos_583 {V : Type*} [Fintype V] (G : SimpleGraph V) (hG : G.Connected) : + ∃ D : Finset G.Subgraph, + (∀ H ∈ D, IsPathSubgraph H) ∧ + IsDecomposition G D ∧ + D.card ≤ ⌈(Fintype.card V : ℚ) / 2⌉₊ := by + sorry + +end Erdos583 diff --git a/FormalConjectures/ErdosProblems/588.lean b/FormalConjectures/ErdosProblems/588.lean new file mode 100644 index 0000000..30ab55c --- /dev/null +++ b/FormalConjectures/ErdosProblems/588.lean @@ -0,0 +1,159 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 588 + +*References:* +- [erdosproblems.com/588](https://www.erdosproblems.com/588) +- [BGS74] Burr, Stefan A. and Grünbaum, Branko and Sloane, N. J. A., *The orchard problem*. + Geometriae Dedicata (1974), 397-424. +- [Er84] Erdős, P., *Research problems*. Period. Math. Hungar. (1984), 101-103. +- [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, Branko, *New views on some old questions of combinatorial geometry*. + Colloquio Internazionale sulle Teorie Combinatorie (Roma, 1973), Tomo I (1976), 451-468. +- [Ka63] Kárteszi, F., *Sylvester egy tételéről és Erdős egy sejtéséről*. Matematikai Lapok + (1963), 3-10. +- [SoSt13] Solymosi, József and Stojaković, Miloš, *Many collinear $k$-tuples with no $k+1$ + collinear points*. Discrete Comput. Geom. (2013), 811-820. +-/ + +@[expose] public section + +open EuclideanGeometry Filter Asymptotics + +namespace Erdos588 + +/-- +`numLinesWithPointsMax k n` is $f_k(n)$: the maximum number of lines containing exactly $k$ +points among all sets $S$ of $n$ points in $\mathbb{R}^2$ with no $k + 1$ points on a line. + +Since $S$ has no $k + 1$ points on a line, the lines with at least $k$ points of $S$ are exactly +the lines with exactly $k$ points of $S$. The definition follows Erdős Problem 101 (the case +$k = 4$). +-/ +noncomputable def numLinesWithPointsMax (k n : ℕ) : ℕ := + sSup {((linesWithPointsFor k S).ncard) | (S : Set ℝ²) + (_ : S.ncard = n) (_ : S.Finite) (_ : NonCollinearFor (k + 1) S)} + +/-- +Let $f_k(n)$ be minimal such that if $n$ points in $\mathbb{R}^2$ have no $k+1$ points on a line +then there must be at most $f_k(n)$ many lines containing at least $k$ points. Is it true that +$$f_k(n) = o(n^2)$$ +for $k \geq 4$? + +The case $k = 4$ is Erdős Problem 101. The restriction $k \geq 4$ is needed: see +`Erdos588.erdos_588.variants.three_not_isLittleO`. +-/ +@[category research open, question, AMS 52] +theorem erdos_588 : + ∀ k : ℕ, 4 ≤ k → + (fun n : ℕ ↦ (numLinesWithPointsMax k n : ℝ)) =o[atTop] (fun n : ℕ ↦ (n : ℝ) ^ 2) := by + sorry + +/-- +The trivial upper bound, by counting pairs of points: for $k \geq 2$, +$$f_k(n) \cdot k(k-1) \leq n(n-1).$$ +-/ +@[category textbook, AMS 52, formal_proof using lean4 at + "https://github.com/veljjanoski/formal-conjectures-proofs/blob/a199537b29d77124f8e1ea0d816a881e96f0cc0f/FcProofs/Erdos588.lean#L81"] +theorem erdos_588.variants.trivial_upper (k n : ℕ) (hk : 2 ≤ k) : + numLinesWithPointsMax k n * (k * (k - 1)) ≤ n * (n - 1) := by + sorry + +/-- +Sylvester showed (see [BGS74]) that +$$f_3(n) = \frac{n^2}{6} + O(n).$$ + +The upper bound $f_3(n) \leq n(n-1)/6$ is `Erdos588.erdos_588.variants.trivial_upper` with +$k = 3$. The lower bound comes from a construction on a cubic curve. +-/ +@[category research solved, AMS 52] +theorem erdos_588.variants.sylvester : + (fun n : ℕ ↦ (numLinesWithPointsMax 3 n : ℝ) - (n : ℝ) ^ 2 / 6) =O[atTop] + (fun n : ℕ ↦ (n : ℝ)) := by + sorry + +/-- +Burr, Grünbaum, and Sloane [BGS74] and Füredi and Palásti [FuPa84] gave constructions which +show that +$$f_3(n) \geq \left(\frac{1}{6} + o(1)\right) n^2.$$ +-/ +@[category research solved, AMS 52] +theorem erdos_588.variants.three_lower : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (1 / 6 - ε) * (n : ℝ) ^ 2 ≤ (numLinesWithPointsMax 3 n : ℝ) := by + sorry + +/-- +The restriction to $k \geq 4$ in `Erdos588.erdos_588` is necessary: $f_3(n)$ is not $o(n^2)$. +This follows from `Erdos588.erdos_588.variants.sylvester`. +-/ +@[category research solved, AMS 52] +theorem erdos_588.variants.three_not_isLittleO : + ¬ (fun n : ℕ ↦ (numLinesWithPointsMax 3 n : ℝ)) =o[atTop] (fun n : ℕ ↦ (n : ℝ) ^ 2) := by + sorry + +/-- +Kárteszi [Ka63] proved that for $k \geq 4$, +$$f_k(n) \gg_k n \log n,$$ +resolving a conjecture of Erdős that $f_k(n)/n \to \infty$. +-/ +@[category research solved, AMS 52] +theorem erdos_588.variants.karteszi : + ∀ k : ℕ, 4 ≤ k → ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + c * (n : ℝ) * Real.log (n : ℝ) ≤ (numLinesWithPointsMax k n : ℝ) := by + sorry + +/-- +Grünbaum [Gr76] proved that for $k \geq 4$, +$$f_k(n) \gg_k n^{1 + \frac{1}{k-2}}.$$ +-/ +@[category research solved, AMS 52] +theorem erdos_588.variants.grunbaum : + ∀ k : ℕ, 4 ≤ k → ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + c * (n : ℝ) ^ (1 + 1 / ((k : ℝ) - 2)) ≤ (numLinesWithPointsMax k n : ℝ) := by + sorry + +/-- +Solymosi and Stojaković [SoSt13] proved that for $k \geq 4$, +$$f_k(n) \gg_k n^{2 - O_k(1/\sqrt{\log n})}.$$ +-/ +@[category research solved, AMS 52] +theorem erdos_588.variants.solymosi_stojakovic : + ∀ k : ℕ, 4 ≤ k → ∃ c > (0 : ℝ), ∃ C > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + c * (n : ℝ) ^ (2 - C / Real.sqrt (Real.log (n : ℝ))) ≤ + (numLinesWithPointsMax k n : ℝ) := by + sorry + +/-- +Erdős speculated that Grünbaum's bound $n^{1 + \frac{1}{k-2}}$ may be the correct order of +magnitude of $f_k(n)$ for $k \geq 4$. This is false: by +`Erdos588.erdos_588.variants.solymosi_stojakovic` [SoSt13], for every $k \geq 4$ we have +$f_k(n) \neq O(n^{1 + \frac{1}{k-2}})$. +-/ +@[category research solved, AMS 52] +theorem erdos_588.variants.grunbaum_order : + ∀ k : ℕ, 4 ≤ k → + ¬ (fun n : ℕ ↦ (numLinesWithPointsMax k n : ℝ)) =O[atTop] + (fun n : ℕ ↦ (n : ℝ) ^ (1 + 1 / ((k : ℝ) - 2))) := by + sorry + +end Erdos588 diff --git a/FormalConjectures/ErdosProblems/59.lean b/FormalConjectures/ErdosProblems/59.lean new file mode 100644 index 0000000..bc41630 --- /dev/null +++ b/FormalConjectures/ErdosProblems/59.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 59 + +*References:* +- [erdosproblems.com/59](https://www.erdosproblems.com/59) +- [EFR86] Erdős, P., Frankl, P. and Rödl, V., *The asymptotic number of graphs not containing a + fixed subgraph and a problem for hypergraphs having no exponent*. Graphs Combin. (1986), + 113-121. +- [MoSa16] Morris, R. and Saxton, D., *The number of $C_{2\ell}$-free graphs*. Adv. Math. (2016), + 534-580. [arXiv:1309.2927](https://arxiv.org/abs/1309.2927) +- [Va99] Various, *Some of Paul's favorite problems*. Booklet produced for the conference "Paul + Erdős and his mathematics", Budapest, July 1999 (1999). +-/ + +@[expose] public section + +open Filter SimpleGraph + +namespace Erdos59 + +/-- `numFree H n` is the number of labelled graphs on the vertex set `Fin n` which do not +contain `H` as a subgraph. -/ +noncomputable def numFree {k : ℕ} (H : SimpleGraph (Fin k)) (n : ℕ) : ℕ := + {G : SimpleGraph (Fin n) | H.Free G}.ncard + +/-- If `H` has an edge, the empty graph on `Fin n` is `H`-free, so `numFree H n` is positive. -/ +@[category API, AMS 5] +theorem numFree_pos {k : ℕ} {H : SimpleGraph (Fin k)} (hH : H ≠ ⊥) (n : ℕ) : + 0 < numFree H n := by + unfold numFree + exact (Set.ncard_pos (Set.toFinite _)).2 ⟨⊥, SimpleGraph.free_bot hH⟩ + +/-- +Is it true that the number of graphs on $n$ vertices which do not contain $G$ is +$$\leq 2^{(1+o(1))\mathrm{ex}(n;G)}?$$ + +The answer is no, already for $G=C_6$ (see `erdos_59.variants.morris_saxton`). Graphs are +labelled, and $G$ ranges over finite graphs containing a cycle, as in [MoSa16]; for some forests +the answer is trivially no (for the path with two edges the free graphs include all matchings, +about $2^{\Theta(n\log n)}$ of them). +-/ +@[category research solved, question, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos59.lean#L46"] +theorem erdos_59 : + ¬ ∀ (k : ℕ) (H : SimpleGraph (Fin k)), ¬ H.IsAcyclic → + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (numFree H n : ℝ) ≤ (2 : ℝ) ^ ((1 + ε) * (extremalNumber n H : ℝ)) := by + sorry + +/-- +If $G$ is not bipartite the answer is yes, proved by Erdős, Frankl, and Rödl [EFR86]. +-/ +@[category research solved, AMS 5] +theorem erdos_59.variants.erdos_frankl_rodl {k : ℕ} (H : SimpleGraph (Fin k)) + (hH : ¬ H.IsBipartite) : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (numFree H n : ℝ) ≤ (2 : ℝ) ^ ((1 + ε) * (extremalNumber n H : ℝ)) := by + sorry + +/-- +The answer is no for $G=C_6$, the cycle on 6 vertices. Morris and Saxton [MoSa16, Proposition +1.4] have proved there are at least +$$2^{(1+c)\mathrm{ex}(n;C_6)}$$ +such graphs for infinitely many $n$, for some constant $c>0$. +-/ +@[category research solved, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos59.lean#L46"] +theorem erdos_59.variants.morris_saxton : + ∃ c : ℝ, 0 < c ∧ ∃ᶠ n : ℕ in atTop, + (2 : ℝ) ^ ((1 + c) * (extremalNumber n (cycleGraph 6) : ℝ)) ≤ + (numFree (cycleGraph 6) n : ℝ) := by + sorry + +/-- +In [Va99] the specific case of $G=C_4$ is also asked. +-/ +@[category research open, question, AMS 5] +theorem erdos_59.variants.c4 : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (numFree (cycleGraph 4) n : ℝ) ≤ + (2 : ℝ) ^ ((1 + ε) * (extremalNumber n (cycleGraph 4) : ℝ)) := by + sorry + +/-- +It is still possible (and conjectured by Morris and Saxton) that the weaker bound of +$$2^{O(\mathrm{ex}(n;G))}$$ +holds for all $G$ containing a cycle. +-/ +@[category research open, AMS 5] +theorem erdos_59.variants.big_o : + ∀ (k : ℕ) (H : SimpleGraph (Fin k)), ¬ H.IsAcyclic → + ∃ C : ℝ, 0 < C ∧ ∀ᶠ n : ℕ in atTop, + (numFree H n : ℝ) ≤ (2 : ℝ) ^ (C * (extremalNumber n H : ℝ)) := by + sorry + +end Erdos59 diff --git a/FormalConjectures/ErdosProblems/592.lean b/FormalConjectures/ErdosProblems/592.lean index 82ac530..6c3198c 100644 --- a/FormalConjectures/ErdosProblems/592.lean +++ b/FormalConjectures/ErdosProblems/592.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 592 @@ -22,19 +23,23 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/592](https://www.erdosproblems.com/592) -/ +@[expose] public section + open Cardinal Ordinal namespace Erdos592 universe u +def erdos_592.answer : Ordinal.{u} → Prop := sorry + /-- Determine which countable ordinals $β$ have the property that, if $α = \omega^β$, then in any red/blue colouring of the edges of $K_α$ there is either a red $K_α$ or a blue $K_3$. -/ -@[category research open, AMS 3] +@[category research open, question value, AMS 3] theorem erdos_592 (β : Ordinal.{u}) : β.card ≤ ℵ₀ → - OrdinalCardinalRamsey (ω ^ β) (ω ^ β) 3 ↔ (answer(sorry) : Ordinal.{u} → Prop) β := by + (OrdinalCardinalRamsey (ω ^ β) (ω ^ β) 3 ↔ erdos_592.answer β) := by sorry -- TODO(firsching): add condition by Galvin and Larson. diff --git a/FormalConjectures/ErdosProblems/593.lean b/FormalConjectures/ErdosProblems/593.lean index 5480abc..732d1dc 100644 --- a/FormalConjectures/ErdosProblems/593.lean +++ b/FormalConjectures/ErdosProblems/593.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 593 @@ -27,77 +28,95 @@ import FormalConjecturesUtil birthday), Vol. I. Colloq. Math. Soc. János Bolyai 10, North-Holland (1975), 425–513. - [Er95d] Erdős, Paul, Some of my favourite problems in various branches of combinatorics. Matematiche (Catania) 47 (1992), no. 2, 231–240 (1995). +- [EHR73] Erdős, Paul and Hajnal, András and Rothschild, Bruce, On chromatic number of graphs + and set-systems. Cambridge Summer School in Mathematical Logic (Cambridge, 1971), + Lecture Notes in Math. 337, Springer (1973), 531–538. -/ +@[expose] public section + open Cardinal Set SimpleGraph namespace Erdos593 /- ## Main open problem -/ +def erdos_593.answer : Set ((n : ℕ) × UniformHypergraph (Fin n) 3) := sorry + /-- **Erdős Problem 593 (\$500)**: Characterize those finite 3-uniform hypergraphs which appear in every 3-uniform hypergraph of chromatic number $> \aleph_0$. -A natural conjectural characterization, recorded here, is that the obligatory finite 3-uniform -hypergraphs are exactly the 2-colorable ones (Property B). The forward direction -(`IsObligatory → IsTwoColorable`) and converse (`IsTwoColorable → IsObligatory`) are stated as -separate variants below; in the graph case ($r = 2$), Erdős–Galvin–Hajnal [EGH75] proved the -analogous result (obligatory ⇔ bipartite). +The answer is the set of obligatory finite 3-uniform hypergraphs, represented here on the +labelled vertex sets `Fin n`. + +Two-colorability (Property B) is a necessary condition, see +`erdos_593.variants.obligatory_implies_two_colorable`, but it is not sufficient: two triples +sharing a pair form a 2-colorable hypergraph that is not obligatory, see +`erdos_593.variants.common_pair_not_obligatory`. In the graph case ($r = 2$) the problem is +completely solved by Erdős–Galvin–Hajnal [EGH75]: the obligatory graphs are exactly the finite +bipartite graphs. + +A resolution has been claimed by E. Li (arXiv:2606.24882, 2026); at the time of writing +erdosproblems.com still lists the problem as open. -/ -@[category research open, AMS 5] -theorem erdos_593 : answer(sorry) ↔ - ∀ (W : Type) [Fintype W] (F : ThreeUniformHypergraph W), - IsObligatory F ↔ F.IsTwoColorable := by +@[category research open, question value, AMS 5] +theorem erdos_593 : + {p : Σ n : ℕ, UniformHypergraph (Fin n) 3 | p.2.IsObligatory} = erdos_593.answer := by sorry /-- -**Erdős Problem 593 — Necessary direction**: Every obligatory finite 3-uniform -hypergraph is 2-colorable. - -This is the natural necessary condition for the conjectural characterization in `erdos_593`: -if a finite 3-uniform hypergraph `F` is not 2-colorable, one expects to construct a -hypergraph with large chromatic number that contains no copy of `F`. +**Necessary direction**: every obligatory finite 3-uniform hypergraph is 2-colorable. + +This follows from two constructions in [EGH75]. By [EHR73] (see [EGH75, p. 426]) there are +3-uniform hypergraphs of arbitrarily large chromatic number consisting of edge-disjoint +triples, so an obligatory `F` is linear (no two edges share two vertices). By the remark +preceding [EGH75, Theorem 10.9] there are, for every infinite cardinal $\kappa$, 3-uniform +hypergraphs of chromatic number $> \kappa$ all of whose linear sub-hypergraphs are +2-colorable. An obligatory `F` appears in such a hypergraph, hence is 2-colorable. -/ -@[category research open, AMS 5] -theorem erdos_593.variants.obligatory_implies_two_colorable : answer(sorry) ↔ - ∀ (W : Type) [Fintype W] (F : ThreeUniformHypergraph W), - IsObligatory F → F.IsTwoColorable := by +@[category research solved, question, AMS 5] +theorem erdos_593.variants.obligatory_implies_two_colorable : + ∀ (W : Type) [Fintype W] (F : UniformHypergraph W 3), + F.IsObligatory → F.IsNColorable 2 := by sorry /-- -**Erdős Problem 593 — Sufficient direction**: Every finite 2-colorable 3-uniform +**Sufficient direction fails**: it is not the case that every finite 2-colorable 3-uniform hypergraph is obligatory. -This is the converse direction of the `erdos_593` characterization: if 2-colorability -matches the graph-case characterization (bipartite ⇔ obligatory), then every 2-colorable -finite 3-uniform hypergraph must appear in every 3-uniform hypergraph of chromatic number -$> \aleph_0$. - -Together with `erdos_593.variants.obligatory_implies_two_colorable`, this implies `erdos_593`. +The hypergraph `commonPair` with edges $\{0,1,2\}$ and $\{0,1,3\}$ is 2-colorable but does +not appear in the 3-uniform hypergraphs of large chromatic number consisting of edge-disjoint +triples constructed in [EHR73], see `erdos_593.variants.common_pair_not_obligatory`. -/ -@[category research open, AMS 5] -theorem erdos_593.variants.two_colorable_implies_obligatory : answer(sorry) ↔ - ∀ (W : Type) [Fintype W] (F : ThreeUniformHypergraph W), - F.IsTwoColorable → IsObligatory F := by +@[category research solved, question, AMS 5] +theorem erdos_593.variants.two_colorable_implies_obligatory : + ¬ ∀ (W : Type) [Fintype W] (F : UniformHypergraph W 3), + F.IsNColorable 2 → F.IsObligatory := by sorry +/-- The 3-uniform hypergraph on four vertices consisting of two triples sharing a pair, +$\{0,1,2\}$ and $\{0,1,3\}$. -/ +def commonPair : UniformHypergraph (Fin 4) 3 := + UniformHypergraph.ofFinset {{0, 1, 2}, {0, 1, 3}} (by unfold Finset.IsUniform; decide) + +/-- Two triples sharing a pair are 2-colorable: color the shared pair with one color and the +remaining two vertices with the other. -/ +@[category test, AMS 5] +theorem erdos_593.variants.commonPair_isTwoColorable : commonPair.IsNColorable 2 := + ⟨fun i => if i.val < 2 then 0 else 1, by + exact (UniformHypergraph.isProperColoring_ofFinset_iff + ({{0, 1, 2}, {0, 1, 3}} : Finset (Finset (Fin 4))) + (by unfold Finset.IsUniform; decide) _).mpr (by unfold Finset.IsProperHypergraphColoring; decide)⟩ + /-- -**Conjunction of the two open implications gives the conjectured characterization**: if both -`obligatory_implies_two_colorable` and `two_colorable_implies_obligatory` hold, then the -characterization conjectured in `erdos_593` (`IsObligatory F ↔ F.IsTwoColorable`) follows by -elementary `Iff` manipulation. +Two triples sharing a pair are **not** obligatory: by [EHR73] (see [EGH75, p. 426]) there are +3-uniform hypergraphs of arbitrarily large chromatic number consisting of edge-disjoint +triples, and `commonPair` does not appear in any of them. -/ -@[category test, AMS 5] -theorem erdos_593.variants.implications_combine - (h₁ : ∀ (W : Type) [Fintype W] (F : ThreeUniformHypergraph W), - IsObligatory F → F.IsTwoColorable) - (h₂ : ∀ (W : Type) [Fintype W] (F : ThreeUniformHypergraph W), - F.IsTwoColorable → IsObligatory F) : - ∀ (W : Type) [Fintype W] (F : ThreeUniformHypergraph W), - IsObligatory F ↔ F.IsTwoColorable := by - intro W _ F - exact ⟨h₁ W F, h₂ W F⟩ +@[category research solved, AMS 5] +theorem erdos_593.variants.common_pair_not_obligatory : ¬ commonPair.IsObligatory := by + sorry /- ## Variants and partial results -/ @@ -107,17 +126,16 @@ For the 2-uniform (graph) case, a graph of chromatic cardinal $> \aleph_0$ must finite bipartite graphs. Specifically, for every finite bipartite graph `F` and every graph `G` with chromatic cardinal $> \aleph_0$, there is a graph embedding from `F` into `G`. -This uses `Nonempty (F ↪g G)` (graph embedding), aligned with the injective vertex map -used in the hypergraph `Appears` definition. +This uses `F ⊑ G` (`SimpleGraph.IsContained`, an injective graph homomorphism), aligned with +the injective edge-preserving map used in the hypergraph `Appears` definition. A graph embedding +`F ↪g G` would require an induced copy, which the theorem does not provide. -/ -@[category research solved, AMS 5] +@[category research solved, question, AMS 5] theorem erdos_593.variants.graph_case_bipartite_obligatory : - answer(True) ↔ ∀ (V : Type*) (G : SimpleGraph V), ℵ₀ < G.chromaticCardinal → ∀ (W : Type*) [Fintype W] (F : SimpleGraph W), F.IsBipartite → - Nonempty (F ↪g G) := by - simp only [true_iff] + F ⊑ G := by -- This is the Erdős–Galvin–Hajnal theorem [EGH75]. sorry @@ -127,14 +145,12 @@ For every odd $k \geq 3$, there exists a graph with chromatic cardinal $\aleph_1 contains no cycle of length $k$. This shows the class of obligatory graphs is strictly smaller than all finite graphs. -/ -@[category research solved, AMS 5] +@[category research solved, question, AMS 5] theorem erdos_593.variants.graph_case_no_odd_cycle : - answer(True) ↔ ∀ k : ℕ, Odd k → 3 ≤ k → ∃ (V : Type*) (G : SimpleGraph V), G.chromaticCardinal = ℵ_ 1 ∧ IsEmpty (cycleGraph k →g G) := by - simp only [true_iff] -- This is the Erdős–Galvin–Hajnal theorem [EGH75]. sorry @@ -148,23 +164,14 @@ contradicting $\chi(H) > \aleph_0$. -/ @[category textbook, AMS 5] theorem erdos_593.variants.uncountable_vertices_if_large_chromatic - {V : Type} (H : ThreeUniformHypergraph V) (hχ : ℵ₀ < H.chromaticCardinal) : + {V : Type} (H : UniformHypergraph V 3) (hχ : ℵ₀ < H.chromaticCardinal) : ¬ Countable V := by intro hcount -- Since V is countable, there is an injection φ : V → ℕ. obtain ⟨φ, hφ⟩ := Countable.exists_injective_nat V - -- The injection φ is a proper coloring using ℕ as the color type: - -- each edge has card 3, so we can extract two distinct vertices with distinct images. - have hprop : H.IsProperColoring φ := by - intro e he - -- Extract 3 distinct elements from e using H.uniform. - have hcard : e.card = 3 := H.uniform e he - -- Since e.card = 3 ≥ 2, there exist two distinct elements u ≠ v in e. - have hge : 1 < e.card := by omega - obtain ⟨u, hu, v, hv, huv⟩ := Finset.one_lt_card.mp hge - exact ⟨u, hu, v, hv, fun heq => huv (hφ heq)⟩ - -- So χ(H) ≤ #ℕ = ℵ₀. - have hle : H.chromaticCardinal ≤ ℵ₀ := csInf_le' ⟨ℕ, Cardinal.mk_nat, φ, hprop⟩ + have hprop := H.isProperColoring_of_injective (by decide) hφ + have hle : H.chromaticCardinal ≤ ℵ₀ := by + simpa using H.chromaticCardinal_le hprop exact absurd (lt_of_lt_of_le hχ hle) (lt_irrefl _) /-- @@ -174,16 +181,17 @@ particular, $\chi(H) > \aleph_0$ implies `H` has at least one hyperedge. -/ @[category textbook, AMS 5] theorem erdos_593.variants.nonempty_edges_if_large_chromatic - {V : Type} (H : ThreeUniformHypergraph V) (hχ : ℵ₀ < H.chromaticCardinal) : - H.edges.Nonempty := by + {V : Type} (H : UniformHypergraph V 3) (hχ : ℵ₀ < H.chromaticCardinal) : + H.edgeSet.Nonempty := by by_contra! hempty - -- H has no edges (hempty : H.edges = ∅), so any coloring is proper. + -- H has no edges (hempty : H.edgeSet = ∅), so any coloring is proper. have hprop : H.IsProperColoring (fun _ : V => (0 : Fin 1)) := by intro e he rw [hempty] at he exact (Set.mem_empty_iff_false e).mp he |>.elim -- Hence χ(H) ≤ 1 < ℵ₀. - have hle : H.chromaticCardinal ≤ 1 := csInf_le' ⟨Fin 1, by simp, fun _ => 0, hprop⟩ + have hle : H.chromaticCardinal ≤ 1 := by + simpa using H.chromaticCardinal_le hprop have h1le : (1 : Cardinal) ≤ ℵ₀ := le_of_lt Cardinal.one_lt_aleph0 exact absurd (lt_of_lt_of_le hχ (hle.trans h1le)) (lt_irrefl _) @@ -198,18 +206,11 @@ in `H` via some injection `φ₂`. Since `F₁` appears in `F₂` via `φ₁`, t @[category textbook, AMS 5] theorem erdos_593.variants.obligatory_monotone {W₁ W₂ : Type} [Fintype W₁] [Fintype W₂] [DecidableEq W₂] - {F₁ : ThreeUniformHypergraph W₁} {F₂ : ThreeUniformHypergraph W₂} - (h12 : F₁.Appears F₂) (hObl : IsObligatory F₂) : - IsObligatory F₁ := by + {F₁ : UniformHypergraph W₁ 3} {F₂ : UniformHypergraph W₂ 3} + (h12 : F₁.Appears F₂) (hObl : F₂.IsObligatory) : + F₁.IsObligatory := by intro V _hV H hχ - obtain ⟨φ₂, hφ₂_inj, hφ₂_edge⟩ := hObl V H hχ - obtain ⟨φ₁, hφ₁_inj, hφ₁_edge⟩ := h12 - refine ⟨φ₂ ∘ φ₁, hφ₂_inj.comp hφ₁_inj, fun e he => ?_⟩ - -- e.image (φ₂ ∘ φ₁) = (e.image φ₁).image φ₂ by Finset.image_image - have heq : e.image (φ₂ ∘ φ₁) = (e.image φ₁).image φ₂ := by - rw [Finset.image_image] - rw [heq] - exact hφ₂_edge _ (hφ₁_edge e he) + exact h12.trans (hObl V H hχ) /-- **The empty hypergraph is trivially obligatory**: The 3-uniform hypergraph on `PEmpty` (no @@ -219,9 +220,10 @@ This degenerate case confirms the definition is well-formed. -/ @[category textbook, AMS 5] theorem erdos_593.variants.empty_hypergraph_obligatory : - IsObligatory (W := PEmpty) ⟨∅, fun _ h => (Set.mem_empty_iff_false _).mp h |>.elim⟩ := by + UniformHypergraph.IsObligatory (W := PEmpty) (k := 3) + (UniformHypergraph.ofFinset ∅ (by simp [Finset.IsUniform])) := by intro V _hV H _hχ exact ⟨IsEmpty.elim inferInstance, Function.injective_of_subsingleton _, - fun _ h => (Set.mem_empty_iff_false _).mp h |>.elim⟩ + by simp [UniformHypergraph.ofFinset, Hypergraph.ofEdgeFamily, Hypergraph.image]⟩ end Erdos593 diff --git a/FormalConjectures/ErdosProblems/595.lean b/FormalConjectures/ErdosProblems/595.lean index 969567f..f3ba298 100644 --- a/FormalConjectures/ErdosProblems/595.lean +++ b/FormalConjectures/ErdosProblems/595.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 595 @@ -30,6 +31,8 @@ import FormalConjecturesUtil Academia, Prague (1975), 405-412. -/ +@[expose] public section + open SimpleGraph Set namespace Erdos595 @@ -47,8 +50,8 @@ not the union of countably many triangle-free graphs? A problem of Erdős and Hajnal [Er87]. -/ -@[category research open, AMS 5] -theorem erdos_595 : answer(sorry) ↔ +@[category research open, question, AMS 5] +theorem erdos_595 : ∃ (V : Type*) (_ : Infinite V) (G : SimpleGraph V), G.CliqueFree 4 ∧ ¬IsCountableUnionOfTriangleFree G := by sorry @@ -70,8 +73,8 @@ More precisely: for every `n : ℕ` with `1 ≤ n`, there exist a finite type `V This is the finite analogue of Problem 595. The proofs of Folkman [Fo70] and Nešetřil–Rödl [NeRo75] give different explicit constructions. -/ -@[category research solved, AMS 5] -theorem erdos_595.variants.folkman_finite : answer(True) ↔ +@[category research solved, question, AMS 5] +theorem erdos_595.variants.folkman_finite : ∀ n : ℕ, 1 ≤ n → ∃ (V : Type*) (_ : Fintype V) (G : SimpleGraph V), G.CliqueFree 4 ∧ diff --git a/FormalConjectures/ErdosProblems/596.lean b/FormalConjectures/ErdosProblems/596.lean index c134fd2..599c4f8 100644 --- a/FormalConjectures/ErdosProblems/596.lean +++ b/FormalConjectures/ErdosProblems/596.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 596 @@ -27,10 +28,14 @@ import FormalConjecturesUtil subgraphs*, *J. Combin. Theory* B **20** (1976), 243--249. -/ +@[expose] public section + open SimpleGraph namespace Erdos596 +def erdos_596.answer {U₁ : Type} {U₂ : Type} : SimpleGraph U₁ → SimpleGraph U₂ → Prop := sorry + /-- **Erdős Problem 596** (Erdős–Hajnal, [Er87]). For which graph pairs $(G_1, G_2)$ is it true that @@ -42,15 +47,14 @@ true that Erdős and Hajnal originally conjectured that no such pair exists; but $(C_4, C_6)$ witnesses it (Nešetřil–Rödl + Erdős–Hajnal). The full question is to characterise the -class of all such pairs, recorded here as `answer(sorry)`. +class of all such pairs, recorded here as the unknown `erdos_596.answer`. See Problem 595 for the specific case $(G_1, G_2) = (K_4, K_3)$. -/ -@[category research open, AMS 5] +@[category research open, question value, AMS 5] theorem erdos_596 : ∀ {U₁ U₂ : Type} (G₁ : SimpleGraph U₁) (G₂ : SimpleGraph U₂), - IsErdosHajnalExceptional G₁ G₂ ↔ - (answer(sorry) : ∀ {U₁ U₂ : Type}, SimpleGraph U₁ → SimpleGraph U₂ → Prop) G₁ G₂ := by + IsErdosHajnalExceptional G₁ G₂ ↔ erdos_596.answer G₁ G₂ := by sorry /-- Erdős–Hajnal exceptional pairs exist — recorded as a known direction of `erdos_596`. -/ @@ -83,9 +87,9 @@ theorem erdos_596.variants.C4_C6_is_exceptional : /-- The original Erdős–Hajnal conjecture (that no exceptional pair exists) is **false** — witnessed by $(C_4, C_6)$ via `C4_C6_is_exceptional`. -/ -@[category research solved, AMS 5] -theorem erdos_596.variants.original_conjecture_is_false : answer(False) ↔ - ∀ {U₁ U₂ : Type} (G₁ : SimpleGraph U₁) (G₂ : SimpleGraph U₂), +@[category research solved, question, AMS 5] +theorem erdos_596.variants.original_conjecture_is_false : + ¬ ∀ {U₁ U₂ : Type} (G₁ : SimpleGraph U₁) (G₂ : SimpleGraph U₂), ¬IsErdosHajnalExceptional G₁ G₂ := by sorry @@ -93,8 +97,8 @@ theorem erdos_596.variants.original_conjecture_is_false : answer(False) ↔ Erdős Problem 595. The finite Ramsey property holds (Folkman 1970, Nešetřil–Rödl [NeRo75]); the open part is whether every $K_4$-free graph is a countable union of triangle-free graphs. -/ -@[category research open, AMS 5] -theorem erdos_596.variants.K4_K3_exceptional_iff : answer(sorry) ↔ +@[category research open, question, AMS 5] +theorem erdos_596.variants.K4_K3_exceptional_iff : IsErdosHajnalExceptional (completeGraph (Fin 4)) (completeGraph (Fin 3)) := by sorry diff --git a/FormalConjectures/ErdosProblems/597.lean b/FormalConjectures/ErdosProblems/597.lean new file mode 100644 index 0000000..664928d --- /dev/null +++ b/FormalConjectures/ErdosProblems/597.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 597 + +*Reference:* [erdosproblems.com/597](https://www.erdosproblems.com/597) + +*References:* +- [Er87] Erdős, P., *Some problems on finite and infinite graphs*. Logic and combinatorics + (Arcata, Calif., 1985) (1987), 223-228. +-/ + +@[expose] public section + +open Cardinal Ordinal +open scoped Cardinal Ordinal + +namespace Erdos597 + +/-- +The graph-target ordinal partition relation $\alpha \to (\beta, G)^2$: for every red/blue +colouring of the edges of the complete graph on $\alpha$, either there is a red clique of +order type $\beta$, or there is a blue copy of the graph $G$ (an injective map sending the +edges of $G$ to blue edges). + +This generalises `OrdinalCardinalRamsey`, replacing the blue clique of cardinality $c$ +(i.e. a blue copy of $K_c$) by a blue copy of an arbitrary graph $G$. + +Will be moved to `FormalConjecturesForMathlib/SetTheory/Ordinal/PartitionRelation.lean` +once the shared home for ordinal partition relations lands (see PR #4195). +-/ +def OrdinalGraphRamsey {W : Type*} (α β : Ordinal.{0}) (G : SimpleGraph W) : Prop := + ∀ red blue : SimpleGraph α.ToType, IsCompl red blue → + (∃ s, red.IsClique s ∧ typeLT s = β) ∨ + (∃ f : W → α.ToType, Function.Injective f ∧ + ∀ a b, G.Adj a b → blue.Adj (f a) (f b)) + +/-- +**Erdős Problem 597** [Er87]. Let $G$ be a graph on at most $\aleph_1$ +vertices which contains no $K_4$ and no $K_{\aleph_0,\aleph_0}$ (the complete bipartite +graph with $\aleph_0$ vertices in each class). Is it true that +$$\omega_1^2 \to (\omega_1 \omega, G)^2?$$ +-/ +@[category research open, question, AMS 3 5] +theorem erdos_597 : + ∀ (W : Type) (G : SimpleGraph W), #W ≤ ℵ_ 1 → G.CliqueFree 4 → + (¬ ∃ A B : Set W, Disjoint A B ∧ A.Infinite ∧ B.Infinite ∧ + ∀ a ∈ A, ∀ b ∈ B, G.Adj a b) → + OrdinalGraphRamsey ((ω_ 1) ^ (2 : ℕ)) ((ω_ 1) * ω) G := by + sorry + +/-- +**Erdős Problem 597, finite case** [Er87]. Is it true that +$\omega_1^2 \to (\omega_1 \omega, G)^2$ for every finite $K_4$-free graph $G$? +(A finite graph contains no $K_{\aleph_0,\aleph_0}$, so that hypothesis is vacuous.) +-/ +@[category research open, question, AMS 3 5] +theorem erdos_597.variants.finite : + ∀ (W : Type) [Fintype W] (G : SimpleGraph W), G.CliqueFree 4 → + OrdinalGraphRamsey ((ω_ 1) ^ (2 : ℕ)) ((ω_ 1) * ω) G := by + sorry + +/-- +Erdős and Hajnal proved that $\omega_1^2 \to (\omega_1 \omega, 3)^2$: in every red/blue +colouring of the edges of the complete graph on $\omega_1^2$ there is either a red clique +of order type $\omega_1 \cdot \omega$ or a blue triangle. +-/ +@[category research solved, AMS 3 5] +theorem erdos_597.variants.erdos_hajnal : + OrdinalCardinalRamsey ((ω_ 1) ^ (2 : ℕ)) ((ω_ 1) * ω) 3 := by + sorry + +/-- +Erdős originally asked Problem 597 with just the assumption that $G$ is $K_4$-free, but +Baumgartner proved that $\omega_1^2 \not\to (\omega_1 \omega, K_{\aleph_0,\aleph_0})^2$. +-/ +@[category research solved, AMS 3 5] +theorem erdos_597.variants.baumgartner : + ¬ OrdinalGraphRamsey ((ω_ 1) ^ (2 : ℕ)) ((ω_ 1) * ω) (completeBipartiteGraph ℕ ℕ) := by + sorry + +/-- +Sanity check: the relation $\omega_1^2 \to (\omega_1 \omega, G)^2$ holds trivially when +$G$ is a single vertex with no edges, since any vertex of $\omega_1^2$ is a blue copy +of $G$. +-/ +@[category test, AMS 3] +theorem ordinalGraphRamsey_bot : + OrdinalGraphRamsey ((ω_ 1) ^ (2 : ℕ)) ((ω_ 1) * ω) (⊥ : SimpleGraph (Fin 1)) := by + intro red blue _ + right + have : Nonempty ((ω_ 1) ^ (2 : ℕ)).ToType := by + rw [Ordinal.nonempty_toType_iff] + exact pow_ne_zero 2 (omega_pos 1).ne' + obtain ⟨x⟩ := this + exact ⟨fun _ => x, fun a b _ => Subsingleton.elim a b, fun a b h => by simp at h⟩ + +end Erdos597 diff --git a/FormalConjectures/ErdosProblems/598.lean b/FormalConjectures/ErdosProblems/598.lean index bea03c7..3fabca6 100644 --- a/FormalConjectures/ErdosProblems/598.lean +++ b/FormalConjectures/ErdosProblems/598.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 598 @@ -22,12 +23,12 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/598](https://www.erdosproblems.com/598) -/ +@[expose] public section + namespace Erdos598 open Cardinal -variable (m : Type*) [Infinite m] - /-- Let $\kappa = (2^{\aleph_0})^+$. This is the successor cardinal of the continuum. -/ @@ -39,8 +40,9 @@ Let $m$ be an infinite cardinal and $\kappa$ be the successor cardinal of $2^{\a Can one colour the countable subsets of $m$ using $\kappa$ many colours so that every $X \subseteq m$ with $|X| = \kappa$ contains subsets of all possible colours? -/ -@[category research open, AMS 3 5] -theorem erdos_598 : answer(sorry) ↔ +@[category research open, question, AMS 3 5] +theorem erdos_598 : + ∀ (m : Type*) [Infinite m], ∃ c : { s : Set m // s.Countable } → κ.out, ∀ X : Set m, #X = κ → c '' { s : { sub : Set m // sub.Countable } | s.1 ⊆ X } = Set.univ := by diff --git a/FormalConjectures/ErdosProblems/60.lean b/FormalConjectures/ErdosProblems/60.lean index 5fd36d9..83ad036 100644 --- a/FormalConjectures/ErdosProblems/60.lean +++ b/FormalConjectures/ErdosProblems/60.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 60 @@ -25,6 +26,8 @@ import FormalConjecturesUtil Combinatorial Theory B (2021). -/ +@[expose] public section + namespace Erdos60 open SimpleGraph Filter @@ -46,12 +49,15 @@ theorem erdos_60 : /- ## Variants and partial results -/ /-- -He, Ma, and Yang [HeMaYa21] proved the conjecture when $n = q^2 + q + 1$ for some even integer $q$. +He, Ma, and Yang [HeMaYa21] proved the conjecture when $n = q^2 + q + 1$ for some $q = 2^k$: they +showed that for large even $q$ every graph on $q^2 + q + 1$ vertices with +$\frac{1}{2}q(q+1)^2 + 1$ edges contains at least $q - 1$ copies of $C_4$, and +$\mathrm{ex}(q^2 + q + 1; C_4) = \frac{1}{2}q(q+1)^2$ when $q = 2^k$. -/ @[category research solved, AMS 5] theorem erdos_60.variants.he_ma_yang : ∃ c : ℝ, c > 0 ∧ - ∀ (q : ℕ) (_hq : Even q), + ∀ (q : ℕ) (_hq : q.isPowerOfTwo), ∀ (G : SimpleGraph (Fin (q^2 + q + 1))) [DecidableRel G.Adj], (extremalNumber (q^2 + q + 1) (cycleGraph 4) < G.edgeFinset.card) → (c * Real.sqrt ((q^2 + q + 1) : ℝ) ≤ ({ H' : G.Subgraph | Nonempty (H'.coe ≃g cycleGraph 4) }.ncard : ℝ)) := by diff --git a/FormalConjectures/ErdosProblems/601.lean b/FormalConjectures/ErdosProblems/601.lean new file mode 100644 index 0000000..5dc648d --- /dev/null +++ b/FormalConjectures/ErdosProblems/601.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 601 + +*Reference:* [erdosproblems.com/601](https://www.erdosproblems.com/601) + +*References:* +- [EHM70] Erdős, P.; Hajnal, A.; Milner, E.C. *Set mappings and polarized partition relations.* + Combinatorial theory and its applications, I–III (Balatonfüred, 1969) (1970), 327–363. +- [Er81] Erdős, P. *On the combinatorial problems which I would most like to see solved.* + Combinatorica 1 (1981), 25–42, Section VII. +- [La90] Larson, J.A. *Martin's Axiom and ordinal graphs: large independent sets or infinite + paths.* Ann. Pure Appl. Logic 47 (1990), 31–39. +-/ + +@[expose] public section + +open Cardinal Ordinal SimpleGraph + +namespace Erdos601 + +universe u + +/-- +`HasPathOrIndepSetOfType α` holds for an ordinal $\alpha$ if every simple graph on +$\alpha.\mathrm{ToType}$ contains either: + +1. an **infinite path** — an injective function $f : \mathbb{N} \to \alpha.\mathrm{ToType}$ + with $G.\mathrm{Adj}\, (f n)\, (f(n+1))$ for all $n$, or +2. an **independent set of order type $\alpha$** — a set $s \subseteq \alpha.\mathrm{ToType}$ + that is pairwise non-adjacent in $G$ and whose order type (under the well-order inherited + from $\alpha$) equals $\alpha$. +-/ +def HasPathOrIndepSetOfType (α : Ordinal.{u}) : Prop := + ∀ G : SimpleGraph α.ToType, + (∃ f : ℕ → α.ToType, Function.Injective f ∧ ∀ n, G.Adj (f n) (f (n + 1))) ∨ + (∃ s : Set α.ToType, G.IsIndepSet s ∧ typeLT s = α) + +def erdos_601.answer : Ordinal.{0} → Prop := by sorry + +/-- +**Erdős Problem 601** ($500 prize). + +For which limit ordinals $\alpha$ does `HasPathOrIndepSetOfType α` hold? +-/ +@[category research open, question value, AMS 5] +theorem erdos_601 : + ∀ α : Ordinal.{0}, Order.IsSuccLimit α → + (HasPathOrIndepSetOfType α ↔ + erdos_601.answer α) := by + sorry + +/-- +**Erdős–Hajnal–Milner conjecture** [Er81, Section VII]: every graph on a limit ordinal +$\alpha$ contains an infinite path or an independent set of order type $\alpha$. -/ +@[category research open, AMS 5] +theorem erdos_601.variants.universal : + ∀ α : Ordinal.{0}, Order.IsSuccLimit α → HasPathOrIndepSetOfType α := by + sorry + +namespace erdos_601.variants + +/-- +**Erdős–Hajnal–Milner (1970)** [EHM70]: For all limit ordinals $\alpha < \omega_1^{\omega+2}$, +every graph on $\alpha.\mathrm{ToType}$ has either an infinite path or an independent set of +order type $\alpha$. +-/ +@[category research solved, AMS 5] +theorem erdos_hajnal_milner_1970 : + ∀ α : Ordinal.{0}, + Order.IsSuccLimit α → + α < ω_ 1 ^ (ω + 2) → + HasPathOrIndepSetOfType α := by + sorry + +/-- +**Erdős–Hajnal–Milner conjecture at $\omega_1^{\omega+2}$** [Er81, Section VII]: every +graph on $\omega_1^{\omega+2}$ contains an infinite path or an independent set of that +order type. Erdős conjectured the positive answer. This is the first limit ordinal not +covered by the Erdős–Hajnal–Milner theorem. +-/ +@[category research open, AMS 5] +theorem omega_1_omega_plus_2 : + HasPathOrIndepSetOfType (ω_ 1 ^ (ω + 2)) := by + sorry + +/- +**Larson (1990)** [La90] showed that under Martin's Axiom (MA), the property +`HasPathOrIndepSetOfType α` holds for all limit ordinals $\alpha < 2^{\aleph_0}$. We do +not state this here as a Lean theorem because Martin's Axiom is not yet formalised in +Mathlib (and a bare `MA : Prop` placeholder would not faithfully encode the axiom). +-/ + +/-- +**Base case $\alpha = \omega$**: `HasPathOrIndepSetOfType ω` holds. + +Every countably infinite graph on vertex set $\omega$ either contains an infinite path or +has an infinite independent set (and an infinite set has order type $\omega$). Follows from +Ramsey-theoretic arguments (or directly from the Erdős–Hajnal–Milner result since +$\omega < \omega_1^{\omega+2}$). +-/ +@[category research solved, AMS 5] +theorem at_omega : HasPathOrIndepSetOfType ω := by + sorry + +end erdos_601.variants + +end Erdos601 diff --git a/FormalConjectures/ErdosProblems/602.lean b/FormalConjectures/ErdosProblems/602.lean index c6bc522..fdda5f1 100644 --- a/FormalConjectures/ErdosProblems/602.lean +++ b/FormalConjectures/ErdosProblems/602.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 602 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/602](https://www.erdosproblems.com/602) -/ +@[expose] public section + open Set namespace Erdos602 @@ -71,8 +74,8 @@ forbidden intersection size of 1. countably infinite set is in bijection with `ℕ`, the two formulations are equivalent, but working over an arbitrary ground type makes the statement apply immediately to, e.g., almost-disjoint families of countable subsets of an uncountable space. -/ -@[category research open, AMS 3 5] -theorem erdos_602 : answer(sorry) ↔ +@[category research open, question, AMS 3 5] +theorem erdos_602 : ∀ {α : Type*} {I : Type*} (A : I → Set α), (∀ i, (A i).Countable ∧ (A i).Infinite) → (∀ i j, i ≠ j → (A i ∩ A j).Finite) → @@ -92,14 +95,12 @@ particular satisfies `|A_i ∩ A_j| ≠ 1`), then Property B holds trivially. `a_i` and `b_i`. We can define a colouring that assigns colour 0 to `a_i` and colour 1 to `b_i` for each `i` (using disjointness, these choices don't conflict), and extend arbitrarily elsewhere. Then no `A_i` is monochromatic. -/ -@[category research solved, AMS 3 5] -theorem erdos_602.variants.disjoint : answer(True) ↔ +@[category research solved, question, AMS 3 5] +theorem erdos_602.variants.disjoint : ∀ {α : Type*} {I : Type*} (A : I → Set α), (∀ i, (A i).Infinite) → (∀ i j, i ≠ j → Disjoint (A i) (A j)) → HasPropertyB I A := by - show True ↔ _ - simp only [true_iff] intro α I A hInfinite hDisjoint -- For each i, pick two distinct elements a_fn i, b_fn i ∈ A i. have ha_b : ∀ i, ∃ a b : α, a ∈ A i ∧ b ∈ A i ∧ a ≠ b := by @@ -132,13 +133,13 @@ theorem erdos_602.variants.disjoint : answer(True) ↔ -- f (a_fn i) = 0: ¬ ∃ j, a_fn i = b_fn j. have hfa : f (a_fn i) = 0 := by simp only [f] - rw [if_neg] + rw [ite_eq_right] rintro ⟨j, hj⟩ exact key i j hj -- f (b_fn i) = 1: witnessed by i itself. have hfb : f (b_fn i) = 1 := by simp only [f] - rw [if_pos ⟨i, rfl⟩] + rw [ite_eq_left ⟨i, rfl⟩] -- hMono says f is constant on A i, but f (a_fn i) = 0 ≠ 1 = f (b_fn i). have hne := hMono (a_fn i) (ha_mem i) (b_fn i) (hb_mem i) rw [hfa, hfb] at hne @@ -151,8 +152,8 @@ If the index set is countable, the answer is yes, and the intersection condition is unnecessary. This is Bernstein's Lemma: every countable system of infinite sets has Property B. -/ -@[category research solved, AMS 3 5] -theorem erdos_602.variants.countable_index : answer(True) ↔ +@[category research solved, question, AMS 3 5] +theorem erdos_602.variants.countable_index : ∀ {α : Type*} (A : ℕ → Set α), (∀ i, (A i).Countable ∧ (A i).Infinite) → (∀ i j, i ≠ j → (A i ∩ A j).Finite) → @@ -238,15 +239,13 @@ If the family consists of exactly two countably infinite sets `A₀` and `A₁` - If `|A₀ ∩ A₁| ≥ 2`: the intersection contains two distinct points `x` and `y`. Assign `x` colour 0 and `y` colour 1. Both `A₀` and `A₁` contain `x` and `y`, so neither is monochromatic. -/ -@[category research solved, AMS 3 5] -theorem erdos_602.variants.two_sets : answer(True) ↔ +@[category research solved, question, AMS 3 5] +theorem erdos_602.variants.two_sets : ∀ {α : Type*} (A : Fin 2 → Set α), (∀ i, (A i).Infinite) → (A 0 ∩ A 1).Finite → Set.ncard (A 0 ∩ A 1) ≠ 1 → HasPropertyB (Fin 2) A := by - show True ↔ _ - simp only [true_iff] intro α A hInfinite hFin hNcard classical -- Case split: intersection empty or size ≥ 2. diff --git a/FormalConjectures/ErdosProblems/604.lean b/FormalConjectures/ErdosProblems/604.lean new file mode 100644 index 0000000..83c8364 --- /dev/null +++ b/FormalConjectures/ErdosProblems/604.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 604 + +*References:* +- [erdosproblems.com/604](https://www.erdosproblems.com/604) +- [OAI26] OpenAI, [*The weak pinned planar distance theorem*](https://github.com/openai/math/blob/1581d4cbdd69a0faf34b2089614fe2a814316a6a/preprints/The-weak-pinned-planar-distance-theorem-September-23-2026/paper.pdf) (2026). +- [Er46] Erdős, Paul, *On sets of distances of $n$ points*. Amer. Math. Monthly (1946), 248--250. +- [Er57] Erdős, Paul, *Some unsolved problems*. Michigan Math. J. (1957), 291-300. +- [Er61] Erdős, Paul, *Some unsolved problems*. Magyar Tud. Akad. Mat. Kutató Int. Közl. (1961), + 221-254. +- [Er75f] Erdős, Paul, *On some problems of elementary and combinatorial geometry*. Ann. Mat. Pura + Appl. (4) (1975), 99-108. +- [Er83c] Erdős, Paul, *Combinatorial problems in geometry*. Math. Chronicle (1983), 35-54. +- [Er85] Erdős, P., *Problems and results in combinatorial geometry*. Discrete geometry and + convexity (New York, 1982) (1985), 1-11. +- [Er87b] Erdős, P., *Some combinatorial and metric problems in geometry*. Intuitive geometry + (Siófok, 1985) (1987), 167-177. +- [Er90] Erdős, Paul, *Some of my favourite unsolved problems*. A tribute to Paul Erdős (1990), + 467-478. +- [Er95] Erdős, Paul, *Some of my favourite problems in number theory, combinatorics, and + geometry*. Resenhas (1995), 165-186. +- [Er97b] Erdős, Paul, *Some old and new problems in various branches of combinatorics*. Discrete + Math. (1997), 227-231. +- [Er97c] Erdős, Paul, *Some of my favorite problems and results*. The mathematics of Paul Erdős, + I (1997), 47-67. +- [Er97e] Erdős, Paul, *Some of my favourite unsolved problems*. Math. Japon. (1997), 527-537. +- [Er97f] Erdős, Paul, *Some unsolved problems*. Combinatorics, geometry and probability + (Cambridge, 1993) (1997), 1-10. +- [KaTa04] Katz, Nets Hawk and Tardos, Gábor, *A new entropy inequality for the Erdős distance + problem*. Towards a theory of geometric graphs (2004), 119-126. +-/ + +@[expose] public section + +open Filter +open scoped EuclideanGeometry Finset + +namespace Erdos604 + +/-- The pinned distance function $f(n)$. For a set $A$ of $n$ points in $\mathbb{R}^2$, take the +largest number of distinct distances from a point $x \in A$ to the other points of $A$. Then +$f(n)$ is the least such value over all such sets $A$. + +The distance $d(x, x) = 0$ is not counted, as in `distinctDistancesFromOther`. Every $n$ admits a set +of $n$ points in $\mathbb{R}^2$, so the infimum is a minimum. -/ +noncomputable def pinnedDistinctDistances (n : ℕ) : ℕ := + sInf {m : ℕ | ∃ A : Finset ℝ², #A = n ∧ A.sup (distinctDistancesFromOther A) = m} + +/-- +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^{1-o(1)}?$$ + +This is the pinned distance problem, a stronger form of Problem 89. Here $n^{1-o(1)}$ means: for +every $\varepsilon > 0$ and all large $n$, the bound is at least $n^{1-\varepsilon}$. We do not +count the distance $d(x, x) = 0$; this changes the count by one. + +This weak formulation was proved by OpenAI [OAI26]. +-/ +@[category research solved, question, AMS 52, + formal_proof using lean4 at + "https://github.com/MendozaLab/erdos-experiments/blob/09f72c57ed2d98906b9cf03bff2091f6fe73807f/proofs/erdos604/Erdos604Proof/ExternalApplication.lean#L17"] +theorem erdos_604 : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, + (n : ℝ) ^ (1 - ε) ≤ (pinnedDistinctDistances n : ℝ) := by + sorry + +/-- +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 \frac{n}{\sqrt{\log n}}?$$ +-/ +@[category research open, question, AMS 52] +theorem erdos_604.variants.sqrt_log : + (fun n : ℕ => (n : ℝ) / (n : ℝ).log.sqrt) =O[atTop] + (fun n => (pinnedDistinctDistances n : ℝ)) := by + sorry + +/-- +The integer grid shows that $\frac{n}{\sqrt{\log n}}$ would be best possible: there are sets of +$n$ points in $\mathbb{R}^2$ in which every point has $O(\frac{n}{\sqrt{\log n}})$ distinct +distances to the other points. This follows from the bound of Erdős [Er46] on the total number of +distinct distances in the grid (see Erdős Problem 89), since the number of distances from one point +is at most the total number of distances. For $n$ that is not a square, take $n$ points of the +smallest square grid with at least $n$ points. +-/ +@[category research solved, AMS 52] +theorem erdos_604.variants.grid_upper_bound : + (fun n => (pinnedDistinctDistances n : ℝ)) =O[atTop] + (fun n : ℕ => (n : ℝ) / (n : ℝ).log.sqrt) := by + sorry + +/-- +Katz and Tardos [KaTa04] proved that some point of $A$ has $\gg n^{c-o(1)}$ distinct distances to +the other points of $A$, where +$$c=\frac{48-14e}{55-16e}=0.864137\cdots.$$ +-/ +@[category research solved, AMS 52] +theorem erdos_604.variants.katz_tardos : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, + (n : ℝ) ^ ((48 - 14 * Real.exp 1) / (55 - 16 * Real.exp 1) - ε) ≤ + (pinnedDistinctDistances n : ℝ) := by + sorry + +/-- +Let $d(x)$ be the number of distinct distances from $x$ to the other points of $A$. Erdős [Er75f] +conjectured that +$$\sum_{x\in A}d(x) \gg \frac{n^2}{\sqrt{\log n}}$$ +for every set $A\subset\mathbb{R}^2$ of $n$ points. + +The sum is at most $n$ times the largest $d(x)$, so this conjecture implies a positive answer to +`Erdos604.erdos_604.variants.sqrt_log`. +-/ +@[category research open, AMS 52] +theorem erdos_604.variants.average : + ∃ C : ℝ, 0 < C ∧ ∀ᶠ n : ℕ in atTop, ∀ A : Finset ℝ², #A = n → + C * (n : ℝ) ^ 2 / (n : ℝ).log.sqrt ≤ ((∑ x ∈ A, distinctDistancesFromOther A x : ℕ) : ℝ) := by + sorry + +end Erdos604 diff --git a/FormalConjectures/ErdosProblems/609.lean b/FormalConjectures/ErdosProblems/609.lean new file mode 100644 index 0000000..e787215 --- /dev/null +++ b/FormalConjectures/ErdosProblems/609.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 609 + +*References:* +- [erdosproblems.com/609](https://www.erdosproblems.com/609) +- [ErGr75] Erdős, P. and Graham, R. L., On partition theorems for finite graphs. + Colloq. Math. Soc. János Bolyai (1975). +- [Ch97] Chung, F., 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, F., Short monochromatic odd cycles. + arXiv:2506.14910 (2025). +-/ + +@[expose] public section + +open Filter + +namespace Erdos609 + +/-- +The monochromatic subgraph of color `i` under edge coloring `c : Sym2 V → Fin n`. +-/ +def monochromaticGraph {V : Type*} {n : ℕ} (c : Sym2 V → Fin n) (i : Fin n) : SimpleGraph V := + SimpleGraph.fromRel (fun u v ↦ c s(u, v) = i) + +/-- +A coloring `c` has a monochromatic odd cycle of length at most `m`. +-/ +def MonochromaticHasOddCycleLe (n : ℕ) (m : ℕ) (c : Sym2 (Fin (2 ^ n + 1)) → Fin n) : Prop := + ∃ (i : Fin n) (l : ℕ), l ∈ (monochromaticGraph c i).oddCycleLengths ∧ l ≤ m + +/-- +$f(n)$ is 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$. +-/ +noncomputable def f (n : ℕ) : ℕ := + sInf {m : ℕ | ∀ (c : Sym2 (Fin (2 ^ n + 1)) → Fin n), MonochromaticHasOddCycleLe n m c} + +def erdos_609.answer : ℕ → ℝ := sorry + +/-- +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)$. +-/ +@[category research open, question value, AMS 5] +theorem erdos_609 : + (fun n ↦ (f n : ℝ)) =Θ[atTop] erdos_609.answer := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos609 diff --git a/FormalConjectures/ErdosProblems/614.lean b/FormalConjectures/ErdosProblems/614.lean new file mode 100644 index 0000000..da12fd2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/614.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 614 + +*References:* +- [erdosproblems.com/614](https://www.erdosproblems.com/614) +- [A problem on sparse induced subgraphs](https://mathweb.ucsd.edu/~erdosproblems/erdos/newproblems/SparseInducedSubgraphs.html) +- [FRS97] Faudree, R. J., Rousseau, C. C. and Schelp, R. H., *Problems in graph theory from Memphis*. + The Mathematics of Paul Erdős, II, 7–26. +-/ + +@[expose] public section + +namespace Erdos614 + +def erdos_614.answer : ℕ → ℕ → ℕ := sorry + +open scoped Classical in +/-- +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)$. +-/ +@[category research open, question value, AMS 5] +theorem erdos_614 : + ∀ n k, IsLeast {m : ℕ | ∃ G : SimpleGraph (Fin n), G.edgeFinset.card = m ∧ + ∀ s : Finset (Fin n), s.card = k + 2 → + ∃ v : s, k ≤ (G.induce (s : Set (Fin n))).degree v} (erdos_614.answer n k) := by + sorry + +end Erdos614 diff --git a/FormalConjectures/ErdosProblems/616.lean b/FormalConjectures/ErdosProblems/616.lean new file mode 100644 index 0000000..1fee7d5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/616.lean @@ -0,0 +1,48 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 616 + +*References:* +- [erdosproblems.com/616](https://www.erdosproblems.com/616) +- [EHT91] Erdős, Paul and Hajnal, András and Tuza, Zsolt, Local constraints ensuring small + representing sets. J. Combin. Theory Ser. A (1991), 78-84. +-/ + +@[expose] public section + +namespace Erdos616 + +open Filter Asymptotics + +def erdos_616.answer : ℕ → ℕ∞ := sorry + +/-- +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 $G$ +where every subgraph $G'$ on at most $3r-3$ vertices has $\tau(G')\leq 1$, we have $\tau(G)\leq t$. +-/ +@[category research open, question value, AMS 5] +theorem erdos_616 : + ∀ r : ℕ, 3 ≤ r → Hypergraph.localTransversalBound r (3 * r - 3) 1 = erdos_616.answer r := by + sorry + +end Erdos616 diff --git a/FormalConjectures/ErdosProblems/623.lean b/FormalConjectures/ErdosProblems/623.lean index f8b64ce..e81643f 100644 --- a/FormalConjectures/ErdosProblems/623.lean +++ b/FormalConjectures/ErdosProblems/623.lean @@ -13,14 +13,18 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 623 *Reference:* [erdosproblems.com/623](https://www.erdosproblems.com/623) -/ + +@[expose] public section + open Filter Real Set open scoped Cardinal Ordinal namespace Erdos623 @@ -31,8 +35,8 @@ Let $X$ be a set of cardinality $\aleph_\omega$ and $f$ be a function from the f $X$ to $X$ such that $f(A)\not\in A$ for all $A$. Must there exist an infinite $Y\subseteq X$ that is independent - that is, for all finite $B\subset Y$ we have $f(B)\not\in Y$? -/ -@[category research open, AMS 3] -theorem erdos_623 : answer(sorry) ↔ ∀ (X : Type u) (hX : #X = ℵ_ ω) +@[category research open, question, AMS 3] +theorem erdos_623 : ∀ (X : Type u) (hX : #X = ℵ_ ω) (f : Finset X → X), (∀ A : Finset X, f A ∉ A) → (∃ Y : Set X, Set.Infinite Y ∧ (∀ (B : Finset X), ↑B ⊆ Y → f B ∉ Y)) := by sorry diff --git a/FormalConjectures/ErdosProblems/626.lean b/FormalConjectures/ErdosProblems/626.lean new file mode 100644 index 0000000..c672109 --- /dev/null +++ b/FormalConjectures/ErdosProblems/626.lean @@ -0,0 +1,182 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 626 + +*References:* +- [erdosproblems.com/626](https://www.erdosproblems.com/626) +- [Er59b] Erdős, P., *Graph theory and probability*. Canadian J. Math. (1959), 34-38. +- [Er62b] Erdős, P., *On circuits and subgraphs of chromatic graphs*. Mathematika (1962), + 170-175. +- [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. +- [Ko88] Kostochka, A. V., *Upper bounds on the chromatic number of graphs*. Trudy Inst. Mat. + (Novosibirsk) (1988), 204-226, 265. +-/ + +@[expose] public section + +open Filter +open scoped Topology + +namespace Erdos626 + +/-- +`g k n` is $g_k(n)$: the largest $m$ such that some graph on $n$ vertices has chromatic number +exactly $k$ and girth $> m$, that is, no cycle of length $\leq m$. + +The girth is `SimpleGraph.egirth`, which is `⊤` for an acyclic graph. The value `sSup ∅ = 0` +for $n < k$ affects only finitely many $n$. For $k \leq 2$ the set is unbounded whenever an +acyclic graph on $n$ vertices with chromatic number $k$ exists, and then `sSup` is also $0$; this +case is not used below, where $k \geq 4$. +-/ +noncomputable def g (k n : ℕ) : ℕ := + sSup {m : ℕ | ∃ G : SimpleGraph (Fin n), G.chromaticNumber = k ∧ (m : ℕ∞) < G.egirth} + +/-- +`h m n` is $h^{(m)}(n)$: the largest chromatic number of a graph on $n$ vertices with girth +$> m$. +-/ +noncomputable def h (m n : ℕ) : ℕ := + sSup {c : ℕ | ∃ G : SimpleGraph (Fin n), (m : ℕ∞) < G.egirth ∧ G.chromaticNumber = c} + +/-- Every cycle has length at least $3$, so for $m \leq 2$ the girth condition is vacuous and +$h^{(m)}(n) = n$. -/ +@[category test, AMS 5] +theorem h_of_le_two (m n : ℕ) (hm : m ≤ 2) : h m n = n := by + unfold h + apply IsGreatest.csSup_eq + refine ⟨⟨⊤, ?_, by simp [SimpleGraph.chromaticNumber_top]⟩, ?_⟩ + · exact lt_of_lt_of_le (by exact_mod_cast (by omega : m < 3)) + (⊤ : SimpleGraph (Fin n)).three_le_egirth + · rintro c ⟨G, -, hG⟩ + have hle := G.chromaticNumber_le_card + rw [hG, Fintype.card_fin] at hle + exact_mod_cast hle + +/-- +Let $k \geq 4$ and let $g_k(n)$ denote the largest $m$ such that there is a graph on $n$ +vertices with chromatic number $k$ and girth $> m$ (i.e. containing no cycle of length +$\leq m$). Does +$$\lim_{n\to\infty}\frac{g_k(n)}{\log n}$$ +exist? + +By `Erdos626.erdos_626.variants.kostochka` and `Erdos626.erdos_626.variants.erdos_upper`, the +limit, if it exists, is a positive real number. +-/ +@[category research open, question, AMS 5] +theorem erdos_626.parts.i : + ∀ k : ℕ, 4 ≤ k → ∃ L : ℝ, + Tendsto (fun n : ℕ ↦ (g k n : ℝ) / Real.log n) atTop (𝓝 L) := by + sorry + +/-- +Kostochka [Ko88] proved that for $k \geq 4$ +$$g_k(n) \geq \frac{1}{4\log k}\log n.$$ +Kostochka's theorem gives this lower bound for the girth itself, and $g_k(n)$ is one less than the +largest possible girth, so the inequality above holds only up to $1$. The statement below is a +consequence of his theorem, not the theorem itself: for every $\varepsilon > 0$ and all +sufficiently large $n$, $g_k(n) \geq \left(\frac{1}{4\log k} - \varepsilon\right)\log n$. +-/ +@[category research solved, AMS 5] +theorem erdos_626.variants.kostochka : + ∀ k : ℕ, 4 ≤ k → ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (1 / (4 * Real.log k) - ε) * Real.log n ≤ (g k n : ℝ) := by + sorry + +/-- +Erdős [Er59b] proved that for $k \geq 4$ +$$g_k(n) \leq \frac{2}{\log(k-2)}\log n + 1.$$ +We state it for all sufficiently large $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_626.variants.erdos_upper : + ∀ k : ℕ, 4 ≤ k → ∀ᶠ n : ℕ in atTop, + (g k n : ℝ) ≤ 2 * Real.log n / Real.log ((k : ℝ) - 2) + 1 := by + sorry + +/-- +Let $h^{(m)}(n)$ be the maximal chromatic number of a graph on $n$ vertices with girth $> m$. +Does +$$\lim_{n\to\infty}\frac{\log h^{(m)}(n)}{\log n}$$ +exist, and what is its value? The value is asked for in +`Erdos626.erdos_626.variants.h_odd_conjecture` and `Erdos626.erdos_626.variants.h_even_conjecture`. +-/ +@[category research open, question, AMS 5] +theorem erdos_626.parts.ii : + ∀ m : ℕ, ∃ L : ℝ, + Tendsto (fun n : ℕ ↦ Real.log (h m n : ℝ) / Real.log n) atTop (𝓝 L) := by + sorry + +/-- +Erdős [Er59b] proved that +$$\lim_{n\to\infty}\frac{\log h^{(m)}(n)}{\log n} \gg \frac{1}{m}.$$ +The existence of the limit is open, so we state the lower bound for the lower limit: there is +an absolute constant $c > 0$ such that for every $m \geq 1$ and $\varepsilon > 0$, eventually +$h^{(m)}(n) \geq n^{c/m - \varepsilon}$. +-/ +@[category research solved, AMS 5] +theorem erdos_626.variants.h_lower : + ∃ c > (0 : ℝ), ∀ m : ℕ, 1 ≤ m → ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (n : ℝ) ^ (c / (m : ℝ) - ε) ≤ (h m n : ℝ) := by + sorry + +/-- +Erdős [Er59b] proved that for odd $m$ +$$\lim_{n\to\infty}\frac{\log h^{(m)}(n)}{\log n} \leq \frac{2}{m+1}.$$ +The existence of the limit is open, so we state the bound for the upper limit: for every +$\varepsilon > 0$, eventually $h^{(m)}(n) \leq n^{2/(m+1) + \varepsilon}$. +-/ +@[category research solved, AMS 5] +theorem erdos_626.variants.h_upper_odd : + ∀ m : ℕ, Odd m → ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (h m n : ℝ) ≤ (n : ℝ) ^ (2 / ((m : ℝ) + 1) + ε) := by + sorry + +/-- +Erdős conjectured that the bound in `Erdos626.erdos_626.variants.h_upper_odd` is sharp: for +odd $m$, +$$\lim_{n\to\infty}\frac{\log h^{(m)}(n)}{\log n} = \frac{2}{m+1}.$$ +-/ +@[category research open, AMS 5] +theorem erdos_626.variants.h_odd_conjecture : + ∀ m : ℕ, Odd m → Tendsto (fun n : ℕ ↦ Real.log (h m n : ℝ) / Real.log n) atTop + (𝓝 (2 / ((m : ℝ) + 1))) := by + sorry + +/-- +For even $m$, Erdős had no good guess for the value of the limit, other than that it should +lie in $\left[\frac{2}{m+2}, \frac{2}{m}\right]$. He could not prove this even for $m = 4$. + +The existence of the limit is open, so we state the claim for the lower and upper limits: for +every $\varepsilon > 0$, eventually +$n^{2/(m+2) - \varepsilon} \leq h^{(m)}(n) \leq n^{2/m + \varepsilon}$. We require $m \geq 2$, +since $2/m$ is undefined for $m = 0$. The upper half is known: girth $> m$ implies girth +$> m - 1$, so $h^{(m)}(n) \leq h^{(m-1)}(n)$, and `Erdos626.erdos_626.variants.h_upper_odd` for +the odd number $m - 1$ gives the exponent $2/m$. +-/ +@[category research open, AMS 5] +theorem erdos_626.variants.h_even_conjecture : + ∀ m : ℕ, Even m → 2 ≤ m → ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (n : ℝ) ^ (2 / ((m : ℝ) + 2) - ε) ≤ (h m n : ℝ) ∧ + (h m n : ℝ) ≤ (n : ℝ) ^ (2 / (m : ℝ) + ε) := by + sorry + +end Erdos626 diff --git a/FormalConjectures/ErdosProblems/627.lean b/FormalConjectures/ErdosProblems/627.lean new file mode 100644 index 0000000..c5e1560 --- /dev/null +++ b/FormalConjectures/ErdosProblems/627.lean @@ -0,0 +1,167 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 627 + +*References:* +- [erdosproblems.com/627](https://www.erdosproblems.com/627) +- [AFM25] Araujo, I. and Filipe, R. and Miyazaki, R., *A note on the maximum ratio between + chromatic number and clique number*. arXiv:2512.16062 (2025). +- [Er61d] Erdős, P., *Graph theory and probability. II*. Canadian J. Math. (1961), 346-352. +- [Er67c] Erdős, P., *Some remarks on chromatic graphs*. Colloq. Math. (1967), 253-256. +- [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. +- [My55] Mycielski, J., *Sur le coloriage des graphs*. Colloquium Mathematicum 3 (1955), 161–162. + [doi:10.4064/cm-3-2-161-162](https://doi.org/10.4064/cm-3-2-161-162) +- [Zy52] Zykov, A. A., *On some properties of linear complexes*. Amer. Math. Soc. Translation + (1952), 33. +-/ + +@[expose] public section + +open Filter SimpleGraph +open scoped Topology Asymptotics + +namespace Erdos627 + +/-- +`maxChromaticCliqueRatio n` is $f(n)$, the maximum of $\chi(G)/\omega(G)$ over all graphs $G$ on +$n$ vertices. + +A graph on `Fin n` is finite, so its chromatic number (an element of `ℕ∞`) is finite and +`ENat.toNat` returns it. The maximum is taken over the finitely many graphs on `Fin n`, so the +supremum is attained. For $n = 0$ the only graph is empty, with $\chi = \omega = 0$, and the +convention $0 / 0 = 0$ gives $f(0) = 0$; this does not affect any asymptotic statement below. +-/ +noncomputable def maxChromaticCliqueRatio (n : ℕ) : ℝ := + ⨆ G : SimpleGraph (Fin n), (G.chromaticNumber.toNat : ℝ) / (G.cliqueNum : ℝ) + +/-- +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_2n)^2}$$ +exist? + +Since $f(n) \asymp n/(\log_2 n)^2$ (see `Erdos627.erdos_627.variants.theta`), the limit, if it +exists, is a finite real number. +-/ +@[category research open, question, AMS 5] +theorem erdos_627 : + ∃ L : ℝ, Tendsto (fun n : ℕ ↦ maxChromaticCliqueRatio n / ((n : ℝ) / Real.logb 2 n ^ 2)) + atTop (𝓝 L) := by + sorry + +/-- +Erdős [Er67c] proved that +$$f(n) \asymp \frac{n}{(\log_2 n)^2}.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_627.variants.theta : + (fun n : ℕ ↦ maxChromaticCliqueRatio n) =Θ[atTop] + (fun n : ℕ ↦ (n : ℝ) / Real.logb 2 n ^ 2) := by + sorry + +/-- +Erdős [Er67c] proved the lower bound +$$f(n) \geq \left(\frac{1}{4} + o(1)\right) \frac{n}{(\log_2 n)^2}.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_627.variants.lower : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (1 / 4 - ε) * ((n : ℝ) / Real.logb 2 n ^ 2) ≤ maxChromaticCliqueRatio n := by + sorry + +/-- +The method of Erdős [Er67c] gives the upper bound +$$f(n) \leq (4 + o(1)) \frac{n}{(\log_2 n)^2}.$$ +Erdős states the constant as $1$, but Araujo, Filipe, and Miyazaki [AFM25] note that his method +gives $4$. +-/ +@[category research solved, AMS 5] +theorem erdos_627.variants.upper : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + maxChromaticCliqueRatio n ≤ (4 + ε) * ((n : ℝ) / Real.logb 2 n ^ 2) := by + sorry + +/-- +Consequently, if the limit in `Erdos627.erdos_627` exists, it lies in $[1/4, 4]$ [Er67c] +(with the correction of the upper constant from $1$ to $4$ noted in [AFM25]). +-/ +@[category research solved, AMS 5] +theorem erdos_627.variants.limit_bounds : + ∀ L : ℝ, Tendsto (fun n : ℕ ↦ maxChromaticCliqueRatio n / ((n : ℝ) / Real.logb 2 n ^ 2)) + atTop (𝓝 L) → 1 / 4 ≤ L ∧ L ≤ 4 := by + sorry + +/-- +Araujo, Filipe, and Miyazaki [AFM25, Theorem 1.3] improved the upper bound to +$$f(n) \leq (3.71943 + o(1)) \frac{n}{(\log_2 n)^2},$$ +using recent improvements in the asymptotics of Ramsey numbers. [AFM25] is an arXiv preprint. +-/ +@[category research solved, AMS 5] +theorem erdos_627.variants.afm_upper : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + maxChromaticCliqueRatio n ≤ (3.71943 + ε) * ((n : ℝ) / Real.logb 2 n ^ 2) := by + sorry + +/-- +Araujo, Filipe, and Miyazaki [AFM25, Theorem 1.2]: suppose that $R(s,t) \leq R(k)$ for all +$s, t, k \in \mathbb{N}$ with $st \leq k^2$ (their Conjecture 1.1), and that +$\lim_{k \to \infty} \frac{\log_2 R(k)}{k}$ exists and equals $\ell$. Then +$$f(n) = (\ell^2 + o(1)) \frac{n}{(\log_2 n)^2},$$ +so the limit in `Erdos627.erdos_627` exists and equals $\ell^2$. Here $R(s,t)$ is the +two-colour Ramsey number and $R(k) = R(k,k)$ (see [77]). [AFM25] is an arXiv preprint. +-/ +@[category research solved, AMS 5] +theorem erdos_627.variants.conditional (ℓ : ℝ) + (hR : ∀ s t k : ℕ, s * t ≤ k ^ 2 → classicalRamsey s t ≤ diagonalRamsey k) + (hlim : Tendsto (fun k : ℕ ↦ Real.logb 2 (diagonalRamsey k : ℝ) / (k : ℝ)) atTop (𝓝 ℓ)) : + Tendsto (fun n : ℕ ↦ maxChromaticCliqueRatio n / ((n : ℝ) / Real.logb 2 n ^ 2)) + atTop (𝓝 (ℓ ^ 2)) := by + sorry + +/-- +Tutte and Zykov [Zy52] independently proved that for every $k$ there is a graph with +$\omega(G) = 2$ and $\chi(G) = k$. + +We require $k \geq 2$: a graph with $\omega(G) = 2$ has an edge, so $\chi(G) \geq 2$. +The proof here uses Mycielski's construction [My55]. +-/ +@[category research solved, AMS 5] +theorem erdos_627.variants.tutte_zykov : + ∀ k : ℕ, 2 ≤ k → ∃ (n : ℕ) (G : SimpleGraph (Fin n)), + G.cliqueNum = 2 ∧ G.chromaticNumber = (k : ℕ∞) := by + exact exists_cliqueNum_eq_two_chromaticNumber_eq + +/-- +Erdős [Er61d] proved that for every (large) $n$ there is a graph on $n$ vertices with +$\omega(G) = 2$ and +$$\chi(G) \gg \frac{n^{1/2}}{\log n},$$ +whence $f(n) \gg n^{1/2}/\log n$. +-/ +@[category research solved, AMS 5] +theorem erdos_627.variants.erdos_1961 : + ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, ∃ G : SimpleGraph (Fin n), + G.cliqueNum = 2 ∧ + c * Real.sqrt (n : ℝ) / Real.log (n : ℝ) ≤ (G.chromaticNumber.toNat : ℝ) := by + sorry + +end Erdos627 diff --git a/FormalConjectures/ErdosProblems/628.lean b/FormalConjectures/ErdosProblems/628.lean index 3aa4c36..df9aeb5 100644 --- a/FormalConjectures/ErdosProblems/628.lean +++ b/FormalConjectures/ErdosProblems/628.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 628 @@ -30,6 +31,8 @@ import FormalConjecturesUtil (2022), 259--274. -/ +@[expose] public section + namespace Erdos628 open SimpleGraph diff --git a/FormalConjectures/ErdosProblems/629.lean b/FormalConjectures/ErdosProblems/629.lean new file mode 100644 index 0000000..7f07841 --- /dev/null +++ b/FormalConjectures/ErdosProblems/629.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 629 + +*References:* +- [erdosproblems.com/629](https://www.erdosproblems.com/629) +- [ERT80] Erdős, Paul and Rubin, Arthur L. and Taylor, Herbert, *Choosability in graphs*. + Proceedings of the West Coast Conference on Combinatorics, Graph Theory and Computing (1979), + Congress. Numer. XXVI (1980), 125-157. [PDF](https://www.renyi.hu/~p_erdos/1980-07.pdf) +- [HMT96] Hanson, Denis and MacGillivray, Gary and Toft, Bjarne, *Choosability of bipartite + graphs*. Ars Combin. (1996), 183-192. +- [RaSr00] Radhakrishnan, Jaikumar and Srinivasan, Aravind, *Improved bounds and algorithms for + hypergraph $2$-coloring*. Random Structures Algorithms (2000), 4-32. +-/ + +@[expose] public section + +open Filter SimpleGraph + +namespace Erdos629 + +/-- $n(k)$: the least number of vertices of a bipartite graph $G$ with $\chi_L(G) > k$. +Bipartite means `Colorable 2`, as in [ERT80], which asks for the least number of nodes of a +$2$-colorable graph that is not $k$-choosable. -/ +noncomputable def n (k : ℕ) : ℕ := + sInf {m : ℕ | ∃ G : SimpleGraph (Fin m), G.Colorable 2 ∧ k < G.listChromaticNumber} + +/-- Any bipartite graph $G$ on $m$ vertices with $\chi_L(G) > k$ gives $n(k) \leq m$. -/ +@[category API, AMS 5] +theorem n_le {k m : ℕ} (G : SimpleGraph (Fin m)) (hG : G.Colorable 2) + (hk : k < G.listChromaticNumber) : n k ≤ m := + Nat.sInf_le ⟨G, hG, hk⟩ + +def erdos_629.answer : ℕ → ℕ := sorry + +/-- +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. + +Determine the minimal number of vertices $n(k)$ of a bipartite graph $G$ such that +$\chi_L(G)>k$. +-/ +@[category research open, question value, AMS 5] +theorem erdos_629 : n = erdos_629.answer := by + sorry + +/-- +A problem of Erdős, Rubin, and Taylor [ERT80], who proved that +$$2^{k-1} (0 : ℝ), ∀ᶠ k : ℕ in atTop, + c * 2 ^ k * Real.sqrt (k / Real.log k) ≤ (n k : ℝ) := by + sorry + +/-- +Erdős, Rubin, and Taylor [ERT80] proved $n(2)=6$. +-/ +@[category research solved, AMS 5] +theorem erdos_629.variants.n_two : n 2 = 6 := by + sorry + +/-- +Hanson, MacGillivray, and Toft [HMT96] proved $n(3)=14$. +-/ +@[category research solved, AMS 5] +theorem erdos_629.variants.n_three : n 3 = 14 := by + sorry + +/-- +Hanson, MacGillivray, and Toft [HMT96] proved +$$n(k) \leq kn(k-2)+2^k.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_629.variants.hmt_recursion (k : ℕ) (hk : 2 ≤ k) : + n k ≤ k * n (k - 2) + 2 ^ k := by + sorry + +end Erdos629 diff --git a/FormalConjectures/ErdosProblems/64.lean b/FormalConjectures/ErdosProblems/64.lean index 22b941b..a01746b 100644 --- a/FormalConjectures/ErdosProblems/64.lean +++ b/FormalConjectures/ErdosProblems/64.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 64 @@ -22,15 +23,17 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/64](https://www.erdosproblems.com/64) -/ +@[expose] public section + namespace Erdos64 /-- Does every finite graph with minimum degree at least $3$ contain a cycle of length $2^k$ for some $k \geq 2$? -/ -@[category research open, AMS 5] +@[category research open, question, AMS 5] theorem erdos_64 : - answer(sorry) ↔ ∀ (V : Type*) (G : SimpleGraph V) [Fintype V] [DecidableRel G.Adj], + ∀ (V : Type*) (G : SimpleGraph V) [Fintype V] [DecidableRel G.Adj], G.minDegree ≥ 3 → ∃ (k : ℕ) (v : V) (c : G.Walk v v), k ≥ 2 ∧ c.IsCycle ∧ c.length = 2^k := by sorry diff --git a/FormalConjectures/ErdosProblems/640.lean b/FormalConjectures/ErdosProblems/640.lean new file mode 100644 index 0000000..3837739 --- /dev/null +++ b/FormalConjectures/ErdosProblems/640.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 640 + +*References:* +- [erdosproblems.com/640](https://www.erdosproblems.com/640) +- [Er97d] Erdős, Paul, *Some recent problems and results in graph theory*. Discrete Math. + (1997), 81–85, p.84. +-/ + +@[expose] public section + +open SimpleGraph + +namespace Erdos640 + +/-- An odd cycle whose vertices induce a graph of chromatic number at least `k`. -/ +def HasHighChromaticOddCycle {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∃ v, ∃ p : G.Walk v v, p.IsCycle ∧ Odd p.length ∧ + (k : ℕ∞) ≤ (G.induce {x | x ∈ p.support}).chromaticNumber + +/-- +For every $k \geq 3$, does there exist $f(k)$ such that every finite graph of chromatic +number at least $f(k)$ has an odd cycle whose vertices induce a graph of chromatic +number at least $k$? The cycle may have chords in the ambient graph. +-/ +@[category research open, question, AMS 5] +theorem erdos_640 : + ∀ k : ℕ, 3 ≤ k → ∃ N : ℕ, ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + (N : ℕ∞) ≤ G.chromaticNumber → HasHighChromaticOddCycle G k := by + sorry + +/-- Every finite graph of chromatic number at least $3$ has an odd cycle whose vertices +induce a graph of chromatic number at least $3$. -/ +@[category textbook, AMS 5, formal_proof using lean4 at + "https://github.com/AItoBit/formal-conjectures/blob/0e6191e205ebdc112d8d5c8ec8ff9a3f7f1b0616/proofs/erdos640/Erdos640.lean"] +theorem erdos_640.variants.three (n : ℕ) (G : SimpleGraph (Fin n)) + (hG : (3 : ℕ∞) ≤ G.chromaticNumber) : HasHighChromaticOddCycle G 3 := by + sorry + +end Erdos640 diff --git a/FormalConjectures/ErdosProblems/642.lean b/FormalConjectures/ErdosProblems/642.lean new file mode 100644 index 0000000..f047f8a --- /dev/null +++ b/FormalConjectures/ErdosProblems/642.lean @@ -0,0 +1,147 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 642 + +*References:* +- [erdosproblems.com/642](https://www.erdosproblems.com/642) +- [CES96] Chen, Guantao and Erdős, Paul and Staton, William, *Proof of a conjecture of Bollobás + on nested cycles*. J. Combin. Theory Ser. B (1996), 38--43. +- [DMMS24] Draganić, Nemanja and Methuku, Abhishek and Munhá Correia, David and Sudakov, + Benny, *Cycles with many chords*. Random Structures Algorithms (2024), 3--16. +- [Er97d] Erdős, Paul, *Some recent problems and results in graph theory*. Discrete Math. + (1997), 81-85. +-/ + +@[expose] public section + +open Filter + +namespace Erdos642 + +/-- Every cycle of the graph `G` has more vertices than chords. + +A cycle is a closed walk `c` with `c.IsCycle`. It has `c.length` vertices. A chord of `c` is an +edge of `G` between two vertices of `c` that is not an edge of `c` +(`SimpleGraph.Walk.IsChord`). -/ +def CyclesHaveMoreVerticesThanChords {V : Type*} (G : SimpleGraph V) : Prop := + ∀ (v : V) (c : G.Walk v v), c.IsCycle → {e : Sym2 V | c.IsChord e}.ncard < c.length + +open scoped Classical in +/-- The maximal number $f(n)$ of edges of a graph on `n` vertices in which every cycle has more +vertices than chords. There are finitely many graphs on `Fin n`, so the supremum is a maximum. -/ +noncomputable def maxEdges (n : ℕ) : ℕ := + (Finset.univ.filter fun G : SimpleGraph (Fin n) => CyclesHaveMoreVerticesThanChords G).sup + fun G => G.edgeSet.ncard + +/-- +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 problem of Hamburger and Szegedy. A chord is an edge between two vertices of the cycle which are +not consecutive in the cycle. +-/ +@[category research open, question, AMS 5] +theorem erdos_642 : + (fun n : ℕ => (maxEdges n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ)) := by + sorry + +/-- Chen, Erdős, and Staton [CES96] proved $f(n) \ll n^{3/2}$. -/ +@[category research solved, AMS 5] +theorem erdos_642.variants.upper_bound_n_pow_three_halves : + (fun n : ℕ => (maxEdges n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ) ^ (3 / 2 : ℝ)) := by + sorry + +/-- +Draganić, Methuku, Munhá Correia, and Sudakov [DMMS24] have improved this to +$$f(n) \ll n(\log n)^8.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_642.variants.upper_bound_n_log_pow_eight : + (fun n : ℕ => (maxEdges n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ) * Real.log n ^ 8) := by + sorry + +/-- A graph without cycles satisfies the condition, since there is no cycle to check. -/ +@[category test, AMS 5] +theorem cyclesHaveMoreVerticesThanChords_of_isAcyclic {V : Type*} {G : SimpleGraph V} + (hG : G.IsAcyclic) : CyclesHaveMoreVerticesThanChords G := + fun _ c hc => absurd hc (hG c) + +open scoped Classical in +/-- Every graph on `n` vertices in which every cycle has more vertices than chords has at most +`maxEdges n` edges. -/ +@[category API, AMS 5] +theorem le_maxEdges {n : ℕ} (G : SimpleGraph (Fin n)) + (hG : CyclesHaveMoreVerticesThanChords G) : G.edgeSet.ncard ≤ maxEdges n := by + unfold maxEdges + exact Finset.le_sup (f := fun H : SimpleGraph (Fin n) => H.edgeSet.ncard) + (Finset.mem_filter.2 ⟨Finset.mem_univ G, hG⟩) + +/-- The maximum defining $f(n)$ is attained by an admissible graph. -/ +@[category API, AMS 5] +theorem exists_maxEdges (n : ℕ) : + ∃ G : SimpleGraph (Fin n), CyclesHaveMoreVerticesThanChords G ∧ + G.edgeSet.ncard = maxEdges n := by + classical + have hne : (Finset.univ.filter fun G : SimpleGraph (Fin n) => + CyclesHaveMoreVerticesThanChords G).Nonempty := by + refine ⟨⊥, Finset.mem_filter.2 ⟨Finset.mem_univ _, ?_⟩⟩ + exact cyclesHaveMoreVerticesThanChords_of_isAcyclic SimpleGraph.isAcyclic_bot + obtain ⟨G, hG, hmax⟩ := Finset.exists_mem_eq_sup _ hne (fun G => G.edgeSet.ncard) + exact ⟨G, (Finset.mem_filter.1 hG).2, hmax.symm⟩ + +/-- The elementary bound $f(n)\leq\binom n2$. -/ +@[category API, AMS 5] +theorem maxEdges_le_choose_two (n : ℕ) : maxEdges n ≤ n.choose 2 := by + classical + obtain ⟨G, _, hG⟩ := exists_maxEdges n + rw [← hG] + simpa only [SimpleGraph.edgeFinset, Set.ncard_eq_toFinset_card', Fintype.card_fin] using + G.card_edgeFinset_le_card_choose_two + +/-- There are no edges on an empty vertex set. -/ +@[category test, AMS 5] +theorem maxEdges_zero : maxEdges 0 = 0 := by + have := maxEdges_le_choose_two 0 + simpa using this + +/-- The asymptotic question is equivalent to a uniform linear edge bound for every admissible +finite graph, including the empty graph. -/ +@[category API, AMS 5] +theorem isBigO_iff_uniform_edge_bound : + ((fun n : ℕ => (maxEdges n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ))) ↔ + ∃ C : ℝ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + CyclesHaveMoreVerticesThanChords G → (G.edgeSet.ncard : ℝ) ≤ C * n := by + have hzero : ∀ n : ℕ, (n : ℝ) = 0 → (maxEdges n : ℝ) = 0 := by + intro n hn + have : n = 0 := by exact_mod_cast hn + simp [this, maxEdges_zero] + rw [Asymptotics.isBigO_nat_atTop_iff hzero] + simp only [Real.norm_natCast] + constructor + · rintro ⟨C, hC⟩ + refine ⟨C, fun n G hG => ?_⟩ + exact (Nat.cast_le.2 (le_maxEdges G hG)).trans (hC n) + · rintro ⟨C, hC⟩ + refine ⟨C, fun n => ?_⟩ + obtain ⟨G, hG, hmax⟩ := exists_maxEdges n + simpa [hmax] using hC n G hG + +end Erdos642 diff --git a/FormalConjectures/ErdosProblems/643.lean b/FormalConjectures/ErdosProblems/643.lean new file mode 100644 index 0000000..1492db0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/643.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 643 + +*References:* +- [erdosproblems.com/643](https://www.erdosproblems.com/643) +- [Fu84] F\"uredi, Z., Hypergraphs in which all disjoint pairs have distinct unions. Combinatorica + (1984), 161--168. +- [PiVe09] Pikhurko, Oleg and Verstra\"{e}te, Jacques, The maximum size of hypergraphs without + generalized 4-cycles. J. Combin. Theory Ser. A (2009), 637--649. +- [HMY26] Huang, Hao, Ma, Jie, and Yang, Tianchi, *Extremal hypergraphs without generalized + 4-cycles*. [arXiv:2609.37744](https://arxiv.org/abs/2609.37744) (2026), Theorem 1.2. +-/ + +@[expose] public section + +namespace Erdos643 + +open Filter Asymptotics + +/-- The least number of edges forcing two distinct disjoint pairs with the same union. +It is one more than the maximum size of an avoiding family. -/ +noncomputable def forcingThreshold (n t : ℕ) : ℕ := + Hypergraph.extremalNumber n t (fun H ↦ ¬ H.HasRepeatedDisjointUnion) + 1 + +def erdos_643.parts.i.answer : ℕ → ℕ → ℝ := sorry + +/-- +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}?$$ +-/ +@[category research open, question value, AMS 5] +theorem erdos_643.parts.i : + ∀ t : ℕ, 1 ≤ t → + (fun n ↦ (forcingThreshold n t : ℝ)) ~[atTop] erdos_643.parts.i.answer t := by + sorry + +/-- +Is it true that $f(n;t)=(1+o(1))\binom{n}{t-1}$ for $t\geq 3$? + +For $t\geq4$, Huang, Ma, and Yang [HMY26] prove the exact extremal formula below. +The case $t=3$ remains open. +-/ +@[category research open, question, AMS 5] +theorem erdos_643.parts.ii : + ∀ t : ℕ, 3 ≤ t → + (fun n ↦ (forcingThreshold n t : ℝ)) ~[atTop] + (fun n ↦ (n.choose (t - 1) : ℝ)) := by + sorry + +/-- Huang, Ma, and Yang [HMY26, Theorem 1.2] determine the maximum size of an avoiding family +for each fixed $t\geq4$ and all sufficiently large $n$: +$$\binom{n-1}{t-1}+\left\lfloor\frac{n-1}{t}\right\rfloor.$$ +The forcing threshold is one larger. -/ +@[category research solved, AMS 5] +theorem erdos_643.variants.exact_t_ge_four : + ∀ t : ℕ, 4 ≤ t → ∀ᶠ n : ℕ in atTop, + Hypergraph.extremalNumber n t (fun H ↦ ¬ H.HasRepeatedDisjointUnion) = + (n - 1).choose (t - 1) + (n - 1) / t := by + sorry + +/-- The largest avoiding family attains the value one below the forcing threshold. -/ +@[category API, AMS 5] +theorem exists_avoiding_maximizer (n t : ℕ) : + ∃ H : Finset (Finset (Fin n)), H.IsUniform t ∧ ¬ H.HasRepeatedDisjointUnion ∧ + H.card + 1 = forcingThreshold n t := by + classical + let S := ((Finset.univ : Finset (Fin n)).powersetCard t).powerset.filter + fun H ↦ ¬ H.HasRepeatedDisjointUnion + have hne : S.Nonempty := by + refine ⟨∅, ?_⟩ + simp [S, Finset.HasRepeatedDisjointUnion] + obtain ⟨H, hH, hmax⟩ := Finset.exists_mem_eq_sup S hne Finset.card + have hmem := Finset.mem_filter.1 hH + refine ⟨H, ?_, hmem.2, ?_⟩ + · intro e he + exact (Finset.mem_powersetCard.1 (Finset.mem_powerset.1 hmem.1 he)).2 + · unfold forcingThreshold + apply congrArg (fun k : ℕ ↦ k + 1) + calc + H.card = S.sup Finset.card := hmax.symm + _ = Hypergraph.extremalNumber n t (fun H ↦ ¬ H.HasRepeatedDisjointUnion) := by + unfold Hypergraph.extremalNumber + congr 1 + ext K + simp [S] + +/-- A bound is at least the forcing threshold exactly when every uniform family with that +many edges contains the forbidden four-edge configuration. -/ +@[category API, AMS 5] +theorem forcingThreshold_le_iff (n t m : ℕ) : + forcingThreshold n t ≤ m ↔ + ∀ H : Finset (Finset (Fin n)), H.IsUniform t → + m ≤ H.card → H.HasRepeatedDisjointUnion := by + classical + constructor + · intro hm H hHt hcard + by_contra hfree + have hmem : H ∈ ((Finset.univ : Finset (Fin n)).powersetCard t).powerset.filter + (fun H ↦ ¬ H.HasRepeatedDisjointUnion) := by + refine Finset.mem_filter.2 ⟨Finset.mem_powerset.2 ?_, hfree⟩ + intro e he + exact Finset.mem_powersetCard.2 ⟨Finset.subset_univ _, hHt e he⟩ + have hmax : H.card < forcingThreshold n t := by + unfold forcingThreshold + apply Nat.lt_succ_of_le + unfold Hypergraph.extremalNumber + apply Finset.le_sup + simpa using hmem + omega + · intro hm + obtain ⟨H, hHt, hfree, hmax⟩ := exists_avoiding_maximizer n t + by_contra hlt + exact hfree (hm H hHt (by omega)) + +/-- When no edge of size $t$ fits in the ground set, the threshold is one. -/ +@[category test, AMS 5] +theorem forcingThreshold_eq_one_of_lt {n t : ℕ} (h : n < t) : + forcingThreshold n t = 1 := by + classical + have hempty : (Finset.univ : Finset (Fin n)).powersetCard t = ∅ := + Finset.powersetCard_eq_empty.2 (by simpa using h) + simp [forcingThreshold, Hypergraph.extremalNumber, hempty, Finset.HasRepeatedDisjointUnion] + +end Erdos643 diff --git a/FormalConjectures/ErdosProblems/644.lean b/FormalConjectures/ErdosProblems/644.lean new file mode 100644 index 0000000..edd0ac4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/644.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 644 + +*References:* +- [erdosproblems.com/644](https://www.erdosproblems.com/644) +- [EFKT92] Erdős, P. and Fon-Der-Flaass, D. and Kostochka, A. V. and Tuza, Zs., Small transversals in + uniform hypergraphs. Siberian Adv. Math. (1992), 82-88. +-/ + +@[expose] public section + +namespace Erdos644 + +open Filter Asymptotics + +/-- For $r \geq 3$, the transversal bound satisfies $f(k,r) \leq 2k$. -/ +@[category textbook, AMS 5] +theorem erdos_644.variants.elementary_upper_bound (k r : ℕ) (hr : 3 ≤ r) : + Hypergraph.subfamilyTransversalBound k r 2 ≤ ((2 * k : ℕ) : ℕ∞) := by + classical + unfold Hypergraph.subfamilyTransversalBound + refine iInf_le_of_le (2 * k) (iInf_le_of_le ?_ le_rfl) + intro V F hu hl + have hthree {e f g : Finset V} (he : e ∈ F) (hf : f ∈ F) (hg : g ∈ F) + (hef : Disjoint e f) (heg : Disjoint e g) (hfg : Disjoint f g) : False := by + obtain ⟨S, hS, hhit⟩ := hl {e, f, g} (by + simpa only [Finset.coe_insert, Finset.coe_singleton, Set.insert_subset_iff, + Set.singleton_subset_iff] using And.intro he (And.intro hf hg)) + (Finset.card_le_three.trans hr) + obtain ⟨x, hxS, hxe⟩ := hhit e (by simp) + obtain ⟨y, hyS, hyf⟩ := hhit f (by simp) + obtain ⟨z, hzS, hzg⟩ := hhit g (by simp) + have hxy : x ≠ y := fun h ↦ Finset.disjoint_left.mp hef hxe (h.symm ▸ hyf) + have hxz : x ≠ z := fun h ↦ Finset.disjoint_left.mp heg hxe (h.symm ▸ hzg) + have hyz : y ≠ z := fun h ↦ Finset.disjoint_left.mp hfg hyf (h.symm ▸ hzg) + have := Finset.card_le_card (show {x, y, z} ⊆ S by + simpa only [Finset.insert_subset_iff, Finset.singleton_subset_iff] using + And.intro hxS (And.intro hyS hzS)) + simp [hxy, hxz, hyz] at this + omega + by_cases hF : F.Nonempty + · obtain ⟨e, he⟩ := hF + by_cases hall : ∀ f ∈ F, ¬ Disjoint e f + · refine ⟨e, by rw [hu e he]; omega, ?_⟩ + intro f hf + simpa [Finset.not_disjoint_iff] using hall f hf + · push Not at hall + obtain ⟨f, hf, hef⟩ := hall + refine ⟨e ∪ f, (Finset.card_union_le e f).trans (by rw [hu e he, hu f hf]; omega), ?_⟩ + intro g hg + by_contra h + have heg : Disjoint e g := Finset.disjoint_left.mpr (by + intro x hxe hxg + exact h ⟨x, Finset.mem_union_left f hxe, hxg⟩) + have hfg : Disjoint f g := Finset.disjoint_left.mpr (by + intro x hxf hxg + exact h ⟨x, Finset.mem_union_right e hxf, hxg⟩) + exact hthree he hf hg hef heg hfg + · exact ⟨∅, by simp, fun e he ↦ (hF ⟨e, he⟩).elim⟩ + +/-- The extremal parameter is finite, so its conversion to $\mathbb{N}$ loses no value. -/ +@[category test, AMS 5] +theorem transversalBound_lt_top (k r : ℕ) (hr : 3 ≤ r) : + Hypergraph.subfamilyTransversalBound k r 2 < ⊤ := + lt_of_le_of_lt (erdos_644.variants.elementary_upper_bound k r hr) + (ENat.natCast_lt_top (2 * k)) + +/-- +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_is$ 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$. Is it +true that +$$f(k,7)=(1+o(1))\frac{3}{4}k?$$ +-/ +@[category research open, question, AMS 5] +theorem erdos_644.parts.i : + (fun k ↦ ((Hypergraph.subfamilyTransversalBound k 7 2).toNat : ℝ)) ~[atTop] + (fun k ↦ (3 / 4 : ℝ) * k) := by + sorry + +/-- +Is it true that for any $r\geq 3$ there exists some constant $c_r$ such that +$$f(k,r)=(1+o(1))c_rk?$$ +-/ +@[category research open, question, AMS 5] +theorem erdos_644.parts.ii : + ∀ r : ℕ, 3 ≤ r → ∃ c : ℝ, 0 < c ∧ + (fun k ↦ ((Hypergraph.subfamilyTransversalBound k r 2).toNat : ℝ)) ~[atTop] + (fun k ↦ c * k) := by + sorry + +end Erdos644 diff --git a/FormalConjectures/ErdosProblems/649.lean b/FormalConjectures/ErdosProblems/649.lean index 5da6656..16f3837 100644 --- a/FormalConjectures/ErdosProblems/649.lean +++ b/FormalConjectures/ErdosProblems/649.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 649 @@ -28,6 +29,8 @@ import FormalConjecturesUtil (1964), 816-818. -/ +@[expose] public section + namespace Erdos649 /-- @@ -38,13 +41,26 @@ In fact, the answer to this question as written is easily seen to be no, since t solutions to $2^k\equiv -1\pmod{7}$, and hence this fails with $p=2$ and $q=7$. It is possible that Erdős meant to exclude such obstructions, by amending this to 'odd primes' or 'all sufficiently large primes' or such. + +The statement below assumes $p \neq q$: for $p = q$ no such $n$ exists, because $p$ would divide +both $n$ and $n+1$. -/ -@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.29.1/ErdosProblems/Erdos649.lean"] -theorem erdos_649 : answer(False) ↔ - ∀ p q : ℕ, p.Prime → q.Prime → +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos649.lean#L488"] +theorem erdos_649 : + ¬ ∀ p q : ℕ, p.Prime → q.Prime → p ≠ q → ∃ n : ℕ, n.maxPrimeFac = p ∧ (n + 1).maxPrimeFac = q := by sorry +/-- +The number of solutions is finite for any fixed $p,q$ since the largest prime factor of $n(n+1)$ +tends to $\infty$ (Mahler [Ma35] showed that this is $\gg \log\log n$, see +[368](https://www.erdosproblems.com/368)). +-/ +@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos649.lean#L97"] +theorem erdos_649.variants.finite (p q : ℕ) : + {n : ℕ | n.maxPrimeFac = p ∧ (n + 1).maxPrimeFac = q}.Finite := by + sorry + /-- In fact, the answer to this question as written is easily seen to be no, since there are no solutions to $2^k\equiv -1\pmod{7}$, and hence this fails with $p=2$ and $q=7$. @@ -54,7 +70,7 @@ theorem erdos_649.variants.no_solution_two_seven : ¬ ∃ n : ℕ, n.maxPrimeFac = 2 ∧ (n + 1).maxPrimeFac = 7 := by rintro ⟨n, hn, hn'⟩ have h1n : 1 < n := by - have := (Nat.one_lt_maxPrimeFac_iff n).mp (by omega) + have := (Nat.one_lt_maxPrimeFac_iff (n := n)).mp (by omega) omega -- Since `2` is the greatest prime factor of `n`, it is the only one, so `n` is a power of `2`. obtain ⟨k, hpow⟩ : ∃ k, n = 2 ^ k := @@ -81,7 +97,7 @@ and hence $n$ is a quadratic residue modulo $q$. On the other hand, since $q\equ know that $-1$ is not a quadratic residue modulo $q$, and hence $n\not\equiv -1\pmod{q}$, so it is impossible for $q\mid n+1$. -/ -@[category research solved, AMS 11] +@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos649.lean#L374"] theorem erdos_649.variants.tong (p : ℕ) (hp : p.Prime) : {q : ℕ | q.Prime ∧ ¬ ∃ n : ℕ, n.maxPrimeFac = p ∧ (n + 1).maxPrimeFac = q}.Infinite := by @@ -91,8 +107,8 @@ theorem erdos_649.variants.tong (p : ℕ) (hp : p.Prime) : Tong asks whether, for any given odd prime $q$, there are infinitely many primes $p$ such that there is no integer $n$ with $P(n)=p$ and $P(n+1)=q$. -/ -@[category research open, AMS 11] -theorem erdos_649.variants.tong_question : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_649.variants.tong_question : ∀ q : ℕ, q.Prime → Odd q → {p : ℕ | p.Prime ∧ ¬ ∃ n : ℕ, n.maxPrimeFac = p ∧ (n + 1).maxPrimeFac = q}.Infinite := by @@ -107,13 +123,36 @@ $73\mid 2^{18}-1\mid n$. @[category textbook, AMS 11] theorem erdos_649.variants.sampaio : ¬ ∃ n : ℕ, n.maxPrimeFac = 19 ∧ (n + 1).maxPrimeFac = 2 := by - sorry + rintro ⟨n, hn, hn'⟩ + have hn0 : n ≠ 0 := by + rintro rfl + simp at hn + -- Since `2` is the greatest prime factor of `n + 1`, it is the only one, so `n + 1` is a power + -- of `2`. + obtain ⟨k, hpow⟩ : ∃ k, n + 1 = 2 ^ k := + ⟨_, Nat.eq_prime_pow_of_unique_prime_dvd (by omega) + (fun {q} hq hqd ↦ + le_antisymm (hn' ▸ Nat.le_maxPrimeFac (by omega) hq hqd) hq.two_le)⟩ + -- On the other hand `19` divides `n`, i.e. `2 ^ k ≡ 1 (mod 19)`. + have h19 : 19 ∣ n := hn ▸ Nat.maxPrimeFac_dvd + -- Modulo `2 ^ 18 - 1`, which both `19` and `73` divide, `2 ^ k` depends only on `k % 18`. + have hmod : 2 ^ k % (2 ^ 18 - 1) = 2 ^ (k % 18) % (2 ^ 18 - 1) := by + conv_lhs => rw [← Nat.div_add_mod k 18, pow_add, pow_mul] + rw [Nat.mul_mod, Nat.pow_mod] + norm_num + -- As `2` is a primitive root modulo `19`, this forces `18 ∣ k`, and then `73 ∣ 2 ^ 18 - 1 ∣ n`. + have h73 : 73 ∣ n := by + have hk : k % 18 < 18 := Nat.mod_lt _ (by norm_num) + interval_cases h : k % 18 <;> omega + -- But `73` is a prime factor of `n` larger than `19`. + have := hn ▸ Nat.le_maxPrimeFac hn0 (by norm_num) h73 + omega /-- Problem 6 in the 12th Romanian Master of Mathematics Competitions in 2020 was to prove that there exist infinitely many odd primes $p$ such that, for every $n$, $P(n)P(n+1)\neq 2p$. -/ -@[category textbook, AMS 11] +@[category textbook, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos649.lean#L1090"] theorem erdos_649.variants.rmm_2020 : {p : ℕ | p.Prime ∧ Odd p ∧ ∀ n : ℕ, n.maxPrimeFac * (n + 1).maxPrimeFac ≠ 2 * p}.Infinite := by diff --git a/FormalConjectures/ErdosProblems/65.lean b/FormalConjectures/ErdosProblems/65.lean new file mode 100644 index 0000000..478affd --- /dev/null +++ b/FormalConjectures/ErdosProblems/65.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 65 + +*References:* +- [erdosproblems.com/65](https://www.erdosproblems.com/65) +- [GKS84] Gyárfás, A., Komlós, J. and Szemerédi, E., On the distribution of cycle lengths in graphs. + J. Graph Theory (1984), 441-462. +- [GPSV85] Gyárfás, A., Prömel, H. J., Szemerédi, E. and Voigt, B., On the sum of the reciprocals + of cycle lengths in sparse graphs. Combinatorica (1985), 41-52. +- [LiMo20] Liu, H. and Montgomery, R., A solution to Erdős and Hajnal's odd cycle problem. + arXiv:2010.15802 (2020). +-/ + +@[expose] public section + +namespace Erdos65 + +/-- +Let $G$ be a graph with $n$ vertices and $kn$ edges, and $a_10$. Is it true that +$$\sum\frac{1}{a_i}\gg \log k?$$ + +Gyárfás, Komlós, and Szemerédi [GKS84] have proved that this sum is $\gg \log k$, so that only +the second question remains. + +The bound is stated for all sufficiently large $k$: [GKS84, Theorem 4'] proves it for $k \geq b$, +where $b$ is a constant. The case of $k$ slightly larger than $1$ is a separate problem, studied +in [GPSV85]. +-/ +@[category research solved, question, AMS 5] +theorem erdos_65.parts.i : + ∃ c > (0 : ℝ), ∀ᶠ k : ℝ in Filter.atTop, + ∀ (n : ℕ) (V : Type) [Fintype V] (G : SimpleGraph V), + 0 < n → + Fintype.card V = n → + (G.edgeSet.ncard : ℝ) = k * n → + (∑ᶠ a ∈ G.cycleLengths, (1 : ℝ) / a) ≥ c * Real.log k := by + sorry + +/-- +Is the sum $\sum\frac{1}{a_i}$ minimised when $G$ is a complete bipartite graph? + +This problem is #65 in Extremal Graph Theory in the graphs problem collection. +-/ +@[category research open, question, AMS 5] +theorem erdos_65.parts.ii : + ∀ (k : ℝ) (hk : 0 < k), + ∀ (n : ℕ) (V : Type) [Fintype V] (G : SimpleGraph V), + 0 < n → + Fintype.card V = n → + (G.edgeSet.ncard : ℝ) = k * n → + ∀ (A B : Type) [Fintype A] [Fintype B], + Fintype.card (A ⊕ B) = n → + ((completeBipartiteGraph A B).edgeSet.ncard : ℝ) = k * n → + (∑ᶠ a ∈ (completeBipartiteGraph A B).cycleLengths, (1 : ℝ) / a) ≤ + (∑ᶠ a ∈ G.cycleLengths, (1 : ℝ) / a) := by + sorry + +/-- +Liu and Montgomery [LiMo20, Corollary 1.2] have proved the asymptotically sharp lower bound of +$\geq (\tfrac{1}{2}-o(1))\log k$. +-/ +@[category research solved, AMS 5] +theorem erdos_65.variants.liu_montgomery : + ∀ ε > (0 : ℝ), ∀ᶠ k : ℝ in Filter.atTop, + ∀ (n : ℕ) (V : Type) [Fintype V] (G : SimpleGraph V), + 0 < n → + Fintype.card V = n → + (G.edgeSet.ncard : ℝ) = k * n → + (∑ᶠ a ∈ G.cycleLengths, (1 : ℝ) / a) ≥ (1 / 2 - ε) * Real.log k := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos65 diff --git a/FormalConjectures/ErdosProblems/654.lean b/FormalConjectures/ErdosProblems/654.lean new file mode 100644 index 0000000..720019f --- /dev/null +++ b/FormalConjectures/ErdosProblems/654.lean @@ -0,0 +1,157 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 654 + +*References:* +- [erdosproblems.com/654](https://www.erdosproblems.com/654) +- [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, Paul, *Some of my favourite unsolved problems*. Math. Japon. (1997), 527-537. +- [Fe26] T. Feng et al, *Semi-Autonomous Mathematics Discovery with Gemini: A Case Study on the + Erdős Problems*. arXiv:2601.22401 (2026). +-/ + +@[expose] public section + +open Filter Finset EuclideanGeometry + +namespace Erdos654 + +/-- +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 the other $x_j$. +Is it true that $f(n) > (1-o(1))n$? + +Erdős asks this in [Er97e]. The answer is no: Aletheia [Fe26] constructed, for every $m \geq 10$, +a set of $n = 4m$ points with no four on a circle such that every point has fewer than +$\frac{3}{4}n$ distinct distances to the other points. This gives infinitely many $n$, which is +enough to refute the statement with $\varepsilon = 1/8$. See `Erdos654.erdos_654.variants.feng`. +-/ +@[category research solved, question, AMS 52] +theorem erdos_654.parts.i : + ¬ ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, ∀ A : Finset ℝ², #A = n → NoFourConcyclic A → + ∃ x ∈ A, (1 - ε) * (n : ℝ) < (distinctDistancesFromOther A x : ℝ) := by + sorry + +/-- +Let $f(n)$ be as in `erdos_654.parts.i`. Is it true that $f(n) > (\frac{1}{3}+c)n$ for some +constant $c>0$ and all large $n$? +-/ +@[category research open, question, AMS 52] +theorem erdos_654.parts.ii : + ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, ∀ A : Finset ℝ², #A = n → NoFourConcyclic A → + ∃ x ∈ A, (1 / 3 + c) * (n : ℝ) < (distinctDistancesFromOther A x : ℝ) := by + sorry + +/-- +It is trivial that $f(n) \geq \frac{n-1}{3}$. + +In fact every point $x$ has at least $\frac{n-1}{3}$ distinct distances to the other points: a +circle centred at $x$ contains at most three other points, since four would lie on a common +circle. +-/ +@[category textbook, AMS 52] +theorem erdos_654.variants.trivial_bound (A : Finset ℝ²) (hA : NoFourConcyclic A) : + ∀ x ∈ A, ((#A : ℝ) - 1) / 3 ≤ (distinctDistancesFromOther A x : ℝ) := by + intro x hx + have hfib : ∀ d ∈ (A.erase x).image (fun y ↦ dist y x), + #{y ∈ A.erase x | dist y x = d} ≤ 3 := by + intro d _ + by_contra! h4 + obtain ⟨T, hT, hT4⟩ := Finset.exists_subset_card_eq h4 + refine hA (T : Set ℝ²) (fun y hy ↦ ?_) (by rw [Set.ncard_coe_finset, hT4]) + ⟨x, d, fun y hy ↦ (Finset.mem_filter.1 (hT (Finset.mem_coe.1 hy))).2⟩ + exact Finset.mem_of_mem_erase (Finset.mem_filter.1 (hT (Finset.mem_coe.1 hy))).1 + have hle := Finset.card_le_mul_card_image (A.erase x) 3 hfib + rw [Finset.card_erase_of_mem hx] at hle + have h1 : 1 ≤ #A := Finset.card_pos.2 ⟨x, hx⟩ + have hle' : #A - 1 ≤ 3 * distinctDistancesFromOther A x := by + unfold distinctDistancesFromOther + convert hle using 3 + ext d + simp + have : ((#A - 1 : ℕ) : ℝ) ≤ 3 * (distinctDistancesFromOther A x : ℝ) := by + exact_mod_cast hle' + rw [Nat.cast_sub h1, Nat.cast_one] at this + linarith + +/-- +Aletheia [Fe26] showed that for every $m \geq 10$ there is a set of $n = 4m$ points in +$\mathbb{R}^2$, no four on a circle, such that every point has fewer than $\frac{3}{4}n = 3m$ +distinct distances to the other points. + +The construction places $2m$ points on each of two perpendicular lines, so it is not in general +position. Each point has at most $3m - 1$ distinct distances to the other points. +-/ +@[category research solved, AMS 52] +theorem erdos_654.variants.feng (m : ℕ) (hm : 10 ≤ m) : + ∃ A : Finset ℝ², #A = 4 * m ∧ NoFourConcyclic A ∧ + ∀ x ∈ A, distinctDistancesFromOther A x < 3 * m := by + sorry + +/-- +Erdős [Er87b] and Erdős and Pach [ErPa90] ask the question of `erdos_654.parts.ii` under the +additional assumption that no three points are on a line. Let $x_1,\ldots,x_n\in \mathbb{R}^2$ with +no three points on a line and no four points on a circle. Is there some $x_i$ with at least +$(\frac{1}{3}+c)n$ distinct distances to the other $x_j$, for some constant $c>0$ and all large +$n$? +-/ +@[category research open, question, AMS 52] +theorem erdos_654.variants.general_position : + ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, ∀ A : Finset ℝ², #A = n → InGeneralPosition A → + ∃ x ∈ A, (1 / 3 + c) * (n : ℝ) < (distinctDistancesFromOther A x : ℝ) := by + sorry + +/-- +Let $x_1,\ldots,x_n\in \mathbb{R}^2$ with no three points on a line and no four points on a +circle. Is there some $x_i$ with at least $(1-o(1))n$ distinct distances to the other $x_j$? + +This is the general-position analogue of `Erdos654.erdos_654.parts.i`. The remark on +erdosproblems.com notes that the construction of [Fe26], which has all points on two lines, does +not settle the version in general position. +-/ +@[category research open, question, AMS 52] +theorem erdos_654.variants.general_position_one_sub_eps : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, ∀ A : Finset ℝ², #A = n → InGeneralPosition A → + ∃ x ∈ A, (1 - ε) * (n : ℝ) < (distinctDistancesFromOther A x : ℝ) := by + sorry + +/-- `AtMostTwoPerCircle A` means that every circle centred at a point $x \in A$ contains at most +two other points of $A$. -/ +def AtMostTwoPerCircle (A : Finset ℝ²) : Prop := + ∀ x ∈ A, ∀ r : ℝ, #((A.erase x).filter fun y ↦ dist y x = r) ≤ 2 + +/-- +Erdős and Pach [ErPa90] suggest that the bound $(1-o(1))n$ holds under the assumption that every +circle centred at a point $x_i$ contains at most $2$ other points $x_j$. We state this for points +in general position (no three on a line and no four on a circle [Er87b, p. 167]), the setting in +which [Er87b] and [ErPa90] ask the weaker question. Without the assumption of no three points on a +line the statement is false: the sets of [Fe26] satisfy the circle condition. +-/ +@[category research open, question, AMS 52] +theorem erdos_654.variants.erdos_pach : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, ∀ A : Finset ℝ², #A = n → InGeneralPosition A → + AtMostTwoPerCircle A → ∃ x ∈ A, (1 - ε) * (n : ℝ) < (distinctDistancesFromOther A x : ℝ) := by + sorry + +end Erdos654 diff --git a/FormalConjectures/ErdosProblems/655.lean b/FormalConjectures/ErdosProblems/655.lean index 996dbb2..e7c4ab2 100644 --- a/FormalConjectures/ErdosProblems/655.lean +++ b/FormalConjectures/ErdosProblems/655.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 655 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/655](https://www.erdosproblems.com/655) -/ +@[expose] public section + open Filter Finset EuclideanGeometry namespace Erdos655 @@ -45,9 +48,9 @@ the points are in general position was intended; see `erdos_655.variants.general The disproof — the regular `n`-gon construction together with its supporting lemmas — is formalised at the linked commit. -/ -@[category research solved, AMS 5 52, formal_proof using formal_conjectures at "https://github.com/AlperTheKing/formal-conjectures/blob/4aaaf544b6ed0ef22580787a8d8a19e85dc49556/FormalConjectures/ErdosProblems/655.lean"] +@[category research solved, question, AMS 5 52, formal_proof using formal_conjectures at "https://github.com/AlperTheKing/formal-conjectures/blob/4aaaf544b6ed0ef22580787a8d8a19e85dc49556/FormalConjectures/ErdosProblems/655.lean"] theorem erdos_655 : - answer(False) ↔ ∃ c > (0 : ℝ), ∀ᶠ n in atTop, ∀ (X : Finset ℝ²), #X = n → IsValid X → + ¬ ∃ c > (0 : ℝ), ∀ᶠ n in atTop, ∀ (X : Finset ℝ²), #X = n → IsValid X → (1 + c) * n / 2 ≤ distinctDistances X := by sorry @@ -59,9 +62,9 @@ all $n$ sufficiently large? In the spirit of related conjectures of Erdős and others, presumably some kind of assumption that the points are in general position (e.g. no three on a line and no four on a circle) was intended.-/ -@[category research open, AMS 5 52] +@[category research open, question, AMS 5 52] theorem erdos_655.variants.general_position : - answer(sorry) ↔ ∃ c > (0 : ℝ), ∀ᶠ n in atTop, ∀ (X : Finset ℝ²), #X = n → IsValid X → + ∃ c > (0 : ℝ), ∀ᶠ n in atTop, ∀ (X : Finset ℝ²), #X = n → IsValid X → InGeneralPosition X → (1 + c) * n / 2 ≤ distinctDistances X := by sorry diff --git a/FormalConjectures/ErdosProblems/657.lean b/FormalConjectures/ErdosProblems/657.lean new file mode 100644 index 0000000..0bc4fcf --- /dev/null +++ b/FormalConjectures/ErdosProblems/657.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 657 + +*References:* +- [erdosproblems.com/657](https://www.erdosproblems.com/657) +- [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. +- [Er75f] Erdős, Paul, *On some problems of elementary and combinatorial geometry*. Ann. Mat. + Pura Appl. (4) (1975), 99-108. +- [ErPa90] Erdős, P. and Pach, J., *Variations on the theme of repeated distances*. + Combinatorica (1990), 261-269. +- [Er97e] Erdős, Paul, *Some of my favourite unsolved problems*. Math. Japon. (1997), 527-537. +- [Du08] Dumitrescu, Adrian, *On distinct distances and λ-free point sets*. Discrete Math. + (2008), 6533-6538. +-/ + +@[expose] public section + +open Filter +open scoped EuclideanGeometry + +namespace Erdos657 + +/-- +Is it true that if $A\subset \mathbb{R}^2$ is a set of $n$ points such that every subset of $3$ +points determines $3$ distinct distances (that is, $A$ has no isosceles triangles, degenerate +ones included) then $A$ determines at least $f(n)n$ distinct distances, for some function $f$ +with $f(n)\to \infty$? +-/ +@[category research open, question, AMS 52] +theorem erdos_657 : + ∃ f : ℕ → ℝ, Tendsto f atTop atTop ∧ + ∀ n : ℕ, ∀ A : Finset ℝ², A.card = n → (A : Set ℝ²).IsIsoscelesFree → + f n * (n : ℝ) ≤ (distinctDistances A : ℝ) := by + sorry + +/-- +In [Er73] Erdős attributes the problem, more generally in $\mathbb{R}^k$, to himself and Davies: +for every fixed $k \geq 1$, is there a function $f$ with $f(n)\to \infty$ such that every set of +$n$ points in $\mathbb{R}^k$ with no isosceles triangles determines at least $f(n)n$ distinct +distances? + +Here the dimension $k$ is fixed and $f$ may depend on $k$. +-/ +@[category research open, question, AMS 52] +theorem erdos_657.variants.higher_dim : + ∀ k : ℕ, 1 ≤ k → ∃ f : ℕ → ℝ, Tendsto f atTop atTop ∧ + ∀ n : ℕ, ∀ A : Finset (ℝ^k), A.card = n → (A : Set (ℝ^k)).IsIsoscelesFree → + f n * (n : ℝ) ≤ (distinctDistances A : ℝ) := by + sorry + +/-- +The question on the real line, which Erdős [Er73] said was open, has a positive answer: there is +a function $f$ with $f(n)\to \infty$ such that every set of $n$ real numbers with no three-term +arithmetic progression determines at least $f(n)n$ distinct distances. This follows from the +lower bound of Dumitrescu [Du08]. + +On the line, a set has no isosceles triangle exactly when it has no three-term arithmetic +progression. +-/ +@[category research solved, question, AMS 11 52] +theorem erdos_657.variants.dim_one : + ∃ f : ℕ → ℝ, Tendsto f atTop atTop ∧ + ∀ n : ℕ, ∀ A : Finset ℝ, A.card = n → (A : Set ℝ).IsIsoscelesFree → + f n * (n : ℝ) ≤ (distinctDistances A : ℝ) := by + sorry + +/-- +Dumitrescu [Du08] proved that there is a constant $c > 0$ such that, for all large $n$, every set +of $n$ real numbers with no three-term arithmetic progression determines at least +$n(\log n)^c$ distinct distances. +-/ +@[category research solved, AMS 11 52] +theorem erdos_657.variants.dim_one_lower : + ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + ∀ A : Finset ℝ, A.card = n → (A : Set ℝ).IsIsoscelesFree → + (n : ℝ) * (Real.log n) ^ c ≤ (distinctDistances A : ℝ) := by + sorry + +/-- +As noted in [Du08], Behrend's construction of large sets without three-term arithmetic +progressions shows that there is a constant $C > 0$ such that, for all large $n$, some set +of $n$ real numbers with no three-term arithmetic progression determines at most +$n 2^{C\sqrt{\log n}}$ distinct distances. +-/ +@[category research solved, AMS 11 52] +theorem erdos_657.variants.dim_one_upper : + ∃ C > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + ∃ A : Finset ℝ, A.card = n ∧ (A : Set ℝ).IsIsoscelesFree ∧ + (distinctDistances A : ℝ) ≤ (n : ℝ) * (2 : ℝ) ^ (C * √(Real.log n)) := by + sorry + +/-- +Straus observed that for every $k$ there is a set of $2^k$ points in $\mathbb{R}^k$ with no +isosceles triangles which determines at most $2^k - 1$ distinct distances. +-/ +@[category research solved, AMS 52] +theorem erdos_657.variants.straus (k : ℕ) : + ∃ A : Finset (ℝ^k), A.card = 2 ^ k ∧ (A : Set (ℝ^k)).IsIsoscelesFree ∧ + distinctDistances A ≤ 2 ^ k - 1 := by + sorry + +end Erdos657 diff --git a/FormalConjectures/ErdosProblems/660.lean b/FormalConjectures/ErdosProblems/660.lean index e26a868..3d7ca42 100644 --- a/FormalConjectures/ErdosProblems/660.lean +++ b/FormalConjectures/ErdosProblems/660.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 660 @@ -28,6 +29,8 @@ import FormalConjecturesUtil Appl. (4) (1975), 99–108. -/ +@[expose] public section + open scoped EuclideanGeometry namespace Erdos660 @@ -49,12 +52,11 @@ The $(1 - o(1)) \frac{n}{2}$ lower bound is formalised as: for every $\varepsilo of $n$ vertices of a convex polyhedron with $n$ sufficiently large determines at least $(1 - \varepsilon) \frac{n}{2}$ distinct distances. -/ -@[category research open, AMS 51 52] +@[category research open, question, AMS 51 52] theorem erdos_660 : - answer(sorry) ↔ - ∀ ε : ℝ, 0 < ε → ∀ᶠ n in Filter.atTop, ∀ P : Finset ℝ³, - P.card = n → IsPolyhedronVertices P → - (1 - ε) * ((n : ℝ) / 2) ≤ (distinctDistances P : ℝ) := by + ∀ ε : ℝ, 0 < ε → ∀ᶠ n in Filter.atTop, ∀ P : Finset ℝ³, + P.card = n → IsPolyhedronVertices P → + (1 - ε) * ((n : ℝ) / 2) ≤ (distinctDistances P : ℝ) := by sorry /-- @@ -72,9 +74,9 @@ theorem erdos_660.variants.altman_planar (n : ℕ) (P : Finset ℝ²) In [Er75f] Erdős claims that Altman proved that the vertices determine $\gg n$ many distinct distances, but gives no reference. -/ -@[category research open, AMS 51 52] +@[category research open, question, AMS 51 52] theorem erdos_660.variants.Er75f : - answer(sorry) ↔ ∃ c > (0 : ℝ), ∀ᶠ n in Filter.atTop, ∀ P : Finset ℝ³, + ∃ c > (0 : ℝ), ∀ᶠ n in Filter.atTop, ∀ P : Finset ℝ³, P.card = n → IsPolyhedronVertices P → c * n ≤ (distinctDistances P : ℝ) := by sorry diff --git a/FormalConjectures/ErdosProblems/661.lean b/FormalConjectures/ErdosProblems/661.lean new file mode 100644 index 0000000..87bb14f --- /dev/null +++ b/FormalConjectures/ErdosProblems/661.lean @@ -0,0 +1,143 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 661 + +*References:* +- [erdosproblems.com/661](https://www.erdosproblems.com/661) +- [ErPa90] Erdős, P. and Pach, J., *Variations on the theme of repeated distances*. + Combinatorica (1990), 261--269. +- [Er92e] Erdős, Pál, *Some Unsolved problems in Geometry, Number Theory and Combinatorics*. + Eureka (1992), 44-48. +- [Er97e] Erdős, Paul, *Some of my favourite unsolved problems*. Math. Japon. (1997), 527-537. +- [Er97f] Erdős, Paul, *Some unsolved problems*. Combinatorics, geometry and probability + (Cambridge, 1993) (1997), 1-10. +- [Er46] Erdős, Paul, *On sets of distances of $n$ points*. Amer. Math. Monthly 53 (1946), + 248--250. +-/ + +@[expose] public section + +open Filter Finset EuclideanGeometry + +namespace Erdos661 + +variable {X : Type*} [MetricSpace X] + +/-- The set of distances $d(x, y)$ with $x \in A$ and $y \in B$. -/ +noncomputable def crossDistanceSet (A B : Finset X) : Finset ℝ := + (A ×ˢ B).image fun p : X × X => dist p.1 p.2 + +variable (X) in +/-- The minimal number of distinct distances $d(x_i, y_j)$ over all choices of $2n$ distinct +points $x_1, \ldots, x_n, y_1, \ldots, y_n$ in `X`. + +The $x_i$ form a set `A` of $n$ points, the $y_j$ form a set `B` of $n$ points, and `A` and `B` +are disjoint, so all $2n$ points are distinct. -/ +noncomputable def minimalCrossDistances (n : ℕ) : ℕ := + sInf {m : ℕ | ∃ A B : Finset X, #A = n ∧ #B = n ∧ Disjoint A B ∧ + #(crossDistanceSet A B) = m} + +/-- +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\left(\frac{n}{\sqrt{\log n}}\right)?$$ + +We require all $2n$ points to be distinct; without any distinctness one could take all points +equal and get a single distance. Writing $F(n)$ for the minimal number of such distances +(`minimalCrossDistances ℝ² n`), the question asks whether $F(n) = o(n / \sqrt{\log n})$. This is +equivalent to the existence, for all large $n$, of configurations whose count is at most $g(n)$ +for some fixed $g(n) = o(n / \sqrt{\log n})$, since the infimum is attained. + +The source adds that one can also ask this for points in $\mathbb{R}^3$. Taken literally, the +question is easy there, since a cubic grid of $2n$ points determines only $O(n^{2/3})$ distinct +distances, so we do not state it. +-/ +@[category research open, question, AMS 52] +theorem erdos_661 : + (fun n => (minimalCrossDistances ℝ² n : ℝ)) =o[atTop] + (fun (n : ℕ) => (n : ℝ) / (n : ℝ).log.sqrt) := by + sorry + +/-- +Take $2n$ points of the smallest square grid with at least $2n$ points; by [Er46] they determine +$O(n / \sqrt{\log n})$ distinct distances. Splitting them into two halves of $n$ points shows +that $F(n) = O(n / \sqrt{\log n})$. So the question is whether this trivial bound can be +improved by more than a constant factor. +-/ +@[category research solved, AMS 52] +theorem erdos_661.variants.grid_upper_bound : + (fun n => (minimalCrossDistances ℝ² n : ℝ)) =O[atTop] + (fun (n : ℕ) => (n : ℝ) / (n : ℝ).log.sqrt) := by + sorry + +/-- +Every split of a set of $2n$ points into two halves of $n$ points gives a configuration for +$F(n)$, and the distances between the halves are among the distances of the whole set. Hence +$F(n) \leq f(2n)$, where $f(2n)$ is the minimal number of distinct distances determined by $2n$ +points in $\mathbb{R}^2$. +-/ +@[category textbook, AMS 52] +theorem erdos_661.variants.le_minimalDistinctDistances (n : ℕ) : + minimalCrossDistances ℝ² n ≤ minimalDistinctDistancesIn ℝ² (2 * n) := by + obtain ⟨P, hP⟩ := Infinite.exists_subset_card_eq ℝ² (2 * n) + obtain ⟨Q, hQ, hQm⟩ := Nat.sInf_mem (s := {m | ∃ points : Finset ℝ², #points = 2 * n ∧ + distinctDistances points = m}) ⟨_, P, hP, rfl⟩ + obtain ⟨A, hAQ, hA⟩ := Finset.exists_subset_card_eq (show n ≤ #Q by omega) + have hB : #(Q \ A) = n := by + rw [Finset.card_sdiff_of_subset hAQ] + omega + have h1 : minimalCrossDistances ℝ² n ≤ #(crossDistanceSet A (Q \ A)) := + Nat.sInf_le ⟨A, Q \ A, hA, hB, Finset.disjoint_sdiff, rfl⟩ + refine h1.trans (le_of_le_of_eq (Finset.card_le_card fun d hd => ?_) hQm) + obtain ⟨⟨x, y⟩, hxy, rfl⟩ := Finset.mem_image.1 hd + obtain ⟨hx, hy⟩ := Finset.mem_product.1 hxy + obtain ⟨hyQ, hyA⟩ := Finset.mem_sdiff.1 hy + exact Finset.mem_image.2 ⟨(x, y), Finset.mem_offDiag.2 ⟨hAQ hx, hyQ, fun h => hyA (h ▸ hx)⟩, + rfl⟩ + +/-- +Let $F(2n)$ be the minimal number of distinct distances $d(x_i, y_j)$ for $2n$ distinct points +$x_1,\ldots,x_n,y_1,\ldots,y_n\in \mathbb{R}^2$, and $f(2n)$ the minimal number of distinct +distances determined by any $2n$ points in $\mathbb{R}^2$. Is $F = o(f)$? + +Here $F(2n)$ of erdosproblems.com is `minimalCrossDistances ℝ² n` (indexed by $n$ points on each +side) and $f(2n)$ is `minimalDistinctDistancesIn ℝ² (2 * n)`. See also Erdős Problem 89. +-/ +@[category research open, question, AMS 52] +theorem erdos_661.variants.little_o_distinct_distances : + (fun n => (minimalCrossDistances ℝ² n : ℝ)) =o[atTop] + (fun n => (minimalDistinctDistancesIn ℝ² (2 * n) : ℝ)) := by + sorry + +/-- +In $\mathbb{R}^4$ Lenz observed (as stated on erdosproblems.com/661) that for every $n$ there are +$2n$ distinct points $x_1,\ldots,x_n,y_1,\ldots,y_n\in \mathbb{R}^4$ with $d(x_i,y_j)=1$ for all +$i,j$: take the $x_i$ on the circle of radius $1/\sqrt{2}$ about the origin in the plane of the +first two coordinates, and the $y_j$ on the circle of radius $1/\sqrt{2}$ about the origin in the +plane of the last two coordinates. +-/ +@[category research solved, AMS 52] +theorem erdos_661.variants.lenz (n : ℕ) : + ∃ A B : Finset (EuclideanSpace ℝ (Fin 4)), #A = n ∧ #B = n ∧ Disjoint A B ∧ + ∀ x ∈ A, ∀ y ∈ B, dist x y = 1 := by + sorry + +end Erdos661 diff --git a/FormalConjectures/ErdosProblems/663.lean b/FormalConjectures/ErdosProblems/663.lean new file mode 100644 index 0000000..c481915 --- /dev/null +++ b/FormalConjectures/ErdosProblems/663.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 663 + +*References:* +- [erdosproblems.com/663](https://www.erdosproblems.com/663) +- [BEGL96] Burr, S. A., Erdős, P., Graham, R. L., and Li, W. W.-C., + *Complete sequences of sets of integer powers*. Acta Arith. (1996), 133–138. +- [Er97e] Erdős, Paul, *Some of my favourite unsolved problems*. + Math. Japon. (1997), 527–537. +-/ + +@[expose] public section + +namespace Erdos663 + +open Filter Asymptotics +open scoped BigOperators + +/-- Let $k \geq 2$, and let $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, then $q(n,k) < (1+o(1))\log n$? -/ +@[category research open, question, AMS 11] +theorem erdos_663 : ∀ k ≥ 2, ∃ error : ℕ → ℝ, + error =o[atTop] (fun _ ↦ (1 : ℝ)) ∧ ∀ᶠ n in atTop, + let P : ℕ := ∏ i ∈ Finset.Icc 1 k, (n + i) + ∃ q : ℕ, q.Prime ∧ ¬ q ∣ P ∧ (∀ p : ℕ, p.Prime → ¬ p ∣ P → q ≤ p) ∧ + (q : ℝ) < (1 + error n) * Real.log n := by + sorry + +-- TODO: Formalize the easy bound $q(n,k) < (1+o(1))k\log n$ recorded in the source. + +end Erdos663 diff --git a/FormalConjectures/ErdosProblems/664.lean b/FormalConjectures/ErdosProblems/664.lean new file mode 100644 index 0000000..c97abbf --- /dev/null +++ b/FormalConjectures/ErdosProblems/664.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 664 + +*References:* +- [erdosproblems.com/664](https://www.erdosproblems.com/664) +- [Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_. + Combinatorica (1981), 25-42. +- [Er97f] Erdős, Paul, _Some unsolved problems_. Combinatorics, geometry and probability + (Cambridge, 1993) (1997), 1-10. +-/ + +@[expose] public section + +open Filter Real Finset + +namespace Erdos664 + +/-- +Let $c<1$ be some constant and $A_1,\ldots,A_m\subseteq \{1,\ldots,n\}$ be such that +$\lvert A_i\rvert >c\sqrt{n}$ for all $i$ and $\lvert A_i\cap A_j\rvert\leq 1$ for all $i\neq j$. + +Must there exist some set $B$ such that $B\cap A_i\neq \emptyset$ and +$\lvert B\cap A_i\rvert \ll_c 1$ for all $i$? + +The answer is no, proved by Alon: if $q$ is a large prime power and $n=m=q^2+q+1$ then there +exist $A_1,\ldots,A_m\subseteq \{1,\ldots,n\}$ such that +$\lvert A_i\rvert \geq \tfrac{2}{5}\sqrt{n}$ for all $i$ and $\lvert A_i\cap A_j\rvert\leq 1$ for +all $i\neq j$, and yet if $B$ has non-empty intersection with all $A_i$ then there exists $A_j$ +such that $\lvert B\cap A_j\rvert \gg \log n$. +-/ +@[category research solved, question, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos664.lean#L214"] +theorem erdos_664 : + ¬ ∀ c : ℝ, 0 < c → c < 1 → ∃ K : ℕ, ∀ (n m : ℕ) (A : Fin m → Finset (Fin n)), + (∀ i, c * √n < (A i).card) → (∀ i j, i ≠ j → (A i ∩ A j).card ≤ 1) → + ∃ B : Finset (Fin n), (∀ i, (B ∩ A i).Nonempty) ∧ + ∀ i, (B ∩ A i).card ≤ K := by + sorry + +/-- Alon's counterexample already works for $c=2/5$. -/ +@[category research solved, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos664.lean#L214"] +theorem erdos_664.variants.two_fifths : + ¬ ∃ K : ℕ, ∀ (n m : ℕ) (A : Fin m → Finset (Fin n)), + (∀ i, 2 / 5 * √n < (A i).card) → (∀ i j, i ≠ j → (A i ∩ A j).card ≤ 1) → + ∃ B : Finset (Fin n), (∀ i, (B ∩ A i).Nonempty) ∧ + ∀ i, (B ∩ A i).card ≤ K := by + sorry + +/-- +In [Er81] the condition $\lvert A_i\cap A_j\rvert\leq 1$ for all $i\neq j$ is replaced by every +two points in $\{1,\ldots,n\}$ being contained in exactly one $A_i$, that is, +$A_1,\ldots,A_m$ is a pairwise balanced block design. The bound $\lvert A_i\rvert>c\sqrt{n}$ is +kept, only the condition $c<1$ is omitted. This weaker version remains open, although Alon +conjectures the answer there to also be no. +-/ +@[category research open, question, AMS 5] +theorem erdos_664.variants.block_design : + ∀ c : ℝ, 0 < c → ∃ K : ℕ, ∀ (n m : ℕ) (A : Fin m → Finset (Fin n)), + (∀ i, c * √n < (A i).card) → (∀ x y : Fin n, x ≠ y → ∃! i, x ∈ A i ∧ y ∈ A i) → + ∃ B : Finset (Fin n), (∀ i, (B ∩ A i).Nonempty) ∧ + ∀ i, (B ∩ A i).card ≤ K := by + sorry + +end Erdos664 diff --git a/FormalConjectures/ErdosProblems/665.lean b/FormalConjectures/ErdosProblems/665.lean new file mode 100644 index 0000000..6bbd92b --- /dev/null +++ b/FormalConjectures/ErdosProblems/665.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 665 + +*References:* +- [erdosproblems.com/665](https://www.erdosproblems.com/665) +- [Er97f] Erdős, Paul, Some unsolved problems. Combinatorics, geometry and probability (Cambridge, + 1993) (1997), 1-10. +- [ErLa82] Erdős, P. and Larson, J., On pairwise balanced block designs with the sizes of blocks as + uniform as possible. Annals of Discrete Mathematics (1982), 129-134. +- [ShSi85] S. S. Shrikhande and N. M. Singhi, On a problem of Erdős and Larson. Combinatorica + (1985), 351-358. +-/ + +@[expose] public section + +namespace Erdos665 + +open Filter Asymptotics + +/-- +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 \lvert A_i\rvert 0$ and, for all large $n$, +a pairwise balanced design such that +$$\lvert A_i\rvert > n^{1/2}-C$$ +for all $1\leq i\leq m$? +-/ +@[category research open, question, AMS 5] +theorem erdos_665 : + ∃ C : ℝ, 0 < C ∧ ∀ᶠ n : ℕ in atTop, + ∃ H : Finset (Finset (Fin n)), H.IsPairwiseBalancedDesign ∧ + ∀ e ∈ H, e.card < n ∧ Real.sqrt n - C < e.card := by + sorry + +end Erdos665 diff --git a/FormalConjectures/ErdosProblems/667.lean b/FormalConjectures/ErdosProblems/667.lean new file mode 100644 index 0000000..e6f4338 --- /dev/null +++ b/FormalConjectures/ErdosProblems/667.lean @@ -0,0 +1,113 @@ +/- +Copyright 2025 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 667 + +A problem of Erdős, Faudree, Rousseau, and Schelp on the growth exponent of the largest clique +that is guaranteed inside a locally dense graph. + +*References:* +* [erdosproblems.com/667](https://www.erdosproblems.com/667) +* [Er97f] P. Erdős, _Some unsolved problems_. In: Combinatorics, Geometry and Probability + (Cambridge, 1993), Cambridge Univ. Press (1997), 1-10. +* [EFRS94] P. Erdős, R. J. Faudree, C. C. Rousseau and R. H. Schelp, + _A local density condition for triangles_. Discrete Math. 127 (1994), 153-161. +-/ + +@[expose] public section +open SimpleGraph Filter + +namespace Erdos667 + +/-- A graph `G` on `n` vertices is *`(p, q)`-locally dense* if every set of `p` of its vertices +spans at least `q` edges of `G`; equivalently, every induced subgraph on `p` vertices has at +least `q` edges. -/ +def LocallyDense (p q : ℕ) {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∀ s : Finset (Fin n), s.card = p → q ≤ (G.induce s).edgeSet.ncard + +open Classical in +/-- `H p q n` is `H(n) = H(n; p, q)`: the largest `m` such that *every* `(p, q)`-locally dense +graph on `n` vertices must contain a complete graph on `m` vertices `Kₘ`. + +The condition "`G` contains `Kₘ`" is `¬ G.CliqueFree m`. Any `m`-clique needs `m ≤ n` vertices, +and the property is downward closed in `m`, so `Nat.findGreatest _ n` returns the genuine maximum. -/ +noncomputable def H (p q n : ℕ) : ℕ := + Nat.findGreatest + (fun m => ∀ G : SimpleGraph (Fin n), LocallyDense p q G → ¬ G.CliqueFree m) n + +/-- The growth exponent `c(p, q) = liminf_{n → ∞} (log H(n)) / (log n)`. -/ +noncomputable def c (p q : ℕ) : ℝ := + liminf (fun n : ℕ => Real.log (H p q n) / Real.log n) atTop + +/-- +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)}{\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. When $q = 1$ this corresponds exactly to the +classical Ramsey problem, and hence $\tfrac{1}{p-1} \leq c(p, 1) \leq \tfrac{2}{p+1}$ for +$p \geq 3$. It is easy to see that if $q = \binom{p-1}{2} + 1$ then $c(p, q) = 1$. + +erdosproblems.com/667 also states that Erdős, Faudree, Rousseau and Schelp showed +$c(p, \binom{p-1}{2}) \leq 1/2$. This cannot hold for all $p$: for $p = 6$, $q = 10$, the +complement of a $(6, 10)$-locally dense graph is $C_6$-free, so Bondy–Simonovits together with +$\alpha(F) \geq n^2 / (2e(F) + n)$ gives $c(6, 10) \geq 2/3$. That remark is therefore not +formalised here. +-/ +@[category research open, question, AMS 5] +theorem erdos_667 : + ∀ p : ℕ, StrictMonoOn (c p) (Set.Icc 1 (Nat.choose (p - 1) 2 + 1)) := by + sorry + +/-- +That $c(p, q)$ is *nondecreasing* in $q$ for fixed $p$ is a straightforward consequence of the +definitions: enlarging $q$ shrinks the family of $(p, q)$-locally dense graphs, which can only +increase the guaranteed clique size $H(n)$, and hence the exponent. +-/ +@[category textbook, AMS 5, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/d16a9d73d85f1377e83798f5d9585ee4c4140979/erdos-667/Solution.lean#L41"] +theorem erdos_667.variants.monotoneOn (p : ℕ) : + MonotoneOn (c p) (Set.Icc 1 (Nat.choose (p - 1) 2 + 1)) := by + sorry + +/-- +The right endpoint: when $q = \binom{p-1}{2} + 1$ one has $c(p, q) = 1$ +(stated as "easy to see" on erdosproblems.com/667). +-/ +@[category research solved, AMS 5, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/d16a9d73d85f1377e83798f5d9585ee4c4140979/erdos-667/Solution.lean#L45"] +theorem erdos_667.variants.endpoint (p : ℕ) (hp : 2 ≤ p) : + c p (Nat.choose (p - 1) 2 + 1) = 1 := by + sorry + +/-- +The case $q = 1$ is the classical Ramsey problem, giving the bounds +$\tfrac{1}{p-1} \leq c(p, 1) \leq \tfrac{2}{p+1}$ for $p \geq 3$. (For $p = 2$ the condition +forces $G$ to be complete, so $c(2, 1) = 1$ and the upper bound fails.) +-/ +@[category research solved, AMS 5] +theorem erdos_667.variants.ramsey_bounds (p : ℕ) (hp : 3 ≤ p) : + 1 / ((p : ℝ) - 1) ≤ c p 1 ∧ c p 1 ≤ 2 / ((p : ℝ) + 1) := by + sorry + +end Erdos667 diff --git a/FormalConjectures/ErdosProblems/668.lean b/FormalConjectures/ErdosProblems/668.lean new file mode 100644 index 0000000..faa1a69 --- /dev/null +++ b/FormalConjectures/ErdosProblems/668.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. +-/ +module + +public import FormalConjecturesUtil +public import FormalConjectures.ErdosProblems.«90» + +/-! +# Erdős Problem 668 + +*References:* +- [erdosproblems.com/668](https://www.erdosproblems.com/668) +- [A385657](https://oeis.org/A385657) +- [AMP25] B. Alexeev, D. Mixon, and H. Parshall, *The Erdős unit distance problem for small point + sets*. arXiv:2412.11914 (2025). +- [EHSVZ25] P. Engel, O. Hammond-Lee, Y. Su, D. Varga, and P. Zsámboki, *Diverse beam search to + find densest-known planar unit distance graphs*. arXiv:2406.15317 (2025). +- [Er97f] Erdős, Paul, *Some unsolved problems*. Combinatorics, geometry and probability + (Cambridge, 1993) (1997), 1-10. +-/ + +@[expose] public section + +open Filter +open scoped EuclideanGeometry + +namespace Erdos668 + +open Erdos90 + +/-- +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$? + +The actual maximal number of unit distances is the subject of +[Erdős Problem 90](https://www.erdosproblems.com/90). + +Two sets of points are congruent if an isometry of the plane maps one onto the other. +-/ +@[category research open, question, AMS 52] +theorem erdos_668.parts.i : + ∀ m : ℕ, ∀ᶠ n in atTop, ∃ A : Fin m → Finset ℝ², + (∀ i, (A i).card = n ∧ unitDistNum (A i) = maxUnitDistances n) ∧ + ∀ i j, i ≠ j → ¬ ∃ f : ℝ² ≃ᵢ ℝ², f '' A i = A j := by + sorry + +/-- +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. + +Computational evidence of Engel, Hammond-Lee, Su, Varga, and Zsámboki [EHSVZ25] and Alexeev, +Mixon, and Parshall [AMP25] suggests that this count is $=1$ for various other $5\leq n\leq 21$ +(although these calculations were checking only up to graph isomorphism, rather than +congruency). +-/ +@[category research solved, question, AMS 52] +theorem erdos_668.parts.ii : + ¬ ∀ n : ℕ, 3 < n → ∃ A B : Finset ℝ², A.card = n ∧ B.card = n ∧ + unitDistNum A = maxUnitDistances n ∧ unitDistNum B = maxUnitDistances n ∧ + ¬ ∃ f : ℝ² ≃ᵢ ℝ², f '' A = B := by + sorry + +/-- +For $n=4$ there is, up to congruence, exactly one set of points in $\mathbb{R}^2$ which maximises +the number of unit distances: two unit equilateral triangles $abc$ and $bcd$ joined by the edge +$bc$, with $a\neq d$. +-/ +@[category research solved, AMS 52] +theorem erdos_668.variants.four_points : + ∃ a b c d : ℝ², dist a b = 1 ∧ dist a c = 1 ∧ dist b c = 1 ∧ dist b d = 1 ∧ dist c d = 1 ∧ + ({a, b, c, d} : Finset ℝ²).card = 4 ∧ + ∀ B : Finset ℝ², B.card = 4 → + (unitDistNum B = maxUnitDistances 4 ↔ ∃ f : ℝ² ≃ᵢ ℝ², f '' {a, b, c, d} = B) := by + sorry + +/-- `Erdos668.erdos_668.variants.four_points` settles `Erdos668.erdos_668.parts.ii` at +$n = 4$. -/ +@[category test, AMS 52] +theorem erdos_668.variants.four_points_implies_parts_ii : + type_of% erdos_668.variants.four_points → type_of% erdos_668.parts.ii := by + rintro ⟨a, b, c, d, -, -, -, -, -, -, h⟩ + intro H + obtain ⟨A, B, hA, hB, hAm, hBm, hAB⟩ := H 4 (by norm_num) + obtain ⟨f, hf⟩ := (h A hA).1 hAm + obtain ⟨g, hg⟩ := (h B hB).1 hBm + exact hAB ⟨f.symm.trans g, by rw [← hf, ← hg, Set.image_image]; simp⟩ + +end Erdos668 diff --git a/FormalConjectures/ErdosProblems/669.lean b/FormalConjectures/ErdosProblems/669.lean new file mode 100644 index 0000000..27e965d --- /dev/null +++ b/FormalConjectures/ErdosProblems/669.lean @@ -0,0 +1,246 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 669 + +*References:* +- [erdosproblems.com/669](https://www.erdosproblems.com/669) +- [BGS74] Burr, Stefan A. and Grünbaum, Branko and Sloane, N. J. A., *The orchard problem*. + Geometriae Dedicata (1974), 397-424. +- [Er97f] Erdős, Paul, *Some unsolved problems*. Combinatorics, geometry and probability + (Cambridge, 1993) (1997), 1-10. +-/ + +@[expose] public section + +open Filter +open scoped Topology EuclideanGeometry + +namespace Erdos669 + +/-- +The set of lines in $\mathbb{R}^2$ containing at least $k$ points of $S$. It is the analogue of +`EuclideanGeometry.linesWithPointsFor`, which asks for exactly $k$ points. Only lines spanned by two +distinct points of $S$ are counted, so the definition is meant for $k \geq 2$. +-/ +noncomputable def linesWithAtLeastPointsFor (k : ℕ) (S : Set ℝ²) : Set (AffineSubspace ℝ ℝ²) := + let determined_lines := { affineSpan ℝ {p, q} | (p ∈ S) (q ∈ S) (_ : p ≠ q) } + { L ∈ determined_lines | k ≤ (↑L ∩ S).ncard } + +/-- +The set of numbers of distinct lines through at least $k$ points, taken over all sets of $n$ +points in $\mathbb{R}^2$. +-/ +noncomputable def lineCountsAtLeast (k n : ℕ) : Set ℕ := + {m | ∃ S : Finset ℝ², S.card = n ∧ (linesWithAtLeastPointsFor k (S : Set ℝ²)).ncard = m} + +/-- +The set of numbers of distinct lines through exactly $k$ points, taken over all sets of $n$ +points in $\mathbb{R}^2$. +-/ +noncomputable def lineCountsExactly (k n : ℕ) : Set ℕ := + {m | ∃ S : Finset ℝ², S.card = n ∧ + (EuclideanGeometry.linesWithPointsFor k (S : Set ℝ²)).ncard = m} + +/-- A set of lines, each spanned by two points of `S`, has at most `S.card ^ 2` elements. -/ +@[category API, AMS 52] +private lemma ncard_le_sq (S : Finset ℝ²) (T : Set (AffineSubspace ℝ ℝ²)) + (hT : ∀ L ∈ T, ∃ p ∈ S, ∃ q ∈ S, affineSpan ℝ {p, q} = L) : T.ncard ≤ S.card ^ 2 := by + have hfin : ((S : Set ℝ²) ×ˢ (S : Set ℝ²)).Finite := S.finite_toSet.prod S.finite_toSet + have hcard : ((S : Set ℝ²) ×ˢ (S : Set ℝ²)).ncard = S.card ^ 2 := by + rw [Set.ncard_prod, Set.ncard_coe_finset, sq] + have hsub : T ⊆ (fun pq : ℝ² × ℝ² => affineSpan ℝ {pq.1, pq.2}) '' + ((S : Set ℝ²) ×ˢ (S : Set ℝ²)) := by + intro L hL + obtain ⟨p, hp, q, hq, rfl⟩ := hT L hL + exact ⟨(p, q), Set.mk_mem_prod (Finset.mem_coe.2 hp) (Finset.mem_coe.2 hq), rfl⟩ + exact (Set.ncard_le_ncard hsub (hfin.image _)).trans + ((Set.ncard_image_le hfin).trans hcard.le) + +/-- +The counts are bounded: a line through two or more points of an $n$-point set is spanned by an +ordered pair of its points, and there are at most $n^2$ ordered pairs. The set is also nonempty, +since $n$-point sets exist, so the `sSup` in `Erdos669.maxLinesAtLeast` is attained. +-/ +@[category test, AMS 52] +theorem lineCountsAtLeast_bddAbove (k n : ℕ) : BddAbove (lineCountsAtLeast k n) := by + refine ⟨n ^ 2, ?_⟩ + rintro _ ⟨S, rfl, rfl⟩ + refine ncard_le_sq S _ ?_ + rintro L ⟨⟨p, hp, q, hq, -, rfl⟩, -⟩ + exact ⟨p, Finset.mem_coe.1 hp, q, Finset.mem_coe.1 hq, rfl⟩ + +/-- +The same bound for lines through exactly $k$ points, so the `sSup` in `Erdos669.maxLinesExactly` +is attained as well. +-/ +@[category test, AMS 52] +theorem lineCountsExactly_bddAbove (k n : ℕ) : BddAbove (lineCountsExactly k n) := by + refine ⟨n ^ 2, ?_⟩ + rintro _ ⟨S, rfl, rfl⟩ + refine ncard_le_sq S _ ?_ + rintro L ⟨⟨p, hp, q, hq, -, rfl⟩, -⟩ + exact ⟨p, Finset.mem_coe.1 hp, q, Finset.mem_coe.1 hq, rfl⟩ + +/-- +A line through exactly $k$ points of $S$ is a line through at least $k$ points of $S$. +-/ +@[category test, AMS 52] +theorem linesWithPointsFor_subset_linesWithAtLeastPointsFor (k : ℕ) (S : Set ℝ²) : + EuclideanGeometry.linesWithPointsFor k S ⊆ linesWithAtLeastPointsFor k S := by + rintro L ⟨hL, hk⟩ + exact ⟨hL, hk.ge⟩ + +/-- +$F_k(n)$: the largest number of distinct lines passing through at least $k$ of the points, over +all sets of $n$ points in $\mathbb{R}^2$. This is the least $m$ such that any $n$ points have at +most $m$ such lines. See `Erdos669.lineCountsAtLeast_bddAbove`. +-/ +noncomputable def maxLinesAtLeast (k n : ℕ) : ℕ := + sSup (lineCountsAtLeast k n) + +/-- +$f_k(n)$: the largest number of distinct lines passing through exactly $k$ of the points, over +all sets of $n$ points in $\mathbb{R}^2$. This is the least $m$ such that any $n$ points have at +most $m$ such lines. See `Erdos669.lineCountsExactly_bddAbove`. +-/ +noncomputable def maxLinesExactly (k n : ℕ) : ℕ := + sSup (lineCountsExactly k n) + +def erdos_669.parts.i.answer : ℕ → Option ℝ := sorry + +/-- +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$. + +This part asks for $\lim F_k(n)/n^2$ for $k \geq 3$ (the case $k = 2$ is trivial). The +original question [Er97f, Problem 16] asks for the limits "if they exist", so the answer allows +nonexistence: the answer at $k$ is `some x` if the limit exists and equals $x$, and `none` +otherwise. +-/ +@[category research open, question value, AMS 52] +theorem erdos_669.parts.i : + ∀ k : ℕ, 3 ≤ k → ∀ x : ℝ, + erdos_669.parts.i.answer k = some x ↔ + Tendsto (fun n : ℕ => (maxLinesAtLeast k n : ℝ) / (n : ℝ) ^ 2) atTop (𝓝 x) := by + sorry + +def erdos_669.parts.ii.answer : ℕ → Option ℝ := sorry + +/-- +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$. + +This part asks for $\lim f_k(n)/n^2$ for $k \geq 3$ (the case $k = 2$ is trivial). The +original question [Er97f, Problem 16] asks for the limits "if they exist", so the answer allows +nonexistence: the answer at $k$ is `some x` if the limit exists and equals $x$, and `none` +otherwise. +-/ +@[category research open, question value, AMS 52] +theorem erdos_669.parts.ii : + ∀ k : ℕ, 3 ≤ k → ∀ x : ℝ, + erdos_669.parts.ii.answer k = some x ↔ + Tendsto (fun n : ℕ => (maxLinesExactly k n : ℝ) / (n : ℝ) ^ 2) atTop (𝓝 x) := by + sorry + +/-- +Trivially $f_k(n)\leq F_k(n)$. +-/ +@[category research solved, AMS 52] +theorem erdos_669.variants.exactly_le_atLeast (k n : ℕ) : + maxLinesExactly k n ≤ maxLinesAtLeast k n := by + refine csSup_le' ?_ + rintro _ ⟨S, hS, rfl⟩ + have hfin : (linesWithAtLeastPointsFor k (S : Set ℝ²)).Finite := by + refine ((S.finite_toSet.prod S.finite_toSet).image + (fun pq : ℝ² × ℝ² => affineSpan ℝ {pq.1, pq.2})).subset ?_ + rintro L ⟨⟨p, hp, q, hq, -, rfl⟩, -⟩ + exact ⟨(p, q), Set.mk_mem_prod hp hq, rfl⟩ + exact le_csSup_of_le (lineCountsAtLeast_bddAbove k n) ⟨S, hS, rfl⟩ + (Set.ncard_le_ncard (linesWithPointsFor_subset_linesWithAtLeastPointsFor k _) hfin) + +/-- +$f_2(n)=F_2(n)=\binom{n}{2}$. +-/ +@[category research solved, AMS 52] +theorem erdos_669.variants.k_two (n : ℕ) : + maxLinesExactly 2 n = n.choose 2 ∧ maxLinesAtLeast 2 n = n.choose 2 := by + sorry + +/-- +The problem with $k=3$ is the classical 'Orchard problem' of Sylvester. Burr, Grünbaum, and Sloane +[BGS74] have proved that +$$f_3(n)=\frac{n^2}{6}-O(n)$$ +and +$$F_3(n)=\frac{n^2}{6}-O(n).$$ + +This is the statement for $f_3$. +-/ +@[category research solved, AMS 52] +theorem erdos_669.variants.burr_grunbaum_sloane_exactly : + (fun n : ℕ => (maxLinesExactly 3 n : ℝ) - (n : ℝ) ^ 2 / 6) =O[atTop] + (fun n : ℕ => (n : ℝ)) := by + sorry + +/-- +The problem with $k=3$ is the classical 'Orchard problem' of Sylvester. Burr, Grünbaum, and Sloane +[BGS74] have proved that +$$f_3(n)=\frac{n^2}{6}-O(n)$$ +and +$$F_3(n)=\frac{n^2}{6}-O(n).$$ + +This is the statement for $F_3$. +-/ +@[category research solved, AMS 52] +theorem erdos_669.variants.burr_grunbaum_sloane_atLeast : + (fun n : ℕ => (maxLinesAtLeast 3 n : ℝ) - (n : ℝ) ^ 2 / 6) =O[atTop] + (fun n : ℕ => (n : ℝ)) := by + sorry + +/-- +There is a trivial upper bound of $F_k(n) \leq \binom{n}{2}/\binom{k}{2}$. +-/ +@[category research solved, AMS 52] +theorem erdos_669.variants.upper_bound (k n : ℕ) (hk : 2 ≤ k) : + (maxLinesAtLeast k n : ℝ) ≤ (n.choose 2 : ℝ) / (k.choose 2 : ℝ) := by + sorry + +/-- +There is a trivial upper bound of $F_k(n) \leq \binom{n}{2}/\binom{k}{2}$, and hence +$$\lim F_k(n)/n^2 \leq \frac{1}{k(k-1)}.$$ +See also [101](https://www.erdosproblems.com/101). + +Here the limit is assumed to exist and is called `L`. +-/ +@[category research solved, AMS 52] +theorem erdos_669.variants.limit_le (k : ℕ) (hk : 2 ≤ k) (L : ℝ) + (hL : Tendsto (fun n : ℕ => (maxLinesAtLeast k n : ℝ) / (n : ℝ) ^ 2) atTop (𝓝 L)) : + L ≤ 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 0000000..1ae4730 --- /dev/null +++ b/FormalConjectures/ErdosProblems/670.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 670 + +*References:* +- [erdosproblems.com/670](https://www.erdosproblems.com/670) +- [Er97f] Erdős, Paul, *Some unsolved problems*. Combinatorics, geometry and probability + (Cambridge, 1993) (1997), 1-10. +- [Ho26] Ho, B. S., *Erdős's diameter conjecture for separated distances fails in high + dimensions*. [arXiv:2604.15305](https://arxiv.org/abs/2604.15305) (2026). +-/ + +@[expose] public section + +open Filter + +namespace Erdos670 + +/-- A finite set $A$ of points has *separated distances* if all its pairwise distances differ +by at least $1$: for any two different unordered pairs $\{a, b\} \neq \{c, e\}$ of distinct +points of $A$, we have $\lvert d(a, b) - d(c, e)\rvert \geq 1$. -/ +def HasSeparatedDistances {X : Type*} [MetricSpace X] (A : Finset X) : Prop := + ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, ∀ e ∈ A, a ≠ b → c ≠ e → s(a, b) ≠ s(c, e) → + 1 ≤ |dist a b - dist c e| + +/-- +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 quantifiers in the source are ambiguous. Following the remarks on erdosproblems.com, this is +the regime where $d$ is fixed and the $o(1)$ term tends to $0$ as $n \to \infty$, at a rate +which may depend on $d$. The case $d = 1$ was proved by Erdős +(`Erdos670.erdos_670.variants.dim_one`), so the question is open for $d \geq 2$. +-/ +@[category research open, question, AMS 52] +theorem erdos_670 : + ∀ d : ℕ, 1 ≤ d → ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + ∀ A : Finset (EuclideanSpace ℝ (Fin d)), A.card = n → HasSeparatedDistances A → + (1 - ε) * (n : ℝ) ^ 2 ≤ Metric.diam (A : Set (EuclideanSpace ℝ (Fin d))) := by + sorry + +/-- +Erdős [Er97f] proved the claim when $d = 1$: if $A\subseteq \mathbb{R}$ is a set of $n$ points +such that all pairwise distances differ by at least $1$, then the diameter of $A$ is at least +$(1+o(1))n^2$. +-/ +@[category research solved, question, AMS 52] +theorem erdos_670.variants.dim_one : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + ∀ A : Finset (EuclideanSpace ℝ (Fin 1)), A.card = n → HasSeparatedDistances A → + (1 - ε) * (n : ℝ) ^ 2 ≤ Metric.diam (A : Set (EuclideanSpace ℝ (Fin 1))) := by + sorry + +/-- +The trivial lower bound: if $A\subseteq \mathbb{R}^d$ is a set of $n \neq 2$ points such that all +pairwise distances differ by at least $1$, then the diameter of $A$ is at least $\binom{n}{2}$. + +For $n \geq 3$, take a closest pair $a, b$ and a third point $c$. Then +$1 \leq \lvert d(a, c) - d(b, c)\rvert \leq d(a, b)$, so every distance is at least $1$. The +$\binom{n}{2}$ distances are at least $1$ apart, so the largest one is at least $\binom{n}{2}$. +For $n = 2$ the hypothesis is vacuous, and two points at distance $1/2$ show that the bound fails. +-/ +@[category textbook, AMS 52] +theorem erdos_670.variants.choose_two (d : ℕ) (A : Finset (EuclideanSpace ℝ (Fin d))) + (hA : HasSeparatedDistances A) (hn : A.card ≠ 2) : + (A.card.choose 2 : ℝ) ≤ Metric.diam (A : Set (EuclideanSpace ℝ (Fin d))) := by + sorry + +/-- +Ho [Ho26] showed that the claim fails if $n$ grows with $d$: there exist infinitely many $n$ +and, with $d = n^2 - n$, a set $A\subset \mathbb{R}^d$ of $n$ points such that all pairwise +distances differ by at least $1$, with diameter at most +$$ +\left(1-\frac{1}{\pi^2}+o(1)\right)n^2\approx 0.898n^2. +$$ +Ho's construction uses $n = q + 1$ points in dimension $q^2 + q = n^2 - n$, for every prime power +$q$. +-/ +@[category research solved, AMS 52, formal_proof using lean4 at + "https://github.com/boonsuan/erdos670/blob/c053b2580e0cf7e74c8d905f96feb101061612a3/DiameterConstruction/MainTheorem.lean#L452"] +theorem erdos_670.variants.ho : + ∀ ε > (0 : ℝ), ∃ᶠ n : ℕ in atTop, + ∃ A : Finset (EuclideanSpace ℝ (Fin (n ^ 2 - n))), A.card = n ∧ + HasSeparatedDistances A ∧ + Metric.diam (A : Set (EuclideanSpace ℝ (Fin (n ^ 2 - n)))) ≤ + (1 - 1 / Real.pi ^ 2 + ε) * (n : ℝ) ^ 2 := by + sorry + +/-- +The version of the problem where the $o(1)$ term must be uniform in the dimension $d$ has a +negative answer. This follows from `Erdos670.erdos_670.variants.ho` (Ho [Ho26]). +-/ +@[category research solved, question, AMS 52] +theorem erdos_670.variants.uniform_in_dim : + ¬ ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, ∀ d : ℕ, + ∀ A : Finset (EuclideanSpace ℝ (Fin d)), A.card = n → HasSeparatedDistances A → + (1 - ε) * (n : ℝ) ^ 2 ≤ Metric.diam (A : Set (EuclideanSpace ℝ (Fin d))) := by + sorry + +end Erdos670 diff --git a/FormalConjectures/ErdosProblems/675.lean b/FormalConjectures/ErdosProblems/675.lean new file mode 100644 index 0000000..da94f96 --- /dev/null +++ b/FormalConjectures/ErdosProblems/675.lean @@ -0,0 +1,153 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 675 + +*References:* +- [erdosproblems.com/675](https://www.erdosproblems.com/675) +- [Er79] Erdős, Paul, *Some unconventional problems in number theory*. Math. Mag. (1979), 67-70. +- [Ho26] Ho, B. S., *A squarefree lower bound for Erdős Problem 675*. + [PDF](https://boonsuan.github.io/erdos675_squarefree.pdf) (2026). +-/ + +@[expose] public section + +open Asymptotics Filter + +namespace Erdos675 + +/-- +`IsTranslation A n t` says that $t \geq 1$ and, for all $1 \leq a \leq n$, $a \in A$ if and +only if $a + t \in A$. +-/ +def IsTranslation (A : Set ℕ) (n t : ℕ) : Prop := + 1 ≤ t ∧ ∀ a : ℕ, 1 ≤ a → a ≤ n → (a ∈ A ↔ a + t ∈ A) + +/-- +A set $A \subseteq \mathbb{N}$ has the translation property if, for every $n$, there is an +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$. +-/ +def HasTranslationProperty (A : Set ℕ) : Prop := + ∀ n : ℕ, ∃ t : ℕ, IsTranslation A n t + +/-- +`minTranslation A n` is the least $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$. It is `0` if there is no such $t_n$. +-/ +noncomputable def minTranslation (A : Set ℕ) (n : ℕ) : ℕ := + sInf {t : ℕ | IsTranslation A n t} + +/-- `composedOf P` is the set of positive integers all of whose prime factors lie in `P` +(a version of `Nat.factoredNumbers` for an arbitrary set `P`). It contains $1$. -/ +def composedOf (P : Set ℕ) : Set ℕ := + {m : ℕ | 0 < m ∧ ∀ p : ℕ, p.Prime → p ∣ m → p ∈ P} + +/-- The set $\{1\}$ does not have the translation property: for $n = 1$ it would need +$1 + t \in \{1\}$ for some $t \geq 1$. -/ +@[category test, AMS 11] +theorem not_hasTranslationProperty_singleton_one : ¬ HasTranslationProperty {1} := by + intro h + obtain ⟨t, ht1, ht⟩ := h 1 + have h1 : 1 + t ∈ ({1} : Set ℕ) := (ht 1 le_rfl le_rfl).mp (Set.mem_singleton 1) + rw [Set.mem_singleton_iff] at h1 + omega + +/-- The numbers $1, 2, 3$ are squarefree, and $t = 4$ is the least $t \geq 1$ such that +$1 + t$, $2 + t$ and $3 + t$ are all squarefree. -/ +@[category test, AMS 11] +theorem minTranslation_squarefree_three : minTranslation {m : ℕ | Squarefree m} 3 = 4 := by + sorry + +/-- If `P` contains every prime, then `composedOf P` is the set of all positive integers. -/ +@[category test, AMS 11] +theorem composedOf_primes : composedOf {p : ℕ | p.Prime} = {m : ℕ | 0 < m} := by + ext m + show (0 < m ∧ ∀ p : ℕ, p.Prime → p ∣ m → p ∈ {p : ℕ | p.Prime}) ↔ 0 < m + exact ⟨fun h ↦ h.1, fun h ↦ ⟨h, fun _ hp _ ↦ hp⟩⟩ + +/-- +A set $A \subseteq \mathbb{N}$ has the translation property if, for every $n$, there is an +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$. Does the set of sums of two squares $\{x^2 + y^2 : x, y \in \mathbb{N}\}$ +have the translation property? +-/ +@[category research open, question, AMS 11] +theorem erdos_675.parts.i : + HasTranslationProperty {m : ℕ | ∃ x y : ℕ, m = x ^ 2 + y ^ 2} := by + sorry + +/-- +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? + +We read "can" as: is there such a partition for which this set (which contains $1$) has the +translation property? +-/ +@[category research open, question, AMS 11] +theorem erdos_675.parts.ii : + ∃ P : Set ℕ, P ⊆ {p : ℕ | p.Prime} ∧ + (fun x : ℕ ↦ (x : ℝ) / Real.log x) =O[atTop] (fun x ↦ ((P ∩ Set.Iic x).ncard : ℝ)) ∧ + (fun x : ℕ ↦ (x : ℝ) / Real.log x) =O[atTop] + (fun x ↦ ((({p : ℕ | p.Prime} \ P) ∩ Set.Iic x).ncard : ℝ)) ∧ + HasTranslationProperty (composedOf P) := by + sorry + +/-- +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$? + +We ask for the inequality for all sufficiently large $n$, since $t_1 = 1$. + +Ho [Ho26] proved that the answer is yes: for every fixed $0 < c < 25/72$, $t_n > \exp(n^c)$ for +all sufficiently large $n$ (Theorem 1.2 and Corollary 3.2); see also the +[forum discussion](https://www.erdosproblems.com/forum/thread/675#post-6002). +-/ +@[category research solved, question, AMS 11] +theorem erdos_675.parts.iii : + ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + Real.exp ((n : ℝ) ^ c) < (minTranslation {m : ℕ | Squarefree m} n : ℝ) := by + sorry + +/-- +Elementary sieve theory implies that the set of squarefree numbers has the translation property +(as remarked on erdosproblems.com). +-/ +@[category research solved, AMS 11] +theorem erdos_675.variants.squarefree : HasTranslationProperty {m : ℕ | Squarefree m} := by + sorry + +open scoped Classical in +/-- +Let $B \subseteq \mathbb{N}$ be a set of pairwise coprime integers with +$$\sum_{b \in B,\ b < x} \frac{1}{b} = o(\log \log x).$$ +Then $A = \{n : b \nmid n \text{ for all } b \in B\}$ has the translation property. +As remarked on erdosproblems.com, this follows from Brun's sieve, and Erdős did not know what +happens if the condition on the sum is weakened or dropped. +-/ +@[category research solved, AMS 11] +theorem erdos_675.variants.brun (B : Set ℕ) (hB : B.Pairwise Nat.Coprime) + (hsum : (fun x : ℕ ↦ ∑ b ∈ Finset.range x with b ∈ B, (1 : ℝ) / (b : ℝ)) =o[atTop] + fun x : ℕ ↦ Real.log (Real.log (x : ℝ))) : + HasTranslationProperty {n : ℕ | ∀ b ∈ B, ¬ b ∣ n} := by + sorry + +end Erdos675 diff --git a/FormalConjectures/ErdosProblems/676.lean b/FormalConjectures/ErdosProblems/676.lean new file mode 100644 index 0000000..2b54282 --- /dev/null +++ b/FormalConjectures/ErdosProblems/676.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 676 + +*References:* +- [erdosproblems.com/676](https://www.erdosproblems.com/676) +- [Er79] Erdős, Paul, *Some unconventional problems in number theory*. + Math. Mag. (1979), 67–70. +- [Er79d] Erdős, P., *Some unconventional problems in number theory*. + Acta Math. Acad. Sci. Hungar. (1979), 71–80. +- [Er80] Erdős, Paul, *A survey of problems in combinatorial number theory*. + Ann. Discrete Math. (1980), 89–115. +-/ + +@[expose] public section + +namespace Erdos676 + +open Filter + +/-- An integer has a representation $ap^2+b$ with $p$ prime, $a \geq 1$, and $b < p$ +if and only if $p^2 \leq n$ and $n \bmod p^2 < p$ for some prime $p$. -/ +@[category test, AMS 11] +theorem representation_iff_mod (n : ℕ) : + (∃ a p b : ℕ, p.Prime ∧ 1 ≤ a ∧ b < p ∧ n = a * p ^ 2 + b) ↔ + ∃ p : ℕ, p.Prime ∧ p ^ 2 ≤ n ∧ n % p ^ 2 < p := by + constructor + · rintro ⟨a, p, b, hp, ha, hb, rfl⟩ + refine ⟨p, hp, ?_, ?_⟩ + · nlinarith + · have hb' : b < p ^ 2 := by + have := hp.two_le + nlinarith + simpa [Nat.add_mod, Nat.mul_mod, Nat.mod_eq_of_lt hb'] using hb + · rintro ⟨p, hp, hn, hr⟩ + refine ⟨n / p ^ 2, p, n % p ^ 2, hp, ?_, hr, ?_⟩ + · exact Nat.div_pos hn (pow_pos hp.pos _) + · simpa [Nat.mul_comm, Nat.add_comm] using (Nat.mod_add_div n (p ^ 2)).symm + +/-- The integer $35$ has no representation $ap^2+b$ of the required form. -/ +@[category test, AMS 11] +theorem not_representable_35 : + ¬ ∃ a p b : ℕ, p.Prime ∧ 1 ≤ a ∧ b < p ∧ 35 = a * p ^ 2 + b := by + rw [representation_iff_mod] + rintro ⟨p, hp, hn, hr⟩ + have hp6 : p < 6 := by nlinarith + have hc : ∀ q : Fin 6, ¬ (q.val.Prime ∧ q.val ^ 2 ≤ 35 ∧ 35 % q.val ^ 2 < q.val) := + by decide + exact hc ⟨p, hp6⟩ ⟨hp, hn, hr⟩ + +/-- The integer $899$ has no representation $ap^2+b$ of the required form. -/ +@[category test, AMS 11] +theorem not_representable_899 : + ¬ ∃ a p b : ℕ, p.Prime ∧ 1 ≤ a ∧ b < p ∧ 899 = a * p ^ 2 + b := by + rw [representation_iff_mod] + rintro ⟨p, hp, hn, hr⟩ + have hp30 : p < 30 := by nlinarith + have hc : ∀ q : Fin 30, ¬ (q.val.Prime ∧ q.val ^ 2 ≤ 899 ∧ 899 % q.val ^ 2 < q.val) := + by decide + exact hc ⟨p, hp30⟩ ⟨hp, hn, hr⟩ + +/-- Is every sufficiently large integer of the form $ap^2+b$ for some prime $p$ and integers +$a \geq 1$ and $0 \leq b < p$? -/ +@[category research open, question, AMS 11] +theorem erdos_676 : ∀ᶠ n in atTop, + ∃ a p b : ℕ, p.Prime ∧ 1 ≤ a ∧ b < p ∧ n = a * p ^ 2 + b := by + sorry + +/- TODO: Formalize the source's additional variants: the quantitative almost-all result, the +version without primality, the general pair $(A,f)$, and the questions about the minimal $c_n$. -/ + +end Erdos676 diff --git a/FormalConjectures/ErdosProblems/679.lean b/FormalConjectures/ErdosProblems/679.lean new file mode 100644 index 0000000..8b0cdad --- /dev/null +++ b/FormalConjectures/ErdosProblems/679.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 679 + +*References:* +- [erdosproblems.com/679](https://www.erdosproblems.com/679) +- [Er79d] P. Erdős, Some unconventional problems in number theory. + Acta Math. Acad. Sci. Hungar. 33 (1979), 71–80. +-/ + +@[expose] public section + +open Filter Real + +namespace Erdos679 + +/-- +Let $\epsilon>0$ and $\omega(n)$ count the number of distinct prime factors of $n$. +Are there infinitely many values of $n$ such that +$$\omega(n-k) < (1+\epsilon)\frac{\log k}{\log\log k}$$ +for all $k 0$ such that $P(n, k) \ge k^{1 + c}$ for all $0 < k \le n/2$. +There exists $c > 0$ such that $P(n, k) \ge \min(n - k + 1, k^{1 + c})$ for all $0 < k \le n/2$. -Erdős originally stated this for $1 \le k \le n$ with a $\min(n-k+1, k^{1+c})$ bound [Er79d], -but as discussed on [erdosproblems.com](https://www.erdosproblems.com/forum/discuss/683), -the $\min$ term was introduced only to handle $k > n/2$; the problem is naturally stated -for $k \le n/2$ (cf. [#961](https://www.erdosproblems.com/961)). +Erdős stated this for $1 \le k \le n$ with the bound $\min(n-k+1, k^{1+c})$ [Er79d]. The +minimum is needed even for $k \le n/2$: at $n = 2k$ every prime factor of $\binom{2k}{k}$ is at +most $2k$, so $P(n, k) \ge k^{1+c}$ fails for large $k$. The range $k \le n/2$ is natural +(cf. [#961](https://www.erdosproblems.com/961) and the +[discussion](https://www.erdosproblems.com/forum/discuss/683)). -/ -@[category research open, AMS 11] -theorem erdos_683 : answer(sorry) ↔ - ∃ c > (0 : ℝ), ∀ n k : ℕ, 0 < k ∧ k ≤ n / 2 → (P n k : ℝ) ≥ k ^ (1 + c) := by +@[category research open, question, AMS 11] +theorem erdos_683 : + ∃ c > (0 : ℝ), ∀ n k : ℕ, 0 < k ∧ k ≤ n / 2 → + (P n k : ℝ) ≥ min (↑(n - k + 1) : ℝ) ((k : ℝ) ^ (1 + c)) := by sorry /-- @@ -60,19 +65,23 @@ theorem erdos_683.variant.sylvester_schur : sorry /-- -Erdos [Er55d] improved this to $P(n, k) \gg k \log k $ for $k \le n/2$. +Erdős [Er55d] improved this to $P(n, k) \gg \min(n - k + 1, k \log k)$ for $k \le n/2$. The +minimum cannot be dropped: at $n = 2k$ one has $P(n, k) \le 2k$. -/ @[category research solved, AMS 11] theorem erdos_683.variant.erdos_log : - ∃ c > 0, ∀ n k : ℕ, 0 < k ∧ k ≤ n / 2 → P n k > c * k * Real.log k := by + ∃ c > 0, ∀ n k : ℕ, 0 < k ∧ k ≤ n / 2 → + (P n k : ℝ) ≥ min (↑(n - k + 1) : ℝ) (c * k * Real.log k) := by sorry /-- -Standard heuristics suggest that $P(n, k) > e^{c\sqrt{k}}$ for some constant $c > 0$. +Standard heuristics suggest that $P(n, k) > \min(n - k + 1, e^{c\sqrt{k}})$ for some constant +$c > 0$. -/ @[category research open, AMS 11] theorem erdos_683.variant.exp_sqrt : - ∃ c > 0, ∀ n k : ℕ, 0 < k ∧ k ≤ n / 2 → P n k > Real.exp (c * Real.sqrt k) := by + ∃ c > 0, ∀ n k : ℕ, 0 < k ∧ k ≤ n / 2 → + (P n k : ℝ) > min (↑(n - k + 1) : ℝ) (Real.exp (c * Real.sqrt k)) := by sorry -- TODO: Erdos 683 and 961 are equivalent. diff --git a/FormalConjectures/ErdosProblems/685.lean b/FormalConjectures/ErdosProblems/685.lean new file mode 100644 index 0000000..416661a --- /dev/null +++ b/FormalConjectures/ErdosProblems/685.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 685 + +*References:* +- [erdosproblems.com/685](https://www.erdosproblems.com/685) +- [Er79d] Erdős, P., *Some unconventional problems in number theory*. Acta Math. Acad. Sci. + Hungar. (1979), 71-80. +-/ + +@[expose] public section + +open Filter +open scoped ArithmeticFunction.omega + +namespace Erdos685 + +/-- `primeRecipSum k n` is the sum of $1/p$ over the primes $k < p < n$. -/ +noncomputable def primeRecipSum (k n : ℕ) : ℝ := + ∑ p ∈ (Finset.Ioo k n).filter Nat.Prime, (1 : ℝ) / p + +/-- Both ends are excluded: the only prime strictly between $2$ and $5$ is $3$. -/ +@[category test, AMS 11] +theorem primeRecipSum_two_five : primeRecipSum 2 5 = 1 / 3 := by + rw [primeRecipSum, show (Finset.Ioo 2 5).filter Nat.Prime = {3} by decide] + norm_num + +/-- +Let $\epsilon > 0$ and let $n$ be large depending on $\epsilon$. Is it true that for all +$n^{\epsilon} < k \leq n^{1-\epsilon}$ the number of distinct prime divisors of $\binom{n}{k}$ is +$$(1+o(1))\, k \sum_{k < p < n} \frac{1}{p}?$$ + +The $o(1)$ is uniform in $k$. +-/ +@[category research open, question, AMS 11] +theorem erdos_685.parts.i : + ∀ ε > (0 : ℝ), ∀ δ > (0 : ℝ), ∀ᶠ n : ℕ in atTop, ∀ k : ℕ, + (n : ℝ) ^ ε < (k : ℝ) → (k : ℝ) ≤ (n : ℝ) ^ (1 - ε) → + |(ω (n.choose k) : ℝ) - (k : ℝ) * primeRecipSum k n| ≤ + δ * ((k : ℝ) * primeRecipSum k n) := by + sorry + +/-- +Is it true that, for some constant $c > 0$, the number of distinct prime divisors of +$\binom{n}{k}$ is +$$(1+o(1))\, k \sum_{k < p < n} \frac{1}{p}$$ +even for all $(\log n)^c \leq k \leq n^{1-\epsilon}$? + +Here $\epsilon > 0$ is as in the first question, and the $o(1)$ is uniform in $k$. +-/ +@[category research open, question, AMS 11] +theorem erdos_685.parts.ii : + ∃ c > (0 : ℝ), ∀ ε > (0 : ℝ), ∀ δ > (0 : ℝ), ∀ᶠ n : ℕ in atTop, ∀ k : ℕ, + Real.log (n : ℝ) ^ c ≤ (k : ℝ) → (k : ℝ) ≤ (n : ℝ) ^ (1 - ε) → + |(ω (n.choose k) : ℝ) - (k : ℝ) * primeRecipSum k n| ≤ + δ * ((k : ℝ) * primeRecipSum k n) := by + sorry + +/-- +For $1 \leq k \leq n - 1$ the number of distinct prime divisors of $\binom{n}{k}$ satisfies +$$\omega\left(\binom{n}{k}\right) \geq \frac{\log \binom{n}{k}}{\log n}.$$ +-/ +@[category textbook, AMS 11] +theorem erdos_685.variants.trivial_lower_bound : + ∀ n k : ℕ, 0 < k → k < n → + Real.log (n.choose k : ℝ) / Real.log (n : ℝ) ≤ (ω (n.choose k) : ℝ) := by + intro n k hk0 hkn + have hn : 1 < n := by omega + have hchoose : n.choose k ≤ n ^ (ω (n.choose k)) := by + have hc : (n.choose k).primeFactors.card = ω (n.choose k) := by + simp only [Nat.primeFactors, List.card_toFinset, ArithmeticFunction.cardDistinctFactors_apply] + calc + n.choose k = ∏ p ∈ (n.choose k).primeFactors, + p ^ (n.choose k).factorization p := + Nat.prod_primeFactors_pow_factorization (Nat.choose_ne_zero hkn.le) + _ ≤ ∏ _p ∈ (n.choose k).primeFactors, n := + Finset.prod_le_prod fun _ _ => Nat.pow_factorization_choose_le (by omega) + _ = n ^ (ω (n.choose k)) := by simp [hc] + have hp : 0 < Real.log (n : ℝ) := Real.log_pos (by exact_mod_cast hn) + apply (div_le_iff₀ hp).mpr + have hpow : (n.choose k : ℝ) ≤ (n : ℝ) ^ (ω (n.choose k)) := by + exact_mod_cast hchoose + have hlog := Real.log_le_log (Nat.cast_pos.mpr (Nat.choose_pos hkn.le)) hpow + simpa only [Real.log_pow] using hlog + +end Erdos685 diff --git a/FormalConjectures/ErdosProblems/687.lean b/FormalConjectures/ErdosProblems/687.lean new file mode 100644 index 0000000..947c8a2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/687.lean @@ -0,0 +1,223 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil +public import FormalConjectures.GreensOpenProblems.«46» + +/-! +# Erdős Problem 687 + +*References:* +- [erdosproblems.com/687](https://www.erdosproblems.com/687) +- [Ben Green's Open Problem 46](https://people.maths.ox.ac.uk/greenbj/papers/open-problems.pdf#problem.46): + the same question; see `Green46` in `FormalConjectures.GreensOpenProblems.«46»`. +- [OEIS A058989](https://oeis.org/A058989): the values $Y(p_n)$, where $p_n$ is the $n$-th prime. +- [OEIS A048670](https://oeis.org/A048670): Jacobsthal's function of $\prod_{p \leq p_n} p$, + which is $Y(p_n) + 1$. +- [Er79d] Erdős, P., *Some unconventional problems in number theory*. Acta Math. Acad. Sci. + Hungar. 33 (1979), 71-80. +- [Er80] Erdős, Paul, *A survey of problems in combinatorial number theory*. Ann. Discrete Math. + 6 (1980), 89-115. +- [Er96b] Erdős, Paul, *Some problems I presented or planned to present in my short talk*. + Analytic number theory, Vol. 1 (Allerton Park, IL, 1995), Progr. Math. 138 (1996), 333-335. +- [Iw78] Iwaniec, Henryk, *On the problem of Jacobsthal*. Demonstratio Math. 11 (1978), 225-232. + [doi:10.1515/dema-1978-0121](https://doi.org/10.1515/dema-1978-0121) +- [MaPo90] Maier, Helmut and Pomerance, Carl, *Unusually large gaps between consecutive primes*. + Trans. Amer. Math. Soc. 322 (1990), 201-237. +- [FGKMT18] Ford, Kevin and Green, Ben and Konyagin, Sergei and Maynard, James and Tao, Terence, + *Long gaps between primes*. J. Amer. Math. Soc. 31 (2018), 65-105. + [arXiv:1412.5029](https://arxiv.org/abs/1412.5029) +- [OAI26a] OpenAI, *A quadratic bound for Jacobsthal's function*. OpenAI Math Release preprint + (2026). + https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/A-quadratic-bound-for-Jacobsthals-function-September-25-2026/paper.pdf +-/ + +@[expose] public section + +open Filter + +namespace Erdos687 + +/-- +`Y x` is $Y(x)$, the maximal $y$ such that there is a choice of congruence classes $a_p$, one +for each prime $p \leq x$, such that every integer in $[1, y]$ is congruent to at least one of +the $a_p \pmod{p}$. The covering condition is `Green46.IsCoveredByResidues x y`. + +We take $x$ to be a natural number, since $Y(x)$ only depends on $\lfloor x \rfloor$. The set of +such $y$ contains $0$ and is bounded by $\prod_{p \leq x} p$ +(`Erdos687.lt_primorial_of_isCoveredByResidues`), so `sSup` is its maximum. $Y(x) = 0$ for +$x < 2$. +-/ +noncomputable def Y (x : ℕ) : ℕ := + sSup {y : ℕ | Green46.IsCoveredByResidues x y} + +/-- `Green46.maxY` is `Y` cast to `ℝ`. -/ +@[category test, AMS 11] +theorem maxY_eq_Y (x : ℕ) : Green46.maxY x = Y x := rfl + +/-- If $[1, y]$ is covered by classes $a_p \pmod{p}$, $p \leq x$, then $y < \prod_{p \leq x} p$: +by the Chinese remainder theorem some integer in $[1, \prod_{p \leq x} p]$ lies in none of the +classes. -/ +@[category test, AMS 11] +theorem lt_primorial_of_isCoveredByResidues {x y : ℕ} (h : Green46.IsCoveredByResidues x y) : + y < primorial x := by + obtain ⟨a, ha⟩ := h + refine lt_of_not_ge fun hy ↦ ?_ + let t := (Finset.range (x + 1)).filter Nat.Prime + have hs : ∀ p ∈ t, (fun p : ℕ ↦ p) p ≠ 0 := fun p hp ↦ (Finset.mem_filter.1 hp).2.ne_zero + have pp : Set.Pairwise (t : Set ℕ) (Function.onFun Nat.Coprime fun p : ℕ ↦ p) := + fun p hp q hq hpq ↦ + (Nat.coprime_primes (Finset.mem_filter.1 hp).2 (Finset.mem_filter.1 hq).2).2 hpq + -- By the Chinese remainder theorem, `k ≡ a p + 1 (mod p)` for every prime `p ≤ x`. + let k := Nat.chineseRemainderOfFinset (fun p ↦ a p + 1) (fun p ↦ p) t hs pp + have hk : (k : ℕ) < primorial x := Nat.chineseRemainderOfFinset_lt_prod _ _ hs pp + -- Shift `k` into `[1, primorial x]` without changing its residues. + obtain ⟨m, hm1, hmP, hmk⟩ : + ∃ m, 1 ≤ m ∧ m ≤ primorial x ∧ ∀ p ∈ t, m ≡ k [MOD p] := by + by_cases h0 : (k : ℕ) = 0 + · refine ⟨primorial x, primorial_pos x, le_rfl, fun p hp ↦ ?_⟩ + have hp' := Finset.mem_filter.1 hp + rw [h0] + exact Nat.modEq_zero_iff_dvd.2 + (hp'.2.dvd_primorial_iff.2 (Nat.lt_succ_iff.1 (Finset.mem_range.1 hp'.1))) + · exact ⟨k, Nat.one_le_iff_ne_zero.2 h0, hk.le, fun p _ ↦ Nat.ModEq.refl _⟩ + obtain ⟨p, hpx, hp, hpm⟩ := ha m (Finset.mem_Icc.2 ⟨hm1, hmP.trans hy⟩) + have hpt : p ∈ t := Finset.mem_filter.2 ⟨Finset.mem_range.2 (Nat.lt_succ_of_le hpx), hp⟩ + have h1 : a p ≡ a p + 1 [MOD p] := hpm.symm.trans ((hmk p hpt).trans (k.2 p hpt)) + have hd : p ∣ 1 := by simpa using (Nat.modEq_iff_dvd' (Nat.le_add_right (a p) 1)).1 h1 + exact hp.not_dvd_one hd + +/-- With the single prime $2$, one class covers $1$ but no class covers both $1$ and $2$, so +$Y(2) = 1$. -/ +@[category test, AMS 11] +theorem Y_two : Y 2 = 1 := by + have h1 : Green46.IsCoveredByResidues 2 1 := by + refine ⟨fun _ ↦ 1, fun m hm ↦ ⟨2, le_rfl, Nat.prime_two, ?_⟩⟩ + have := Finset.mem_Icc.1 hm + show m % 2 = 1 % 2 + omega + have h2 : ∀ y, Green46.IsCoveredByResidues 2 y → y ≤ 1 := by + rintro y ⟨a, ha⟩ + by_contra hy + obtain ⟨p, hp2, hp, hp1⟩ := ha 1 (Finset.mem_Icc.2 ⟨le_rfl, by omega⟩) + obtain ⟨q, hq2, hq, hq1⟩ := ha 2 (Finset.mem_Icc.2 ⟨by omega, by omega⟩) + rw [le_antisymm hp2 hp.two_le] at hp1 + rw [le_antisymm hq2 hq.two_le] at hq1 + exact absurd (hp1.trans hq1.symm) (by decide) + rw [Y] + exact IsGreatest.csSup_eq ⟨h1, h2⟩ + +/-- The classes $1 \pmod 2$ and $2 \pmod 3$ cover $1, 2, 3$, but no choice of classes modulo +$2$ and $3$ covers $1, 2, 3, 4$, so $Y(3) = 3$. -/ +@[category test, AMS 11] +theorem Y_three : Y 3 = 3 := by + have h1 : Green46.IsCoveredByResidues 3 3 := by + refine ⟨fun p ↦ if p = 2 then 1 else 2, fun m hm ↦ ?_⟩ + obtain ⟨hm1, hm3⟩ := Finset.mem_Icc.1 hm + interval_cases m + · exact ⟨2, by norm_num, Nat.prime_two, by decide⟩ + · exact ⟨3, le_rfl, Nat.prime_three, by decide⟩ + · exact ⟨2, by norm_num, Nat.prime_two, by decide⟩ + have h2 : ∀ y, Green46.IsCoveredByResidues 3 y → y ≤ 3 := by + rintro y ⟨a, ha⟩ + by_contra hy + have key : ∀ m, 1 ≤ m → m ≤ 4 → m % 2 = a 2 % 2 ∨ m % 3 = a 3 % 3 := by + intro m hm1 hm4 + obtain ⟨p, hp3, hp, hpm⟩ := ha m (Finset.mem_Icc.2 ⟨hm1, by omega⟩) + interval_cases p + · exact absurd hp (by decide) + · exact absurd hp (by decide) + · exact Or.inl hpm + · exact Or.inr hpm + have k1 := key 1 le_rfl (by norm_num) + have k2 := key 2 (by norm_num) (by norm_num) + have k3 := key 3 (by norm_num) (by norm_num) + have k4 := key 4 (by norm_num) le_rfl + omega + rw [Y] + exact IsGreatest.csSup_eq ⟨h1, h2⟩ + +def erdos_687.parts.i.answer : ℕ → ℝ := sorry + +/-- +Let $Y(x)$ be the maximal $y$ such that there exists a choice of congruence classes $a_p$ for +all primes $p\leq x$ such that every integer in $[1,y]$ is congruent to at least one of the +$a_p\pmod{p}$. Give good estimates for $Y(x)$. + +We formalise this as determining $Y(x)$ up to constant factors. +-/ +@[category research open, question value, AMS 11] +theorem erdos_687.parts.i : + (fun x : ℕ ↦ (Y x : ℝ)) =Θ[atTop] erdos_687.parts.i.answer := by + sorry + +/-- +In particular, can one prove that $Y(x)=o(x^2)$? + +Yes: an internal OpenAI model proved $h(k) \ll k^2$ for Jacobsthal's function $h$ [OAI26a] +(see `Erdos970.erdos_970`). Since $Y(x) + 1$ is Jacobsthal's function of $\prod_{p \leq x} p$, +which has $\pi(x) \ll x/\log x$ prime factors, this gives $Y(x) \ll x^2/(\log x)^2$. +The linked Lean proof is by 30k30, from the bound of [OAI26a]. +-/ +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/30k30/scholia/blob/b072c89c3edac06521868e32cc15b2bc91bd8533/erdos-687/glue/JacobsthalTo687.lean#L325"] +theorem erdos_687.parts.ii : + (fun x : ℕ ↦ (Y x : ℝ)) =o[atTop] (fun x : ℕ ↦ (x : ℝ) ^ 2) := by + sorry + +/-- +Or, even stronger, can one prove that $Y(x)\ll x^{1+o(1)}$? + +We read $Y(x)\ll x^{1+o(1)}$ as $Y(x) = O(x^{1+\varepsilon})$ for every fixed +$\varepsilon > 0$. +-/ +@[category research open, question, AMS 11] +theorem erdos_687.parts.iii : + ∀ ε > (0 : ℝ), (fun x : ℕ ↦ (Y x : ℝ)) =O[atTop] (fun x : ℕ ↦ (x : ℝ) ^ (1 + ε)) := by + sorry + +/-- +Iwaniec's upper bound for Jacobsthal's function [Iw78] gives $Y(x) \ll x^2$. +-/ +@[category research solved, AMS 11] +theorem erdos_687.variants.iwaniec : + (fun x : ℕ ↦ (Y x : ℝ)) =O[atTop] (fun x : ℕ ↦ (x : ℝ) ^ 2) := by + sorry + +/-- +Ford, Green, Konyagin, Maynard and Tao [FGKMT18] proved +$$Y(x) \gg \frac{x \log x \log\log\log x}{\log\log x}.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_687.variants.fgkmt : + (fun x : ℕ ↦ (x : ℝ) * Real.log x * Real.log (Real.log (Real.log x)) / + Real.log (Real.log x)) =O[atTop] (fun x : ℕ ↦ (Y x : ℝ)) := by + sorry + +/-- +Maier and Pomerance [MaPo90] conjectured that $Y(x) \ll x(\log x)^{2+o(1)}$ (in this form it is +stated in [FGKMT18]). + +We read this as $Y(x) = O(x(\log x)^{2+\varepsilon})$ for every fixed $\varepsilon > 0$. +-/ +@[category research open, AMS 11] +theorem erdos_687.variants.maier_pomerance : + ∀ ε > (0 : ℝ), (fun x : ℕ ↦ (Y x : ℝ)) =O[atTop] + (fun x : ℕ ↦ (x : ℝ) * Real.log x ^ (2 + ε)) := by + sorry + +end Erdos687 diff --git a/FormalConjectures/ErdosProblems/691.lean b/FormalConjectures/ErdosProblems/691.lean new file mode 100644 index 0000000..c06de9b --- /dev/null +++ b/FormalConjectures/ErdosProblems/691.lean @@ -0,0 +1,45 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 691 + +*Reference:* [erdosproblems.com/691](https://www.erdosproblems.com/691) +-/ + +@[expose] public section + +namespace Erdos691 + +/-- The set $M_A = \{n \geq 1 : a \mid n \text{ for some } a \in A\}$ of positive multiples +of elements of $A$. -/ +def multiples (A : Set ℕ) : Set ℕ := {n | 1 ≤ n ∧ ∃ a ∈ A, a ∣ n} + +def erdos_691.answer : Set ℕ → Prop := sorry + +/-- Given $A \subseteq \mathbb{N}$, let +$M_A = \{n \geq 1 : a \mid n \text{ for some } a \in A\}$. Find a necessary and sufficient +condition on $A$ for $M_A$ to have density $1$. -/ +@[category research open, question value, AMS 11] +theorem erdos_691 : + erdos_691.answer = fun A ↦ (multiples A).HasDensity 1 := by + sorry + +end Erdos691 diff --git a/FormalConjectures/ErdosProblems/692.lean b/FormalConjectures/ErdosProblems/692.lean index b96b4cb..a6aabcc 100644 --- a/FormalConjectures/ErdosProblems/692.lean +++ b/FormalConjectures/ErdosProblems/692.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 692 @@ -30,6 +31,8 @@ import FormalConjecturesUtil arXiv:2501.10333 (2025). -/ +@[expose] public section + namespace Erdos692 open Filter @@ -46,6 +49,14 @@ $\delta_1(n,m)$ is the density of the set of integers with exactly one divisor i def IsDelta₁ (n m : ℕ) (δ : ℝ) : Prop := (exactlyOneDivisorIn n m).HasDensity δ +/-- +The set of local maxima of the sequence `f` on `(a, ∞)`. Each local maximum is recorded by the +first index `m` of a maximal interval `[m, b]` on which `f` is constant, with `f` strictly smaller +at `m - 1` and at `b + 1`. +-/ +def localMaxima (f : ℕ → ℝ) (a : ℕ) : Set ℕ := + {m | a < m ∧ f (m - 1) < f m ∧ ∃ b, m ≤ b ∧ (∀ j ∈ Set.Icc m b, f j = f m) ∧ f (b + 1) < f m} + /-- Let $\delta_1(n,m)$ be the density of the set of integers with exactly one divisor in $(n,m)$. Is $\delta_1(n,m)$ unimodular for $m>n+1$ (i.e. increases until some $m$ then decreases @@ -55,20 +66,22 @@ Cambie has calculated that unimodularity fails even for $n=2$ and $n=3$. This was formalized in Lean by Monticone using Aristotle. -/ -@[category research solved, AMS 11, formal_proof using lean4 at +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://gist.githubusercontent.com/pitmonticone/96516af9100a37a1da81908dc0b0410c/raw/a1d6ca7f3835c58b257e5e715c8fdf3a224e1bd0/Erdos692.lean"] -theorem erdos_692.parts.i : answer(False) ↔ - ∀ δ : ℕ → ℕ → ℝ, (∀ a b, IsDelta₁ a b (δ a b)) → ∀ n, UnimodularOn (δ n) (n + 1) := by +theorem erdos_692.parts.i : + ¬ ∀ δ : ℕ → ℕ → ℝ, (∀ a b, IsDelta₁ a b (δ a b)) → ∀ n, UnimodularOn (δ n) (n + 1) := by sorry +def erdos_692.parts.ii.answer : ℕ := sorry + /-- Let $\delta_1(n,m)$ be the density of the set of integers with exactly one divisor in $(n,m)$. For fixed $n$, where does $\delta_1(n,m)$ achieve its maximum? -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_692.parts.ii (n : ℕ) : ∀ δ : ℕ → ℕ → ℝ, (∀ a b, IsDelta₁ a b (δ a b)) → - IsGreatest (δ n '' Set.Ioi (n + 1)) (δ n answer(sorry)) := by + IsGreatest (δ n '' Set.Ioi (n + 1)) (δ n erdos_692.parts.ii.answer) := by sorry /-- @@ -86,7 +99,8 @@ theorem erdos_692.variants.erdos_upper_bound : Cambie has calculated that unimodularity fails even for $n=2$ and $n=3$. For example, $$\delta_1(3,6)= 0.35\quad \delta_1(3,7)\approx 0.33\quad \delta_1(3,8)\approx 0.3619.$$ -/ -@[category research solved, AMS 11] +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/b8e7531a14cbe5c18ea1ae2e9e85b811bc3c7a46/erdos-692/Solution.lean#L26"] theorem erdos_692.variants.cambie_three : ∀ δ : ℕ → ℕ → ℝ, (∀ a b, IsDelta₁ a b (δ a b)) → δ 3 7 < δ 3 6 ∧ δ 3 7 < δ 3 8 := by @@ -94,13 +108,13 @@ theorem erdos_692.variants.cambie_three : /-- Cambie [Ca25] has shown that, for fixed $n$, the sequence $\delta_1(n,m)$ has superpolynomially -many local maxima $m$. +many local maxima $m$. A local maximum is a maximal run of equal values of the sequence that is +strictly larger than the values just before and just after the run. -/ @[category research solved, AMS 11] theorem erdos_692.variants.cambie_local_maxima (k : ℕ) : ∀ δ : ℕ → ℕ → ℝ, (∀ a b, IsDelta₁ a b (δ a b)) → - ∀ᶠ n : ℕ in atTop, (n : ℝ) ^ k ≤ - ({m : ℕ | n + 1 < m ∧ δ n (m - 1) ≤ δ n m ∧ δ n (m + 1) ≤ δ n m}.ncard : ℝ) := by + ∀ᶠ n : ℕ in atTop, (n : ℕ∞) ^ k ≤ (localMaxima (δ n) (n + 1)).encard := by sorry end Erdos692 diff --git a/FormalConjectures/ErdosProblems/694.lean b/FormalConjectures/ErdosProblems/694.lean index f9b8eba..70a3dc5 100644 --- a/FormalConjectures/ErdosProblems/694.lean +++ b/FormalConjectures/ErdosProblems/694.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 694 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/694](https://www.erdosproblems.com/694) -/ +@[expose] public section + namespace Erdos694 open Filter Topology Real @@ -42,23 +45,28 @@ $$ A Lean formalisation of the reduction exists, conditional on Mertens' product theorem and Linnik's theorem; see the [formal proof](https://github.com/Shashi456/erdos-formalizations/blob/main/Erdos/P694/Proof.lean). + +The extrema are only required on nonempty fibres of the totient (values such as $3$ have no +preimage), and the identity is asked for sufficiently large $x$: at $x = 1$ the maximum is +$f_\max(1) / f_\min(1) = 2$ while $\log \log 1 = 0$. -/ @[category research solved, AMS 11] theorem erdos_694 : ∀ᵉ (fmax : ℕ → ℕ) (fmin : ℕ → ℕ), - (∀ n, IsGreatest (Nat.totient ⁻¹' {n}) (fmax n)) → - (∀ n, IsLeast (Nat.totient ⁻¹' {n}) (fmin n)) → + (∀ n, (∃ m, Nat.totient m = n) → IsGreatest (Nat.totient ⁻¹' {n}) (fmax n)) → + (∀ n, (∃ m, Nat.totient m = n) → IsLeast (Nat.totient ⁻¹' {n}) (fmin n)) → ∃ o : ℕ → ℝ, Tendsto o atTop (𝓝 0) ∧ - ∀ x : ℕ, sSup { (fmax n : ℝ) / fmin n | (n : ℕ) (_ : n ≤ x) (_ : ∃ m, Nat.totient m = n) } = - (exp eulerMascheroniConstant + o x) * log (log (x : ℝ)) := by + ∀ᶠ x : ℕ in atTop, + sSup { (fmax n : ℝ) / fmin n | (n : ℕ) (_ : n ≤ x) (_ : ∃ m, Nat.totient m = n) } = + (exp eulerMascheroniConstant + o x) * log (log (x : ℝ)) := by sorry /-- Carmichael has asked whether there is an integer $n$ for which $\phi(m) = n$ has exactly one solution, that is $\frac{f_\max(n)}{f_\min(n)} = 1$. -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_694.variants.carmichael : - answer(sorry) ↔ ∃ n > 0, ∃! m, Nat.totient m = n := by + ∃ n > 0, ∃! m, Nat.totient m = n := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/7.lean b/FormalConjectures/ErdosProblems/7.lean index 3736f8b..234f8c8 100644 --- a/FormalConjectures/ErdosProblems/7.lean +++ b/FormalConjectures/ErdosProblems/7.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 7 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/7](https://www.erdosproblems.com/7) -/ +@[expose] public section + namespace Erdos7 open Set @@ -29,8 +32,8 @@ open Set /-- Is there a covering system all of whose moduli are odd (and greater than 1)? -/ -@[category research open, AMS 11] -theorem erdos_7 : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_7 : ∃ (C : StrictCoveringSystem ℤ), ∀ i, ¬ C.moduli i ≤ Ideal.span {2} ∧ C.moduli i ≠ ⊤ := by sorry diff --git a/FormalConjectures/ErdosProblems/70.lean b/FormalConjectures/ErdosProblems/70.lean index 9d0869a..af02911 100644 --- a/FormalConjectures/ErdosProblems/70.lean +++ b/FormalConjectures/ErdosProblems/70.lean @@ -13,19 +13,29 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 70 -*Reference:* [erdosproblems.com/70](https://www.erdosproblems.com/70) - -The 3-uniform (triple) partition relation $\mathfrak{c} \to (\beta, n)^3_2$ -on the ordinal of the real numbers — the triple analogue of `OrdinalCardinalRamsey` -used in Problems 590–592. +*References:* +- [erdosproblems.com/70](https://www.erdosproblems.com/70) +- [ErRa56] Erdős, P. and Rado, R., *A partition calculus in set theory*, + Bull. Amer. Math. Soc. **62** (1956), 427–489, Theorem 31. +- [Er87] Erdős, P., *Some problems on finite and infinite graphs*, + Logic and combinatorics (Arcata, Calif., 1985), Contemp. Math. **65** (1987), 223–228. + +The 3-uniform (triple) partition relation $\mathfrak{c} \to (\beta, n)^3_2$, where +$\mathfrak{c}$ denotes the order type of the real numbers with their usual order (written +$\lambda$ in [ErRa56]). This is the triple analogue of `OrdinalCardinalRamsey` used in +Problems 590–592; the file also contains the analogous relation for an ordinal in place +of the real line. -/ +@[expose] public section + open Cardinal Ordinal open scoped Cardinal @@ -63,21 +73,46 @@ def OrdinalCardinalRamsey3 (α β : Ordinal.{u}) (c : Cardinal.{u}) : Prop := -- or there is a blue-monochromatic subset of cardinality c (∃ s : Set α.ToType, #s = c ∧ s.Triplewise (fun x y z ↦ ¬ isRed x y z)) +/-- +`RealCardinalRamsey3 β c` asserts the 3-uniform partition relation +$\mathfrak{c} \to (\beta, c)^3_2$, where $\mathfrak{c}$ is the order type of the real +numbers with their usual order. + +It states that for any 2-coloring of all 3-element subsets of $\mathbb{R}$, +one of the following must hold: +* There is a red-monochromatic subset of order type $\beta$: the range of an order embedding + `β.ToType ↪o ℝ` such that any three distinct elements of the range are colored red. +* There is a blue-monochromatic subset of cardinality $c$: a set $s \subseteq \mathbb{R}$ with + $\#s = c$ such that every three distinct elements of $s$ are colored blue. + +The coloring is encoded as in `OrdinalCardinalRamsey3`: a predicate on ordered triples of +distinct reals that is invariant under permutation of its three arguments. +-/ +def RealCardinalRamsey3 (β : Ordinal.{0}) (c : Cardinal.{0}) : Prop := + -- For any partition of 3-element subsets of `ℝ` into red and blue: + ∀ (isRed : ℝ → ℝ → ℝ → Prop), + -- The colouring is well-defined on *unordered* triples of distinct elements: + (∀ x y z, x ≠ y → y ≠ z → x ≠ z → + (isRed x y z ↔ isRed y x z) ∧ (isRed x y z ↔ isRed x z y)) → + -- either there is a red-monochromatic subset of order type β + (∃ e : β.ToType ↪o ℝ, (Set.range e).Triplewise isRed) ∨ + -- or there is a blue-monochromatic subset of cardinality c + (∃ s : Set ℝ, #s = c ∧ s.Triplewise (fun x y z ↦ ¬ isRed x y z)) + /- ### The main open problem -/ /-- -**Erdős Problem 70**: Let $\mathfrak{c}$ be the cardinality of the continuum, +**Erdős Problem 70**: Let $\mathfrak{c}$ be the order type of the real numbers, let $\beta$ be a countable ordinal, and let $2 \le n < \omega$. Is it true that $\mathfrak{c} \to (\beta, n)^3_2$? -Note: The cases $n \le 3$ are trivially true (see `omega_three`), so the +Note: The cases $n \le 3$ are trivially true (compare `omega_three`), so the genuine content of the conjecture begins at $n = 4$. -/ -@[category research open, AMS 3] +@[category research open, question, AMS 3] theorem erdos_70 : - answer(sorry) ↔ ∀ᵉ (β : Ordinal.{0}) (n : ℕ) (_ : β.card ≤ ℵ₀) (_ : 2 ≤ n), - OrdinalCardinalRamsey3 (𝔠).ord β n := by + RealCardinalRamsey3 β n := by sorry /- ### Variants -/ @@ -86,29 +121,32 @@ namespace erdos_70.variants /-- **Erdős–Rado partial result**: $\mathfrak{c} \to (\omega + n, 4)^3_2$ for any -$2 \le n < \omega$. Positive partial answer to Problem 70 with $\beta = \omega + n$ -and the blue side fixed at $4$. +$2 \le n < \omega$, where $\mathfrak{c}$ is the order type of the real numbers. +Positive partial answer to Problem 70 with $\beta = \omega + n$ and the blue side +fixed at $4$ [ErRa56, Theorem 31]. -/ @[category research solved, AMS 3] theorem erdos_rado (n : ℕ) (hn : 2 ≤ n) : - OrdinalCardinalRamsey3 (𝔠).ord (ω + n) 4 := by + RealCardinalRamsey3 (ω + n) 4 := by sorry /-- -**First open case beyond Erdős–Rado**: $\mathfrak{c} \to (\omega \cdot 2, 4)^3_2$. +**First open case beyond Erdős–Rado**: $\mathfrak{c} \to (\omega \cdot 2, 4)^3_2$, +where $\mathfrak{c}$ is the order type of the real numbers. Erdős and Rado proved $\mathfrak{c} \to (\omega + n, 4)^3_2$ for every finite $n \ge 2$ (see `erdos_rado`), which covers all red ordinals below $\omega \cdot 2 = \omega + \omega$. This variant asks whether the result extends to $\beta = \omega \cdot 2$, the simplest countable ordinal not covered by their theorem. -/ -@[category research open, AMS 3] +@[category research open, question, AMS 3] theorem omega_times_two_four : - answer(sorry) ↔ OrdinalCardinalRamsey3 (𝔠).ord (ω * 2) 4 := by + RealCardinalRamsey3 (ω * 2) 4 := by sorry /-- -**Trivial boundary case**: $\mathfrak{c} \to (\omega, 3)^3_2$. +**Trivial boundary case**: $\mathfrak{c} \to (\omega, 3)^3_2$, stated for the initial +ordinal $\mathfrak{c}.\mathrm{ord}$ of the cardinality of the continuum. This is trivially true because in a 3-uniform hypergraph, a \"blue clique of size 3\" consists of a single 3-element subset ($\binom{3}{3} = 1$), so the blue alternative @@ -120,10 +158,10 @@ merely asks for one blue triple to exist. The proof splits into two cases: The problem becomes non-trivial only for $n \ge 4$; see `omega_times_two_four` for the simplest genuinely open case. -/ -@[category research solved, AMS 3, formal_proof using formal_conjectures at +@[category research solved, question, AMS 3, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/c024db0fa3ac32c6dddcd6c28d7b0cd994dad580/FormalConjectures/ErdosProblems/70.lean#L126"] theorem omega_three : - answer(True) ↔ OrdinalCardinalRamsey3 (𝔠).ord ω 3 := by + OrdinalCardinalRamsey3 (𝔠).ord ω 3 := by sorry /-- @@ -135,9 +173,8 @@ main Erdős problem (which asks for *countable* $\beta$). Under CH, $\omega_1 = making this a self-referential question about $\mathfrak{c}.\mathrm{ord} \to (\mathfrak{c}.\mathrm{ord}, n)^3_2$. -/ -@[category research open, AMS 3] +@[category research open, question, AMS 3] theorem omega_one : - answer(sorry) ↔ ∀ᵉ (n : ℕ) (_ : 2 ≤ n), OrdinalCardinalRamsey3 (𝔠).ord (Cardinal.aleph 1).ord n := by sorry diff --git a/FormalConjectures/ErdosProblems/700.lean b/FormalConjectures/ErdosProblems/700.lean index 8094ee8..63302cf 100644 --- a/FormalConjectures/ErdosProblems/700.lean +++ b/FormalConjectures/ErdosProblems/700.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 700 @@ -30,6 +31,8 @@ A problem of Erdős and Szekeres [ErSz78]. * Guy, R. K., _Unsolved Problems in Number Theory_, B31, B33. -/ +@[expose] public section + namespace Erdos700 open Finset @@ -42,6 +45,10 @@ noncomputable def f (n : ℕ) : ℕ := /-- `P n` is the largest prime factor of `n` (and `0` if `n ≤ 1`). -/ noncomputable def P (n : ℕ) : ℕ := n.primeFactors.sup id +/-- $Q(n)$ is the largest prime-power divisor of $n$: the maximum of $p^{v_p(n)}$ over +prime divisors $p$ of $n$. It is `0` when `n ≤ 1`. -/ +noncomputable def Q (n : ℕ) : ℕ := n.primeFactors.sup (fun p => p ^ n.factorization p) + /-- The set whose infimum defines `f`. -/ def fSet (n : ℕ) : Set ℕ := {m | ∃ k, 1 < k ∧ k ≤ n / 2 ∧ m = Nat.gcd n (n.choose k)} @@ -59,6 +66,8 @@ lemma f_mem (n k : ℕ) (h1 : 1 < k) (h2 : k ≤ n / 2) : lemma f_le (n k : ℕ) (h1 : 1 < k) (h2 : k ≤ n / 2) : f n ≤ Nat.gcd n (n.choose k) := Nat.sInf_le (f_mem n k h1 h2) +def erdos_700.parts.i.answer : Set ℕ := sorry + /-- Let $f(n) = \min_{1 < k \le n/2} \gcd(n, \binom{n}{k})$ and let $P(n)$ be the largest prime dividing $n$. @@ -66,12 +75,41 @@ dividing $n$. Erdős–Szekeres [ErSz78] note that $f(n) = n/P(n)$ when $n$ is a product of two primes (`erdos_700.variants.prime_mul`), with $n = 30$ a further example. The characterisation itself is -open; we state it as the (unknown) predicate that is equivalent to being such an `n`. -/ -@[category research open, AMS 11] -theorem erdos_700.parts.i (n : ℕ) (hn : ¬ n.Prime) (hn1 : 1 < n) : - f n = n / P n ↔ answer(sorry) := by +open; we state it as the (unknown) set of all composite `n` with `f n = n / P n`. + +This follows the largest-prime reading on erdosproblems.com. In [ErSz78, p. 98], the first prose +line below (7) reads: "where $P(n)$ is the greatest prime power which divides $n$." +The paper's reading is stated with $Q(n)$ in `erdos_700.variants.prime_power_divisor`. -/ +@[category research open, question value, AMS 11] +theorem erdos_700.parts.i : + {n : ℕ | ¬ n.Prime ∧ 1 < n ∧ f n = n / P n} = erdos_700.parts.i.answer := by sorry +def erdos_700.variants.prime_power_divisor.answer : Set ℕ := sorry + +/-- Characterise those composite $n$ such that $f(n) = n/Q(n)$, where $Q(n)$ is the largest +prime-power divisor of $n$. This is the reading of part (a) in Erdős–Szekeres +[ErSz78, pp. 98–99](https://combinatorica.hu/~p_erdos/1978-46.pdf). -/ +@[category research open, question value, AMS 11] +theorem erdos_700.variants.prime_power_divisor : + {n : ℕ | ¬ n.Prime ∧ 1 < n ∧ f n = n / Q n} = erdos_700.variants.prime_power_divisor.answer + := by + sorry + +/-- At $n = 12$, $f(n) = 3 = n/Q(n)$, whereas $n/P(n) = 4$. -/ +@[category test, AMS 11] +theorem prime_power_divisor_separation : f 12 = 3 ∧ 12 / P 12 = 4 ∧ 12 / Q 12 = 3 := by + refine ⟨le_antisymm ?_ ?_, ?_, ?_⟩ + · exact f_le 12 4 (by decide) (by decide) + · have hne : (fSet 12).Nonempty := ⟨_, f_mem 12 4 (by decide) (by decide)⟩ + obtain ⟨k, hk1, hk2, hkeq⟩ := Nat.sInf_mem hne + rw [f_eq, hkeq] + interval_cases k <;> decide + · unfold P + decide +kernel + · unfold Q + decide +kernel + /-- Let $f(n) = \min_{1 < k \le n/2} \gcd(n, \binom{n}{k})$. **(b)** Are there infinitely many composite $n$ such that $f(n) > n^{1/2}$? @@ -79,9 +117,9 @@ theorem erdos_700.parts.i (n : ℕ) (hn : ¬ n.Prime) (hn1 : 1 < n) : Erdős–Szekeres [ErSz78] could not prove this. (Since $f(n) \ge p(n)$, the least prime factor of $n$, there are infinitely many $n$ — those of the form $p^2$ — with $f(n) \ge n^{1/2}$; the question asks for the strict inequality.) Here $f(n) > n^{1/2}$ is written as `(f n) ^ 2 > n`. -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_700.parts.ii : - answer(sorry) ↔ {n : ℕ | ¬ n.Prime ∧ 1 < n ∧ (f n) ^ 2 > n}.Infinite := by + {n : ℕ | ¬ n.Prime ∧ 1 < n ∧ (f n) ^ 2 > n}.Infinite := by sorry /-- Let $f(n) = \min_{1 < k \le n/2} \gcd(n, \binom{n}{k})$. @@ -91,9 +129,9 @@ theorem erdos_700.parts.ii : Erdős–Szekeres [ErSz78] prove the weaker bound $f(n) \le (1 + o(1)) n/\log n$ (the case $A = 1$). Here $f(n) \ll_A n/(\log n)^A$ is spelled out as: for every `A > 0` there is a constant `C` (depending on `A`) with `f(n) ≤ C · n/(log n)^A` for every composite `n`. -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_700.parts.iii : - answer(sorry) ↔ (∀ A : ℝ, 0 < A → ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, ¬ n.Prime → 1 < n → + (∀ A : ℝ, 0 < A → ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, ¬ n.Prime → 1 < n → (f n : ℝ) ≤ C * (n : ℝ) / (Real.log n) ^ A) := by sorry diff --git a/FormalConjectures/ErdosProblems/701.lean b/FormalConjectures/ErdosProblems/701.lean index c147050..e14b7a3 100644 --- a/FormalConjectures/ErdosProblems/701.lean +++ b/FormalConjectures/ErdosProblems/701.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 701 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/701](https://www.erdosproblems.com/701) -/ +@[expose] public section + namespace Erdos701 open Cardinal @@ -32,8 +35,8 @@ $B\subseteq A\in\mathcal{F}$ then $B\in \mathcal{F}$). There exists some element whenever $\mathcal{F}'\subseteq \mathcal{F}$ is an intersecting subfamily we have $$\lvert \mathcal{F}'\rvert \leq \lvert \{ A\in \mathcal{F} : x\in A\}\rvert.$$ -/ -@[category research open, AMS 5] -theorem erdos_701 : answer(sorry) ↔ ∀ {X : Type} [Nonempty X] [Fintype X], +@[category research open, question, AMS 5] +theorem erdos_701 : ∀ {X : Type} [Nonempty X] [Fintype X], ∀ (F : Set (Set X)), IsLowerSet F → ∃ x : X, ∀ᵉ (F' ⊆ F), F'.Intersecting → diff --git a/FormalConjectures/ErdosProblems/704.lean b/FormalConjectures/ErdosProblems/704.lean new file mode 100644 index 0000000..019df8b --- /dev/null +++ b/FormalConjectures/ErdosProblems/704.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 704 + +*References:* +- [erdosproblems.com/704](https://www.erdosproblems.com/704) +- [Da26] Davies, J., *Measurable obstructions for unmeasurable colourings*. Preprint (2026). + [arXiv:2610.12301](https://arxiv.org/abs/2610.12301) +- [Er81] Erdős, P., *On the combinatorial problems which I would most like to see solved*. + Combinatorica (1981), 25-42. +- [FrWi81] Frankl, P. and Wilson, R. M., *Intersection theorems with geometric consequences*. + Combinatorica (1981), 357-368. +- [LaRo72] Larman, D. G. and Rogers, C. A., *The realization of distances within sets in + Euclidean space*. Mathematika (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. +- [Ra00] Raigorodskii, A. M., *On the chromatic number of a space*. Uspekhi Mat. Nauk (2000), + 147-148. +-/ + +@[expose] public section + +open Filter +open scoped Topology + +namespace Erdos704 + +/-- +The unit distance graph $G_n$ on $\mathbb{R}^n$: two points are adjacent if and only if the +distance between them is $1$. +-/ +def unitDistanceGraph (n : ℕ) : SimpleGraph (EuclideanSpace ℝ (Fin n)) where + Adj x y := dist x y = 1 + symm.symm x y := by simp [dist_comm] + +/-- +Does $\chi(G_n)$ grow exponentially in $n$? + +Yes: Frankl and Wilson [FrWi81] proved an exponential lower bound and Larman and Rogers +[LaRo72] proved an exponential upper bound. Here exponential growth means that there are +constants $1 < c \leq C$ such that $c^n \leq \chi(G_n) \leq C^n$ for all large $n$. +-/ +@[category research solved, question, AMS 5 52] +theorem erdos_704.parts.i : + (∃ c > (1 : ℝ), ∀ᶠ n : ℕ in atTop, + ∀ k : ℕ, (unitDistanceGraph n).Colorable k → c ^ n ≤ (k : ℝ)) ∧ + ∃ C : ℝ, ∀ᶠ n : ℕ in atTop, + ∃ k : ℕ, (unitDistanceGraph n).Colorable k ∧ (k : ℝ) ≤ C ^ n := by + sorry + +/-- +Let $G_n$ be the unit distance graph in $\mathbb{R}^n$, with two vertices joined by an edge if +and only if the distance between them is $1$. Does +$$\lim_{n\to\infty}\chi(G_n)^{1/n}$$ +exist? + +This generalises the Hadwiger–Nelson problem (Erdős Problem 508), the case $n = 2$. The +chromatic number is finite (see `Erdos704.erdos_704.variants.cube_colouring`). +-/ +@[category research open, question, AMS 5 52] +theorem erdos_704.parts.ii : + ∃ L : ℝ, Tendsto + (fun n : ℕ ↦ ((unitDistanceGraph n).chromaticNumber.toNat : ℝ) ^ (1 / (n : ℝ))) + atTop (𝓝 L) := by + sorry + +/-- +The trivial colouring (by tiling with cubes) gives +$$\chi(G_n) \leq (2 + \sqrt{n})^n.$$ +In particular $\chi(G_n)$ is finite for every $n$. +-/ +@[category textbook, AMS 5 52] +theorem erdos_704.variants.cube_colouring : + ∀ n : ℕ, ∃ k : ℕ, (unitDistanceGraph n).Colorable k ∧ + (k : ℝ) ≤ (2 + Real.sqrt n) ^ n := by + sorry + +/-- +Frankl and Wilson [FrWi81] proved +$$\chi(G_n) \geq (1 + o(1)) 1.2^n.$$ +-/ +@[category research solved, AMS 5 52] +theorem erdos_704.variants.frankl_wilson : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + ∀ k : ℕ, (unitDistanceGraph n).Colorable k → (1 - ε) * 1.2 ^ n ≤ (k : ℝ) := by + sorry + +/-- +Raigorodskii [Ra00] proved +$$\chi(G_n) \geq (1.239\cdots + o(1))^n.$$ +We state the weaker bound with the truncated constant $1.239$: for every $0 < c < 1.239$ we +have $\chi(G_n) \geq c^n$ for all large $n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_704.variants.raigorodskii : + ∀ c ∈ Set.Ioo (0 : ℝ) 1.239, ∀ᶠ n : ℕ in atTop, + ∀ k : ℕ, (unitDistanceGraph n).Colorable k → c ^ n ≤ (k : ℝ) := by + sorry + +/-- +Davies [Da26, Theorem 1.4] proved +$$\chi(G_n) \geq (2 + o(1))^n,$$ +improving the bound of Raigorodskii (see `Erdos704.erdos_704.variants.raigorodskii`): for every +$0 < c < 2$ we have $\chi(G_n) \geq c^n$ for all large $n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_704.variants.davies_lower : + ∀ c ∈ Set.Ioo (0 : ℝ) 2, ∀ᶠ n : ℕ in atTop, + ∀ k : ℕ, (unitDistanceGraph n).Colorable k → c ^ n ≤ (k : ℝ) := by + sorry + +/-- +Larman and Rogers [LaRo72] proved +$$\chi(G_n) \leq (3 + o(1))^n.$$ +Prosanov [Pr20] has given an alternative proof of this bound. +-/ +@[category research solved, AMS 5 52] +theorem erdos_704.variants.larman_rogers : + ∀ C > (3 : ℝ), ∀ᶠ n : ℕ in atTop, + ∃ k : ℕ, (unitDistanceGraph n).Colorable k ∧ (k : ℝ) ≤ C ^ n := by + sorry + +/-- +Davies [Da26, Theorem 1.5] proved +$$\chi(G_n) \leq (3\sqrt{3}/2 + o(1))^n,$$ +improving the bound of Larman and Rogers (see `Erdos704.erdos_704.variants.larman_rogers`). +(The abstract of [Da26] prints $3\sqrt{3}/4$; Theorem 1.5 has $3\sqrt{3}/2 \approx 2.598$.) +-/ +@[category research solved, AMS 5 52] +theorem erdos_704.variants.davies_upper : + ∀ C > 3 * Real.sqrt 3 / 2, ∀ᶠ n : ℕ in atTop, + ∃ k : ℕ, (unitDistanceGraph n).Colorable k ∧ (k : ℝ) ≤ C ^ n := by + sorry + +/-- +Larman and Rogers [LaRo72] conjecture that the truth may be +$$\chi(G_n) = (2^{3/2} + o(1))^n,$$ +that is, $\chi(G_n)^{1/n} \to 2^{3/2}$. + +This is false: by `Erdos704.erdos_704.variants.davies_upper` [Da26] we have +$\limsup \chi(G_n)^{1/n} \leq 3\sqrt{3}/2 < 2^{3/2}$. Whether the limit exists remains open +(`Erdos704.erdos_704.parts.ii`). +-/ +@[category research solved, AMS 5 52] +theorem erdos_704.variants.larman_rogers_conjecture : + ¬ Tendsto + (fun n : ℕ ↦ ((unitDistanceGraph n).chromaticNumber.toNat : ℝ) ^ (1 / (n : ℝ))) + atTop (𝓝 ((2 : ℝ) ^ ((3 : ℝ) / 2))) := by + sorry + +end Erdos704 diff --git a/FormalConjectures/ErdosProblems/706.lean b/FormalConjectures/ErdosProblems/706.lean new file mode 100644 index 0000000..6963c12 --- /dev/null +++ b/FormalConjectures/ErdosProblems/706.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 706 + +*References:* +- [erdosproblems.com/706](https://www.erdosproblems.com/706) +- [Er81] Erdős, P., *On the combinatorial problems which I would most like to see solved*. + Combinatorica (1981), 25-42. +-/ + +@[expose] public section + +open Filter +open scoped EuclideanGeometry + +namespace Erdos706 + +/-- +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)$. + +Estimate $L(r)$. In particular, is it true that $L(r)\leq r^{O(1)}$? + +The case $r=1$ is the Hadwiger-Nelson problem, for which it is known that +$5\leq L(1)\leq 7$. + +See also [508](https://www.erdosproblems.com/508), [704](https://www.erdosproblems.com/704), +and [705](https://www.erdosproblems.com/705). + +Here $L(r)\leq r^{O(1)}$ is read as: there is $C$ with $\chi(G)\leq r^C$ for all large $r$. Small +$r$ must be excluded, since $L(1)\geq 5 > 1^C$. +-/ +@[category research open, question, AMS 5 52] +theorem erdos_706 : + ∃ C : ℕ, ∀ᶠ r : ℕ in atTop, ∀ (P : Finset ℝ²) (A : Finset ℝ), A.card = r → + (∀ a ∈ A, 0 < a) → + (SimpleGraph.DistancePlaneGraph (A : Set ℝ) (P : Set ℝ²)).chromaticNumber ≤ + (r ^ C : ℕ) := by + sorry + +end Erdos706 diff --git a/FormalConjectures/ErdosProblems/709.lean b/FormalConjectures/ErdosProblems/709.lean new file mode 100644 index 0000000..4c59698 --- /dev/null +++ b/FormalConjectures/ErdosProblems/709.lean @@ -0,0 +1,210 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 709 + +*References:* +- [erdosproblems.com/709](https://www.erdosproblems.com/709) +- [ErSu59] P. Erdős and J. Surányi, Bemerkungen zu einer Aufgabe eines mathematischen + Wettbewerbs, Mat. Lapok 10 (1959), 39–48. +- [Er92c] P. Erdős, Some of my forgotten problems in number theory, Hardy–Ramanujan J. 15 + (1992), 34–50. +- [vD26] W. van Doorn, On the length of an interval that contains distinct multiples of the + first $n$ positive integers, Integers (2026), #A7. +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos709 + +/-- The block of `length` consecutive positive integers immediately after `start`. -/ +def window (start length : ℕ) : Finset ℕ := Finset.Icc (start + 1) (start + length) + +/-- A block contains distinct multiples of all elements of `A`. -/ +def HasDistinctMultiples (A : Finset ℕ) (start length : ℕ) : Prop := + ∃ choice : ℕ → ℕ, + Set.InjOn choice (A : Set ℕ) ∧ + ∀ a ∈ A, choice a ∈ window start length ∧ a ∣ choice a + +/-- The multiplier `k` works for all `n`-element inputs and all starting points. +`M` is required to be the largest element of `A`. -/ +def Works (n k : ℕ) : Prop := + ∀ (A : Finset ℕ) (M : ℕ), + A.card = n → M ∈ A → (∀ a ∈ A, a ≤ M) → (∀ a ∈ A, 2 ≤ a) → + ∀ start : ℕ, HasDistinctMultiples A start (k * M) + +/-- `k` is the least multiplier that works for inputs of size `n`. -/ +def IsOptimal (n k : ℕ) : Prop := Works n k ∧ ∀ j < k, ¬ Works n j + +/-- A matching in a shorter block remains a matching in any longer block. -/ +@[category API, AMS 5 11] +theorem matching_mono_length + (A : Finset ℕ) (start small large : ℕ) (hsmall : small ≤ large) + (h : HasDistinctMultiples A start small) : HasDistinctMultiples A start large := by + obtain ⟨choice, hinj, hchoice⟩ := h + refine ⟨choice, hinj, ?_⟩ + intro a ha + obtain ⟨hmem, hdvd⟩ := hchoice a ha + refine ⟨?_, hdvd⟩ + simp only [window, Finset.mem_Icc] at hmem ⊢ + constructor + · exact hmem.1 + · omega + +/-- If multiplier `k` works, every larger multiplier also works. -/ +@[category API, AMS 5 11] +theorem works_mono (n k l : ℕ) (hkl : k ≤ l) (h : Works n k) : Works n l := by + intro A M hcard hmax hbound htwo start + exact matching_mono_length A start (k * M) (l * M) (Nat.mul_le_mul_right M hkl) + (h A M hcard hmax hbound htwo start) + +/-- Every interval of `M` consecutive positive integers contains a multiple of `a` when +`0 < a ≤ M`. -/ +@[category API, AMS 5 11] +theorem exists_multiple_in_window + (a M start : ℕ) (ha : 0 < a) (haM : a ≤ M) : + ∃ b ∈ window start M, a ∣ b := by + let r := start % a + let b := start + (a - r) + have hr : r < a := Nat.mod_lt start ha + have heq : start % a + a * (start / a) = start := by + simpa [Nat.mul_comm] using Nat.mod_add_div start a + have hbdiv : b = a * (start / a + 1) := by + have haux : b = a * (start / a) + a := by + dsimp [b, r] + omega + calc + b = a * (start / a) + a := haux + _ = a * (start / a + 1) := by ring + refine ⟨b, ?_, ?_⟩ + · simp only [window, Finset.mem_Icc] + constructor + · dsimp [b] + omega + · dsimp [b] + omega + · exact ⟨start / a + 1, hbdiv⟩ + +/-- Erdős Problem 709 holds for a singleton input: the multiplier `1` suffices. -/ +@[category textbook, AMS 5 11] +theorem erdos_709.variants.singleton : Works 1 1 := by + intro A M hcard hM hbound htwo start + have hA : A = {M} := by + obtain ⟨z, hz⟩ := Finset.card_eq_one.mp hcard + have hMz : M = z := Finset.mem_singleton.mp (hz ▸ hM) + simpa [hMz] using hz + obtain ⟨b, hb, hd⟩ := + exists_multiple_in_window M M start (by have := htwo M hM; omega) le_rfl + refine ⟨fun _ => b, ?_, ?_⟩ + · intro u hu v hv _ + rw [hA] at hu hv + simp only [Finset.coe_singleton, Set.mem_singleton_iff] at hu hv + exact hu.trans hv.symm + · intro a ha + rw [hA] at ha + have hEq : a = M := Finset.mem_singleton.mp ha + subst a + simpa using And.intro hb hd + +/-- For singleton inputs, every multiplier at least `1` works. -/ +@[category API, AMS 5 11] +theorem works_one_of_one_le (k : ℕ) (hk : 1 ≤ k) : Works 1 k := + works_mono 1 1 k hk erdos_709.variants.singleton + +/-- `IsAdmissible n c` says that for every set $A \subseteq [2,\infty)$ of $n$ natural numbers, +every block of at least $c \max(A)$ consecutive positive integers contains distinct multiples of +the elements of $A$. Restricting to positive integers loses nothing: translating a block by a +multiple of $\operatorname{lcm}(A)$ does not change which of its elements each $a \in A$ divides. +`Works` above is the same condition with an integer multiplier. -/ +def IsAdmissible (n : ℕ) (c : ℝ) : Prop := + ∀ A : Finset ℕ, A.card = n → (∀ a ∈ A, 2 ≤ a) → + ∀ start length : ℕ, c * ((A.sup id : ℕ) : ℝ) ≤ (length : ℝ) → + HasDistinctMultiples A start length + +/-- $f(n)$ is the infimum of the admissible $c$. Since $c\max(A)$ need not be an integer, "an +interval of $c\max(A)$ consecutive integers" is read as "at least $c\max(A)$ consecutive +integers" (a longer interval contains a shorter one). For $n \geq 1$ the set of admissible $c$ +contains $n$ and is bounded below by $0$, so `sInf` is the true infimum. The value $f(0)=0$ is +a junk value and plays no role. -/ +noncomputable def f (n : ℕ) : ℝ := sInf {c : ℝ | IsAdmissible n c} + +/-- The integers $5, 6, 7$ contain no distinct multiples of $2$ and $3$, since $6$ is the only +multiple of each. So three consecutive integers are not enough for $A=\{2,3\}$. -/ +@[category test, AMS 11] +theorem not_hasDistinctMultiples_two_three : ¬ HasDistinctMultiples {2, 3} 4 3 := by + rintro ⟨x, hinj, h⟩ + obtain ⟨h2w, h2d⟩ := h 2 (by simp) + obtain ⟨h3w, h3d⟩ := h 3 (by simp) + simp only [window, Finset.mem_Icc] at h2w h3w + have h23 : x 2 = x 3 := by omega + have := hinj (by simp) (by simp) h23 + omega + +def erdos_709.answer : ℕ → ℝ := sorry + +/-- +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)\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. + +We read "good bounds" as determining the order of magnitude of $f(n)$. +-/ +@[category research open, question value, AMS 11] +theorem erdos_709 : f =Θ[atTop] erdos_709.answer := by + sorry + +/-- +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$. + +This is the lower bound. +-/ +@[category research solved, AMS 11] +theorem erdos_709.variants.ersu_lower : + ∃ c > (0 : ℝ), (fun n : ℕ ↦ Real.log n ^ c) =O[atTop] f := by + sorry + +/-- +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$. + +This is the upper bound. +-/ +@[category research solved, AMS 11] +theorem erdos_709.variants.ersu_upper : + f =O[atTop] fun n : ℕ ↦ (n : ℝ) ^ (1 / 2 : ℝ) := by + sorry + +/-- +The lower bound here can be improved, using van Doorn's lower bound for [711] from [vD26], to +$$\frac{\log n}{\log\log n}\ll f(n).$$ +-/ +@[category research solved, AMS 11] +theorem erdos_709.variants.van_doorn_lower : + (fun n : ℕ ↦ Real.log n / Real.log (Real.log n)) =O[atTop] f := by + sorry + +end Erdos709 diff --git a/FormalConjectures/ErdosProblems/710.lean b/FormalConjectures/ErdosProblems/710.lean new file mode 100644 index 0000000..e655228 --- /dev/null +++ b/FormalConjectures/ErdosProblems/710.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. +-/ +module + +public import FormalConjecturesUtil +public import FormalConjectures.ErdosProblems.«711» + +/-! +# Erdős Problem 710 + +*References:* +- [erdosproblems.com/710](https://www.erdosproblems.com/710) +- [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. 42 (1980), 147-161. + [PDF](https://www.renyi.hu/~p_erdos/1980-13.pdf) +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos710 + +/-- $f(n)$: the least $L$ such that the open interval $(n,n+L)$ contains distinct integers +$a_1,\ldots,a_n$ with $k \mid a_k$ for all $1 \leq k \leq n$. This is +`Erdos711.HasDivisibleDistinctTuple n n L`. + +The set of such $L$ is nonempty for every $n$ (take $a_k = k(n+1)$ and $L = n^2+1$), so `sInf` +is the true minimum. For $n = 0$ there is nothing to choose and $f(0) = 0$. -/ +noncomputable def f (n : ℕ) : ℕ := + sInf {L : ℕ | Erdos711.HasDivisibleDistinctTuple n n L} + +/-- Any admissible interval length is an upper bound for $f(n)$. -/ +@[category API, AMS 11] +theorem f_le {n L : ℕ} (h : Erdos711.HasDivisibleDistinctTuple n n L) : f n ≤ L := + Nat.sInf_le h + +/-- The tuple $a_k = k(n+1)$ shows that the set defining $f(n)$ is nonempty. -/ +@[category API, AMS 11] +theorem hasDivisibleDistinctTuple_sq (n : ℕ) : + Erdos711.HasDivisibleDistinctTuple n n (n ^ 2 + 1) := by + refine ⟨fun i ↦ (i.val + 1) * (n + 1), fun i j hij ↦ ?_, fun i ↦ ⟨?_, ?_, ?_⟩⟩ + · have hij' : (i.val + 1) * (n + 1) = (j.val + 1) * (n + 1) := hij + have := mul_right_cancel₀ (by omega : n + 1 ≠ 0) hij' + exact Fin.ext (by omega) + · show n < (i.val + 1) * (n + 1) + nlinarith [Nat.zero_le (i.val * n)] + · show (i.val + 1) * (n + 1) < n + (n ^ 2 + 1) + have := Nat.mul_le_mul_right (n + 1) (show i.val + 1 ≤ n from i.isLt) + nlinarith + · exact dvd_mul_right _ _ + +/-- The example $11, 22, 21, 16, 15, 12, 14, 24, 18, 20$ of [ErPo80, p. 147] shows $f(10) \leq 15$. +[ErPo80] use the interval $(n, f(n)]$, where this reads $f(10) = 24$. -/ +@[category test, AMS 11] +theorem f_ten_le : f 10 ≤ 15 := + f_le ⟨![11, 22, 21, 16, 15, 12, 14, 24, 18, 20], by decide, by decide⟩ + +def erdos_710.answer : ℕ → ℝ := sorry + +/-- +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\leq k\leq n$. Obtain an asymptotic formula for $f(n)$. +-/ +@[category research open, question value, AMS 11] +theorem erdos_710 : (fun n ↦ (f n : ℝ)) ~[atTop] erdos_710.answer := by + sorry + +/-- +Erdős and Pomerance [ErPo80] proved +$$\left(\frac{2}{\sqrt{e}}+o(1)\right)n\left(\frac{\log n}{\log\log n}\right)^{1/2} +\leq f(n) \leq (1.7398\cdots+o(1))n(\log n)^{1/2}.$$ + +This is the lower bound [ErPo80, Theorem 2]. +-/ +@[category research solved, AMS 11] +theorem erdos_710.variants.lower_bound : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (2 / Real.sqrt (Real.exp 1) - ε) * n * + Real.sqrt (Real.log n / Real.log (Real.log n)) ≤ (f n : ℝ) := by + sorry + +/-- +Erdős and Pomerance [ErPo80] proved +$$\left(\frac{2}{\sqrt{e}}+o(1)\right)n\left(\frac{\log n}{\log\log n}\right)^{1/2} +\leq f(n) \leq (1.7398\cdots+o(1))n(\log n)^{1/2}.$$ + +This is the upper bound. Here $1.7398\cdots = \sqrt{r}/(1-r)$, where $r$ is the solution of +$e^{-r} = r$ [ErPo80, (11), p. 154]. +-/ +@[category research solved, AMS 11] +theorem erdos_710.variants.upper_bound : + ∃ r : ℝ, Real.exp (-r) = r ∧ ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (f n : ℝ) ≤ (Real.sqrt r / (1 - r) + ε) * n * Real.sqrt (Real.log n) := by + sorry + +end Erdos710 diff --git a/FormalConjectures/ErdosProblems/711.lean b/FormalConjectures/ErdosProblems/711.lean new file mode 100644 index 0000000..d0170ec --- /dev/null +++ b/FormalConjectures/ErdosProblems/711.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 711 + +*References:* +- [erdosproblems.com/711](https://www.erdosproblems.com/711) +- [ErPo80] Erdős, P. and Pomerance, C., + *Matching the natural numbers up to $n$ with distinct multiples in another interval* (1980). +- [Er92c] Erdős, P., *Some of my forgotten problems in number theory*. + Hardy-Ramanujan J. (1992), 34–50. +- [vD26] van Doorn, W., + [*On the length of an interval that contains distinct multiples of the first $n$ positive + integers*](https://arxiv.org/abs/2601.16972). Integers 26 (2026), #A7. +-/ + +@[expose] public section + +namespace Erdos711 + +open Filter Asymptotics + +/-- There are distinct $a_1,\ldots,a_n$ in the open interval $(m,m+L)$ such that +$i \mid a_i$ for every $1 \leq i \leq n$. -/ +def HasDivisibleDistinctTuple (n m L : ℕ) : Prop := + ∃ a : Fin n → ℕ, + Function.Injective a ∧ + ∀ i : Fin n, m < a i ∧ a i < m + L ∧ (i.val + 1) ∣ a i + +/-- $L$ is the minimal interval length for the parameters $(n,m)$. -/ +def IsMinimalIntervalLength (n m L : ℕ) : Prop := + HasDivisibleDistinctTuple n m L ∧ + ∀ L', HasDivisibleDistinctTuple n m L' → L ≤ L' + +/-- Let $f(n,m)$ be minimal such that $(m,m+f(n,m))$ contains distinct integers +$a_1,\ldots,a_n$ with $k \mid a_k$ for $1 \leq k \leq n$. Prove that +$\max_m f(n,m) \leq n^{1+o(1)}$. -/ +@[category research open, question, AMS 11] +theorem erdos_711.parts.i : ∃ error : ℕ → ℝ, + error =o[atTop] (fun _ ↦ (1 : ℝ)) ∧ ∀ᶠ n in atTop, ∀ m, ∃ L, + HasDivisibleDistinctTuple n m L ∧ (L : ℝ) ≤ Real.rpow n (1 + error n) := by + sorry + +/-- Prove that $\max_m (f(n,m)-f(n,n)) \to \infty$. + +This was proved by van Doorn [vD26], who obtained the stronger lower bound +$f(n,m)-f(n,n) \gg n\log n/\log\log n$ for a suitable $m=m(n)$ and all large $n$. -/ +@[category research solved, question, AMS 11] +theorem erdos_711.parts.ii : ∀ B : ℕ, ∀ᶠ n in atTop, + ∃ m Lm Ln : ℕ, IsMinimalIntervalLength n m Lm ∧ + IsMinimalIntervalLength n n Ln ∧ B ≤ Lm - Ln := by + sorry + +-- TODO: Formalize the Erdős–Pomerance bounds and van Doorn's stronger quantitative theorem. + +end Erdos711 diff --git a/FormalConjectures/ErdosProblems/712.lean b/FormalConjectures/ErdosProblems/712.lean new file mode 100644 index 0000000..ec1d622 --- /dev/null +++ b/FormalConjectures/ErdosProblems/712.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 712 + +*References:* +- [erdosproblems.com/712](https://www.erdosproblems.com/712) +- [Er81] Erdős, P., On the combinatorial problems which I would most like to see solved. + Combinatorica (1981), 25-42. +-/ + +@[expose] public section + +namespace Erdos712 + +open Filter Asymptotics +open scoped Topology + +def erdos_712.answer : ℕ → ℕ → ℝ := sorry + +/-- +Determine, for any $k>r>2$, the limiting value as $n\to\infty$ of +$$\frac{\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 placed on $n$ vertices +so that there exists no set of $k$ vertices which is covered by all $\binom{k}{r}$ possible +$r$-edges. +-/ +@[category research open, question value, AMS 5] +theorem erdos_712 : + ∀ k r : ℕ, 2 < r → r < k → + Tendsto (fun n ↦ (Hypergraph.cliqueExtremalNumber n r k : ℝ) / n.choose r) + atTop (𝓝 (erdos_712.answer k r)) := by + sorry + + +/-- The normalized extremal numbers have a limit in $[0,1]$. This existence result does +not determine the value asked for in Erdős Problem 712. -/ +@[category textbook, AMS 5] +theorem erdos_712.variants.limit_exists (r k : ℕ) : + ∃ π ∈ Set.Icc (0 : ℝ) 1, + Tendsto (fun n : ℕ ↦ (Hypergraph.cliqueExtremalNumber n r k : ℝ) / n.choose r) + atTop (𝓝 π) := by + sorry + +/-- Turán's theorem gives the graph case: +$\mathrm{ex}_2(n,K_k)/\binom{n}{2}\to 1-1/(k-1)$. -/ +@[category research solved, AMS 5] +theorem erdos_712.variants.graph_case (k : ℕ) (hk : 2 ≤ k) : + Tendsto (fun n : ℕ ↦ (Hypergraph.cliqueExtremalNumber n 2 k : ℝ) / n.choose 2) + atTop (𝓝 (1 - 1 / ((k : ℝ) - 1))) := by + sorry + +/-- With denominator $n^2$, Turán's graph limit is +$\frac12(1-1/(k-1))$. The factor $\frac12$ comes from the normalization. -/ +@[category research solved, AMS 5] +theorem erdos_712.variants.graph_case_div_sq (k : ℕ) (hk : 2 ≤ k) : + Tendsto (fun n : ℕ ↦ (Hypergraph.cliqueExtremalNumber n 2 k : ℝ) / (n : ℝ) ^ 2) + atTop (𝓝 ((1 / 2) * (1 - 1 / ((k : ℝ) - 1)))) := by + sorry + +end Erdos712 diff --git a/FormalConjectures/ErdosProblems/713.lean b/FormalConjectures/ErdosProblems/713.lean new file mode 100644 index 0000000..58409e5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/713.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 713 + +*References:* +- [erdosproblems.com/713](https://www.erdosproblems.com/713) +- [Er67d] Erdős, P., *Some recent results on extremal problems in graph theory. {R}esults*. (1967), + 117--123 (English); pp. 124--130 (French). +- [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, Zoltán and Gerbner, Dániel, *Hypergraphs without exponents*. J. Combin. Theory + Ser. A (2021), Paper No. 105517, 9. +-/ + +@[expose] public section + +open Filter SimpleGraph + +namespace Erdos713 + +open scoped Classical in +/-- +Is it true that, for every bipartite graph $G$, there exists some $\alpha\in [1,2)$ and $c>0$ such that $$\mathrm{ex}(n;G)\sim cn^\alpha?$$ + +The condition that $G$ have at least two edges excludes degenerate forbidden graphs whose +extremal number is eventually zero, for which the displayed asymptotic with $c>0$ is impossible. +-/ +@[category research open, question, AMS 5] +theorem erdos_713.parts.i : + ∀ (q : ℕ) (G : SimpleGraph (Fin q)), G.IsBipartite → 2 ≤ G.edgeFinset.card → + ∃ α c : ℝ, α ∈ Set.Ico 1 2 ∧ 0 < c ∧ + Asymptotics.IsEquivalent atTop + (fun n : ℕ => (extremalNumber n G : ℝ)) + (fun n : ℕ => c * (n : ℝ) ^ α) := by + sorry + +open scoped Classical in +/-- +Must $\alpha$ be rational? + +The same nondegeneracy condition on $G$ is used as in part (i). Rationality means that the real +number $\alpha$ lies in the image of the canonical embedding $\mathbb{Q}\to\mathbb{R}$. +-/ +@[category research open, question, AMS 5] +theorem erdos_713.parts.ii : + ∀ (q : ℕ) (G : SimpleGraph (Fin q)), G.IsBipartite → 2 ≤ G.edgeFinset.card → + ∀ α c : ℝ, α ∈ Set.Ico 1 2 → 0 < c → + Asymptotics.IsEquivalent atTop + (fun n : ℕ => (extremalNumber n G : ℝ)) + (fun n : ℕ => c * (n : ℝ) ^ α) → + α ∈ Set.range ((↑) : ℚ → ℝ) := by + sorry + +end Erdos713 diff --git a/FormalConjectures/ErdosProblems/714.lean b/FormalConjectures/ErdosProblems/714.lean new file mode 100644 index 0000000..dda5559 --- /dev/null +++ b/FormalConjectures/ErdosProblems/714.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 714 + +*References:* +- [erdosproblems.com/714](https://www.erdosproblems.com/714) +- [Br66] Brown, W. G., *On graphs that do not contain a Thomsen graph*. Canad. Math. Bull. (1966), + 281-285. +- [ERS66] Erdős, P. and Rényi, A. and Sós, V. T., *On a problem of graph theory*. Studia Sci. Math. + Hungar. (1966), 215--235. +- [KST54] Kövari, T. and Sós, V. T. and Turán, P., *On a problem of K. Zarankiewicz*. Colloq. Math. + (1954), 50-57. +-/ + +@[expose] public section + +open Filter SimpleGraph + +namespace Erdos714 + +/-- +Is it true that $$\mathrm{ex}(n; K_{r,r}) \gg n^{2-1/r}?$$ +-/ +@[category research open, question, AMS 5] +theorem erdos_714 : + ∀ r : ℕ, 2 ≤ r → ∃ c : ℝ, 0 < c ∧ ∀ᶠ n : ℕ in atTop, + c * (n : ℝ) ^ ((2 : ℝ) - 1 / (r : ℝ)) ≤ + (extremalNumber n (completeBipartiteGraph (Fin r) (Fin r)) : ℝ) := by + sorry + +end Erdos714 diff --git a/FormalConjectures/ErdosProblems/719.lean b/FormalConjectures/ErdosProblems/719.lean new file mode 100644 index 0000000..11bb4ad --- /dev/null +++ b/FormalConjectures/ErdosProblems/719.lean @@ -0,0 +1,48 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 719 + +*References:* +- [erdosproblems.com/719](https://www.erdosproblems.com/719) +-/ + +@[expose] public section + +namespace Erdos719 + +open Filter Asymptotics + +/-- +Let $r\geq 2$, and let $\mathrm{ex}_r(n;K_{r+1}^r)$ be the maximum number of $r$-edges that can +be placed on $n$ vertices without forming a $K_{r+1}^r$ (the $r$-uniform complete graph on +$r+1$ vertices). Is every +$r$-hypergraph $G$ on $n$ vertices the union of at most $\mathrm{ex}_{r}(n;K_{r+1}^r)$ many copies +of $K_r^r$ and $K_{r+1}^r$, no two of which share a $K_r^r$? +-/ +@[category research open, question, AMS 5] +theorem erdos_719 : + ∀ r : ℕ, 2 ≤ r → ∀ (n : ℕ) (H : Finset (Finset (Fin n))), + H.IsUniform r → ∃ D : Finset (Finset (Fin n)), + H.IsCompleteHypergraphDecomposition r D ∧ + D.card ≤ Hypergraph.cliqueExtremalNumber n r (r + 1) := by + sorry + +end Erdos719 diff --git a/FormalConjectures/ErdosProblems/725.lean b/FormalConjectures/ErdosProblems/725.lean new file mode 100644 index 0000000..d3e08f1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/725.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 725 + +*References:* +- [erdosproblems.com/725](https://www.erdosproblems.com/725) +- [Er81] Erdős, P., *On the combinatorial problems which I would most like to see solved*. + Combinatorica 1 (1981), 25-42. [PDF](https://www.renyi.hu/~p_erdos/1981-16.pdf) +- [ErKa46] Erdős, P. and Kaplansky, I., *The asymptotic number of Latin rectangles*. + Amer. J. Math. 68 (1946), 230-236. [PDF](https://www.renyi.hu/~p_erdos/1946-12.pdf) +- [Ya51] Yamamoto, K., *On the asymptotic number of Latin rectangles*. + Jpn. J. Math. 21 (1951), 113-119. +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos725 + +/-- `M` is a $k\times n$ Latin rectangle: `M i j` is the entry in row `i` and column `j`, the +entries are in `Fin n` (standing for $\{1,\dots,n\}$), every row is a permutation of the +entries, and no entry is repeated in a column. -/ +abbrev IsLatinRectangle {k n : ℕ} (M : Fin k → Fin n → Fin n) : Prop := + (∀ i, Function.Injective (M i)) ∧ ∀ j, Function.Injective fun i ↦ M i j + +/-- $L(k,n)$ is the number of $k\times n$ Latin rectangles. Rows, columns and entries are +labelled and the rows are ordered. It is $0$ for $k>n\geq 1$ and $1$ for $k=0$. -/ +noncomputable def L (k n : ℕ) : ℕ := + Nat.card {M : Fin k → Fin n → Fin n // IsLatinRectangle M} + +/-- There are $n!$ Latin rectangles with one row. -/ +@[category test, AMS 5] +theorem L_one (n : ℕ) : L 1 n = n.factorial := by + have e : {M : Fin 1 → Fin n → Fin n // IsLatinRectangle M} ≃ Equiv.Perm (Fin n) := + { toFun := fun M ↦ Equiv.ofBijective (M.1 0) (Finite.injective_iff_bijective.1 (M.2.1 0)) + invFun := fun σ ↦ ⟨fun _ ↦ σ, fun _ ↦ σ.injective, fun _ a b _ ↦ Subsingleton.elim a b⟩ + left_inv := fun M ↦ by + refine Subtype.ext (funext fun i ↦ ?_) + have hi : i = 0 := Subsingleton.elim i 0 + subst hi + rfl + right_inv := fun σ ↦ Equiv.ext fun _ ↦ rfl } + unfold L + rw [Nat.card_congr e, Nat.card_perm, Nat.card_eq_fintype_card, Fintype.card_fin] + +def erdos_725.answer : ℕ → ℕ → ℝ := sorry + +/-- +Give an asymptotic formula for the number of $k\times n$ Latin rectangles. + +The formula $F(k,n)$ must satisfy $L(k,n)\sim F(k,n)$ as $n\to\infty$ for every choice of +$k=k(n)\leq n$, so it also covers Latin squares ($k=n$). +-/ +@[category research open, question value, AMS 5] +theorem erdos_725 (k : ℕ → ℕ) (hk : ∀ n, k n ≤ n) : + (fun n ↦ (L (k n) n : ℝ)) ~[atTop] fun n ↦ erdos_725.answer (k n) n := by + sorry + +/-- +Erdős and Kaplansky [ErKa46] proved the count is +$$\sim e^{-\binom{k}{2}}(n!)^k$$ +when $k=o((\log n)^{3/2-\epsilon})$. + +Here $\epsilon>0$ is fixed. +-/ +@[category research solved, AMS 5] +theorem erdos_725.variants.erdos_kaplansky (ε : ℝ) (hε : 0 < ε) (k : ℕ → ℕ) + (hk : (fun n ↦ (k n : ℝ)) =o[atTop] fun n ↦ Real.log n ^ (3 / 2 - ε)) : + (fun n ↦ (L (k n) n : ℝ)) ~[atTop] + fun n ↦ Real.exp (-((k n).choose 2 : ℝ)) * (n.factorial : ℝ) ^ k n := by + sorry + +/-- +Yamamoto [Ya51] extended this to $k\leq n^{1/3-o(1)}$. + +As in [Ya51, p. 113], we assume $k ?_) + obtain ⟨hm0, hm⟩ := hm + rw [hc] at hm + by_contra! hlt + interval_cases m <;> simp at hm + +def erdos_731.answer : ℕ → ℝ := sorry + +/-- +Find some reasonable function $f(n)$ such that, for almost all integers $n$, the least integer +$m$ such that $m\nmid \binom{2n}{n}$ satisfies +$$m\sim f(n).$$ + +Here "almost all" means natural density $1$, and $m \sim f(n)$ means that for every +$\varepsilon>0$ the set of $n$ with $|m/f(n)-1|<\varepsilon$ has density $1$. +-/ +@[category research open, question value, AMS 11] +theorem erdos_731 : ∀ ε > (0 : ℝ), + {n : ℕ | |(leastNonDivisor n : ℝ) / erdos_731.answer n - 1| < ε}.HasDensity 1 := by + sorry + +/-- +A problem of Erdős, Graham, Ruzsa, and Straus [EGRS75], who say it is 'not hard to show that', +for almost all $n$, the minimal such $m$ satisfies +$$m=\exp((\log n)^{1/2+o(1)}).$$ + +[EGRS75, (8), p. 91] states this as: for every $\varepsilon>0$, for all $n$ outside a set of +density $0$, $\exp((\log n)^{1/2-\varepsilon}) < m < \exp((\log n)^{1/2+\varepsilon})$. +-/ +@[category research solved, AMS 11] +theorem erdos_731.variants.egrs75 : ∀ ε > (0 : ℝ), + {n : ℕ | Real.exp (Real.log n ^ ((1 : ℝ) / 2 - ε)) < (leastNonDivisor n : ℝ) ∧ + (leastNonDivisor n : ℝ) < Real.exp (Real.log n ^ ((1 : ℝ) / 2 + ε))}.HasDensity 1 := by + sorry + +end Erdos731 diff --git a/FormalConjectures/ErdosProblems/732.lean b/FormalConjectures/ErdosProblems/732.lean new file mode 100644 index 0000000..45a2798 --- /dev/null +++ b/FormalConjectures/ErdosProblems/732.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 732 + +*References:* +- [erdosproblems.com/732](https://www.erdosproblems.com/732) +-/ + +@[expose] public section + +namespace Erdos732 + +open Filter Asymptotics + +def erdos_732.parts.i.answer : ℕ → List ℕ → Prop := sorry + +/-- +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 $\lvert A_i\rvert=X_i$ for $1\leq +i\leq m$. (A pairwise block design means that every pair in $\{1,\ldots,n\}$ is contained in exactly +one of the $A_i$.) Are there necessary and sufficient conditions for $(X_i)$ to be block-compatible? +Is there some constant $c>0$ such that for all large $n$ there are +$$\geq \exp(c n^{1/2}\log n)$$ +many block-compatible sequences for $\{1,\ldots,n\}$? +-/ +@[category research open, question value, AMS 5] +theorem erdos_732.parts.i : + ∀ (n : ℕ) (s : List ℕ), s ∈ Hypergraph.blockSizeProfiles n ↔ erdos_732.parts.i.answer n s := by + sorry + +/-- +Is there some constant $c>0$ such that for all large $n$ there are at least +$\exp(c n^{1/2}\log n)$ block-compatible sequences? + +Alon has proved there are at least $2^{(\frac{1}{2}+o(1))n^{1/2}\log n}$ many sequences +which are block-compatible for $n$. +-/ +@[category research solved, question, AMS 5] +theorem erdos_732.parts.ii : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ n : ℕ in atTop, + Real.exp (c * Real.sqrt n * Real.log n) ≤ (Hypergraph.blockSizeProfiles n).card := by + sorry + +end Erdos732 diff --git a/FormalConjectures/ErdosProblems/734.lean b/FormalConjectures/ErdosProblems/734.lean new file mode 100644 index 0000000..b0e1e63 --- /dev/null +++ b/FormalConjectures/ErdosProblems/734.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 734 + +*References:* +- [erdosproblems.com/734](https://www.erdosproblems.com/734) +- [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 = Indagationes Math. 10, 421--423. +-/ + +@[expose] public section + +namespace Erdos734 + +open Filter Asymptotics + +/-- +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 $\lvert +A_i\rvert=t$. +-/ +@[category research open, AMS 5] +theorem erdos_734 : + ∃ C : ℝ, 0 < C ∧ ∀ᶠ n : ℕ in atTop, + ∃ H : Finset (Finset (Fin n)), H.IsPairwiseBalancedDesign ∧ + (∀ e ∈ H, e.card < n) ∧ ∀ t : ℕ, + ({e ∈ H | e.card = t}.card : ℝ) ≤ C * Real.sqrt n := by + sorry + +end Erdos734 diff --git a/FormalConjectures/ErdosProblems/74.lean b/FormalConjectures/ErdosProblems/74.lean index 0ad9ad1..4961f5f 100644 --- a/FormalConjectures/ErdosProblems/74.lean +++ b/FormalConjectures/ErdosProblems/74.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 74 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/74](https://www.erdosproblems.com/74) -/ +@[expose] public section + open Filter SimpleGraph open scoped Topology Real @@ -119,9 +122,13 @@ noncomputable def SimpleGraph.maxSubgraphEdgeDistToBipartite Let $f(n)\to \infty$ possibly very slowly. Is there a graph of infinite chromatic number such that every finite subgraph on $n$ vertices can be made bipartite by deleting at most $f(n)$ edges? + +The answer is no. A machine-checked disproof constructs a function $f(n) \to \infty$ for which +every graph satisfying this local deletion bound has finite chromatic number. -/ -@[category research open, AMS 5] -theorem erdos_74 : answer(sorry) ↔ ∀ f : ℕ → ℕ, Tendsto f atTop atTop → +@[category research solved, question, AMS 5, formal_proof using lean4 at + "https://github.com/tadamcz/erdos74/blob/e127ee587c7c91267eecdb3569443d2b0ad64b52/Erdos74/Resolutions/Erdos74_118usd_22h.lean#L2511"] +theorem erdos_74 : ¬ ∀ f : ℕ → ℕ, Tendsto f atTop atTop → (∃ (V : Type u) (G : SimpleGraph V), G.chromaticNumber = ⊤ ∧ ∀ n, G.maxSubgraphEdgeDistToBipartite n ≤ f n) := by sorry @@ -130,8 +137,8 @@ theorem erdos_74 : answer(sorry) ↔ ∀ f : ℕ → ℕ, Tendsto f atTop atTop Is there a graph of infinite chromatic number such that every finite subgraph on $n$ vertices can be made bipartite by deleting at most $\sqrt{n}$ edges? -/ -@[category research open, AMS 5] -theorem erdos_74.variants.sqrt : answer(sorry) ↔ +@[category research open, question, AMS 5] +theorem erdos_74.variants.sqrt : ∃ (V : Type u) (G : SimpleGraph V), G.chromaticNumber = ⊤ ∧ ∀ n, G.maxSubgraphEdgeDistToBipartite n ≤ (n : ℝ).sqrt := by sorry diff --git a/FormalConjectures/ErdosProblems/740.lean b/FormalConjectures/ErdosProblems/740.lean index 6b00e96..a925ac0 100644 --- a/FormalConjectures/ErdosProblems/740.lean +++ b/FormalConjectures/ErdosProblems/740.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 740: Infinitary version of chromatic number and odd cycles @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/740](https://erdosproblems.com/740) -/ +@[expose] public section + open scoped Cardinal namespace Erdos740 @@ -35,14 +38,13 @@ Let $\mathfrak{m}$ be an infinite cardinal and $G$ be a graph with chromatic num 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$? -/ -@[category research open, AMS 5] +@[category research open, question, AMS 5] theorem erdos_740 : - answer(sorry) ↔ - ∀ (V : Type*) (G : SimpleGraph V), - ℵ₀ ≤ G.chromaticCardinal → - ∀ (r : ℕ), - ∃ (H : G.Subgraph), H.coe.chromaticCardinal = G.chromaticCardinal ∧ - NoShortOddCycle H.coe r := by + ∀ (V : Type*) (G : SimpleGraph V), + ℵ₀ ≤ G.chromaticCardinal → + ∀ (r : ℕ), + ∃ (H : G.Subgraph), H.coe.chromaticCardinal = G.chromaticCardinal ∧ + NoShortOddCycle H.coe r := by sorry -- TODO: add the related infinitary chromatic-number statements from erdosproblems.com. diff --git a/FormalConjectures/ErdosProblems/741.lean b/FormalConjectures/ErdosProblems/741.lean index 465028a..e676a7e 100644 --- a/FormalConjectures/ErdosProblems/741.lean +++ b/FormalConjectures/ErdosProblems/741.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 741 @@ -25,6 +26,8 @@ import FormalConjecturesUtil Math. Pannon. (1994), 261-269. -/ +@[expose] public section + open scoped Pointwise open Set @@ -37,9 +40,9 @@ both have positive upper density? This was proved by the DeepMind prover agent. -/ -@[category research solved, AMS 5, formal_proof using formal_conjectures at +@[category research solved, question, AMS 5, formal_proof using formal_conjectures at "https://github.com/google-deepmind/formal-conjectures/blob/9d492049e42167b0d2fd58a9e91da3bf160172b5/FormalConjectures/ErdosProblems/741.lean#L228"] -theorem erdos_741.parts.i : answer(True) ↔ ∀ A : Set ℕ, 0 < upperDensity (A + A) → ∃ A₁ A₂, +theorem erdos_741.parts.i : ∀ A : Set ℕ, 0 < upperDensity (A + A) → ∃ A₁ A₂, A = A₁ ∪ A₂ ∧ Disjoint A₁ A₂ ∧ 0 < upperDensity (A₁ + A₁) ∧ 0 < upperDensity (A₂ + A₂) := by sorry @@ -49,8 +52,8 @@ Let $A\subseteq \mathbb{N}$ be such that $A+A$ has positive lower density. Can one always decompose $A=A_1\sqcup A_2$ such that $A_1+A_1$ and $A_2+A_2$ both have positive lower density? -/ -@[category research open, AMS 5] -theorem erdos_741.variants.lower : answer(sorry) ↔ ∀ A : Set ℕ, 0 < lowerDensity (A + A) → ∃ A₁ A₂, +@[category research open, question, AMS 5] +theorem erdos_741.variants.lower : ∀ A : Set ℕ, 0 < lowerDensity (A + A) → ∃ A₁ A₂, A = A₁ ∪ A₂ ∧ Disjoint A₁ A₂ ∧ 0 < lowerDensity (A₁ + A₁) ∧ 0 < lowerDensity (A₂ + A₂) := by sorry @@ -63,10 +66,10 @@ both have positive density in this sense? This was disproved by the DeepMind prover agent. -/ -@[category research solved, AMS 5, +@[category research solved, question, AMS 5, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/486bc8afae062b6711cd16d3466d651ee2880a52/FormalConjectures/ErdosProblems/741.lean#L1449"] -theorem erdos_741.variants.exact_density : answer(False) ↔ - ∀ A : Set ℕ, HasPosDensity (A + A) → ∃ A₁ A₂, +theorem erdos_741.variants.exact_density : + ¬ ∀ A : Set ℕ, HasPosDensity (A + A) → ∃ A₁ A₂, A = A₁ ∪ A₂ ∧ Disjoint A₁ A₂ ∧ HasPosDensity (A₁ + A₁) ∧ HasPosDensity (A₂ + A₂) := by sorry @@ -77,9 +80,9 @@ cannot both have bounded gaps? This was proved by DeepMind prover agent. -/ -@[category research solved, AMS 5, +@[category research solved, question, AMS 5, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/486bc8afae062b6711cd16d3466d651ee2880a52/FormalConjectures/ErdosProblems/741.lean#L1629"] -theorem erdos_741.parts.ii : answer(True) ↔ ∃ A : Set ℕ, IsAddBasisOfOrder (A ∪ {0}) 2 ∧ ∀ A₁ A₂, +theorem erdos_741.parts.ii : ∃ A : Set ℕ, IsAddBasisOfOrder (A ∪ {0}) 2 ∧ ∀ A₁ A₂, A = A₁ ∪ A₂ → Disjoint A₁ A₂ → ¬ (IsSyndetic (A₁ + A₁) ∧ IsSyndetic (A₂ + A₂)) := by sorry diff --git a/FormalConjectures/ErdosProblems/742.lean b/FormalConjectures/ErdosProblems/742.lean index f8c73ea..941f63a 100644 --- a/FormalConjectures/ErdosProblems/742.lean +++ b/FormalConjectures/ErdosProblems/742.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 742 @@ -30,6 +31,8 @@ import FormalConjecturesUtil J. Graph Theory 16 (1992), 81-98. -/ +@[expose] public section + open SimpleGraph namespace Erdos742 @@ -51,9 +54,9 @@ to hold for the complete balanced bipartite graph $K_{\lceil n/2 \rceil, \lfloor The conjecture is resolved up to a finite check: Fan [Fa87] verified it for $n \leq 24$ and $n = 26$, and Füredi [Fü92] proved it for all sufficiently large $n$. -/ -@[category research open, AMS 5] +@[category research open, question, AMS 5] theorem erdos_742 : - answer(sorry) ↔ ∀ (V : Type*) [Fintype V] [DecidableEq V] + ∀ (V : Type*) [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj], IsDiameter2Critical G → G.edgeFinset.card ≤ (Fintype.card V) ^ 2 / 4 := by sorry @@ -115,7 +118,8 @@ Füredi [Fü92] proved the Murty-Simon conjecture for all sufficiently large $n$ exists $n_0$ such that every diameter-$2$-critical graph on $n \geq n_0$ vertices has at most $\lfloor n^2 / 4 \rfloor$ edges. -/ -@[category research solved, AMS 5] +@[category research solved, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos742.lean#L4279"] theorem furedi_bound : ∃ n₀ : ℕ, ∀ (V : Type*) [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj], n₀ ≤ Fintype.card V → IsDiameter2Critical G → diff --git a/FormalConjectures/ErdosProblems/743.lean b/FormalConjectures/ErdosProblems/743.lean new file mode 100644 index 0000000..f0790e2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/743.lean @@ -0,0 +1,203 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 743 + +*References:* +- [erdosproblems.com/743](https://www.erdosproblems.com/743) +- [ABCHPT21] Allen, Peter and Böttcher, Julia and Clemens, Dennis and Hladký, Jan and Piguet, + Diana and Taraz, Anusch, *The tree packing conjecture for trees of almost linear maximum + degree*. arXiv:2106.11720 (2021). +- [Bo83] Bollobás, Béla, *Some remarks on packing trees*. Discrete Math. (1983), 203-204. +- [Er81] Erdős, P., *On the combinatorial problems which I would most like to see solved*. + Combinatorica (1981), 25-42. +- [Fi83] Fishburn, P. C., *Balanced integer arrays: a matrix packing theorem*. J. Combin. Theory + Ser. A (1983), 98-101. +- [Fi83b] Fishburn, P. C., *Packing graphs with odd and even trees*. J. Graph Theory (1983), + 369-383. +- [GyLe78] Gyárfás, A. and Lehel, J., *Packing trees of different order into $K_n$*. + Combinatorics (Proc. Fifth Hungarian Colloq., Keszthely, 1976), Colloq. Math. Soc. János Bolyai + 18 (1978), 463-469. +- [JKKO19] Joos, Felix and Kim, Jaehoon and Kühn, Daniela and Osthus, Deryk, *Optimal packings + of bounded degree trees*. J. Eur. Math. Soc. (JEMS) (2019), 3573-3647. +- [JaMo24] Janzer, Barnabás and Montgomery, Richard, *Packing the largest trees in the tree + packing conjecture*. arXiv:2403.10515 (2024). +-/ + +@[expose] public section + +open Filter SimpleGraph + +namespace Erdos743 + +/-- `IsPacking n S T` says that the graphs `T k`, for `k ∈ S`, pack into the complete graph +$K_n$ on `Fin n`. + +That is, for each $k \in S$ there is an injective map $f_k : \{0, \ldots, k - 1\} \to +\{0, \ldots, n - 1\}$, such that the graphs `(T k).map (f k)` have pairwise disjoint edge sets. +Every graph on `Fin n` is a subgraph of $K_n$, so this says that $K_n$ contains pairwise +edge-disjoint copies of the graphs `T k`. -/ +def IsPacking (n : ℕ) (S : Set ℕ) (T : (k : ℕ) → SimpleGraph (Fin k)) : Prop := + ∃ f : (k : S) → Fin k → Fin n, (∀ k : S, Function.Injective (f k)) ∧ + ∀ k l : S, (k : ℕ) < (l : ℕ) → + Disjoint ((T k).map (f k)).edgeSet ((T l).map (f l)).edgeSet + +/-- A packing of the graphs indexed by `S` gives a packing of those indexed by a subset `S'`. -/ +@[category API, AMS 5] +theorem IsPacking.mono {n : ℕ} {S S' : Set ℕ} {T : (k : ℕ) → SimpleGraph (Fin k)} + (h : IsPacking n S T) (hS : S' ⊆ S) : IsPacking n S' T := by + obtain ⟨f, hinj, hdisj⟩ := h + exact ⟨fun k => f ⟨k, hS k.2⟩, fun k => hinj ⟨k, hS k.2⟩, + fun k l hkl => hdisj ⟨k, hS k.2⟩ ⟨l, hS l.2⟩ hkl⟩ + +/-- The numbers of edges $k - 1$ of trees on $k$ vertices, for $2 \leq k \leq n$, add up to the +number $\binom{n}{2}$ of edges of $K_n$. -/ +@[category test, AMS 5] +theorem sum_Icc_two_sub_one (n : ℕ) : ∑ k ∈ Finset.Icc 2 n, (k - 1) = n.choose 2 := by + induction n with + | zero => simp + | succ n ih => + rcases Nat.lt_or_ge n 1 with h | h + · interval_cases n + simp + · rw [Finset.sum_Icc_succ_top (by omega), ih, + show (n + 1).choose 2 = n.choose 1 + n.choose 2 from Nat.choose_succ_succ n 1, + Nat.choose_one_right] + omega + +/-- +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. We state it as a packing. For +every $n$ and all trees $T_k$ on the vertex set `Fin k`, $2 \leq k \leq n$, there are injective +maps +$f_k : \{0, \ldots, k - 1\} \to \{0, \ldots, n - 1\}$ such that the graphs $f_k(T_k)$ are +pairwise edge-disjoint (see `IsPacking`). Every tree with $k$ vertices is isomorphic to a tree +on `Fin k`, so this covers every collection of trees. + +A tree with $k$ vertices has $k - 1$ edges, and $\sum_{k=2}^{n} (k - 1) = \binom{n}{2}$ is the +number of edges of $K_n$. Hence the copies $f_k(T_k)$ of a packing cover every edge of $K_n$. +So a packing is the same as a decomposition of $K_n$ into copies of $T_2, \ldots, T_n$. +-/ +@[category research open, question, AMS 5] +theorem erdos_743 : + ∀ n : ℕ, ∀ T : (k : ℕ) → SimpleGraph (Fin k), + (∀ k ∈ Set.Icc 2 n, (T k).IsTree) → IsPacking n (Set.Icc 2 n) T := by + sorry + +/-- +Gyárfás and Lehel [GyLe78] proved that this holds if all but at most $2$ of the trees are stars, +or if all the trees are stars or paths. This variant is the second case: each tree is a star or a +path. + +Here a star on `Fin k` is `starGraph c` for a centre `c`, and a path is a graph isomorphic to +`pathGraph k`. +-/ +@[category research solved, AMS 5] +theorem erdos_743.variants.stars_or_paths (n : ℕ) (T : (k : ℕ) → SimpleGraph (Fin k)) + (hT : ∀ k ∈ Set.Icc 2 n, (T k).IsTree ∧ + ((∃ c : Fin k, T k = starGraph c) ∨ Nonempty (T k ≃g pathGraph k))) : + IsPacking n (Set.Icc 2 n) T := by + sorry + +/-- +Gyárfás and Lehel [GyLe78] proved that this holds if all but at most $2$ of the trees are stars, +or if all the trees are stars or paths. This variant is the first case. + +Here a star on `Fin k` is `starGraph c` for a centre `c`. The two trees that may fail to be +stars are $T_a$ and $T_b$. +-/ +@[category research solved, AMS 5] +theorem erdos_743.variants.all_but_two_stars (n : ℕ) (T : (k : ℕ) → SimpleGraph (Fin k)) + (hT : ∀ k ∈ Set.Icc 2 n, (T k).IsTree) + (hstar : ∃ a b : ℕ, ∀ k ∈ Set.Icc 2 n, k ≠ a → k ≠ b → ∃ c : Fin k, T k = starGraph c) : + IsPacking n (Set.Icc 2 n) T := by + sorry + +/-- +Fishburn [Fi83b] proved this for $n\leq 9$. +-/ +@[category research solved, AMS 5] +theorem erdos_743.variants.fishburn (n : ℕ) (hn : n ≤ 9) (T : (k : ℕ) → SimpleGraph (Fin k)) + (hT : ∀ k ∈ Set.Icc 2 n, (T k).IsTree) : + IsPacking n (Set.Icc 2 n) T := by + sorry + +/-- +Bollobás [Bo83] proved that the smallest $\lfloor n/\sqrt{2}\rfloor$ many trees can always be +packed greedily into $K_n$. + +The smallest trees are $T_1, \ldots, T_m$ with $m = \lfloor n/\sqrt{2} \rfloor$. The tree $T_1$ is +a single vertex, so we only pack $T_2, \ldots, T_m$. +-/ +@[category research solved, AMS 5] +theorem erdos_743.variants.bollobas (n : ℕ) (T : (k : ℕ) → SimpleGraph (Fin k)) + (hT : ∀ k ∈ Set.Icc 2 ⌊(n : ℝ) / Real.sqrt 2⌋₊, (T k).IsTree) : + IsPacking n (Set.Icc 2 ⌊(n : ℝ) / Real.sqrt 2⌋₊) T := by + sorry + +open scoped Classical in +/-- +Joos, Kim, Kühn, and Osthus [JKKO19] proved that this conjecture holds when the trees have +bounded maximum degree. That is, for every $d$ there is $N$ such that for all $n \geq N$ the +following holds. If $T_k$ is a tree with $k$ vertices and maximum degree at most $d$ for +$2 \leq k \leq n$, then $K_n$ decomposes into $T_2, \ldots, T_n$. + +They even allow the first $o(n)$ trees to have arbitrary maximum degree. +-/ +@[category research solved, AMS 5] +theorem erdos_743.variants.bounded_degree (d : ℕ) : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → ∀ T : (k : ℕ) → SimpleGraph (Fin k), + (∀ k ∈ Set.Icc 2 n, (T k).IsTree ∧ (T k).maxDegree ≤ d) → + IsPacking n (Set.Icc 2 n) T := by + sorry + +open scoped Classical in +/-- +Allen, Böttcher, Clemens, Hladký, Piguet, and Taraz [ABCHPT21] proved that this conjecture holds +when all the trees have maximum degree $\leq c\frac{n}{\log n}$ for some constant $c>0$. That is, +there is $c > 0$ such that for all sufficiently large $n$ the following holds. If $T_k$ is a tree +with $k$ vertices and maximum degree at most $cn/\log n$ for $2 \leq k \leq n$, then $K_n$ +decomposes into $T_2, \ldots, T_n$. +-/ +@[category research solved, AMS 5] +theorem erdos_743.variants.almost_linear_degree : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ n : ℕ in atTop, ∀ T : (k : ℕ) → SimpleGraph (Fin k), + (∀ k ∈ Set.Icc 2 n, + (T k).IsTree ∧ ((T k).maxDegree : ℝ) ≤ c * (n : ℝ) / Real.log (n : ℝ)) → + IsPacking n (Set.Icc 2 n) T := by + sorry + +/-- +Janzer and Montgomery [JaMo24] have proved that there exists some $c>0$ such that the largest $cn$ +trees can be packed into $K_n$. + +We state this for all sufficiently large $n$. The trees are $T_k$ with $n - cn < k \leq n$, and +we also require $2 \leq k$. +-/ +@[category research solved, AMS 5] +theorem erdos_743.variants.largest_trees : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ n : ℕ in atTop, ∀ T : (k : ℕ) → SimpleGraph (Fin k), + (∀ k : ℕ, 2 ≤ k → k ≤ n → (n : ℝ) - c * n < k → (T k).IsTree) → + IsPacking n {k : ℕ | 2 ≤ k ∧ k ≤ n ∧ (n : ℝ) - c * n < k} T := by + sorry + +end Erdos743 diff --git a/FormalConjectures/ErdosProblems/75.lean b/FormalConjectures/ErdosProblems/75.lean index 8a7e0c5..d46fdea 100644 --- a/FormalConjectures/ErdosProblems/75.lean +++ b/FormalConjectures/ErdosProblems/75.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 75 @@ -23,6 +24,8 @@ import FormalConjecturesUtil * [erdosproblems.com/75] (https://www.erdosproblems.com/75) -/ +@[expose] public section + open Cardinal namespace Erdos75 @@ -32,9 +35,8 @@ Is there a graph of chromatic number `ℵ_ 1` with `ℵ_ 1` vertices such that f `ε > 0`, if `n` is sufficiently large and `H` is a subgraph on `n` vertices, then `H` contains an independent set of size `> n ^ (1 - ε)`? -/ -@[category research open, AMS 5] +@[category research open, question, AMS 5] theorem erdos_75 : - answer(sorry) ↔ ∃ (V : Type) (G : SimpleGraph V), G.chromaticCardinal = ℵ_ 1 ∧ #V = ℵ_ 1 ∧ diff --git a/FormalConjectures/ErdosProblems/757.lean b/FormalConjectures/ErdosProblems/757.lean index d0448ea..b94e65e 100644 --- a/FormalConjectures/ErdosProblems/757.lean +++ b/FormalConjectures/ErdosProblems/757.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 757 @@ -25,6 +26,8 @@ import FormalConjecturesUtil four elements. J. Combin. Theory Ser. B (1995), 108-118. -/ +@[expose] public section + open scoped Pointwise open Filter @@ -37,10 +40,12 @@ of size at least `c * A.ncard`. The difference condition is equivalent to def IsAdmissible (c : ℝ) : Prop := ∀ {A : Set ℝ}, A.Finite → (∀ B ⊆ A, B.ncard = 4 → 11 ≤ (B - B).ncard) → ∃ S ⊆ A, IsSidon S ∧ c * A.ncard ≤ (S.ncard : ℝ) +def erdos_757.answer : ℝ := sorry + /-- What is the supremum of the set of admissible numbers? -/ -@[category research open, AMS 5] +@[category research open, question value, AMS 5] theorem erdos_757 {A : Set ℝ} : - answer(sorry) = sSup {c | IsAdmissible c} := by + erdos_757.answer = sSup {c | IsAdmissible c} := by sorry /-- The supremum is strictly larger than `1 / 2`, which is proved in [GyLe95]. -/ diff --git a/FormalConjectures/ErdosProblems/761.lean b/FormalConjectures/ErdosProblems/761.lean new file mode 100644 index 0000000..94159ea --- /dev/null +++ b/FormalConjectures/ErdosProblems/761.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 761 + +*References:* +- [erdosproblems.com/761](https://www.erdosproblems.com/761) +- [ErGi93] Erdős, P. and Gimbel, J., *Some problems and results in cochromatic theory*. + Quo vadis, graph theory? (1993), 261-264. +-/ + +@[expose] public section + +universe u + +namespace Erdos761 + +/-- The vertices in `S` span no directed cycle of `D`: there is no closed directed walk of +positive length inside `S`. -/ +def IsAcyclicOn {V : Type*} (D : Digraph V) (S : Set V) : Prop := + ∀ v : V, ¬ Relation.TransGen (fun a b : V ↦ a ∈ S ∧ b ∈ S ∧ D.Adj a b) v v + +/-- `Dicolorable G k` says that, for every orientation `D` of `G`, the vertices can be coloured +with `k` colours such that no colour class contains a directed cycle of `D`. -/ +def Dicolorable {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∀ D : Digraph V, D.IsOrientation G → + ∃ c : V → Fin k, ∀ i : Fin k, IsAcyclicOn D {v | c v = i} + +/-- The dichromatic number $\delta(G)$: the least `k` such that `G` is `k`-dicolorable. It is +finite for finite graphs, since colouring all vertices differently works. -/ +noncomputable def dichromaticNumber {V : Type*} (G : SimpleGraph V) : ℕ∞ := + ⨅ (k : ℕ) (_ : Dicolorable G k), (k : ℕ∞) + +/-- If `Dicolorable G k` holds, then $\delta(G) \leq k$. -/ +@[category API, AMS 5] +theorem dichromaticNumber_le {V : Type*} {G : SimpleGraph V} {k : ℕ} + (h : Dicolorable G k) : dichromaticNumber G ≤ k := + iInf₂_le k h + +/-- +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. + +Must a graph with large chromatic number have large dichromatic number? + +This question is due to Erdős and Neumann-Lara. We read it for finite graphs: for every $k$ there +is $m$ such that every finite graph with $\chi(G)\geq m$ has $\delta(G)\geq k$. +-/ +@[category research open, question, AMS 5] +theorem erdos_761.parts.i : + ∀ k : ℕ, ∃ m : ℕ, ∀ (V : Type*) [Finite V] (G : SimpleGraph V), + (m : ℕ∞) ≤ G.chromaticNumber → (k : ℕ∞) ≤ dichromaticNumber G := by + sorry + +/-- +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. + +Must a graph with large cochromatic number contain a graph with large dichromatic number? + +This question is due to Erdős and Gimbel. We read it for finite graphs and subgraphs: for every +$k$ there is $m$ such that every finite graph with $\zeta(G)\geq m$ has a subgraph $H$ with +$\delta(H)\geq k$. +-/ +@[category research open, question, AMS 5] +theorem erdos_761.parts.ii : + ∀ k : ℕ, ∃ m : ℕ, ∀ (V : Type*) [Finite V] (G : SimpleGraph V), + (m : ℕ∞) ≤ G.cochromaticNumber → + ∃ H : G.Subgraph, (k : ℕ∞) ≤ dichromaticNumber H.coe := by + sorry + +/-- +A positive answer to the second question implies a positive answer to the first via the bound +mentioned in [760]. +-/ +@[category research solved, AMS 5] +theorem erdos_761.variants.parts_ii_imp_i : + (∀ k : ℕ, ∃ m : ℕ, ∀ (V : Type u) [Finite V] (G : SimpleGraph V), + (m : ℕ∞) ≤ G.cochromaticNumber → + ∃ H : G.Subgraph, (k : ℕ∞) ≤ dichromaticNumber H.coe) → + ∀ k : ℕ, ∃ m : ℕ, ∀ (V : Type u) [Finite V] (G : SimpleGraph V), + (m : ℕ∞) ≤ G.chromaticNumber → (k : ℕ∞) ≤ dichromaticNumber G := by + sorry + +end Erdos761 diff --git a/FormalConjectures/ErdosProblems/766.lean b/FormalConjectures/ErdosProblems/766.lean new file mode 100644 index 0000000..fe97477 --- /dev/null +++ b/FormalConjectures/ErdosProblems/766.lean @@ -0,0 +1,159 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 766 + +*References:* +- [erdosproblems.com/766](https://www.erdosproblems.com/766) +- [Er64c] Erdős, P., *Extremal problems in graph theory*. Theory of Graphs and its Applications + (Proc. Sympos. Smolenice, 1963) (1964), 29-36. + [PDF](https://www.renyi.hu/~p_erdos/1964-06.pdf) +-/ + +@[expose] public section + +open Filter +open scoped SimpleGraph + +namespace Erdos766 + +/-- $f(n;k,l)$ in the sense of [Er64c], where it is called $f_1(n;k,l)$: the least $m$ such that +every graph with $n$ vertices and $m$ edges contains at least one graph with $k$ vertices and +$l$ edges as a (not necessarily induced) subgraph. There is no graph with $n$ vertices and more +than $\binom{n}{2}$ edges, so the set is nonempty. -/ +noncomputable def forcingNumber (n k l : ℕ) : ℕ := + sInf {m : ℕ | ∀ G : SimpleGraph (Fin n), G.edgeSet.ncard = m → + ∃ H : SimpleGraph (Fin k), H.edgeSet.ncard = l ∧ H ⊑ G} + +/-- If every graph with $n$ vertices and $m$ edges contains a graph with $k$ vertices and $l$ +edges, then $f(n;k,l) \leq m$. -/ +@[category API, AMS 5] +theorem forcingNumber_le {n k l m : ℕ} (h : ∀ G : SimpleGraph (Fin n), G.edgeSet.ncard = m → + ∃ H : SimpleGraph (Fin k), H.edgeSet.ncard = l ∧ H ⊑ G) : forcingNumber n k l ≤ m := + Nat.sInf_le h + +/-- For $k \leq n$ every graph on $n$ vertices contains the empty graph on $k$ vertices, so +$f(n;k,0) = 0$. -/ +@[category test, AMS 5] +theorem forcingNumber_zero {n k : ℕ} (hkn : k ≤ n) : forcingNumber n k 0 = 0 := + Nat.eq_zero_of_le_zero <| forcingNumber_le fun _ _ ↦ + ⟨⊥, by simp, SimpleGraph.bot_isContained_iff_card_le.2 (by simpa using hkn)⟩ + +/-- $f(n;k,l) \leq \mathrm{ex}(n;G) + 1$ for every graph $G$ with $k$ vertices and $l$ edges, +since a graph with more than $\mathrm{ex}(n;G)$ edges contains $G$. Here $\mathrm{ex}(n;G)$ is +`SimpleGraph.extremalNumber n G`, the maximum number of edges of a graph on $n$ vertices with no +copy of $G$. -/ +@[category test, AMS 5] +theorem forcingNumber_le_extremalNumber_add_one (n : ℕ) {k l : ℕ} (G : SimpleGraph (Fin k)) + (h : G.edgeSet.ncard = l) : forcingNumber n k l ≤ SimpleGraph.extremalNumber n G + 1 := by + classical + refine forcingNumber_le fun G' hG' ↦ ⟨G, h, ?_⟩ + refine SimpleGraph.IsContained.of_extremalNumber_lt_card_edgeFinset ?_ + rw [Fintype.card_fin, ← Set.ncard_coe_finset, SimpleGraph.coe_edgeFinset, hG'] + exact Nat.lt_succ_self _ + +/-- The function of erdosproblems.com: the minimum of $\mathrm{ex}(n;G)$ over all graphs $G$ with +$k$ vertices and $l$ edges. In [Er64c] the least $m$ such that every graph with $n$ vertices and +$m$ edges contains one fixed graph with $k$ vertices and $l$ edges is called $f_2(n;k,l)$, so +this is $f_2(n;k,l) - 1$. The value is in `ℕ∞` and is `⊤` when no such graph $G$ exists. -/ +noncomputable def minExtremalNumber (n k l : ℕ) : ℕ∞ := + ⨅ (G : SimpleGraph (Fin k)) (_ : G.edgeSet.ncard = l), (SimpleGraph.extremalNumber n G : ℕ∞) + +/-- The minimum is at most $\mathrm{ex}(n;G)$ for every graph $G$ with $k$ vertices and $l$ +edges. -/ +@[category API, AMS 5] +theorem minExtremalNumber_le (n : ℕ) {k l : ℕ} (G : SimpleGraph (Fin k)) + (h : G.edgeSet.ncard = l) : minExtremalNumber n k l ≤ SimpleGraph.extremalNumber n G := + iInf₂_le G h + +/-- There is no graph with $0$ vertices and $1$ edge, so the minimum is `⊤`. -/ +@[category test, AMS 5] +theorem minExtremalNumber_zero_one (n : ℕ) : minExtremalNumber n 0 1 = ⊤ := by + simp [minExtremalNumber, Set.eq_empty_of_isEmpty] + +def erdos_766.parts.i.answer : ℕ → ℕ → ℕ → ℝ := sorry + +/-- +Let $f(n;k,l)=\min \mathrm{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 Real.log (c n) / (n * Real.log n)) atTop (𝓝 γ) := by + ∃ c : ℕ → ℕ, (∀ n, 0 < n → IsCutoff n (c n)) ∧ + ∃ γ : ℝ, Tendsto (fun n : ℕ => Real.log (c n) / (n * Real.log n)) atTop (𝓝 γ) := by sorry end Erdos769 diff --git a/FormalConjectures/ErdosProblems/77.lean b/FormalConjectures/ErdosProblems/77.lean new file mode 100644 index 0000000..39e2dbc --- /dev/null +++ b/FormalConjectures/ErdosProblems/77.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 77 + +*References:* +- [erdosproblems.com/77](https://www.erdosproblems.com/77) +- [BBCGHMST24] Balister, P. and Bollobás, B. and Campos, M. and Griffiths, S. and Hurley, E. and + Morris, R. and Sahasrabudhe, J. and Tiba, M., Upper bounds for multicolour Ramsey numbers. + arXiv:2410.17197 (2024). +- [CGMS23] Campos, Marcelo and Griffiths, Simon and Morris, Robert and Sahasrabudhe, Julian, An + exponential improvement for diagonal Ramsey. arXiv:2303.09521 (2023). +- [Er88] Erdős, P, Problems and results in combinatorial analysis and graph theory. Discrete Math. + (1988), 81-92. +- [Er93] Erdős, Paul, Some of my favorite solved and unsolved problems in graph theory. Quaestiones + Math. (1993), 333-350. +- [GNNW24] Gupta, P. and Ndiaye, N. and Norin, S. and Wei, L., Optimizing the CGMS upper bound on + Ramsey numbers. arXiv:2407.19026 (2024). +-/ + +@[expose] public section + +open scoped Topology + +namespace Erdos77 + +def erdos_77.answer : ℝ := sorry + +/-- +If $R(k)$ is 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$, then find the value of +$$\lim_{k\to \infty}R(k)^{1/k}.$$ + +This problem is #3 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, question value, AMS 5] +theorem erdos_77 : + Filter.Tendsto (fun k : ℕ ↦ (SimpleGraph.diagonalRamsey k : ℝ) ^ (1 / (k : ℝ))) + Filter.atTop (𝓝 erdos_77.answer) := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos77 diff --git a/FormalConjectures/ErdosProblems/773.lean b/FormalConjectures/ErdosProblems/773.lean new file mode 100644 index 0000000..66e4b09 --- /dev/null +++ b/FormalConjectures/ErdosProblems/773.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 773 + +*References:* +- [erdosproblems.com/773](https://www.erdosproblems.com/773) +- [AlEr85] Alon, Noga and Erdős, P., *An application of graph theory to additive number theory*. + European J. Combin. (1985), 201-203. +- [Er80] Erdős, Paul, *A survey of problems in combinatorial number theory*. Ann. Discrete Math. + (1980), 89-115. +- [LeTh95] Lefmann, Hanno and Thiele, Torsten, *Point sets with distinct distances*. Combinatorica + (1995), 379--408. +-/ + +@[expose] public section + +namespace Erdos773 + +open Filter + +/-- +What is the size of the largest Sidon subset $A\subseteq\{1,2^2,\ldots,N^2\}$? Is it $N^{1-o(1)}$? +-/ +@[category research open, question, AMS 11] +theorem erdos_773 : + ∀ ε > (0 : ℝ), ∀ᶠ N : ℕ in atTop, + (N : ℝ) ^ (1 - ε) ≤ + (Finset.maxSidonSubsetCard + (Finset.image (fun n : ℕ => n ^ 2) (Finset.Icc 1 N)) : ℝ) := by + sorry + +end Erdos773 diff --git a/FormalConjectures/ErdosProblems/775.lean b/FormalConjectures/ErdosProblems/775.lean index de11eaa..67fc46a 100644 --- a/FormalConjectures/ErdosProblems/775.lean +++ b/FormalConjectures/ErdosProblems/775.lean @@ -40,8 +40,8 @@ $f_k(n)\to \infty$ as $n\to \infty$. -/ @[category research solved, AMS 5, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.29.1/ErdosProblems/Erdos775.lean"] theorem erdos_775 : answer(False) ↔ - ∃ C : ℕ, ∃ᶠ n : ℕ in atTop, ∃ H : ThreeUniformHypergraph (Fin n), - n - C ≤ (ThreeUniformHypergraph.cliqueSizes H).ncard := by + ∃ C : ℕ, ∃ᶠ n : ℕ in atTop, ∃ H : UniformHypergraph (Fin n) 3, + n - C ≤ (UniformHypergraph.cliqueSizes H).ncard := by sorry /-- @@ -52,8 +52,8 @@ $f_k(n)\to \infty$ as $n\to \infty$. @[category research solved, AMS 5] theorem erdos_775.variants.gao : ∃ f : ℕ → ℕ, Tendsto f atTop atTop ∧ - ∀ᶠ n : ℕ in atTop, ∀ H : ThreeUniformHypergraph (Fin n), - (ThreeUniformHypergraph.cliqueSizes H).ncard + f n ≤ n := by + ∀ᶠ n : ℕ in atTop, ∀ H : UniformHypergraph (Fin n) 3, + (UniformHypergraph.cliqueSizes H).ncard + f n ≤ n := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/78.lean b/FormalConjectures/ErdosProblems/78.lean new file mode 100644 index 0000000..4f98019 --- /dev/null +++ b/FormalConjectures/ErdosProblems/78.lean @@ -0,0 +1,165 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 78 + +*References:* +- [erdosproblems.com/78](https://www.erdosproblems.com/78) +- [Co15] Cohen, Gil, *Two-source dispersers for polylogarithmic entropy and improved Ramsey + graphs*. arXiv:1506.04428 (2015). +- [Er47] Erdős, P., *Some remarks on the theory of graphs*. Bull. Amer. Math. Soc. (1947), + 292-294. +- [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. +- [Er88] Erdős, P, Problems and results in combinatorial analysis and graph theory. Discrete Math. + (1988), 81-92. +- [Er93] Erdős, Paul, Some of my favorite solved and unsolved problems in graph theory. Quaestiones + Math. (1993), 333-350. +- [Er95] Erdős, Paul, *Some of my favourite problems in number theory, combinatorics, and + geometry*. Resenhas (1995), 165-186. +- [Er97c] Erdős, Paul, *Some of my favorite problems and results*. The mathematics of Paul + Erdős, I (1997), 47-67. +- [Li23b] Li, Xin, *Two source extractors for asymptotically optimal entropy, and (many) more*. + arXiv:2303.06802 (2023). +- [Va99] Various, *Some of Paul's favorite problems*. Booklet produced for the conference "Paul + Erdős and his mathematics", Budapest, July 1999 (1999). +-/ + +@[expose] public section + +open Filter Real ComplexityTheory + +namespace Erdos78 + +/-- +The graph on `Fin n` described by an adjacency oracle `adj`. Two distinct vertices `u` and `v` +are adjacent if `adj (1ⁿ, u, v)` or `adj (1ⁿ, v, u)` is `true`. + +The number of vertices is given in unary, as the list `List.replicate n true`. So if `adj` is +computable in polynomial time, then the whole graph on `n` vertices is computable in time +polynomial in `n`. This is the notion of a *weakly explicit* family of graphs; compare +`stronglyExplicitGraph`. +-/ +def explicitGraph (adj : List Bool × ℕ × ℕ → Bool) (n : ℕ) : SimpleGraph (Fin n) := + SimpleGraph.fromRel fun u v ↦ adj (List.replicate n true, u, v) + +/-- +The graph on `Fin n` described by an adjacency oracle `adj` which receives `n` in binary. Two +distinct vertices `u` and `v` are adjacent if `adj (n, u, v)` or `adj (n, v, u)` is `true`. + +If `adj` is computable in polynomial time, then each adjacency query is answered in time +polynomial in $\log n$. This is the notion of a *strongly explicit* family of graphs, which is +what "explicit Ramsey graph" usually means in the literature (e.g. [Co15], [Li23b]). Compare +`explicitGraph`, where only time polynomial in $n$ is allowed. +-/ +def stronglyExplicitGraph (adj : ℕ × ℕ × ℕ → Bool) (n : ℕ) : SimpleGraph (Fin n) := + SimpleGraph.fromRel fun u v ↦ adj (n, u, v) + +/-- +The graph `G` has no clique and no independent set with `m` vertices. +-/ +def NoHomogeneousSet {V : Type*} (G : SimpleGraph V) (m : ℕ) : Prop := + G.CliqueFree m ∧ Gᶜ.CliqueFree m + +/-- +Let $R(k)$ be the Ramsey number for $K_k$. Give a constructive proof that $R(k) > C^k$ for some +constant $C > 1$. + +Equivalently, give an explicit construction of graphs on $n$ vertices which contain no clique +and no independent set of size $\geq c \log n$, for some constant $c > 0$. + +We formalise "explicit" as: the adjacency relation of the graph on $n$ vertices is decided by a +single algorithm that runs in time polynomial in $n$ (see `explicitGraph`). This is the weakest +reasonable notion ("weakly explicit"); even this is open. The strongly explicit version, with time +polynomial in $\log n$, is `erdos_78.variants.strongly_explicit`. + +This problem is #4 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, AMS 5 68] +theorem erdos_78 : + ∃ c > (0 : ℝ), ∃ adj : List Bool × ℕ × ℕ → Bool, IsPolyTime adj ∧ + ∀ᶠ n in atTop, NoHomogeneousSet (explicitGraph adj n) ⌈c * log n⌉₊ := by + sorry + +/-- +Erdős [Er47] gave a simple probabilistic, non-constructive proof that $R(k) > C^k$ for some +constant $C > 1$. In fact $R(k) > 2^{k/2}$ for all $k \geq 3$. +-/ +@[category research solved, AMS 5] +theorem erdos_78.variants.nonconstructive : + ∃ C > (1 : ℝ), ∀ᶠ k in atTop, C ^ k < (SimpleGraph.diagonalRamsey k : ℝ) := by + sorry + +/-- +Erdős also asked for an explicit construction of graphs on $n$ vertices whose largest clique and +independent set have size $o(n^{1/2})$. Such constructions are now known; see [Co15] for the +history. +-/ +@[category research solved, AMS 5 68] +theorem erdos_78.variants.little_o_sqrt : + ∃ f : ℕ → ℝ, f =o[atTop] (fun n ↦ √(n : ℝ)) ∧ + ∃ adj : List Bool × ℕ × ℕ → Bool, IsPolyTime adj ∧ + ∀ᶠ n in atTop, NoHomogeneousSet (explicitGraph adj n) ⌈f n⌉₊ := by + sorry + +/-- +Cohen [Co15] constructed explicit graphs on $n$ vertices with no clique and no independent set +of size $2^{(\log \log n)^C}$, for some constant $C > 0$. +-/ +@[category research solved, AMS 5 68] +theorem erdos_78.variants.cohen : + ∃ C > (0 : ℝ), ∃ adj : List Bool × ℕ × ℕ → Bool, IsPolyTime adj ∧ + ∀ᶠ n in atTop, + NoHomogeneousSet (explicitGraph adj n) ⌈(2 : ℝ) ^ (log (log n)) ^ C⌉₊ := by + sorry + +/-- +Li [Li23b] improved this to explicit graphs on $n$ vertices with no clique and no independent set +of size $(\log n)^C$, for some constant $C > 0$. +-/ +@[category research solved, AMS 5 68] +theorem erdos_78.variants.li : + ∃ C > (0 : ℝ), ∃ adj : List Bool × ℕ × ℕ → Bool, IsPolyTime adj ∧ + ∀ᶠ n in atTop, NoHomogeneousSet (explicitGraph adj n) ⌈(log n) ^ C⌉₊ := by + sorry + +/-- +The strongly explicit version of `erdos_78`: an explicit family of graphs on $n$ vertices with no +clique and no independent set of size $\geq c \log n$, where each adjacency query is answered in +time polynomial in $\log n$ (see `stronglyExplicitGraph`). +-/ +@[category research open, AMS 5 68] +theorem erdos_78.variants.strongly_explicit : + ∃ c > (0 : ℝ), ∃ adj : ℕ × ℕ × ℕ → Bool, IsPolyTime adj ∧ + ∀ᶠ n in atTop, NoHomogeneousSet (stronglyExplicitGraph adj n) ⌈c * log n⌉₊ := by + sorry + +/-- +The construction of Li [Li23b] is strongly explicit: there are graphs on $n$ vertices with no +clique and no independent set of size $(\log n)^C$, for some constant $C > 0$, whose adjacency +queries are answered in time polynomial in $\log n$. +-/ +@[category research solved, AMS 5 68] +theorem erdos_78.variants.li_strongly_explicit : + ∃ C > (0 : ℝ), ∃ adj : ℕ × ℕ × ℕ → Bool, IsPolyTime adj ∧ + ∀ᶠ n in atTop, NoHomogeneousSet (stronglyExplicitGraph adj n) ⌈(log n) ^ C⌉₊ := by + sorry + +end Erdos78 diff --git a/FormalConjectures/ErdosProblems/782.lean b/FormalConjectures/ErdosProblems/782.lean new file mode 100644 index 0000000..d861c4a --- /dev/null +++ b/FormalConjectures/ErdosProblems/782.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 782 + +*References:* +- [erdosproblems.com/782](https://www.erdosproblems.com/782) +- [BEF90] Brown, T. C. and Erdős, P. and Freedman, A. R., _Quasi-progressions and descending + waves_. J. Combin. Theory Ser. A 53 (1990), 81-95. +- [BFS03] Brown, T. C., Freedman, A. R. and Shiue, P. J.-S., _Progressions of squares_. + Australas. J. Combin. 27 (2003), 187-192. +- [BEU26] Bremner, A., Elsholtz, C. and Ulas, M., _There are infinitely many Hilbert cubes of + dimension 3 in the set of squares_. [arXiv:2604.05459](https://arxiv.org/abs/2604.05459) (2026). +- [CiGr07] Cilleruelo, J. and Granville, A., _Lattice points on circles, squares in arithmetic + progressions and sumsets of squares_. Additive combinatorics (2007), 241-262. +- [DiEl12] Dietmann, R. and Elsholtz, C., _Hilbert cubes in progression-free sets and in the set + of squares II_. [arXiv:1207.1461](https://arxiv.org/abs/1207.1461) (2012). +- [So07] Solymosi, J., _Elementary additive combinatorics_. Additive combinatorics (2007), 29-38. +-/ + +@[expose] public section + +namespace Erdos782 + +/-- `ContainsQuasiProgression S C k` says that `S` contains a $k$-term quasi-progression of +diameter $C$: terms $x_1,\ldots,x_k\in S$ and a difference $d\geq 1$ with +$x_i+d\leq x_{i+1}\leq x_i+d+C$ for all $1\leq i0$ such that, for any $k$, the squares contain a sequence $x_1,\ldots,x_k$ where, for +some $d$ and all $1\leq i (counting A x * counting B x : ℝ) / (x : ℝ)) atTop (𝓝 1) /-- -Let $A,B\subseteq \mathbb{N}$ be infinite sets such that $A+B$ contains all large integers. -Let $A(x)=\lvert A\cap [1,x]\rvert$ and similarly for $B(x)$. Is it true that if +Let $A,B\subseteq \mathbb{N}$ be infinite sets of positive integers such that $A+B$ contains all +large integers. Let $A(x)=\lvert A\cap [1,x]\rvert$ 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$? @@ -74,10 +77,10 @@ $$A(x)B(x)-x=o(A(x)).$$ This was formalized in Lean by van Doorn using Aristotle. -/ -@[category research solved, AMS 11, formal_proof using lean4 at +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/Woett/Lean-files/blob/main/ErdosProblem785.lean"] -theorem erdos_785 : answer(True) ↔ - ∀ A B : Set ℕ, A.Infinite → B.Infinite → IsExactAdditiveComplement A B → +theorem erdos_785 : + ∀ A B : Set ℕ, A.Infinite → B.Infinite → 0 ∉ A → 0 ∉ B → IsExactAdditiveComplement A B → Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop := by sorry @@ -87,7 +90,7 @@ do not exist, as reported in [Er57] and [Er61]). -/ @[category research solved, AMS 11] theorem erdos_785.variants.danzer : - ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ IsExactAdditiveComplement A B := by + ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ 0 ∉ A ∧ 0 ∉ B ∧ IsExactAdditiveComplement A B := by sorry /-- @@ -96,19 +99,20 @@ $$A(x)B(x)-x=o(A(x)).$$ -/ @[category research solved, AMS 11] theorem erdos_785.variants.sarkozy_szemeredi (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite) - (h : IsExactAdditiveComplement A B) : + (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B) : ¬ (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) =o[atTop] (fun x : ℕ => (counting A x : ℝ)) := by sorry /-- -Chen and Fang [ChFa15] proved $A(x)B(x)-x\ll A(x)^c$ cannot hold for any constant $c>0$. +Chen and Fang [ChFa15] proved $A(x)B(x)-x\ll \min(A(x),B(x))^c$ cannot hold for any constant +$c>0$. In particular $A(x)B(x)-x\ll A(x)^c$ cannot hold when $A$ is the sparser of the two sets. -/ @[category research solved, AMS 11] theorem erdos_785.variants.chen_fang (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite) - (h : IsExactAdditiveComplement A B) (c : ℝ) (hc : 0 < c) : + (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B) (c : ℝ) (hc : 0 < c) : ¬ (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) =O[atTop] - (fun x : ℕ => (counting A x : ℝ) ^ c) := by + (fun x : ℕ => (min (counting A x) (counting B x) : ℝ) ^ c) := by sorry /-- @@ -117,7 +121,7 @@ we must have $A(2x)/A(x)\to 1$ and $B(2x)/B(x)\to 2$. -/ @[category research solved, AMS 11] theorem erdos_785.variants.narkiewicz (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite) - (h : IsExactAdditiveComplement A B) : + (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B) : (Tendsto (fun x : ℕ => (counting A (2 * x) : ℝ) / (counting A x : ℝ)) atTop (𝓝 1) ∧ Tendsto (fun x : ℕ => (counting B (2 * x) : ℝ) / (counting B x : ℝ)) atTop (𝓝 2)) ∨ (Tendsto (fun x : ℕ => (counting B (2 * x) : ℝ) / (counting B x : ℝ)) atTop (𝓝 1) ∧ @@ -132,7 +136,7 @@ for infinitely many $x$. -/ @[category research solved, AMS 11] theorem erdos_785.variants.ruzsa_upper_bound (w : ℕ → ℝ) (hw : Tendsto w atTop atTop) : - ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ IsExactAdditiveComplement A B ∧ + ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ 0 ∉ A ∧ 0 ∉ B ∧ IsExactAdditiveComplement A B ∧ ∃ᶠ x : ℕ in atTop, (counting A x * counting B x : ℝ) - (x : ℝ) < w x := by sorry @@ -143,7 +147,7 @@ $$A(x)B(x)-x > (1-o(1))\frac{a^*(x)}{A(x)}.$$ -/ @[category research solved, AMS 11] theorem erdos_785.variants.ruzsa_lower_bound (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite) - (h : IsExactAdditiveComplement A B) : + (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B) : (∀ ε > (0 : ℝ), ∀ᶠ x : ℕ in atTop, (1 - ε) * (aStar A x : ℝ) / (counting A x : ℝ) < (counting A x * counting B x : ℝ) - (x : ℝ)) ∨ @@ -160,7 +164,7 @@ They later [ChFa14] improved $5/4$ to $3-\sqrt{3}\approx 1.268$. -/ @[category research solved, AMS 11] theorem erdos_785.variants.chen_fang_limsup (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite) - (h : IsAdditiveComplement A B) + (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsAdditiveComplement A B) (hlim : limsup (fun x : ℕ => ((counting A x * counting B x : ℝ) / (x : ℝ) : EReal)) atTop < ((3 - Real.sqrt 3 : ℝ) : EReal)) : Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop := by @@ -169,9 +173,9 @@ theorem erdos_785.variants.chen_fang_limsup (A B : Set ℕ) (hA : A.Infinite) (h /-- Chen conjectures that this should be true with $3/2$. -/ -@[category research open, AMS 11] -theorem erdos_785.variants.chen_conjecture : answer(sorry) ↔ - ∀ A B : Set ℕ, A.Infinite → B.Infinite → IsAdditiveComplement A B → +@[category research open, question, AMS 11] +theorem erdos_785.variants.chen_conjecture : + ∀ A B : Set ℕ, A.Infinite → B.Infinite → 0 ∉ A → 0 ∉ B → IsAdditiveComplement A B → limsup (fun x : ℕ => ((counting A x * counting B x : ℝ) / (x : ℝ) : EReal)) atTop < ((3 / 2 : ℝ) : EReal) → Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop := by @@ -184,7 +188,7 @@ for which $A(x)B(x)-x=1$ for infinitely many $x$. -/ @[category research solved, AMS 11] theorem erdos_785.variants.chen_fang_sharp : - ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ IsAdditiveComplement A B ∧ + ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ 0 ∉ A ∧ 0 ∉ B ∧ IsAdditiveComplement A B ∧ limsup (fun x : ℕ => ((counting A x * counting B x : ℝ) / (x : ℝ) : EReal)) atTop = ((3 / 2 : ℝ) : EReal) ∧ ∃ᶠ x : ℕ in atTop, (counting A x * counting B x : ℝ) - (x : ℝ) = 1 := by diff --git a/FormalConjectures/ErdosProblems/786.lean b/FormalConjectures/ErdosProblems/786.lean index 6eeb0f5..40baef3 100644 --- a/FormalConjectures/ErdosProblems/786.lean +++ b/FormalConjectures/ErdosProblems/786.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 786 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/786](https://www.erdosproblems.com/786) -/ +@[expose] public section + open Filter Real open scoped Topology @@ -47,8 +50,8 @@ Let $\epsilon > 0$. Is there some set $A\subset\mathbb{N}$ of density $> 1 - \ep such that $a_1\cdots a_r = b_1\cdots b_s$ with $a_i, b_j\in A$ can only hold when $r = s$? -/ -@[category research open, AMS 11] -theorem erdos_786.parts.i : answer(sorry) ↔ ∀ ε > 0, ε ≤ 1 → +@[category research open, question, AMS 11] +theorem erdos_786.parts.i : ∀ ε > 0, ε ≤ 1 → ∃ (A : Set ℕ) (δ : ℝ), 0 ∉ A ∧ 1 - ε < δ ∧ A.HasDensity δ ∧ A.IsMulCardSet := by sorry @@ -57,8 +60,8 @@ Is there some set $A\subset\{1, ..., N\}$ of size $\geq (1 - o(1))N$ such that $a_1\cdots a_r = b_1\cdots b_s$ with $a_i, b_j\in A$ can only hold when $r = s$? -/ -@[category research open, AMS 11] -theorem erdos_786.parts.ii : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_786.parts.ii : ∃ (A : ℕ → Set ℕ) (f : ℕ → ℝ) (_ : f =o[atTop] (1 : ℕ → ℝ)), ∀ N, A N ⊆ Set.Icc 1 (N + 1) ∧ (1 - f N) * N ≤ (A N).ncard ∧ (A N).IsMulCardSet := by sorry @@ -177,7 +180,7 @@ $$ \sum_{i=1}^k \frac{1}{p_i} < 1 < \sum_{i=1}^{k + 1} \frac{1}{p_i}, $$ and let $A$ be the set of all naturals divisible by exactly one of $p_1, ..., p_k$ (with -multiplicity $1$). Then $A$ has density $\frac{1}{e} - \epsilon$ and has the property +multiplicity $1$). Then $A$ has density $> \frac{1}{e} - \epsilon$ and has the property that $a_1\cdots a_r = b_1\cdots b_s$ with $a_i, b_j\in A$ can only hold when $r = s$. -/ @[category research solved, AMS 11] @@ -186,7 +189,7 @@ theorem erdos_786.parts.i.selfridge (ε : ℝ) (hε : 0 < ε ∧ ε < 1 / rexp 1 ∑ q ∈ consecutivePrimesFrom p k, (1 : ℝ) / q < 1 ∧ 1 < ∑ q ∈ consecutivePrimesFrom p (k + 1), (1 : ℝ) / q ∧ letI A := { n | ∑ q ∈ consecutivePrimesFrom p k, (n : ℕ).factorization q = 1 } - A.HasDensity (1 / rexp 1 - ε) ∧ A.IsMulCardSet := by + ∃ δ, 1 / rexp 1 - ε < δ ∧ A.HasDensity δ ∧ A.IsMulCardSet := by sorry end Erdos786 diff --git a/FormalConjectures/ErdosProblems/787.lean b/FormalConjectures/ErdosProblems/787.lean new file mode 100644 index 0000000..6271ae1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/787.lean @@ -0,0 +1,166 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 787 + +*References:* +- [erdosproblems.com/787](https://www.erdosproblems.com/787) +- [Be25] Beker, A., *The Erdős-Moser sum-free set problem via improved bounds for + $k$-configurations*. [arXiv:2501.10203](https://arxiv.org/abs/2501.10203) (2025). +- [Ch71] Choi, S. L. G., *On a combinatorial problem in number theory*. + Proc. London Math. Soc. (3) (1971), 629-642. +- [Er65] Erdős, P., *Extremal problems in number theory*. Proc. Sympos. Pure Math., Vol. VIII + (1965), 181-189. [PDF](https://www.renyi.hu/~p_erdos/1965-02.pdf) +- [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. [PDF](https://www.renyi.hu/~p_erdos/1973-21.pdf) +- [Ru05] Ruzsa, Imre Z., *Sum-avoiding subsets*. Ramanujan J. (2005), 77-82. +- [Sa21] Sanders, Tom, *The Erdős-Moser sum-free set problem*. Canad. J. Math. (2021), 63-107. +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos787 + +/-- +`g G n` is the largest `m` such that every set `A` of `n` elements of `G` has a subset `B` with +$\lvert B\rvert \geq m$ and $b_1 + b_2 \notin A$ for all distinct $b_1, b_2 \in B$ +[Er65, p. 187]. The problem takes `G = ℝ`. + +The condition on `B` is `Disjoint B.restrictedSumset A`. For `G = ℝ` or `G = ℤ`, the set of such +`m` contains `0` and is bounded by `n`, so `sSup` is its maximum, not a junk value. +-/ +noncomputable def g (G : Type*) [Add G] [DecidableEq G] (n : ℕ) : ℕ := + sSup {m : ℕ | ∀ A : Finset G, A.card = n → + ∃ B ⊆ A, m ≤ B.card ∧ Disjoint B.restrictedSumset A} + +/-- `Disjoint B.restrictedSumset A` says that $b_1 + b_2 \notin A$ for all distinct +$b_1, b_2 \in B$. -/ +@[category API, AMS 5 11] +theorem disjoint_restrictedSumset_iff {G : Type*} [Add G] [DecidableEq G] (A B : Finset G) : + Disjoint B.restrictedSumset A ↔ ∀ b₁ ∈ B, ∀ b₂ ∈ B, b₁ ≠ b₂ → b₁ + b₂ ∉ A := by + unfold Finset.restrictedSumset + rw [Finset.disjoint_left] + constructor + · intro h b₁ hb₁ b₂ hb₂ hne hmem + have hmem' : b₁ + b₂ ∈ Finset.image (fun p : G × G => p.1 + p.2) B.offDiag := + Finset.mem_image.2 ⟨(b₁, b₂), Finset.mem_offDiag.2 ⟨hb₁, hb₂, hne⟩, rfl⟩ + exact h hmem' hmem + · intro h x hx hxA + obtain ⟨⟨b₁, b₂⟩, hp, rfl⟩ := Finset.mem_image.1 hx + obtain ⟨hb₁, hb₂, hne⟩ := Finset.mem_offDiag.1 hp + exact h b₁ hb₁ b₂ hb₂ hne hxA + +/-- If every set of `n` reals has a subset `B` of size at least `m` with +`Disjoint B.restrictedSumset A`, then `m ≤ g ℝ n`. -/ +@[category API, AMS 5 11] +theorem le_g {n m : ℕ} (h : ∀ A : Finset ℝ, A.card = n → + ∃ B ⊆ A, m ≤ B.card ∧ Disjoint B.restrictedSumset A) : m ≤ g ℝ n := by + refine le_csSup (bddAbove_def.2 ⟨n, fun m' hm' => ?_⟩) h + have hm'' : ∀ A : Finset ℝ, A.card = n → + ∃ B ⊆ A, m' ≤ B.card ∧ Disjoint B.restrictedSumset A := hm' + obtain ⟨A, hA⟩ := Infinite.exists_subset_card_eq ℝ n + obtain ⟨B, hBA, hmB, -⟩ := hm'' A hA + exact hmB.trans ((Finset.card_le_card hBA).trans_eq hA) + +def erdos_787.answer : ℕ → ℝ := sorry + +/-- +Let $g(n)$ be maximal such that given any set $A\subset \mathbb{R}$ with $\lvert A\rvert=n$ there +exists some $B\subseteq A$ of size $\lvert B\rvert\geq g(n)$ such that $b_1+b_2\not\in A$ for all +$b_1\neq b_2\in B$. + +Estimate $g(n)$. +-/ +@[category research open, question value, AMS 5 11] +theorem erdos_787 : (fun n ↦ (g ℝ n : ℝ)) =Θ[atTop] erdos_787.answer := by + sorry + +/-- +This function was considered by Erdős and Moser. Choi observed that, without loss of generality, +one can assume that $A\subset \mathbb{Z}$. + +Here this means that sets of integers give the same value $g(n)$ as sets of reals. +-/ +@[category research solved, AMS 5 11] +theorem erdos_787.variants.integers (n : ℕ) : g ℤ n = g ℝ n := by + sorry + +/-- +Klarner proved $g(n) \gg \log n$ (indeed, a greedy construction suffices). +-/ +@[category research solved, AMS 5 11] +theorem erdos_787.variants.klarner : + ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, c * Real.log n ≤ (g ℝ n : ℝ) := by + sorry + +/-- +Choi [Ch71] proved $g(n) \ll n^{2/5+o(1)}$. + +Here this means that $g(n) \leq n^{2/5+\varepsilon}$ for every $\varepsilon > 0$ and all large $n$, +as in [Er73, p. 130]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_787.variants.choi : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, (g ℝ n : ℝ) ≤ (n : ℝ) ^ (2 / 5 + ε) := by + sorry + +/-- +The current best bounds known 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]. + +This is the lower bound. +-/ +@[category research solved, AMS 5 11] +theorem erdos_787.variants.sanders : + ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, Real.log n ^ (1 + c) ≤ (g ℝ n : ℝ) := by + sorry + +/-- +The current best bounds known 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]. + +This is the upper bound. [Ru05] proves it in the form $\exp(O(\sqrt{\log n}))$, which is the form +stated here. +-/ +@[category research solved, AMS 5 11] +theorem erdos_787.variants.ruzsa : + ∃ C > (0 : ℝ), ∀ᶠ n : ℕ in atTop, (g ℝ n : ℝ) ≤ Real.exp (C * Real.sqrt (Real.log n)) := by + sorry + +/-- +Beker [Be25] has proved +$$(\log n)^{1+\tfrac{1}{68}+o(1)} \ll g(n).$$ + +Here this means that $g(n) \geq (\log n)^{1+c}$ for every $c < 1/68$ and all large $n$ +[Be25, Theorem 1.2]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_787.variants.beker : + ∀ c : ℝ, 0 < c → c < 1 / 68 → ∀ᶠ n : ℕ in atTop, Real.log n ^ (1 + c) ≤ (g ℝ n : ℝ) := by + sorry + +end Erdos787 diff --git a/FormalConjectures/ErdosProblems/794.lean b/FormalConjectures/ErdosProblems/794.lean index 3aa2994..4e26a40 100644 --- a/FormalConjectures/ErdosProblems/794.lean +++ b/FormalConjectures/ErdosProblems/794.lean @@ -53,7 +53,7 @@ one element each from $\{1,2,3\},\{4,5,6\},\{7,8,9\}$, and then adding the edge -/ @[category research solved, AMS 5, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.29.1/ErdosProblems/Erdos794.lean"] theorem erdos_794 : answer(False) ↔ - ∀ n : ℕ, ∀ H : Finset (Finset (Fin (3 * n))), H.IsThreeUniform → + ∀ n : ℕ, ∀ H : Finset (Finset (Fin (3 * n))), H.IsUniform 3 → n ^ 3 + 1 ≤ H.card → H.ContainsSubgraph 4 3 ∨ H.ContainsSubgraph 5 7 := by sorry @@ -64,7 +64,7 @@ second condition can be dropped. -/ @[category research solved, AMS 5] theorem erdos_794.variants.balogh {V : Type*} [DecidableEq V] (H : Finset (Finset V)) - (hH : H.IsThreeUniform) (h : H.ContainsSubgraph 5 7) : H.ContainsSubgraph 4 3 := by + (hH : H.IsUniform 3) (h : H.ContainsSubgraph 5 7) : H.ContainsSubgraph 4 3 := by sorry /-- @@ -74,7 +74,7 @@ one element each from $\{1,2,3\},\{4,5,6\},\{7,8,9\}$, and then adding the edge -/ @[category research solved, AMS 5] theorem erdos_794.variants.harris : - harrisHypergraph.IsThreeUniform ∧ harrisHypergraph.card = 28 ∧ + harrisHypergraph.IsUniform 3 ∧ harrisHypergraph.card = 28 ∧ ¬ harrisHypergraph.ContainsSubgraph 4 3 ∧ ¬ harrisHypergraph.ContainsSubgraph 5 7 := by sorry @@ -87,7 +87,7 @@ so likely there is simply a typo in this problem's statement). -/ @[category research solved, AMS 5] theorem erdos_794.variants.frankl_furedi (ε : ℝ) (hε : 0 < ε) : - ∀ᶠ n : ℕ in atTop, ∃ H : Finset (Finset (Fin n)), H.IsThreeUniform ∧ + ∀ᶠ n : ℕ in atTop, ∃ H : Finset (Finset (Fin n)), H.IsUniform 3 ∧ ¬ H.ContainsSubgraph 4 3 ∧ (2 / 7 - ε) * (n.choose 3 : ℝ) ≤ (H.card : ℝ) := by sorry diff --git a/FormalConjectures/ErdosProblems/80.lean b/FormalConjectures/ErdosProblems/80.lean index 05e8f6a..b3239ec 100644 --- a/FormalConjectures/ErdosProblems/80.lean +++ b/FormalConjectures/ErdosProblems/80.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 80 @@ -23,6 +24,8 @@ import FormalConjecturesUtil - [erdosproblems.com/80](https://www.erdosproblems.com/80) - [erdosproblems.com/600](https://www.erdosproblems.com/600), stated in `FormalConjectures/ErdosProblems/600.lean` +- [FoLo12] Fox, Jacob and Loh, Po-Shen, On a problem of Erdős and Rothschild on edges in + triangles. Combinatorica (2012), 619--628. 600 asks the same question from the other side. `Erdos600.eFunction n r` is the least edge count forcing some edge into `r` triangles; `f c n` here is the largest book forced once the @@ -31,6 +34,8 @@ same thing, and the two functions are inverse to each other in that sense. Both `SimpleGraph.trianglesContaining`, which 600 introduced. -/ +@[expose] public section + open Filter Finset SimpleGraph open scoped Topology @@ -70,12 +75,16 @@ at least $cn^2$ edges, where each edge is contained in at least one triangle, mu 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)>n^\epsilon$ for some $\epsilon>0$? +The answer is no. Fox and Loh [FoLo12] proved that $f_c(n) \leq n^{O(1/\log\log n)}$ for every +fixed $c < 1/4$, so no $\epsilon > 0$ works for, say, $c = 1/8$. For $c > 1/4$ the situation is +different: $f_c(n) \geq n/6$, see [erdosproblems.com/80](https://www.erdosproblems.com/80). + The bound $c < 1/2$ is what makes the hypothesis satisfiable: a simple graph on $n$ vertices has at most $n(n-1)/2$ edges, so no graph has $cn^2$ of them once $c \geq 1/2$. -/ -@[category research open, AMS 5] -theorem erdos_80 : - answer(sorry) ↔ ∀ c : ℝ, 0 < c → c < 1 / 2 → +@[category research solved, question, AMS 5] +theorem erdos_80.parts.i : + ¬ ∀ c : ℝ, 0 < c → c < 1 / 2 → ∃ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, (n : ℝ) ^ ε < f c n := by sorry @@ -84,9 +93,9 @@ The weaker question from the same problem: is $f_c(n) \gg \log n$? Same feasibility bound on `c` as above. -/ -@[category research open, AMS 5] -theorem erdos_80.variants.log : - answer(sorry) ↔ ∀ c : ℝ, 0 < c → c < 1 / 2 → +@[category research open, question, AMS 5] +theorem erdos_80.parts.ii : + ∀ c : ℝ, 0 < c → c < 1 / 2 → (fun n : ℕ ↦ (f c n : ℝ)) ≫ (fun n : ℕ ↦ Real.log n) := by sorry diff --git a/FormalConjectures/ErdosProblems/802.lean b/FormalConjectures/ErdosProblems/802.lean new file mode 100644 index 0000000..b8d23c6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/802.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 802 + +*References:* +- [erdosproblems.com/802](https://www.erdosproblems.com/802) +- [AEKS81] Ajtai, M. and Erdős, P. and Komlós, J. and Szemerédi, E., *On Turán's theorem for + sparse graphs*. Combinatorica (1981), 313-317. +- [AKS80] Ajtai, Miklós and Komlós, János and Szemerédi, Endre, *A note on Ramsey numbers*. + J. Combin. Theory Ser. A (1980), 354-360. +- [Al96b] Alon, Noga, *Independence numbers of locally sparse graphs and a Ramsey type problem*. + Random Structures Algorithms (1996), 271-278. +- [Sh95] Shearer, James B., *On the independence number of sparse graphs*. Random Structures + Algorithms (1995), 269-271. +-/ + +@[expose] public section + +open Real + +namespace Erdos802 + +open scoped Classical in +/-- +Is it true that any $K_r$-free graph on $n$ vertices with average degree $t$ contains an +independent set on +$$\gg_r \frac{\log t}{t}n$$ +many vertices? + +A conjecture of Ajtai, Erdős, Komlós, and Szemerédi [AEKS81]. +-/ +@[category research open, question, AMS 5] +theorem erdos_802 : ∀ r : ℕ, ∃ c > (0 : ℝ), ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + G.CliqueFree r → + c * (log G.averageDegree / G.averageDegree) * n ≤ G.indepNum := by + sorry + +open scoped Classical in +/-- +Ajtai, Erdős, Komlós, and Szemerédi [AEKS81] proved that any $K_r$-free graph on $n$ vertices +with average degree $t$ contains an independent set on +$$\gg_r \frac{\log\log(t+1)}{t}n$$ +many vertices. +-/ +@[category research solved, AMS 5] +theorem erdos_802.variants.aeks : ∀ r : ℕ, ∃ c > (0 : ℝ), ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + G.CliqueFree r → + c * (log (log (G.averageDegree + 1)) / G.averageDegree) * n ≤ G.indepNum := by + sorry + +open scoped Classical in +/-- +Shearer [Sh95] proved that any $K_r$-free graph on $n$ vertices with average degree $t$ contains +an independent set on +$$\gg_r \frac{\log t}{\log\log(t+1)t}n$$ +many vertices. + +We assume $t \geq 2$. For $t + 1$ slightly larger than $e$ the factor $\log\log(t+1)$ is close +to $0$, so the bound blows up and the statement is false without such a restriction. +-/ +@[category research solved, AMS 5] +theorem erdos_802.variants.shearer : ∀ r : ℕ, ∃ c > (0 : ℝ), ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + G.CliqueFree r → 2 ≤ G.averageDegree → + c * (log G.averageDegree / (log (log (G.averageDegree + 1)) * G.averageDegree)) * n ≤ + G.indepNum := by + sorry + +open scoped Classical in +/-- +Ajtai, Komlós, and Szemerédi [AKS80] proved the conjectured bound when $r = 3$: any +triangle-free graph on $n$ vertices with average degree $t$ contains an independent set on +$$\gg \frac{\log t}{t}n$$ +many vertices. +-/ +@[category research solved, AMS 5] +theorem erdos_802.variants.r_eq_three : ∃ c > (0 : ℝ), ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + G.CliqueFree 3 → + c * (log G.averageDegree / G.averageDegree) * n ≤ G.indepNum := by + sorry + +open scoped Classical in +/-- +Alon [Al96b] proved the conjectured bound under the stronger assumption that the induced graph +on every vertex neighbourhood has chromatic number $\leq r - 2$. +-/ +@[category research solved, AMS 5] +theorem erdos_802.variants.alon : ∀ r : ℕ, ∃ c > (0 : ℝ), ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + (∀ v, (G.induce (G.neighborSet v)).Colorable (r - 2)) → + c * (log G.averageDegree / G.averageDegree) * n ≤ G.indepNum := by + sorry + +end Erdos802 diff --git a/FormalConjectures/ErdosProblems/805.lean b/FormalConjectures/ErdosProblems/805.lean new file mode 100644 index 0000000..a13d782 --- /dev/null +++ b/FormalConjectures/ErdosProblems/805.lean @@ -0,0 +1,133 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 805 + +*References:* +- [erdosproblems.com/805](https://www.erdosproblems.com/805) +- [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. +- [AlSu07] Alon, N. and Sudakov, B., *On graphs with subgraphs having large independence + numbers*. J. Graph Theory 56 (2007), 149-157. + [arXiv:0706.4099](https://arxiv.org/abs/0706.4099) +- [ABS21] Alon, N., Bucić, M. and Sudakov, B., *Large cliques and independent sets all over the + place*. Proc. Amer. Math. Soc. 149 (2021), 3145-3157. + [arXiv:2004.04718](https://arxiv.org/abs/2004.04718) +-/ + +@[expose] public section + +open Filter + +namespace Erdos805 + +/-- `IsLocallyRamsey G m k`: every set of `m` vertices of `G` contains a clique with at least `k` +vertices and an independent set with at least `k` vertices. -/ +def IsLocallyRamsey {n : ℕ} (G : SimpleGraph (Fin n)) (m k : ℕ) : Prop := + ∀ S : Finset (Fin n), S.card = m → + (∃ C ⊆ S, k ≤ C.card ∧ G.IsClique (C : Set (Fin n))) ∧ + (∃ I ⊆ S, k ≤ I.card ∧ G.IsIndepSet (I : Set (Fin n))) + +/-- If every set of `m` vertices contains a clique and an independent set of size `k`, so does +every set of `m' ≥ m` vertices. Thus "every induced subgraph on exactly `m` vertices" and "every +set of at least `m` vertices" (the formulation of [ABS21]) agree. -/ +@[category API, AMS 5] +theorem IsLocallyRamsey.mono {n m m' k : ℕ} {G : SimpleGraph (Fin n)} + (h : IsLocallyRamsey G m k) (hm : m ≤ m') : IsLocallyRamsey G m' k := by + intro S hS + obtain ⟨T, hTS, hT⟩ := Finset.exists_subset_card_eq (show m ≤ S.card by omega) + obtain ⟨⟨C, hCT, hCk, hC⟩, ⟨I, hIT, hIk, hI⟩⟩ := h T hT + exact ⟨⟨C, hCT.trans hTS, hCk, hC⟩, ⟨I, hIT.trans hTS, hIk, hI⟩⟩ + +/-- `HasRamseyGraphs g`: for all sufficiently large `n` there is a graph on `n` vertices in +which every induced subgraph on `g n` vertices contains a clique and an independent set of size +at least $\log n$ (that is, of at least `⌈log n⌉` vertices; `log` is the natural logarithm). -/ +def HasRamseyGraphs (g : ℕ → ℕ) : Prop := + ∀ᶠ n : ℕ in atTop, ∃ G : SimpleGraph (Fin n), IsLocallyRamsey G (g n) ⌈Real.log n⌉₊ + +/-- The answer: the set of functions `g` with $n>g(n)\geq(\log n)^2$ for which such graphs +exist. -/ +def erdos_805.parts.i.answer : Set (ℕ → ℕ) := sorry + +/-- +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$? + +This is the first part. A problem of Erdős and Hajnal [Er91]; see also +[erdosproblems.com/804](https://www.erdosproblems.com/804). The inequalities +on `g` are required for all large `n`, and a graph is required for all large `n`. +-/ +@[category research open, question value, AMS 5] +theorem erdos_805.parts.i : + {g : ℕ → ℕ | (∀ᶠ n : ℕ in atTop, Real.log n ^ 2 ≤ g n ∧ g n < n) ∧ HasRamseyGraphs g} = + erdos_805.parts.i.answer := by + sorry + +/-- +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$? + +This is the second part. Erdős and Hajnal thought that there is no such graph for +$g(n)=(\log n)^3$ [AlSu07]; we state the positive proposition, with $g(n)=\lfloor(\log n)^3\rfloor$ +and a graph required for all large $n$, as in the first part. +-/ +@[category research open, question, AMS 5] +theorem erdos_805.parts.ii : HasRamseyGraphs (fun n ↦ ⌊Real.log n ^ 3⌋₊) := by + sorry + +/-- +Alon and Sudakov [AlSu07] proved that there is no such graph with +$$g(n)=\frac{c}{\log\log n}(\log n)^3$$ +for some constant $c>0$. + +Here `log` is the natural logarithm, as in [AlSu07], and the statement is for all large `n`. +-/ +@[category research solved, AMS 5] +theorem erdos_805.variants.alon_sudakov : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ n : ℕ in atTop, ¬ ∃ G : SimpleGraph (Fin n), + IsLocallyRamsey G ⌊c * Real.log n ^ 3 / Real.log (Real.log n)⌋₊ ⌈Real.log n⌉₊ := by + sorry + +/-- +Alon, Bucić, and Sudakov [ABS21] construct such a graph with +$$g(n)\leq 2^{2^{(\log\log n)^{1/2+o(1)}}}.$$ + +Here all logarithms are to base $2$, as in [ABS21], so the cliques and independent sets have at +least $\lceil\log_2 n\rceil$ vertices; this implies the natural-logarithm version of the problem. +The $o(1)$ is expressed as: for every $0<\varepsilon<1/2$ and all large $n$ there is such a graph +with $g(n)=\lceil 2^{2^{(\log_2\log_2 n)^{1/2+\varepsilon}}}\rceil$. This form, with the rounding, +follows from [ABS21, Theorem 2]. +-/ +@[category research solved, AMS 5] +theorem erdos_805.variants.alon_bucic_sudakov : + ∀ ε : ℝ, 0 < ε → ε < 1 / 2 → ∀ᶠ n : ℕ in atTop, ∃ G : SimpleGraph (Fin n), + IsLocallyRamsey G + ⌈(2 : ℝ) ^ ((2 : ℝ) ^ (Real.logb 2 (Real.logb 2 n) ^ (1 / 2 + ε)))⌉₊ + ⌈Real.logb 2 n⌉₊ := by + sorry + +end Erdos805 diff --git a/FormalConjectures/ErdosProblems/81.lean b/FormalConjectures/ErdosProblems/81.lean new file mode 100644 index 0000000..605ee15 --- /dev/null +++ b/FormalConjectures/ErdosProblems/81.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 81 + +*References:* +- [erdosproblems.com/81](https://www.erdosproblems.com/81) +- [EOZ93] Erdős, Paul and Ordman, Edward T. and Zalcstein, Yechezkel, + *Clique partitions of chordal graphs*. Combin. Probab. Comput. (1993), 409–415. +- [CEO94] Chen, Guan-Tao and Erdős, Paul and Ordman, Edward T., + *Clique partitions of split graphs*. Combinatorics, graph theory, algorithms and applications + (Beijing, 1993) (1994), 21–30. +-/ + +@[expose] public section + +namespace Erdos81 + +open SimpleGraph + +/-- 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? -/ +@[category research open, question, AMS 5] +theorem erdos_81 : + ∃ C : ℝ, ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), G.IsChordal → + ∃ P : Finset (Finset (Fin n)), G.IsCliqueEdgePartition P ∧ + (P.card : ℝ) ≤ (n : ℝ) ^ 2 / 6 + C * n := by + sorry + +/-- Chen, Erdős, and Ordman [CEO94] have shown that any split graph can be partitioned +into $\frac{3}{16}n^2+O(n)$ many cliques. -/ +@[category research solved, AMS 5] +theorem erdos_81.variants.split : + ∃ C : ℝ, ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), G.IsSplitGraph → + ∃ P : Finset (Finset (Fin n)), G.IsCliqueEdgePartition P ∧ + (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 0000000..51b1ff6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/810.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 810 + +*References:* +- [erdosproblems.com/810](https://www.erdosproblems.com/810) +- [BEGS89] Burr, S. A., Erdős, P., Graham, R. L., and Sós, V. T., + *Maximal anti-Ramsey graphs and the strong chromatic number*. + J. Graph Theory 13 (1989), no. 3, 263–282. +- [Er91] Erdős, P., *Problems and results in combinatorial analysis and combinatorial number + theory*. Graph theory, combinatorics, and applications, Vol. 1 (1991), 397–406. +-/ + +@[expose] public section + +namespace Erdos810 + +open Filter + +/-- Four objects are pairwise distinct. -/ +def PairwiseDistinct4 {α : Type _} (a b c d : α) : Prop := + a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d + +/-- The vertices $a,b,c,d$ form a $C_4$ in cyclic order. -/ +def IsC4 {n : ℕ} (G : SimpleGraph (Fin n)) (a b c d : Fin n) : Prop := + PairwiseDistinct4 a b c d ∧ + G.Adj a b ∧ G.Adj b c ∧ G.Adj c d ∧ G.Adj d a + +/-- An edge-colouring by $n$ colours such that reversing an edge gives the same colour and every +$C_4$ receives four distinct colours. -/ +def C4RainbowColoring {n : ℕ} (G : SimpleGraph (Fin n)) + (color : Fin n → Fin n → Fin n) : Prop := + (∀ a b, G.Adj a b → color a b = color b a) ∧ + ∀ a b c d, IsC4 G a b c d → + PairwiseDistinct4 (color a b) (color b c) (color c d) (color d a) + +/-- Does there exist some $\epsilon>0$ such that, for all sufficiently large $n$, there exists a +graph $G$ on $n$ vertices with at least $\epsilon n^2$ edges whose edges can be coloured with $n$ +colours so that every $C_4$ receives four distinct colours? -/ +@[category research open, question, AMS 5] +theorem erdos_810 : ∃ ε > 0, ∀ᶠ n in atTop, + ∃ G : SimpleGraph (Fin n), ∃ color : Fin n → Fin n → Fin n, + ε * (n : ℝ) ^ 2 ≤ (G.edgeSet.ncard : ℝ) ∧ C4RainbowColoring G color := by + sorry + +end Erdos810 diff --git a/FormalConjectures/ErdosProblems/813.lean b/FormalConjectures/ErdosProblems/813.lean new file mode 100644 index 0000000..81dde70 --- /dev/null +++ b/FormalConjectures/ErdosProblems/813.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 813 + +*References:* +- [erdosproblems.com/813](https://www.erdosproblems.com/813) +- [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. +- [BuSu23] Bucić, M. and Sudakov, B., *Large independent sets from local considerations*. + Combinatorica 43 (2023), 505-546. [arXiv:2007.03667](https://arxiv.org/abs/2007.03667) +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos813 + +/-- +Every set of $7$ vertices of `G` contains a triangle, that is, three pairwise adjacent +vertices. For $n < 7$ there is no such set, so the condition is vacuous. +-/ +def EverySevenHasTriangle {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∀ S : Finset (Fin n), S.card = 7 → ∃ t ⊆ S, G.IsNClique 3 t + +/-- +`h n` is $h(n)$: the smallest clique number of a graph on $n$ vertices in which every set of +$7$ vertices contains a triangle. The complete graph satisfies the condition, so the set is +never empty and `sInf` is a true minimum. +-/ +noncomputable def h (n : ℕ) : ℕ := + sInf {k : ℕ | ∃ G : SimpleGraph (Fin n), EverySevenHasTriangle G ∧ G.cliqueNum = k} + +/-- The complete graph on $n$ vertices satisfies the condition. -/ +@[category test, AMS 5] +theorem everySevenHasTriangle_top (n : ℕ) : + EverySevenHasTriangle (⊤ : SimpleGraph (Fin n)) := by + intro S hS + obtain ⟨t, htS, ht⟩ := Finset.exists_subset_card_eq (show 3 ≤ S.card by omega) + exact ⟨t, htS, ⟨(SimpleGraph.isClique_univ.2 rfl).subset (Set.subset_univ _), ht⟩⟩ + +/-- For $n = 7$ the graph must contain a triangle, and a triangle plus $4$ isolated vertices +has clique number $3$, so $h(7) = 3$. -/ +@[category test, AMS 5] +theorem h_seven : h 7 = 3 := by + -- The triangle on `{0, 1, 2}` together with four isolated vertices. + set G : SimpleGraph (Fin 7) := + { Adj := fun v w => v ≠ w ∧ v.val < 3 ∧ w.val < 3 + symm := by constructor; intro v w h; exact ⟨h.1.symm, h.2.2, h.2.1⟩ + loopless := by constructor; intro v h; exact h.1 rfl } with hG + have hmem3 : ∀ a : Fin 7, a ∈ ({0, 1, 2} : Finset (Fin 7)) ↔ a.val < 3 := by decide + have htri : G.IsNClique 3 ({0, 1, 2} : Finset (Fin 7)) := by + constructor + · intro a ha b hb hab + exact ⟨hab, (hmem3 a).1 ha, (hmem3 b).1 hb⟩ + · decide + have hclique : G.cliqueNum = 3 := by + refine le_antisymm ?_ (htri.card_eq ▸ htri.isClique.card_le_cliqueNum) + obtain ⟨s, hs⟩ := G.exists_isNClique_cliqueNum + rw [← hs.card_eq] + by_cases hcard : s.card ≤ 1 + · omega + · have hsub : s ⊆ ({0, 1, 2} : Finset (Fin 7)) := by + intro v hv + obtain ⟨w, hw, hne⟩ := Finset.exists_mem_ne (by omega : 1 < s.card) v + exact (hmem3 v).2 (hs.isClique hv hw hne.symm).2.1 + simpa using Finset.card_le_card hsub + have hESH : EverySevenHasTriangle G := by + intro S hS + have hU : S = Finset.univ := S.eq_univ_of_card (by simp [hS]) + exact ⟨{0, 1, 2}, hU ▸ Finset.subset_univ _, htri⟩ + have h3 : (3 : ℕ) ∈ + {k : ℕ | ∃ G : SimpleGraph (Fin 7), EverySevenHasTriangle G ∧ G.cliqueNum = k} := + ⟨G, hESH, hclique⟩ + refine le_antisymm (Nat.sInf_le h3) (le_csInf ⟨3, h3⟩ ?_) + rintro k ⟨G', hG', rfl⟩ + obtain ⟨t, -, ht⟩ := hG' Finset.univ (by simp) + exact ht.card_eq ▸ ht.isClique.card_le_cliqueNum + +/-- +Let $h(n)$ be minimal such that every graph on $n$ vertices where every set of $7$ vertices +contains a triangle must contain a clique on at least $h(n)$ vertices. Estimate $h(n)$. In +particular, do there exist constants $c_1, c_2 > 0$ such that +$$n^{1/3+c_1} \ll h(n) \ll n^{1/2-c_2}?$$ + +The lower half has a positive answer (`Erdos813.erdos_813.variants.lower`); the upper half is +`Erdos813.erdos_813.variants.upper`. +-/ +@[category research open, question, AMS 5] +theorem erdos_813 : + ∃ c₁ > (0 : ℝ), ∃ c₂ > (0 : ℝ), + (fun n : ℕ ↦ (n : ℝ) ^ (1 / 3 + c₁ : ℝ)) =O[atTop] (fun n ↦ (h n : ℝ)) ∧ + (fun n : ℕ ↦ (h n : ℝ)) =O[atTop] (fun n : ℕ ↦ (n : ℝ) ^ (1 / 2 - c₂ : ℝ)) := by + sorry + +/-- +Erdős and Hajnal proved (see [Er91]) that +$$n^{1/3} \ll h(n) \ll n^{1/2}.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_813.variants.erdos_hajnal : + (fun n : ℕ ↦ (n : ℝ) ^ (1 / 3 : ℝ)) =O[atTop] (fun n ↦ (h n : ℝ)) ∧ + (fun n : ℕ ↦ (h n : ℝ)) =O[atTop] (fun n : ℕ ↦ (n : ℝ) ^ (1 / 2 : ℝ)) := by + sorry + +/-- +Bucić and Sudakov [BuSu23] proved that $h(n) \gg n^{5/12-o(1)}$. Their result is stated for +graphs in which every $7$ vertices contain an independent set of size $3$; it applies to $h$ +by taking complements. +-/ +@[category research solved, AMS 5] +theorem erdos_813.variants.bucic_sudakov : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, (n : ℝ) ^ (5 / 12 - ε : ℝ) ≤ (h n : ℝ) := by + sorry + +/-- +The lower half of `Erdos813.erdos_813` has a positive answer: there is a constant $c_1 > 0$ +with $n^{1/3+c_1} \ll h(n)$. This follows from the bound $h(n) \gg n^{5/12-o(1)}$ of Bucić and +Sudakov [BuSu23], since $5/12 > 1/3$. +-/ +@[category research solved, question, AMS 5] +theorem erdos_813.variants.lower : + ∃ c₁ > (0 : ℝ), (fun n : ℕ ↦ (n : ℝ) ^ (1 / 3 + c₁ : ℝ)) =O[atTop] (fun n ↦ (h n : ℝ)) := by + sorry + +/-- +The upper half of `Erdos813.erdos_813`: is there a constant $c_2 > 0$ with +$h(n) \ll n^{1/2-c_2}$? +-/ +@[category research open, question, AMS 5] +theorem erdos_813.variants.upper : + ∃ c₂ > (0 : ℝ), (fun n : ℕ ↦ (h n : ℝ)) =O[atTop] (fun n : ℕ ↦ (n : ℝ) ^ (1 / 2 - c₂ : ℝ)) := by + sorry + +end Erdos813 diff --git a/FormalConjectures/ErdosProblems/819.lean b/FormalConjectures/ErdosProblems/819.lean new file mode 100644 index 0000000..9deed0b --- /dev/null +++ b/FormalConjectures/ErdosProblems/819.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 819 + +*References:* +- [erdosproblems.com/819](https://www.erdosproblems.com/819) +- [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. +- [ErFr91] Erdős, P. and Freud, R., *On sums of a Sidon-sequence*. J. Number Theory 38 (1991), + 196-205. +-/ + +@[expose] public section + +open Filter Asymptotics +open scoped Finset Pointwise + +namespace Erdos819 + +/-- $f(N)$ is the maximum of $\lvert (A + A) \cap [1, N] \rvert$ over all +$A \subseteq \{1, \ldots, N\}$ with $\lvert A \rvert = \lfloor N^{1/2} \rfloor$, where +$\lfloor N^{1/2} \rfloor$ is `Nat.sqrt N`. Such sets exist for every $N$, since +$\lfloor N^{1/2} \rfloor \leq N$, so the maximum is over a nonempty family. -/ +def f (N : ℕ) : ℕ := + (Finset.powersetCard (Nat.sqrt N) (Finset.Icc 1 N)).sup + fun A ↦ #((A + A) ∩ Finset.Icc 1 N) + +/-- Trivial upper bound: $f(N) \leq N$. -/ +@[category API, AMS 5 11] +theorem f_le (N : ℕ) : f N ≤ N := by + refine Finset.sup_le fun A _ ↦ ?_ + calc #((A + A) ∩ Finset.Icc 1 N) ≤ #(Finset.Icc 1 N) := + Finset.card_le_card Finset.inter_subset_right + _ = N := by simp + +/-- Every sum $a + b$ with $a, b \in A$ comes from an unordered pair $\{a, b\}$, so +$\lvert A + A\rvert \leq \binom{\lvert A\rvert + 1}{2}$. -/ +@[category API, AMS 5 11] +theorem card_add_self_le (A : Finset ℕ) : #(A + A) ≤ (#A + 1).choose 2 := by + rw [← Finset.card_sym2] + calc #(A + A) ≤ #(A.sym2.image (Sym2.lift ⟨fun a b ↦ a + b, fun a b ↦ add_comm a b⟩)) := by + refine Finset.card_le_card fun x hx ↦ ?_ + obtain ⟨a, ha, b, hb, rfl⟩ := Finset.mem_add.1 hx + exact Finset.mem_image.2 ⟨s(a, b), Finset.mk_mem_sym2_iff.2 ⟨ha, hb⟩, rfl⟩ + _ ≤ #A.sym2 := Finset.card_image_le + +/-- With $k = \lfloor N^{1/2} \rfloor$, we have $f(N) \leq \binom{k+1}{2} = (k^2 + k)/2$, and +$k^2 \leq N$, $k \leq N^{1/2}$. -/ +@[category API, AMS 5 11] +theorem f_le_half_add_sqrt (N : ℕ) : (f N : ℝ) ≤ (N + Real.sqrt N) / 2 := by + have hf : f N ≤ (Nat.sqrt N + 1).choose 2 := by + refine Finset.sup_le fun A hA ↦ ?_ + rw [← (Finset.mem_powersetCard.1 hA).2] + exact (Finset.card_le_card Finset.inter_subset_left).trans (card_add_self_le A) + have hsq : ((Nat.sqrt N : ℕ) : ℝ) ^ 2 ≤ N := by exact_mod_cast Nat.sqrt_le' N + have hle : ((Nat.sqrt N : ℕ) : ℝ) ≤ Real.sqrt N := Real.nat_sqrt_le_real_sqrt + calc (f N : ℝ) ≤ ((Nat.sqrt N + 1).choose 2 : ℕ) := by exact_mod_cast hf + _ = ((Nat.sqrt N : ℝ) ^ 2 + Nat.sqrt N) / 2 := by + rw [Nat.cast_choose_two]; push_cast; ring + _ ≤ (N + Real.sqrt N) / 2 := by linarith + +def erdos_819.answer : ℕ → ℝ := sorry + +/-- +Let $f(N)$ be maximal such that there exists $A\subseteq \{1,\ldots,N\}$ with +$\lvert A\rvert=\lfloor N^{1/2}\rfloor$ such that $\lvert (A+A)\cap [1,N]\rvert=f(N)$. +Estimate $f(N)$. +-/ +@[category research open, question value, AMS 5 11] +theorem erdos_819 : (fun N ↦ (f N : ℝ)) ~[atTop] erdos_819.answer := by + sorry + +/-- +Erdős and Freud [ErFr91] proved +$$\left(\frac{3}{8}-o(1)\right)N \leq f(N) \leq \left(\frac{1}{2}+o(1)\right)N.$$ + +This is the lower bound. +-/ +@[category research solved, AMS 5 11] +theorem erdos_819.variants.erdos_freud_lower : + ∀ ε > (0 : ℝ), ∀ᶠ N : ℕ in atTop, (3 / 8 - ε) * N ≤ (f N : ℝ) := by + sorry + +/-- +Erdős and Freud [ErFr91] proved +$$\left(\frac{3}{8}-o(1)\right)N \leq f(N) \leq \left(\frac{1}{2}+o(1)\right)N.$$ + +This is the upper bound. +-/ +@[category research solved, AMS 5 11] +theorem erdos_819.variants.erdos_freud_upper : + ∀ ε > (0 : ℝ), ∀ᶠ N : ℕ in atTop, (f N : ℝ) ≤ (1 / 2 + ε) * N := by + intro ε hε + filter_upwards [eventually_ge_atTop ⌈1 / (4 * ε ^ 2)⌉₊] with N hN + have hN' : 1 / (4 * ε ^ 2) ≤ (N : ℝ) := (Nat.le_ceil _).trans (by exact_mod_cast hN) + have h1 : 1 ≤ 4 * ε ^ 2 * N := by + rw [div_le_iff₀ (by positivity)] at hN' + linarith + -- $\sqrt{N} \leq 2\varepsilon N$, since $N \leq (2\varepsilon N)^2$ once $4\varepsilon^2 N \geq 1$. + have hs : Real.sqrt N ≤ 2 * ε * N := by + rw [Real.sqrt_le_left (by positivity)] + nlinarith [(Nat.cast_nonneg N : (0 : ℝ) ≤ N)] + linarith [f_le_half_add_sqrt N] + +end Erdos819 diff --git a/FormalConjectures/ErdosProblems/820.lean b/FormalConjectures/ErdosProblems/820.lean new file mode 100644 index 0000000..857b5ce --- /dev/null +++ b/FormalConjectures/ErdosProblems/820.lean @@ -0,0 +1,180 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 820 + +*References:* +- [erdosproblems.com/820](https://www.erdosproblems.com/820) +- [Er74b] Erdős, P., *Remarks on some problems in number theory*. Math. Balkanica (1974), + 197-202. +- [OEIS A263647](https://oeis.org/A263647): the $n$ with $(2^n-1, 3^n-1) = 1$. +-/ + +@[expose] public section + +open Filter + +namespace Erdos820 + +/-- $H(n)$ is the smallest integer $l$ such that there is some $k < l$ with +$(k^n-1, l^n-1) = 1$. + +We take $k$ and $l$ to be integers with $k \geq 2$, so that $k^n - 1 \geq 1$ for $n \geq 1$. +Smaller $k$ give degenerate values: over the integers $k = 0$ gives $(-1, l^n-1) = 1$, and $k = 1$ +gives $(0, l^n-1) = l^n-1$, which is $1$ for $n = 1$, $l = 2$. Both would contradict the value +$H(1) = 3$ listed in the source. + +For $n \geq 1$ the set is nonempty (see `Erdos820.H_spec`). For $n = 0$ it is empty, and +`H 0 = 0` by the `sInf ∅` convention; the only statement whose truth depends on `H 0` is +`Erdos820.H_eq_three_iff`, where both sides are false. -/ +noncomputable def H (n : ℕ) : ℕ := + sInf {l : ℕ | ∃ k : ℕ, 2 ≤ k ∧ k < l ∧ Nat.Coprime (k ^ n - 1) (l ^ n - 1)} + +/-- $K(n)$ is the smallest integer $k \geq 2$ such that $(k^n-1, 2^n-1) = 1$. As for +`Erdos820.H`, smaller $k$ are excluded because they give degenerate values. + +For $n \geq 2$ the value $k = 2$ never works, and $k = 2^n - 1$ always works. For $n = 1$ we +get $K(1) = 2$, and for $n = 0$ the set is empty, so `K 0 = 0`. -/ +noncomputable def K (n : ℕ) : ℕ := + sInf {k : ℕ | 2 ≤ k ∧ Nat.Coprime (k ^ n - 1) (2 ^ n - 1)} + +/-- For $n \geq 1$ the minimum defining $H(n)$ is attained: there is $k$ with $2 \leq k < H(n)$ +and $(k^n-1, H(n)^n-1) = 1$. For $n \geq 2$, the pair $k = 2$, $l = 2^n - 1$ shows that the set +is nonempty. For $n = 1$, take $k = 2$, $l = 3$. -/ +@[category API, AMS 11] +theorem H_spec {n : ℕ} (hn : 1 ≤ n) : + ∃ k : ℕ, 2 ≤ k ∧ k < H n ∧ Nat.Coprime (k ^ n - 1) (H n ^ n - 1) := by + have hne : {l : ℕ | ∃ k : ℕ, 2 ≤ k ∧ k < l ∧ Nat.Coprime (k ^ n - 1) (l ^ n - 1)}.Nonempty := by + obtain rfl | hn2 := hn.eq_or_lt + · exact ⟨3, 2, le_rfl, by norm_num, by decide⟩ + · have h4 : 4 ≤ 2 ^ n := + calc 4 = 2 ^ 2 := by norm_num + _ ≤ 2 ^ n := Nat.pow_le_pow_right (by norm_num) hn2 + refine ⟨2 ^ n - 1, 2, le_rfl, by omega, ?_⟩ + have h1 : 1 ≤ (2 ^ n - 1) ^ n := Nat.one_le_pow _ _ (by omega) + exact Nat.Coprime.coprime_dvd_left (dvd_pow_self _ (by omega)) + ((Nat.coprime_self_sub_right h1).2 (Nat.coprime_one_right _)) + exact Nat.sInf_mem hne + +/-- $H(n) = 3$ if and only if $(2^n-1, 3^n-1) = 1$. This holds for every $n$, including +$n = 0$, where both sides are false. -/ +@[category API, AMS 11] +theorem H_eq_three_iff (n : ℕ) : H n = 3 ↔ Nat.Coprime (2 ^ n - 1) (3 ^ n - 1) := by + constructor + · intro h + have hne : {l : ℕ | ∃ k : ℕ, 2 ≤ k ∧ k < l ∧ Nat.Coprime (k ^ n - 1) (l ^ n - 1)}.Nonempty := + Nat.nonempty_of_pos_sInf (by unfold H at h; omega) + have hmem : H n ∈ {l : ℕ | ∃ k : ℕ, 2 ≤ k ∧ k < l ∧ Nat.Coprime (k ^ n - 1) (l ^ n - 1)} := + Nat.sInf_mem hne + rw [h] at hmem + obtain ⟨k, hk2, hk3, hk⟩ := hmem + obtain rfl : k = 2 := by omega + exact hk + · intro h + unfold H + refine le_antisymm (Nat.sInf_le ⟨2, le_rfl, by norm_num, h⟩) + (le_csInf ⟨3, 2, le_rfl, by norm_num, h⟩ ?_) + rintro l ⟨k, hk2, hkl, -⟩ + omega + +/-- The first values of $H(n)$, for $1 \leq n \leq 10$, are $3, 3, 3, 6, 3, 18, 3, 6, 3, 12$. -/ +@[category test, AMS 11] +theorem H_one_to_ten : + H 1 = 3 ∧ H 2 = 3 ∧ H 3 = 3 ∧ H 4 = 6 ∧ H 5 = 3 ∧ H 6 = 18 ∧ H 7 = 3 ∧ H 8 = 6 ∧ + H 9 = 3 ∧ H 10 = 12 := by + have key : ∀ n m : ℕ, (∃ k, 2 ≤ k ∧ k < m ∧ Nat.Coprime (k ^ n - 1) (m ^ n - 1)) → + (∀ l < m, ∀ k < l, 2 ≤ k → ¬ Nat.Coprime (k ^ n - 1) (l ^ n - 1)) → H n = m := by + intro n m hm hlt + unfold H + refine le_antisymm (Nat.sInf_le hm) (le_csInf ⟨m, hm⟩ ?_) + rintro l ⟨k, hk2, hkl, hk⟩ + by_contra! h + exact hlt l h k hkl hk2 hk + have three (n : ℕ) (h : Nat.Coprime (2 ^ n - 1) (3 ^ n - 1)) : H n = 3 := + (H_eq_three_iff n).2 h + exact ⟨three 1 (by decide), three 2 (by decide), three 3 (by decide), + key 4 6 ⟨5, by decide⟩ (by decide +kernel), three 5 (by decide), + key 6 18 ⟨14, by decide⟩ (by decide +kernel), three 7 (by decide), + key 8 6 ⟨5, by decide⟩ (by decide +kernel), three 9 (by decide), + key 10 12 ⟨11, by decide⟩ (by decide +kernel)⟩ + +/-- +Let $H(n)$ be the smallest integer $l$ such that there exists $k < l$ with $(k^n-1, l^n-1) = 1$. +Is it true that $H(n) = 3$ infinitely often? That is, is $(2^n-1, 3^n-1) = 1$ for infinitely +many $n$ (see `Erdos820.H_eq_three_iff`)? + +The request to estimate $H(n)$ is open-ended and not formalised; the variants below state the +specific questions that are asked. See also Erdős Problem 770. +-/ +@[category research open, question, AMS 11] +theorem erdos_820 : {n : ℕ | H n = 3}.Infinite := by + sorry + +/-- +Is it true that there exists some constant $c > 0$ such that, for all $\epsilon > 0$, +$$ +H(n) > \exp\left(n^{(c-\epsilon)/\log\log n}\right) +$$ +for infinitely many $n$ and +$$ +H(n) < \exp\left(n^{(c+\epsilon)/\log\log n}\right) +$$ +for all large enough $n$? +-/ +@[category research open, question, AMS 11] +theorem erdos_820.variants.log_log_exponent : + ∃ c > (0 : ℝ), ∀ ε > (0 : ℝ), + (∃ᶠ n : ℕ in atTop, + Real.exp ((n : ℝ) ^ ((c - ε) / Real.log (Real.log (n : ℝ)))) < (H n : ℝ)) ∧ + ∀ᶠ n : ℕ in atTop, + (H n : ℝ) < Real.exp ((n : ℝ) ^ ((c + ε) / Real.log (Real.log (n : ℝ)))) := by + sorry + +/-- +Let $K(n)$ be the smallest $k$ such that $(k^n-1, 2^n-1) = 1$. Does a similar upper bound hold +for $K(n)$? That is, is there a constant $c > 0$ such that, for all $\epsilon > 0$, +$$ +K(n) < \exp\left(n^{(c+\epsilon)/\log\log n}\right) +$$ +for all large enough $n$? + +We read "similar" as an upper bound of the same shape, with its own constant $c$, which need +not be the same as in `Erdos820.erdos_820.variants.log_log_exponent`. +-/ +@[category research open, question, AMS 11] +theorem erdos_820.variants.two_pow_upper : + ∃ c > (0 : ℝ), ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, + (K n : ℝ) < Real.exp ((n : ℝ) ^ ((c + ε) / Real.log (Real.log (n : ℝ)))) := by + sorry + +/-- +Erdős [Er74b] proved that there exists a constant $c > 0$ such that +$$ +H(n) > \exp\left(n^{c/(\log\log n)^2}\right) +$$ +for infinitely many $n$. +-/ +@[category research solved, AMS 11] +theorem erdos_820.variants.erdos_lower : + ∃ c > (0 : ℝ), ∃ᶠ n : ℕ in atTop, + Real.exp ((n : ℝ) ^ (c / Real.log (Real.log (n : ℝ)) ^ 2)) < (H n : ℝ) := by + sorry + +end Erdos820 diff --git a/FormalConjectures/ErdosProblems/824.lean b/FormalConjectures/ErdosProblems/824.lean new file mode 100644 index 0000000..7dfddeb --- /dev/null +++ b/FormalConjectures/ErdosProblems/824.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 824 + +*References:* +- [erdosproblems.com/824](https://www.erdosproblems.com/824) +- [Er59c] Erdős, P., *Remarks on number theory. II. Some problems on the $\sigma$ function*. + Acta Arith. (1959), 171--177. +- [Er74b] Erdős, P., *Remarks on some problems in number theory*. Math. Balkanica (1974), + 197-202. +- [PoPo16] Pollack, Paul and Pomerance, Carl, *Some problems of Erdős on the sum-of-divisors + function*. Trans. Amer. Math. Soc. Ser. B (2016), 1-26. +- [LiZh26] Li, Shisheng and Zhuang, Zhong, *Coprime pairs with equal sum of divisors, assuming + smooth shifted primes*. Preprint (October 2026). + [github.com/daizisheng/erdos-824](https://github.com/daizisheng/erdos-824/blob/b4b7099bb8ab9c1c7fc61dae18a73cdbe503fe5a/paper/erdos824.pdf) +- [OpenAI26] OpenAI, *Weighted dilation graphs, smooth shifted primes and totient fibers*. + OpenAI Math Release preprint (September 2026). + [github.com/openai/math](https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/Weighted-Dilation-Graphs-Smooth-Shifted-Primes-and-Totient-Fibers-September-24-2026/paper.pdf) +-/ + +@[expose] public section + +open Filter +open scoped ArithmeticFunction.sigma + +namespace Erdos824 + +/-- `h x` is the number of pairs of integers $1 \leq a < b < x$ such that $(a, b) = 1$ and +$\sigma(a) = \sigma(b)$, where $\sigma$ is the sum of divisors function. + +We take $x$ to be a natural number. For real $x$ the count equals `h ⌈x⌉`, so the asymptotic +statements below do not change. -/ +def h (x : ℕ) : ℕ := + ((Finset.Ico 1 x ×ˢ Finset.Ico 1 x).filter fun (a, b) ↦ + a < b ∧ a.Coprime b ∧ σ 1 a = σ 1 b).card + +/-- `hSquarefree x` is the number of pairs of integers $1 \leq a < b < x$ such that $a$ and $b$ +are squarefree and $\sigma(a) = \sigma(b)$. -/ +def hSquarefree (x : ℕ) : ℕ := + ((Finset.Ico 1 x ×ˢ Finset.Ico 1 x).filter fun (a, b) ↦ + a < b ∧ Squarefree a ∧ Squarefree b ∧ σ 1 a = σ 1 b).card + +/-- +Let $h(x)$ count the number of integers $1\leq ax^{2-o(1)}$? + +That is, is it true that for every $\epsilon > 0$ we have $h(x) > x^{2-\epsilon}$ for all large +$x$? According to erdosproblems.com, Erdős [Er74b] proved that $\limsup h(x)/x = \infty$ and +claimed a similar proof for this problem. +-/ +@[category research solved, question, AMS 11, + formal_proof using lean4 at "https://github.com/cadamcat/equal-divisor-sums-lean4/blob/6280393739de142f3c54160ce7083110ed55f194/Erdos824/Theorem.lean#L17"] +theorem erdos_824 : + ∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℕ in atTop, (x : ℝ) ^ (2 - ε) < (h x : ℝ) := by + sorry + +/-- +Pollack and Pomerance [PoPo16, Section 6] proved that $h(x)/x \to \infty$, answering a question +of Erdős [Er59c]. +-/ +@[category research solved, AMS 11] +theorem erdos_824.variants.pollack_pomerance : + Tendsto (fun x : ℕ ↦ (h x : ℝ) / (x : ℝ)) atTop atTop := by + sorry + +/-- +A similar question can be asked if the condition $(a,b)=1$ is replaced by the condition that $a$ +and $b$ are squarefree. Let $h'(x)$ count the number of squarefree integers $1\leq ax^{2-o(1)}$? +-/ +@[category research open, question, AMS 11] +theorem erdos_824.variants.squarefree : + ∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℕ in atTop, (x : ℝ) ^ (2 - ε) < (hSquarefree x : ℝ) := by + sorry + +end Erdos824 diff --git a/FormalConjectures/ErdosProblems/826.lean b/FormalConjectures/ErdosProblems/826.lean index 2dc6381..fefcab4 100644 --- a/FormalConjectures/ErdosProblems/826.lean +++ b/FormalConjectures/ErdosProblems/826.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 826 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/826](https://www.erdosproblems.com/826) -/ +@[expose] public section + open scoped ArithmeticFunction.sigma namespace Erdos826 @@ -32,8 +35,8 @@ $$ \tau(n + k) \ll k? $$ -/ -@[category research open, AMS 11] -theorem erdos_826 : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_826 : ∃ C > (0 : ℝ), { n | ∀ k ≥ 1, σ 0 (n + k) ≤ C * k }.Infinite := by sorry diff --git a/FormalConjectures/ErdosProblems/827.lean b/FormalConjectures/ErdosProblems/827.lean new file mode 100644 index 0000000..d584be1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/827.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 827 + +*References:* +- [erdosproblems.com/827](https://www.erdosproblems.com/827) +- [Er75h] Erdős, P., *Some problems on elementary geometry*. Austral. Math. Soc. Gaz. 2 (1975), + 2-3. +- [Er78c] Erdős, P., *Some more problems on elementary geometry*. Austral. Math. Soc. Gaz. 5 + (1978), 52-54. +- [MaRo15] Martínez, L. and Roldán-Pensado, E., *Points defining triangles with distinct + circumradii*. Acta Math. Hungar. 145 (2015), 136-141. + [arXiv:1402.6276](https://arxiv.org/abs/1402.6276) +-/ + +@[expose] public section + +open Filter Asymptotics EuclideanGeometry + +namespace Erdos827 + +/-- The points of `S` lie on a circle of radius `r`. -/ +def OnCircleOfRadius (S : Finset ℝ²) (r : ℝ) : Prop := + ∃ c : ℝ², ∀ p ∈ S, dist p c = r + +/-- Distinct triples of points of `S` never lie on circles of the same radius. For a set with no +three collinear points, every triple lies on exactly one circle, so this says that the +$\binom{|S|}{3}$ circumradii are pairwise different. -/ +def HasDistinctCircumradii (S : Finset ℝ²) : Prop := + ∀ T ⊆ S, ∀ T' ⊆ S, T.card = 3 → T'.card = 3 → T ≠ T' → + ∀ r : ℝ, OnCircleOfRadius T r → ¬ OnCircleOfRadius T' r + +/-- $n_k$: the least $m$ such that every set of $m$ points of $\mathbb{R}^2$ in general position +(no three collinear, no four concyclic) contains $k$ points whose $\binom{k}{3}$ triples +determine circles of pairwise different radii. By [MaRo15] such an $m$ exists for every $k$, so +`sInf` is a true minimum. -/ +noncomputable def n (k : ℕ) : ℕ := + sInf {m : ℕ | ∀ X : Finset ℝ², X.card = m → InGeneralPosition (X : Set ℝ²) → + ∃ Y ⊆ X, Y.card = k ∧ HasDistinctCircumradii Y} + +/-- If every set of `m` points in general position contains `k` points with pairwise different +circumradii, then $n_k \leq m$. -/ +@[category API, AMS 52] +theorem n_le {k m : ℕ} + (h : ∀ X : Finset ℝ², X.card = m → InGeneralPosition (X : Set ℝ²) → + ∃ Y ⊆ X, Y.card = k ∧ HasDistinctCircumradii Y) : + n k ≤ m := + Nat.sInf_le h + +def erdos_827.answer : ℕ → ℕ := sorry + +/-- +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. + +Determine $n_k$. + +General position means that no three points are collinear and no four are concyclic, as in +[Er75h] (quoted in [MaRo15]). +-/ +@[category research open, question value, AMS 52] +theorem erdos_827 : n = erdos_827.answer := by + sorry + +/-- +In [Er78c] Erdős gave an argument for $n_k \leq k+2\binom{k-1}{2}\binom{k-1}{3}$, but this +argument is incorrect, as explained by Martínez and Roldán-Pensado [MaRo15], who give a corrected +argument that proves $n_k\ll k^9$. + +[MaRo15, Theorem 1.1] assumes only that no four points lie on a line or a circle. That class +contains the sets in general position, so the bound holds for $n_k$ as defined here. +-/ +@[category research solved, AMS 52] +theorem erdos_827.variants.martinez_roldan_pensado : + (fun k : ℕ ↦ (n k : ℝ)) =O[atTop] fun k : ℕ ↦ (k : ℝ) ^ 9 := by + sorry + +/-- +Martínez and Roldán-Pensado [MaRo15, Theorem 1.2] show that $n_4 \leq 9$. +-/ +@[category research solved, AMS 52] +theorem erdos_827.variants.n_four_le : n 4 ≤ 9 := by + sorry + +/-- +Martínez and Roldán-Pensado [MaRo15, Theorem 1.2] show that $n_5 \leq 37$. +-/ +@[category research solved, AMS 52] +theorem erdos_827.variants.n_five_le : n 5 ≤ 37 := by + sorry + +end Erdos827 diff --git a/FormalConjectures/ErdosProblems/830.lean b/FormalConjectures/ErdosProblems/830.lean index fb8f499..7c86574 100644 --- a/FormalConjectures/ErdosProblems/830.lean +++ b/FormalConjectures/ErdosProblems/830.lean @@ -13,15 +13,24 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 830 -*Reference:* [erdosproblems.com/830](https://www.erdosproblems.com/830) +*References:* +- [erdosproblems.com/830](https://www.erdosproblems.com/830) +- [Er55b] Erdős, P., *On amicable numbers*. Publ. Math. Debrecen (1955), 108-111. +- [Gu04] Guy, Richard K., *Unsolved problems in number theory*. (2004), xviii+437. +- [Po15] Pomerance, Carl, *On amicable numbers*. (2015), 321-327. +- [Po81] Pomerance, Carl, *On the distribution of amicable numbers. II*. J. Reine Angew. Math. + (1981), 183-188. -/ +@[expose] public section + open scoped ArithmeticFunction.sigma open Filter Real @@ -29,18 +38,17 @@ namespace Erdos830 open scoped Classical in /-- -Let $A(x)$ counts the number of amicable $1\leq a\leq b\leq x$. +Let $A(x)$ count the number of amicable pairs $1\leq a\leq b\leq x$. -/ noncomputable abbrev A (x : ℝ) : ℝ := - Finset.card <| (Finset.Icc 1 ⌊x⌋₊ ×ˢ Finset.Icc 1 ⌊x⌋₊).filter fun (a, b) ↦ - a ≤ b ∧ IsAmicable a b + ((Finset.Icc 1 ⌊x⌋₊ ×ˢ Finset.Icc 1 ⌊x⌋₊).filter fun (a, b) ↦ a ≤ b ∧ IsAmicable a b).card /-- **Erdos Problem 830, Part 1** We say that $a,b\in \mathbb{N}$ are an amicable pair if $\sigma(a)=\sigma(b)=a+b$. Are there infinitely many amicable pairs? -/ -@[category research open, AMS 11] -theorem erdos_830.parts.i : answer(sorry) ↔ {(a, b) | IsAmicable a b}.Infinite := by +@[category research open, question, AMS 11] +theorem erdos_830.parts.i : {(a, b) | IsAmicable a b}.Infinite := by sorry /-- **Erdos Problem 830, Part 2** @@ -48,8 +56,8 @@ We say that $a,b\in \mathbb{N}$ are an amicable pair if $\sigma(a)=\sigma(b)=a+b If $A(x)$ counts the number of amicable $1\leq a\leq b\leq x$ then is it true that $$A(x) > x^{1-o(1)}?$$ -/ -@[category research open, AMS 11] -theorem erdos_830.parts.ii : answer(sorry) ↔ ∃ o : ℝ → ℝ, o =o[atTop] (1 : ℝ → ℝ) ∧ ∀ᶠ x in atTop, +@[category research open, question, AMS 11] +theorem erdos_830.parts.ii : ∃ o : ℝ → ℝ, o =o[atTop] (1 : ℝ → ℝ) ∧ ∀ᶠ x in atTop, x ^ (1 - o x) < A x := by sorry @@ -73,12 +81,13 @@ theorem erdos_830.variants.pomerance : ∀ᶠ x in atTop, A x ≤ x * rexp (- Re /-- We say that $a,b\in \mathbb{N}$ are an amicable pair if $\sigma(a)=\sigma(b)=a+b$. If $A(x)$ counts the number of amicable $1\leq a\leq b\leq x$ then one can show that -$A(x) \leq x \exp(-(\tfrac{1}{2}+o(1))(\log x\log\log x)^{1/2})$. +$A(x) \leq x \exp(-(\tfrac{1}{2}+o(1))(\log x\log\log\log x)^{1/2})$. +(erdosproblems.com has $\log\log x$; [Po15, Theorem 1.1] has $\log\log\log x$.) -/ @[category research solved, AMS 11] theorem erdos_830.variants.pomerance_stronger : ∃ o : ℝ → ℝ, o =o[atTop] (1 : ℝ → ℝ) ∧ - ∀ᶠ x in atTop, A x ≤ x * rexp (- (1/ 2 + o x) * √(x.log * x.log.log)) := by + ∀ᶠ x in atTop, A x ≤ x * rexp (- (1/ 2 + o x) * √(x.log * x.log.log.log)) := by sorry end Erdos830 diff --git a/FormalConjectures/ErdosProblems/837.lean b/FormalConjectures/ErdosProblems/837.lean new file mode 100644 index 0000000..1f7720c --- /dev/null +++ b/FormalConjectures/ErdosProblems/837.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 837 + +*References:* +- [erdosproblems.com/837](https://www.erdosproblems.com/837) +-/ + +@[expose] public section + +namespace Erdos837 + +open Filter Asymptotics + +def erdos_837.answer : Set ℝ := sorry + +/-- +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{\lvert G_n\rvert}{k}} >\alpha$$ +then there exist subgraphs $H_n\subseteq G_n$ such that $\lvert H_n\rvert \to \infty$ and +$$\liminf \frac{e(H_n)}{\binom{\lvert H_n\rvert}{k}} >\beta,$$ +and further that this property does not necessarily hold if $>\alpha$ is replaced by $\geq \alpha$. +What is $A_3$? +-/ +@[category research open, question value, AMS 5] +theorem erdos_837 : + {α : ℝ | α ∈ Set.Icc 0 1 ∧ ∃ β : ℝ, α < β ∧ + Hypergraph.HasDensityJump 3 α β true ∧ ¬ Hypergraph.HasDensityJump 3 α β false} + = erdos_837.answer := by + sorry + +end Erdos837 diff --git a/FormalConjectures/ErdosProblems/839.lean b/FormalConjectures/ErdosProblems/839.lean new file mode 100644 index 0000000..698b72d --- /dev/null +++ b/FormalConjectures/ErdosProblems/839.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 839 + +*References:* +- [erdosproblems.com/839](https://www.erdosproblems.com/839) +- [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). + +See also [Erdős Problem 359](https://www.erdosproblems.com/359) and +[Erdős Problem 867](https://www.erdosproblems.com/867). +-/ + +@[expose] public section + +open Filter Real Finset +open scoped ENNReal + +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, question, AMS 11] +theorem erdos_839.parts.i : + ∀ (a : ℕ → ℕ), (∀ n, 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a → + atTop.limsup (fun n : ℕ => (a n : ℝ≥0∞) / 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$? + +This is equivalent to asking whether the range $\{a_1,a_2,\ldots\}$ has logarithmic density zero +(see `Set.HasLogDensity`). +-/ +@[category research open, question, AMS 11] +theorem erdos_839.parts.ii : + ∀ (a : ℕ → ℕ), (∀ n, 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a → + Set.HasLogDensity (Set.range a) 0 := by + sorry + +-- TODO: Formalize the additional material on the possible lower limit, reciprocal-sum growth, +-- upper-density constructions, and the links with Erdős Problems 359 and 867. + +end Erdos839 diff --git a/FormalConjectures/ErdosProblems/840.lean b/FormalConjectures/ErdosProblems/840.lean new file mode 100644 index 0000000..72a4c5a --- /dev/null +++ b/FormalConjectures/ErdosProblems/840.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 840 + +*References:* +- [erdosproblems.com/840](https://www.erdosproblems.com/840) +- [Er81h] Erdős, P., *Some problems and results on additive and multiplicative number theory*. + Analytic number theory (Philadelphia, Pa., 1980), Lecture Notes in Math. 899 (1981), 171-182. + [PDF](https://www.renyi.hu/~p_erdos/1981-33.pdf) +- [ErFr91] Erdős, P. and Freud, R., *On sums of a Sidon-sequence*. J. Number Theory 38 (1991), + 196-205. +- [Pi06] Pikhurko, O., *Dense edge-magic graphs and thin additive bases*. Discrete Math. 306 + (2006), 2097-2107. +-/ + +@[expose] public section + +open Filter Asymptotics +open scoped Finset Pointwise + +namespace Erdos840 + +/-- The constant $c$ is attained by quasi-Sidon sets: there are sets +$A_N \subseteq \{1, \ldots, N\}$ with $\lvert A_N\rvert = (1+o(1))cN^{1/2}$ and +$\lvert A_N+A_N\rvert=(1+o(1))\binom{\lvert A_N\rvert}{2}$ as $N \to \infty$. -/ +def IsQuasiSidonConstant (c : ℝ) : Prop := + ∃ A : ℕ → Finset ℕ, (∀ N, A N ⊆ Finset.Icc 1 N) ∧ + (fun N ↦ (#(A N) : ℝ)) ~[atTop] (fun N ↦ c * Real.sqrt N) ∧ + (fun N ↦ (#(A N + A N) : ℝ)) ~[atTop] (fun N ↦ ((#(A N)).choose 2 : ℝ)) + +/-- The constant $0$ is attained by the empty sets, so the set of attained constants is +nonempty. -/ +@[category test, AMS 5 11] +theorem isQuasiSidonConstant_zero : IsQuasiSidonConstant 0 := by + refine ⟨fun _ ↦ ∅, fun _ ↦ Finset.empty_subset _, ?_, ?_⟩ + · simpa using (IsEquivalent.refl : (fun _ : ℕ ↦ (0 : ℝ)) ~[atTop] fun _ ↦ 0) + · simpa using (IsEquivalent.refl : (fun _ : ℕ ↦ (0 : ℝ)) ~[atTop] fun _ ↦ 0) + +def erdos_840.answer : ℝ := sorry + +/-- +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 +$$\lvert A+A\rvert=(1+o(1))\binom{\lvert A\rvert}{2}.$$ +How does $f(N)$ grow? + +Following [Er81h, p. 175], we ask for the largest $c$ such that there are quasi-Sidon sets +$A \subseteq \{1, \ldots, N\}$ with $\lvert A\rvert = (1+o(1))cN^{1/2}$. +-/ +@[category research open, question value, AMS 5 11] +theorem erdos_840 : IsLUB {c : ℝ | IsQuasiSidonConstant c} erdos_840.answer := by + sorry + +/-- +Erdős and Freud [ErFr91] proved +$$\left(\frac{2}{\sqrt{3}}+o(1)\right)N^{1/2} \leq f(N) \leq \left(2+o(1)\right)N^{1/2}.$$ +(Although both bounds were already given by Erdős in [Er81h].) + +This is the lower bound. The lower bound is taking a genuine Sidon set $B\subset [1,N/3]$ of size +$\sim N^{1/2}/\sqrt{3}$ and taking the union with $\{N-b : b\in B\}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_840.variants.erdos_freud_lower : IsQuasiSidonConstant (2 / Real.sqrt 3) := by + sorry + +/-- +Erdős and Freud [ErFr91] proved +$$\left(\frac{2}{\sqrt{3}}+o(1)\right)N^{1/2} \leq f(N) \leq \left(2+o(1)\right)N^{1/2}.$$ +(Although both bounds were already given by Erdős in [Er81h].) + +This is the upper bound. +-/ +@[category research solved, AMS 5 11] +theorem erdos_840.variants.erdos_freud_upper (c : ℝ) (hc : IsQuasiSidonConstant c) : c ≤ 2 := by + by_contra! hlt + have hc0 : 0 < c := by linarith + obtain ⟨A, hAsub, hk, hs⟩ := hc + -- $cN^{1/2} \to \infty$, so the constant $1$ is negligible: $|A_N| - 1 \sim cN^{1/2}$. + have hsqrt : Tendsto (fun N : ℕ ↦ c * Real.sqrt N) atTop atTop := + Tendsto.const_mul_atTop hc0 (Real.tendsto_sqrt_atTop.comp tendsto_natCast_atTop_atTop) + have hk1 := hk.sub_isLittleO (w := fun _ ↦ (1 : ℝ)) + (isLittleO_const_left.2 (Or.inr (tendsto_norm_atTop_atTop.comp hsqrt))) + -- $\binom{|A_N|}{2} = |A_N|(|A_N|-1)/2 \sim (cN^{1/2})^2/2$. + have hC := ((hk.mul hk1).div (IsEquivalent.refl (u := fun _ : ℕ ↦ (2 : ℝ)))).congr_left + (w := fun N ↦ ((#(A N)).choose 2 : ℝ)) + (Eventually.of_forall fun N ↦ by simp only [Pi.mul_apply, Pi.sub_apply, Pi.div_apply, + Nat.cast_choose_two]) + -- Hence $|A_N + A_N|/N \to c^2/2$. + have hlim : Tendsto (fun N : ℕ ↦ (#(A N + A N) : ℝ) / N) atTop (nhds (c ^ 2 / 2)) := by + refine (((hs.trans hC).div (IsEquivalent.refl (u := fun N : ℕ ↦ (N : ℝ)))).congr_right + (w := fun _ ↦ c ^ 2 / 2) ?_).tendsto_const + filter_upwards [eventually_gt_atTop 0] with N hN + have hN' : (N : ℝ) ≠ 0 := by exact_mod_cast hN.ne' + have hsq : Real.sqrt N * Real.sqrt N = N := Real.mul_self_sqrt (Nat.cast_nonneg N) + simp only [Pi.mul_apply, Pi.div_apply] + rw [show c * Real.sqrt N * (c * Real.sqrt N) = c ^ 2 * (Real.sqrt N * Real.sqrt N) by ring, + hsq] + field_simp + -- But $A_N + A_N \subseteq [2, 2N]$, so $|A_N + A_N|/N \leq 2$. + have hbound : ∀ᶠ N : ℕ in atTop, (#(A N + A N) : ℝ) / N ≤ 2 := by + filter_upwards [eventually_gt_atTop 0] with N hN + have hsub : A N + A N ⊆ Finset.Icc 2 (2 * N) := by + intro x hx + obtain ⟨a, ha, b, hb, rfl⟩ := Finset.mem_add.1 hx + have ha' := Finset.mem_Icc.1 (hAsub N ha) + have hb' := Finset.mem_Icc.1 (hAsub N hb) + exact Finset.mem_Icc.2 ⟨by omega, by omega⟩ + have hcard : #(A N + A N) ≤ 2 * N := by + have := Finset.card_le_card hsub + rw [Nat.card_Icc] at this + omega + rw [div_le_iff₀ (by exact_mod_cast hN)] + exact_mod_cast hcard + have := le_of_tendsto hlim hbound + nlinarith + +/-- +The upper bound was improved by Pikhurko [Pi06] to +$$f(N) \leq \left(\left(\frac{1}{4}+\frac{1}{(\pi+2)^2}\right)^{-1/2}+o(1)\right)N^{1/2}$$ +(the constant here is $=1.863\cdots$). +-/ +@[category research solved, AMS 5 11] +theorem erdos_840.variants.pikhurko (c : ℝ) (hc : IsQuasiSidonConstant c) : + c ≤ (1 / 4 + 1 / (Real.pi + 2) ^ 2) ^ (-(1 : ℝ) / 2) := by + sorry + +end Erdos840 diff --git a/FormalConjectures/ErdosProblems/850.lean b/FormalConjectures/ErdosProblems/850.lean index 23052ce..d2a92f0 100644 --- a/FormalConjectures/ErdosProblems/850.lean +++ b/FormalConjectures/ErdosProblems/850.lean @@ -13,23 +13,26 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 850 *Reference:* [erdosproblems.com/850](https://www.erdosproblems.com/850) -/ +@[expose] public section + namespace Erdos850 /-- Can there exist two distinct integers $x$ and $y$ such that $x,y$ have the same prime factors, $x+1,y+1$ have the same prime factors, and $x+2,y+2$ also have the same prime factors? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_850 : - answer(sorry) ↔ ∃ x y : ℕ, x ≠ y ∧ x.primeFactors = y.primeFactors + ∃ x y : ℕ, x ≠ y ∧ x.primeFactors = y.primeFactors ∧ (x + 1).primeFactors = (y + 1).primeFactors ∧ (x + 2).primeFactors = (y + 2).primeFactors := by sorry diff --git a/FormalConjectures/ErdosProblems/852.lean b/FormalConjectures/ErdosProblems/852.lean new file mode 100644 index 0000000..9e5d231 --- /dev/null +++ b/FormalConjectures/ErdosProblems/852.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 852 + +*References:* +- [erdosproblems.com/852](https://www.erdosproblems.com/852) +- [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. +- [A001223](https://oeis.org/A001223) +- [A053597](https://oeis.org/A053597) +- [A078515](https://oeis.org/A078515) +-/ + +@[expose] public section + +open Filter + +namespace Erdos852 + +/-- The $H$ prime gaps $d_n, d_{n+1}, \ldots, d_{n+H-1}$ are pairwise distinct. + +Here $d_n = p_{n+1} - p_n$ is `primeGap n`, so the primes are indexed from $p_0 = 2$. The empty run +$H = 0$ and every run with $H = 1$ are distinct. -/ +def DistinctGapRun (n H : ℕ) : Prop := + Set.InjOn primeGap (Set.Ico n (n + H)) + +/-- The gaps $d_0, d_1 = 1, 2$ are distinct. -/ +@[category test, AMS 11] +theorem distinctGapRun_zero_two : DistinctGapRun 0 2 := by + have h0 : primeGap 0 = 1 := by simp [primeGap] + have h1 : primeGap 1 = 2 := by simp [primeGap] + intro a ha b hb hab + simp only [Set.mem_Ico] at ha hb + have ha' : a = 0 ∨ a = 1 := by omega + have hb' : b = 0 ∨ b = 1 := by omega + rcases ha' with rfl | rfl <;> rcases hb' with rfl | rfl <;> omega + +/-- The gaps $d_0, d_1, d_2 = 1, 2, 2$ are not distinct. -/ +@[category test, AMS 11] +theorem not_distinctGapRun_zero_three : ¬ DistinctGapRun 0 3 := by + have h1 : primeGap 1 = 2 := by simp [primeGap] + have h2 : primeGap 2 = 2 := by simp [primeGap] + intro h + have := h (show (1 : ℕ) ∈ Set.Ico 0 (0 + 3) by simp) (show (2 : ℕ) ∈ Set.Ico 0 (0 + 3) by simp) + (h1.trans h2.symm) + omega + +/-- +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 [Er85c]. Estimate +$h(x)$. In particular, is it true that +$$h(x) > (\log x)^c$$ +for some constant $c > 0$? + +The statement avoids defining $h$. Since $h(x)$ is the longest such run, $h(x) > y$ holds exactly +when some $n < x$ starts a run of $H > y$ distinct gaps. We state the question this way, with $x$ +real. We read it as asking for one $c > 0$ such that the inequality holds for all large $x$. + +The primes are indexed from $p_0 = 2$, as in `primeGap`. Shifting the index by one does not change +the question. +-/ +@[category research open, question, AMS 11] +theorem erdos_852.parts.i : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ x : ℝ in atTop, + ∃ n : ℕ, (n : ℝ) < x ∧ ∃ H : ℕ, (Real.log x) ^ c < (H : ℝ) ∧ DistinctGapRun n H := by + sorry + +/-- +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 [Er85c]. Estimate +$h(x)$. In particular, is it true that +$$h(x) = o(\log x)?$$ + +The statement avoids defining $h$. It says that for every $\varepsilon > 0$ and all large real $x$, +every run of $H$ distinct gaps $d_n, \ldots, d_{n+H-1}$ with $n < x$ satisfies +$H \leq \varepsilon \log x$. This is $h(x) \leq \varepsilon \log x$, because $h(x)$ is the longest +such run. + +The indexing is as in `Erdos852.erdos_852.parts.i`. +-/ +@[category research open, question, AMS 11] +theorem erdos_852.parts.ii : + ∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℝ in atTop, + ∀ n : ℕ, (n : ℝ) < x → ∀ H : ℕ, DistinctGapRun n H → (H : ℝ) ≤ ε * Real.log x := by + sorry + +/-- +Brun's sieve implies $h(x) \to \infty$ as $x \to \infty$ (remark on +[erdosproblems.com/852](https://www.erdosproblems.com/852)). + +That is, for every $H$ and all large $x$ there is some $n < x$ such that $d_n, \ldots, d_{n+H-1}$ +are all distinct. Since more values of $n$ are allowed as $x$ grows, this holds exactly when, for +every $H$, some $n$ has $d_n, \ldots, d_{n+H-1}$ all distinct. + +This also follows from `Erdos6.erdos_6.variants.increasing`, because strictly increasing prime +gaps are distinct. +-/ +@[category research solved, AMS 11] +theorem erdos_852.variants.tendsto_atTop : + ∀ H : ℕ, ∀ᶠ x : ℝ in atTop, ∃ n : ℕ, (n : ℝ) < x ∧ DistinctGapRun n H := by + sorry + +end Erdos852 diff --git a/FormalConjectures/ErdosProblems/854.lean b/FormalConjectures/ErdosProblems/854.lean new file mode 100644 index 0000000..41b8aea --- /dev/null +++ b/FormalConjectures/ErdosProblems/854.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. +-/ +module + +public import FormalConjecturesUtil +public import FormalConjectures.ErdosProblems.«235» + +/-! +# Erdős Problem 854 + +*References:* +- [erdosproblems.com/854](https://www.erdosproblems.com/854) +- [Er85c] Erdős, P., *On some of my problems in number theory I would most like to see solved*. + Number theory (Ootacamund, 1984), Lecture Notes in Math. 1122 (1985), 74-84. + [PDF](https://www.renyi.hu/~p_erdos/1985-17.pdf) +- [Ob1] Erdős, P., *Oberwolfach Mathematical Problems*, Volume 1. Mathematisches + Forschungsinstitut Oberwolfach. +- [OEIS A389839](https://oeis.org/A389839): smallest even number which cannot be written as the + difference of two consecutive numbers which are relatively prime to the $n$th primorial. It + agrees with `minEvenNonGap k` for $k\geq 3$. +- [OEIS A048670](https://oeis.org/A048670): Jacobsthal's function of the product of the first $n$ + primes, which is the largest gap. +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos854 + +/-- The $k$th primorial $n_k = p_1 \cdots p_k$, the product of the first $k$ primes +(`Nat.nth Nat.Prime i` is the $(i+1)$st prime, counting from $i = 0$). In particular $n_0 = 1$. -/ +noncomputable def kthPrimorial (k : ℕ) : ℕ := + ∏ i ∈ Finset.range k, Nat.nth Nat.Prime i + +/-- `gapSet m` is the set of values of $a_{i+1} - a_i$, where $a_1 < a_2 < \cdots$ are the +integers in $[1, m)$ coprime to $m$ (for $m > 1$). It is the set of entries of `Erdos235.gaps m`, +the differences of consecutive entries of the sorted list of integers below `m` coprime to `m`. -/ +def gapSet (m : ℕ) : Finset ℕ := + (Erdos235.gaps m).toFinset + +/-- `maxGap m` is $\max_i (a_{i+1} - a_i)$ for the integers in $[1, m)$ coprime to `m`, and `0` +if there are no gaps. For $m = n_k$ with $k\geq 2$ this is the Jacobsthal function of $m$. -/ +def maxGap (m : ℕ) : ℕ := + (gapSet m).sup id + +/-- $f(k)$: the smallest positive even integer that is not of the form $a_{i+1} - a_i$ for the +integers $a_1 < a_2 < \cdots$ in $[1, n_k)$ coprime to $n_k$. The condition `0 < t` is needed +since $0$ is not a gap. For $k \geq 1$ the set contains $n_k$ itself (even, and larger than every +gap), so `sInf` is a true minimum. -/ +noncomputable def minEvenNonGap (k : ℕ) : ℕ := + sInf {t : ℕ | 0 < t ∧ Even t ∧ t ∉ gapSet (kthPrimorial k)} + +/-- The third primorial is $2 \cdot 3 \cdot 5 = 30$. -/ +@[category test, AMS 11] +theorem kthPrimorial_three : kthPrimorial 3 = 30 := by + simp [kthPrimorial, Finset.prod_range_succ, Nat.nth_prime_zero_eq_two, + Nat.nth_prime_one_eq_three, Nat.nth_prime_two_eq_five] + +def erdos_854.parts.i.answer : ℕ → ℝ := sorry + +/-- +Let $n_k$ denote the $k$th primorial, i.e. the product of the first $k$ primes. + +If $1=a_1 0$ such that, for all +large $k$, the number of distinct gap values is at least $c$ times the largest gap. +-/ +@[category research open, question, AMS 11] +theorem erdos_854.parts.ii : + ∃ c > (0 : ℝ), ∀ᶠ k : ℕ in atTop, + c * (maxGap (kthPrimorial k) : ℝ) ≤ ((gapSet (kthPrimorial k)).card : ℝ) := by + sorry + +end Erdos854 diff --git a/FormalConjectures/ErdosProblems/855.lean b/FormalConjectures/ErdosProblems/855.lean index bd8c969..dc0e3be 100644 --- a/FormalConjectures/ErdosProblems/855.lean +++ b/FormalConjectures/ErdosProblems/855.lean @@ -13,8 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil -import FormalConjectures.Wikipedia.HardyLittlewood +module + +public import FormalConjecturesUtil +public import FormalConjectures.Wikipedia.HardyLittlewood /-! # Erdős Problem 855 @@ -24,6 +26,8 @@ import FormalConjectures.Wikipedia.HardyLittlewood This is an "eventually" formulation of the Second Hardy–Littlewood conjecture. -/ +@[expose] public section + open Filter open scoped Nat.Prime @@ -31,11 +35,11 @@ namespace Erdos855 /-- Erdős Problem 855 (Segal's conjecture): $\pi(x + y) \le \pi(x) + \pi(y)$ -for sufficiently large $x, y$. +for all sufficiently large $x, y$, i.e. for all $x, y \ge N$ for some $N$. -/ -@[category research open, AMS 11] -theorem erdos_855 : answer(sorry) ↔ - ∀ᶠ x in atTop, ∀ᶠ y in atTop, π (x + y) ≤ π x + π y := by +@[category research open, question, AMS 11] +theorem erdos_855 : + ∀ᶠ (xy : ℕ × ℕ) in atTop ×ˢ atTop, π (xy.1 + xy.2) ≤ π xy.1 + π xy.2 := by sorry end Erdos855 diff --git a/FormalConjectures/ErdosProblems/856.lean b/FormalConjectures/ErdosProblems/856.lean new file mode 100644 index 0000000..9f1f016 --- /dev/null +++ b/FormalConjectures/ErdosProblems/856.lean @@ -0,0 +1,142 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 856 + +*References:* +- [erdosproblems.com/856](https://www.erdosproblems.com/856) +- [Er70] Erdős, P., *Some extremal problems in combinatorial number theory*. Mathematical Essays + Dedicated to A. J. Macintyre (1970), 123-133. [PDF](https://www.renyi.hu/~p_erdos/1970-21.pdf) +- [TaZh25b] Tang, Q. and Zhang, S., *Harmonic LCM patterns and sunflower-free capacity*. + [arXiv:2512.20055](https://arxiv.org/abs/2512.20055) (2025). + +The problem is closely related to the sunflower problem +[erdosproblems.com/857](https://www.erdosproblems.com/857). The version with natural density in +place of the harmonic sum is [erdosproblems.com/536](https://www.erdosproblems.com/536). +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos856 + +/-- A finite set `A` of natural numbers contains `k` distinct elements with the same pairwise least +common multiple: there is a subset `S ⊆ A` of size `k` and a number `L` such that +`lcm a b = L` for all distinct `a, b ∈ S`. -/ +def HasEqualLcmTuple (k : ℕ) (A : Finset ℕ) : Prop := + ∃ S : Finset ℕ, S ⊆ A ∧ S.card = k ∧ ∃ L : ℕ, ∀ a ∈ S, ∀ b ∈ S, a ≠ b → Nat.lcm a b = L + +/-- $f_k(N)$ is the maximum of $\sum_{n \in A} 1/n$ over all $A \subseteq \{1, \ldots, N\}$ that +contain no `k` distinct elements with the same pairwise least common multiple. + +The set of values is finite and contains `0` (for `A = ∅`) when `k ≥ 1`, so the `sSup` is a +maximum. -/ +noncomputable def f (k N : ℕ) : ℝ := + sSup {s : ℝ | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ ¬ HasEqualLcmTuple k A ∧ + s = ∑ n ∈ A, (n : ℝ)⁻¹} + +/-- Every `A ⊆ {1, …, N}` without `k` distinct elements with the same pairwise least common +multiple has harmonic sum at most `f k N`. -/ +@[category API, AMS 11] +theorem sum_le_f {k N : ℕ} {A : Finset ℕ} (hA : A ⊆ Finset.Icc 1 N) + (hfree : ¬ HasEqualLcmTuple k A) : ∑ n ∈ A, (n : ℝ)⁻¹ ≤ f k N := by + have hfin : {s : ℝ | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ ¬ HasEqualLcmTuple k A ∧ + s = ∑ n ∈ A, (n : ℝ)⁻¹}.Finite := by + refine ((Finset.Icc 1 N).powerset.finite_toSet.image + (fun A : Finset ℕ => ∑ n ∈ A, (n : ℝ)⁻¹)).subset ?_ + rintro s ⟨B, hB, -, rfl⟩ + exact ⟨B, Finset.mem_coe.2 (Finset.mem_powerset.2 hB), rfl⟩ + exact le_csSup hfin.bddAbove ⟨A, hA, hfree, rfl⟩ + +/-- The numbers $6$, $10$, $15$ have the same pairwise least common multiple $30$. -/ +@[category test, AMS 11] +theorem hasEqualLcmTuple_six_ten_fifteen : HasEqualLcmTuple 3 {6, 10, 15} := + ⟨{6, 10, 15}, Finset.Subset.refl _, by decide, 30, by decide⟩ + +def erdos_856.answer : ℕ → ℕ → ℝ := sorry + +/-- +Let $k\geq 3$ and $f_k(N)$ be the maximum value of $\sum_{n\in A}\frac{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)$. + +This is the question of Erdős [Er70, p. 127]. We read "estimate" as +$f_k(N) = \Theta(\text{answer})$ as $N \to \infty$, for each fixed $k$. +-/ +@[category research open, question value, AMS 11] +theorem erdos_856 (k : ℕ) (hk : 3 ≤ k) : + f k =Θ[atTop] erdos_856.answer k := by + sorry + +/-- +Erdős [Er70, p. 127] notes that +$$f_k(N) \ll \frac{\log N}{\log\log N}.$$ + +The implied constant depends on $k$. +-/ +@[category research solved, AMS 11] +theorem erdos_856.variants.erdos_upper (k : ℕ) (hk : 3 ≤ k) : + ∃ C > (0 : ℝ), ∀ᶠ N : ℕ in atTop, f k N ≤ C * (Real.log N / Real.log (Real.log N)) := by + sorry + +/-- The exponent $c_k = \frac{k-2}{e\,((k-2)!)^{1/(k-2)}}$ of [TaZh25b, Theorem 1.2] (called $b_k$ +on the problem page, where $c_k$ denotes the upper exponent). -/ +noncomputable def tangZhangExponent (k : ℕ) : ℝ := + ((k : ℝ) - 2) / (Real.exp 1 * ((Nat.factorial (k - 2) : ℕ) : ℝ) ^ (1 / ((k : ℝ) - 2))) + +/-- +Tang and Zhang [TaZh25b, Theorem 1.2] proved that, for fixed $k\geq 3$ and as $N\to\infty$, +$$f_k(N) \geq (\log N)^{c_k - o(1)}, \qquad c_k = \frac{k-2}{e\,((k-2)!)^{1/(k-2)}}.$$ + +The $o(1)$ is stated with an arbitrary $\varepsilon > 0$. +-/ +@[category research solved, AMS 11] +theorem erdos_856.variants.tang_zhang_lower (k : ℕ) (hk : 3 ≤ k) (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ N : ℕ in atTop, Real.log N ^ (tangZhangExponent k - ε) ≤ f k N := by + sorry + +/-- +Tang and Zhang [TaZh25b, Corollary 1.7] proved, as $N\to\infty$, +$$(\log N)^{\log(1.551)-o(1)}\leq f_3(N)\ll(\log N)^{\frac{3}{2^{2/3}}-1+o(1)}.$$ + +This is the lower bound, with the $o(1)$ stated with an arbitrary $\varepsilon > 0$. Since +$\log(1.551) = 0.4389\ldots$, it implies the site's $(\log N)^{0.438}\leq f_3(N)$ for large $N$. +-/ +@[category research solved, AMS 11] +theorem erdos_856.variants.tang_zhang_three_lower (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ N : ℕ in atTop, Real.log N ^ (Real.log 1.551 - ε) ≤ f 3 N := by + sorry + +/-- +Tang and Zhang [TaZh25b, Corollary 1.7] proved, as $N\to\infty$, +$$(\log N)^{\log(1.551)-o(1)}\leq f_3(N)\ll(\log N)^{\frac{3}{2^{2/3}}-1+o(1)}.$$ + +This is the upper bound, with the $o(1)$ and the implied constant absorbed into an arbitrary +$\varepsilon > 0$. The site rounds the exponent to $0.889$, but $\frac{3}{2^{2/3}}-1=0.8898\ldots$. +-/ +@[category research solved, AMS 11] +theorem erdos_856.variants.tang_zhang_three_upper (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ N : ℕ in atTop, f 3 N ≤ Real.log N ^ (3 / (2 : ℝ) ^ ((2 : ℝ) / 3) - 1 + ε) := by + sorry + +end Erdos856 diff --git a/FormalConjectures/ErdosProblems/857.lean b/FormalConjectures/ErdosProblems/857.lean index 3a875b3..e87bffa 100644 --- a/FormalConjectures/ErdosProblems/857.lean +++ b/FormalConjectures/ErdosProblems/857.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 857 @@ -26,6 +27,8 @@ of size at least `m(n, k)` contains a `k`-sunflower. The problem asks to estimate `m(n, k)`, ideally asymptotically. -/ +@[expose] public section + open Filter namespace Erdos857 @@ -37,13 +40,14 @@ noncomputable def m (n k : ℕ) : ℕ := sInf {t : ℕ | ∀ (F : Set (Set (Fin n))), t ≤ F.ncard → ∃ S ⊆ F, S.ncard = k ∧ IsSunflower S} +def erdos_857.answer : ℕ → ℕ → ℝ := sorry + /-- Estimate `m(n,k)`, or better give an asymptotic formula. -/ -@[category research open, AMS 5] +@[category research open, question value, AMS 5] theorem erdos_857 : - let f : ℕ → ℕ → ℝ := answer(sorry) - ∀ k : ℕ, 3 ≤ k → Tendsto (fun n : ℕ => (m n k : ℝ) / f k n) atTop (nhds 1) := by + ∀ k : ℕ, 3 ≤ k → Tendsto (fun n : ℕ => (m n k : ℝ) / erdos_857.answer k n) atTop (nhds 1) := by sorry end Erdos857 diff --git a/FormalConjectures/ErdosProblems/86.lean b/FormalConjectures/ErdosProblems/86.lean new file mode 100644 index 0000000..1fdc48c --- /dev/null +++ b/FormalConjectures/ErdosProblems/86.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 86 + +*References:* +- [erdosproblems.com/86](https://www.erdosproblems.com/86) +- [BHLL14] Balogh, József and Hu, Ping and Lidický, Bernard and Liu, Hong, *Upper bounds on the size + of 4- and 6-cycle-free subgraphs of the hypercube*. European J. Combin. (2014), 75-85. +- [BHN95] Brass, Peter and Harborth, Heiko and Nienborg, Hauke, *On the maximum number of edges in a + {$C_4$}-free subgraph of {$Q_n$}*. J. Graph Theory (1995), 17--23. +- [Ba12b] R. Baber, *Turán densities of hypercubes*. arXiv:1201.3587 (2012). +- [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. +-/ + +@[expose] public section + +open Filter SimpleGraph + +namespace Erdos86 + +/-- +Let $Q_n$ be the $n$-dimensional hypercube graph (so that $Q_n$ has $2^n$ vertices and $n2^{n-1}$ edges). Is it true that every subgraph of $Q_n$ with $$\geq \left(\frac{1}{2}+o(1)\right)n2^{n-1}$$ many edges contains a $C_4$? +-/ +@[category research open, question, AMS 5] +theorem erdos_86 : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, ∀ H : SimpleGraph (Fin n → Bool), + H ≤ hypercube n → + (1 / 2 + ε) * n * 2 ^ (n - 1 : ℕ) ≤ (H.edgeSet.ncard : ℝ) → + cycleGraph 4 ⊑ H := by + sorry + +end Erdos86 diff --git a/FormalConjectures/ErdosProblems/860.lean b/FormalConjectures/ErdosProblems/860.lean new file mode 100644 index 0000000..4939418 --- /dev/null +++ b/FormalConjectures/ErdosProblems/860.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 860 + +*References:* +- [erdosproblems.com/860](https://www.erdosproblems.com/860) +- [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. 42 (1980), 147-161. + [PDF](https://www.renyi.hu/~p_erdos/1980-13.pdf) +- [Er92c] Erdős, P., *Some of my forgotten problems in number theory*. Hardy-Ramanujan J. 15 + (1992), 34-50. [PDF](https://hrj.episciences.org/125/pdf) +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos860 + +/-- There are distinct integers $a_1,\ldots,a_{\pi(n)}$ in the open interval $(m,m+L)$ such that +$p_i \mid a_i$ for every $1 \leq i \leq \pi(n)$, where $p_i$ is the $i$th prime. Primes are +indexed from $0$ by `Nat.nth Nat.Prime`, so $p_i$ is `Nat.nth Nat.Prime (i - 1)`. -/ +def HasPrimeMultiples (n m L : ℕ) : Prop := + ∃ a : Fin (Nat.primeCounting n) → ℕ, + Function.Injective a ∧ ∀ i, m < a i ∧ a i < m + L ∧ Nat.nth Nat.Prime i.val ∣ a i + +/-- $h(n)$: the least $L$ such that for every $m \geq 1$ the open interval $(m,m+L)$ contains +distinct integers $a_1,\ldots,a_{\pi(n)}$ with $p_i \mid a_i$, where $p_i$ is the $i$th prime. + +The set of such $L$ is nonempty: $L = n\pi(n)+1$ works, since each $p_i \leq n$ has at least +$\pi(n)$ multiples in $(m,m+L)$, so the $a_i$ can be chosen one by one. So `sInf` is the true +minimum. For $n < 2$ there are no primes and $h(n) = 0$. -/ +noncomputable def h (n : ℕ) : ℕ := + sInf {L : ℕ | ∀ m, 1 ≤ m → HasPrimeMultiples n m L} + +/-- Any $L$ that works for every $m \geq 1$ is an upper bound for $h(n)$. -/ +@[category API, AMS 11] +theorem h_le {n L : ℕ} (hL : ∀ m, 1 ≤ m → HasPrimeMultiples n m L) : h n ≤ L := + Nat.sInf_le hL + +def erdos_860.answer : ℕ → ℝ := sorry + +/-- +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)$. +-/ +@[category research open, question value, AMS 11] +theorem erdos_860 : (fun n ↦ (h n : ℝ)) =Θ[atTop] erdos_860.answer := by + sorry + +/-- +Erdős and Pomerance [ErPo80] proved that +$$h(n) \ll \frac{n^{3/2}}{(\log n)^{1/2}}.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_860.variants.erdos_pomerance_upper : + (fun n : ℕ ↦ (h n : ℝ)) =O[atTop] + fun n : ℕ ↦ (n : ℝ) ^ (3 / 2 : ℝ) / Real.sqrt (Real.log n) := by + sorry + +/-- +Erdős and Selfridge proved $h(n)>(3-o(1))n$. + +[ErPo80, (19), p. 159] states this as $\limsup h(n)/n \geq 3$, that is, it holds for infinitely +many $n$. We state that form. +-/ +@[category research solved, AMS 11] +theorem erdos_860.variants.erdos_selfridge_lower : + ∀ ε > (0 : ℝ), ∃ᶠ n : ℕ in atTop, (3 - ε) * n ≤ (h n : ℝ) := by + sorry + +/-- +Ruzsa proved $h(n)/n\to \infty$, as reported in [Er92c, p. 36]. +-/ +@[category research solved, AMS 11] +theorem erdos_860.variants.ruzsa : + Tendsto (fun n : ℕ ↦ (h n : ℝ) / n) atTop atTop := by + sorry + +end Erdos860 diff --git a/FormalConjectures/ErdosProblems/864.lean b/FormalConjectures/ErdosProblems/864.lean new file mode 100644 index 0000000..95003e2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/864.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 864 + +*References:* +- [erdosproblems.com/864](https://www.erdosproblems.com/864) +- [A389182](https://oeis.org/A389182) +- [ErFr91] Erdős, P. and Freud, R., *On sums of a Sidon-sequence*. J. Number Theory 38 (1991), + 196--205. +- [Er92c] Erdős, P., *Some of my forgotten problems in number theory*. Hardy-Ramanujan J. 15 + (1992), 34-50. +-/ + +@[expose] public section + +open Filter +open scoped Finset + +namespace Erdos864 + +/-- The representations of $n$ as a sum $n = a + b$ with $a \leq b$ and $a, b \in A$, recorded as +the pairs $(a, b)$. The case $a = b$ is allowed. -/ +def sumRepresentations (A : Finset ℕ) (n : ℕ) : Finset (ℕ × ℕ) := + {p ∈ A ×ˢ A | p.1 ≤ p.2 ∧ p.1 + p.2 = n} + +/-- There is at most one $n$ with more than one representation $n = a + b$, where $a \leq b$ and +$a, b \in A$. That is, any two integers with more than one representation are equal. + +Every Sidon set satisfies this condition, since then no $n$ has more than one representation. -/ +def HasAtMostOneRepeatedSum (A : Finset ℕ) : Prop := + ∀ n m : ℕ, 1 < #(sumRepresentations A n) → 1 < #(sumRepresentations A m) → n = m + +/-- +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\leq b\in A$). Estimate the maximal possible size of $|A|$. In +particular, is it true that +$$|A| \leq (1+o(1))\frac{2}{\sqrt{3}} N^{1/2}?$$ + +A problem of Erdős and Freud [ErFr91] [Er92c]. For the analogous question with $n=a-b$ they prove +that $\lvert A\rvert\sim N^{1/2}$. This is a weaker form of Erdős Problem 840. + +The condition on $A$ is `HasAtMostOneRepeatedSum`. We state the question as follows: for every +$\varepsilon > 0$ and all large $N$, every such set $A$ satisfies +$|A| \leq (1+\varepsilon)\frac{2}{\sqrt{3}} N^{1/2}$. +-/ +@[category research open, question, AMS 5 11] +theorem erdos_864 : + ∀ ε : ℝ, 0 < ε → ∀ᶠ N : ℕ in atTop, ∀ A ⊆ Finset.Icc 1 N, + HasAtMostOneRepeatedSum A → + (#A : ℝ) ≤ (1 + ε) * (2 / Real.sqrt 3) * Real.sqrt (N : ℝ) := by + sorry + +/-- +Erdős and Freud [ErFr91] [Er92c] prove that +$$\lvert A\rvert \geq (1+o(1))\frac{2}{\sqrt{3}}N^{1/2}.$$ +This is shown by taking a genuine Sidon set $B\subset [1,N/3]$ of size $\sim N^{1/2}/\sqrt{3}$ +and taking the union with $\{N-b : b\in B\}$. + +That is, for every $\varepsilon > 0$ and all large $N$ there is a set $A\subseteq \{1,\ldots,N\}$ +with the property of `Erdos864.erdos_864` and $|A| \geq (1-\varepsilon)\frac{2}{\sqrt{3}}N^{1/2}$. +So the constant $2/\sqrt{3}$ there cannot be replaced by a smaller one. +-/ +@[category research solved, AMS 5 11] +theorem erdos_864.variants.lower_bound : + ∀ ε : ℝ, 0 < ε → ∀ᶠ N : ℕ in atTop, ∃ A ⊆ Finset.Icc 1 N, + HasAtMostOneRepeatedSum A ∧ + (1 - ε) * (2 / Real.sqrt 3) * Real.sqrt (N : ℝ) ≤ #A := by + sorry + +/-- A Sidon set has no integer with more than one representation, so it satisfies the condition +of the problem. -/ +@[category test, AMS 5 11] +theorem hasAtMostOneRepeatedSum_of_isSidon {A : Finset ℕ} (hA : IsSidon (A : Set ℕ)) : + HasAtMostOneRepeatedSum A := by + intro n m hn _ + exfalso + obtain ⟨p, hp, q, hq, hpq⟩ := Finset.one_lt_card.1 hn + simp only [sumRepresentations, Finset.mem_filter, Finset.mem_product] at hp hq + obtain ⟨⟨hp1, hp2⟩, hp3, hp4⟩ := hp + obtain ⟨⟨hq1, hq2⟩, hq3, hq4⟩ := hq + rcases hA p.1 (Finset.mem_coe.2 hp1) q.1 (Finset.mem_coe.2 hq1) + p.2 (Finset.mem_coe.2 hp2) q.2 (Finset.mem_coe.2 hq2) (by omega) with ⟨h1, h2⟩ | ⟨h1, h2⟩ + · exact hpq (Prod.ext h1 h2) + · exact hpq (Prod.ext (by omega) (by omega)) + +/-- The set $\{1,2,3\}$ is not a Sidon set, but it satisfies the condition: only +$4 = 1 + 3 = 2 + 2$ has two representations. -/ +@[category test, AMS 5 11] +theorem hasAtMostOneRepeatedSum_one_two_three : HasAtMostOneRepeatedSum {1, 2, 3} := by + have key : ∀ n, 1 < #(sumRepresentations {1, 2, 3} n) → n = 4 := by + intro n hn + obtain ⟨⟨a, b⟩, hp, ⟨c, d⟩, hq, hpq⟩ := Finset.one_lt_card.1 hn + simp only [sumRepresentations, Finset.mem_filter, Finset.mem_product, Finset.mem_insert, + Finset.mem_singleton] at hp hq + have hne : a ≠ c ∨ b ≠ d := by + rw [Ne, Prod.mk.injEq, not_and_or] at hpq + exact hpq + omega + intro n m hn hm + rw [key n hn, key m hm] + +/-- The set $\{1,2,3,4\}$ does not satisfy the condition: both $4 = 1 + 3 = 2 + 2$ and +$5 = 1 + 4 = 2 + 3$ have two representations. Without the case $a = b$, $4$ would have only one +representation and the set would satisfy the condition. -/ +@[category test, AMS 5 11] +theorem not_hasAtMostOneRepeatedSum_Icc_one_four : + ¬ HasAtMostOneRepeatedSum (Finset.Icc 1 4) := by + intro h + have h4 : 1 < #(sumRepresentations (Finset.Icc 1 4) 4) := by decide +kernel + have h5 : 1 < #(sumRepresentations (Finset.Icc 1 4) 5) := by decide +kernel + have := h 4 5 h4 h5 + omega + +end Erdos864 diff --git a/FormalConjectures/ErdosProblems/865.lean b/FormalConjectures/ErdosProblems/865.lean index 949ccfa..8d54a12 100644 --- a/FormalConjectures/ErdosProblems/865.lean +++ b/FormalConjectures/ErdosProblems/865.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 865 @@ -27,6 +28,8 @@ import FormalConjecturesUtil (2026). -/ +@[expose] public section + open Finset Filter open scoped Asymptotics @@ -64,7 +67,35 @@ there are distinct $a,b\in A$ such that $a+b\in A$, which establishes the $k=2$ theorem erdos_865.variants.k2 (N : ℕ) : ∀ A ⊆ Icc 1 (2 * N), A.card ≥ N + 2 → ∃ a ∈ A, ∃ b ∈ A, a ≠ b ∧ a + b ∈ A := by - sorry + intro A hA hcard + have hne : A.Nonempty := by + rw [← Finset.card_pos]; omega + set m := A.max' hne with hm + have hmA : m ∈ A := Finset.max'_mem A hne + have hmle : m ≤ 2 * N := by + have := hA hmA + rw [Finset.mem_Icc] at this + omega + have hcard' : (Icc 1 N).card < (A.erase m).card := by + rw [Finset.card_erase_of_mem hmA, Nat.card_Icc] + omega + have hmaps : ∀ x ∈ A.erase m, min x (m - x) ∈ Icc 1 N := by + intro x hx + obtain ⟨hxm, hxA⟩ := Finset.mem_erase.mp hx + have hxle : x ≤ m := Finset.le_max' A x hxA + have hx1 := (Finset.mem_Icc.mp (hA hxA)).1 + rw [Finset.mem_Icc] + omega + obtain ⟨x, hx, y, hy, hxy, hxyeq⟩ := + Finset.exists_ne_map_eq_of_card_lt_of_maps_to hcard' hmaps + obtain ⟨hxm, hxA⟩ := Finset.mem_erase.mp hx + obtain ⟨hym, hyA⟩ := Finset.mem_erase.mp hy + have hxle : x ≤ m := Finset.le_max' A x hxA + have hyle : y ≤ m := Finset.le_max' A y hyA + refine ⟨x, hxA, y, hyA, hxy, ?_⟩ + have : x + y = m := by omega + rw [this] + exact hmA noncomputable def f (N k : ℕ) : ℕ := sInf {m | ∀ A ⊆ Icc 1 N, A.card ≥ m → diff --git a/FormalConjectures/ErdosProblems/87.lean b/FormalConjectures/ErdosProblems/87.lean new file mode 100644 index 0000000..50bf86a --- /dev/null +++ b/FormalConjectures/ErdosProblems/87.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 87 + +*References:* +- [erdosproblems.com/87](https://www.erdosproblems.com/87) +- [Er95] Erdős, Paul, Some of my favourite problems in number theory, combinatorics, and geometry. + Resenhas (1995), 165-186. +-/ + +@[expose] public section + +open Filter + +namespace Erdos87 + +/-- +Let $0 < \epsilon < 1$. Is it true that, if $k$ is sufficiently large, then +$$R(G) > (1-\epsilon)^k R(k)$$ +for every graph $G$ with chromatic number $\chi(G)=k$? + +The restriction $\epsilon < 1$ excludes negative bases in $(1-\epsilon)^k$. + +This problem is #12 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, question, AMS 5] +theorem erdos_87.parts.i : + ∀ ε > (0 : ℝ), ε < 1 → ∀ᶠ k : ℕ in atTop, + ∀ (V : Type) [Fintype V] (G : SimpleGraph V), G.chromaticNumber = (k : ℕ∞) → + (SimpleGraph.diagonalGraphRamsey G : ℝ) > + (1 - ε) ^ k * (SimpleGraph.diagonalRamsey k : ℝ) := by + sorry + +/-- +Even stronger, is there some $c > 0$ such that, for all large $k$, +$$R(G) > c R(k)$$ +for every graph $G$ with chromatic number $\chi(G)=k$? + +This problem is #13 in Ramsey Theory in the graphs problem collection. +-/ +@[category research open, question, AMS 5] +theorem erdos_87.parts.ii : + ∃ c > (0 : ℝ), ∀ᶠ k : ℕ in atTop, + ∀ (V : Type) [Fintype V] (G : SimpleGraph V), G.chromaticNumber = (k : ℕ∞) → + (SimpleGraph.diagonalGraphRamsey G : ℝ) > c * (SimpleGraph.diagonalRamsey k : ℝ) := by + sorry + +-- TODO: Add variants of the problem. + +end Erdos87 diff --git a/FormalConjectures/ErdosProblems/872.lean b/FormalConjectures/ErdosProblems/872.lean index 88ddefb..61e085c 100644 --- a/FormalConjectures/ErdosProblems/872.lean +++ b/FormalConjectures/ErdosProblems/872.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 872 @@ -33,6 +34,8 @@ value grows linearly, and the questions below concern the Prolonger-first quanti - [erdosproblems.com/forum/thread/872](https://www.erdosproblems.com/forum/thread/872) -/ +@[expose] public section + open Filter namespace Erdos872 @@ -154,22 +157,25 @@ The problem asks for asymptotic lower bounds on `L(n)`. Two specific targets are /-- Erdős Problem 872, part (i) (weak form): there exists a constant $\epsilon > 0$ such that the game length is at least $\epsilon \cdot n$ for all sufficiently large $n$. -/ -@[category research open, AMS 5 11 91] -theorem erdos_872.parts.i : answer(sorry) ↔ +@[category research open, question, AMS 5 11 91] +theorem erdos_872.parts.i : ∃ ε > (0 : ℝ), ∀ᶠ n in atTop, (L n : ℝ) ≥ ε * n := by sorry /-- Erdős Problem 872, part (ii) (strong form): for every $\epsilon > 0$, the game length is at least $(1-\epsilon) \cdot n / 2$ for all sufficiently large $n$. -Status note: the forum thread (April-May 2026) records Shortener strategies giving +The forum thread (April-May 2026) records Shortener strategies giving $L(n) \leq (23/48 + o(1)) \cdot n$ (described in the thread as accepted as correct, with a Lean formalization in progress) and a claimed $L(n) \leq 0.19 \cdot n$, either of which would answer this -question negatively under the Prolonger-first convention. Neither is published, so the statement -is recorded here as the original Erdős question. -/ -@[category research open, AMS 5 11 91] -theorem erdos_872.parts.ii : answer(sorry) ↔ - ∀ ε > (0 : ℝ), ∀ᶠ n in atTop, (L n : ℝ) ≥ (1 - ε) * n / 2 := by +question negatively under the Prolonger-first convention. + +The $23/48$ upper bound for `C`-respecting plays (following old-bielefelder's strategy in the +forum thread) was formalized in Lean 4 by Pommeret using Aristotle and Claude Opus 4.7, and +completed to a proof for the full minimax game value `L n` by Ilia Pauzner using Gemini 4 Argon. -/ +@[category research solved, question, AMS 5 11 91, formal_proof using formal_conjectures at "https://github.com/ilpauzner/formal-conjectures/blob/d9299da16287d2347e375d9eec253eec455bae75/FormalConjectures/ErdosProblems/872.lean#L1180"] +theorem erdos_872.parts.ii : + ¬ ∀ ε > (0 : ℝ), ∀ᶠ n in atTop, (L n : ℝ) ≥ (1 - ε) * n / 2 := by sorry /-- A trivial upper bound: a play can claim at most the $n - 1$ elements of $\{2, \dots, n\}$, so @@ -187,9 +193,17 @@ theorem erdos_872.trivial_upper_bound (n : ℕ) (hn : 2 ≤ n) : The set of primes in $\{2, \dots, n\}$ is a maximal primitive subset of size $\pi(n)$, and the forum thread asks whether this is the smallest possible for all $n \geq 2$. Equivalently: must every completed play of the saturation game, by both players and regardless of strategy, claim at least -$\pi(n)$ elements? (Terminal positions of the game are exactly the maximal primitive subsets.) -/ -@[category research open, AMS 5 11 91] -theorem erdos_872.variants.prime_question : answer(sorry) ↔ +$\pi(n)$ elements? (Terminal positions of the game are exactly the maximal primitive subsets.) + +The answer is yes. For each prime $q \le n$, let $q^k$ be the largest power of $q$ that is at most +$n$. Maximality gives an element of $A$ comparable with $q^k$ under divisibility, and no element is +comparable with two such prime powers, so $|A| \ge \pi(n)$. This argument was posted on the forum +by old-bielefelder (May 2026); the statement also appears as Theorem 2.3(i) of +[El23] S. Elsakhawy, *Independence and domination in divisor graph and mod-difference graphs*, +J. Egyptian Math. Soc. 31 (2023). -/ +@[category research solved, question, AMS 5 11 91, formal_proof using lean4 at + "https://github.com/mnn31/erdos-lean/blob/5cb725981b3ad137103ef908eb6ecff9e7ed9bdf/ErdosLean/Erdos872.lean#L114"] +theorem erdos_872.variants.prime_question : ∀ n ≥ 2, ∀ A : Finset ℕ, Maximal (IsPrimitive n) A → ((Finset.Icc 2 n).filter Nat.Prime).card ≤ A.card := by sorry diff --git a/FormalConjectures/ErdosProblems/878.lean b/FormalConjectures/ErdosProblems/878.lean new file mode 100644 index 0000000..02dda40 --- /dev/null +++ b/FormalConjectures/ErdosProblems/878.lean @@ -0,0 +1,193 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 878 + +*References:* +- [erdosproblems.com/878](https://www.erdosproblems.com/878) +- [Er84e] Erdős, P., _On two unconventional number theoretic functions and on some + related problems_. (1984), 113--121. +- [Ki26] Kitamura, K., _Erdős Problem #878 in Lean_, + [GitHub repository](https://github.com/KitaKen1/erdos-878-lean/tree/d4a8eecf0606b3eee7342c2040a31c8c30eb5d76) (2026). +-/ + +@[expose] public section + +open Filter Asymptotics +open scoped Topology Real + +namespace Erdos878 + +/-- The function $f(n)=\sum_{p\mid n}p^{\lfloor\log_p n\rfloor}$. -/ +noncomputable def f (n : ℕ) : ℕ := + ∑ p ∈ n.primeFactors, p ^ Nat.log p n + +open scoped Classical in +/-- The function $F(n)$ from Erdős Problem 878, with nontrivial terms $a_i \ge 2$. -/ +noncomputable def F (n : ℕ) : ℕ := + ((Finset.Icc 2 n).powerset.filter fun A ↦ + A ⊆ Finset.Icc 2 n ∧ + (A : Set ℕ).Pairwise (fun a b ↦ Nat.Coprime a b) ∧ + ∀ a ∈ A, ∀ p, p.Prime → p ∣ a → p ∣ n).sup fun A ↦ ∑ a ∈ A, a + +/-- The maximum of an arithmetic function on $\{0,\ldots,x\}$. -/ +noncomputable def maxUpTo (g : ℕ → ℕ) (x : ℕ) : ℕ := + (Finset.range (x + 1)).sup g + +/-- The function $H(x)=\sum_{1\le n \lfloor n/2 \rfloor + \lfloor n/3 \rfloor - \lfloor n/6 \rfloor$$ +then $G(A)$ contains all odd cycles of length $\leq n/3 + 1$? + +A problem of Erdős and Sárközy [ErSa97]. +-/ +@[category research open, question, AMS 5 11] +theorem erdos_883.parts.i : + ∀ (n : ℕ) (A : Finset ℕ), + A ⊆ Finset.Icc 1 n → + n / 2 + n / 3 - n / 6 < A.card → + ∀ l : ℕ, Odd l → 3 ≤ l → l ≤ n / 3 + 1 → + l ∈ (coprimeGraph.induce (A : Set ℕ)).oddCycleLengths := by + sorry + +open scoped Classical in +/-- +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 graph on $2\ell+1$ vertices? + +The second question was solved by Sárközy [Sa99], who proved this with +$\ell \gg \log n/\log\log n$. +-/ +@[category research solved, question, AMS 5 11] +theorem erdos_883.parts.ii : + ∀ l : ℕ, 1 ≤ l → ∀ᶠ n : ℕ in atTop, ∀ A : Finset ℕ, + A ⊆ Finset.Icc 1 n → + n / 2 + n / 3 - n / 6 < A.card → + (SimpleGraph.completeMultipartiteGraph (fun i : Fin 3 ↦ Fin (![1, l, l] i))).IsContained + (coprimeGraph.induce (A : Set ℕ)) := by + sorry + +end Erdos883 diff --git a/FormalConjectures/ErdosProblems/887.lean b/FormalConjectures/ErdosProblems/887.lean index 21c7d60..633114e 100644 --- a/FormalConjectures/ErdosProblems/887.lean +++ b/FormalConjectures/ErdosProblems/887.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 887 @@ -23,16 +24,21 @@ import FormalConjecturesUtil * [erdosproblems.com/887](https://www.erdosproblems.com/887) * [ErRo97] Erdős, Paul and Rosenfeld, Moshe, The factor-difference set of integers. Acta Arith. (1997), 353--359. -/ + +@[expose] public section + open Filter Finset Real namespace Erdos887 +def erdos_887.parts.i.answer : ℕ := sorry + /-- Is there an absolute constant $K$ such that, for every $C > 0$, if $n$ is sufficiently large then $n$ has at most $K$ divisors in $(n^{\frac{1}{2}}, n^{\frac{1}{2}} + C n^{\frac{1}{4}})$. -/ -@[category research open, AMS 11] +@[category research open, question value, AMS 11] theorem erdos_887.parts.i : ∀ C > (0 : ℝ), ∀ᶠ n in atTop, - #{ d ∈ Ioo ⌊√n⌋₊ ⌈√n + C * n^((1 : ℝ) / 4)⌉₊ | d ∣ n } ≤ answer(sorry) := by + #{ d ∈ Ioo ⌊√n⌋₊ ⌈√n + C * n^((1 : ℝ) / 4)⌉₊ | d ∣ n } ≤ erdos_887.parts.i.answer := by sorry /-- @@ -54,12 +60,21 @@ theorem erdos_887.variants.rosenfeld_infinite : ∃ C > (0 : ℝ), sorry /-- -Erdős and Rosenfeld, ask whether $4$ is the best possible $K$ for the infinitude of $n$ -with (at least) $K$ divisors in $(n^{\frac{1}{2}}, n^{\frac{1}{2}} + n^{\frac{1}{4}})$. +Erdős and Rosenfeld ask whether $4$ is the best possible $K$ for the infinitude of $n$ +with (at least) $K$ divisors in $(n^{\frac{1}{2}}, n^{\frac{1}{2}} + C n^{\frac{1}{4}})$, for some +constant $C > 0$. The constant cannot be taken to be $1$. Distinct divisors $d > \sqrt{n}$ give +distinct integers $d + n/d$, and a divisor in the interval has +$2\sqrt{n} < d + n/d < 2\sqrt{n} + C^2$, so for $C = 1$ there is at most one such divisor. + +The answer is no. In a [forum post](https://www.erdosproblems.com/forum/thread/887#post-7374) +(July 2026), m-czech showed that for $C = 31$ infinitely many $n$ have $5$ divisors in the +interval. The construction is $n = (x^2 - 1)(x^2 - 4)(x^2 - 16)(x^2 - 49)$ with +$z^2 = 56 x^2 + 65$. -/ -@[category research open, AMS 11] +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/mnn31/erdos-lean/blob/5cb725981b3ad137103ef908eb6ecff9e7ed9bdf/ErdosLean/Erdos887.lean#L538"] theorem erdos_887.variants.rosenfeld_4 : - IsGreatest {K | ∃ C > (0 : ℝ), + ¬ IsGreatest {K | ∃ C > (0 : ℝ), Infinite {n : ℕ | K ≤ #{ d ∈ Ioo ⌊√n⌋₊ ⌈√n + C * n^((1 : ℝ) / 4)⌉₊ | d ∣ n }}} 4 := by sorry diff --git a/FormalConjectures/ErdosProblems/891.lean b/FormalConjectures/ErdosProblems/891.lean index ea7d136..d5fdb28 100644 --- a/FormalConjectures/ErdosProblems/891.lean +++ b/FormalConjectures/ErdosProblems/891.lean @@ -26,10 +26,18 @@ import FormalConjecturesUtil -/ open Nat Filter Finset +open Polynomial open scoped ArithmeticFunction.omega namespace Erdos891 +/-- Dickson's conjecture for finite families of linear integer polynomials. -/ +def DicksonConjecture : Prop := + ∀ (fs : Finset ℤ[X]), + (∀ f ∈ fs, f.degree = 1 ∧ BunyakovskyCondition f) → + SchinzelCondition fs → + Infinite {n : ℕ | ∀ f ∈ fs, (f.eval (n : ℤ)).natAbs.Prime} + /-- Let $2=p_1 < p_2 < \cdots$ be the primes and $k\geq 2$. Is it true that, for all sufficiently large $n$, there must exist an integer in $[n,n+p_1\cdots p_k)$ with $>k$ many prime factors? @@ -69,8 +77,8 @@ integers at most $p_1\cdots p_k$. By Dickson's conjecture [Wikipedia], there are $n'$ such that $\frac{L_k}{m}n'+1$ is prime for all $1\leq m < p_1\cdots p_k$. It follows that, if $n=L_kn'+1$, then all integers in $[n,n+p_1\cdots p_k-1)$ have at most $k$ prime factors. -/ -@[category research open, AMS 11] -theorem erdos_891.variants.weisenberg (k : ℕ) (hk : k ≥ 2) : +@[category research solved, AMS 11] +theorem erdos_891.variants.weisenberg (hDickson : DicksonConjecture) (k : ℕ) (hk : k ≥ 2) : ∃ᶠ n in atTop, ∀ m ∈ Ico n (n + (∏ i ∈ range k, i.nth Nat.Prime) - 1), ω m ≤ k := by diff --git a/FormalConjectures/ErdosProblems/895.lean b/FormalConjectures/ErdosProblems/895.lean new file mode 100644 index 0000000..0ef75fc --- /dev/null +++ b/FormalConjectures/ErdosProblems/895.lean @@ -0,0 +1,76 @@ +/- +Copyright 2025 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 895 + +*References:* +- [erdosproblems.com/895](https://www.erdosproblems.com/895) +- [Er95d] Erdős, Paul, *On some problems in combinatorial set theory*. Publ. Inst. Math. + (Beograd) (N.S.) (1995), 61-65. +-/ + +@[expose] public section + +open Filter + +namespace Erdos895 + +/-- +Is it true that, for all sufficiently large $n$, if $G$ is a triangle-free graph on +$\{1,\ldots,n\}$ then there must exist three independent points $a,b,a+b$? + +A problem of Erdős and Hajnal [Er95d]. The stated problem has been resolved by Barber (personal +communication) who verified using a SAT solver that this is true for all $n\geq 18$. +-/ +@[category research solved, question, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos895.lean#L268"] +theorem erdos_895 : + ∀ᶠ n in atTop, ∀ G : SimpleGraph (Set.Icc 1 n), G.CliqueFree 3 → + ∃ a b c : Set.Icc 1 n, a ≠ b ∧ (a : ℕ) + (b : ℕ) = c ∧ G.IsIndepSet {a, b, c} := by + sorry + +/-- +Barber's sharp form of [erdős_895](https://www.erdosproblems.com/895): every triangle-free graph on +$\{1,\ldots,n\}$ with $n\geq 18$ contains three independent points $a,b,a+b$. +-/ +@[category research solved, AMS 5, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos895.lean#L243"] +theorem erdos_895.variants.eighteen (n : ℕ) (hn : 18 ≤ n) (G : SimpleGraph (Set.Icc 1 n)) + (hG : G.CliqueFree 3) : + ∃ a b c : Set.Icc 1 n, a ≠ b ∧ (a : ℕ) + (b : ℕ) = c ∧ G.IsIndepSet {a, b, c} := by + sorry + +/-- +Hajnal thought that there is in fact an independent set which is a Hindman set - that is, an +independent set of the shape +$$\left\{ \sum_{i\in S}a_i : S\subseteq \{1,\ldots,k\}\right\}$$ +for some $a_1,\ldots,a_k$ (provided $n$ is sufficiently large depending on $k$). + +The general question of an independent Hindman set remains open. Here the $a_i$ are taken to be +distinct positive integers and $S$ ranges over the nonempty subsets of $\{1,\ldots,k\}$. +-/ +@[category research open, question, AMS 5] +theorem erdos_895.variants.hindman : + ∀ k : ℕ, ∀ᶠ n in atTop, ∀ G : SimpleGraph (Set.Icc 1 n), G.CliqueFree 3 → + ∃ a : Fin k → ℕ, StrictMono a ∧ ∃ I : Set (Set.Icc 1 n), G.IsIndepSet I ∧ + Subtype.val '' I = {m | ∃ S : Finset (Fin k), S.Nonempty ∧ m = ∑ i ∈ S, a i} := by + sorry + +end Erdos895 diff --git a/FormalConjectures/ErdosProblems/897.lean b/FormalConjectures/ErdosProblems/897.lean index 06a7325..2315197 100644 --- a/FormalConjectures/ErdosProblems/897.lean +++ b/FormalConjectures/ErdosProblems/897.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 897 @@ -28,6 +29,8 @@ import FormalConjecturesUtil - [Wi81] E. Wirsing, Additive and completely additive functions with restricted growth. Recent progress in analytic number theory, Vol. 2 (Durham, 1979), 231--280 (1981). -/ + +@[expose] public section -- TODO(lezeau): add `ArithmeticFunction.IsAdditive` to `ForMathlib` namespace Erdos897 @@ -40,9 +43,9 @@ Is it true that $\limsup_n (f(n+1)−f(n))/ \log n = ∞$? The answer is no; this follows from a construction of Wirsing [Wi81], rediscovered by Archivara [Ar25] and formalised in Lean by Aristotle [ArWu25]. -/ -@[category research solved, AMS 11, formal_proof using lean4 at +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.24.0/ErdosProblems/Erdos897.lean"] -theorem erdos_897.parts.i : answer(False) ↔ ∀ (f : ℕ → ℝ), +theorem erdos_897.parts.i : ¬ ∀ (f : ℕ → ℝ), (∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) → ((Filter.atTop ⊓ Filter.principal {(p, k) : ℕ × ℕ | p.Prime}).limsup (fun (p, k) => (f (p^k) / (p^k : ℝ).log : EReal)) = ⊤) → @@ -56,9 +59,9 @@ Is it true that $\limsup_n f(n+1)/ f(n) = ∞$? The answer is no; the same counterexample is formalised in Lean by Aristotle [ArWu25]. -/ -@[category research solved, AMS 11, formal_proof using lean4 at +@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.24.0/ErdosProblems/Erdos897.lean"] -theorem erdos_897.parts.ii : answer(False) ↔ ∀ (f : ℕ → ℝ), +theorem erdos_897.parts.ii : ¬ ∀ (f : ℕ → ℝ), (∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) → ((Filter.atTop ⊓ Filter.principal {(p, k) : ℕ × ℕ | p.Prime}).limsup (fun (p, k) => (f (p^k) / (p^k : ℝ).log : EReal)) = ⊤) → @@ -67,9 +70,10 @@ theorem erdos_897.parts.ii : answer(False) ↔ ∀ (f : ℕ → ℝ), /-- Wirsing [Wi70] proved that if $|f(n+1)−f(n)| ≤ C$ then $f(n) = c \log n + O(1)$ for some constant -$c$. +$c$. This is Erdős Problem 491; see `erdos_491`, whose linked formal proof gives this statement. -/ -@[category research solved, AMS 11] +@[category research solved, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos491.lean#L34"] theorem erdos_897.variants.log_growth (f : ℕ → ℝ) (hf : ∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) @@ -88,8 +92,8 @@ Is it true that $\limsup_n (f(n+1)−f(n))/ \log n = ∞$? The known counterexample does not satisfy either of these extra hypotheses, so this variant remains open. -/ -@[category research open, AMS 11] -theorem erdos_897.variants.parts.i : answer(sorry) ↔ ∀ (f : ℕ → ℝ), +@[category research open, question, AMS 11] +theorem erdos_897.variants.parts.i : ∀ (f : ℕ → ℝ), (∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) → ((Filter.atTop ⊓ Filter.principal {(p, k) : ℕ × ℕ | p.Prime}).limsup (fun (p, k) => (f (p^k) / (p^k : ℝ).log : EReal)) = ⊤) → @@ -106,8 +110,8 @@ Is it true that $\limsup_n f(n+1)/f(n) = ∞$? The known counterexample does not satisfy either of these extra hypotheses, so this variant remains open. -/ -@[category research open, AMS 11] -theorem erdos_897.variants.parts.ii : answer(sorry) ↔ ∀ (f : ℕ → ℝ), +@[category research open, question, AMS 11] +theorem erdos_897.variants.parts.ii : ∀ (f : ℕ → ℝ), (∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) → ((Filter.atTop ⊓ Filter.principal {(p, k) : ℕ × ℕ | p.Prime}).limsup (fun (p, k) => (f (p^k) / (p^k : ℝ).log : EReal)) = ⊤) → diff --git a/FormalConjectures/ErdosProblems/90.lean b/FormalConjectures/ErdosProblems/90.lean index 115477d..262d0dd 100644 --- a/FormalConjectures/ErdosProblems/90.lean +++ b/FormalConjectures/ErdosProblems/90.lean @@ -14,7 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil + +@[expose] public section /-! # Erdős Problem 90: The unit distance problem diff --git a/FormalConjectures/ErdosProblems/901.lean b/FormalConjectures/ErdosProblems/901.lean new file mode 100644 index 0000000..7fdb842 --- /dev/null +++ b/FormalConjectures/ErdosProblems/901.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 901 + +*References:* +- [erdosproblems.com/901](https://www.erdosproblems.com/901) +- [Be77] Beck, J., On a combinatorial problem of {P}. {E}rdős and {L}. {L}ovász. Discrete Math. + (1977), 127--131. +- [Be78] Beck, J., On {$3$}-chromatic hypergraphs. Discrete Math. (1978), 127--137. +- [Er63b] Erdős, P., On a combinatorial problem. Nordisk Mat. Tidskr. (1963), 5--10, 40. +- [Er64e] Erdős, P., On a combinatorial problem. {II}. Acta Math. Acad. Sci. Hungar. (1964), + 445--447. +- [ErLo75] Erdős, P. and Lovász, L., Problems and results on {$3$}-chromatic hypergraphs and some + related questions. (1975), 609--627. +- [Pl09] Pluhár, András, Greedy colorings of uniform hypergraphs. Random Structures Algorithms + (2009), 216--221. +- [RaSr00] Radhakrishnan, Jaikumar and Srinivasan, Aravind, Improved bounds and algorithms for + hypergraph {$2$}-coloring. Random Structures Algorithms (2000), 4--32. +-/ + +@[expose] public section + +namespace Erdos901 + +open Filter Asymptotics + +def erdos_901.answer : ℕ → ℝ := sorry + +/-- +Let $m(n)$ be minimal such that there is an $n$-uniform hypergraph with $m(n)$ edges which is +$3$-chromatic. Estimate $m(n)$. +-/ +@[category research open, question value, AMS 5] +theorem erdos_901 : + (fun n ↦ ((Hypergraph.minChromaticEdges n 3).toNat : ℝ)) =Θ[atTop] + erdos_901.answer := by + sorry + +end Erdos901 diff --git a/FormalConjectures/ErdosProblems/902.lean b/FormalConjectures/ErdosProblems/902.lean new file mode 100644 index 0000000..b3402d7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/902.lean @@ -0,0 +1,176 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 902 + +*References:* +- [erdosproblems.com/902](https://www.erdosproblems.com/902) +- [Er63c] Erdős, P., *On a problem in graph theory*. Math. Gaz. 47 (1963), 220-223. + [PDF](https://www.renyi.hu/~p_erdos/1963-08.pdf) +- [Er82e] Erdős, Paul, *Some of my favourite problems which recently have been solved*. + (1982), 59-79. +- [SzSz65] Szekeres, E. and Szekeres, G., *On a problem of Schütte and Erdős*. Math. Gaz. 49 + (1965), 290-293. +-/ + +@[expose] public section + +open Filter Asymptotics + +namespace Erdos902 + +/-- `HasPropertyS G n` is Schütte's property $S_n$ [Er63c]: every set `E` of `n` vertices is +dominated by a vertex outside it, that is, some vertex `x ∉ E` has an edge to every vertex of +`E`. -/ +def HasPropertyS {V : Type*} (G : Digraph V) (n : ℕ) : Prop := + ∀ E : Finset V, E.card = n → ∃ x ∉ E, ∀ e ∈ E, G.Adj x e + +/-- $f(n)$: the least number of vertices of a tournament with property $S_n$. + +A tournament with fewer than $n$ vertices has no set of $n$ vertices, so it has property $S_n$ +vacuously; the condition `n ≤ m` excludes this case. -/ +noncomputable def f (n : ℕ) : ℕ := + sInf {m : ℕ | n ≤ m ∧ ∃ G : Digraph (Fin m), G.IsTournament ∧ HasPropertyS G n} + +/-- The cyclic tournament on three vertices, `a → a + 1`, has property $S_1$, so +$f(1) \leq 3$. -/ +@[category test, AMS 5] +theorem f_one_le : f 1 ≤ 3 := by + refine Nat.sInf_le ⟨by norm_num, ⟨fun a b => b = a + 1⟩, ⟨by decide, by decide⟩, ?_⟩ + intro E hE + obtain ⟨a, rfl⟩ := Finset.card_eq_one.1 hE + have key : ∀ a : Fin 3, a + 2 ≠ a ∧ a = a + 2 + 1 := by decide + refine ⟨a + 2, by simp [(key a).1], fun e he => ?_⟩ + rw [Finset.mem_singleton.1 he] + exact (key a).2 + +/-- Erdős's tournament on seven vertices [Er63c], with `a → a + 1, a + 2, a + 4` modulo $7$, +has property $S_2$, so $f(2) \leq 7$. -/ +@[category test, AMS 5] +theorem f_two_le : f 2 ≤ 7 := by + refine Nat.sInf_le ⟨by norm_num, ⟨fun a b => b - a ∈ ({1, 2, 4} : Finset (Fin 7))⟩, + ⟨by decide, by decide⟩, ?_⟩ + intro E hE + obtain ⟨a, b, hab, rfl⟩ := Finset.card_eq_two.1 hE + have key : ∀ a b : Fin 7, a ≠ b → ∃ x, x ≠ a ∧ x ≠ b ∧ + a - x ∈ ({1, 2, 4} : Finset (Fin 7)) ∧ b - x ∈ ({1, 2, 4} : Finset (Fin 7)) := by + decide + obtain ⟨x, hxa, hxb, ha, hb⟩ := key a b hab + refine ⟨x, by simp [hxa, hxb], fun e he => ?_⟩ + rcases Finset.mem_insert.1 he with rfl | he + · exact ha + · rw [Finset.mem_singleton.1 he] + exact hb + +def erdos_902.answer : ℕ → ℝ := sorry + +/-- +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)$. +-/ +@[category research open, question value, AMS 5] +theorem erdos_902 : (fun n ↦ (f n : ℝ)) =Θ[atTop] erdos_902.answer := by + sorry + +/-- +It is easy to check that $f(1)=3$ and $f(2)=7$. + +This is the statement for $f(1)$. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.f_one : f 1 = 3 := by + refine le_antisymm f_one_le (le_csInf ⟨3, ?_⟩ ?_) + · refine ⟨by norm_num, ⟨fun a b => b = a + 1⟩, ⟨by decide, by decide⟩, ?_⟩ + intro E hE + obtain ⟨a, rfl⟩ := Finset.card_eq_one.1 hE + have key : ∀ a : Fin 3, a + 2 ≠ a ∧ a = a + 2 + 1 := by decide + refine ⟨a + 2, by simp [(key a).1], fun e he => ?_⟩ + rw [Finset.mem_singleton.1 he] + exact (key a).2 + · rintro m ⟨hm, G, hG, hS⟩ + by_contra! hm3 + interval_cases m + · obtain ⟨x, hx, -⟩ := hS {0} rfl + exact hx (by simp [Subsingleton.elim x 0]) + · have h01 := hG.2 0 1 (by decide) + by_cases h : G.Adj 0 1 + · obtain ⟨x, hx, hx0⟩ := hS {0} rfl + have hx1 : x = 1 := by fin_cases x <;> simp_all + subst hx1 + exact h01.1 h (hx0 0 (by simp)) + · obtain ⟨x, hx, hx1⟩ := hS {1} rfl + have hx0 : x = 0 := by fin_cases x <;> simp_all + subst hx0 + exact h (hx1 1 (by simp)) + +/-- +It is easy to check that $f(1)=3$ and $f(2)=7$. + +This is the statement for $f(2)$. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.f_two : f 2 = 7 := by + sorry + +/-- +Erdős [Er63c] proved +$$2^{n+1}-1 \leq f(n) \ll n^22^n.$$ + +This is the lower bound. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.erdos_lower (n : ℕ) : 2 ^ (n + 1) - 1 ≤ f n := by + sorry + +/-- +Erdős [Er63c] proved +$$2^{n+1}-1 \leq f(n) \ll n^22^n.$$ + +This is the upper bound, in the form proved in [Er63c, (2)]: +$\limsup_n f(n)2^{-n}n^{-2} \leq \log 2$. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.erdos_upper : + ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, (f n : ℝ) ≤ (Real.log 2 + ε) * n ^ 2 * 2 ^ n := by + sorry + +/-- +Szekeres and Szekeres [SzSz65] proved that $f(3)=19$ and +$$n2^n \ll f(n).$$ + +This is the statement for $f(3)$. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.szekeres_f_three : f 3 = 19 := by + sorry + +/-- +Szekeres and Szekeres [SzSz65] proved that $f(3)=19$ and +$$n2^n \ll f(n).$$ + +This is the lower bound. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.szekeres_lower : + ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, c * n * 2 ^ n ≤ (f n : ℝ) := by + sorry + +end Erdos902 diff --git a/FormalConjectures/ErdosProblems/906.lean b/FormalConjectures/ErdosProblems/906.lean index 36df202..1222714 100644 --- a/FormalConjectures/ErdosProblems/906.lean +++ b/FormalConjectures/ErdosProblems/906.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 906 @@ -22,12 +23,14 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/906](https://www.erdosproblems.com/906) -/ +@[expose] public section + namespace Erdos906 /-- Does there exists an entire non-zero transcendental function `f : ℂ → ℂ` such that for any sequence `n₀ < n₁ < ...`, `{ z | ∃ k, iteratedDeriv (n k) f z = 0 }` is dense. -/ -@[category research open, AMS 30] -theorem erdos_906 : answer(sorry) ↔ ∃ f : ℂ → ℂ, Transcendental (Polynomial ℂ) f ∧ +@[category research open, question, AMS 30] +theorem erdos_906 : ∃ f : ℂ → ℂ, Transcendental (Polynomial ℂ) f ∧ Differentiable ℂ f ∧ ∀ n : ℕ → ℕ, StrictMono n → Dense { z | ∃ k, iteratedDeriv (n k) f z = 0 } := by sorry diff --git a/FormalConjectures/ErdosProblems/911.lean b/FormalConjectures/ErdosProblems/911.lean new file mode 100644 index 0000000..bd11e61 --- /dev/null +++ b/FormalConjectures/ErdosProblems/911.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 911 + +*References:* +- [erdosproblems.com/911](https://www.erdosproblems.com/911) +- [Er82e] Erdős, Paul, *Some of my favourite problems which recently have been solved*. + (1982), 59--79. +-/ + +@[expose] public section + +open Filter SimpleGraph + +namespace Erdos911 + +/-- +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$. + +Is there a function $f$ such that $f(x)/x\to \infty$ as $x\to \infty$ such that, for all large $C$, +if $G$ is a graph with $n$ vertices and $e\geq Cn$ edges then +$$\hat{R}(G) > f(C) e?$$ + +Here $\hat{R}(G)$ is `sizeRamsey G G`, and $G$ has at least one vertex (for $n = 0$ the +inequality fails trivially). +-/ +@[category research open, question, AMS 5] +theorem erdos_911 : + ∃ f : ℝ → ℝ, Tendsto (fun x ↦ f x / x) atTop atTop ∧ + ∃ C₀ : ℝ, ∀ C ≥ C₀, ∀ (n : ℕ) (G : SimpleGraph (Fin n)), 0 < n → + C * n ≤ (G.edgeSet.ncard : ℝ) → + f C * G.edgeSet.ncard < (sizeRamsey G G : ℝ) := by + sorry + +end Erdos911 diff --git a/FormalConjectures/ErdosProblems/913.lean b/FormalConjectures/ErdosProblems/913.lean index 4aa6e08..5d5bba6 100644 --- a/FormalConjectures/ErdosProblems/913.lean +++ b/FormalConjectures/ErdosProblems/913.lean @@ -42,7 +42,7 @@ theorem erdos_913 : answer(sorry) ↔ It is likely that there are infinitely many primes $p$ such that $8p^2 - 1$ is also prime. -/ @[category research open, AMS 11] -theorem erdos_913.variants.infinite_many_8p_sq_add_one_primes : +theorem erdos_913.variants.infinite_many_8p_sq_sub_one_primes : { p | p.Prime ∧ (8 * p ^ 2 - 1).Prime }.Infinite := by sorry diff --git a/FormalConjectures/ErdosProblems/918.lean b/FormalConjectures/ErdosProblems/918.lean index d3d9b34..8308a93 100644 --- a/FormalConjectures/ErdosProblems/918.lean +++ b/FormalConjectures/ErdosProblems/918.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 918 @@ -25,95 +26,121 @@ import FormalConjecturesUtil - [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. -/ +@[expose] public section + universe u -open scoped Cardinal +open scoped Cardinal Ordinal namespace Erdos918 /-- Is there a graph with $\aleph_2$ vertices and chromatic number $\aleph_2$ such that every subgraph on $\aleph_1$ vertices has chromatic number $\leq\aleph_0$? -/ -- Formalisation note: source material [ErHa68b] uses only induced subgraphs -@[category research open, AMS 5] +@[category research open, question, AMS 5] theorem erdos_918.parts.i : - answer(sorry) ↔ ∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ 2 ∧ G.chromaticCardinal = ℵ_ 2 ∧ + ∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ 2 ∧ G.chromaticCardinal = ℵ_ 2 ∧ ∀ (W : Set V) (_ : #W = ℵ₁), (G.induce W).chromaticCardinal ≤ ℵ₀ := by sorry /-- Is there a graph with $\aleph_{\omega+1}$ vertices and chromatic number $\aleph_1$ such that every subgraph on $\aleph_\omega$ vertices has chromatic number $\leq\aleph_0$? -/ -@[category research open, AMS 5] +-- Formalisation note: `ω` here is `Ordinal.omega0`, from `open scoped Ordinal`, as in 623.lean. +-- It is the fixed first infinite ordinal, not a variable: `variants.erdos_hajnal` settles every +-- finite `k` under GCH, and `ℵ_ω` is the limit of that family, so this asks the single next case. +@[category research open, question, AMS 5] theorem erdos_918.parts.ii : - answer(sorry) ↔ ∀ (ω : Ordinal), ∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ (ω + 1) ∧ G.chromaticCardinal = ℵ₁ ∧ ∀ (W : Set V) (_ : #W = ℵ_ ω), (G.induce W).chromaticCardinal ≤ ℵ₀ := by sorry /-- Is there a graph with $\aleph_2$ vertices and chromatic number $\aleph_2$ such that every subgraph on $\aleph_1$ vertices has chromatic number $\leq\aleph_0$? -/ --- Formalisation note: It is not clear whether this question for general subgraphs is open or not -@[category research open, AMS 5] +-- Formalisation note: for the `≤ ℵ₀` direction this is the same question as `parts.i`, not a +-- separate one. Every subgraph on `W` is contained in the induced subgraph on `W`, so its +-- chromatic cardinal is no larger; and the top subgraph induced on `W` has `coe` equal to +-- `G.induce W`. So the two quantifications are equivalent and the answers cannot differ. The +-- `= ℵ₀` pair below is genuinely different, because an edgeless subgraph has chromatic +-- cardinal `1`, and that is the source's own reason for the impossibility there. +@[category research open, question, AMS 5] theorem erdos_918.variants.all_subgraphs.parts.i : - answer(sorry) ↔ ∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ 2 ∧ G.chromaticCardinal = ℵ_ 2 ∧ + ∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ 2 ∧ G.chromaticCardinal = ℵ_ 2 ∧ ∀ (H : G.Subgraph) (_ : #H.verts = ℵ₁), H.coe.chromaticCardinal ≤ ℵ₀ := by sorry /-- Is there a graph with $\aleph_{\omega+1}$ vertices and chromatic number $\aleph_1$ such that every subgraph on $\aleph_\omega$ vertices has chromatic number $\leq\aleph_0$? -/ -@[category research open, AMS 5] +@[category research open, question, AMS 5] theorem erdos_918.variants.all_subgraphs.parts.ii : - answer(sorry) ↔ ∀ (ω : Ordinal), - ∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ (ω + 1) ∧ G.chromaticCardinal = ℵ₁ ∧ - ∀ (H : G.Subgraph) (_ : #H.verts = ℵ_ ω), H.coe.chromaticCardinal ≤ ℵ₀ := by + ∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ (ω + 1) ∧ G.chromaticCardinal = ℵ₁ ∧ + ∀ (H : G.Subgraph) (_ : #H.verts = ℵ_ ω), H.coe.chromaticCardinal ≤ ℵ₀ := by sorry -/-- A question of Erd\H{o}s and Hajnal [ErHa68b], who proved that for every finite $k$ -there is a graph with chromatic number $\aleph_1$ and $\aleph_k$ vertices where each subgraph on -less than $\aleph_k$ vertices has chromatic number $\leq \aleph_0$. -/ +/-- A question of Erd\H{o}s and Hajnal [ErHa68b], who proved, assuming the generalized continuum +hypothesis, that for every finite $k \geq 1$ there is a graph with chromatic number $\aleph_1$ and +$\aleph_k$ vertices where each subgraph on less than $\aleph_k$ vertices has chromatic number +$\leq \aleph_0$. -/ -- Formalisation note: the source is missing the assumption that the graph have ℵₖ vertices --- which can be found in [ErHa68b] -@[category research solved, AMS 5] -theorem erdos_918.variants.erdos_hajnal (k : ℕ) (hk : 0 < k) : ∃ (V : Type u) (G : SimpleGraph V), +-- which can be found in [ErHa68b, Corollary 1]. That corollary assumes the generalized continuum +-- hypothesis, stated here as `2 ^ c = Order.succ c` for every infinite cardinal `c`. +@[category research solved, AMS 5, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/82c9238052cac467baaf930d5dbe8ae6191a574c/erdos-918/Solution.lean#L56"] +theorem erdos_918.variants.erdos_hajnal (hGCH : ∀ c : Cardinal.{u}, ℵ₀ ≤ c → 2 ^ c = Order.succ c) + (k : ℕ) (hk : 0 < k) : ∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ k ∧ G.chromaticCardinal = ℵ₁ ∧ ∀ (W : Set V) (_ : #W < ℵ_ k), (G.induce W).chromaticCardinal ≤ ℵ₀ := by sorry -/-- In [ErHa69] the questions are stated with $= \aleph_0$ rather than $\leq\aleph_0$. This is +/-- In [Er69b] the questions are stated with $= \aleph_0$ rather than $\leq\aleph_0$. This is a likely typo since it can be shown that no such graph exists in this case. This is the first question with induced subgraphs. -/ -@[category textbook, AMS 5] +-- Formalisation note: the source states the impossibility for general subgraphs, in a +-- parenthetical, "assuming subgraph and not induced subgraph was intended". It does not +-- assert it for induced subgraphs, and the argument for the general case does not carry +-- over: an induced subgraph on `W` has chromatic cardinal at least that of any subgraph +-- on `W`, so the edgeless-subgraph argument is unavailable here. +@[category textbook, AMS 5, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/82c9238052cac467baaf930d5dbe8ae6191a574c/erdos-918/Solution.lean#L62"] theorem erdos_918.variants.eq_aleph_0.parts.i : ¬∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ 2 ∧ G.chromaticCardinal = ℵ_ 2 ∧ ∀ (W : Set V) (_ : #W = ℵ₁), (G.induce W).chromaticCardinal = ℵ₀ := by sorry -/-- In [ErHa69] the questions are stated with $= \aleph_0$ rather than $\leq\aleph_0$. This is +/-- In [Er69b] the questions are stated with $= \aleph_0$ rather than $\leq\aleph_0$. This is a likely typo since it can be shown that no such graph exists in this case. This is the first question with all subgraphs. -/ -@[category textbook, AMS 5] +@[category textbook, AMS 5, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/82c9238052cac467baaf930d5dbe8ae6191a574c/erdos-918/Solution.lean#L67"] theorem erdos_918.variants.eq_aleph_0_all_subgraphs.parts.i : ¬∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ 2 ∧ G.chromaticCardinal = ℵ_ 2 ∧ ∀ (H : G.Subgraph) (_ : #H.verts = ℵ₁), H.coe.chromaticCardinal = ℵ₀ := by sorry -/-- In [ErHa69] the questions are stated with $= \aleph_0$ rather than $\leq\aleph_0$. This is +/-- In [Er69b] the questions are stated with $= \aleph_0$ rather than $\leq\aleph_0$. This is a likely typo since it can be shown that no such graph exists in this case. This is the second question with induced subgraphs. -/ -@[category textbook, AMS 5] -theorem erdos_918.variants.eq_aleph_0.parts.ii (ω : Ordinal) : +-- Formalisation note: the source states the impossibility for general subgraphs, in a +-- parenthetical, "assuming subgraph and not induced subgraph was intended". It does not +-- assert it for induced subgraphs, and the argument for the general case does not carry +-- over: an induced subgraph on `W` has chromatic cardinal at least that of any subgraph +-- on `W`, so the edgeless-subgraph argument is unavailable here. +@[category textbook, AMS 5, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/82c9238052cac467baaf930d5dbe8ae6191a574c/erdos-918/Solution.lean#L72"] +theorem erdos_918.variants.eq_aleph_0.parts.ii : ¬∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ (ω + 1) ∧ G.chromaticCardinal = ℵ₁ ∧ ∀ (W : Set V) (_ : #W = ℵ_ ω), (G.induce W).chromaticCardinal = ℵ₀ := by sorry -/-- In [ErHa69] the questions are stated with $= \aleph_0$ rather than $\leq\aleph_0$. This is +/-- In [Er69b] the questions are stated with $= \aleph_0$ rather than $\leq\aleph_0$. This is a likely typo since it can be shown that no such graph exists in this case. This is the second question with all subgraphs. -/ -@[category textbook, AMS 5] -theorem erdos_918.variants.eq_aleph_0_all_subgraphs.parts.ii (ω : Ordinal) : +@[category textbook, AMS 5, formal_proof using lean4 at + "https://github.com/linrock/math-proofs/blob/82c9238052cac467baaf930d5dbe8ae6191a574c/erdos-918/Solution.lean#L78"] +theorem erdos_918.variants.eq_aleph_0_all_subgraphs.parts.ii : ¬∃ (V : Type u) (G : SimpleGraph V), #V = ℵ_ (ω + 1) ∧ G.chromaticCardinal = ℵ₁ ∧ ∀ (H : G.Subgraph) (_ : #H.verts = ℵ_ ω), H.coe.chromaticCardinal = ℵ₀ := by sorry diff --git a/FormalConjectures/ErdosProblems/931.lean b/FormalConjectures/ErdosProblems/931.lean index b90e2e2..601e5c3 100644 --- a/FormalConjectures/ErdosProblems/931.lean +++ b/FormalConjectures/ErdosProblems/931.lean @@ -61,8 +61,7 @@ theorem erdos_931.variants.additional_condition_nonempty : ∃ (k₁ k₂ : ℕ) (∏ j ∈ Finset.Icc 1 k₂, (n₂ + j)).primeFactors}.Nonempty := by use 10, 3, (by norm_num), (by norm_num) use (0, 13) - norm_num [Finset.prod_Icc_succ_top] - norm_num +decide [Nat.primeFactors, Nat.primeFactorsList] + decide +kernel /-- Erdős was unable to prove that if the two products have the same factors diff --git a/FormalConjectures/ErdosProblems/934.lean b/FormalConjectures/ErdosProblems/934.lean new file mode 100644 index 0000000..b1a85ce --- /dev/null +++ b/FormalConjectures/ErdosProblems/934.lean @@ -0,0 +1,183 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 934 + +*References:* +- [erdosproblems.com/934](https://www.erdosproblems.com/934) +- [Er88] Erdős, P., *Problems and results in combinatorial analysis and graph theory*. + Discrete Math. 72 (1988), 81-92. +- [BBPP83] Bermond, J.-C., Bond, J., Paoli, M. and Peyrat, C., *Graphs and interconnection + networks: diameter and vulnerability*. Surveys in Combinatorics (Southampton, 1983), London Math. + Soc. Lecture Note Ser. 82, Cambridge Univ. Press (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 Math. 81 (1990), 129-135. +- [CCJK22] Cambie, S., Cames van Batenburg, W., de Joannis de Verclos, R. and Kang, R. J., + *Maximising line subgraphs of diameter at most $t$*. SIAM J. Discrete Math. 36 (2022), + 939-950. [arXiv:2103.11898](https://arxiv.org/abs/2103.11898) +- [KMP26] Kumar, H., Mohar, B. and Pragada, S., *An improved bound for the strong clique index + of graphs*. [arXiv:2607.02698](https://arxiv.org/abs/2607.02698) (2026). +- [CvBK26] Cames van Batenburg, W. and Korsky, S., *Asymptotically attaining the Moore bound*. + [arXiv:2608.03965](https://arxiv.org/abs/2608.03965) (2026). +-/ + +@[expose] public section + +open Filter + +namespace Erdos934 + +/-- The graph `G` has two edges at distance at least `t`: there are edges `uv` and `wx` of `G` +such that every vertex of `{u, v}` is at graph distance at least `t` from every vertex of +`{w, x}`, i.e. the shortest path between the two edges has length at least `t`. We use the +extended distance `SimpleGraph.edist`, so vertices in different components are at distance `⊤`. +For `1 ≤ t` the two edges are automatically distinct (indeed vertex-disjoint): `t = 1` means +vertex-disjoint edges and `t = 2` means an induced `2K₂`. Only `1 ≤ t` is intended. -/ +def HasFarEdges {V : Type*} (G : SimpleGraph V) (t : ℕ) : Prop := + ∃ u v w x : V, G.Adj u v ∧ G.Adj w x ∧ + ∀ a ∈ ({u, v} : Set V), ∀ b ∈ ({w, x} : Set V), (t : ℕ∞) ≤ G.edist a b + +/-- `h t d` is $h_t(d)$: the least `m` such that every graph with at least `m` edges and maximum +degree at most `d` contains two edges at distance at least `t`. As in [CCJK22] and [KMP26], +"at least `m` edges" is used, so `h t d - 1` is the largest number of edges of a graph with +maximum degree at most `d` in which any two edges are at distance less than `t`, i.e. whose line +graph has diameter at most `t`. Graphs on `Fin n` for arbitrary `n` cover all finite graphs. The +set is nonempty (for example `3 * d ^ t / 2 + 1` belongs to it by [CCJK22, Theorem 6]), so +`sInf` is a genuine minimum. -/ +noncomputable def h (t d : ℕ) : ℕ := + sInf {m : ℕ | ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + (∀ v, (G.neighborSet v).ncard ≤ d) → m ≤ G.edgeSet.ncard → HasFarEdges G t} + +/-- If every graph with at least `m` edges and maximum degree at most `d` has two edges at +distance at least `t`, then `h t d ≤ m`. -/ +@[category API, AMS 5] +theorem h_le {t d m : ℕ} + (hm : ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + (∀ v, (G.neighborSet v).ncard ≤ d) → m ≤ G.edgeSet.ncard → HasFarEdges G t) : + h t d ≤ m := by + unfold h + exact Nat.sInf_le hm + +def erdos_934.answer : ℕ → ℕ → ℕ := sorry + +/-- +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]. Erdős wrote 'This problem seems to be interesting only +if there is a nice expression for $h_t(d)$.' We read "estimate" as asking for an exact +expression, as in that remark: `h t d = erdos_934.answer t d` for all `1 ≤ t` and all `d`. +-/ +@[category research open, question value, AMS 5] +theorem erdos_934 : ∀ t d : ℕ, 1 ≤ t → h t d = erdos_934.answer t d := by + sorry + +/-- +It is easy to see that $h_t(d)\leq 2d^t$ always and $h_1(d)=d+1$. + +The site (and [CCJK22, p. 1]) states $h_1(d)=d+1$ without restriction; it fails for $d=2$ (the +triangle has three pairwise intersecting edges, so $h_1(2)=4$), hence we assume $d\neq 2$. +-/ +@[category research solved, AMS 5] +theorem erdos_934.variants.h_one : ∀ d : ℕ, d ≠ 2 → h 1 d = d + 1 := by + sorry + +/-- +Erdős and Nešetřil and Bermond, Bond, Paoli, and Peyrat [BBPP83] independently conjectured that +$h_2(d) \leq \tfrac{5}{4}d^2+1$, with equality for even $d$. This was proved by Chung, Gyárfás, +Tuza, and Trotter [CGTT90]. +-/ +@[category research solved, AMS 5] +theorem erdos_934.variants.h_two : + (∀ d : ℕ, 4 * h 2 d ≤ 5 * d ^ 2 + 4) ∧ + ∀ d : ℕ, Even d → 4 * h 2 d = 5 * d ^ 2 + 4 := by + sorry + +/-- +Cambie, Cames van Batenburg, de Joannis de Verclos, and Kang [CCJK22, Theorem 2] proved that $h_3(3)=23$. +-/ +@[category research solved, AMS 5] +theorem erdos_934.variants.h_three_three : h 3 3 = 23 := by + sorry + +/-- +The same authors prove that for all $t\geq 1$ we have +$$h_t(d) \leq \tfrac{3}{2}d^t+1.$$ +See [CCJK22, Theorem 6]. Here the inequality is stated as `2 * h t d ≤ 3 * d ^ t + 2`. +-/ +@[category research solved, AMS 5] +theorem erdos_934.variants.upper : + ∀ t d : ℕ, 1 ≤ t → 2 * h t d ≤ 3 * d ^ t + 2 := by + sorry + +/-- +The same authors prove that, if $t$ is large, then there are infinitely many $d$ such that +$h_t(d) \geq 0.629^td^t$. See [CCJK22, Proposition 5]. +-/ +@[category research solved, AMS 5] +theorem erdos_934.variants.lower_large_t : + ∃ t₀ : ℕ, ∀ t : ℕ, t₀ ≤ t → + ∃ᶠ d : ℕ in atTop, ((629 : ℝ) / 1000) ^ t * (d : ℝ) ^ t ≤ (h t d : ℝ) := by + sorry + +/-- +Cambie, Cames van Batenburg, de Joannis de Verclos, and Kang [CCJK22] conjectured that +$h_3(d) \leq d^3-d^2+d+2$ (with equality if $d-1$ is a prime power; the site writes "if and only +if", while [CCJK22, Conjecture 1] says "if"). Kumar, Mohar and Pragada [KMP26, Lemma 3.1] +refute the inequality: the odd graph $KG(7,3)$ has $35$ vertices, is $4$-regular, has $70$ edges +and any two of its edges are at distance less than $3$, so $h_3(4)\geq 71 > 54$. +-/ +@[category research solved, AMS 5] +theorem erdos_934.variants.kmp_h_three_four : 71 ≤ h 3 4 := by + sorry + +/-- +The inequality $h_3(d) \leq d^3-d^2+d+2$ conjectured in [CCJK22] is false [KMP26, Conjecture 1.9 +and Lemma 3.1]. Here the inequality is stated as `h 3 d + d ^ 2 ≤ d ^ 3 + d + 2`. +-/ +@[category research solved, AMS 5] +theorem erdos_934.variants.ccjk_conjecture_false : + ¬ ∀ d : ℕ, h 3 d + d ^ 2 ≤ d ^ 3 + d + 2 := by + sorry + +/-- +Kumar, Mohar and Pragada [KMP26, Theorem 1.11] proved +$$\liminf_{d\to\infty}\frac{h_3(d)}{d^3}\geq \frac{253}{225}.$$ +In particular the conjecture of [CCJK22] that $h_t(d)\leq (1+o(1))d^t$ is false for $t=3$. +-/ +@[category research solved, AMS 5] +theorem erdos_934.variants.kmp_liminf : + ∀ ε > (0 : ℝ), ∀ᶠ d : ℕ in atTop, (253 / 225 - ε) * (d : ℝ) ^ 3 ≤ (h 3 d : ℝ) := by + sorry + +/-- +For every fixed $t\geq 2$, $\liminf_{d\to\infty} h_t(d)/d^t \geq 1$ [CvBK26, Corollary 1.2]. This +confirms, in a strong form, the conjecture of [CCJK22] that $h_t(d)\geq (1-o(1))d^t$ for +infinitely many $d$. +-/ +@[category research solved, AMS 5] +theorem erdos_934.variants.lower_liminf : + ∀ t : ℕ, 2 ≤ t → ∀ ε > (0 : ℝ), ∀ᶠ d : ℕ in atTop, + (1 - ε) * (d : ℝ) ^ t ≤ (h t d : ℝ) := by + sorry + +end Erdos934 diff --git a/FormalConjectures/ErdosProblems/938.lean b/FormalConjectures/ErdosProblems/938.lean index f1a12d9..c164f95 100644 --- a/FormalConjectures/ErdosProblems/938.lean +++ b/FormalConjectures/ErdosProblems/938.lean @@ -13,14 +13,18 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 938 *Reference:* [erdosproblems.com/938](https://www.erdosproblems.com/938) -/ + +@[expose] public section + open Nat namespace Erdos938 @@ -29,8 +33,8 @@ namespace Erdos938 Let $A=\{n_1 < n_2 < \cdots\}$ be the sequence of powerful numbers (if $p\mid n$ then $p^2\mid n$). Are there only finitely many three-term progressions of consecutive terms $n_k,n_{k+1},n_{k+2}$? -/ -@[category research open, AMS 11] -theorem erdos_938 : answer(sorry) ↔ {P : Finset ℕ | (P : Set ℕ).IsAPOfLength 3 ∧ ∃ k, +@[category research open, question, AMS 11] +theorem erdos_938 : {P : Finset ℕ | (P : Set ℕ).IsAPOfLength 3 ∧ ∃ k, P = {nth Powerful k, nth Powerful (k + 1), nth Powerful (k + 2)}}.Finite := by sorry diff --git a/FormalConjectures/ErdosProblems/939.lean b/FormalConjectures/ErdosProblems/939.lean index bc9df98..04c55e4 100644 --- a/FormalConjectures/ErdosProblems/939.lean +++ b/FormalConjectures/ErdosProblems/939.lean @@ -13,49 +13,97 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 939 -*Reference:* [erdosproblems.com/939](https://www.erdosproblems.com/939) +*References:* +- [erdosproblems.com/939](https://www.erdosproblems.com/939) +- [Ni95] Nitaj, A., _On a conjecture of Erdős on 3-powerful numbers_. Bull. London Math. Soc. + (1995), 317-318. +- [Co98] Cohn, J. H. E., _A conjecture of Erdős on 3-powerful numbers_. Math. Comp. (1998), + 439-440. +- [Wa24] Walsh, P., _A question of Erdős on 3-powerful numbers and an elliptic curve analogue + of the Ankeny-Artin-Chowla conjecture_. arXiv:2404.03970 (2024). +- [LaPa67] Lander, L. J. and Parkin, T. R., _A counterexample to Euler's sum of powers + conjecture_. Math. Comp. (1967), 101-103. -/ + +@[expose] public section + open Nat namespace Erdos939 /-- A set `S` belongs to `Erdos939Sums r` if it meets the following criteria: +- The elements are positive. `0` has no prime factors, so it is vacuously `r`-powerful, and + the source means positive integers. - The size of the set is `$|S| = r - 2$`. - The elements of the set are coprime (their greatest common divisor is 1). - Every element in `S` is an `$r$-powerful` number. - The sum of the elements in `S`, i.e., `$\sum_{s \in S} s$`, is also an `$r$-powerful` number. + +The summands are taken to be distinct (`S` is a `Finset`). The source does not say whether +repeated summands are allowed; all known examples and constructions use distinct summands. -/ def Erdos939Sums (r : ℕ) := - {S : Finset ℕ | S.card = r - 2 ∧ S.Coprime ∧ r.Full (∑ s ∈ S, s) ∧ ∀ s ∈ S, r.Full s} + {S : Finset ℕ | S.card = r - 2 ∧ S.Coprime ∧ r.Full (∑ s ∈ S, s) ∧ + ∀ s ∈ S, 0 < s ∧ r.Full s} /-- If $r≥4$ then can the sum of $r-2$ coprime $r$-powerful numbers ever be itself $r$-powerful? -/ -@[category research open, AMS 11] -theorem erdos_939 : answer(sorry) ↔ ∀ r ≥ 4, (Erdos939Sums r).Nonempty := by +@[category research open, question, AMS 11] +theorem erdos_939 : ∀ r ≥ 4, (Erdos939Sums r).Nonempty := by sorry /-- -If $r≥4$ are there infinitely many sums of $r-2$ coprime $r$-powerful numbers +If $r≥4$, are there at most finitely many sums of $r-2$ coprime $r$-powerful numbers that are themselves $r$-powerful? + +The answer is no: for every $r \ge 6$ there are infinitely many such sums, see +`erdos_939.variants.infinite_of_six_le`. (For $r = 4$ and $r = 5$ the question is open; for +$r = 4$ no example is known at all, see `erdos_939`.) +A construction in the site's comments, from GPT-5.5 Pro prompted by Price, gives infinitely +many for every $r \ge 6$. This statement quantifies over every $r \ge 4$, so it stays open at +$r = 4$ and $r = 5$. The category is unchanged because the construction is recorded in the +comments and not in the literature. +-/ +@[category research solved, question, AMS 11] +theorem erdos_939.variants.finite : ¬ ∀ r ≥ 4, (Erdos939Sums r).Finite := by + sorry + +/-- +For every $r \ge 6$ there are infinitely many sums of $r - 2$ coprime $r$-powerful numbers that +are themselves $r$-powerful. + +A construction, found by GPT-5.5 Pro prompted by Liam Price and recorded in the comments on +[erdosproblems.com/939](https://www.erdosproblems.com/forum/thread/939), expands +$(X+Y)^r = (X-Y)^r + \sum_{j \text{ odd}} 2\binom{r}{j} X^{r-j} Y^j$, splits the $j = 3$ term into +$\lfloor r/2 \rfloor - 2$ distinct pieces to obtain exactly $r - 2$ summands, and takes +$X = q^r$, $Y = B^r$ with $B$ divisible by all primes in the coefficients and $q > B$ a prime not +dividing $B$; varying $q$ gives infinitely many solutions. -/ -@[category research open, AMS 11] -theorem erdos_939.variants.infinite : answer(sorry) ↔ ∀ r ≥ 4, (Erdos939Sums r).Infinite := by +@[category research solved, AMS 11] +theorem erdos_939.variants.infinite_of_six_le : ∀ r ≥ 6, (Erdos939Sums r).Infinite := by sorry /-- Are there infinitely many triples of coprime $3$-powerful numbers $a, b, c$ such that $a + b = c$? + +The answer is yes. Nitaj [Ni95] proved it, with $2^3\cdot 3^5\cdot 73^3 + 271^3 = 919^3$ as an +example. In Nitaj's construction at least two of $a, b, c$ are perfect cubes. Cohn [Co98] +constructed infinitely many triples of which none is a perfect cube, and Walsh [Wa24] gave a +further construction. -/ -@[category research open, AMS 11] +@[category research solved, question, AMS 11] theorem erdos_939.variants.triples : - answer(sorry) ↔ {(a,b,c) | ({a, b, c} : Finset ℕ).Coprime ∧ + {(a,b,c) | ({a, b, c} : Finset ℕ).Coprime ∧ + 0 < a ∧ 0 < b ∧ (3).Full a ∧ (3).Full b ∧ (3).Full c ∧ a + b = c}.Infinite := by sorry @@ -63,7 +111,7 @@ theorem erdos_939.variants.triples : /-- Cambie has found several examples of the sum of $r - 2$ coprime $r$-powerful numbers being itself $r$-powerful. For example when $r=5$ we have -$$3761^5=2^8\cdot3^{10}\cdot 5^7 + 2^{12}\cdot 23^6 + 11^5\cdot 13^5$$. +$$3^7\cdot 61^5 = 2^8\cdot3^{10}\cdot 5^7 + 2^{12}\cdot 23^6 + 11^5\cdot 13^5$$. -/ @[category research solved, AMS 11] theorem erdos_939.variants.examples : (∃ r ≥ 4, (Erdos939Sums r).Nonempty) := by @@ -84,7 +132,13 @@ theorem erdos_939.variants.examples : (∃ r ≥ 4, (Erdos939Sums r).Nonempty) : theorem erdos_939.variants.seven : (Erdos939Sums 7).Nonempty := by sorry -/-- Cambie has also found solutions when $r=8$. -/ +/-- +Cambie has also found solutions when $r=8$. + +The source adds that the $r=8$ solution works "even with the sum of $5$ $8$-powerful numbers". +That is a stronger result than this statement, which asks for the $r - 2 = 6$ summands of +`Erdos939Sums`. +-/ @[category research solved, AMS 11] theorem erdos_939.variants.eight : (Erdos939Sums 8).Nonempty := by sorry @@ -94,19 +148,17 @@ Euler had conjectured that the sum of $k - 1$ many $k$-th powers is never a $k$-th power, but this is false for $k=5$, as Lander and Parkin [LaPa67] found $$27^5+84^5+110^5+133^5=144^5$$. -[LaPa67] Lander, L. J. and Parkin, T. R., "A counterexample to Euler's sum of powers conjecture." - Math. Comp. (1967), 101--103. +The summands must be positive. Without that condition a set containing `0` would count, so the +negation would be satisfied by a sum of fewer than $k-1$ powers and would claim less than the +refutation of Euler's conjecture that this theorem records. -/ @[category research solved, AMS 11] theorem erdos_939.variants.euler : ¬ (∀ k ≥ 4, ∀ S : Finset ℕ, S.card = k - 1 → - ¬ (∃ q, ∑ s ∈ S, s ^ k = q ^k)) := by + (∀ s ∈ S, 0 < s) → ¬ (∃ q, ∑ s ∈ S, s ^ k = q ^k)) := by push Not use 5 norm_num use {27, 84, 110, 133} - constructor - · decide - · use 144 - norm_num + refine ⟨by decide, by decide, 144, by norm_num⟩ end Erdos939 diff --git a/FormalConjectures/ErdosProblems/94.lean b/FormalConjectures/ErdosProblems/94.lean index f2a23ed..4ae611a 100644 --- a/FormalConjectures/ErdosProblems/94.lean +++ b/FormalConjectures/ErdosProblems/94.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 94 @@ -29,6 +30,8 @@ import FormalConjecturesUtil (1995), 379-408. -/ +@[expose] public section + open Filter EuclideanGeometry namespace Erdos94 @@ -56,8 +59,8 @@ Note it is trivial that $\sum f(u_i)=\binom{n}{2}$. -/ @[category test, AMS 5 52] theorem erdos_94.variants.sum_multiplicity (P : Finset ℝ²) : - ∑ u ∈ distanceSet P, distanceMultiplicity P u = P.card.choose 2 := by - sorry + ∑ u ∈ distanceSet P, distanceMultiplicity P u = P.card.choose 2 := + sum_distanceMultiplicity P /-- Lefmann and Theile [LeTh95] prove a stronger version of this question, that diff --git a/FormalConjectures/ErdosProblems/940.lean b/FormalConjectures/ErdosProblems/940.lean index 0e3f049..7e2fd82 100644 --- a/FormalConjectures/ErdosProblems/940.lean +++ b/FormalConjectures/ErdosProblems/940.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 940 @@ -27,6 +28,8 @@ import FormalConjecturesUtil (1988), 137-163. -/ +@[expose] public section + open Filter namespace Erdos940 @@ -35,9 +38,9 @@ namespace Erdos940 Let $r \ge 3$. Is it true that the set of integers which are the sum of at most $r$ $r$-powerful numbers has density $0$? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_940 : - answer(sorry) ↔ ∀ r ≥ 3, + ∀ r ≥ 3, {n : ℕ | ∃ (S : Multiset ℕ), S.card ≤ r ∧ (∀ s ∈ S, r.Full s) ∧ n = S.sum}.HasDensity 0 := by sorry @@ -59,21 +62,19 @@ The cubes are those of non-negative integers, which is what `Multiset ℕ` gives decides the question: over `ℤ` a sum of three cubes is conjectured to represent every integer that is not $\pm 4 \bmod 9$, which is density $7/9$. -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_940.variants.three_cubes : - answer(sorry) ↔ {n : ℕ | ∃ (S : Multiset ℕ), S.card ≤ 3 ∧ n = (Multiset.map (· ^ 3) S).sum}.HasDensity 0 := by sorry /-- -Let $r \ge 3$. It is not known if all large integers are the sum of at most $r$-many -$r$-powerful numbers. +Let $r \ge 3$. Are there infinitely many integers which are not the sum of at most $r$-many +$r$-powerful numbers? -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_940.variants.large_integers : - answer(sorry) ↔ - ∀ r ≥ 3, (∀ᶠ x in atTop, ∃ (S : Multiset ℕ), S.card ≤ r ∧ (∀ s ∈ S, r.Full s) ∧ x = S.sum) := by + ∀ r ≥ 3, ¬ (∀ᶠ x in atTop, ∃ (S : Multiset ℕ), S.card ≤ r ∧ (∀ s ∈ S, r.Full s) ∧ x = S.sum) := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/955.lean b/FormalConjectures/ErdosProblems/955.lean index f2aad3d..85bb14b 100644 --- a/FormalConjectures/ErdosProblems/955.lean +++ b/FormalConjectures/ErdosProblems/955.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 955 @@ -31,12 +32,16 @@ import FormalConjecturesUtil (2018), 330--342. - [Po14b] Pollack, Paul, Some arithmetic properties of the sum of proper divisors and the sum of prime divisors. Illinois J. Math. (2014), 125--147. +- [PoPo16] Pollack, Paul and Pomerance, Carl, Some problems of Erdős on the sum-of-divisors + function. Trans. Amer. Math. Soc. Ser. B (2016), 1--26. - [Tr15] Troupe, Lee, On the number of prime factors of values of the sum-of-proper-divisors function. J. Number Theory (2015), 120--135. - [Tr20] Troupe, Lee, Divisor sums representable as the sum of two squares. Proc. Amer. Math. Soc. (2020), 4189--4202. -/ +@[expose] public section + open Nat Filter open scoped ArithmeticFunction ArithmeticFunction.sigma Topology @@ -67,10 +72,9 @@ If $A\subset \mathbb{N}$ has density $0$ then $s^{-1}(A)$ must also have density A conjecture of Erdős, Granville, Pomerance, and Spiro [EGPS90]. -/ -@[category research open, AMS 11] +@[category research open, question, AMS 11] theorem erdos_955 : - answer(sorry) ↔ - ∀ A : Set ℕ, A.HasDensity 0 → { x | s x ∈ A }.HasDensity 0 := by + ∀ A : Set ℕ, A.HasDensity 0 → { x | s x ∈ A }.HasDensity 0 := by sorry /-- @@ -84,10 +88,15 @@ theorem erdos_955.variants.positive_density : /-- Erdős [Er73b] proved that there are sets $A$ of positive density such that $s^{-1}(A)$ is empty. + +Here "positive density" means positive lower density: Erdős proved that the set of untouchable +numbers (those not of the form $s(n)$) has positive lower density [Er73b, Satz I]. Pollack and +Pomerance [PoPo16] conjecture that this set has a natural density and give a heuristic for its +value. The same result is stated as `erdos_418.variants.sigma` in Erdős Problem 418. -/ @[category research solved, AMS 11] theorem erdos_955.variants.empty_preimage : - ∃ A : Set ℕ, (∃ d > 0, A.HasDensity d) ∧ { x | s x ∈ A } = ∅ := by + ∃ A : Set ℕ, 0 < A.lowerDensity ∧ { x | s x ∈ A } = ∅ := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/959.lean b/FormalConjectures/ErdosProblems/959.lean index 444fc2f..05724a4 100644 --- a/FormalConjectures/ErdosProblems/959.lean +++ b/FormalConjectures/ErdosProblems/959.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 959 @@ -22,10 +23,11 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/959](https://www.erdosproblems.com/959) -/ +@[expose] public section + namespace Erdos959 open EuclideanGeometry Filter -open scoped Topology noncomputable section @@ -69,6 +71,8 @@ def extremalGap (n : ℕ) : ℕ := by classical exact Nat.findGreatest (AttainableGap n) (Nat.choose n 2) +def erdos_959.answer : ℕ → ℝ := sorry + /-- Let $A\subseteq \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 @@ -76,13 +80,10 @@ the distance $d$ is determined, ordered so 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$ (this is `extremalGap n`). - -The asymptotic order of `extremalGap` is not known; a natural formalization of -"estimate" asks whether it has a well-defined polynomial growth exponent. -/ -@[category research open, AMS 52] -theorem erdos_959 : answer(sorry) ↔ - ∃ γ : ℝ, Tendsto (fun n : ℕ => Real.log (extremalGap n) / Real.log n) atTop (𝓝 γ) := by +@[category research open, question value, AMS 52] +theorem erdos_959 : + (fun n ↦ (extremalGap n : ℝ)) =Θ[atTop] erdos_959.answer := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/961.lean b/FormalConjectures/ErdosProblems/961.lean index 092d4f3..ca1d86f 100644 --- a/FormalConjectures/ErdosProblems/961.lean +++ b/FormalConjectures/ErdosProblems/961.lean @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil /-! # Erdős Problem 961 @@ -24,6 +26,8 @@ import FormalConjecturesUtil - [RaSh73](https://eudml.org/doc/urn:eudml:doc:205214) Ramachandra, K. and Shorey, T. N., On gaps between numbers with a large prime factor. Acta Arith. (1973), 99--111. -/ +@[expose] public section + open Filter Real namespace Erdos961 @@ -68,8 +72,8 @@ noncomputable def f (k : ℕ) : ℕ := /-- It is conjectured that $f(k) \ll (\log k)^O(1)$. -/ -@[category research open, AMS 11] -theorem erdos_961 : answer(sorry) ↔ ∃ C : ℕ, ∀ᶠ k : ℕ in atTop, f k < log k ^ C := by +@[category research open, question, AMS 11] +theorem erdos_961 : ∃ C : ℕ, ∀ᶠ k : ℕ in atTop, f k < log k ^ C := by sorry /-- diff --git a/FormalConjectures/ErdosProblems/967.lean b/FormalConjectures/ErdosProblems/967.lean index 6efdee8..958e4d5 100644 --- a/FormalConjectures/ErdosProblems/967.lean +++ b/FormalConjectures/ErdosProblems/967.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 967 @@ -26,6 +27,8 @@ import FormalConjecturesUtil - [Yi25] Yip, F., *On a problem of Erdős and Ingham*. arXiv:2512.16528 (2025). -/ +@[expose] public section + open Filter open scoped Topology @@ -46,10 +49,10 @@ $1+\sum_{k}\frac{1}{a_k^{1+it}}=0$. This was formalized in Lean by Wu using Aristotle. -/ -@[category research solved, AMS 11 30, formal_proof using lean4 at -"https://gist.github.com/llllvvuu/d25f037d1f1000bdabd6ca928c74c9bb"] -theorem erdos_967 : answer(False) ↔ - ∀ a : ℕ → ℕ, StrictMono a → 1 < a 0 → Summable (fun k : ℕ => 1 / (a k : ℝ)) → +@[category research solved, question, AMS 11 30, formal_proof using lean4 at +"https://gist.githubusercontent.com/llllvvuu/d25f037d1f1000bdabd6ca928c74c9bb/raw/c2d3e4ed5d88520993b508f84be029cf8808f565/967.lean"] +theorem erdos_967 : + ¬ ∀ a : ℕ → ℕ, StrictMono a → 1 < a 0 → Summable (fun k : ℕ => 1 / (a k : ℝ)) → ∀ t : ℝ, 1 + (∑' k, summand t (a k)) ≠ 0 := by sorry @@ -67,8 +70,8 @@ theorem erdos_967.variants.yip (t : ℝ) (ht : t ≠ 0) : /-- It remains open whether this is true for every finite sequence of integers. -/ -@[category research open, AMS 11 30] -theorem erdos_967.variants.finite : answer(sorry) ↔ +@[category research open, question, AMS 11 30] +theorem erdos_967.variants.finite : ∀ A : Finset ℕ, (∀ n ∈ A, 1 < n) → ∀ t : ℝ, 1 + (∑ n ∈ A, summand t n) ≠ 0 := by sorry @@ -76,8 +79,8 @@ theorem erdos_967.variants.finite : answer(sorry) ↔ A question of Erdős and Ingham [ErIn64]. The simplest case they could not decide this question for was the finite sequence $\{2,3,5\}$. -/ -@[category research open, AMS 11 30] -theorem erdos_967.variants.two_three_five : answer(sorry) ↔ +@[category research open, question, AMS 11 30] +theorem erdos_967.variants.two_three_five : ∀ t : ℝ, 1 + (∑ n ∈ ({2, 3, 5} : Finset ℕ), summand t n) ≠ 0 := by sorry diff --git a/FormalConjectures/ErdosProblems/969.lean b/FormalConjectures/ErdosProblems/969.lean new file mode 100644 index 0000000..4e47cd5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/969.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. +-/ + +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 969 + +*References:* +- [Erdős Problem 969](https://www.erdosproblems.com/969) +- Moser, L. and MacLeod, R. A., *The error term for the squarefree integers*. + Canadian Mathematical Bulletin **9** (1966), 303–306. + https://doi.org/10.4153/CMB-1966-039-4 +-/ + +@[expose] public section + +namespace Erdos969 + +open Filter Asymptotics + +/-- The squarefree counting function `Q(x)`. -/ +def squarefreeCounting (x : ℕ) : ℕ := + ((Finset.Icc 1 x).filter Squarefree).card + +/-- Exactly seven integers in $[1,10]$ are squarefree, including $1$. -/ +@[category test, AMS 11] +theorem squarefreeCounting_ten : squarefreeCounting 10 = 7 := by + decide +kernel + +/-- The error term in `Q(x) = (6 / π^2) x + E(x)`. -/ +noncomputable def squarefreeCountingError (x : ℕ) : ℝ := + (squarefreeCounting x : ℝ) - 6 / Real.pi ^ 2 * x + +def erdos_969.answer : ℕ → ℝ := sorry + +/-- Let $Q(x)$ count the squarefree integers in $[1,x]$, and define $E(x)$ by +$$Q(x)=\frac{6}{\pi^2}x+E(x).$$ +Determine the order of magnitude of $E(x)$: an upper bound $E(x)=O(g(x))$ with a matching +oscillation bound $E(x)\ne o(g(x))$. -/ +@[category research open, question value, AMS 11] +theorem erdos_969 : + let g := erdos_969.answer + (fun x => |squarefreeCountingError x|) =O[atTop] g ∧ + ¬(fun x => |squarefreeCountingError x|) =o[atTop] g := by + sorry + +/-- The prime number theorem implies $E(x)=o(\sqrt{x})$. -/ +@[category research solved, AMS 11] +theorem erdos_969.variants.prime_number_theorem : + (fun x => |squarefreeCountingError x|) =o[atTop] (fun x : ℕ => (x : ℝ).sqrt) := by + sorry + +/-- Evelyn and Linfoot proved $E(x)=\Omega(x^{1/4})$. -/ +@[category research solved, AMS 11] +theorem erdos_969.variants.evelyn_linfoot : + ¬(fun x => |squarefreeCountingError x|) =o[atTop] + (fun x : ℕ => (x : ℝ) ^ (1 / 4 : ℝ)) := by + sorry + +end Erdos969 diff --git a/FormalConjectures/ErdosProblems/97.lean b/FormalConjectures/ErdosProblems/97.lean index 8d173e6..2ea0447 100644 --- a/FormalConjectures/ErdosProblems/97.lean +++ b/FormalConjectures/ErdosProblems/97.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 97 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/97](https://www.erdosproblems.com/97) -/ +@[expose] public section + open EuclideanGeometry open Real @@ -72,9 +75,9 @@ def HasNUnitDistanceProperty (n : ℕ) (A : Finset ℝ²) : Prop := /-- Does every convex polygon have a vertex with no other 4 vertices equidistant from it? -/ -@[category research open, AMS 52] +@[category research open, question, AMS 52] theorem erdos_97 : - answer(sorry) ↔ ∀ A : Finset ℝ², A.Nonempty → ConvexIndep A → ¬HasNEquidistantProperty 4 A := by + ∀ A : Finset ℝ², A.Nonempty → ConvexIndep A → ¬HasNEquidistantProperty 4 A := by sorry /-- @@ -93,7 +96,7 @@ theorem erdos_97.variants.three_equidistant : let A₂ : ℝ² := !₂[(√3), -1] let A₃ : ℝ² := !₂[0, 2] let B₁ : ℝ² := !₂[(-8991 / 10927 * √3), -26503 / 10927] - let B₂ : ℝ² := !₂[(-17747 / 10947 * √3), -235 / 10927] + let B₂ : ℝ² := !₂[(17747 / 10927 * √3), -235 / 10927] let B₃ : ℝ² := !₂[(-8756 / 10927 * √3), 26738 / 10927] let C₁ : ℝ² := !₂[(-10753 / 18529 * √3), -44665 / 18529] let C₂ : ℝ² := !₂[(27709 / 18529 * √3), 6203 / 18529] @@ -105,8 +108,8 @@ theorem erdos_97.variants.three_equidistant : Erdős also conjectured that there is a $k$ for which every convex polygon has a vertex with no other $k$ vertices equidistant from it. -/ -@[category research open, AMS 52] -theorem erdos_97.variants.k_equidistant : answer(sorry) ↔ +@[category research open, question, AMS 52] +theorem erdos_97.variants.k_equidistant : ∃ k : ℕ, ∀ A : Finset ℝ², A.Nonempty → ConvexIndep A → ¬HasNEquidistantProperty k A := by sorry diff --git a/FormalConjectures/ErdosProblems/971.lean b/FormalConjectures/ErdosProblems/971.lean index b534c40..2a7d720 100644 --- a/FormalConjectures/ErdosProblems/971.lean +++ b/FormalConjectures/ErdosProblems/971.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 971 @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [erdosproblems.com/971](https://www.erdosproblems.com/971) -/ +@[expose] public section + namespace Erdos971 open Filter Finset Real @@ -35,8 +38,8 @@ Let `p(a, d)` be the least prime congruent to `a (mod d)`. Does there exist a constant `c > 0` such that for all large `d`, `p(a, d) > (1 + c) * φ(d) * log d` for `≫ φ(d)` many values of `a`? -/ -@[category research open, AMS 11] -theorem erdos_971 : answer(sorry) ↔ +@[category research open, question, AMS 11] +theorem erdos_971 : ∃ c > (0 : ℝ), ∃ C > (0 : ℝ), ∀ᶠ d in atTop, C * (d.totient : ℝ) ≤ #{a < d | a.Coprime d ∧ (leastCongruentPrime a d : ℝ) > (1 + c) * d.totient * log d} := by diff --git a/FormalConjectures/ErdosProblems/976.lean b/FormalConjectures/ErdosProblems/976.lean new file mode 100644 index 0000000..447909a --- /dev/null +++ b/FormalConjectures/ErdosProblems/976.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 976 + +*References:* +- [erdosproblems.com/976](https://www.erdosproblems.com/976) +- [Er52c] Erdős, P., *On the greatest prime factor of $\prod_{k=1}^x f(k)$*. J. London Math. Soc. + 27 (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. +- [Na22] Nagell, T., Abh. Math. Sem. Hamburg 1 (1922), 179-194. +- [Ri34] Ricci, G., Annali di Mat. (1934), 295-303. +- [Te90] Tenenbaum, G., *Sur une question d'Erdős et Schinzel*. A tribute to Paul Erdős (1990), + 405-443. +-/ + +@[expose] public section + +open Filter Asymptotics Polynomial + +namespace Erdos976 + +/-- $F_f(n)$, the greatest prime divisor of $\prod_{1\leq m\leq n} f(m)$. If $f$ has no integer +root the product is nonzero; `Nat.maxPrimeFac` of $0$ or $1$ is a junk value that does not +matter for large $n$. -/ +noncomputable def F (f : ℤ[X]) (n : ℕ) : ℕ := + (∏ m ∈ Finset.Icc 1 n, f.eval (m : ℤ)).natAbs.maxPrimeFac + +def erdos_976.answer : ℤ[X] → ℕ → ℝ := sorry + +/-- +Let $f\in \mathbb{Z}[x]$ be an irreducible polynomial of degree $d\geq 2$. Let $F_f(n)$ be maximal +such that there exists $1\leq m\leq n$ with $f(m)$ is divisible by a prime $\geq F_f(n)$. +Equivalently, $F_f(n)$ is the greatest prime divisor of +$$\prod_{1\leq m\leq n}f(m).$$ +Estimate $F_f(n)$. + +We read "estimate" as determining the order of magnitude of $F_f(n)$. +-/ +@[category research open, question value, AMS 11] +theorem erdos_976 (f : ℤ[X]) (hf : Irreducible f) (hd : 2 ≤ f.natDegree) : + (fun n ↦ (F f n : ℝ)) =Θ[atTop] erdos_976.answer f := by + sorry + +/-- +Let $f\in \mathbb{Z}[x]$ be an irreducible polynomial of degree $d\geq 2$, and let $F_f(n)$ be the +greatest prime divisor of $\prod_{1\leq m\leq n}f(m)$. Is it true that $F_f(n)\gg n^{1+c}$ for some +constant $c>0$? +-/ +@[category research open, question, AMS 11] +theorem erdos_976.parts.i : + ∀ f : ℤ[X], Irreducible f → 2 ≤ f.natDegree → + ∃ c > (0 : ℝ), (fun n : ℕ ↦ (n : ℝ) ^ (1 + c)) =O[atTop] fun n ↦ (F f n : ℝ) := by + sorry + +/-- +Let $f\in \mathbb{Z}[x]$ be an irreducible polynomial of degree $d\geq 2$, and let $F_f(n)$ be the +greatest prime divisor of $\prod_{1\leq m\leq n}f(m)$. Is it true that $F_f(n)\gg n^d$? +-/ +@[category research open, question, AMS 11] +theorem erdos_976.parts.ii : + ∀ f : ℤ[X], Irreducible f → 2 ≤ f.natDegree → + (fun n : ℕ ↦ (n : ℝ) ^ f.natDegree) =O[atTop] fun n ↦ (F f n : ℝ) := by + sorry + +/-- +Nagell [Na22] and Ricci [Ri34] proved that $F_f(n) \gg n\log n$. +-/ +@[category research solved, AMS 11] +theorem erdos_976.variants.nagell_ricci (f : ℤ[X]) (hf : Irreducible f) + (hd : 2 ≤ f.natDegree) : + (fun n : ℕ ↦ (n : ℝ) * Real.log n) =O[atTop] fun n ↦ (F f n : ℝ) := by + sorry + +/-- +Erdős [Er52c] improved the bound of Nagell and Ricci to +$$F_f(n) \gg n(\log n)^{\log\log\log n}.$$ +More precisely, [Er52c] gives $F_f(n) > n(\log n)^{c\log\log\log n}$ for some constant +$c = c(f) > 0$; the site omits $c$. +-/ +@[category research solved, AMS 11] +theorem erdos_976.variants.erdos (f : ℤ[X]) (hf : Irreducible f) (hd : 2 ≤ f.natDegree) : + ∃ c > (0 : ℝ), + (fun n : ℕ ↦ (n : ℝ) * Real.log n ^ (c * Real.log (Real.log (Real.log n)))) =O[atTop] + fun n ↦ (F f n : ℝ) := by + sorry + +/-- +In [Er65b] Erdős claimed a proof of $F_f(n) \gg n\exp((\log n)^c)$ for some constant $c>0$, but +never published it. A proof was provided by Tenenbaum [Te90]. +-/ +@[category research solved, AMS 11] +theorem erdos_976.variants.tenenbaum (f : ℤ[X]) (hf : Irreducible f) (hd : 2 ≤ f.natDegree) : + ∃ c > (0 : ℝ), (fun n : ℕ ↦ (n : ℝ) * Real.exp (Real.log n ^ c)) =O[atTop] + fun n ↦ (F f n : ℝ) := by + sorry + +end Erdos976 diff --git a/FormalConjectures/ErdosProblems/977.lean b/FormalConjectures/ErdosProblems/977.lean new file mode 100644 index 0000000..bba1bc3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/977.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 977 + +*References:* +- [erdosproblems.com/977](https://www.erdosproblems.com/977) +- [Er65b] Erdős, Paul, *Some recent advances and current problems in number theory*. Lectures on + Modern Mathematics, Vol. III (1965), 196-244. +- [Sc62] Schinzel, A., *On primitive prime factors of $a^n-b^n$*. Proc. Cambridge Philos. Soc. + (1962), 555-562. +- [St74b] Stewart, C. L., *The greatest prime factor of $a^n-b^n$*. Acta Arith. (1974/75), + 427-433. +- [St13] Stewart, Cameron L., *On divisors of Lucas and Lehmer numbers*. Acta Math. (2013), + 291-314. +- [MuWo02] Murty, Ram and Wong, Siman, *The $ABC$ conjecture and prime divisors of the Lucas and + Lehmer sequences*. (2002), 43-54. +- [La21] L. Lai, *On the largest prime divisor of $n!+1$*. arXiv:2103.14894 (2021). +-/ + +@[expose] public section + +open Filter + +namespace Erdos977 + +/-- +If $P(m)$ is the greatest prime divisor of $m$, then is it true that +$$\frac{P(2^n-1)}{n}\to \infty$$ +as $n\to \infty$? + +Schinzel [Sc62] proved that $P(2^n-1)>2n$ for $n>12$. In [Er65b] Erdős also asks about $P(n!+1)$. +Stewart [St74b] proved that this conjecture is true if we restrict $n$ to those integers with +$<\frac{1}{\log 2}\log\log n$ many prime factors. + +This was proved in the affirmative by Stewart [St13], who proved that +$P(2^n-1)\gg n^{1+\frac{1}{104\log\log n}}$ for all large $n$. +-/ +@[category research solved, question, AMS 11, formal_proof using lean4 at + "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos977.lean#L4271"] +theorem erdos_977 : + Tendsto (fun n : ℕ ↦ (Nat.maxPrimeFac (2 ^ n - 1) : ℝ) / n) atTop atTop := by + sorry + +/-- Schinzel [Sc62] proved that $P(2^n-1)>2n$ for $n>12$. -/ +@[category research solved, AMS 11] +theorem erdos_977.variants.schinzel : + ∀ n : ℕ, 12 < n → 2 * n < Nat.maxPrimeFac (2 ^ n - 1) := by + sorry + +/-- Stewart [St13] proved that $P(2^n-1)\gg n^{1+\frac{1}{104\log\log n}}$ for all large $n$. -/ +@[category research solved, AMS 11] +theorem erdos_977.variants.stewart : ∃ c : ℝ, 0 < c ∧ ∀ᶠ n : ℕ in atTop, + c * (n : ℝ) ^ (1 + 1 / (104 * Real.log (Real.log n))) ≤ Nat.maxPrimeFac (2 ^ n - 1) := by + sorry + +/-- +In [Er65b] Erdős also asks about $P(n!+1)$: is it true that $P(n!+1)/n\to\infty$? This appears to +be open still. Murty and Wong [MuWo02] proved that $P(n!+1)>(1+o(1))n\log n$ assuming the abc +conjecture. +-/ +@[category research open, question, AMS 11] +theorem erdos_977.variants.factorial : + Tendsto (fun n : ℕ ↦ (Nat.maxPrimeFac (n.factorial + 1) : ℝ) / n) atTop atTop := by + sorry + +/-- +The best-known unconditional result, due to Lai [La21], is that +$$\limsup \frac{P(n!+1)}{n} \geq 1+9\log 2\approx 7.238.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_977.variants.lai : ∀ C : ℝ, C < 1 + 9 * Real.log 2 → + ∃ᶠ n : ℕ in atTop, C * n < Nat.maxPrimeFac (n.factorial + 1) := by + sorry + +end Erdos977 diff --git a/FormalConjectures/ErdosProblems/995.lean b/FormalConjectures/ErdosProblems/995.lean new file mode 100644 index 0000000..fd3923c --- /dev/null +++ b/FormalConjectures/ErdosProblems/995.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Erdős Problem 995 + +*References:* +- [erdosproblems.com/995](https://www.erdosproblems.com/995) +- [Er49] Erdős, P., On the strong law of large numbers, Trans. Amer. Math. Soc. (1949), + 329-334. + +Let $n_1 < n_2 < \cdots$ be a lacunary sequence of integers and $f \in L^2([0,1])$ with +$\int_0^1 f = 0$. Estimate the growth of +$$S_N(\alpha) = \sum_{k \le N} f(\{\alpha n_k\})$$ +for almost all $\alpha$, where $\{\cdot\}$ denotes the fractional part. In particular, is it +true that $S_N(\alpha) = o\!\left(N \sqrt{\log\log N}\right)$ for almost all $\alpha$? + +Erdős [Er49] constructed a lacunary sequence and a mean-zero $f \in L^2([0,1])$ for which, for +every $\varepsilon > 0$, $\limsup_N S_N(\alpha) / (N (\log\log N)^{1/2 - \varepsilon}) = \infty$ +for almost all $\alpha$, and believed this lower bound to be close to the truth. + +The mean-zero hypothesis $\int_0^1 f = 0$ is the natural normalisation: otherwise the sum has a +linear main term coming from the average of $f$. +-/ + +@[expose] public section + +open MeasureTheory Filter Asymptotics Set + +namespace Erdos995 + +/-- The partial sum $S_N(\alpha) = \sum_{k < N} f(\{\alpha n_k\})$. -/ +noncomputable def partialSum (n : ℕ → ℕ) (f : ℝ → ℝ) (α : ℝ) (N : ℕ) : ℝ := + ∑ k ∈ Finset.range N, f (Int.fract (α * (n k : ℝ))) + +/-- +Erdős Problem 995: + +For every lacunary sequence $(n_k)$ of integers and every $f \in L^2([0,1])$ with +$\int_0^1 f = 0$, is it true that for almost all $\alpha$, +$$\sum_{k < N} f(\{\alpha n_k\}) = o\!\left(N \sqrt{\log\log N}\right)?$$ +-/ +@[category research open, question, AMS 11 42] +theorem erdos_995 : + ∀ (n : ℕ → ℕ), IsLacunary n → ∀ (f : ℝ → ℝ), + MemLp f 2 (volume.restrict (Icc (0 : ℝ) 1)) → + ∫ x in (0 : ℝ)..1, f x = 0 → + ∀ᵐ α ∂(volume.restrict (Icc (0 : ℝ) 1)), + partialSum n f α =o[atTop] fun N => (N : ℝ) * Real.sqrt (Real.log (Real.log N)) := by + sorry + +/-- +Erdős [Er49] showed the growth cannot be pushed below $N (\log\log N)^{1/2}$ by more than an +arbitrarily small power: there is a lacunary sequence and a mean-zero $f \in L^2([0,1])$ such +that for every $\varepsilon > 0$, for almost all $\alpha$, +$$\limsup_{N \to \infty} \frac{\sum_{k < N} f(\{\alpha n_k\})}{N (\log\log N)^{1/2 - \varepsilon}} + = \infty.$$ +-/ +@[category research solved, AMS 11 42] +theorem erdos_995.variants.erdos_lower_bound : + ∃ (n : ℕ → ℕ), IsLacunary n ∧ ∃ (f : ℝ → ℝ), + MemLp f 2 (volume.restrict (Icc (0 : ℝ) 1)) ∧ + ∫ x in (0 : ℝ)..1, f x = 0 ∧ + ∀ ε > (0 : ℝ), + ∀ᵐ α ∂(volume.restrict (Icc (0 : ℝ) 1)), + atTop.limsup (fun N => (((partialSum n f α N) / + ((N : ℝ) * (Real.log (Real.log N)) ^ ((1 : ℝ) / 2 - ε)) : ℝ) : EReal)) = ⊤ := by + sorry + +end Erdos995 diff --git a/FormalConjectures/ErdosProblems/996.lean b/FormalConjectures/ErdosProblems/996.lean index b414e60..8d8c799 100644 --- a/FormalConjectures/ErdosProblems/996.lean +++ b/FormalConjectures/ErdosProblems/996.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Erdős Problem 996 @@ -27,6 +28,8 @@ import FormalConjecturesUtil Second Series 18.3 (1966): 259-269. -/ +@[expose] public section + open MeasureTheory AddCircle Filter Topology Asymptotics Finset Real namespace Erdos996 @@ -38,8 +41,8 @@ noncomputable def fourierPartial {T : ℝ} [hT : Fact (0 < T)] (f : Lp ℂ 2 (@h /-- Does there exists a positive constant `C` such that for all `f ∈ L²[0,1]` and all lacunary sequences `n`, if `‖f - fₖ‖₂ = O(1 / log log log k ^ C)`, then for almost every `x`, `lim ∑ k ∈ Finset.range N, f (n k • x)) / N = ∫ t, f t ∂t`? -/ -@[category research open, AMS 42] -theorem erdos_996 : answer(sorry) ↔ +@[category research open, question, AMS 42] +theorem erdos_996 : ∃ (C : ℝ), 0 < C ∧ ∀ (f : Lp ℂ 2 (haarAddCircle (T := 1))) (n : ℕ → ℕ), IsLacunary n → (fun k => (eLpNorm (⇑f - fourierPartial f k) 2 (haarAddCircle (T := 1))).toReal) =O[atTop] diff --git a/FormalConjectures/GreensOpenProblems/46.lean b/FormalConjectures/GreensOpenProblems/46.lean index 10b9994..79bb693 100644 --- a/FormalConjectures/GreensOpenProblems/46.lean +++ b/FormalConjectures/GreensOpenProblems/46.lean @@ -14,7 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil + +@[expose] public section /-! # Ben Green's Open Problem 46 diff --git a/FormalConjectures/GreensOpenProblems/51.lean b/FormalConjectures/GreensOpenProblems/51.lean index d124e2a..b95a9df 100644 --- a/FormalConjectures/GreensOpenProblems/51.lean +++ b/FormalConjectures/GreensOpenProblems/51.lean @@ -36,6 +36,7 @@ open scoped Pointwise namespace Green51 +set_option backward.isDefEq.respectTransparency false in /-- The largest dimension of a coset guaranteed to be contained in $2A$ for $A \subseteq \mathbb{F}_2^n$ with density $\alpha$. -/ noncomputable def guaranteedMaxCosetDim (n : ℕ) (α : ℝ) : ℕ := sInf { maxCosetDim (ZMod 2) (𝔽₂ n) ↑(A + A) | (A : Finset (𝔽₂ n)) (_h : A.dens ≥ α) } diff --git a/FormalConjectures/GreensOpenProblems/52.lean b/FormalConjectures/GreensOpenProblems/52.lean index d783eac..8508268 100644 --- a/FormalConjectures/GreensOpenProblems/52.lean +++ b/FormalConjectures/GreensOpenProblems/52.lean @@ -28,6 +28,7 @@ open scoped Pointwise namespace Green52 +set_option backward.isDefEq.respectTransparency false in /-- Suppose that $A \subset \mathbb{F}_2^n$ is a set with an additive complement of size $K$. Does $2A$ contain a coset of codimension $O_K(1)$? @@ -40,6 +41,7 @@ theorem green_52 : n ≤ Module.finrank (ZMod 2) V.direction + c K := by sorry +set_option backward.isDefEq.respectTransparency false in /-- Could $2A$ even contain a coset of codimension $O(\log K)$? diff --git a/FormalConjectures/GreensOpenProblems/53.lean b/FormalConjectures/GreensOpenProblems/53.lean index 84c82e8..d20c307 100644 --- a/FormalConjectures/GreensOpenProblems/53.lean +++ b/FormalConjectures/GreensOpenProblems/53.lean @@ -29,6 +29,7 @@ open scoped Pointwise namespace Green53 +set_option backward.isDefEq.respectTransparency false in /-- Suppose that $\mathbb{F}_2^n$ is partitioned in to sets $A_1, ..., A_K$. Does $2A_i$ contain a coset of codimension $O_K(1)$ for some $i$? diff --git a/FormalConjectures/GreensOpenProblems/72.lean b/FormalConjectures/GreensOpenProblems/72.lean index 3e86962..c6540b6 100644 --- a/FormalConjectures/GreensOpenProblems/72.lean +++ b/FormalConjectures/GreensOpenProblems/72.lean @@ -13,15 +13,25 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil /-! # Ben Green's Open Problem 72 More commonly known as the **no-three-in-line problem**. -Given $N > 2$ and more than $2 * N$ points on an $N \times N$-grid, -are there $3$ of the points on a common line? +What is the largest subset of the grid $[N]^2$ with no three points in a line? In particular, +for $N$ sufficiently large, is it impossible to have a set of size $2N$ with this property? + +The upper bound $2N$ is the easy half and is `allowedSetSize_le` below, by pigeonhole on the +columns. The open content is whether $2N$ is attained. Green records that it is for $N$ up to +around 50, that $(3/2 + o(1))N$ points are achievable for arbitrary $N$, and that his "personal +suspicion is that this is optimal". The Wikipedia reference points the same way: Guy and Kelly +conjectured $c = \sqrt[3]{2\pi^2/3} \approx 1.874$, and after an error in the heuristic was found +Guy corrected it to $c = \pi/\sqrt3 \approx 1.814$. Both are below $2$, so the expected answer to +the question above is yes. *References:* - [Ben Green's Open Problem 72](https://people.maths.ox.ac.uk/greenbj/papers/open-problems.pdf#problem.72) @@ -30,6 +40,8 @@ are there $3$ of the points on a common line? https://arxiv.org/abs/2510.17743 -/ +@[expose] public section + namespace Green72 /-- We say a subset of $[N]^2$ is allowed for some $k$ if it contains no $k$ points @@ -73,22 +85,31 @@ def NoKInLineFor (k : ℕ) (N : ℕ) : Prop := AllowedSetSize k N = (k - 1) * N /-- The **no-k-in-line problem**: -For $N \geq k$ and $k > 2$, the AllowedSetSize is $(k - 1) N$, i. e. on an $N \times N$ subset, -there is a set of $(k - 1) N$ points for which no $k$ lie on a line (and not such a set of bigger size). +For which $k > 2$ does every $N \times N$ grid with $N \geq k$ contain a set of $(k - 1) N$ points +with no $k$ on a line, so that `AllowedSetSize k N` is the pigeonhole bound $(k - 1) N$? + +[GK2025] proves that every $k > 10^{37}$ has this property, which is `no_k_in_line_big` below, +and does not optimise this constant. At $k = 3$ it is the property that Green expects to fail +for large $N$, see `green_72`. -/ @[category research open, AMS 5 52] -theorem NoKInLine {k : ℕ} {N : ℕ} (hk : 2 < k) (h : k ≤ N) : NoKInLineFor k N := by +theorem NoKInLine : answer(sorry) = {k | 2 < k ∧ ∀ N, k ≤ N → NoKInLineFor k N} := by sorry /-- **Green's Open Problem 72 / No-three-in-line problem**: -The no-k-in-line conjecture holds for $k = 3$. -/ +For $N$ sufficiently large, is it impossible to have $2N$ points in $[N]^2$ with no three in a +line? Green suspects the answer is yes, and that $(3/2 + o(1))N$ is optimal. -/ @[category research open, AMS 5 52] -theorem green_72 {N : ℕ} (hN : 3 ≤ N) : NoKInLineFor 3 N := by +theorem green_72 : answer(sorry) ↔ ∀ᶠ N in Filter.atTop, ¬ NoKInLineFor 3 N := by sorry alias no_three_in_line := green_72 -/-- Does the no-three-in-line problem hold when $N$ is big enough? -/ +/-- Is $2N$ attained for all sufficiently large $N$? + +This is not the negation of `green_72`. Negating that one gives $\exists^f N$ where this asks +$\forall^f N$, so both can be answered `False` if the behaviour oscillates. Green asks his +question in the `green_72` form. -/ @[category research open, AMS 5 52] theorem green_72.variants.eventually : answer(sorry) ↔ ∀ᶠ N in Filter.atTop, NoKInLineFor 3 N := by sorry @@ -99,8 +120,8 @@ theorem no_three_in_line_le {N : ℕ} (hN : 3 ≤ N) (hN' : N ≤ 60) : NoKInLineFor 3 N := by sorry -/-- In [GK2025] Grebennikov and Kwan prove the no-k-in-line conjecture for $k > 10 ^ 37$ -and $N \geq k$. -/ +/-- In [GK2025] Grebennikov and Kwan prove that the pigeonhole bound $(k - 1) N$ is attained +for $k > 10 ^ {37}$ and $N \geq k$. -/ @[category research solved, AMS 5 52] theorem no_k_in_line_big {k : ℕ} (N : ℕ) (h : 10 ^ 37 < k) (hN : k ≤ N) : NoKInLineFor k N := by diff --git a/FormalConjectures/HistoricalOpen/BergeFulkerson.lean b/FormalConjectures/HistoricalOpen/BergeFulkerson.lean new file mode 100644 index 0000000..06e41af --- /dev/null +++ b/FormalConjectures/HistoricalOpen/BergeFulkerson.lean @@ -0,0 +1,31 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Berge–Fulkerson + +*References:* +- [Source 1](https://arxiv.org/abs/2607.29511) +-/ + +namespace FullOldProblemsCatalog.BergeFulkerson + +/-- All finite bridgeless cubic multigraphs; six perfect matchings; each edge exactly twice. See the sources in the module documentation. -/ +@[category research open, AMS 05] +theorem conjecture : FullOldProblems.BergeFulkerson := by + sorry + +end FullOldProblemsCatalog.BergeFulkerson diff --git a/FormalConjectures/HistoricalOpen/BorgerDeSmitQuestion4.lean b/FormalConjectures/HistoricalOpen/BorgerDeSmitQuestion4.lean new file mode 100644 index 0000000..f9c03ed --- /dev/null +++ b/FormalConjectures/HistoricalOpen/BorgerDeSmitQuestion4.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import HilbertDrafts.Hilbert12Lambda +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Question 4 of Borger and de Smit on Λ-geometric class field theory + +*References:* +- [Borger and de Smit, Explicit class field theory and the algebraic geometry of Λ-rings](https://arxiv.org/abs/1809.02295) +- [Gurney, Elliptic curves with complex multiplication and Λ-structures](https://arxiv.org/abs/1710.08674) +-/ + +namespace HilbertCatalog.BorgerDeSmitQuestion4 + +/-- Some number field other than the rational numbers and the imaginary quadratic fields has a maximal abelian extension generated by the periodic points of one flat separated scheme of finite type with a Λ-structure over its ring of integers. This is Question 4 of Borger and de Smit, a precise question in the spirit of Hilbert 12. The authors state no expected answer. -/ +@[category research open, AMS 11] +theorem conjecture : HilbertDrafts.Hilbert12Lambda.BorgerDeSmitQuestion4 := by + sorry + +end HilbertCatalog.BorgerDeSmitQuestion4 diff --git a/FormalConjectures/HistoricalOpen/Cantoni.lean b/FormalConjectures/HistoricalOpen/Cantoni.lean new file mode 100644 index 0000000..537737d --- /dev/null +++ b/FormalConjectures/HistoricalOpen/Cantoni.lean @@ -0,0 +1,33 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Cantoni's three-Hamilton-cycle conjecture + +*References:* +- [Source 1](https://arxiv.org/abs/1812.05650) +- [Source 2](https://www.facom.ufu.br/~nunes/teoria%20dos%20grafos/graph-theory.pdf) +- [Source 3](https://www.sciencedirect.com/science/article/pii/S0012365X25003103) +-/ + +namespace FullOldProblemsCatalog.Cantoni + +/-- Every planar cubic finite simple graph with exactly three undirected Hamilton cycles contains a triangle. See the sources in the module documentation. -/ +@[category research open, AMS 05] +theorem conjecture : FullOldProblems.Cantoni := by + sorry + +end FullOldProblemsCatalog.Cantoni diff --git a/FormalConjectures/HistoricalOpen/ChvatalToughness.lean b/FormalConjectures/HistoricalOpen/ChvatalToughness.lean new file mode 100644 index 0000000..392b346 --- /dev/null +++ b/FormalConjectures/HistoricalOpen/ChvatalToughness.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Chvátal toughness + +*References:* +- [Source 1](https://arxiv.org/abs/2506.12684) +- [Source 2](https://doi.org/10.1016/j.disc.2026.115364) +-/ + +namespace FullOldProblemsCatalog.ChvatalToughness + +/-- A universal positive real threshold for Hamiltonicity of all tough simple graphs of order at least three. See the sources in the module documentation. -/ +@[category research open, AMS 05] +theorem conjecture : FullOldProblems.ChvatalToughness := by + sorry + +end FullOldProblemsCatalog.ChvatalToughness diff --git a/FormalConjectures/HistoricalOpen/ErdosCriticalMinimumDegree.lean b/FormalConjectures/HistoricalOpen/ErdosCriticalMinimumDegree.lean new file mode 100644 index 0000000..0493e94 --- /dev/null +++ b/FormalConjectures/HistoricalOpen/ErdosCriticalMinimumDegree.lean @@ -0,0 +1,33 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Erdős linear minimum degree in 4-critical graphs + +*References:* +- [Source 1](https://doi.org/10.1080/16073606.1993.9631741) +- [Source 2](https://www.erdosproblems.com/1032) +- [Source 3](https://www.erdosproblems.com/forum/thread/1032) +-/ + +namespace FullOldProblemsCatalog.ErdosCriticalMinimumDegree + +/-- There is epsilon > 0 and arbitrarily large n with an n-vertex edge-critical four-chromatic simple graph of minimum degree at least epsilon*n. See the sources in the module documentation. -/ +@[category research open, AMS 05] +theorem conjecture : FullOldProblems.ErdosCriticalMinimumDegree := by + sorry + +end FullOldProblemsCatalog.ErdosCriticalMinimumDegree diff --git a/FormalConjectures/HistoricalOpen/ErdosPurdyDegenerateQuadruples.lean b/FormalConjectures/HistoricalOpen/ErdosPurdyDegenerateQuadruples.lean new file mode 100644 index 0000000..d557bcb --- /dev/null +++ b/FormalConjectures/HistoricalOpen/ErdosPurdyDegenerateQuadruples.lean @@ -0,0 +1,33 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Erdős–Purdy degenerate quadruples + +*References:* +- [Source 1](https://users.renyi.hu/~p_erdos/1971-20.pdf) +- [Source 2](https://www.erdosproblems.com/1087) +- [Source 3](https://www.erdosproblems.com/forum/thread/1087) +-/ + +namespace FullOldProblemsCatalog.ErdosPurdyDegenerateQuadruples + +/-- For every epsilon > 0, all sufficiently large finite planar sets A have at most |A|^(3+epsilon) four-point subsets with fewer than six distinct pair distances. See the sources in the module documentation. -/ +@[category research open, AMS 52] +theorem conjecture : FullOldProblems.ErdosPurdyDegenerateQuadruples := by + sorry + +end FullOldProblemsCatalog.ErdosPurdyDegenerateQuadruples diff --git a/FormalConjectures/HistoricalOpen/HajosCycleDecomposition.lean b/FormalConjectures/HistoricalOpen/HajosCycleDecomposition.lean new file mode 100644 index 0000000..d333a12 --- /dev/null +++ b/FormalConjectures/HistoricalOpen/HajosCycleDecomposition.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Hajós cycle decomposition + +*References:* +- [Source 1](https://arxiv.org/abs/1706.04334) +- [Source 2](https://arxiv.org/abs/2610.07840v2) +-/ + +namespace FullOldProblemsCatalog.HajosCycleDecomposition + +/-- All finite nonempty simple even graphs; exact floor((n-1)/2) bound. See the sources in the module documentation. -/ +@[category research open, AMS 05] +theorem conjecture : FullOldProblems.HajosCycleDecomposition := by + sorry + +end FullOldProblemsCatalog.HajosCycleDecomposition diff --git a/FormalConjectures/HistoricalOpen/Hilbert12LambdaGeometric.lean b/FormalConjectures/HistoricalOpen/Hilbert12LambdaGeometric.lean new file mode 100644 index 0000000..0c5f4be --- /dev/null +++ b/FormalConjectures/HistoricalOpen/Hilbert12LambdaGeometric.lean @@ -0,0 +1,33 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import HilbertDrafts.Hilbert12Lambda +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Hilbert 12 in the Λ-geometric form of Borger and de Smit + +*References:* +- [Hilbert, Mathematical Problems, problem 12](https://mathcs.clarku.edu/~djoyce/hilbert/problems.html#prob12) +- [Borger and de Smit, Explicit class field theory and the algebraic geometry of Λ-rings](https://arxiv.org/abs/1809.02295) +- [Gurney, Elliptic curves with complex multiplication and Λ-structures](https://arxiv.org/abs/1710.08674) +-/ + +namespace HilbertCatalog.Hilbert12LambdaGeometric + +/-- For every number field, the maximal abelian extension is generated by the periodic points of one flat separated scheme of finite type with a Λ-structure over its ring of integers. This is known for the rational numbers and for imaginary quadratic fields. It is the universal form of Question 4 of Borger and de Smit, whose answer is unknown; one number field with no such scheme would refute it. It is one published precise formulation of explicit class field theory, not the only reading of Hilbert 12. -/ +@[category research open, AMS 11] +theorem conjecture : HilbertDrafts.Hilbert12Lambda.Hilbert12LambdaGeometric := by + sorry + +end HilbertCatalog.Hilbert12LambdaGeometric diff --git a/FormalConjectures/HistoricalOpen/Hilbert13.lean b/FormalConjectures/HistoricalOpen/Hilbert13.lean new file mode 100644 index 0000000..8a885b1 --- /dev/null +++ b/FormalConjectures/HistoricalOpen/Hilbert13.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import HilbertDrafts.Hilbert13 +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Hilbert’s thirteenth problem in its algebraic form + +*References:* +- [Source 1](https://www.math.uchicago.edu/~farb/papers/RD.pdf) +- [Source 2](https://doi.org/10.4171/DM/984) +-/ + +namespace HilbertCatalog.Hilbert13 + +/-- Generic complex septimic resolvent degree equals three. The precise formulation and its four-round independent review are published with the validator release. -/ +@[category research open, AMS 12] +theorem conjecture : HilbertDrafts.Hilbert13.AlgebraicHilbert13 := by + sorry + +end HilbertCatalog.Hilbert13 diff --git a/FormalConjectures/HistoricalOpen/Hilbert16QuadraticLimitCycles.lean b/FormalConjectures/HistoricalOpen/Hilbert16QuadraticLimitCycles.lean new file mode 100644 index 0000000..c89ea0c --- /dev/null +++ b/FormalConjectures/HistoricalOpen/Hilbert16QuadraticLimitCycles.lean @@ -0,0 +1,33 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import HilbertDrafts.Hilbert16Open +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Hilbert 16, second part: quadratic vector fields have at most four limit cycles + +*References:* +- [Hilbert, Mathematical Problems, problem 16](https://mathcs.clarku.edu/~djoyce/hilbert/problems.html#prob16) +- [Ilyashenko, Centennial history of Hilbert’s 16th problem](https://www.ams.org/journals/bull/2002-39-03/S0273-0979-02-00946-1/) +- [Gasull and Santana on the Hilbert numbers](https://arxiv.org/abs/2407.13465) +-/ + +namespace HilbertCatalog.Hilbert16QuadraticLimitCycles + +/-- Every real planar polynomial vector field of degree at most two has at most four limit cycles, counted in the whole affine plane without multiplicity. This is the upper bound in the conjecture H(2) = 4, one degree of the maximum-number question in the second part of Hilbert 16. It says nothing about positions or higher degrees. -/ +@[category research open, AMS 34] +theorem conjecture : HilbertDrafts.Hilbert16Open.QuadraticFourCycles := by + sorry + +end HilbertCatalog.Hilbert16QuadraticLimitCycles diff --git a/FormalConjectures/HistoricalOpen/Hilbert16QuinticSurfaces.lean b/FormalConjectures/HistoricalOpen/Hilbert16QuinticSurfaces.lean new file mode 100644 index 0000000..c7be4c8 --- /dev/null +++ b/FormalConjectures/HistoricalOpen/Hilbert16QuinticSurfaces.lean @@ -0,0 +1,33 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import HilbertDrafts.Hilbert16Open +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Hilbert 16, first part: is twenty-three the maximal number of components of a real quintic surface + +*References:* +- [Hilbert, Mathematical Problems, problem 16](https://mathcs.clarku.edu/~djoyce/hilbert/problems.html#prob16) +- [Orevkov, Real quintic surface with 23 components](https://www.math.univ-toulouse.fr/~orevkov/q23.pdf) +- [Kharlamov, Overview of topological properties of real algebraic surfaces](https://arxiv.org/abs/math/0502127) +-/ + +namespace HilbertCatalog.Hilbert16QuinticSurfaces + +/-- Every real quintic surface in real projective three-space with nonsingular complexification has at most twenty-three connected components. The maximum is known to be twenty-three, twenty-four or twenty-five, so the statement may be true or false. It concerns only the number of sheets in degree five, the first degree left open by the question in the first part of Hilbert 16. -/ +@[category research open, AMS 14] +theorem conjecture : HilbertDrafts.Hilbert16Open.QuinticSurfaceComponents := by + sorry + +end HilbertCatalog.Hilbert16QuinticSurfaces diff --git a/FormalConjectures/HistoricalOpen/Hilbert6VlasovPoissonLimit.lean b/FormalConjectures/HistoricalOpen/Hilbert6VlasovPoissonLimit.lean new file mode 100644 index 0000000..48e6b3e --- /dev/null +++ b/FormalConjectures/HistoricalOpen/Hilbert6VlasovPoissonLimit.lean @@ -0,0 +1,34 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import HilbertDrafts.Hilbert6MeanField +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Mean-field limit for the Vlasov–Poisson equation from Newtonian point charges + +*References:* +- [Hilbert, Mathematical Problems, problem 6](https://mathcs.clarku.edu/~djoyce/hilbert/problems.html#prob6) +- [Jabin, A review of the mean field limits for Vlasov equations](https://www.math.umd.edu/~tadmor/ki_net/pubs/files/review_MF.pdf) +- [Lazarovici and Pickl, A mean field limit for the Vlasov–Poisson system](https://arxiv.org/abs/1502.04608) +- [Serfaty, Mean field limit for Coulomb-type flows](https://arxiv.org/abs/1803.08345) +-/ + +namespace HilbertCatalog.Hilbert6VlasovPoissonLimit + +/-- Point particles in three-space under the repulsive Coulomb force scaled by one over their number, started from independent samples of a smooth compactly supported density, have empirical averages that converge in probability at each fixed time to those of the classical Vlasov–Poisson solution. The force is not truncated and no noise is added. The existence of that solution is a known theorem and is part of the statement. The limit is open in this setting and expected to be true. It is one instance of the particle-to-continuum programme associated with Hilbert 6, not the problem itself. -/ +@[category research open, AMS 82 35] +theorem conjecture : HilbertDrafts.Hilbert6MeanField.VlasovPoissonMeanFieldLimit := by + sorry + +end HilbertCatalog.Hilbert6VlasovPoissonLimit diff --git a/FormalConjectures/HistoricalOpen/KotzigPerfectFactorization.lean b/FormalConjectures/HistoricalOpen/KotzigPerfectFactorization.lean new file mode 100644 index 0000000..256497b --- /dev/null +++ b/FormalConjectures/HistoricalOpen/KotzigPerfectFactorization.lean @@ -0,0 +1,31 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Kotzig perfect 1-factorization + +*References:* +- [Source 1](https://arxiv.org/html/2607.09459) +-/ + +namespace FullOldProblemsCatalog.KotzigPerfectFactorization + +/-- Every even n >= 4; K_n partitions into n-1 perfect matchings with every pair Hamiltonian. See the sources in the module documentation. -/ +@[category research open, AMS 05] +theorem conjecture : FullOldProblems.KotzigPerfectFactorization := by + sorry + +end FullOldProblemsCatalog.KotzigPerfectFactorization diff --git a/FormalConjectures/HistoricalOpen/LovaszHamiltonPath.lean b/FormalConjectures/HistoricalOpen/LovaszHamiltonPath.lean new file mode 100644 index 0000000..34b179e --- /dev/null +++ b/FormalConjectures/HistoricalOpen/LovaszHamiltonPath.lean @@ -0,0 +1,31 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Lovász Hamiltonian path + +*References:* +- [Source 1](https://arxiv.org/abs/2609.38135v2) +-/ + +namespace FullOldProblemsCatalog.LovaszHamiltonPath + +/-- Every connected finite vertex-transitive graph has a Hamilton path. See the sources in the module documentation. -/ +@[category research open, AMS 05] +theorem conjecture : FullOldProblems.LovaszHamiltonPath := by + sorry + +end FullOldProblemsCatalog.LovaszHamiltonPath diff --git a/FormalConjectures/HistoricalOpen/MarcusBlockPermanent.lean b/FormalConjectures/HistoricalOpen/MarcusBlockPermanent.lean new file mode 100644 index 0000000..3fde9c5 --- /dev/null +++ b/FormalConjectures/HistoricalOpen/MarcusBlockPermanent.lean @@ -0,0 +1,33 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Marcus block-permanent conjecture + +*References:* +- [Source 1](https://arxiv.org/html/2202.01867v1) +- [Source 2](https://yair-lavi.com/mincs-list/conjecture-9/index.html) +- [Source 3](https://doi.org/10.1080/00029890.1965.11970575) +-/ + +namespace FullOldProblemsCatalog.MarcusBlockPermanent + +/-- For every complex Hermitian PSD block matrix A, permanent(A) >= permanent([permanent(A_ij)]); with block size >= 2 and positive definite diagonal blocks, equality iff every off-diagonal block is zero. See the sources in the module documentation. -/ +@[category research open, AMS 15] +theorem conjecture : FullOldProblems.MarcusBlockPermanent := by + sorry + +end FullOldProblemsCatalog.MarcusBlockPermanent diff --git a/FormalConjectures/HistoricalOpen/MarcusDeOliveira.lean b/FormalConjectures/HistoricalOpen/MarcusDeOliveira.lean new file mode 100644 index 0000000..3a2c46e --- /dev/null +++ b/FormalConjectures/HistoricalOpen/MarcusDeOliveira.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Marcus–de Oliveira determinantal conjecture + +*References:* +- [Source 1](https://doi.org/10.3390/math13050711) +- [Source 2](https://www.mat.uc.pt/preprints/ps/p2611.pdf) +-/ + +namespace FullOldProblemsCatalog.MarcusDeOliveira + +/-- For all complex normal matrices A,B of every positive order, det(A+B) lies in the real convex hull of products of pairwise sums over all permutations of their complete eigenvalue lists. See the sources in the module documentation. -/ +@[category research open, AMS 15] +theorem conjecture : FullOldProblems.MarcusDeOliveira := by + sorry + +end FullOldProblemsCatalog.MarcusDeOliveira diff --git a/FormalConjectures/HistoricalOpen/MinkowskiInhomogeneousProduct.lean b/FormalConjectures/HistoricalOpen/MinkowskiInhomogeneousProduct.lean new file mode 100644 index 0000000..30852a3 --- /dev/null +++ b/FormalConjectures/HistoricalOpen/MinkowskiInhomogeneousProduct.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Minkowski inhomogeneous product conjecture + +*References:* +- [Source 1](https://doi.org/10.1112/S0025579300000863) +- [Source 2](https://insa.nic.in/writereaddata/UpLoadedFiles/IJPAM/Vol46_2015_3_ART05.pdf) +-/ + +namespace FullOldProblemsCatalog.MinkowskiInhomogeneousProduct + +/-- Every nonsingular real n-by-n matrix A and real shift b admit an integer z with product_i |(Az-b)_i| <= |det A|/2^n, in every positive dimension. See the sources in the module documentation. -/ +@[category research open, AMS 11] +theorem conjecture : FullOldProblems.MinkowskiInhomogeneousProduct := by + sorry + +end FullOldProblemsCatalog.MinkowskiInhomogeneousProduct diff --git a/FormalConjectures/HistoricalOpen/RankOneAbelianStark.lean b/FormalConjectures/HistoricalOpen/RankOneAbelianStark.lean new file mode 100644 index 0000000..01b4fe9 --- /dev/null +++ b/FormalConjectures/HistoricalOpen/RankOneAbelianStark.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import HilbertDrafts.Hilbert12 +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Rank-one abelian Stark conjecture + +*References:* +- [Source 1](https://math.berkeley.edu/~hhao/notes/Rank-one%20abelian%20Stark%20conjecture.pdf) +- [Source 2](https://www.cambridge.org/core/services/aop-cambridge-core/content/view/853876BFEE7F6C3686DB9381CB3BF08F/S0010437X03100371a.pdf/local_stark_conjecture_at_a_real_place.pdf) +-/ + +namespace HilbertCatalog.RankOneAbelianStark + +/-- The rank-one abelian Stark conjecture for number fields, with normalized places, partial zeta derivatives and the abelian root-extension condition. This is the specified Stark route associated with Hilbert 12. -/ +@[category research open, AMS 11] +theorem conjecture : HilbertDrafts.Hilbert12Stark.RankOneAbelianStark := by + sorry + +end HilbertCatalog.RankOneAbelianStark diff --git a/FormalConjectures/HistoricalOpen/RiddellErdosProgressionRatio.lean b/FormalConjectures/HistoricalOpen/RiddellErdosProgressionRatio.lean new file mode 100644 index 0000000..843d16f --- /dev/null +++ b/FormalConjectures/HistoricalOpen/RiddellErdosProgressionRatio.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Riddell–Erdős progression-free subset ratio + +*References:* +- [Source 1](https://www.numdam.org/article/AST_1975__24-25__295_0.pdf#page=14) +- [Source 2](https://www.erdosproblems.com/201) +-/ + +namespace FullOldProblemsCatalog.RiddellErdosProgressionRatio + +/-- For every fixed k >= 3, R_k(N)/G_k(N) tends to 1, where R_k is the maximum progression-free subset size in [1,N] and G_k is the minimum such maximum across all N-element integer sets. See the sources in the module documentation. -/ +@[category research open, AMS 11] +theorem conjecture : FullOldProblems.RiddellErdosProgressionRatio := by + sorry + +end FullOldProblemsCatalog.RiddellErdosProgressionRatio diff --git a/FormalConjectures/HistoricalOpen/SidonSubsetAsymptotic.lean b/FormalConjectures/HistoricalOpen/SidonSubsetAsymptotic.lean new file mode 100644 index 0000000..f662342 --- /dev/null +++ b/FormalConjectures/HistoricalOpen/SidonSubsetAsymptotic.lean @@ -0,0 +1,33 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Riddell–Erdős Sidon subsets / Erdős 530 + +*References:* +- [Source 1](https://www.renyi.hu/~p_erdos/1973-21.pdf#page=4) +- [Source 2](https://arxiv.org/abs/2605.03181) +- [Source 3](https://www.erdosproblems.com/530) +-/ + +namespace FullOldProblemsCatalog.SidonSubsetAsymptotic + +/-- Sharp universal asymptotic l(N) ~ sqrt(N) for arbitrary finite real sets; both bounds encoded. See the sources in the module documentation. -/ +@[category research open, AMS 11] +theorem conjecture : FullOldProblems.SidonSubsetAsymptotic := by + sorry + +end FullOldProblemsCatalog.SidonSubsetAsymptotic diff --git a/FormalConjectures/HistoricalOpen/TutteFiveFlow.lean b/FormalConjectures/HistoricalOpen/TutteFiveFlow.lean new file mode 100644 index 0000000..d146def --- /dev/null +++ b/FormalConjectures/HistoricalOpen/TutteFiveFlow.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Tutte 5-flow + +*References:* +- [Source 1](https://dwest.web.illinois.edu/openp/tut5flow.html) +- [Source 2](https://arxiv.org/abs/2601.12036) +-/ + +namespace FullOldProblemsCatalog.TutteFiveFlow + +/-- Every finite bridgeless multigraph has a nowhere-zero integer 5-flow. See the sources in the module documentation. -/ +@[category research open, AMS 05] +theorem conjecture : FullOldProblems.TutteFiveFlow := by + sorry + +end FullOldProblemsCatalog.TutteFiveFlow diff --git a/FormalConjectures/HistoricalOpen/TutteThreeFlow.lean b/FormalConjectures/HistoricalOpen/TutteThreeFlow.lean new file mode 100644 index 0000000..1a7222b --- /dev/null +++ b/FormalConjectures/HistoricalOpen/TutteThreeFlow.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Tutte 3-flow + +*References:* +- [Source 1](https://arxiv.org/abs/2011.02140) +- [Source 2](https://arxiv.org/abs/2609.08377) +-/ + +namespace FullOldProblemsCatalog.TutteThreeFlow + +/-- Every finite 4-edge-connected multigraph has a nowhere-zero integer 3-flow. See the sources in the module documentation. -/ +@[category research open, AMS 05] +theorem conjecture : FullOldProblems.TutteThreeFlow := by + sorry + +end FullOldProblemsCatalog.TutteThreeFlow diff --git a/FormalConjectures/HistoricalOpen/VizingIndependence.lean b/FormalConjectures/HistoricalOpen/VizingIndependence.lean new file mode 100644 index 0000000..dc0c3f6 --- /dev/null +++ b/FormalConjectures/HistoricalOpen/VizingIndependence.lean @@ -0,0 +1,32 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Vizing independence number + +*References:* +- [Source 1](https://www.ort.shu.edu.cn/CN/10.15960/j.cnki.issn.1007-6093.2025.01.019) +- [Source 2](https://arxiv.org/abs/1805.05996) +-/ + +namespace FullOldProblemsCatalog.VizingIndependence + +/-- Every connected Delta-critical finite simple graph; independence number at most n/2. See the sources in the module documentation. -/ +@[category research open, AMS 05] +theorem conjecture : FullOldProblems.VizingIndependence := by + sorry + +end FullOldProblemsCatalog.VizingIndependence diff --git a/FormalConjectures/HistoricalOpen/WangHadamardPermanentNonvanishing.lean b/FormalConjectures/HistoricalOpen/WangHadamardPermanentNonvanishing.lean new file mode 100644 index 0000000..a682b7e --- /dev/null +++ b/FormalConjectures/HistoricalOpen/WangHadamardPermanentNonvanishing.lean @@ -0,0 +1,34 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import FormalConjecturesUtil.Attributes.Basic + +/-! +# Wang's Hadamard permanent question + +*References:* +- [Source 1](https://doi.org/10.1007/BF02760844) +- [Source 2](https://users.monash.edu.au/~iwanless/papers/wangconjLAMA.pdf) +- [Source 3](https://yair-lavi.com/mincs-list/problem-5/index.html) +- [Source 4](https://arxiv.org/abs/1802.08001) +-/ + +namespace FullOldProblemsCatalog.WangHadamardPermanentNonvanishing + +/-- Every real sign Hadamard matrix of order > 2 has nonzero permanent; encoded over integers, without a Sylvester or circulant restriction. See the sources in the module documentation. -/ +@[category research open, AMS 15] +theorem conjecture : FullOldProblems.WangHadamardPermanentNonvanishing := by + sorry + +end FullOldProblemsCatalog.WangHadamardPermanentNonvanishing diff --git a/FormalConjectures/LittProblems/1.lean b/FormalConjectures/LittProblems/1.lean index bbaf9ce..da9243a 100644 --- a/FormalConjectures/LittProblems/1.lean +++ b/FormalConjectures/LittProblems/1.lean @@ -58,12 +58,12 @@ The variable indexed by `0 : Fin (n + 1)` corresponds to $z$, and the variable i `i.succ` corresponds to $y_i = f^{(i)}(z)$. -/ def IsSolutionOfAlgebraicODE (n : ℕ) (f : PowerSeries ℚ) (g : MvRatFunc (Fin (n + 1)) ℚ) : Prop := - let pt : Fin (n + 1) → PowerSeries ℚ := Fin.cases X (fun i : Fin n ↦ (derivative ℚ)^[i.val] f) + let pt : Fin (n + 1) → PowerSeries ℚ := Fin.cases X (fun i : Fin n ↦ (PowerSeries.derivative (R := ℚ))^[i.val] f) ∃ p q : MvPolynomial (Fin (n + 1)) ℚ, q ≠ 0 ∧ g = (algebraMap _ _ p) / (algebraMap _ _ q) ∧ IsDefined (Fin (n + 1)) ℚ g (PowerSeries.constantCoeff ∘ pt) ∧ - (derivative ℚ)^[n] f * MvPolynomial.aeval pt q = MvPolynomial.aeval pt p + (PowerSeries.derivative (R := ℚ))^[n] f * MvPolynomial.aeval pt q = MvPolynomial.aeval pt p def ℤAdjoinInvNat (N : ℕ) : Subalgebra ℤ ℚ := Algebra.adjoin ℤ {(1 / N : ℚ)} @@ -133,7 +133,7 @@ theorem lam_litt.variants.integrality_implies_omega_integrality simp [hpN, sq, p.2.ne_zero] · intro p j hj by_cases hpmem : (p : ℕ) ∈ N.primeFactors - · simp only [hpmem, if_true] at hj; omega + · simp only [hpmem, ite_true] at hj; omega · exact den_coprime_of_mem_adjoinInvNat p.2 hpmem (hN j) /-- diff --git a/FormalConjectures/Millenium/RiemannHypothesis.lean b/FormalConjectures/Millenium/RiemannHypothesis.lean index c8d38be..cbca025 100644 --- a/FormalConjectures/Millenium/RiemannHypothesis.lean +++ b/FormalConjectures/Millenium/RiemannHypothesis.lean @@ -13,95 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil +public import FormalConjectures.Millennium.RiemannHypothesis -/-! -# Riemann Hypothesis and its generalizations - -The Riemann Hypothesis asserts that all non-trivial zeros of the Riemann zeta function -$\zeta(s)$ have real part $\frac{1}{2}$. The trivial zeros are the negative even integers -$-2, -4, -6, \ldots$. The hypothesis is one of the seven Millennium Prize Problems -posed by the Clay Mathematics Institute. - -The Generalized Riemann Hypothesis extends this to Dirichlet $L$-functions of primitive -Dirichlet characters. - -Note: the **Extended Riemann Hypothesis** (ERH) for Dedekind zeta functions is intentionally -**not** stated here. Mathlib's `NumberField.dedekindZeta` is the naive Dirichlet series -(`LSeries`), not a meromorphic continuation; outside the region of absolute convergence -`tsum` returns junk `0`, producing spurious zeros that make the naive foramlisation of the -conjecture provably false. The ERH should be added once Mathlib provides a meromorphic -continuation of the Dedekind zeta function. - -*References:* -- [The Clay Institute](https://www.claymath.org/wp-content/uploads/2022/05/riemann.pdf) -- [Wikipedia: Riemann hypothesis](https://en.wikipedia.org/wiki/Riemann_hypothesis) -- [Wikipedia: Generalized Riemann hypothesis](https://en.wikipedia.org/wiki/Generalized_Riemann_hypothesis) -- [Wikipedia: Dedekind zeta function](https://en.wikipedia.org/wiki/Dedekind_zeta_function) -- J. Neukirch, *Algebraic Number Theory*, Springer (Grundlehren 322), 1999, Chapter VII, §5. -- D. A. Marcus, *Number Fields*, Springer (GTM 81), 1977, Chapter VII. --/ - -namespace RiemannHypothesis - -/-- The **Riemann Hypothesis**: all non-trivial zeros of the Riemann zeta function have real -part $\frac{1}{2}$. That is, if $\zeta(s) = 0$, $s \neq 1$, and $s$ is not a trivial zero -$-2(n+1)$ for some $n \in \mathbb{N}$, then $\operatorname{Re}(s) = \frac{1}{2}$. - -This is the official Millennium Prize Problem as posed by the -[Clay Mathematics Institute](https://www.claymath.org/wp-content/uploads/2022/05/riemann.pdf). - -This uses the `RiemannHypothesis` type from Mathlib, which is defined as -`∀ (s : ℂ), riemannZeta s = 0 → (¬∃ n : ℕ, s = -2 * (n + 1)) → s ≠ 1 → s.re = 1 / 2`. -/ -@[category research open, AMS 11] -theorem riemannHypothesis : RiemannHypothesis := by - sorry - -end RiemannHypothesis - -namespace GRH - -/-- Let $\chi$ be a Dirichlet character, `trivialZeros` is the set of trivial zeros of the -Dirichlet $L$-function of $\chi$ which is always a set of non-positive integers. -- $\chi = 1$ then the Dirichlet $L$-function is the Riemann zeta function, having trivial - zeroes at all negative even integers (exclude $0$). -- $\chi$ is odd, then the trivial zeroes are the negative odd integers. -- $\chi \neq 1$ is even, then the trivial zeroes are the non-positive even integers. -/ -def trivialZeros {q : ℕ} (χ : DirichletCharacter ℂ q) : Set ℤ := - if q = 1 then {-2 * (n + 1) | (n : ℕ) } else - if χ.Odd then { -2 * n - 1 | (n : ℕ) } else - { - 2 * n | (n : ℕ) } - -/-- The **Generalized Riemann Hypothesis** asserts that all the non-trivial zeros of the -Dirichlet $L$-function $L(\chi, s)$ of a primitive Dirichlet character $\chi$ have real part -$\frac{1}{2}$. -/ -@[category research open, AMS 11] -theorem generalized_riemann_hypothesis (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) - (hχ : χ.IsPrimitive) (s : ℂ) (hs : χ.LFunction s = 0) - (hs_nontrivial : s ∉ Int.cast '' trivialZeros χ) : - s.re = 1 / 2 := by - sorry - -/-- GRH for $\chi = 1$ is `RiemannHypothesis`. -/ -@[category test, AMS 11] -theorem implies_riemannHypothesis : - type_of% (generalized_riemann_hypothesis 1 1) ↔ RiemannHypothesis := by - aesop (add simp [DirichletCharacter.isPrimitive_one_level_one, trivialZeros, - RiemannHypothesis, riemannZeta_one_ne_zero]) - -end GRH - -/- NOTE: Extended Riemann Hypothesis -## Extended Riemann Hypothesis - -The ERH for Dedekind zeta functions **cannot** currently be stated correctly because -`NumberField.dedekindZeta` in Mathlib is the naive `LSeries`, not the meromorphic -continuation. Outside the region of absolute convergence (`re s > 1`), `tsum` returns -junk `0` for non-summable series. A statement using the raw `dedekindZeta` therefore has -spurious "zeros" that make the conjecture provably **false**. - -A correct formalisation requires a meromorphic continuation of the Dedekind zeta function -(analogous to how `ZMod.LFunction` extends the Dirichlet L-series). Once Mathlib provides -this, the ERH should be added back here. --/ +/-! Compatibility import for the corrected Millennium source path. -/ diff --git a/FormalConjectures/Millennium/RiemannHypothesis.lean b/FormalConjectures/Millennium/RiemannHypothesis.lean new file mode 100644 index 0000000..5b1dcd5 --- /dev/null +++ b/FormalConjectures/Millennium/RiemannHypothesis.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. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Riemann Hypothesis and its generalizations + +The Riemann Hypothesis asserts that all non-trivial zeros of the Riemann zeta function +$\zeta(s)$ have real part $\frac{1}{2}$. The trivial zeros are the negative even integers +$-2, -4, -6, \ldots$. The hypothesis is one of the seven Millennium Prize Problems +posed by the Clay Mathematics Institute. + +The Generalized Riemann Hypothesis extends this to Dirichlet $L$-functions of primitive +Dirichlet characters. + +Note: the **Extended Riemann Hypothesis** (ERH) for Dedekind zeta functions is intentionally +**not** stated here. Mathlib's `NumberField.dedekindZeta` is the naive Dirichlet series +(`LSeries`), not a meromorphic continuation; outside the region of absolute convergence +`tsum` returns junk `0`, producing spurious zeros that make the naive foramlisation of the +conjecture provably false. The ERH should be added once Mathlib provides a meromorphic +continuation of the Dedekind zeta function. + +*References:* +- [The Clay Institute](https://www.claymath.org/wp-content/uploads/2022/05/riemann.pdf) +- [Wikipedia: Riemann hypothesis](https://en.wikipedia.org/wiki/Riemann_hypothesis) +- [Wikipedia: Generalized Riemann hypothesis](https://en.wikipedia.org/wiki/Generalized_Riemann_hypothesis) +- [Wikipedia: Dedekind zeta function](https://en.wikipedia.org/wiki/Dedekind_zeta_function) +- J. Neukirch, *Algebraic Number Theory*, Springer (Grundlehren 322), 1999, Chapter VII, §5. +- D. A. Marcus, *Number Fields*, Springer (GTM 81), 1977, Chapter VII. +-/ + +@[expose] public section + +namespace RiemannHypothesis + +/-- The **Riemann Hypothesis**: all non-trivial zeros of the Riemann zeta function have real +part $\frac{1}{2}$. That is, if $\zeta(s) = 0$, $s \neq 1$, and $s$ is not a trivial zero +$-2(n+1)$ for some $n \in \mathbb{N}$, then $\operatorname{Re}(s) = \frac{1}{2}$. + +This is the official Millennium Prize Problem as posed by the +[Clay Mathematics Institute](https://www.claymath.org/wp-content/uploads/2022/05/riemann.pdf). + +This uses the `RiemannHypothesis` type from Mathlib, which is defined as +`∀ (s : ℂ), riemannZeta s = 0 → (¬∃ n : ℕ, s = -2 * (n + 1)) → s ≠ 1 → s.re = 1 / 2`. -/ +@[category research open, AMS 11] +theorem riemannHypothesis : RiemannHypothesis := by + sorry + +end RiemannHypothesis + +namespace GRH + +/-- Let $\chi$ be a Dirichlet character, `trivialZeros` is the set of trivial zeros of the +Dirichlet $L$-function of $\chi$ which is always a set of non-positive integers. +- $\chi = 1$ then the Dirichlet $L$-function is the Riemann zeta function, having trivial + zeroes at all negative even integers (exclude $0$). +- $\chi$ is odd, then the trivial zeroes are the negative odd integers. +- $\chi \neq 1$ is even, then the trivial zeroes are the non-positive even integers. -/ +def trivialZeros {q : ℕ} (χ : DirichletCharacter ℂ q) : Set ℤ := + if q = 1 then {-2 * (n + 1) | (n : ℕ) } else + if χ.Odd then { -2 * n - 1 | (n : ℕ) } else + { - 2 * n | (n : ℕ) } + +/-- The **Generalized Riemann Hypothesis** asserts that all the non-trivial zeros of the +Dirichlet $L$-function $L(\chi, s)$ of a primitive Dirichlet character $\chi$ have real part +$\frac{1}{2}$. -/ +@[category research open, AMS 11] +theorem generalized_riemann_hypothesis (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) + (hχ : χ.IsPrimitive) (s : ℂ) (hs : χ.LFunction s = 0) + (hs_nontrivial : s ∉ Int.cast '' trivialZeros χ) : + s.re = 1 / 2 := by + sorry + +/-- GRH for $\chi = 1$ is `RiemannHypothesis`. -/ +@[category test, AMS 11] +theorem implies_riemannHypothesis : + type_of% (generalized_riemann_hypothesis 1 1) ↔ RiemannHypothesis := by + aesop (add simp [DirichletCharacter.isPrimitive_one_level_one, trivialZeros, + RiemannHypothesis, riemannZeta_one_ne_zero]) + +end GRH + +/- NOTE: Extended Riemann Hypothesis +## Extended Riemann Hypothesis + +The ERH for Dedekind zeta functions **cannot** currently be stated correctly because +`NumberField.dedekindZeta` in Mathlib is the naive `LSeries`, not the meromorphic +continuation. Outside the region of absolute convergence (`re s > 1`), `tsum` returns +junk `0` for non-summable series. A statement using the raw `dedekindZeta` therefore has +spurious "zeros" that make the conjecture provably **false**. + +A correct formalisation requires a meromorphic continuation of the Dedekind zeta function +(analogous to how `ZMod.LFunction` extends the Dirichlet L-series). Once Mathlib provides +this, the ERH should be added back here. +-/ diff --git a/FormalConjectures/OEIS/237271.lean b/FormalConjectures/OEIS/237271.lean index 8fd3f54..488f3eb 100644 --- a/FormalConjectures/OEIS/237271.lean +++ b/FormalConjectures/OEIS/237271.lean @@ -187,7 +187,7 @@ $b^{k-1} \equiv 1 \pmod k$ for every $b$ coprime to $k$. This is `IsCarmichael`, which also forces $k$ to be composite. -/ @[category research open, AMS 11] -theorem observation_carmichael (k : ℕ) (hk : IsCarmichael k) : +theorem observation_carmichael (k : ℕ) (hk : _root_.IsCarmichael k) : 3 ≤ a k := by sorry diff --git a/FormalConjectures/OEIS/2897.lean b/FormalConjectures/OEIS/2897.lean index dc3693d..bd5c287 100644 --- a/FormalConjectures/OEIS/2897.lean +++ b/FormalConjectures/OEIS/2897.lean @@ -88,7 +88,7 @@ A formal proof has been found with the methods described in -/ @[category research solved, AMS 11, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/2897.wip.lean#L408"] -theorem a_eq_coeff (n : ℕ) : (a n : ℤ) = MvPolynomial.coeff (xyzPowN n) (pPoly n) := by +theorem a_eq_coeff (n : ℕ) : (a n : ℤ) = (pPoly n).coeff (xyzPowN n) := by sorry end OeisA2897 diff --git a/FormalConjectures/OEIS/358684.lean b/FormalConjectures/OEIS/358684.lean index 29f9745..79d67be 100644 --- a/FormalConjectures/OEIS/358684.lean +++ b/FormalConjectures/OEIS/358684.lean @@ -99,13 +99,13 @@ theorem a_equiv_a' (n : ℕ) : a n = a' n := by omega @[category test, AMS 11] -theorem a_0 : a 0 = 0 := by norm_num [a]; simp [log2_def] +theorem a_0 : a 0 = 0 := by norm_num [a] @[category test, AMS 11] -theorem a_1 : a 1 = 0 := by norm_num [a]; simp [log2_def] +theorem a_1 : a 1 = 0 := by norm_num [a] @[category test, AMS 11] -theorem a_2 : a 2 = 0 := by norm_num [a]; simp [log2_def] +theorem a_2 : a 2 = 0 := by norm_num [a] @[category test, AMS 11] theorem a_3 : a 3 = 0 := by @@ -145,8 +145,8 @@ theorem oeis_358684_conjecture_0 (n : ℕ) : · rw [Nat.log2_eq_log_two] apply Nat.le_log_of_pow_le (by decide) refine le_trans ?_ <| sub_le _ 1 - apply Nat.ordProj_le 2 - exact Nat.sub_ne_zero_of_lt (Nat.minFac_prime (by norm_num)).one_lt + exact Nat.le_of_dvd + (Nat.sub_pos_of_lt (Nat.minFac_prime (by norm_num)).one_lt) pow_padicValNat_dvd · rw [Nat.log2_eq_log_two] have : (2 ^ 2 ^ n) + 1 < 2 ^ ((2 ^ n) + 1) := by simp [pow_add, mul_two] diff --git a/FormalConjectures/ResearchTargets/Math15.lean b/FormalConjectures/ResearchTargets/Math15.lean new file mode 100644 index 0000000..12aa372 --- /dev/null +++ b/FormalConjectures/ResearchTargets/Math15.lean @@ -0,0 +1,91 @@ +import Math15.Interfaces +import Math15.CollatzCertificates +import FormalConjecturesUtil.Attributes.Basic + +/-! +TRUSTED CATALOG-ONLY CHALLENGES. Every declaration below is INTENTIONALLY INCOMPLETE. +These research-open tags are proposed source metadata, not live registry admission. +Target12 is an alternative residual of10; do not award both independently. +Targets13 and14 have scoped novelty review, not an absolute originality guarantee. +These declarations are not proofs and must never be accepted as solution dependencies. +All mathematical definitions and supporting lemmas remain in the clean Math15 modules. +The pinned generator requires theorem-shaped source placeholders to extract exact types. +-/ +namespace Math15Catalog + +/-- Incomplete challenge 01: Book Ramsey B4/B7 on 22 vertices. Source: https://www.cs.rit.edu/~spr/ElJC/sur.pdf -/ +@[category research open] +theorem source01 : Math15.Ramsey.Target01 := by + sorry + +/-- Incomplete challenge 02: Book Ramsey B4/B9 on 27 vertices. Source: https://www.cs.rit.edu/~spr/ElJC/sur.pdf -/ +@[category research open] +theorem source02 : Math15.Ramsey.Target02 := by + sorry + +/-- Incomplete challenge 03: Book Ramsey B7/B11 on 37 vertices. Source: https://www.cs.rit.edu/~spr/ElJC/sur.pdf -/ +@[category research open] +theorem source03 : Math15.Ramsey.Target03 := by + sorry + +/-- Incomplete challenge 04: Two-entry tight lonely-runner classification. Source: https://arxiv.org/html/2608.13599v2#S9 -/ +@[category research open] +theorem source04 : Math15.LonelyRunner.Target04 := by + sorry + +/-- Incomplete challenge 05: Four-speed amended lonely-runner spectrum. Source: https://www.combinatorics.org/ojs/index.php/eljc/article/view/v33i1p38 -/ +@[category research open] +theorem source05 : Math15.LonelyRunner.Target05 := by + sorry + +/-- Incomplete challenge 06: Six-speed maximum-speed/denominator bound. Source: https://arxiv.org/html/2609.03444v2#S6.SS4 -/ +@[category research open] +theorem source06 : Math15.LonelyRunner.Target06 := by + sorry + +/-- Incomplete challenge 07: Height-five Frankl rho 4 proper cover. Source: https://arxiv.org/html/2608.25147v1#S8 -/ +@[category research open] +theorem source07 : Math15.Frankl.Target07 := by + sorry + +/-- Incomplete challenge 08: Height-five Frankl rho 3 exclusion. Source: https://arxiv.org/html/2608.25147v1#S8 -/ +@[category research open] +theorem source08 : Math15.Frankl.Target08 := by + sorry + +/-- Incomplete challenge 09: Height-five Frankl rho 4 full cover. Source: https://arxiv.org/html/2608.25147v1#S8 -/ +@[category research open] +theorem source09 : Math15.Frankl.Target09 := by + sorry + +/-- Incomplete challenge 10: Graceful degree-4-degree-3 trees. Source: https://onlinelibrary.wiley.com/doi/10.1155/jama/5826777 -/ +@[category research open] +theorem source10 : Math15.Graceful.Target10 := by + sorry + +/-- Incomplete challenge 11: Graceful three-degree-3 trees. Source: https://onlinelibrary.wiley.com/doi/10.1155/jama/5826777 -/ +@[category research open] +theorem source11 : Math15.Graceful.Target11 := by + sorry + +/-- Incomplete challenge 12: Graceful degree-4-degree-3 trees with two length-2 arms. Source: https://onlinelibrary.wiley.com/doi/10.1155/jama/5826777 -/ +@[category research open] +theorem source12 : Math15.Graceful.Target12 := by + sorry + +/-- Incomplete challenge 13: Collatz density exponent 23/25. Source: https://arxiv.org/abs/math/0205002 -/ +@[category research open] +theorem source13 : Math15.Collatz.Target13 := by + sorry + +/-- Incomplete challenge 14: Collatz exclusion of 96-local-minimum cycles. Source: https://cs.uwaterloo.ca/journals/JIS/VOL26/Hercher/hercher5.pdf -/ +@[category research open] +theorem source14 : Math15.Collatz.Target14 := by + sorry + +/-- Incomplete challenge 15: Collatz convergence below 2^72. Source: https://pcbarina.fit.vutbr.cz/ -/ +@[category research open] +theorem source15 : Math15.Collatz.Target15 := by + sorry + +end Math15Catalog diff --git a/FormalConjectures/ResearchTargets/Math30.lean b/FormalConjectures/ResearchTargets/Math30.lean new file mode 100644 index 0000000..6bfb0a3 --- /dev/null +++ b/FormalConjectures/ResearchTargets/Math30.lean @@ -0,0 +1,88 @@ +import Math30 +import FormalConjecturesUtil.Attributes.Basic + +/-! +ISOLATED TRUSTED CHALLENGE CATALOG. The following intentionally incomplete theorem +placeholders specify tasks; they are not proofs, and no clean Math30 module imports +this catalog. The actual extractor records their theorem types and sorry dependence. +Research-open tags are proposed local metadata, not admission, novelty certification, +reward activation, or a claim that outstanding semantic readiness gates are closed. +-/ +namespace Math30Catalog + +/-- Incomplete challenge 16: Complex 4x4 exact bilinear multiplication with at most 47 products. Source: https://epoch.ai/frontiermath/open-problems/matrix-multiplication -/ +@[category research open] +theorem source16 : Math30.MatrixBoolean.Statement16 := by + sorry + +/-- Incomplete challenge 17: Exact F2 bilinear rank 23 for 3x3 multiplication. Source: https://arxiv.org/html/2610.01639v1 -/ +@[category research open] +theorem source17 : Math30.MatrixBoolean.Statement17 := by + sorry + +/-- Incomplete challenge 18: Complex 3x3 border rank at least 18. Source: https://arxiv.org/abs/1911.07981 -/ +@[category research open] +theorem source18 : Math30.MatrixBoolean.Statement18 := by + sorry + +/-- Incomplete challenge 19: Degree at most 5, total 14-variable Boolean function fully sensitive at zero. Source: https://epoch.ai/frontiermath/open-problems/degree-sensitivity-boolean -/ +@[category research open] +theorem source19 : Math30.MatrixBoolean.Statement19 := by + sorry + +/-- Incomplete challenge 20: Uniform subquadratic sensitivity-versus-exact-real-degree upper bound. Source: https://arxiv.org/abs/2005.00566v2 -/ +@[category research open] +theorem source20 : Math30.MatrixBoolean.Statement20 := by + sorry + +/-- Incomplete challenge 21: Uniform cubic ordinary-sensitivity upper bound for block sensitivity. Source: https://eccc.weizmann.ac.il/report/2026/010/ -/ +@[category research open] +theorem source21 : Math30.MatrixBoolean.Statement21 := by + sorry + +/-- Incomplete challenge 22: Wilf inequality for proper numerical semigroups with embedding dimension 4. Source: https://arxiv.org/abs/1703.01761 -/ +@[category research open] +theorem source22 : Math30.Problem22 := by + sorry + +/-- Incomplete challenge 23: Wilf inequality for proper numerical semigroups with conductor at most four times multiplicity. Source: https://arxiv.org/abs/1703.01761 -/ +@[category research open] +theorem source23 : Math30.Problem23 := by + sorry + +/-- Incomplete challenge 24: Wilf inequality for proper numerical semigroups with multiplicity at most four times embedding dimension. Source: https://arxiv.org/abs/1111.1863 -/ +@[category research open] +theorem source24 : Math30.Problem24 := by + sorry + +/-- Incomplete challenge 25: Third planar Dirichlet Polya inequality, area times lambda3 at least 12pi. Source: https://arxiv.org/html/2507.04307v3 -/ +@[category research open] +theorem source25 : Math30.Polya.Target25 := by + sorry + +/-- Incomplete challenge 26: Fourth planar Dirichlet Polya inequality, area times lambda4 at least 16pi. Source: https://arxiv.org/html/2507.04307v3 -/ +@[category research open] +theorem source26 : Math30.Polya.Target26 := by + sorry + +/-- Incomplete challenge 27: All positive-index Dirichlet Polya inequalities on convex planar domains. Source: https://arxiv.org/html/2410.04769v2 -/ +@[category research open] +theorem source27 : Math30.Polya.Target27 := by + sorry + +/-- Incomplete challenge 28: Every degree-at-most-four scalar real polynomial minimal graph is affine, in every dimension. Source: https://arxiv.org/html/2404.00115v2 -/ +@[category research open] +theorem source28 : Math30.Problem28 := by + sorry + +/-- Incomplete challenge 29: Every scalar real polynomial minimal graph in dimension eight is affine. Source: https://arxiv.org/html/2404.00115v2 -/ +@[category research open] +theorem source29 : Math30.Problem29 := by + sorry + +/-- Incomplete challenge 30: For every dimension n>=8 there is a degree bound uniform over all scalar real polynomial minimal graphs. Source: https://arxiv.org/html/2404.00115v2 -/ +@[category research open] +theorem source30 : Math30.Problem30 := by + sorry + +end Math30Catalog diff --git a/FormalConjectures/Subsets/FC100OpenSet1.lean b/FormalConjectures/Subsets/FC100OpenSet1.lean index 4149ee5..9be1814 100644 --- a/FormalConjectures/Subsets/FC100OpenSet1.lean +++ b/FormalConjectures/Subsets/FC100OpenSet1.lean @@ -223,6 +223,6 @@ end Subsets.FC100OpenSet1 open Lean Meta ProblemAttributes in #eval verifyCategoryCounts Subsets.FC100OpenSet1.problems [ - ("research open", 91), - ("research solved", 9) + ("research open", 90), + ("research solved", 10) ] diff --git a/FormalConjectures/Wikipedia/ABC.lean b/FormalConjectures/Wikipedia/ABC.lean index 584f7ed..33f8e23 100644 --- a/FormalConjectures/Wikipedia/ABC.lean +++ b/FormalConjectures/Wikipedia/ABC.lean @@ -14,7 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil + +@[expose] public section /-! # *abc* conjecture diff --git a/FormalConjectures/Wikipedia/AgohGiuga.lean b/FormalConjectures/Wikipedia/AgohGiuga.lean index 710ff0e..5fecfe5 100644 --- a/FormalConjectures/Wikipedia/AgohGiuga.lean +++ b/FormalConjectures/Wikipedia/AgohGiuga.lean @@ -118,6 +118,7 @@ theorem squarefree_of_isCarmichael {a : ℕ} (ha₁ : a.Composite) (ha₂ : IsCa rintro p hp ⟨N, rfl⟩ apply absurd (ha₂_forall (p * N + 1) ((1).le_add_left _)) have : Fact p.Prime := ⟨hp⟩ + let : AddCommGroup (ZMod p) := (inferInstance : Field (ZMod p)).toAddCommGroup rw [mul_assoc] at ha₁ rw [mul_assoc, ← geom_sum_mul_of_one_le ((1).le_add_left (p * N)), p.coprime_mul_iff_left] simpa using (mul_dvd_mul_iff_right fun _ ↦ by simp_all only [mul_zero, not_lt_zero]).not.mpr diff --git a/FormalConjectures/Wikipedia/ArtinPrimitiveRootsConjecture.lean b/FormalConjectures/Wikipedia/ArtinPrimitiveRootsConjecture.lean index 8088dd5..15ed864 100644 --- a/FormalConjectures/Wikipedia/ArtinPrimitiveRootsConjecture.lean +++ b/FormalConjectures/Wikipedia/ArtinPrimitiveRootsConjecture.lean @@ -13,16 +13,17 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil -import FormalConjectures.Millenium.RiemannHypothesis +public import FormalConjecturesUtil +public import FormalConjectures.Millennium.RiemannHypothesis /-! # Artin's conjecture on primitive roots Artin's conjecture predicts, given an integer $a$, densities of primes $p$ for which $a$ is a primitive root modulo $p$. Under certain conditions (when $a$ is not a -power and its squarefree part is $1\pmod{4}$) the density is given by Artin's constant +power and its squarefree part is not $1\pmod{4}$) the density is given by Artin's constant $$\prod_{p\ \text{prime}} \left(1 - \frac{1}{p(p - 1)}\right).$$ For more general values of $a$, this constant must be corrected by certain factors. - When $a = b^m$, $m$ is a maximal odd power, the squarefree part of $b$ satisfies @@ -36,8 +37,10 @@ For more general values of $a$, this constant must be corrected by certain facto \prod_{p \mid b_0, p\nmid m} \frac{1}{1 + p - p^2}.$$ - When $a = -1$ or $a$ is a square, then the density is $0$. -Note that Artin's conjecture has been proved subject to the Generalized Riemann Hypothesis -[Ho67]. +Note that Artin's conjecture has been proved by Hooley [Ho67] subject to the Riemann hypothesis +for the Dedekind zeta functions of the Kummer fields $\mathbb{Q}(\zeta_k, a^{1/k})$, $k$ +squarefree. These fields are in general non-abelian over $\mathbb{Q}$, so this hypothesis is not +covered by the Generalized Riemann Hypothesis for Dirichlet $L$-functions. *References:* - [Wikipedia](https://en.wikipedia.org/wiki/Artin%27s_conjecture_on_primitive_roots) @@ -46,11 +49,35 @@ Note that Artin's conjecture has been proved subject to the Generalized Riemann - [Ho67] Hooley, C. "On Artin's conjecture." _Journal für die reine und angewandte Mathematik_ 225 (1967): 209-220. -/ +@[expose] public section + open GRH open scoped Topology Nat namespace ArtinPrimitiveRootsConjecture +/-- `Z` is a Dedekind zeta function of the number field `K`: it is holomorphic away from $s = 1$ +and agrees with the Dedekind zeta series of `K` on $\operatorname{Re} s > 1$, where that series +converges. Such a `Z` is uniquely determined on $\mathbb{C} \setminus \{1\}$. -/ +def IsDedekindZeta (K : Type*) [Field K] [NumberField K] (Z : ℂ → ℂ) : Prop := + DifferentiableOn ℂ Z {1}ᶜ ∧ ∀ s : ℂ, 1 < s.re → Z s = NumberField.dedekindZeta K s + +/-- The **Riemann hypothesis for the Dedekind zeta function** $\zeta_K$ of a number field $K$: +every zero of (the analytic continuation of) $\zeta_K$ in the critical strip +$0 < \operatorname{Re} s < 1$ has real part $\frac{1}{2}$. -/ +def DedekindZetaRH (K : Type*) [Field K] [NumberField K] : Prop := + ∀ Z : ℂ → ℂ, IsDedekindZeta K Z → ∀ s : ℂ, 0 < s.re → s.re < 1 → Z s = 0 → s.re = 1 / 2 + +open Polynomial in +/-- **Hooley's hypothesis** for $a$: the Riemann hypothesis holds for the Dedekind zeta function +of the Kummer field $\mathbb{Q}(\zeta_k, a^{1/k})$, the splitting field of $X^k - a$ over +$\mathbb{Q}$, for every squarefree $k$. This is the hypothesis under which Hooley [Ho67] proved +Artin's conjecture. -/ +def HooleyHypothesis (a : ℤ) : Prop := + ∀ k : ℕ, Squarefree k → + letI := NumberField.of_module_finite ℚ (X ^ k - C (a : ℚ)).SplittingField + DedekindZetaRH (X ^ k - C (a : ℚ)).SplittingField + /-- Let $S(a)$ be the set of primes such that $a$ is a primitive root modulo $p$. -/ abbrev S (a : ℤ) : Set ℕ := {p : ℕ | p.Prime ∧ orderOf (a : ZMod p) = (p-1 : ℕ)} @@ -95,11 +122,13 @@ theorem artin_primitive_roots.parts.i (a : ℤ) (ha : ¬IsSquare a) (ha' : a ≠ sorry /-- -**Artin's Conjecture on Primitive Roots**, first half, conditional on GRH. +**Artin's Conjecture on Primitive Roots**, first half, conditional on the Riemann hypothesis +for the Dedekind zeta functions of the fields $\mathbb{Q}(\zeta_k, a^{1/k})$, $k$ squarefree +[Ho67]. -/ @[category research solved, AMS 11] theorem conditional_artin_primitive_roots.parts.i (a : ℤ) (ha : ¬IsSquare a) (ha' : a ≠ -1) - (h : type_of% generalized_riemann_hypothesis) : + (h : HooleyHypothesis a) : ∃ x > 0, (S a).HasDensity x {p | p.Prime} := by sorry @@ -120,14 +149,16 @@ theorem artin_primitive_roots.parts.ii /-- -**Artin's Conjecture on Primitive Roots**, second half, conditional on GRH. +**Artin's Conjecture on Primitive Roots**, second half, conditional on the Riemann hypothesis +for the Dedekind zeta functions of the fields $\mathbb{Q}(\zeta_k, a^{1/k})$, $k$ squarefree +[Ho67]. -/ @[category research solved, AMS 11] theorem conditional_artin_primitive_roots.parts.ii (a a_0 b : ℤ) (ha : a = a_0 * b ^ 2) (ha' : ∀ n m, m ≠ 1 → a ≠ n ^ m) (ha_0 : Squarefree a_0) (ha_0' : ¬a_0 ≡ 1 [ZMOD 4]) - (h : type_of% generalized_riemann_hypothesis) : + (h : HooleyHypothesis a) : (S a).HasDensity ArtinConstant {p | p.Prime} := by sorry @@ -159,13 +190,15 @@ theorem artin_primitive_roots.variants.part_ii_power_squarefreePart_not_modeq_on sorry /-- -**Artin's Conjecture on Primitive Roots**, second half, power version, conditional on GRH +**Artin's Conjecture on Primitive Roots**, second half, power version, conditional on the +Riemann hypothesis for the Dedekind zeta functions of the fields $\mathbb{Q}(\zeta_k, a^{1/k})$, +$k$ squarefree [Ho67]. -/ @[category research solved, AMS 11] theorem conditional_artin_primitive_roots.variants.part_ii_power_squarefreePart_not_modeq_one (a m b : ℕ) (ha : a = b ^ m) (hb : ∀ u v, 1 < u → b ≠ v ^ u) (hm₁ : 1 < m) (hm₂ : Odd m) (hb' : ¬ b.squarefreePart ≡ 1 [MOD 4]) - (h : type_of% generalized_riemann_hypothesis) : + (h : HooleyHypothesis a) : (S a).HasDensity (ArtinConstant * powCorrectionFactor m) {p | p.Prime} := by sorry @@ -189,13 +222,15 @@ theorem artin_primitive_roots.variants.part_ii_power_squarefreePart_modeq_one sorry /-- -**Artin's Conjecture on Primitive Roots**, second half, power version, conditional on GRH. +**Artin's Conjecture on Primitive Roots**, second half, power version, conditional on the +Riemann hypothesis for the Dedekind zeta functions of the fields $\mathbb{Q}(\zeta_k, a^{1/k})$, +$k$ squarefree [Ho67]. -/ @[category research solved, AMS 11] theorem conditional_artin_primitive_roots.variants.part_ii_power_squarefreePart_modeq_one (a m b : ℕ) (ha : a = b ^ m) (hb : ∀ u v, 1 < u → b ≠ v ^ u) (hm₁ : 1 < m) (hm₂ : Odd m) (hb' : b.squarefreePart ≡ 1 [MOD 4]) - (h : type_of% generalized_riemann_hypothesis) : + (h : HooleyHypothesis a) : (S a).HasDensity (ArtinConstant * powCorrectionFactor m * entanglementFactor b m) {p | p.Prime} := by diff --git a/FormalConjectures/Wikipedia/BorsukConjecture.lean b/FormalConjectures/Wikipedia/BorsukConjecture.lean new file mode 100644 index 0000000..cec2f56 --- /dev/null +++ b/FormalConjectures/Wikipedia/BorsukConjecture.lean @@ -0,0 +1,204 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesUtil + +/-! +# Borsuk's conjecture + +In 1933 Karol Borsuk [Bo33] asked whether every bounded subset of $\mathbb{R}^n$ can be +partitioned into $n + 1$ sets, each of strictly smaller diameter. The hypothesis that the +answer is positive became known as **Borsuk's conjecture**. + +The conjecture is true for $n = 2$ [Bo33] and $n = 3$ [Pe47, Eg55]. It is false in general: +Kahn and Kalai [KK93] disproved it for $n = 1325$ and for all $n > 2014$. Bondarenko [Bo14] +gave a counterexample in dimension $65$, and Jenrich and Brouwer [JB14] one in dimension $64$, +the smallest refereed counterexample. In 2026 Grinsztajn [Gr26] posted a 321-point +counterexample in dimension $63$, obtained with AI assistance and verified by exact +computation; the same configuration was found independently by Konz and by Ji [Ji26]. The +cases $4 \leq n \leq 62$ are open. In dimension $4$, every bounded set can be partitioned into +$9$ parts of smaller diameter [La82], and a 2026 preprint reduces this to $8$ parts [TV26]. + +Erdős Problem 505 (`FormalConjectures.ErdosProblems.«505»`) points to this file. + +*References:* +- [Wikipedia](https://en.wikipedia.org/wiki/Borsuk%27s_conjecture) +- [Bo33] Borsuk, K. (1933). *Drei Sätze über die n-dimensionale euklidische Sphäre*. + Fundamenta Mathematicae 20, 177–190. https://doi.org/10.4064/fm-20-1-177-190 +- [Pe47] Perkal, J. (1947). *Sur la subdivision des ensembles en parties de diamètre inférieur*. + Colloquium Mathematicum 2, 45. +- [Eg55] Eggleston, H. G. (1955). *Covering a three-dimensional set with sets of smaller + diameter*. Journal of the London Mathematical Society 30, 11–24. + https://doi.org/10.1112/jlms/s1-30.1.11 +- [La82] Lassak, M. (1982). *An estimate concerning Borsuk partition problem*. + Bulletin of the Polish Academy of Sciences, Mathematics 30(9–10), 449–451. +- [KK93] Kahn, J., Kalai, G. (1993). *A counterexample to Borsuk's conjecture*. + Bulletin of the American Mathematical Society 29(1), 60–62. + https://arxiv.org/abs/math/9307229 +- [Bo14] Bondarenko, A. (2014). *On Borsuk's conjecture for two-distance sets*. + Discrete & Computational Geometry 51(3), 509–515. https://doi.org/10.1007/s00454-014-9579-4 +- [JB14] Jenrich, T., Brouwer, A. E. (2014). *A 64-dimensional counterexample to Borsuk's + conjecture*. Electronic Journal of Combinatorics 21(4), P4.29. https://doi.org/10.37236/4069 +- [Gr26] Grinsztajn, M. (2026). *A 63-dimensional counterexample to Borsuk's conjecture*. + Proof note and verification script, https://github.com/maaxgrin/borsuk-63-counterexample +- [Ji26] Ji, Y. (2026). *An AI generated counterexample to Borsuk problem in dimension 63*. + https://arxiv.org/abs/2608.12561 (withdrawn as a duplicate of [Gr26]) +- [TV26] Tolmachev, A., Voronov, V. (2026). *Reducing the upper bound for the Borsuk number + in $\mathbb{R}^4$ to 8*. https://arxiv.org/abs/2605.19068 +- [OP28a] Tao, T. et al., *Optimization problems*, constant 28a (smallest Borsuk + counterexample dimension). https://teorth.github.io/optimizationproblems/constants/28a.html +- [Ka15] Kalai, G. (2015). *Some old and new problems in combinatorial geometry I: Around + Borsuk's problem*. https://arxiv.org/abs/1505.04952 +-/ + +@[expose] public section + +open Metric Bornology + +open scoped EuclideanGeometry + +namespace Borsuk + +variable {E : Type*} [PseudoEMetricSpace E] + +/-- +`HasBorsukCover k s` means that the set `s` can be covered by `k` sets, each of strictly +smaller extended diameter than `s`. + +We use the extended diameter `Metric.ediam` rather than `Metric.diam`: the latter takes the +junk value `0` on unbounded sets, which would make `Set.univ` a covering set of "small" +diameter. With `Metric.ediam`, a set of diameter `0` has no Borsuk cover, and an unbounded +set has no finite Borsuk cover, matching Borsuk's formulation for bounded sets with at +least two points. +-/ +def HasBorsukCover (k : ℕ) (s : Set E) : Prop := + ∃ c : Fin k → Set E, s ⊆ ⋃ i, c i ∧ ∀ i, ediam (c i) < ediam s + +/-- +**Borsuk's conjecture** in dimension `n`: every bounded subset of $\mathbb{R}^n$ with at +least two points can be partitioned into $n + 1$ sets of strictly smaller diameter. +-/ +def BorsukConjecture (n : ℕ) : Prop := + ∀ s : Set (ℝ^n), IsBounded s → s.Nontrivial → HasBorsukCover (n + 1) s + +/-- +**Borsuk's conjecture**, open range: every bounded subset of $\mathbb{R}^n$ with at least two +points can be partitioned into $n + 1$ sets of strictly smaller diameter, for +$4 \leq n \leq 62$. + +The conjecture is known to be true for $n \leq 3$ and false for $n \geq 63$. +-/ +@[category research open, AMS 52] +theorem borsuk_conjecture (n : ℕ) (hn : 4 ≤ n) (hn' : n ≤ 62) : BorsukConjecture n := by + sorry + +/-- **Borsuk's conjecture** in dimension $4$, the smallest open case. -/ +@[category research open, AMS 52] +theorem borsuk_conjecture.four : BorsukConjecture 4 := by + sorry + +/-- +**Partial result in dimension $4$**: every bounded subset of $\mathbb{R}^4$ with at least two +points can be partitioned into $9$ sets of strictly smaller diameter. Proved by Lassak [La82], +who showed more generally that $2^{n-1} + 1$ parts suffice in $\mathbb{R}^n$. +-/ +@[category research solved, AMS 52] +theorem borsuk_conjecture.four.nine_parts (s : Set (ℝ^4)) (hs : IsBounded s) + (hs' : s.Nontrivial) : HasBorsukCover 9 s := by + sorry + +/-- +**Partial result in dimension $4$**: every bounded subset of $\mathbb{R}^4$ with at least two +points can be partitioned into $8$ sets of strictly smaller diameter. Claimed by Tolmachev and +Voronov [TV26] via computer-assisted partitions of a truncated Lassak cover, with floating-point +verification; the preprint is not yet refereed. +-/ +@[category research solved, AMS 52] +theorem borsuk_conjecture.four.eight_parts (s : Set (ℝ^4)) (hs : IsBounded s) + (hs' : s.Nontrivial) : HasBorsukCover 8 s := by + sorry + +/-- **Borsuk's conjecture** holds vacuously in dimension $0$: the space is a single point. -/ +@[category test, AMS 52, + formal_proof using formal_conjectures at + "https://github.com/mo271/formal-conjectures/blob/07a6d25f07ba0e16a916be14e9830c36cfcb9777/FormalConjectures/Wikipedia/BorsukConjecture.lean#L118"] +theorem borsuk_conjecture.zero : BorsukConjecture 0 := by + sorry + +/-- +**Borsuk's conjecture** in dimension $1$: a bounded set of reals with at least two points +splits at the midpoint of its smallest enclosing interval into two parts of smaller diameter. +-/ +@[category textbook, AMS 52, + formal_proof using formal_conjectures at + "https://github.com/mo271/formal-conjectures/blob/07a6d25f07ba0e16a916be14e9830c36cfcb9777/FormalConjectures/Wikipedia/BorsukConjecture.lean#L126"] +theorem borsuk_conjecture.one : BorsukConjecture 1 := by + sorry + +/-- **Borsuk's conjecture** in the plane, proved by Borsuk [Bo33]. -/ +@[category research solved, AMS 52, + formal_proof using formal_conjectures at + "https://github.com/mo271/formal-conjectures/blob/07a6d25f07ba0e16a916be14e9830c36cfcb9777/FormalConjectures/Wikipedia/BorsukConjecture.lean#L131"] +theorem borsuk_conjecture.two : BorsukConjecture 2 := by + sorry + +/-- **Borsuk's conjecture** in dimension $3$, proved by Perkal [Pe47] and Eggleston [Eg55]. -/ +@[category research solved, AMS 52, + formal_proof using formal_conjectures at + "https://github.com/mo271/formal-conjectures/blob/07a6d25f07ba0e16a916be14e9830c36cfcb9777/FormalConjectures/Wikipedia/BorsukConjecture.lean#L136"] +theorem borsuk_conjecture.three : BorsukConjecture 3 := by + sorry + +/-- +**Borsuk's conjecture** is false in general: Kahn and Kalai [KK93] gave counterexamples in +dimension $1325$ and in every dimension $n > 2014$. +-/ +@[category research solved, AMS 52, + formal_proof using formal_conjectures at + "https://github.com/mo271/formal-conjectures/blob/07a6d25f07ba0e16a916be14e9830c36cfcb9777/FormalConjectures/Wikipedia/BorsukConjecture.lean#L144"] +theorem borsuk_conjecture.not_forall : ¬ ∀ n, BorsukConjecture n := by + sorry + +/-- **Borsuk's conjecture** fails in dimension $65$, by Bondarenko [Bo14]. -/ +@[category research solved, AMS 52, + formal_proof using formal_conjectures at + "https://github.com/mo271/formal-conjectures/blob/07a6d25f07ba0e16a916be14e9830c36cfcb9777/FormalConjectures/Wikipedia/BorsukConjecture.lean#L149"] +theorem borsuk_conjecture.not_sixty_five : ¬ BorsukConjecture 65 := by + sorry + +/-- +**Borsuk's conjecture** fails in dimension $64$, by Jenrich and Brouwer [JB14]. This is the +smallest dimension with a refereed counterexample. +-/ +@[category research solved, AMS 52, + formal_proof using formal_conjectures at + "https://github.com/mo271/formal-conjectures/blob/07a6d25f07ba0e16a916be14e9830c36cfcb9777/FormalConjectures/Wikipedia/BorsukConjecture.lean#L157"] +theorem borsuk_conjecture.not_sixty_four : ¬ BorsukConjecture 64 := by + sorry + +/-- +**Borsuk's conjecture** fails in dimension $63$, by a 321-point configuration found in 2026 +by Grinsztajn [Gr26] and independently by Konz and Ji [Ji26]. This is the smallest dimension +in which the conjecture is currently known to be false. +-/ +@[category research solved, AMS 52, + formal_proof using formal_conjectures at + "https://github.com/mo271/formal-conjectures/blob/07a6d25f07ba0e16a916be14e9830c36cfcb9777/FormalConjectures/Wikipedia/BorsukConjecture.lean#L166"] +theorem borsuk_conjecture.not_sixty_three : ¬ BorsukConjecture 63 := by + sorry + +end Borsuk diff --git a/FormalConjectures/Wikipedia/BrocardConjecture.lean b/FormalConjectures/Wikipedia/BrocardConjecture.lean index e83f06c..4d698d9 100644 --- a/FormalConjectures/Wikipedia/BrocardConjecture.lean +++ b/FormalConjectures/Wikipedia/BrocardConjecture.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Brocard's Conjecture @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [Luan Alberto Ferreira, *Real exponential sums over primes and prime gaps*](https://arxiv.org/abs/2307.08725) -/ +@[expose] public section + open Finset Filter namespace Brocard diff --git a/FormalConjectures/Wikipedia/Bunyakovsky.lean b/FormalConjectures/Wikipedia/Bunyakovsky.lean index 7692947..909ee39 100644 --- a/FormalConjectures/Wikipedia/Bunyakovsky.lean +++ b/FormalConjectures/Wikipedia/Bunyakovsky.lean @@ -13,14 +13,18 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Bunyakovsky conjecture *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Bunyakovsky_conjecture) -/ + +@[expose] public section + open Polynomial namespace Bunyakovsky diff --git a/FormalConjectures/Wikipedia/CarmichaelTotient.lean b/FormalConjectures/Wikipedia/CarmichaelTotient.lean index 2598d9a..54512ec 100644 --- a/FormalConjectures/Wikipedia/CarmichaelTotient.lean +++ b/FormalConjectures/Wikipedia/CarmichaelTotient.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Carmichael's totient function conjecture @@ -27,6 +28,8 @@ $φ(n) = φ(m)$ where $φ$ is the Euler totient function. - [F1998] Kevin Ford. The distribution of totients. https://arxiv.org/abs/1104.3264 -/ +@[expose] public section + universe u v open Nat diff --git a/FormalConjectures/Wikipedia/ClassNumberProblem.lean b/FormalConjectures/Wikipedia/ClassNumberProblem.lean index 34c5a43..2d5c7d2 100644 --- a/FormalConjectures/Wikipedia/ClassNumberProblem.lean +++ b/FormalConjectures/Wikipedia/ClassNumberProblem.lean @@ -13,14 +13,18 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Class number problem for real quadratic fields *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Class_number_problem) -/ + +@[expose] public section + open Polynomial namespace ClassNumberProblem diff --git a/FormalConjectures/Wikipedia/Dickson.lean b/FormalConjectures/Wikipedia/Dickson.lean index dd9a266..c77c4d9 100644 --- a/FormalConjectures/Wikipedia/Dickson.lean +++ b/FormalConjectures/Wikipedia/Dickson.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Dickson's conjecture @@ -27,6 +28,9 @@ import FormalConjecturesUtil - [Leonard Eugene Dickson, *History of the Theory of Numbers, Vol. I: Divisibility and Primality*](https://archive.org/details/historyoftheoryo01dickuoft) - [Arxiv](https://arxiv.org/pdf/0906.3850) -/ + +@[expose] public section + open Polynomial namespace Dickson diff --git a/FormalConjectures/Wikipedia/Fermat.lean b/FormalConjectures/Wikipedia/Fermat.lean index 3ca015d..0726cda 100644 --- a/FormalConjectures/Wikipedia/Fermat.lean +++ b/FormalConjectures/Wikipedia/Fermat.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Open questions about Fermat numbers @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Fermat_number) -/ +@[expose] public section + namespace Fermat /-- @@ -46,10 +49,10 @@ theorem infinite_fermat_composite : answer(sorry) ↔ Infinite {n : ℕ | ¬Prim sorry /-- -Are all Fermat numbers are square-free? +Does a Fermat number exist that is not square-free? -/ @[category research open, AMS 11] -theorem all_fermat_squarefree : answer(sorry) ↔ ∀ n : ℕ, Squarefree n.fermatNumber := by +theorem exists_fermat_not_squarefree : answer(sorry) ↔ ∃ n : ℕ, ¬Squarefree n.fermatNumber := by sorry end Fermat diff --git a/FormalConjectures/Wikipedia/GaussCircleProblem.lean b/FormalConjectures/Wikipedia/GaussCircleProblem.lean index 5448505..005da83 100644 --- a/FormalConjectures/Wikipedia/GaussCircleProblem.lean +++ b/FormalConjectures/Wikipedia/GaussCircleProblem.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Gauss circle problem @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Gauss_circle_problem) -/ +@[expose] public section + open Filter open scoped EuclideanGeometry Real Topology diff --git a/FormalConjectures/Wikipedia/GoldbachConjecture.lean b/FormalConjectures/Wikipedia/GoldbachConjecture.lean index 08feda5..4001d50 100644 --- a/FormalConjectures/Wikipedia/GoldbachConjecture.lean +++ b/FormalConjectures/Wikipedia/GoldbachConjecture.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Goldbach's conjecture @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [Goldbach's Conjecture Wikipedia Page](https://en.wikipedia.org/wiki/Goldbach%27s_conjecture) -/ +@[expose] public section + namespace GoldbachConjecture /-- diff --git a/FormalConjectures/Wikipedia/Goormaghtigh.lean b/FormalConjectures/Wikipedia/Goormaghtigh.lean index 807537c..3eabf7f 100644 --- a/FormalConjectures/Wikipedia/Goormaghtigh.lean +++ b/FormalConjectures/Wikipedia/Goormaghtigh.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # The Goormaghtigh conjecture @@ -29,6 +30,8 @@ having nontrivial repunit representations in two different bases. [No new Goormaghtigh primes up to $10^{700}$](https://math.colgate.edu/~integers/y98/y98.pdf) -/ +@[expose] public section + namespace Goormaghtigh /-- The repunit with `digits` digits in the given base, expressed without division. -/ diff --git a/FormalConjectures/Wikipedia/Hadamard.lean b/FormalConjectures/Wikipedia/Hadamard.lean index 180b7a2..6665a82 100644 --- a/FormalConjectures/Wikipedia/Hadamard.lean +++ b/FormalConjectures/Wikipedia/Hadamard.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Hadamard's conjecture @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [Résolution d'une question relative aux déterminants](https://gallica.bnf.fr/ark:/12148/bpt6k486252g/f400.image.r) by *Jacques Hadamard*, Bull. des sciences math., p.245, 1893 -/ +@[expose] public section + namespace Hadamard /-- @@ -113,7 +116,14 @@ which satisfies the condition. -/ @[category test, AMS 15] theorem isHadamard_H12 : IsHadamard H12 := by - sorry + have h : H12.transpose * H12 = (12 : ℝ) • 1 := by + rw [← Matrix.ext_iff] + norm_num +decide [Fin.forall_fin_succ, Matrix.mul_apply, Fin.sum_univ_succ, H12, + Matrix.one_apply] + have hd : H12.det ^ 2 = 12 ^ 12 := by simpa [Matrix.det_smul, ← sq] using congrArg Matrix.det h + refine ⟨by simp [Fin.forall_fin_succ, H12], ?_⟩ + rw [← Real.sqrt_sq_eq_abs, hd] + norm_num /-- For all $k ≤ 166$, it is known there that there is a Hadamard matrix of size $4 * k$. diff --git a/FormalConjectures/Wikipedia/HardyLittlewood.lean b/FormalConjectures/Wikipedia/HardyLittlewood.lean index 1f4439a..84a6fbf 100644 --- a/FormalConjectures/Wikipedia/HardyLittlewood.lean +++ b/FormalConjectures/Wikipedia/HardyLittlewood.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # First Hardy–Littlewood conjecture @@ -22,7 +23,9 @@ import FormalConjecturesUtil *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/First_Hardy%E2%80%93Littlewood_conjecture) -/ -open Filter +@[expose] public section + +open Asymptotics Filter open scoped Nat.Prime @@ -58,15 +61,23 @@ noncomputable def Nat.primeTupleCounting {k : ℕ} (m : Fin k.succ → ℕ) (n : open scoped Classical in Nat.count (IsAdmissiblePrimeConstellation m) n.succ +/-- +The first Hardy–Littlewood conjecture for the tuple $(m_0, m_1, \dots, m_k)$: if $m_0 = 0$ and +the $m_i$ are pairwise distinct, then +$$ + \pi_P(n)\sim C_P\int_2^n\frac{dt}{\log^{k+1}t}. +$$ +-/ def FirstHardyLittlewoodConjectureFor {k : ℕ} (m : Fin k.succ → ℕ) : Prop := - let C : ℝ := + m 0 = 0 → Function.Injective m → + let C : ℝ := 2 ^ k * ∏' (q : { q : ℕ // q.Prime ∧ 3 ≤ q}), (1 - (Nat.numResidues q m : ℝ) / q) / (1 - 1 / q) ^ k.succ let π_P : ℕ → ℝ := fun n => (Nat.primeTupleCounting m n : ℝ) - π_P =O[atTop] fun n => C * ∫ t in (2)..n, 1 / t.log ^ k.succ + π_P ~[atTop] fun n => C * ∫ t in (2)..n, 1 / t.log ^ k.succ /-- -Let $P = (m_1, \dots, m_k)$ be a tuple of positive even integers. Let +Let $P = (m_1, \dots, m_k)$ be a tuple of distinct positive even integers. Let $\pi_P(n)$ denote the number of primes $p\leq n$ such that $(p, p + m_1, \dots, p + m_k)$ forms an admissible prime constellation. Let $w(q; m_1, \dots, m_k)$ denote the number of distinct residues of $0, m_1, \dots, m_k$ modulo $q$, and let diff --git a/FormalConjectures/Wikipedia/IdonealCompleteness.lean b/FormalConjectures/Wikipedia/IdonealCompleteness.lean index bed775b..3df6119 100644 --- a/FormalConjectures/Wikipedia/IdonealCompleteness.lean +++ b/FormalConjectures/Wikipedia/IdonealCompleteness.lean @@ -13,9 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module - -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Idoneal numbers completeness conjecture @@ -34,6 +34,8 @@ The Idoneal Numbers Completeness Conjecture asserts that the following list of - [OEIS A000926](https://oeis.org/A000926) -/ +@[expose] public section + namespace Idoneal /-- diff --git a/FormalConjectures/Wikipedia/InscribedSquare.lean b/FormalConjectures/Wikipedia/InscribedSquare.lean index d928c7e..19cd56d 100644 --- a/FormalConjectures/Wikipedia/InscribedSquare.lean +++ b/FormalConjectures/Wikipedia/InscribedSquare.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Inscribed square problem @@ -30,6 +31,8 @@ There are several open and solved variants of this conjecture. - [arxiv/2005.09193](https://arxiv.org/abs/2005.09193) -/ +@[expose] public section + open Topology ContDiff Manifold open scoped EuclideanGeometry @@ -76,19 +79,23 @@ theorem exists_inscribed_rectangle (γ : Circle → ℝ²) (hγ : IsEmbedding γ /-- It is known that every *smooth* Jordan curve admits inscribed rectangles of all aspect ratios. +Here a smooth Jordan curve is a smooth embedding of the circle into the plane, i.e. a smooth +simple closed curve with nowhere vanishing velocity. -/ @[category research solved, AMS 51] theorem exists_inscribed_rectangle_of_smooth (γ : Circle → ℝ²) - (hγ : IsEmbedding γ) (hγ' : ContMDiff (𝓡 1) (𝓡 2) ∞ γ) (r : ℝ) (hr : r > 0) : + (hγ : IsSmoothEmbedding (𝓡 1) (𝓡 2) ∞ γ) (r : ℝ) (hr : r > 0) : ∃ t₁ t₂ t₃ t₄, IsRectangle (γ t₁) (γ t₂) (γ t₃) (γ t₄) r := by sorry /-- It is also known that every $C^2$ Jordan curve admits an inscribed square. +Here a $C^2$ Jordan curve is a $C^2$ embedding of the circle into the plane, i.e. a $C^2$ +simple closed curve with nowhere vanishing velocity. -/ @[category research solved, AMS 51] theorem exists_inscribed_square_of_C2 (γ : Circle → ℝ²) - (hγ : IsEmbedding γ) (hγ' : ContMDiff (𝓡 1) (𝓡 2) 2 γ) : + (hγ : IsSmoothEmbedding (𝓡 1) (𝓡 2) 2 γ) : ∃ t₁ t₂ t₃ t₄, IsRectangle (γ t₁) (γ t₂) (γ t₃) (γ t₄) 1 := by sorry diff --git a/FormalConjectures/Wikipedia/InverseGalois.lean b/FormalConjectures/Wikipedia/InverseGalois.lean index 0d1b26e..27f7d2d 100644 --- a/FormalConjectures/Wikipedia/InverseGalois.lean +++ b/FormalConjectures/Wikipedia/InverseGalois.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Inverse Galois problem @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Inverse_Galois_problem) -/ +@[expose] public section + namespace InverseGalois structure GaloisRealization.{u, v} (K : Type u) (G : Type v) [Field K] [Group G] where @@ -90,11 +93,11 @@ theorem inverse_galois_problem.variants.complex_rational_functions /-- Every finite group is realisable over the field of rational functions -with coefficients `K`, where `K` is any field of characteristic 0. +with coefficients `K`, where `K` is any algebraically closed field of characteristic 0. -/ @[category research solved, AMS 12] theorem inverse_galois_problem.variants.complex_function_field - {G K : Type*} [Field K] [CharZero K] [Fintype G] [Group G] : + {G K : Type*} [Field K] [IsAlgClosed K] [CharZero K] [Fintype G] [Group G] : IsRealizable (RatFunc K) G := by sorry diff --git a/FormalConjectures/Wikipedia/Irrational.lean b/FormalConjectures/Wikipedia/Irrational.lean index afd6f7a..7a3d95d 100644 --- a/FormalConjectures/Wikipedia/Irrational.lean +++ b/FormalConjectures/Wikipedia/Irrational.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Open questions on irrationality of numbers @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Irrational_number#Open_questions) -/ +@[expose] public section + open Real local notation "e" => exp 1 diff --git a/FormalConjectures/Wikipedia/KummerVandiver.lean b/FormalConjectures/Wikipedia/KummerVandiver.lean index efde8b3..d3dcbfc 100644 --- a/FormalConjectures/Wikipedia/KummerVandiver.lean +++ b/FormalConjectures/Wikipedia/KummerVandiver.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Kummer–Vandiver conjecture @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Kummer%E2%80%93Vandiver_conjecture) -/ +@[expose] public section + open NumberField CyclotomicField IsCyclotomicExtension namespace KummerVandiver diff --git a/FormalConjectures/Wikipedia/LegendreConjecture.lean b/FormalConjectures/Wikipedia/LegendreConjecture.lean index 9295ed4..d977734 100644 --- a/FormalConjectures/Wikipedia/LegendreConjecture.lean +++ b/FormalConjectures/Wikipedia/LegendreConjecture.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Legendre's conjecture @@ -24,6 +25,9 @@ import FormalConjecturesUtil - [Legendre Conjecture Wikipedia Page](https://en.wikipedia.org/wiki/Legendre%27s_conjecture) - [Luan Alberto Ferreira, *Real exponential sums over primes and prime gaps*](https://arxiv.org/abs/2307.08725) -/ + +@[expose] public section + open Filter namespace LegendreConjecture diff --git a/FormalConjectures/Wikipedia/LehmerMahlerMeasureProblem.lean b/FormalConjectures/Wikipedia/LehmerMahlerMeasureProblem.lean index 3dbb26e..aefe872 100644 --- a/FormalConjectures/Wikipedia/LehmerMahlerMeasureProblem.lean +++ b/FormalConjectures/Wikipedia/LehmerMahlerMeasureProblem.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Lehmer's Mahler measure problem @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Lehmer%27s_conjecture) -/ +@[expose] public section + namespace LehmerMahlerMeasureProblem open Polynomial LehmerMahlerMeasureProblem @@ -57,10 +60,10 @@ theorem lehmer_mahler_measure_problem.variants.best (f : ℤ[X]) sorry /-- -If $f$ is not reciprocal and $M(f) > 1$ then $M(f) \ge M(X^3 - X - 1)$. +If $f$ is irreducible and not reciprocal and $M(f) > 1$ then $M(f) \ge M(X^3 - X - 1)$. -/ @[category research solved, AMS 11] -theorem lehmer_mahler_measure_problem.variants.not_reciprocal (f : ℤ[X]) +theorem lehmer_mahler_measure_problem.variants.not_reciprocal (f : ℤ[X]) (hi : Irreducible f) (hf : mahlerMeasureZ f > 1) (hf' : f.reverse ≠ f) : mahlerMeasureZ f ≥ mahlerMeasureZ (X^3 - X - 1) := by sorry @@ -70,11 +73,12 @@ def Polynomial.HasOddCoeffs (f : Polynomial ℤ) : Prop := ∀ i ≤ f.natDegree, Odd (f.coeff i) /-- -If all the coefficients of $f$ are odd and $M(f) > 1$, then $M(f) \ge M(X^2 - X - 1)$. +If $f$ is not reciprocal, all the coefficients of $f$ are odd and $M(f) > 1$, then +$M(f) \ge M(X^2 - X - 1)$. -/ @[category research solved, AMS 11] theorem lehmer_mahler_measure_problem.variants.odd (f : ℤ[X]) - (hf : mahlerMeasureZ f > 1) (hf' : f.HasOddCoeffs) : + (hf : mahlerMeasureZ f > 1) (hf' : f.reverse ≠ f) (hf'' : f.HasOddCoeffs) : mahlerMeasureZ f ≥ mahlerMeasureZ (X^2 - X - 1) := by sorry diff --git a/FormalConjectures/Wikipedia/LehmerTotient.lean b/FormalConjectures/Wikipedia/LehmerTotient.lean index c149ba8..72e3ff7 100644 --- a/FormalConjectures/Wikipedia/LehmerTotient.lean +++ b/FormalConjectures/Wikipedia/LehmerTotient.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Lehmer's totient problem @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Lehmer%27s_totient_problem) -/ +@[expose] public section + namespace LehmerTotient /-- diff --git a/FormalConjectures/Wikipedia/Lemoine.lean b/FormalConjectures/Wikipedia/Lemoine.lean index e7346fd..4350b46 100644 --- a/FormalConjectures/Wikipedia/Lemoine.lean +++ b/FormalConjectures/Wikipedia/Lemoine.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Lemoine's conjectures @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [Ki85] Kiltinen, J. and Young P. (1985). Goldbach, Lemoine, and a Know/Don't Know Problem. -/ +@[expose] public section + namespace Lemoine def OddPrime (n : ℕ) : Prop := diff --git a/FormalConjectures/Wikipedia/Mersenne.lean b/FormalConjectures/Wikipedia/Mersenne.lean index bb27507..354079b 100644 --- a/FormalConjectures/Wikipedia/Mersenne.lean +++ b/FormalConjectures/Wikipedia/Mersenne.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Conjectures about Mersenne primes @@ -25,6 +26,8 @@ import FormalConjecturesUtil - [MathWorld: Catalan-Mersenne Number](https://mathworld.wolfram.com/Catalan-MersenneNumber.html) -/ +@[expose] public section + namespace Mersenne namespace Nat @@ -78,14 +81,15 @@ theorem new_mersenne_conjecture (p : ℕ) (hp : Odd p) : NewMersenneConjectureStatement p := by sorry -/-- It suffices to check this conjecture for primes -/ +/-- It suffices to check this conjecture for odd primes. The statement fails at `p = 2`: +`mersenne 2 = 3` is prime and `2 = 2 ^ 0 + 1`, but `2` gives no Wagstaff prime. -/ @[category textbook, AMS 11] theorem new_mersenne_conjecture_of_prime : - (∀ p, p.Prime → NewMersenneConjectureStatement p) → + (∀ p, p.Prime → Odd p → NewMersenneConjectureStatement p) → ∀ p, Odd p → NewMersenneConjectureStatement p := by intro H p hp_odd by_cases hp_prime : p.Prime - · exact H p hp_prime + · exact H p hp_prime hp_odd suffices ¬Nat.GivesWagstaffPrime p by have hF1 : ¬(mersenne p).Prime := fun h => hp_prime h.of_mersenne refine ⟨?_, ?_, ?_⟩ <;> grind diff --git a/FormalConjectures/Wikipedia/MovingSofa.lean b/FormalConjectures/Wikipedia/MovingSofa.lean index 365ec77..6ea61be 100644 --- a/FormalConjectures/Wikipedia/MovingSofa.lean +++ b/FormalConjectures/Wikipedia/MovingSofa.lean @@ -203,7 +203,9 @@ def sofaConstant : ℝ≥0∞ := ⨆ (s : Set ℝ²) (_ : ∃ m, IsMovingSofa s theorem one_le_sofaConstant : 1 ≤ sofaConstant := by calc _ = volume unitSquare := (OrthonormalBasis.volume_parallelepiped _).symm - _ ≤ sofaConstant := le_iSup₂ (α := ℝ≥0∞) unitSquare isMovingSofa_unitSquare + _ ≤ sofaConstant := by + unfold sofaConstant + exact le_iSup_of_le unitSquare (le_iSup_of_le isMovingSofa_unitSquare le_rfl) /-- What is the sofa constant? -/ @[category research solved, AMS 49] diff --git a/FormalConjectures/Wikipedia/NormalityOfPi.lean b/FormalConjectures/Wikipedia/NormalityOfPi.lean index 53eb74d..598f6d5 100644 --- a/FormalConjectures/Wikipedia/NormalityOfPi.lean +++ b/FormalConjectures/Wikipedia/NormalityOfPi.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Normality of mathematical constants @@ -29,6 +30,8 @@ normal in any base. * [Wikipedia (Pi)](https://en.wikipedia.org/wiki/Pi) -/ +@[expose] public section + open Real namespace NormalNumber diff --git a/FormalConjectures/Wikipedia/Oppermann.lean b/FormalConjectures/Wikipedia/Oppermann.lean index 31ec8b4..87da32f 100644 --- a/FormalConjectures/Wikipedia/Oppermann.lean +++ b/FormalConjectures/Wikipedia/Oppermann.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Oppermann's Conjecture @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [Luan Alberto Ferreira, *Real exponential sums over primes and prime gaps*](https://arxiv.org/abs/2307.08725) -/ +@[expose] public section + open Finset Filter namespace Oppermann diff --git a/FormalConjectures/Wikipedia/PerfectNumbers.lean b/FormalConjectures/Wikipedia/PerfectNumbers.lean index 43775be..288efc0 100644 --- a/FormalConjectures/Wikipedia/PerfectNumbers.lean +++ b/FormalConjectures/Wikipedia/PerfectNumbers.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Perfect numbers @@ -37,6 +38,8 @@ formalised here: - [Wikipedia, Odd perfect numbers](https://en.wikipedia.org/wiki/Perfect_number#Odd_perfect_numbers) -/ +@[expose] public section + namespace PerfectNumbers open Nat diff --git a/FormalConjectures/Wikipedia/PollocksConjecture.lean b/FormalConjectures/Wikipedia/PollocksConjecture.lean index 59648f3..dfc658e 100644 --- a/FormalConjectures/Wikipedia/PollocksConjecture.lean +++ b/FormalConjectures/Wikipedia/PollocksConjecture.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Pollock's (tetrahedral numbers) conjecture @@ -30,6 +31,8 @@ Every positive integer is the sum of at most 5 tetrahedral numbers. - [MathWorld: Pollock's Conjecture](https://mathworld.wolfram.com/PollocksConjecture.html) -/ +@[expose] public section + namespace PollocksConjecture open scoped BigOperators diff --git a/FormalConjectures/Wikipedia/PrimesAndPerfectSquares.lean b/FormalConjectures/Wikipedia/PrimesAndPerfectSquares.lean index bfebf00..6d06662 100644 --- a/FormalConjectures/Wikipedia/PrimesAndPerfectSquares.lean +++ b/FormalConjectures/Wikipedia/PrimesAndPerfectSquares.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Primes and perfect squares @@ -22,6 +23,8 @@ import FormalConjecturesUtil *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Landau%27s_problems#Near-square_primes) -/ +@[expose] public section + namespace PrimesAndPerfectSquares diff --git a/FormalConjectures/Wikipedia/RegularPrimes.lean b/FormalConjectures/Wikipedia/RegularPrimes.lean index 1aac756..9008aa7 100644 --- a/FormalConjectures/Wikipedia/RegularPrimes.lean +++ b/FormalConjectures/Wikipedia/RegularPrimes.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Infinite Regular Primes @@ -26,6 +27,8 @@ infinitely many regular primes. *Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Regular_prime) -/ +@[expose] public section + open scoped NumberField variable (p : ℕ) @@ -39,7 +42,7 @@ noncomputable def IsRegularPrime [Fact p.Prime] : Prop := /-- The prime 37 is not a regular prime. -/ @[category textbook, AMS 11] -theorem not_isRegularPrime_37_first : ¬ @IsRegularPrime 37 (by decide) := by +theorem not_isRegularPrime_37 : ¬ @IsRegularPrime 37 (by decide) := by sorry /-- The set of regular primes. -/ @@ -54,16 +57,12 @@ lemma small_regular_primes : { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 } ⊆ regularPrimes := by sorry -/-- The prime 37 is not a regular prime. -/ -@[category textbook, AMS 11] -theorem not_isRegularPrime_37_second : ¬ @IsRegularPrime 37 (by decide) := by - sorry - -/-- An equivalent definition of a regular prime `p` is that it does not divide the numerator of the -first `p-3` Bernoulli numbers. Not in Mathlib. -/ +/-- **Kummer's criterion.** An equivalent definition of a regular prime `p` is that it does not +divide the numerator of any of the Bernoulli numbers $B_k$ for $k = 2, 4, 6, \dots, p - 3$. +Not in Mathlib. -/ @[category textbook, AMS 11] theorem isRegularPrime_iff_Bernoulli (p : ℕ) [Fact p.Prime] : - IsRegularPrime p ↔ ∀ k ∈ Finset.Icc 2 (p - 3), ¬ (p : ℤ) ∣ (bernoulli' k).num := by + IsRegularPrime p ↔ ∀ k ∈ Finset.Icc 2 (p - 3), Even k → ¬ (p : ℤ) ∣ (bernoulli' k).num := by sorry /-- The set of irregular primes is infinite. -/ diff --git a/FormalConjectures/Wikipedia/Schinzel.lean b/FormalConjectures/Wikipedia/Schinzel.lean index 2ae3c9f..54398ce 100644 --- a/FormalConjectures/Wikipedia/Schinzel.lean +++ b/FormalConjectures/Wikipedia/Schinzel.lean @@ -14,7 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. -/ -import FormalConjecturesUtil +module + +public import FormalConjecturesUtil + +@[expose] public section /-! # Hypothesis H diff --git a/FormalConjectures/Wikipedia/TwinPrimes.lean b/FormalConjectures/Wikipedia/TwinPrimes.lean index 48b05df..ebe01d9 100644 --- a/FormalConjectures/Wikipedia/TwinPrimes.lean +++ b/FormalConjectures/Wikipedia/TwinPrimes.lean @@ -13,8 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ +module -import FormalConjecturesUtil +public import FormalConjecturesUtil /-! # Twin prime conjecture @@ -24,6 +25,8 @@ import FormalConjecturesUtil - [Twin Primes Conjecture Wikipedia Page](https://en.wikipedia.org/wiki/Twin_prime#Twin_prime_conjecture) -/ +@[expose] public section + namespace TwinPrimes diff --git a/FormalConjectures/Wikipedia/WallSunSun.lean b/FormalConjectures/Wikipedia/WallSunSun.lean index 568d8ae..7230dda 100644 --- a/FormalConjectures/Wikipedia/WallSunSun.lean +++ b/FormalConjectures/Wikipedia/WallSunSun.lean @@ -29,13 +29,13 @@ variable {d : ℤ} [Fact <| Squarefree d] [Fact <| d ≠ 1] /-- The discriminant of `ℚ[√d]` for `d ≥ 2` squarefree congruent to 1 mod 4 is `d`. -/ @[category textbook, AMS 11, simp] -lemma discr_rat_of_modEq_one (hd₄ : d ≡ 1 [ZMOD 4]) : discr (QuadraticAlgebra ℚ d 0) = d := by +lemma discr_rat_of_modEq_one (hd₄ : d ≡ 1 [ZMOD 4]) : NumberField.discr (QuadraticAlgebra ℚ d 0) = d := by sorry /-- The discriminant of `ℚ[√d]` for `d ≥ 2` squarefree not congruent to 1 mod 4 is `4 * d`. -/ @[category textbook, AMS 11, simp] lemma discr_rat_of_not_modEq_one (hd₄ : ¬ d ≡ 1 [ZMOD 4]) : - discr (QuadraticAlgebra ℚ d 0) = 4 * d := by + NumberField.discr (QuadraticAlgebra ℚ d 0) = 4 * d := by sorry end QuadraticAlgebra @@ -86,7 +86,7 @@ quadratic field `QuadraticAlgebra ℚ d 0` for some squarefree `d : ℤ` not equ @[category textbook, AMS 11] lemma isFundamentalDiscr_iff_exists_discr_quadraticAlgebra {D : ℤ} : IsFundamentalDiscr D ↔ ∃ (d : ℤ) (_ : Fact <| d ≠ 1) (_ : Fact <| Squarefree d), - discr (QuadraticAlgebra ℚ d 0) = D where + NumberField.discr (QuadraticAlgebra ℚ d 0) = D where mp := by rintro (⟨⟨d, rfl⟩, hD₄, hD⟩ | ⟨hD₁, hD₄, hD⟩) · simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, mul_div_cancel_left₀] at hD hD₄ diff --git a/FormalConjectures/WrittenOnTheWallII/GraphConjecture146.lean b/FormalConjectures/WrittenOnTheWallII/GraphConjecture146.lean index f7f91ed..70102fe 100644 --- a/FormalConjectures/WrittenOnTheWallII/GraphConjecture146.lean +++ b/FormalConjectures/WrittenOnTheWallII/GraphConjecture146.lean @@ -87,7 +87,8 @@ example (G : SimpleGraph (Fin 4)) (u v : Fin 4) (h : G.Adj u v) : (graphSquare G).Adj u v := by refine ⟨G.ne_of_adj h, ?_⟩ -- dist u v ≤ length of the 1-step walk ≤ 2 - exact (G.dist_le (Walk.cons h Walk.nil)).trans (by norm_num) + rw [G.edist_eq_one_iff_adj.mpr h] + norm_num /-- `graphSquare` is loopless: no vertex is adjacent to itself. -/ @[category test, AMS 5] diff --git a/FormalConjecturesForMathlib.lean b/FormalConjecturesForMathlib.lean index 2b18c46..073d59d 100644 --- a/FormalConjecturesForMathlib.lean +++ b/FormalConjecturesForMathlib.lean @@ -16,17 +16,27 @@ limitations under the License. module -- shake: keep-all --deprecated_module: ignore public import FormalConjecturesForMathlib.Algebra.GCDMonoid.Finset +public import FormalConjecturesForMathlib.Algebra.GradedMonoid public import FormalConjecturesForMathlib.Algebra.Group.Action.Pointwise.Set.Basic public import FormalConjecturesForMathlib.Algebra.Group.GrowthFunction public import FormalConjecturesForMathlib.Algebra.Group.Indicator +public import FormalConjecturesForMathlib.Algebra.Group.Pointwise.Finset.Basic +public import FormalConjecturesForMathlib.Algebra.Homology.DerivedCategory.Ext.GradedAlgebra public import FormalConjecturesForMathlib.Algebra.MvPolynomial.PoissonBracket public import FormalConjecturesForMathlib.Algebra.MvPolynomial.RegularFunction public import FormalConjecturesForMathlib.Algebra.Order.Group.Pointwise.Interval public import FormalConjecturesForMathlib.Algebra.Polynomial.Algebra public import FormalConjecturesForMathlib.Algebra.Polynomial.Basic public import FormalConjecturesForMathlib.Algebra.Polynomial.HasseDeriv +public import FormalConjecturesForMathlib.Algebra.Polynomial.Irreducible public import FormalConjecturesForMathlib.Algebra.Powerfree public import FormalConjecturesForMathlib.Algebra.QuadraticAlgebra.Instances +public import FormalConjecturesForMathlib.Algebra.Ring.PythagorasNumber +public import FormalConjecturesForMathlib.Algebra.WeylAlgebra +public import FormalConjecturesForMathlib.AlgebraicGeometry.EllipticCurve.GlobalPeriod +public import FormalConjecturesForMathlib.AlgebraicGeometry.EllipticCurve.MinimalDiscriminant +public import FormalConjecturesForMathlib.AlgebraicGeometry.EllipticCurve.Tamagawa +public import FormalConjecturesForMathlib.AlgebraicGeometry.EllipticCurve.TateShafarevich public import FormalConjecturesForMathlib.AlgebraicGeometry.ProjectiveSpace public import FormalConjecturesForMathlib.AlgebraicGeometry.VectorBundle public import FormalConjecturesForMathlib.Analysis.Asymptotics.Basic @@ -47,7 +57,11 @@ public import FormalConjecturesForMathlib.Combinatorics.Additive.RestrictedSumse public import FormalConjecturesForMathlib.Combinatorics.Additive.VCDim public import FormalConjecturesForMathlib.Combinatorics.Basic public import FormalConjecturesForMathlib.Combinatorics.Digraph.Tournament -public import FormalConjecturesForMathlib.Combinatorics.Hypergraph.ThreeUniform +public import FormalConjecturesForMathlib.Combinatorics.Enumerative.Partition.Basic +public import FormalConjecturesForMathlib.Combinatorics.Hypergraph.Basic +public import FormalConjecturesForMathlib.Combinatorics.Hypergraph.Extremal +public import FormalConjecturesForMathlib.Combinatorics.Hypergraph.Finite +public import FormalConjecturesForMathlib.Combinatorics.Hypergraph.Uniform public import FormalConjecturesForMathlib.Combinatorics.LatinSquare public import FormalConjecturesForMathlib.Combinatorics.LimitObjects.Graphon public import FormalConjecturesForMathlib.Combinatorics.LimitObjects.Tournamenton @@ -60,51 +74,69 @@ public import FormalConjecturesForMathlib.Combinatorics.SetFamily.VCDim public import FormalConjecturesForMathlib.Combinatorics.SetTheory.PartitionRelation public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.AnnihilationNumber public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Balanced +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Boundary +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Chordal public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Circumference public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Clique +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Coloring.List public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Coloring.Vertex public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.CompleteGraphEdgeCount public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Connectivity public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Cvetkovic public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Cycle public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.CycleRank +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Decomposition +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Degeneracy public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Degrees public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.DiamExtra public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Domination public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Eccentricity public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.EdgeColouring public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.FractionalAlpha +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.FractionalChromaticNumber +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.HarmonicIndex public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.HomDensity +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Homogeneous public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Hypercube public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Independence public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Induced +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.InducedTreeNeighborhood public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Johnson public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.LargestInducedTree public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.LovaszTheta public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Matching +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Mycielski public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.PathCover +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Petersen +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Prod public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.QuasiLineGraph public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Ramsey public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Residue +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Saturation public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.SizeRamsey public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.SpanningTree public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.SubgraphIsomorphism public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.SzegedIndex public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Temperature +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.TotalColouring public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.UnitDistancePlaneGraph public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.VertexDistance public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.WellTotallyDominated public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.WienerIndex +public import FormalConjecturesForMathlib.Combinatorics.StableMarriage public import FormalConjecturesForMathlib.Combinatorics.YoungDiagram +public import FormalConjecturesForMathlib.Computability.AutomaticSequence public import FormalConjecturesForMathlib.Computability.BitstringEncoding public import FormalConjecturesForMathlib.Computability.Complexity public import FormalConjecturesForMathlib.Computability.DFA +public import FormalConjecturesForMathlib.Computability.Primrec public import FormalConjecturesForMathlib.Computability.TuringMachine.BusyBeavers public import FormalConjecturesForMathlib.Computability.TuringMachine.Notation public import FormalConjecturesForMathlib.Computability.TuringMachine.PostTuringMachine public import FormalConjecturesForMathlib.Data.Bool.Basic public import FormalConjecturesForMathlib.Data.Finset.Card public import FormalConjecturesForMathlib.Data.Finset.Powerset +public import FormalConjecturesForMathlib.Data.Finset.Prod public import FormalConjecturesForMathlib.Data.Finset.ReciprocalSum public import FormalConjecturesForMathlib.Data.Int.IntermediateValue public import FormalConjecturesForMathlib.Data.Int.Order.Basic @@ -120,39 +152,72 @@ public import FormalConjecturesForMathlib.Data.Nat.Prime.Infinite public import FormalConjecturesForMathlib.Data.Nat.Squarefree public import FormalConjecturesForMathlib.Data.Real.Constants public import FormalConjecturesForMathlib.Data.Real.NearestInt +public import FormalConjecturesForMathlib.Data.Set.CountUpTo public import FormalConjecturesForMathlib.Data.Set.Density public import FormalConjecturesForMathlib.Data.Set.Interval public import FormalConjecturesForMathlib.Data.Set.Triplewise public import FormalConjecturesForMathlib.Data.Sym.Sym2 public import FormalConjecturesForMathlib.Data.ZMod.Fp public import FormalConjecturesForMathlib.Data.ZMod.PerfectDifferenceSet +public import FormalConjecturesForMathlib.Dynamics.SymbolicDynamics.BlockComplexity +public import FormalConjecturesForMathlib.FieldTheory.AbsoluteGaloisGroup +public import FormalConjecturesForMathlib.FieldTheory.MilnorKTheory public import FormalConjecturesForMathlib.FieldTheory.MvRatFunc.Defs public import FormalConjecturesForMathlib.Geometry.Euclidean +public import FormalConjecturesForMathlib.Geometry.Group.Hyperbolic +public import FormalConjecturesForMathlib.Geometry.Group.WordMetric +public import FormalConjecturesForMathlib.Geometry.Group.WordProd +public import FormalConjecturesForMathlib.Geometry.Manifold.LieGroupPresentation public import FormalConjecturesForMathlib.Geometry.Metric +public import FormalConjecturesForMathlib.Geometry.OrdinaryLines public import FormalConjecturesForMathlib.Geometry.«2d» public import FormalConjecturesForMathlib.Geometry.«3d» +public import FormalConjecturesForMathlib.GroupTheory.DerivedLength +public import FormalConjecturesForMathlib.GroupTheory.ElementOrders +public import FormalConjecturesForMathlib.GroupTheory.GroupAction.InvolutionFixedPoints +public import FormalConjecturesForMathlib.GroupTheory.GroupAction.MovedPoints +public import FormalConjecturesForMathlib.GroupTheory.GroupAction.OrbitCounts +public import FormalConjecturesForMathlib.GroupTheory.GroupAction.TransitivityDegree +public import FormalConjecturesForMathlib.GroupTheory.PrimeDivisors +public import FormalConjecturesForMathlib.GroupTheory.RationalClasses +public import FormalConjecturesForMathlib.GroupTheory.SubgroupCounts +public import FormalConjecturesForMathlib.GroupTheory.Torsion +public import FormalConjecturesForMathlib.InformationTheory.FiniteEntropy public import FormalConjecturesForMathlib.Lean.Elab.InfoTree.Util public import FormalConjecturesForMathlib.LinearAlgebra.AffineSpace.Simplex.Basic public import FormalConjecturesForMathlib.LinearAlgebra.GeneralLinearGroup +public import FormalConjecturesForMathlib.LinearAlgebra.QuadraticForm.UInvariant public import FormalConjecturesForMathlib.LinearAlgebra.SpecialLinearGroup public import FormalConjecturesForMathlib.Logic.Equiv.Fin.Rotate +public import FormalConjecturesForMathlib.ModelTheory.Decidability +public import FormalConjecturesForMathlib.ModelTheory.Encoding +public import FormalConjecturesForMathlib.ModelTheory.Real public import FormalConjecturesForMathlib.NumberTheory.AdditionChain public import FormalConjecturesForMathlib.NumberTheory.AdditiveComplement public import FormalConjecturesForMathlib.NumberTheory.AdditivelyComplete public import FormalConjecturesForMathlib.NumberTheory.AlmostPrime public import FormalConjecturesForMathlib.NumberTheory.Amicable +public import FormalConjecturesForMathlib.NumberTheory.ArithmeticFunction.PrimeSeries +public import FormalConjecturesForMathlib.NumberTheory.AutomaticNumber +public import FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet +public import FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet.CenterAction +public import FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet.LieDeriv +public import FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet.Subgroups public import FormalConjecturesForMathlib.NumberTheory.BeurlingPrimes public import FormalConjecturesForMathlib.NumberTheory.Carmichael public import FormalConjecturesForMathlib.NumberTheory.CoveringSystem public import FormalConjecturesForMathlib.NumberTheory.DiophantineApproximation.ZNumber public import FormalConjecturesForMathlib.NumberTheory.DirichletCharacter.Basic public import FormalConjecturesForMathlib.NumberTheory.Divisors +public import FormalConjecturesForMathlib.NumberTheory.ExpansionEntropy public import FormalConjecturesForMathlib.NumberTheory.Harmonic public import FormalConjecturesForMathlib.NumberTheory.Lacunary public import FormalConjecturesForMathlib.NumberTheory.LegendreSymbol.Basic +public import FormalConjecturesForMathlib.NumberTheory.MultiplicativelyIndependent public import FormalConjecturesForMathlib.NumberTheory.NormalNumber public import FormalConjecturesForMathlib.NumberTheory.NumberField.FundamentalDiscriminant public import FormalConjecturesForMathlib.NumberTheory.NumberField.Quadratic +public import FormalConjecturesForMathlib.NumberTheory.PerfectNumber public import FormalConjecturesForMathlib.NumberTheory.PisotNumber public import FormalConjecturesForMathlib.NumberTheory.PracticalNumbers public import FormalConjecturesForMathlib.NumberTheory.PrimeGap @@ -160,6 +225,7 @@ public import FormalConjecturesForMathlib.NumberTheory.Primitive public import FormalConjecturesForMathlib.NumberTheory.SierpinskiNumber public import FormalConjecturesForMathlib.NumberTheory.SmoothScale public import FormalConjecturesForMathlib.NumberTheory.WallSunSunPrimes +public import FormalConjecturesForMathlib.NumberTheory.WieferichPrime public import FormalConjecturesForMathlib.Order.Bounds.Basic public import FormalConjecturesForMathlib.Order.Filter.Cofinite public import FormalConjecturesForMathlib.Order.Filter.atTopBot.Finset @@ -168,20 +234,33 @@ public import FormalConjecturesForMathlib.Order.Interval.Finset.Nat public import FormalConjecturesForMathlib.Order.Nat public import FormalConjecturesForMathlib.Order.Unimodular public import FormalConjecturesForMathlib.Probability.FiniteMethod +public import FormalConjecturesForMathlib.RepresentationTheory.CharacterDegree +public import FormalConjecturesForMathlib.RepresentationTheory.Homological.ContCohomology.Sha +public import FormalConjecturesForMathlib.RingTheory.Bialgebra.Cohomology +public import FormalConjecturesForMathlib.RingTheory.Bialgebra.TrivialModule +public import FormalConjecturesForMathlib.RingTheory.CohenMacaulayModule public import FormalConjecturesForMathlib.RingTheory.Ideal.Basic public import FormalConjecturesForMathlib.RingTheory.Ideal.Defs public import FormalConjecturesForMathlib.RingTheory.Ideal.Maximal +public import FormalConjecturesForMathlib.RingTheory.IntersectionMultiplicity public import FormalConjecturesForMathlib.RingTheory.Noetherian.Defs +public import FormalConjecturesForMathlib.RingTheory.SystemOfParameters +public import FormalConjecturesForMathlib.RingTheory.Valuation.LocalUniformization public import FormalConjecturesForMathlib.SetTheory.Cardinal.Arithmetic public import FormalConjecturesForMathlib.SetTheory.Cardinal.Continuum +public import FormalConjecturesForMathlib.SetTheory.Cardinal.ContinuumHypothesis public import FormalConjecturesForMathlib.SetTheory.Cardinal.SimpleGraph +public import FormalConjecturesForMathlib.SetTheory.Ordinal.PartitionRelation public import FormalConjecturesForMathlib.Tactic.Linter.Term public import FormalConjecturesForMathlib.Topology.AbsoluteNeighborhoodRetract public import FormalConjecturesForMathlib.Topology.Algebra.InfiniteSum.Group public import FormalConjecturesForMathlib.Topology.Algebra.InfiniteSum.Order public import FormalConjecturesForMathlib.Topology.Algebra.InfiniteSum.Real +public import FormalConjecturesForMathlib.Topology.CardinalInvariants public import FormalConjecturesForMathlib.Topology.Discrete public import FormalConjecturesForMathlib.Topology.GDelta public import FormalConjecturesForMathlib.Topology.Homogeneous public import FormalConjecturesForMathlib.Topology.LebesgueCoveringDimension +public import FormalConjecturesForMathlib.Topology.MetricSpace.GromovProduct +public import FormalConjecturesForMathlib.Topology.MetricSpace.Hyperbolic public import FormalConjecturesForMathlib.Topology.MetricSpace.MetricSeparated diff --git a/FormalConjecturesForMathlib/Algebra/GradedMonoid.lean b/FormalConjecturesForMathlib/Algebra/GradedMonoid.lean new file mode 100644 index 0000000..49ae393 --- /dev/null +++ b/FormalConjecturesForMathlib/Algebra/GradedMonoid.lean @@ -0,0 +1,39 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Algebra.GradedMonoid + +@[expose] public section + +/-! +# Equality in a graded monoid + +`GradedMonoid.mk_eq_mk` proves an equality `GradedMonoid.mk i a = GradedMonoid.mk j b` from +`i = j` and `HEq a b`. It is `Sigma.ext` stated for `GradedMonoid.mk`, so that unification only +sees the arguments of `GradedMonoid.mk` and never has to reduce projections of the two sides. +-/ + +namespace GradedMonoid + +variable {ι : Type*} {A : ι → Type*} + +/-- Equality of two elements of `GradedMonoid A` written with `GradedMonoid.mk`. -/ +lemma mk_eq_mk {i j : ι} {a : A i} {b : A j} (h : i = j) (h' : HEq a b) : + GradedMonoid.mk i a = GradedMonoid.mk j b := + Sigma.ext h h' + +end GradedMonoid diff --git a/FormalConjecturesForMathlib/Algebra/Group/GrowthFunction.lean b/FormalConjecturesForMathlib/Algebra/Group/GrowthFunction.lean index 12efd20..8b8b29a 100644 --- a/FormalConjecturesForMathlib/Algebra/Group/GrowthFunction.lean +++ b/FormalConjecturesForMathlib/Algebra/Group/GrowthFunction.lean @@ -17,7 +17,7 @@ module public import FormalConjecturesForMathlib.Order.Filter.atTopBot.Finset public import Mathlib.Data.Fin.VecNotation -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Data.Set.Card public import Mathlib.GroupTheory.Finiteness public import Mathlib.Tactic.SetNotationForOrder diff --git a/FormalConjecturesForMathlib/Algebra/Group/Pointwise/Finset/Basic.lean b/FormalConjecturesForMathlib/Algebra/Group/Pointwise/Finset/Basic.lean new file mode 100644 index 0000000..a186739 --- /dev/null +++ b/FormalConjecturesForMathlib/Algebra/Group/Pointwise/Finset/Basic.lean @@ -0,0 +1,43 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Algebra.Group.Pointwise.Finset.Basic + +/-! +# Pointwise addition of finite intervals +-/ + +@[expose] public section + +open scoped Pointwise + +namespace Finset + +/-- The sum of `{0, …, m}` and `{0, …, n}` is `{0, …, m + n}`. -/ +theorem range_add_range (m n : ℕ) : + range (m + 1) + range (n + 1) = range (m + n + 1) := by + ext k + simp only [mem_add, mem_range] + constructor + · rintro ⟨a, ha, b, hb, rfl⟩ + lia + · intro hk + by_cases hkm : k ≤ m + · exact ⟨k, by lia, 0, by lia, by simp⟩ + · exact ⟨m, by lia, k - m, by lia, by lia⟩ + +end Finset diff --git a/FormalConjecturesForMathlib/Algebra/Homology/DerivedCategory/Ext/GradedAlgebra.lean b/FormalConjecturesForMathlib/Algebra/Homology/DerivedCategory/Ext/GradedAlgebra.lean new file mode 100644 index 0000000..2bff0c1 --- /dev/null +++ b/FormalConjecturesForMathlib/Algebra/Homology/DerivedCategory/Ext/GradedAlgebra.lean @@ -0,0 +1,146 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Algebra.DirectSum.Algebra +public import Mathlib.Algebra.Homology.DerivedCategory.Ext.Linear +public import Mathlib.Algebra.Module.GradedModule +public import FormalConjecturesForMathlib.Algebra.GradedMonoid + +@[expose] public noncomputable section + +/-! +# The Yoneda algebra of an object of an abelian category + +Let `C` be an abelian category with `HasExt C` and let `X : C`. The Yoneda composition +`Ext.comp : Ext X X a → Ext X X b → Ext X X (a + b)` makes the family `fun n ↦ Ext X X n` a +graded ring, so that `⨁ n, Ext X X n` is a ring: the Yoneda algebra `Ext^*(X, X)` of `X`. +When `C` is `R`-linear for a commutative ring `R`, it is a graded `R`-algebra. +For `Y : C`, the family `fun n ↦ Ext X Y n` is a graded module over `fun n ↦ Ext X X n`, so +that `⨁ n, Ext X Y n` is a module over `⨁ n, Ext X X n`. + +## Main declarations + +* `CategoryTheory.Abelian.Ext.instGRing`: the graded ring structure on `fun n ↦ Ext X X n`. +* `CategoryTheory.Abelian.Ext.instGAlgebra`: the graded `R`-algebra structure on + `fun n ↦ Ext X X n` when `C` is `R`-linear. +* `CategoryTheory.Abelian.Ext.instGmodule`: the graded module structure on `fun n ↦ Ext X Y n` + over `fun n ↦ Ext X X n`. + +The proofs of the graded axioms compare elements of `GradedMonoid` in different degrees; they use +`GradedMonoid.mk_eq_mk` and `Ext.comp_heq` to reduce these to equalities in a single degree. +-/ + +universe w t v u + +open DirectSum + +namespace CategoryTheory.Abelian.Ext + +variable {C : Type u} [Category.{v} C] [Abelian C] [HasExt.{w} C] + +section + +variable {X Y Z : C} + +/-- Up to `HEq`, the composition `Ext.comp` does not depend on the proof of the degree +equation. -/ +lemma comp_heq {a b c c' : ℕ} (α : Ext X Y a) (β : Ext Y Z b) (h : a + b = c) + (h' : a + b = c') : HEq (α.comp β h) (α.comp β h') := by + subst h h' + rfl + +end + +variable (X Y : C) + +instance instGOne : GradedMonoid.GOne (fun n ↦ Ext X X n) where + one := mk₀ (𝟙 X) + +instance instGMul : GradedMonoid.GMul (fun n ↦ Ext X X n) where + mul α β := α.comp β rfl + +instance instGSMul : GradedMonoid.GSMul (fun n ↦ Ext X X n) (fun n ↦ Ext X Y n) where + smul α β := α.comp β rfl + +variable {X Y} + +@[simp] +lemma gOne_eq : (GradedMonoid.GOne.one : Ext X X 0) = mk₀ (𝟙 X) := rfl + +@[simp] +lemma gMul_eq {a b : ℕ} (α : Ext X X a) (β : Ext X X b) : + GradedMonoid.GMul.mul α β = α.comp β rfl := rfl + +@[simp] +lemma gSMul_eq {a b : ℕ} (α : Ext X X a) (β : Ext X Y b) : + GradedMonoid.GSMul.smul α β = α.comp β rfl := rfl + +variable (X Y) + +instance instGMonoid : GradedMonoid.GMonoid (fun n ↦ Ext X X n) where + one_mul := fun ⟨n, α⟩ ↦ Sigma.ext (zero_add n) + ((comp_heq _ _ rfl (zero_add n)).trans (heq_of_eq (mk₀_id_comp α))) + mul_one := fun ⟨n, α⟩ ↦ Sigma.ext (add_zero n) + ((comp_heq _ _ rfl (add_zero n)).trans (heq_of_eq (comp_mk₀_id α))) + mul_assoc := fun ⟨a, α⟩ ⟨b, β⟩ ⟨c, γ⟩ ↦ Sigma.ext (add_assoc a b c) + ((heq_of_eq (comp_assoc α β γ rfl rfl rfl)).trans (comp_heq _ _ _ rfl)) + +instance instGRing : DirectSum.GRing (fun n ↦ Ext X X n) where + mul_zero α := comp_zero α X _ _ rfl + zero_mul β := zero_comp _ _ β _ rfl + mul_add α β γ := comp_add α β γ rfl + add_mul α β γ := add_comp α β γ rfl + natCast n := n • mk₀ (𝟙 X) + natCast_zero := zero_nsmul _ + natCast_succ n := succ_nsmul (mk₀ (𝟙 X)) n + intCast n := n • mk₀ (𝟙 X) + intCast_ofNat n := natCast_zsmul (mk₀ (𝟙 X)) n + intCast_negSucc_ofNat n := negSucc_zsmul (mk₀ (𝟙 X)) n + +instance instGmodule : DirectSum.Gmodule (fun n ↦ Ext X X n) (fun n ↦ Ext X Y n) where + one_smul := fun ⟨n, β⟩ ↦ Sigma.ext (zero_add n) + ((comp_heq _ _ rfl (zero_add n)).trans (heq_of_eq (mk₀_id_comp β))) + mul_smul := fun ⟨a, α⟩ ⟨b, α'⟩ ⟨c, β⟩ ↦ Sigma.ext (add_assoc a b c) + ((heq_of_eq (comp_assoc α α' β rfl rfl rfl)).trans (comp_heq _ _ _ rfl)) + smul_add α β β' := comp_add α β β' rfl + smul_zero α := comp_zero α Y _ _ rfl + add_smul α α' β := add_comp α α' β rfl + zero_smul β := zero_comp _ _ β _ rfl + +variable (R : Type t) [CommRing R] [Linear R C] + +instance instGAlgebra : DirectSum.GAlgebra R (fun n ↦ Ext X X n) where + toFun := + { toFun r := mk₀ (r • 𝟙 X) + map_zero' := by simp + map_add' r s := by simp [mk₀_smul, mk₀_add, add_smul] } + map_one := by simp + map_mul r s := GradedMonoid.mk_eq_mk rfl (heq_of_eq (by + change mk₀ ((r * s) • 𝟙 X) = (mk₀ (r • 𝟙 X)).comp (mk₀ (s • 𝟙 X)) (zero_add 0) + simp [smul_smul, mul_comm])) + commutes r := fun ⟨n, α⟩ ↦ by + change GradedMonoid.mk (0 + n) ((mk₀ (r • 𝟙 X)).comp α rfl) = + GradedMonoid.mk (n + 0) (α.comp (mk₀ (r • 𝟙 X)) rfl) + refine GradedMonoid.mk_eq_mk (by simp) ((comp_heq _ _ rfl (zero_add n)).trans + ((heq_of_eq ?_).trans (comp_heq _ _ (add_zero n) rfl))) + simp [mk₀_smul] + smul_def r := fun ⟨n, α⟩ ↦ by + change GradedMonoid.mk n (r • α) = GradedMonoid.mk (0 + n) ((mk₀ (r • 𝟙 X)).comp α rfl) + exact GradedMonoid.mk_eq_mk (zero_add n).symm + ((heq_of_eq (by simp [mk₀_smul])).trans (comp_heq _ _ (zero_add n) rfl)) + +end CategoryTheory.Abelian.Ext diff --git a/FormalConjecturesForMathlib/Algebra/MvPolynomial/PoissonBracket.lean b/FormalConjecturesForMathlib/Algebra/MvPolynomial/PoissonBracket.lean index 336cc90..375ff7f 100644 --- a/FormalConjecturesForMathlib/Algebra/MvPolynomial/PoissonBracket.lean +++ b/FormalConjecturesForMathlib/Algebra/MvPolynomial/PoissonBracket.lean @@ -85,7 +85,7 @@ theorem poissonBracket_X_inl_inr [DecidableEq σ] (i j : σ) : rcases eq_or_ne i j with rfl | h · simp · rw [pderiv_X_of_ne (show (Sum.inr j : σ ⊕ σ) ≠ Sum.inr i from by simpa using Ne.symm h), - if_neg h] + ite_eq_right h] · intro k _ hk rw [pderiv_X_of_ne (show (Sum.inl i : σ ⊕ σ) ≠ Sum.inl k from by simpa using Ne.symm hk), pderiv_X_of_ne (show (Sum.inl i : σ ⊕ σ) ≠ Sum.inr k from by simp)] diff --git a/FormalConjecturesForMathlib/Algebra/MvPolynomial/RegularFunction.lean b/FormalConjecturesForMathlib/Algebra/MvPolynomial/RegularFunction.lean index 9d4a3e6..2cdd309 100644 --- a/FormalConjecturesForMathlib/Algebra/MvPolynomial/RegularFunction.lean +++ b/FormalConjecturesForMathlib/Algebra/MvPolynomial/RegularFunction.lean @@ -19,7 +19,7 @@ public import Mathlib.Algebra.MvPolynomial.Monad public import Mathlib.Algebra.MvPolynomial.PDeriv public import Mathlib.Data.Matrix.Basic -public section +@[expose] public section /-! # Regular functions between affine spaces diff --git a/FormalConjecturesForMathlib/Algebra/Polynomial/HasseDeriv.lean b/FormalConjecturesForMathlib/Algebra/Polynomial/HasseDeriv.lean index e5ff4b7..5a4cd3c 100644 --- a/FormalConjecturesForMathlib/Algebra/Polynomial/HasseDeriv.lean +++ b/FormalConjecturesForMathlib/Algebra/Polynomial/HasseDeriv.lean @@ -17,10 +17,3 @@ module public import Mathlib.Algebra.Polynomial.HasseDeriv - -@[expose] public section - -open scoped Polynomial in -- probably removable in the mathlib file -theorem Polynomial.hasseDeriv_map {R S : Type*} [Semiring R] [Semiring S] - {f : R →+* S} {k : ℕ} {p : R[X]} : (p.map f).hasseDeriv k = (p.hasseDeriv k).map f := by - ext; simp [hasseDeriv_coeff] diff --git a/FormalConjecturesForMathlib/Algebra/Polynomial/Irreducible.lean b/FormalConjecturesForMathlib/Algebra/Polynomial/Irreducible.lean new file mode 100644 index 0000000..5a8ec94 --- /dev/null +++ b/FormalConjecturesForMathlib/Algebra/Polynomial/Irreducible.lean @@ -0,0 +1,34 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Algebra.Polynomial.SpecificDegree +public import Mathlib.Tactic.Linarith + +@[expose] public section + +namespace Polynomial + +variable {K : Type*} [Field K] [LinearOrder K] [IsStrictOrderedRing K] + +/-- Over a linearly ordered field, `X ^ 2 + a` is irreducible for every `0 < a`, since it has no +root. -/ +theorem irreducible_X_sq_add_C_of_pos {a : K} (ha : 0 < a) : Irreducible (X ^ 2 + C a) := + irreducible_of_degree_le_three_of_not_isRoot (by simp) fun x hx ↦ by + simp only [IsRoot.def, eval_add, eval_pow, eval_X, eval_C] at hx + nlinarith [sq_nonneg x] + +end Polynomial diff --git a/FormalConjecturesForMathlib/Algebra/Ring/PythagorasNumber.lean b/FormalConjecturesForMathlib/Algebra/Ring/PythagorasNumber.lean new file mode 100644 index 0000000..7e27bba --- /dev/null +++ b/FormalConjecturesForMathlib/Algebra/Ring/PythagorasNumber.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. +-/ +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.Ring.SumsOfSquares + +@[expose] public section + +/-! +# Pythagoras numbers + +The *Pythagoras number* $p(R)$ of $R$ is the least $p$ such that every sum of squares in $R$ is a +sum of $p$ squares; see [Pfister1995] for fields and [CDLR1982] for rings. This file defines: + +* `IsSumSqOfLength n a`: `a` is a sum of `n` squares, a counted refinement of Mathlib's `IsSumSq`; +* `pythagorasBounds R`: the set of `p` such that every sum of squares in `R` is a sum of `p` + squares. + +The Pythagoras number of `R` is `p` exactly when `IsLeast (pythagorasBounds R) p`. The set +`pythagorasBounds R` can be empty, in which case the Pythagoras number is infinite; by [CDLR1982] +this happens for $\mathbb{R}[X, Y]$. No numeric invariant is defined here, so that no convention +for the infinite case is needed. + +The definitions and the correspondence with `IsSumSq` need only `[AddCommMonoid R] [Mul R]`; the +`AddCommMonoid` is what the sum `∑ i : Fin n` requires, since `IsSumSq` itself assumes only +`[Mul R] [Add R] [Zero R]`. Padding a sum of squares with zeros needs `0 * 0 = 0`, so +`IsSumSqOfLength.of_le` and `mem_pythagorasBounds_of_le` are stated for a +`NonUnitalNonAssocSemiring`. + +## References + +* [CDLR1982] M. D. Choi, Z. D. Dai, T. Y. Lam, B. Reznick, *The Pythagoras number of some + affine algebras and local algebras*, J. reine angew. Math. 336 (1982), 45–82. +* [Pfister1995] A. Pfister, *Quadratic forms with applications to algebraic geometry and + topology*, London Math. Soc. Lecture Note Ser. 217, Cambridge University Press, 1995. +-/ + +variable {R : Type*} + +section AddCommMonoid + +variable [AddCommMonoid R] [Mul R] + +/-- `IsSumSqOfLength n a` means that `a` is a sum of `n` squares. -/ +def IsSumSqOfLength (n : ℕ) (a : R) : Prop := + ∃ f : Fin n → R, a = ∑ i, f i * f i + +variable (R) in +/-- The set of `p` such that every sum of squares in `R` is a sum of `p` squares. Its least +element, when it exists, is the Pythagoras number of `R`. -/ +def pythagorasBounds : Set ℕ := + {p | ∀ a : R, IsSumSq a → IsSumSqOfLength p a} + +theorem IsSumSqOfLength.isSumSq {n : ℕ} {a : R} (h : IsSumSqOfLength n a) : IsSumSq a := by + obtain ⟨f, rfl⟩ := h + induction n with + | zero => simp + | succ m ih => + rw [Fin.sum_univ_succ] + exact IsSumSq.sq_add (f 0) (ih fun i ↦ f i.succ) + +theorem IsSumSq.exists_isSumSqOfLength {a : R} (h : IsSumSq a) : ∃ n, IsSumSqOfLength n a := by + induction h with + | zero => exact ⟨0, fun _ ↦ 0, by simp⟩ + | sq_add b _ ih => + obtain ⟨n, f, hf⟩ := ih + refine ⟨n + 1, Fin.cons b f, ?_⟩ + rw [Fin.sum_univ_succ] + simp [hf] + +theorem isSumSq_iff_exists_isSumSqOfLength {a : R} : IsSumSq a ↔ ∃ n, IsSumSqOfLength n a := + ⟨IsSumSq.exists_isSumSqOfLength, fun ⟨_, h⟩ ↦ h.isSumSq⟩ + +end AddCommMonoid + +section NonUnitalNonAssocSemiring + +variable [NonUnitalNonAssocSemiring R] + +/-- Padding with zeros: a sum of `p` squares is a sum of `q` squares for every `q ≥ p`. -/ +theorem IsSumSqOfLength.of_le {p q : ℕ} (hpq : p ≤ q) {a : R} (h : IsSumSqOfLength p a) : + IsSumSqOfLength q a := by + obtain ⟨f, rfl⟩ := h + obtain ⟨r, rfl⟩ := Nat.exists_eq_add_of_le hpq + exact ⟨Fin.append f 0, by simp [Fin.sum_univ_add]⟩ + +theorem mem_pythagorasBounds_of_le {p q : ℕ} (hpq : p ≤ q) (hp : p ∈ pythagorasBounds R) : + q ∈ pythagorasBounds R := + fun a ha ↦ (hp a ha).of_le hpq + +end NonUnitalNonAssocSemiring diff --git a/FormalConjecturesForMathlib/Algebra/WeylAlgebra.lean b/FormalConjecturesForMathlib/Algebra/WeylAlgebra.lean new file mode 100644 index 0000000..d2b5c39 --- /dev/null +++ b/FormalConjecturesForMathlib/Algebra/WeylAlgebra.lean @@ -0,0 +1,133 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Algebra.FreeAlgebra +public import Mathlib.Algebra.RingQuot + +@[expose] public section + +/-! +# The Weyl algebra + +For a commutative ring `R` and an index type `σ`, we define the Weyl algebra +`WeylAlgebra R σ` as the quotient of the free `R`-algebra on `σ ⊕ σ` by the two-sided +ideal generated by the canonical commutation relations: writing `x i` for the generator +indexed by `Sum.inl i` and `y i` for the one indexed by `Sum.inr i`, + +* `x i * x j = x j * x i`; +* `y i * y j = y j * y i`; +* `x i * y j = y j * x i` for `i ≠ j`; +* `x i * y i = y i * x i + 1`. + +For `σ = Fin n` this is the `n`-th Weyl algebra $A_n(R)$: the associative `R`-algebra +with $2n$ generators $Y_1, \dots, Y_{2n}$ subject to $[Y_i, Y_{i+n}] = 1$ and all other +pairs of generators commuting (`Sum.inl i` is $Y_i$, `Sum.inr i` is $Y_{i+n}$). Over a +field of characteristic zero it is the algebra of polynomial-coefficient differential +operators in `n` variables. + +Historical remark: Adjamagbo and van den Essen +([AvdE07](https://arxiv.org/abs/math/0608009), Epilogue) argue that the algebra was +introduced by Dirac in 1926 and should be called the "Dirac quantum algebra"; we keep the +name in universal use. +-/ + +namespace WeylAlgebra + +variable (R : Type*) [CommRing R] (σ : Type*) + +/-- The canonical commutation relations presenting the Weyl algebra as a quotient of the +free algebra on `σ ⊕ σ`: the `Sum.inl` generators pairwise commute, the `Sum.inr` +generators pairwise commute, and the commutator of the `i`-th `Sum.inl` generator with the +`j`-th `Sum.inr` generator is `δ i j`. -/ +inductive Rel : FreeAlgebra R (σ ⊕ σ) → FreeAlgebra R (σ ⊕ σ) → Prop + | inl_mul_comm (i j : σ) : + Rel (FreeAlgebra.ι R (Sum.inl i) * FreeAlgebra.ι R (Sum.inl j)) + (FreeAlgebra.ι R (Sum.inl j) * FreeAlgebra.ι R (Sum.inl i)) + | inr_mul_comm (i j : σ) : + Rel (FreeAlgebra.ι R (Sum.inr i) * FreeAlgebra.ι R (Sum.inr j)) + (FreeAlgebra.ι R (Sum.inr j) * FreeAlgebra.ι R (Sum.inr i)) + | inl_mul_inr_of_ne {i j : σ} (h : i ≠ j) : + Rel (FreeAlgebra.ι R (Sum.inl i) * FreeAlgebra.ι R (Sum.inr j)) + (FreeAlgebra.ι R (Sum.inr j) * FreeAlgebra.ι R (Sum.inl i)) + | inl_mul_inr_self (i : σ) : + Rel (FreeAlgebra.ι R (Sum.inl i) * FreeAlgebra.ι R (Sum.inr i)) + (FreeAlgebra.ι R (Sum.inr i) * FreeAlgebra.ι R (Sum.inl i) + 1) + +end WeylAlgebra + +/-- The Weyl algebra over `R` on the index type `σ`: the free `R`-algebra on `σ ⊕ σ` +modulo the canonical commutation relations `WeylAlgebra.Rel`. For `σ = Fin n` this is the +`n`-th Weyl algebra $A_n(R)$. -/ +def WeylAlgebra (R : Type*) [CommRing R] (σ : Type*) : Type _ := + RingQuot (WeylAlgebra.Rel R σ) + +namespace WeylAlgebra + +variable (R : Type*) [CommRing R] (σ : Type*) + +instance : Ring (WeylAlgebra R σ) := + inferInstanceAs (Ring (RingQuot (Rel R σ))) + +instance : Algebra R (WeylAlgebra R σ) := + inferInstanceAs (Algebra R (RingQuot (Rel R σ))) + +instance : Inhabited (WeylAlgebra R σ) := ⟨0⟩ + +/-- The quotient map from the free algebra on `σ ⊕ σ` onto the Weyl algebra. -/ +noncomputable def mkAlgHom : FreeAlgebra R (σ ⊕ σ) →ₐ[R] WeylAlgebra R σ := + RingQuot.mkAlgHom R (Rel R σ) + +variable {R σ} in +theorem mkAlgHom_rel {x y : FreeAlgebra R (σ ⊕ σ)} (h : Rel R σ x y) : + mkAlgHom R σ x = mkAlgHom R σ y := + RingQuot.mkAlgHom_rel R h + +variable {σ} + +/-- The canonical generators of the Weyl algebra: `of R (Sum.inl i)` is the `i`-th +"position" generator ($Y_i$) and `of R (Sum.inr i)` the `i`-th "momentum" generator +($Y_{i+n}$). -/ +noncomputable def of (v : σ ⊕ σ) : WeylAlgebra R σ := + mkAlgHom R σ (FreeAlgebra.ι R v) + +/-- The position generators pairwise commute. -/ +theorem of_inl_mul_comm (i j : σ) : + of R (Sum.inl i) * of R (Sum.inl j) = of R (Sum.inl j) * of R (Sum.inl i) := by + simpa only [of, map_mul] using mkAlgHom_rel (Rel.inl_mul_comm (R := R) (σ := σ) i j) + +/-- The momentum generators pairwise commute. -/ +theorem of_inr_mul_comm (i j : σ) : + of R (Sum.inr i) * of R (Sum.inr j) = of R (Sum.inr j) * of R (Sum.inr i) := by + simpa only [of, map_mul] using mkAlgHom_rel (Rel.inr_mul_comm (R := R) (σ := σ) i j) + +/-- Position and momentum generators with distinct indices commute. -/ +theorem of_inl_mul_of_inr_of_ne {i j : σ} (h : i ≠ j) : + of R (Sum.inl i) * of R (Sum.inr j) = of R (Sum.inr j) * of R (Sum.inl i) := by + simpa only [of, map_mul] using mkAlgHom_rel (Rel.inl_mul_inr_of_ne (R := R) (σ := σ) h) + +/-- The defining commutation relation: `x i * y i = y i * x i + 1`. -/ +theorem of_inl_mul_of_inr_self (i : σ) : + of R (Sum.inl i) * of R (Sum.inr i) = of R (Sum.inr i) * of R (Sum.inl i) + 1 := by + simpa only [of, map_mul, map_add, map_one] using + mkAlgHom_rel (Rel.inl_mul_inr_self (R := R) (σ := σ) i) + +/-- The canonical commutation relation in commutator form: `[x i, y i] = 1`. -/ +theorem commutator_of_inl_of_inr_self (i : σ) : + of R (Sum.inl i) * of R (Sum.inr i) - of R (Sum.inr i) * of R (Sum.inl i) = 1 := by + rw [of_inl_mul_of_inr_self, add_sub_cancel_left] + +end WeylAlgebra diff --git a/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/GlobalPeriod.lean b/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/GlobalPeriod.lean new file mode 100644 index 0000000..3a1af87 --- /dev/null +++ b/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/GlobalPeriod.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. +-/ +module + +public import FormalConjecturesForMathlib.AlgebraicGeometry.EllipticCurve.MinimalDiscriminant +public import Mathlib.AlgebraicGeometry.EllipticCurve.DivisionPolynomial.Basic +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.Analysis.SpecialFunctions.Sqrt +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.MeasureTheory.Measure.Lebesgue.Complex +public import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic +public import Mathlib.RingTheory.Ideal.Norm.AbsNorm +public import Mathlib.RingTheory.Norm.Defs + +@[expose] public noncomputable section + +/-! +# The real and complex periods of an elliptic curve as integrals + +Let $E$ be an elliptic curve with Weierstrass equation +$y^2 + a_1 xy + a_3 y = x^3 + a_2 x^2 + a_4 x + a_6$ and invariant differential +$\omega = \frac{dx}{2y + a_1 x + a_3}$. Completing the square, +$(2y + a_1 x + a_3)^2 = 4x^3 + b_2 x^2 + 2 b_4 x + b_6 =: F(x)$, the *2-division polynomial* +`WeierstrassCurve.Ψ₂Sq`, so $|\omega| = |dx| / \sqrt{|F(x)|}$ on the $x$-line. + +* Over $\mathbb{R}$ (a curve `W : WeierstrassCurve ℝ`), the real locus $E(\mathbb{R})$ lies over + $\{F \geq 0\}$ with two branches $2y + a_1 x + a_3 = \pm\sqrt{F(x)}$, so the real period is + $\Omega_{\mathbb{R}} = \int_{E(\mathbb{R})} |\omega| = 2 \int_{\mathbb{R}} dx / \sqrt{F(x)}$ + (`WeierstrassCurve.realPeriod`). +* Over $\mathbb{C}$ (a curve `W : WeierstrassCurve ℂ`), the $x$-coordinate is a double cover + $E(\mathbb{C}) \to \mathbb{P}^1(\mathbb{C})$ and $|\omega \wedge \bar\omega| = 4\, dA(x) / |F(x)|$ + on each sheet, so the complex period is + $\Omega_{\mathbb{C}} = \int_{E(\mathbb{C})} |\omega \wedge \bar\omega| + = 4 \int_{\mathbb{C}} dA(x) / |F(x)|$ (`WeierstrassCurve.complexPeriod`). + +Over a number field $K$ these combine into a single global invariant. The archimedean period +$\Omega_\infty(E)$ is the product of the local periods over the infinite places, taking the real +period at a real place and the complex period at a complex one. It depends on the chosen +Weierstrass equation, so the *period* +$\Omega(E) = \Omega_\infty(E)(|N_{K/\mathbb{Q}}(\Delta_E)| / N(\mathfrak{D}_{E/K}))^{1/12}$ +corrects it by the minimal discriminant ideal (`WeierstrassCurve.period`). This is the factor that +appears in the Birch and Swinnerton-Dyer conjecture, and it is defined even when $E$ has no +globally minimal equation. + +*References:* +- [LMFDB](https://www.lmfdb.org/knowledge/show/ec.period), knowl `ec.period` +- [Sil09] Silverman, J. H., *The Arithmetic of Elliptic Curves*, 2nd ed., Graduate Texts in + Mathematics 106, Springer, 2009. Chapter III §1 (Weierstrass equations, the invariant + differential) and Chapter VI (elliptic curves over $\mathbb{C}$). +- [DEW2019] Dokchitser, V., Evans, H. and Wiersema, H., "On a BSD-type formula for L-values of + Artin twists of elliptic curves", Notation 17, [arXiv](https://arxiv.org/abs/1905.04282) +- [DD2010] Dokchitser, T. and Dokchitser, V., "On the Birch-Swinnerton-Dyer quotients modulo + squares", Annals of Mathematics 172 (2010), 567-596, §2.1 and Conjecture 2.1, + [PDF](https://annals.math.princeton.edu/wp-content/uploads/annals-v172-n1-p11-p.pdf) +-/ + +namespace WeierstrassCurve + +section Real + +variable (W : WeierstrassCurve ℝ) + +/-- The density $|\omega| / dx = 1 / \sqrt{4x^3 + b_2 x^2 + 2 b_4 x + b_6}$ of the invariant +differential on either branch of the real locus, as a function on $\mathbb{R}$, with the junk value +$0$ where the cubic is not positive. -/ +def realPeriodIntegrand (x : ℝ) : ℝ := (√(W.Ψ₂Sq.eval x))⁻¹ + +/-- **The real period as an integral**: the integral of $|\omega|$ over the real locus +$E(\mathbb{R})$, that is $2 \int_{\mathbb{R}} dx / \sqrt{F(x)}$ with the integrand taken to be +$0$ where $F \leq 0$. This is the real period of the Birch and Swinnerton-Dyer conjecture, in the +convention that absorbs the real Tamagawa number. -/ +def realPeriod : ℝ := 2 * ∫ x, W.realPeriodIntegrand x + +end Real + +section Complex + +variable (W : WeierstrassCurve ℂ) + +/-- The density of $\Omega_{\mathbb{C}}$ on the $x$-line: $1 / |\Psi_2^2(x)|$. -/ +def complexPeriodIntegrand (x : ℂ) : ℝ := ‖W.Ψ₂Sq.eval x‖⁻¹ + +/-- **The complex period as an integral**: $\Omega_{\mathbb{C}}(E) = \int_{E(\mathbb{C})} +|\omega \wedge \bar\omega| = 4 \int_{\mathbb{C}} dA(x) / |\Psi_2^2(x)|$. Source: LMFDB knowl +`ec.period`. -/ +def complexPeriod : ℝ := 4 * ∫ x : ℂ, W.complexPeriodIntegrand x + +end Complex + +section NumberField + +open scoped Classical in +/-- The *global period* $\Omega(E) = (|N_{K/\mathbb{Q}}(\Delta_E)| / N(\mathfrak{D}_{E/K}))^{1/12} +\prod_v \Omega_v(E)$, the product of the real and complex period integrals over the infinite places +$v$ of $K$, scaled by the discriminant factor. This is the global period of [LMFDB], knowl +`ec.period`. It is not the bare product of archimedean periods in [DD2010], Conjecture 2.1: the +discriminant factor equals the product over the finite places of the differential correction +factors $|\omega / \omega_v^{\min}|_v$ that [DD2010] include in $C(E/K)$, by the scaling of the +discriminant under a change of differential, see [DEW2019], Notation 17. -/ +def period {K : Type*} [Field K] [NumberField K] (E : WeierstrassCurve K) : ℝ := + (|(Algebra.norm ℚ E.Δ : ℝ)| / E.minimalDiscriminant.absNorm) ^ (1 / 12 : ℝ) * + ∏ v : NumberField.InfinitePlace K, + if hv : v.IsReal then (E.map <| NumberField.InfinitePlace.embedding_of_isReal hv).realPeriod + else (E.map v.embedding).complexPeriod + +end NumberField + +end WeierstrassCurve diff --git a/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/MinimalDiscriminant.lean b/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/MinimalDiscriminant.lean new file mode 100644 index 0000000..1744f81 --- /dev/null +++ b/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/MinimalDiscriminant.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. +-/ +module + +public import Mathlib.Algebra.BigOperators.Finprod +public import Mathlib.AlgebraicGeometry.EllipticCurve.Reduction +public import Mathlib.NumberTheory.NumberField.Completion.FinitePlace + +/-! +# Minimal discriminants of elliptic curves over number fields + +The minimal discriminant ideal of an elliptic curve over a number field, together with the +local exponents cutting it out. + +## References + +* [J. Silverman, *The Arithmetic of Elliptic Curves*][silverman2009], Section VIII.8. +-/ + +@[expose] public section + +namespace WeierstrassCurve + +open NumberField IsDedekindDomain + +variable {K : Type*} [Field K] [NumberField K] + +/-- The exponent of `v` in the minimal discriminant ideal of `W`: the natural number `n` such that +the discriminant of a minimal model over the `v`-adic completion has valuation `exp (-n)`. +A vanishing discriminant has valuation `0`, whose `log` is `0`, so this is only +meaningful for elliptic `W`. -/ +noncomputable def minimalDiscriminantExponent (W : WeierstrassCurve K) + (v : HeightOneSpectrum (𝓞 K)) : ℕ := + (-WithZero.log ((IsDiscreteValuationRing.maximalIdeal (v.adicCompletionIntegers K)).valuation + (v.adicCompletion K) ((W⁄(v.adicCompletion K)).minimal (v.adicCompletionIntegers K)).Δ)).toNat + +/-- The minimal discriminant ideal of an elliptic curve over a number field is the product of +the local minimal discriminant ideals `v.asIdeal ^ W.minimalDiscriminantExponent v` over +all nonzero prime ideals `v` of its ring of integers. Only finitely many exponents are nonzero. +See [LMFDB](https://www.lmfdb.org/knowledge/show/ec.minimal_discriminant). -/ +noncomputable def minimalDiscriminant (W : WeierstrassCurve K) : Ideal (𝓞 K) := + ∏ᶠ v : HeightOneSpectrum (𝓞 K), v.asIdeal ^ W.minimalDiscriminantExponent v + +end WeierstrassCurve diff --git a/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/Tamagawa.lean b/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/Tamagawa.lean new file mode 100644 index 0000000..2d06797 --- /dev/null +++ b/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/Tamagawa.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. +-/ +module + +public import Mathlib.Algebra.BigOperators.Finprod +public import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Point +public import Mathlib.AlgebraicGeometry.EllipticCurve.Reduction +public import Mathlib.NumberTheory.NumberField.Completion.FinitePlace +public import Mathlib.SetTheory.Cardinal.NatCard + +@[expose] public noncomputable section + +/-! +# Tamagawa numbers of elliptic curves + +For a non-archimedean local field `K`, the *Tamagawa number* is `[E(K) : E₀(K)]`, where `E₀(K)` is +the points with non-singular reduction on a minimal Weierstrass model. For a global field `K`, the +*Tamagawa product* is the finitely supported product over all non-archimedean completions. + +We describe `E₀(K)` as a set using integral projective representatives, because its group structure +has not been proven, and count its distinct additive translates in `E(K)`. The local definitions +take in an integral model, which gives the usual local definitions when it is minimal. + +## References + +* [Silverman2009] Joseph H. Silverman, *The Arithmetic of Elliptic Curves*, 2nd ed., Graduate Texts + in Mathematics 106, Springer (2009), [doi](https://doi.org/10.1007/978-0-387-09494-6). + Chapter VII, §§1–2 and §6: minimal equations, reduction of points, and `E(K) / E₀(K)`; + see pp. 187–188 for the reduction map and `E₀(K)`, Proposition VII.2.1 for the subgroup and + homomorphism properties, and Theorem VII.6.1 and Corollary VII.6.2 on p. 200. +* [LMFDB, Tamagawa number](https://www.lmfdb.org/knowledge/show/ec.tamagawa_number) +-/ + +namespace WeierstrassCurve.Projective + +open IsDedekindDomain NumberField + +/-- The points with an integral projective representative whose reduction is non-singular. -/ +def nonsingularReduction {R : Type*} [CommRing R] [IsLocalRing R] (K : Type*) [CommRing K] + [Algebra R K] (W : Projective R) : Set (W⁄K).Point := + {P : (W⁄K).Point | ∃ q : Fin 3 → R, P.point = ⟦(algebraMap R K <| q ·)⟧ ∧ + (W.map <| IsLocalRing.residue R).Nonsingular (IsLocalRing.residue R <| q ·)} + +/-- The local Tamagawa number attached to an integral model. For a minimal model this is the +usual Tamagawa number. This is 0 if there are infinitely many distinct translates. -/ +def tamagawaNumber {R : Type*} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] (K : Type*) + [Field K] [Algebra R K] [IsFractionRing R K] (W : Projective R) : ℕ := + Nat.card <| Set.range fun P : (W⁄K).Point ↦ (P + ·) '' W.nonsingularReduction K + +/-- The product of local Tamagawa numbers for minimal integral models at all the non-archimedean +completions. This is 1 if infinitely many local factors differ from 1. -/ +def tamagawaProduct {K : Type*} [Field K] [NumberField K] (W : Projective K) : ℕ := + ∏ᶠ v : HeightOneSpectrum <| RingOfIntegers K, tamagawaNumber (v.adicCompletion K) + (W⁄(v.adicCompletion K) |>.minimal (v.adicCompletionIntegers K) |>.integralModel <| + v.adicCompletionIntegers K) + +end WeierstrassCurve.Projective diff --git a/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/TateShafarevich.lean b/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/TateShafarevich.lean new file mode 100644 index 0000000..325559b --- /dev/null +++ b/FormalConjecturesForMathlib/AlgebraicGeometry/EllipticCurve/TateShafarevich.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. +-/ +module + +public import FormalConjecturesForMathlib.RepresentationTheory.Homological.ContCohomology.Sha +public import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point +public import Mathlib.NumberTheory.NumberField.Completion.FinitePlace +public import Mathlib.NumberTheory.NumberField.Completion.InfinitePlace + +/-! +# The Tate–-Shafarevich group of an elliptic curve over a number field + +The non-singular points over an algebraic closure of a field `K` carry a discrete Galois +representation. For a number field, the *Tate–Shafarevich group* is the intersection of the kernels +of restriction to all infinite and finite completions, where finite places are indexed by the +non-zero prime ideals of the ring of integers of `K`. The coefficient module remains the geometric +points over the separable closure of `K`, with its action restricted to each local Galois group. + +## References + +* [Silverman2009] Joseph H. Silverman, *The Arithmetic of Elliptic Curves*, 2nd ed., Graduate Texts + in Mathematics 106, Springer (2009), [doi](https://doi.org/10.1007/978-0-387-09494-6). + Chapter X, §4, pp. 331–333, especially the definition on p. 332, gives the classical + Tate–-Shafarevich group over a number field, using local geometric points. +* [J. S. Milne, Arithmetic Duality Theorems](https://www.jmilne.org/math/Books/ADTnot.pdf) +* [J. S. Milne, Elliptic Curves](https://www.jmilne.org/math/Books/EC2.pdf), 2nd ed., Chapter IV, + Remark 1.11, p. 111, explains the use of a separable closure over imperfect fields. +-/ + +@[expose] public section + +@[simp] +lemma Field.absoluteGaloisGroup.one_toAlgHom {K : Type*} [Field K] : + (1 : Field.absoluteGaloisGroup K).toAlgHom = AlgHom.id K (AlgebraicClosure K) := rfl + +@[simp] +lemma Field.absoluteGaloisGroup.mul_toAlgHom {K : Type*} [Field K] + (σ τ : Field.absoluteGaloisGroup K) : + (σ * τ).toAlgHom = σ.toAlgHom.comp τ.toAlgHom := rfl + +@[simp] +lemma WeierstrassCurve.Affine.Point.map_id' {R S F : Type*} [CommRing R] [CommRing S] + [Field F] {W' : WeierstrassCurve.Affine R} [DecidableEq F] [Algebra R S] [Algebra R F] + [Algebra S F] [IsScalarTower R S F] (P : (W'.baseChange F).Point) : + WeierstrassCurve.Affine.Point.map (AlgHom.id S F) P = P := by + cases P <;> rfl + +lemma ContinuousLinearMap.mk_apply {R S M M₂ : Type*} [Semiring R] [Semiring S] + {σ : R →+* S} [TopologicalSpace M] [AddCommMonoid M] [TopologicalSpace M₂] + [AddCommMonoid M₂] [Module R M] [Module S M₂] (toLinearMap : M →ₛₗ[σ] M₂) + (cont : Continuous toLinearMap.toFun) (m : M) : + ContinuousLinearMap.mk toLinearMap cont m = toLinearMap m := rfl + +namespace WeierstrassCurve.Affine + +open ContinuousCohomology IsDedekindDomain NumberField + +variable {K : Type*} [Field K] (W : Affine K) + +/-- The geometric non-singular points as a topological space. -/ +local instance : TopologicalSpace (W⁄(AlgebraicClosure K)).Point := ⊥ + +/-- The geometric non-singular points equipped with the discrete topology. -/ +local instance : DiscreteTopology (W⁄(AlgebraicClosure K)).Point := ⟨rfl⟩ + +open scoped Classical in +/-- The natural Galois action on geometric non-singular points with their discrete topology. + +This uses `AlgebraicClosure K` to match `Field.absoluteGaloisGroup`. For number fields, which are +perfect, an algebraic closure is also a separable closure. Over an imperfect field, the coefficient +module for the usual Galois cohomology of an elliptic curve should use `SeparableClosure K` instead. + +TODO: use `SeparableClosure K` for the coefficient field when the API for absolute Galois groups +supports this directly. The automorphism group of the algebraic closure itself gives the usual +absolute Galois group by restriction to the separable closure. -/ +noncomputable def galoisRepresentation : TopRep ℤ <| Field.absoluteGaloisGroup K := .of <| + .ofMonoidHom { + toFun σ := { __ := (Affine.Point.map (W' := W) σ.toAlgHom).toIntLinearMap } + map_one' := by ext; simp + map_mul' σ τ := by ext; simp [ContinuousLinearMap.mk_apply _, Point.map_map] } + +/-- The subgroup of the first continuous Galois cohomology group consisting of classes whose +restrictions vanish at every infinite and finite place. When `W.IsElliptic`, this is the classical +Tate--Shafarevich group of `W` over `K`. The construction also applies to the nonsingular locus +of a singular Weierstrass curve. -/ +noncomputable def tateShafarevich [NumberField K] : + AddSubgroup <| continuousCohomology 1 W.galoisRepresentation := + ContinuousCohomology.tateShafarevich + (fun v : InfinitePlace K ↦ v.Completion) W.galoisRepresentation 1 ⊓ + ContinuousCohomology.tateShafarevich + (fun v : HeightOneSpectrum <| 𝓞 K ↦ v.adicCompletion K) W.galoisRepresentation 1 + +end WeierstrassCurve.Affine diff --git a/FormalConjecturesForMathlib/Analysis/Equidistribution/ModOne.lean b/FormalConjecturesForMathlib/Analysis/Equidistribution/ModOne.lean index 3665610..20edad5 100644 --- a/FormalConjecturesForMathlib/Analysis/Equidistribution/ModOne.lean +++ b/FormalConjecturesForMathlib/Analysis/Equidistribution/ModOne.lean @@ -16,6 +16,7 @@ limitations under the License. module public import Mathlib.Analysis.Real.Cardinality +public import Mathlib.Topology.Instances.AddCircle.Defs @[expose] public section @@ -38,3 +39,31 @@ modulo 1 or uniformly distributed modulo 1 if the sequence of the fractional par -/ def IsEquidistributedModuloOne (s : ℕ → ℝ) : Prop := IsEquidistributed 0 1 (fun n => Int.fract (s n)) + +/-- A sequence that is equidistributed modulo 1 is dense modulo 1. -/ +theorem IsEquidistributedModuloOne.dense_range {s : ℕ → ℝ} (h : IsEquidistributedModuloOne s) : + Dense (Set.range fun n => (s n : AddCircle (1 : ℝ))) := by + have key (y : ℝ) : ((Int.fract y : ℝ) : AddCircle (1 : ℝ)) = y := by + rw [QuotientAddGroup.eq] + exact ⟨⌊y⌋, by simp [← Int.self_sub_floor]⟩ + rw [dense_iff_inter_open] + rintro U hU ⟨p, hp⟩ + obtain ⟨q, rfl⟩ := QuotientAddGroup.mk_surjective p + set t := Int.fract q + have hpt : ((t : ℝ) : AddCircle (1 : ℝ)) ∈ U := (key q).symm ▸ hp + have hpre : IsOpen ((↑) ⁻¹' U : Set ℝ) := hU.preimage (AddCircle.continuous_mk' 1) + obtain ⟨ε, hε, hball⟩ := Metric.isOpen_iff.1 hpre t hpt + set d := min (t + ε / 2) 1 + have htd : t < d := lt_min (by linarith) (Int.fract_lt_one q) + have hlim := h t d htd.le (Set.Icc_subset_Icc (Int.fract_nonneg q) (min_le_right _ _)) + have hpos : (0 : ℝ) < (d - t) / (1 - 0) := by simpa using htd + obtain ⟨n, hn⟩ := (hlim.eventually (lt_mem_nhds hpos)).exists + obtain ⟨m, hm⟩ : ((Finset.range n).filter fun m => Int.fract (s m) ∈ Set.Icc t d).Nonempty := + Finset.card_pos.1 <| Nat.pos_of_ne_zero fun h0 => by + simp only [h0, Nat.cast_zero, zero_div, lt_irrefl] at hn + obtain ⟨-, hm⟩ := Finset.mem_filter.1 hm + refine ⟨_, ?_, m, rfl⟩ + have hmem : Int.fract (s m) ∈ Metric.ball t ε := by + rw [Metric.mem_ball, Real.dist_eq, abs_lt] + constructor <;> linarith [hm.1, hm.2, min_le_left (t + ε / 2) 1] + simpa [key] using hball hmem diff --git a/FormalConjecturesForMathlib/Analysis/Fourier/SpectralSets.lean b/FormalConjecturesForMathlib/Analysis/Fourier/SpectralSets.lean index 372112f..7f38e72 100644 --- a/FormalConjecturesForMathlib/Analysis/Fourier/SpectralSets.lean +++ b/FormalConjecturesForMathlib/Analysis/Fourier/SpectralSets.lean @@ -68,11 +68,15 @@ theorem exponentialCharacter_memLp {d : ℕ} {Ω : Set (Fin d → ℝ)} (MeasureTheory.integrableOn_const (μ := volume) (s := Ω) (C := (1 : ℝ)) hΩ_finite) /-- -(Ω, Λ) is called a spectral pair if Λ is a spectrum for Ω, i.e. -a set Λ of frequencies such that the associated exponential characters - form an orthogonal basis of L^2(Ω). +(Ω, Λ) is called a spectral pair if Ω is a (Lebesgue) measurable set of positive finite +measure and Λ is a spectrum for Ω, i.e. a set Λ of frequencies such that the associated +exponential characters form an orthogonal basis of L^2(Ω). + +The positivity requirement matters: if Ω is a null set then L^2(Ω) is the zero space and +every Λ would vacuously be a spectrum. -/ def spectralPair {d : ℕ} (Ω Λ : Set (Fin d → ℝ)) : Prop := + NullMeasurableSet Ω volume ∧ 0 < volume Ω ∧ ∃ hΩ_finite : volume Ω ≠ ⊤, let e : (Fin d → ℝ) → MeasureTheory.Lp ℂ 2 (volume.restrict Ω) := fun ξ ↦ MeasureTheory.MemLp.toLp (exponentialCharacter ξ) (exponentialCharacter_memLp hΩ_finite ξ) diff --git a/FormalConjecturesForMathlib/Analysis/SpecialFunctions/Log/Basic.lean b/FormalConjecturesForMathlib/Analysis/SpecialFunctions/Log/Basic.lean index 84f1bb2..14277d1 100644 --- a/FormalConjecturesForMathlib/Analysis/SpecialFunctions/Log/Basic.lean +++ b/FormalConjecturesForMathlib/Analysis/SpecialFunctions/Log/Basic.lean @@ -30,6 +30,28 @@ Reference: https://en.wikipedia.org/wiki/Iterated_logarithm -/ noncomputable def Real.iteratedLog (x : ℝ) : ℕ := sInf { (n : ℕ) | Real.log^[n] x ≤ 1 } +/-- The iterated logarithm of a natural number in base `b`: the number of times `Nat.log b` must +be iteratively applied to `n` before the result is at most `1`. -/ +def Nat.iteratedLog (b : ℕ) : ℕ → ℕ + | 0 => 0 + | 1 => 0 + | (n + 2) => Nat.iteratedLog b (Nat.log b (n + 2)) + 1 +termination_by n => n +decreasing_by exact Nat.log_lt_self b (by omega) + +@[simp] +theorem Nat.iteratedLog_zero (b : ℕ) : Nat.iteratedLog b 0 = 0 := by + simp [Nat.iteratedLog] + +@[simp] +theorem Nat.iteratedLog_one (b : ℕ) : Nat.iteratedLog b 1 = 0 := by + simp [Nat.iteratedLog] + +theorem Nat.iteratedLog_of_two_le (b : ℕ) {n : ℕ} (hn : 2 ≤ n) : + Nat.iteratedLog b n = Nat.iteratedLog b (Nat.log b n) + 1 := by + obtain ⟨m, rfl⟩ : ∃ m, n = m + 2 := ⟨n - 2, by omega⟩ + simp [Nat.iteratedLog] + theorem Real.iteratedLog_eq_zero_of_le {x : ℝ} (hx : x ≤ 1) : Real.iteratedLog x = 0 := by simpa [iteratedLog] using Or.inl hx diff --git a/FormalConjecturesForMathlib/Analysis/SpecialFunctions/NthRoot.lean b/FormalConjecturesForMathlib/Analysis/SpecialFunctions/NthRoot.lean index f9f7b22..fdc0d9e 100644 --- a/FormalConjecturesForMathlib/Analysis/SpecialFunctions/NthRoot.lean +++ b/FormalConjecturesForMathlib/Analysis/SpecialFunctions/NthRoot.lean @@ -36,11 +36,11 @@ noncomputable def nthRoot (n : ℕ) (r : ℝ) : ℝ := if Even n then r ^ (n⁻¹ : ℝ) else SignType.sign r ^ n * abs r ^ (n⁻¹ : ℝ) theorem nthRoot_of_even {n : ℕ} (hn : Even n) (r : ℝ) : nthRoot n r = r ^ (n⁻¹ : ℝ) := - if_pos hn + ite_eq_left hn theorem nthRoot_of_odd {n : ℕ} (hn : Odd n) (r : ℝ) : nthRoot n r = SignType.sign r ^ n * abs r ^ (n⁻¹ : ℝ) := - if_neg <| Nat.not_even_iff_odd.mpr hn + ite_eq_right <| Nat.not_even_iff_odd.mpr hn theorem nthRoot_of_odd_of_nonpos {n : ℕ} (hn : Odd n) {r : ℝ} (hr : r ≤ 0) : nthRoot n r = (-1) ^ n * (-r) ^ (n⁻¹ : ℝ) := by diff --git a/FormalConjecturesForMathlib/Combinatorics/Additive/Coset.lean b/FormalConjecturesForMathlib/Combinatorics/Additive/Coset.lean index 894cc1c..3653a34 100644 --- a/FormalConjecturesForMathlib/Combinatorics/Additive/Coset.lean +++ b/FormalConjecturesForMathlib/Combinatorics/Additive/Coset.lean @@ -21,3 +21,173 @@ public import Mathlib noncomputable def maxCosetDim (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] [FiniteDimensional K V] (A : Set V) : ℕ := sSup { Module.finrank K S.direction | (S : AffineSubspace K V) (_h : (S : Set V) ⊆ A) } + +open scoped Pointwise + +/-- +The maximum coset dimension in the entire vector space $V$ is exactly the dimension of $V$. +-/ +theorem maxCosetDim_univ (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] + [FiniteDimensional K V] : maxCosetDim K V (Set.univ : Set V) = Module.finrank K V := by + dsimp [maxCosetDim] + apply le_antisymm + · apply csSup_le + · use 0 + use ⊥ + simp + · rintro _ ⟨S, _, rfl⟩ + exact Submodule.finrank_le S.direction + · apply le_csSup + · use Module.finrank K V + rintro _ ⟨S, _, rfl⟩ + exact Submodule.finrank_le S.direction + · use ⊤ + refine ⟨Set.subset_univ _, ?_⟩ + rw [AffineSubspace.direction_top, finrank_top] + +/-- The maximum coset dimension in the empty set $\emptyset$ is $0$. -/ +theorem maxCosetDim_empty (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] + [FiniteDimensional K V] : maxCosetDim K V (∅ : Set V) = 0 := by + dsimp [maxCosetDim] + have h : {Module.finrank K S.direction | (S : AffineSubspace K V) (_h : (S : Set V) ⊆ ∅)} = {0} := by + ext x + simp only [Set.mem_ofPred_eq, Set.subset_empty_iff, Set.mem_singleton_iff] + constructor + · rintro ⟨S, hS, rfl⟩ + have hbot : S = ⊥ := SetLike.ext'_iff.mpr (by simp [hS]) + rw [hbot, AffineSubspace.direction_bot, finrank_bot] + · rintro rfl + use ⊥ + simp + rw [h, csSup_singleton] + +/-- +If $A \subseteq B$, then the maximum coset dimension achievable in $A$ +cannot exceed the maximum coset dimension achievable in $B$. +-/ +theorem maxCosetDim_mono (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] + [FiniteDimensional K V] {A B : Set V} (h : A ⊆ B) : + maxCosetDim K V A ≤ maxCosetDim K V B := by + dsimp [maxCosetDim] + -- We show that any dimension achievable in A is bounded by the supremum in B + apply csSup_le + · use 0 + use ⊥ + simp [Set.empty_subset] + · rintro d ⟨S, hS, rfl⟩ + apply le_csSup + · -- Prove the set of dimensions in B is bounded above + use Module.finrank K V + rintro _ ⟨S', _, rfl⟩ + exact Submodule.finrank_le S'.direction + · -- The witness S in A is also a witness in B + use S + exact ⟨Set.Subset.trans hS h, rfl⟩ + +/-- +If the target set $A$ is already an affine subspace, the function +returns exactly the rank of its direction. +-/ +theorem maxCosetDim_affineSubspace (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] + [FiniteDimensional K V] (S : AffineSubspace K V) : + maxCosetDim K V (S : Set V) = Module.finrank K S.direction := by + dsimp [maxCosetDim] + apply le_antisymm + · apply csSup_le + · use 0 + use ⊥ + simp [Set.empty_subset] + · rintro _ ⟨S', hS', rfl⟩ + exact Submodule.finrank_mono (AffineSubspace.direction_le hS') + · apply le_csSup + · use Module.finrank K V + rintro _ ⟨S', _, rfl⟩ + exact Submodule.finrank_le S'.direction + · use S + +/-- +Similar to the empty set, a set containing exactly one vector should yield +a maximum dimension of 0. +-/ +theorem maxCosetDim_singleton (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] + [FiniteDimensional K V] (v : V) : maxCosetDim K V ({v} : Set V) = 0 := by + dsimp [maxCosetDim] + have h : {Module.finrank K S.direction | (S : AffineSubspace K V) (_h : (S : Set V) ⊆ {v})} = {0} := by + ext x + simp only [Set.mem_ofPred_eq, Set.mem_singleton_iff] + constructor + · rintro ⟨S, hS, rfl⟩ + obtain rfl | h_nonempty := eq_bot_or_bot_lt S + · rw [AffineSubspace.direction_bot, finrank_bot] + · have h_dir : S.direction = ⊥ := by + apply eq_bot_iff.mpr + rintro y hy + have h_coe : (S : Set V) ≠ ∅ := by + intro h_emp + apply ne_of_gt h_nonempty + exact (AffineSubspace.coe_eq_bot_iff S).mp h_emp + obtain ⟨p, hp⟩ : (S : Set V).Nonempty := Set.nonempty_iff_ne_empty.mpr h_coe + have hpv : p = v := hS hp + have hpy : y +ᵥ p ∈ S := AffineSubspace.vadd_mem_of_mem_direction hy hp + have hpyv : y +ᵥ p = v := hS hpy + rw [hpv] at hpyv + change y + v = v at hpyv + simpa using hpyv + rw [h_dir, finrank_bot] + · rintro rfl + use ⊥ + simp + rw [h, csSup_singleton] + +lemma maxCosetDim_vadd_le (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] + [FiniteDimensional K V] (v : V) (A : Set V) : + maxCosetDim K V (v +ᵥ A) ≤ maxCosetDim K V A := by + dsimp [maxCosetDim] + apply csSup_le + · use 0 + use ⊥ + simp [Set.empty_subset] + · rintro d ⟨S, hS, rfl⟩ + apply le_csSup + · use Module.finrank K V + rintro _ ⟨S', _, rfl⟩ + exact Submodule.finrank_le S'.direction + · let f : V ≃ᵃ[K] V := AffineEquiv.constVAdd K V (-v) + refine ⟨S.map (f : V →ᵃ[K] V), ?_, ?_⟩ + · rw [AffineSubspace.coe_map] + rintro x ⟨y, hy, rfl⟩ + have h_ya : y ∈ v +ᵥ A := hS hy + rcases h_ya with ⟨a, ha, rfl⟩ + change -v + (v + a) ∈ A + rw [neg_add_cancel_left] + exact ha + · have hd : (S.map (f : V →ᵃ[K] V)).direction = S.direction := by + rw [AffineSubspace.map_direction] + change Submodule.map LinearMap.id S.direction = S.direction + exact Submodule.map_id S.direction + rw [hd] + +/-- +Translating a set by a vector does not change its maximum coset dimension. +-/ +theorem maxCosetDim_vadd (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] + [FiniteDimensional K V] (v : V) (A : Set V) : + maxCosetDim K V (v +ᵥ A) = maxCosetDim K V A := by + apply le_antisymm + · exact maxCosetDim_vadd_le K V v A + · have h := maxCosetDim_vadd_le K V (-v) (v +ᵥ A) + have h_cancel : -v +ᵥ (v +ᵥ A) = A := by + ext x + constructor + · rintro ⟨y, ⟨a, ha, rfl⟩, rfl⟩ + change -v + (v + a) ∈ A + rw [neg_add_cancel_left] + exact ha + · rintro hx + use v + x + constructor + · exact ⟨x, hx, rfl⟩ + · change -v + (v + x) = x + rw [neg_add_cancel_left] + rw [h_cancel] at h + exact h diff --git a/FormalConjecturesForMathlib/Combinatorics/Additive/VCDim.lean b/FormalConjecturesForMathlib/Combinatorics/Additive/VCDim.lean index 1945f2a..419c79f 100644 --- a/FormalConjecturesForMathlib/Combinatorics/Additive/VCDim.lean +++ b/FormalConjecturesForMathlib/Combinatorics/Additive/VCDim.lean @@ -110,10 +110,27 @@ protected lemma HasMulVCNDimAtMost.univ : HasMulVCNDimAtMost (.univ : Set G) n d simpa [HasMulVCNDimAtMost] using ⟨default, ∅, by simp⟩ @[to_additive (attr := simp)] +lemma hasMulVCNDimAtMost_zero : HasMulVCNDimAtMost A 0 d ↔ A = ∅ ∨ A = .univ where + mp hA := by + rw [Set.eq_univ_iff_forall] + simp only [HasMulVCNDimAtMost, Finset.univ_eq_empty, Finset.prod_empty, mul_one, + Fin.forall_fin_zero_pi, not_forall, forall_const] at hA + contrapose! hA + obtain ⟨⟨x, hx⟩, y, hy⟩ := hA + refine ⟨fun s ↦ if s = ∅ then y else x, fun s ↦ ?_⟩ + beta_reduce + split_ifs with hs + · simp_all + · rw [← ne_eq, ← Set.nonempty_iff_ne_empty] at hs + obtain ⟨z, hz⟩ := hs + simp_all [Subsingleton.elim z finZeroElim] + mpr := by simp +contextual [or_imp] + +@[to_additive (attr := simp) hasAddVCNDimAtMost_one] lemma hasMulVCNDimAtMost_one : HasMulVCNDimAtMost A 1 d ↔ HasMulVCDimAtMost A d := by symm refine (Equiv.funUnique ..).symm.forall_congr fun x ↦ - ((Equiv.Set.congr <| Equiv.funUnique ..).arrowCongr <| .refl _).symm.forall_congr fun y ↦ + ((Equiv.setCongr <| Equiv.funUnique ..).arrowCongr <| .refl _).symm.forall_congr fun y ↦ not_congr <| (Equiv.funUnique ..).symm.forall_congr fun i ↦ - (Equiv.Set.congr <| Equiv.funUnique ..).symm.forall_congr fun s ↦ ?_ + (Equiv.setCongr <| Equiv.funUnique ..).symm.forall_congr fun s ↦ ?_ simp [Set.image_image, funext_iff] diff --git a/FormalConjecturesForMathlib/Combinatorics/Basic.lean b/FormalConjecturesForMathlib/Combinatorics/Basic.lean index 0e2fa55..ebc7ec3 100644 --- a/FormalConjecturesForMathlib/Combinatorics/Basic.lean +++ b/FormalConjecturesForMathlib/Combinatorics/Basic.lean @@ -16,6 +16,7 @@ limitations under the License. module public import FormalConjecturesForMathlib.Combinatorics.AP.Basic +public import Mathlib.Algebra.Order.Sub.Unbundled.Basic public import Mathlib.Analysis.Normed.Field.Lemmas public import Mathlib.Order.CompletePartialOrder @@ -134,6 +135,29 @@ def IsMaximalSidonSetIn (A : Set ℕ) (N : ℕ) : Prop := A ⊆ Set.Icc 1 N ∧ IsSidon A ∧ ∀ ⦃x : ℕ⦄, x ∈ Set.Icc 1 N → x ∉ A → ¬ IsSidon (A ∪ {x}) +/-- Ordered-pair characterisation of the Sidon property: `A` is Sidon iff whenever `a₁ ≤ b₁`, +`a₂ ≤ b₂` are elements of `A` with `a₁ + b₁ = a₂ + b₂`, then `a₁ = a₂` and `b₁ = b₂`. -/ +theorem isSidon_iff_le [LinearOrder α] (A : Set α) : + IsSidon A ↔ + ∀ a₁ ∈ A, ∀ b₁ ∈ A, ∀ a₂ ∈ A, ∀ b₂ ∈ A, + a₁ ≤ b₁ → a₂ ≤ b₂ → a₁ + b₁ = a₂ + b₂ → a₁ = a₂ ∧ b₁ = b₂ := by + constructor + · intro hS a₁ ha₁ b₁ hb₁ a₂ ha₂ b₂ hb₂ hab₁ hab₂ hsum + rcases hS a₁ ha₁ a₂ ha₂ b₁ hb₁ b₂ hb₂ hsum with h | ⟨h₁, h₂⟩ + · exact h + · obtain rfl : a₁ = b₁ := le_antisymm hab₁ (h₂ ▸ h₁ ▸ hab₂) + exact ⟨h₂, h₁⟩ + · intro hS i₁ hi₁ j₁ hj₁ i₂ hi₂ j₂ hj₂ hsum + rcases le_total i₁ i₂ with h₁ | h₁ <;> rcases le_total j₁ j₂ with h₂ | h₂ + · exact .inl (hS i₁ hi₁ i₂ hi₂ j₁ hj₁ j₂ hj₂ h₁ h₂ hsum) + · have := hS i₁ hi₁ i₂ hi₂ j₂ hj₂ j₁ hj₁ h₁ h₂ (hsum.trans (add_comm _ _)) + exact .inr ⟨this.1, this.2⟩ + · have := hS i₂ hi₂ i₁ hi₁ j₁ hj₁ j₂ hj₂ h₁ h₂ ((add_comm _ _).trans hsum) + exact .inr ⟨this.2, this.1⟩ + · have := hS i₂ hi₂ i₁ hi₁ j₂ hj₂ j₁ hj₁ h₁ h₂ + ((add_comm _ _).trans (hsum.trans (add_comm _ _))) + exact .inl ⟨this.2, this.1⟩ + namespace IsMaximalSidonSetIn /-- If `A` is a maximal Sidon set in `{1, …, N}`, then `A ⊆ {1, …, N}`. -/ @@ -158,6 +182,22 @@ instance (A : Finset α) [DecidableEq α] : Decidable (IsSidon (A : Set α)) := i₁ + i₂ = j₁ + j₂ → (i₁ = j₁ ∧ i₂ = j₂) ∨ (i₁ = j₂ ∧ i₂ = j₁)) ?_ rfl +/-- In a Sidon set, a positive difference determines its endpoints: if `a₁ - b₁ = a₂ - b₂` with +`b₁ < a₁` and `b₂ < a₂`, then `a₁ = a₂` and `b₁ = b₂`. -/ +theorem IsSidon.eq_of_tsub {β : Type*} [AddCommMonoid β] [PartialOrder β] + [ExistsAddOfLE β] [AddLeftMono β] [Sub β] [OrderedSub β] + {A : Finset β} (hS : IsSidon (A : Set β)) + {a₁ b₁ a₂ b₂ : β} (ha₁ : a₁ ∈ A) (hb₁ : b₁ ∈ A) (ha₂ : a₂ ∈ A) (hb₂ : b₂ ∈ A) + (hlt₁ : b₁ < a₁) (hlt₂ : b₂ < a₂) (heq : a₁ - b₁ = a₂ - b₂) : + a₁ = a₂ ∧ b₁ = b₂ := by + have hsum : a₁ + b₂ = a₂ + b₁ := by + calc + a₁ + b₂ = (a₁ - b₁ + b₁) + b₂ := by rw [tsub_add_cancel_of_le hlt₁.le] + _ = (a₂ - b₂ + b₂) + b₁ := by rw [heq]; ac_rfl + _ = a₂ + b₁ := by rw [tsub_add_cancel_of_le hlt₂.le] + rcases hS a₁ ha₁ a₂ ha₂ b₂ hb₂ b₁ hb₁ hsum with h | h + · exact ⟨h.1, h.2.symm⟩ + · exact (hlt₁.ne' h.1).elim /-- The maximum size of a Sidon set in the supplied `Finset`. -/ def maxSidonSubsetCard (A : Finset α) [DecidableEq α] : ℕ := diff --git a/FormalConjecturesForMathlib/Combinatorics/Digraph/Tournament.lean b/FormalConjecturesForMathlib/Combinatorics/Digraph/Tournament.lean index 3b87886..b092b93 100644 --- a/FormalConjecturesForMathlib/Combinatorics/Digraph/Tournament.lean +++ b/FormalConjecturesForMathlib/Combinatorics/Digraph/Tournament.lean @@ -20,7 +20,7 @@ public import Mathlib.Combinatorics.Digraph.Orientation public import Mathlib.Combinatorics.SimpleGraph.Basic public import Mathlib.Combinatorics.SimpleGraph.Finite public import Mathlib.Data.Fintype.Card -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic @[expose] public section diff --git a/FormalConjecturesForMathlib/Combinatorics/Enumerative/Partition/Basic.lean b/FormalConjecturesForMathlib/Combinatorics/Enumerative/Partition/Basic.lean new file mode 100644 index 0000000..64f1c6e --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/Enumerative/Partition/Basic.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. +-/ +module + +public import Mathlib.Combinatorics.Enumerative.Partition.Basic + +@[expose] public section + +namespace Nat + +def partitionNumber : ℕ → ℕ := fun n ↦ Fintype.card (Nat.Partition n) + +theorem partitionNumber_zero : partitionNumber 0 = 1 := by decide + +theorem partitionNumber_one : partitionNumber 1 = 1 := by decide + +-- TODO: shorter/faster proofs +/-- The only partitions of `2` are `2` and `1 + 1`. -/ +lemma Partition.partition_two_parts (p : Partition 2) : p.parts = {2} ∨ p.parts = {1, 1} := by + obtain ⟨s, hpos, hsum⟩ := p + induction s using Multiset.induction_on with + | empty => simp at hsum + | cons a s _ => + have hs : ∀ {i}, i ∈ s → 0 < i := fun hi ↦ hpos (Multiset.mem_cons_of_mem hi) + have ha : 0 < a := hpos (Multiset.mem_cons_self a s) + rw [Multiset.sum_cons] at hsum + obtain rfl | rfl : a = 1 ∨ a = 2 := by lia + · obtain rfl : s = {1} := partition_one_parts ⟨s, hs, by lia⟩ + exact .inr rfl + · obtain rfl : s = 0 := partition_zero_parts ⟨s, hs, by lia⟩ + exact .inl rfl + +theorem partitionNumber_two : partitionNumber 2 = 2 := by + rw [partitionNumber, Fintype.card, Finset.card_eq_two] + refine ⟨⟨{2}, by simp, rfl⟩, ⟨{1, 1}, by simp, rfl⟩, by simp [Partition.ext_iff], ?_⟩ + ext p + simpa [Partition.ext_iff] using p.partition_two_parts + +end Nat diff --git a/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Basic.lean b/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Basic.lean new file mode 100644 index 0000000..213f3c7 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Basic.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. +-/ +module + +public import Mathlib.Combinatorics.Hypergraph.Basic + +@[expose] public section + +/-! +# Uniformity and weak colorings of hypergraphs + +This file extends Mathlib's `Hypergraph` with finite-edge constructors, uniformity, +and weak proper colorings. Uniformity uses extended cardinality, so every edge is finite, +including at uniformity zero. Empty and singleton edges admit no weak proper coloring. +-/ + +namespace Hypergraph + +/-- Every edge has exactly `k` vertices. -/ +def IsUniform {V : Type*} (H : Hypergraph V) (k : ℕ) : Prop := + ∀ e ∈ H.edgeSet, e.encard = k + +/-- A weak proper coloring gives two vertices different colors in every edge. -/ +def IsProperColoring {V C : Type*} (H : Hypergraph V) (f : V → C) : Prop := + ∀ e ∈ H.edgeSet, ∃ u ∈ e, ∃ v ∈ e, f u ≠ f v + +/-- A weak proper coloring using at most `n` colors. -/ +def IsNColorable {V : Type*} (H : Hypergraph V) (n : ℕ) : Prop := + ∃ f : V → Fin n, H.IsProperColoring f + +/-- A family of finite edges on an explicit vertex set, retaining isolated vertices. -/ +def ofEdgeFamily {V : Type*} (F : Set (Finset V)) (S : Set V) + (h : ∀ e ∈ F, (e : Set V) ⊆ S) : Hypergraph V where + vertexSet := S + edgeSet := {e | ∃ a ∈ F, (a : Set V) = e} + subset_vertexSet_of_mem_edgeSet' := by + rintro e ⟨a, ha, rfl⟩ + exact h a ha + +@[simp] +theorem mem_edgeSet_ofEdgeFamily {V : Type*} {F : Set (Finset V)} {S : Set V} + {h : ∀ e ∈ F, (e : Set V) ⊆ S} {e : Finset V} : + (e : Set V) ∈ (ofEdgeFamily F S h).edgeSet ↔ e ∈ F := by + simp [ofEdgeFamily] + +@[simp] +theorem isUniform_ofEdgeFamily_iff {V : Type*} {F : Set (Finset V)} {S : Set V} + {h : ∀ e ∈ F, (e : Set V) ⊆ S} {k : ℕ} : + (ofEdgeFamily F S h).IsUniform k ↔ ∀ e ∈ F, e.card = k := by + simp [IsUniform, ofEdgeFamily] + +@[simp] +theorem isProperColoring_ofEdgeFamily_iff {V C : Type*} {F : Set (Finset V)} + {S : Set V} {h : ∀ e ∈ F, (e : Set V) ⊆ S} {f : V → C} : + (ofEdgeFamily F S h).IsProperColoring f ↔ + ∀ e ∈ F, ∃ u ∈ e, ∃ v ∈ e, f u ≠ f v := by + simp [IsProperColoring, ofEdgeFamily] + +/-- Every edge of a uniform hypergraph is finite. -/ +theorem IsUniform.finite_edge {V : Type*} {H : Hypergraph V} {k : ℕ} + (hH : H.IsUniform k) {e : Set V} (he : e ∈ H.edgeSet) : e.Finite := + Set.finite_of_encard_eq_coe (hH e he) + +/-- An injective coloring is proper when every edge has at least two vertices. -/ +theorem isProperColoring_of_injective {V C : Type*} {H : Hypergraph V} + (hH : ∀ e ∈ H.edgeSet, 2 ≤ e.encard) {f : V → C} + (hf : Function.Injective f) : H.IsProperColoring f := by + intro e he + obtain ⟨u, v, hu, hv, huv⟩ := Set.one_lt_encard_iff.mp + (lt_of_lt_of_le (by decide : (1 : ℕ∞) < 2) (hH e he)) + exact ⟨u, hu, v, hv, fun h ↦ huv (hf h)⟩ + +/-- An injective coloring is proper when uniformity is at least two. -/ +theorem IsUniform.isProperColoring_of_injective {V C : Type*} {H : Hypergraph V} + {k : ℕ} (hH : H.IsUniform k) (hk : 2 ≤ k) {f : V → C} + (hf : Function.Injective f) : H.IsProperColoring f := by + apply Hypergraph.isProperColoring_of_injective ?_ hf + intro e he + rw [hH e he] + exact_mod_cast hk + +end Hypergraph diff --git a/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Extremal.lean b/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Extremal.lean new file mode 100644 index 0000000..5a13ccf --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Extremal.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. +-/ +module + +public import FormalConjecturesForMathlib.Combinatorics.Hypergraph.Finite +public import Mathlib.Analysis.Asymptotics.Defs +public import Mathlib.Topology.Instances.ENNReal.Lemmas +public import Mathlib.Analysis.SpecialFunctions.Log.Basic + +@[expose] public section + +/-! +# Extremal parameters for hypergraphs + +Shared counting and local-to-global parameters for uniform hypergraphs, designs, transversals +and dense subgraphs. Finite extrema use all labeled edge families; isomorphic copies are not +counted separately when counting edges or block-size profiles. +-/ + +namespace Hypergraph + +open Filter + +/-- All `r`-uniform hypergraphs on `n` vertices with exactly `m` edges. -/ +def fixedSizeFamilies (n r m : ℕ) : Finset (Finset (Finset (Fin n))) := + ((Finset.univ : Finset (Fin n)).powersetCard r).powersetCard m + +open scoped Classical in +/-- Probability of a matching in a uniformly chosen fixed-size edge family. +This is the cardinality of the event divided by that of the finite sample space; it is zero +when `m` exceeds the number of possible edges. -/ +noncomputable def matchingProbability (n r m k : ℕ) : ℝ := + ((fixedSizeFamilies n r m).filter (fun H ↦ H.HasHypergraphMatching k)).card / + ((fixedSizeFamilies n r m).card : ℝ) + +open scoped Classical in +/-- Smallest independence number of a linear three-uniform hypergraph on `n` vertices. -/ +noncomputable def linearIndependenceNumber (n : ℕ) : ℕ := + n - ((((Finset.univ : Finset (Fin n)).powersetCard 3).powerset.filter + Finset.IsLinearHypergraph).sup fun H ↦ n - H.hypergraphIndependenceNumber) + +/-- Maximum global transversal size under a local vertex-set constraint. +Infinity records that no finite bound works. -/ +noncomputable def localTransversalBound (r v a : ℕ) : ℕ∞ := + ⨅ (b : ℕ) (_ : ∀ (n : ℕ) (H : Finset (Finset (Fin n))), H.IsUniform r → + (∀ S : Finset (Fin n), S.card ≤ v → + (H.hypergraphInduce S : Set (Finset (Fin n))).HasFiniteTransversal a) → + (H : Set (Finset (Fin n))).HasFiniteTransversal b), (b : ℕ∞) + +/-- Global transversal bound for a uniform family whose small subfamilies have small +transversals. Subfamilies with fewer than `q` edges are included. -/ +noncomputable def subfamilyTransversalBound (k q a : ℕ) : ℕ∞ := + ⨅ (b : ℕ) (_ : ∀ (V : Type) (F : Set (Finset V)), + (∀ e ∈ F, e.card = k) → + (∀ E : Finset (Finset V), (↑E : Set _) ⊆ F → E.card ≤ q → + (E : Set (Finset V)).HasFiniteTransversal a) → F.HasFiniteTransversal b), (b : ℕ∞) + +/-- Least number of edges in an intersecting `r`-uniform family with transversal size `r`. +Infinity records a missing witness. -/ +noncomputable def minIntersectingEdges (r : ℕ) : ℕ∞ := + ⨅ (n : ℕ) (H : Finset (Finset (Fin n))) (_ : H.IsUniform r) + (_ : (H : Set (Finset (Fin n))).Intersecting) + (_ : (H : Set (Finset (Fin n))).HasFiniteTransversal r) + (_ : ¬ (H : Set (Finset (Fin n))).HasFiniteTransversal (r - 1)), (H.card : ℕ∞) + +/-- Least vertex count forcing the Brown--Erdős--Sós little-o conclusion. +Infinity records the absence of a finite threshold. -/ +noncomputable def sparseConfigurationThreshold (r e : ℕ) : ℕ∞ := + ⨅ (v : ℕ) (_ : (fun n ↦ (configurationExtremalNumber n r v e : ℝ)) + =o[atTop] (fun n ↦ (n : ℝ) ^ 2)), (v : ℕ∞) + +/-- Edge density normalized by the number of possible uniform edges. -/ +noncomputable def edgeDensity {n : ℕ} (r : ℕ) (H : Finset (Finset (Fin n))) : ℝ := + (H.card : ℝ) / n.choose r + +/-- A density increase on growing induced vertex sets for every growing host sequence. +The boolean chooses the strict or weak lower bound at the initial density. -/ +def HasDensityJump (r : ℕ) (α β : ℝ) (strict : Bool) : Prop := + ∀ (v : ℕ → ℕ), Tendsto v atTop atTop → + ∀ G : (n : ℕ) → Finset (Finset (Fin (v n))), + (∀ n, (G n).IsUniform r) → + (if strict then α < atTop.liminf (fun n ↦ edgeDensity r (G n)) + else α ≤ atTop.liminf (fun n ↦ edgeDensity r (G n))) → + ∃ S : (n : ℕ) → Finset (Fin (v n)), + Tendsto (fun n ↦ (S n).card) atTop atTop ∧ + β < atTop.liminf (fun n ↦ ((G n).hypergraphInduce (S n)).card / + ((S n).card.choose r : ℝ)) + +open scoped Classical in +/-- The least size above which a coloring gives both colors a positive share of every +induced complete uniform hypergraph. Positivity at `α = 0` retains the Ramsey convention. -/ +noncomputable def balancedColoringThreshold (n r : ℕ) (α : ℝ) : ℕ := + sInf {m | ∃ c : Finset (Fin n) → Bool, ∀ X : Finset (Fin n), m ≤ X.card → + ∀ b : Bool, let count := ((X.powersetCard r).filter (fun e ↦ c e = b)).card + 0 < count ∧ α * (X.card.choose r : ℝ) ≤ count} + +end Hypergraph diff --git a/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Finite.lean b/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Finite.lean new file mode 100644 index 0000000..53e331a --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Finite.lean @@ -0,0 +1,210 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesForMathlib.Combinatorics.Hypergraph.Basic +public import Mathlib.Combinatorics.SetFamily.Intersecting +public import Mathlib.Data.Finset.Powerset +public import Mathlib.Data.Finset.Sort +public import Mathlib.Data.ENat.Lattice +public import FormalConjecturesForMathlib.Combinatorics.SetFamily.PropertyB + +@[expose] public section + +/-! +# Finite hypergraphs and block designs + +Finite hypergraphs are finite families of finite vertex sets. This file supplies uniformity, +weak vertex coloring, independent sets, transversals, designs, and finite extremal counts. +`Finset.toHypergraph` connects this presentation to Mathlib's `Hypergraph`. + +The ground type includes isolated vertices. The support is `H.biUnion id` when only incident +vertices should be counted. Colorings require two differently colored vertices in every edge; +empty and singleton edges therefore admit no proper coloring. +-/ + +namespace Set + +/-- A family of finite sets has a transversal with at most `k` vertices. -/ +def HasFiniteTransversal {V : Type*} (F : Set (Finset V)) (k : ℕ) : Prop := + ∃ S : Finset V, S.card ≤ k ∧ ∀ e ∈ F, ∃ v ∈ S, v ∈ e + +end Set + +namespace Finset + +variable {V : Type*} [DecidableEq V] + +/-- Every edge has exactly `r` vertices. -/ +def IsUniform (H : Finset (Finset V)) (r : ℕ) : Prop := ∀ e ∈ H, e.card = r + +/-- The hypergraph with edge family `H` and ground vertex set `S`. -/ +def toHypergraph (H : Finset (Finset V)) (S : Finset V) (h : ∀ e ∈ H, e ⊆ S) : + Hypergraph V := + Hypergraph.ofEdgeFamily (H : Set (Finset V)) S h + +omit [DecidableEq V] in +/-- Conversion preserves uniformity. -/ +@[simp] +theorem isUniform_toHypergraph_iff (H : Finset (Finset V)) (S : Finset V) + (h : ∀ e ∈ H, e ⊆ S) (r : ℕ) : + (H.toHypergraph S h).IsUniform r ↔ H.IsUniform r := by + exact Hypergraph.isUniform_ofEdgeFamily_iff + +/-- A weak proper coloring has no monochromatic edge. -/ +def IsProperHypergraphColoring (H : Finset (Finset V)) {C : Type*} (c : V → C) : Prop := + ∀ e ∈ H, ∃ x ∈ e, ∃ y ∈ e, c x ≠ c y + +omit [DecidableEq V] in +/-- Conversion preserves weak proper colorings. -/ +@[simp] +theorem isProperColoring_toHypergraph_iff {C : Type*} (H : Finset (Finset V)) + (S : Finset V) (h : ∀ e ∈ H, e ⊆ S) (f : V → C) : + (H.toHypergraph S h).IsProperColoring f ↔ H.IsProperHypergraphColoring f := by + exact Hypergraph.isProperColoring_ofEdgeFamily_iff + +/-- The edge family admits a weak proper coloring with `k` colors. -/ +def HypergraphColorable (H : Finset (Finset V)) (k : ℕ) : Prop := + ∃ c : V → Fin k, H.IsProperHypergraphColoring c + +omit [DecidableEq V] in +/-- Two-colorability agrees with the existing Property B predicate. -/ +theorem hypergraphColorable_two_iff (H : Finset (Finset V)) : + H.HypergraphColorable 2 ↔ H.HasPropertyB := Iff.rfl + +/-- The weak chromatic number is exactly `k`. -/ +def HasHypergraphChromaticNumber (H : Finset (Finset V)) (k : ℕ) : Prop := + H.HypergraphColorable k ∧ ∀ j < k, ¬ H.HypergraphColorable j + +/-- No edge is contained in this set of vertices. -/ +def IsHypergraphIndependent (H : Finset (Finset V)) (S : Finset V) : Prop := + ∀ e ∈ H, ¬ e ⊆ S + +/-- The number of hyperedges containing a vertex. -/ +def hypergraphDegree (H : Finset (Finset V)) (v : V) : ℕ := #{e ∈ H | v ∈ e} + +/-- Distinct edges intersect in at most one vertex. -/ +def IsLinearHypergraph (H : Finset (Finset V)) : Prop := + (H : Set (Finset V)).Pairwise fun e f ↦ (e ∩ f).card ≤ 1 + +/-- Some `m` vertices span at least `k` edges. -/ +def ContainsSubgraph (H : Finset (Finset V)) (m k : ℕ) : Prop := + ∃ S : Finset V, S.card = m ∧ k ≤ #{e ∈ H | e ⊆ S} + +/-- The edges induced on a vertex set. -/ +def hypergraphInduce (H : Finset (Finset V)) (S : Finset V) : Finset (Finset V) := + H.filter (· ⊆ S) + +/-- A copy of the complete `r`-uniform hypergraph on `k` vertices. -/ +def ContainsCompleteHypergraph (H : Finset (Finset V)) (r k : ℕ) : Prop := + ∃ S : Finset V, S.card = k ∧ S.powersetCard r ⊆ H + +/-- A collection of `k` pairwise vertex-disjoint edges. -/ +def HasHypergraphMatching (H : Finset (Finset V)) (k : ℕ) : Prop := + ∃ M ⊆ H, M.card = k ∧ (M : Set (Finset V)).Pairwise Disjoint + +/-- Every `t`-set of ground vertices lies in exactly one block. -/ +def IsBlockDesign (H : Finset (Finset V)) (t k : ℕ) : Prop := + H.IsUniform k ∧ ∀ S : Finset V, S.card = t → ∃! e, e ∈ H ∧ S ⊆ e + +/-- A pairwise balanced design, permitting a block equal to the ground set. -/ +def IsPairwiseBalancedDesign (H : Finset (Finset V)) : Prop := + (∀ e ∈ H, 2 ≤ e.card) ∧ + ∀ S : Finset V, S.card = 2 → ∃! e, e ∈ H ∧ S ⊆ e + +/-- The nondecreasing block-size sequence, retaining repeated sizes. -/ +def blockSizeProfile (H : Finset (Finset V)) : List ℕ := + (H.val.map Finset.card).sort (· ≤ ·) + +/-- Partition into complete `r`-graphs with either `r` or `r+1` vertices. -/ +def IsCompleteHypergraphDecomposition (H : Finset (Finset V)) (r : ℕ) + (D : Finset (Finset V)) : Prop := + (∀ S ∈ D, S.card = r ∨ S.card = r + 1) ∧ + H = D.biUnion (fun S ↦ S.powersetCard r) ∧ + (D : Set (Finset V)).Pairwise fun S T ↦ Disjoint (S.powersetCard r) (T.powersetCard r) + +/-- A complete `t`-partite `t`-uniform hypergraph with `r` vertices in each part. -/ +def ContainsCompletePartiteHypergraph (H : Finset (Finset V)) (t r : ℕ) : Prop := + ∃ f : Fin t × Fin r ↪ V, ∀ a : Fin t → Fin r, + (Finset.univ.image fun i ↦ f (i, a i)) ∈ H + +/-- Two distinct disjoint pairs of edges with the same union. -/ +def HasRepeatedDisjointUnion (H : Finset (Finset V)) : Prop := + ∃ A ∈ H, ∃ B ∈ H, ∃ C ∈ H, ∃ D ∈ H, + Disjoint A B ∧ Disjoint C D ∧ A ∪ B = C ∪ D ∧ + A ≠ B ∧ C ≠ D ∧ A ≠ C ∧ A ≠ D ∧ B ≠ C ∧ B ≠ D + +omit [DecidableEq V] in +@[simp] theorem isUniform_empty (r : ℕ) : (∅ : Finset (Finset V)).IsUniform r := by + simp [IsUniform] + +/-- The cardinal bound in `ContainsSubgraph` counts edges, not copies with labels. -/ +theorem containsSubgraph_iff (H : Finset (Finset V)) (m k : ℕ) : + H.ContainsSubgraph m k ↔ ∃ S : Finset V, + S.card = m ∧ k ≤ (H.hypergraphInduce S).card := Iff.rfl + +omit [DecidableEq V] in +/-- A singleton edge prevents any weak proper coloring. -/ +theorem not_colorable_singleton (v : V) (k : ℕ) : + ¬ ({ {v} } : Finset (Finset V)).HypergraphColorable k := by + rintro ⟨c, hc⟩ + simp [IsProperHypergraphColoring] at hc + +open scoped Classical in +/-- The largest cardinality of an independent vertex set in a finite ground type. -/ +noncomputable def hypergraphIndependenceNumber [Fintype V] (H : Finset (Finset V)) : ℕ := + ((Finset.univ : Finset V).powerset.filter H.IsHypergraphIndependent).sup Finset.card + +open scoped Classical in +/-- Subsets of the incident vertices witnessing Property B. -/ +noncomputable def propertyBWitnesses (H : Finset (Finset V)) : Finset (Finset V) := + (H.biUnion id).powerset.filter fun B ↦ + (∀ e ∈ H, (e ∩ B).Nonempty) ∧ H.IsHypergraphIndependent B + +end Finset + +namespace Hypergraph + +open scoped Classical in +/-- Maximum number of edges among `r`-uniform families satisfying `P` on `n` labeled vertices. +The value is zero if no family is admissible. -/ +noncomputable def extremalNumber (n r : ℕ) (P : Finset (Finset (Fin n)) → Prop) : ℕ := + (((Finset.univ : Finset (Fin n)).powersetCard r).powerset.filter P).sup Finset.card + +/-- The extremal number forbidding a complete uniform hypergraph. -/ +noncomputable def cliqueExtremalNumber (n r k : ℕ) : ℕ := + extremalNumber n r fun H ↦ ¬ H.ContainsCompleteHypergraph r k + +/-- The extremal number forbidding `e` edges on `v` vertices (not necessarily induced). -/ +noncomputable def configurationExtremalNumber (n r v e : ℕ) : ℕ := + extremalNumber n r fun H ↦ ¬ H.ContainsSubgraph v e + +/-- The extremal number forbidding a complete balanced multipartite uniform hypergraph. -/ +noncomputable def partiteExtremalNumber (n t r : ℕ) : ℕ := + extremalNumber n t fun H ↦ ¬ H.ContainsCompletePartiteHypergraph t r + +/-- Minimum edge count for chromatic number `k`, with infinity when no such graph exists. -/ +noncomputable def minChromaticEdges (r k : ℕ) : ℕ∞ := + ⨅ (n : ℕ) (H : Finset (Finset (Fin n))) (_ : H.IsUniform r) + (_ : H.HasHypergraphChromaticNumber k), (H.card : ℕ∞) + +open scoped Classical in +/-- All block-size sequences of pairwise balanced designs on `n` labeled vertices. -/ +noncomputable def blockSizeProfiles (n : ℕ) : Finset (List ℕ) := + (((Finset.univ : Finset (Fin n)).powerset.powerset).filter + Finset.IsPairwiseBalancedDesign).image Finset.blockSizeProfile + +end Hypergraph diff --git a/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Uniform.lean b/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Uniform.lean new file mode 100644 index 0000000..f59fb11 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/Hypergraph/Uniform.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. +-/ +module + +public import FormalConjecturesForMathlib.Combinatorics.Hypergraph.Finite +public import Mathlib.SetTheory.Cardinal.Basic +public import Mathlib.SetTheory.Cardinal.Ordinal + +@[expose] public section + +/-! +# Uniform hypergraphs + +A `UniformHypergraph V k` extends Mathlib's `Hypergraph V` with uniformity `k` +and vertex set `Set.univ`. The vertex type includes isolated vertices. +Finite edge families use `Finset.IsUniform`; +`UniformHypergraph.ofFinset` converts them to this presentation. + +The API includes complete subgraphs, maximal clique sizes, weak colorings, embeddings, +and chromatic cardinals. The chromatic cardinal is zero when no proper coloring exists. +Empty and singleton edges admit no weak proper coloring. +-/ + +open Cardinal Set + +universe u + +/-- A uniform Mathlib hypergraph whose vertex set is the entire ambient type. -/ +structure UniformHypergraph (V : Type*) (k : ℕ) extends Hypergraph V where + /-- All elements of the vertex type are vertices, including isolated ones. -/ + vertexSet_eq_univ : vertexSet = Set.univ + /-- Every hyperedge has exactly `k` vertices. -/ + uniform : toHypergraph.IsUniform k + +namespace UniformHypergraph + +variable {k : ℕ} + +/-- A finite uniform edge family viewed as a uniform hypergraph. -/ +def ofFinset {V : Type*} (H : Finset (Finset V)) (hH : H.IsUniform k) : + UniformHypergraph V k where + toHypergraph := Hypergraph.ofEdgeFamily (H : Set (Finset V)) Set.univ + (fun _ _ ↦ Set.subset_univ _) + vertexSet_eq_univ := rfl + uniform := Hypergraph.isUniform_ofEdgeFamily_iff.mpr hH + +@[simp] +theorem mem_edgeSet_ofFinset {V : Type*} {H : Finset (Finset V)} {hH : H.IsUniform k} + {e : Finset V} : (e : Set V) ∈ (ofFinset H hH).edgeSet ↔ e ∈ H := + Hypergraph.mem_edgeSet_ofEdgeFamily (h := fun _ _ ↦ Set.subset_univ _) + +/-- Every `k`-element subset of `S` is an edge. -/ +def IsCompleteOn {V : Type*} (H : UniformHypergraph V k) (S : Finset V) : Prop := + ∀ e : Finset V, e ⊆ S → e.card = k → (e : Set V) ∈ H.edgeSet + +/-- The sizes of the finite maximal complete subgraphs. -/ +def cliqueSizes {V : Type*} (H : UniformHypergraph V k) : Set ℕ := + { n | ∃ S : Finset V, Maximal (IsCompleteOn H) S ∧ S.card = n } + +/-- Weak proper coloring of the underlying Mathlib hypergraph. -/ +abbrev IsProperColoring {V : Type*} (H : UniformHypergraph V k) {C : Type*} + (f : V → C) : Prop := + H.toHypergraph.IsProperColoring f + +/-- An injective coloring is proper when every edge has at least two vertices. -/ +theorem isProperColoring_of_injective {V C : Type*} (H : UniformHypergraph V k) + (hk : 2 ≤ k) {f : V → C} (hf : Function.Injective f) : H.IsProperColoring f := + H.uniform.isProperColoring_of_injective hk hf + +/-- The finite and possibly infinite presentations have the same proper colorings. -/ +theorem isProperColoring_ofFinset_iff {V C : Type*} (H : Finset (Finset V)) + (hH : H.IsUniform k) (f : V → C) : + (ofFinset H hH).IsProperColoring f ↔ H.IsProperHypergraphColoring f := by + exact Hypergraph.isProperColoring_ofEdgeFamily_iff (h := fun _ _ ↦ Set.subset_univ _) + +/-- The infimum of cardinalities of color types admitting a proper coloring. +The value is zero when no proper coloring exists. -/ +noncomputable def chromaticCardinal {V : Type u} (H : UniformHypergraph V k) : Cardinal.{u} := + sInf {κ : Cardinal.{u} | ∃ (C : Type u), #C = κ ∧ ∃ f : V → C, H.IsProperColoring f} + +/-- A proper coloring bounds the chromatic cardinal by the number of colors. -/ +theorem chromaticCardinal_le {V C : Type u} (H : UniformHypergraph V k) + {f : V → C} (hf : H.IsProperColoring f) : H.chromaticCardinal ≤ #C := + csInf_le' ⟨C, rfl, f, hf⟩ + +/-- The vertex type itself always supplies enough colors when `2 ≤ k`. -/ +theorem chromaticCardinal_le_mk {V : Type u} (H : UniformHypergraph V k) (hk : 2 ≤ k) : + H.chromaticCardinal ≤ #V := + H.chromaticCardinal_le (H.isProperColoring_of_injective hk Function.injective_id) + +/-- An injective vertex map carrying every edge of `F` to an edge of `H`. -/ +def Appears {W V : Type*} (F : UniformHypergraph W k) + (H : UniformHypergraph V k) : Prop := + ∃ φ : W → V, Function.Injective φ ∧ + (F.toHypergraph.image φ).edgeSet ⊆ H.edgeSet + +/-- Appearance is transitive under composition of injective vertex maps. -/ +theorem Appears.trans {U W V : Type*} {F : UniformHypergraph U k} + {G : UniformHypergraph W k} {H : UniformHypergraph V k} + (hFG : F.Appears G) (hGH : G.Appears H) : F.Appears H := by + obtain ⟨f, hf, hF⟩ := hFG + obtain ⟨g, hg, hG⟩ := hGH + refine ⟨g ∘ f, hg.comp hf, ?_⟩ + rw [← Hypergraph.image_image] + exact (Set.image_mono hF).trans hG + +/-- A weak proper coloring using at most `n` colors. -/ +abbrev IsNColorable {V : Type*} (F : UniformHypergraph V k) (n : ℕ) : Prop := + F.toHypergraph.IsNColorable n + +/-- Some hypergraph of the same uniformity and chromatic cardinal `κ` omits `F`. -/ +def HasAvoidingChromaticCardinal {W : Type u} (F : UniformHypergraph W k) + (κ : Cardinal.{u}) : Prop := + ∃ (V : Type u) (_ : DecidableEq V) (H : UniformHypergraph V k), + H.chromaticCardinal = κ ∧ ¬ F.Appears H + +/-- A finite uniform hypergraph is obligatory if it appears in every hypergraph of +that uniformity whose chromatic cardinal exceeds `ℵ₀`. -/ +def IsObligatory {W : Type u} [Fintype W] (F : UniformHypergraph W k) : Prop := + ∀ (V : Type u) [DecidableEq V] (H : UniformHypergraph V k), + ℵ₀ < H.chromaticCardinal → F.Appears H + +end UniformHypergraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SetFamily/PropertyB.lean b/FormalConjecturesForMathlib/Combinatorics/SetFamily/PropertyB.lean index 45a5695..2332f75 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SetFamily/PropertyB.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SetFamily/PropertyB.lean @@ -25,8 +25,8 @@ public import Mathlib.Data.Fin.Basic # Property B A family of sets has *property B* when the ground set admits a 2-colouring under which no member -of the family is monochromatic. For 3-uniform hypergraphs this is -`ThreeUniformHypergraph.IsTwoColorable`. +of the family is monochromatic. For uniform hypergraphs this is +`UniformHypergraph.IsNColorable H 2`. -/ namespace Finset diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Balanced.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Balanced.lean index 422ba22..1f5c914 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Balanced.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Balanced.lean @@ -16,7 +16,7 @@ limitations under the License. module public import Mathlib.Combinatorics.SimpleGraph.Finite -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic @[expose] public section diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Boundary.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Boundary.lean new file mode 100644 index 0000000..0a94b29 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Boundary.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. +-/ +module + +public import Mathlib.Combinatorics.SimpleGraph.Basic +public import Mathlib.Data.Finset.Prod + +/-! +# Boundaries in finite graphs + +The edge boundary consists of edges directed from a vertex set to its complement. The inner +vertex boundary consists of the vertices in the set that have a neighbor outside it. +-/ + +@[expose] public section + +namespace SimpleGraph + +open scoped Finset + +variable {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] + +/-- The edge boundary of $A$, with each crossing edge oriented from $A$ to its complement. +Each undirected crossing edge occurs exactly once. -/ +def edgeBoundary (A : Finset V) : Finset (V × V) := + {p ∈ A ×ˢ Aᶜ | G.Adj p.1 p.2} + +/-- The inner vertex boundary of $A$: vertices in $A$ with a neighbor outside $A$. -/ +def innerVertexBoundary (A : Finset V) : Finset V := + {v ∈ A | ∃ w ∉ A, G.Adj v w} + +@[simp] +theorem edgeBoundary_empty : G.edgeBoundary ∅ = ∅ := by + simp [edgeBoundary] + +@[simp] +theorem edgeBoundary_univ : G.edgeBoundary Finset.univ = ∅ := by + simp [edgeBoundary] + +@[simp] +theorem innerVertexBoundary_empty : G.innerVertexBoundary ∅ = ∅ := by + simp [innerVertexBoundary] + +@[simp] +theorem innerVertexBoundary_univ : G.innerVertexBoundary Finset.univ = ∅ := by + simp [innerVertexBoundary] + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Chordal.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Chordal.lean new file mode 100644 index 0000000..c3fe9c5 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Chordal.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. +-/ +module + +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Combinatorics.SimpleGraph.CycleGraph +public import Mathlib.Tactic.Abel + +/-! +# Chordal graphs and clique edge partitions + +Definitions and basic results used in [Erdős Problem 81](https://www.erdosproblems.com/81). +-/ + +@[expose] public section + +namespace SimpleGraph + +variable {V : Type*} + +/-- A graph is *chordal* if it contains no induced cycle of length `k ≥ 4`. -/ +def IsChordal (G : SimpleGraph V) : Prop := + ∀ k : ℕ, 4 ≤ k → ¬ (cycleGraph k).IsIndContained G + +/-- `P` is a partition of the edges of `G` into cliques: each member of `P` is a clique +of `G` with at least two vertices, and every edge of `G` is contained in exactly one +member of `P`. -/ +def IsCliqueEdgePartition (G : SimpleGraph V) (P : Finset (Finset V)) : Prop := + (∀ s ∈ P, 2 ≤ s.card ∧ G.IsClique (s : Set V)) ∧ + ∀ u v : V, G.Adj u v → ∃! s, s ∈ P ∧ u ∈ s ∧ v ∈ s + +/-- A graph is a *split graph* if its vertex set splits into a clique and an +independent set. -/ +def IsSplitGraph (G : SimpleGraph V) : Prop := + ∃ S : Set V, G.IsClique S ∧ G.IsIndepSet Sᶜ + +/-- Every finite graph has a clique edge partition consisting of its edges. -/ +theorem exists_isCliqueEdgePartition_card_eq {V : Type*} [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] : + ∃ P : Finset (Finset V), G.IsCliqueEdgePartition P ∧ P.card = G.edgeFinset.card := by + refine ⟨G.edgeFinset.image Sym2.toFinset, ⟨?_, ?_⟩, ?_⟩ + · simp only [Finset.mem_image, mem_edgeFinset] + rintro s ⟨e, he, rfl⟩ + induction e using Sym2.ind with + | h a b => + rw [mem_edgeSet] at he + rw [Sym2.toFinset_mk_eq, Finset.card_pair he.ne, Finset.coe_pair] + exact ⟨le_rfl, isClique_pair.mpr (fun _ => he)⟩ + · intro u v huv + refine ⟨s(u, v).toFinset, + ⟨Finset.mem_image.mpr ⟨s(u, v), by simpa using huv, rfl⟩, by simp, by simp⟩, ?_⟩ + rintro s ⟨hs, hu, hv⟩ + obtain ⟨e, -, rfl⟩ := Finset.mem_image.mp hs + rw [Sym2.mem_toFinset] at hu hv + rw [(Sym2.mem_and_mem_iff huv.ne).mp ⟨hu, hv⟩] + · apply Finset.card_image_of_injOn + intro e he e' _ h + simp only [mem_edgeFinset, Finset.mem_coe] at he + induction e using Sym2.ind with + | h a b => + have hab := (mem_edgeSet G).mp he + have ha : a ∈ e'.toFinset := by rw [← h]; simp + have hb : b ∈ e'.toFinset := by rw [← h]; simp + rw [Sym2.mem_toFinset] at ha hb + exact ((Sym2.mem_and_mem_iff hab.ne).mp ⟨ha, hb⟩).symm + +private lemma cycleGraph_adj_succ (m : ℕ) (a : Fin (m + 4)) : (cycleGraph (m + 4)).Adj a (a + 1) := + (cycleGraph_adj (n := m + 2)).mpr (Or.inr (by simp)) + +private lemma cycleGraph_not_adj_add_two (m : ℕ) (a : Fin (m + 4)) : + a ≠ a + 1 + 1 ∧ ¬ (cycleGraph (m + 4)).Adj a (a + 1 + 1) := by + have key : (1 + 1 : Fin (m + 4)) ≠ 1 ∧ (1 + 1 : Fin (m + 4)) ≠ 0 ∧ + (-(1 + 1) : Fin (m + 4)) ≠ 1 := by + refine ⟨?_, ?_, ?_⟩ <;> intro h <;> rw [Fin.ext_iff] at h + · simp [Fin.val_add, Nat.mod_eq_of_lt] at h + · simp [Fin.val_add, Nat.mod_eq_of_lt] at h + · rw [Fin.val_neg'] at h + simp [Fin.val_add, Nat.mod_eq_of_lt] at h + refine ⟨fun h => ?_, fun h => ?_⟩ + · have := congrArg (fun x => x - a) h + simp only [sub_self] at this + exact key.2.1 (by rw [this]; abel) + · rcases (cycleGraph_adj (n := m + 2)).mp h with h | h + · exact key.2.2 (by rw [show -(1 + 1 : Fin (m + 4)) = a - (a + 1 + 1) by abel]; exact h) + · exact key.1 (by rw [show (1 + 1 : Fin (m + 4)) = a + 1 + 1 - a by abel]; exact h) + +/-- Every split graph is chordal. -/ +theorem IsSplitGraph.isChordal {V : Type*} {G : SimpleGraph V} (hG : G.IsSplitGraph) : + G.IsChordal := by + obtain ⟨S, hS, hI⟩ := hG + intro k hk ⟨f⟩ + obtain ⟨m, rfl⟩ := Nat.exists_eq_add_of_le' hk + have noK : ∀ a, f a ∈ S → f (a + 1 + 1) ∈ S → False := fun a ha hb => by + obtain ⟨hne, hna⟩ := cycleGraph_not_adj_add_two m a + exact hna (f.map_adj_iff.mp (hS ha hb (f.injective.ne hne))) + have noI : ∀ a, f a ∉ S → f (a + 1) ∉ S → False := fun a ha hb => by + have h := f.map_adj_iff.mpr (cycleGraph_adj_succ m a) + exact hI ha hb h.ne h + by_cases h1 : f (0 + 1) ∈ S + · have h3 : f (0 + 1 + 1 + 1) ∉ S := fun h => noK _ h1 h + have h2 : f (0 + 1 + 1) ∈ S := by_contra fun h => noI _ h h3 + have h4 : f (0 + 1 + 1 + 1 + 1) ∈ S := by_contra fun h => noI _ h3 h + exact noK _ h2 h4 + · have h0 : f 0 ∈ S := by_contra fun h => noI _ h h1 + have h2 : f (0 + 1 + 1) ∈ S := by_contra fun h => noI _ h1 h + exact noK _ h0 h2 + +/-- The empty family partitions the edges of an edgeless graph. -/ +@[simp] theorem isCliqueEdgePartition_bot_empty : + (⊥ : SimpleGraph V).IsCliqueEdgePartition ∅ := by + simp [IsCliqueEdgePartition] + +/-- An edgeless graph is split, including when its vertex type is empty. -/ +theorem isSplitGraph_bot : (⊥ : SimpleGraph V).IsSplitGraph := by + exact ⟨∅, by simp, by simp [IsIndepSet, Set.Pairwise]⟩ + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Circumference.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Circumference.lean index a953df5..08b5da1 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Circumference.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Circumference.lean @@ -15,17 +15,28 @@ limitations under the License. -/ module +public import Mathlib.Algebra.Ring.Parity public import Mathlib.Combinatorics.SimpleGraph.Paths public import Mathlib.Order.Lattice.Nat @[expose] public section +/-! +# Cycle lengths and circumference + +The cycle lengths and the longest cycle length of a graph. +-/ + namespace SimpleGraph /-- `G.cycleLengths` is the set of lengths of the cycles in `G`. -/ def cycleLengths {α : Type*} (G : SimpleGraph α) : Set ℕ := {m | ∃ (a : α) (w : G.Walk a a), w.IsCycle ∧ w.length = m} +/-- `G.oddCycleLengths` is the set of lengths of odd cycles in `G`. -/ +def oddCycleLengths {α : Type*} (G : SimpleGraph α) : Set ℕ := + {m ∈ G.cycleLengths | Odd m} + variable {α : Type*} [Fintype α] [DecidableEq α] /-- `circumference G` is the length of the longest cycle in `G`. diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring/List.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring/List.lean new file mode 100644 index 0000000..9b3cde7 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring/List.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. +-/ +module + +public import Mathlib.Combinatorics.SimpleGraph.Coloring.Vertex +public import Mathlib.Order.Lattice.Nat + +@[expose] public section + +/-! +# List colourings + +`IsKChoosable G k` says that `G` is $k$-choosable, and `listChromaticNumber G` is the list +chromatic number (choice number) $\chi_L(G)$ of Erdős, Rubin and Taylor. + +## References + +* P. Erdős, A. L. Rubin and H. Taylor, *Choosability in graphs*. Proceedings of the West Coast + Conference on Combinatorics, Graph Theory and Computing (1979), Congress. Numer. XXVI (1980), + 125-157. +-/ + +namespace SimpleGraph + +/-- +A graph $G$ is $k$-choosable if 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. +-/ +def IsKChoosable {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∀ L : V → Finset ℕ, (∀ v, (L v).card = k) → ∃ C : G.Coloring ℕ, ∀ v, C v ∈ L v + +/-- +The list chromatic number $\chi_L(G)$, defined to be the minimal $k$ such that $G$ is +$k$-choosable. It is `0` if $G$ is not $k$-choosable for any $k$, which can only happen for an +infinite graph. +-/ +noncomputable def listChromaticNumber {V : Type*} (G : SimpleGraph V) : ℕ := + sInf {k : ℕ | IsKChoosable G k} + +/-- A $k$-choosable graph is $k$-colourable: give every vertex the list $\{0, \ldots, k-1\}$. -/ +theorem IsKChoosable.colorable {V : Type*} {G : SimpleGraph V} {k : ℕ} (h : G.IsKChoosable k) : + G.Colorable k := by + obtain ⟨C, hC⟩ := h (fun _ => Finset.range k) (fun _ => Finset.card_range k) + exact ⟨Coloring.mk (fun v => ⟨C v, Finset.mem_range.1 (hC v)⟩) + fun hab heq => C.valid hab (congrArg Fin.val heq)⟩ + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring/Vertex.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring/Vertex.lean index 10d4d93..8d97ae8 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring/Vertex.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring/Vertex.lean @@ -18,6 +18,7 @@ module public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Clique public import Mathlib.Data.NNRat.Floor public import Mathlib.Combinatorics.Enumerative.DoubleCounting +public import Mathlib.Combinatorics.SimpleGraph.Coloring.EdgeLabeling public import Mathlib.Combinatorics.SimpleGraph.Coloring.Vertex public import Mathlib.Data.Set.Card @@ -142,13 +143,17 @@ def CDSColorable [Fintype α] (G : SimpleGraph α) : Prop := ∃ (C : G.Coloring Nat), ∀ k : Nat, ∑ i < k, (C.colorClass i).ncard = indepNumK G k -/-- A homomorphism is rainbow if it maps distinct edges to distinct colors. -/ -def IsRainbow {α V : Type*} {H : SimpleGraph α} {G : SimpleGraph V} (f : H →g G) {C : Type*} - (c : Sym2 V → C) : Prop := - Function.Injective fun e : H.edgeSet => c (Sym2.map f e) +/-- A homomorphism `f : H →g G` is rainbow for an edge labeling `c` of `G` if it maps distinct +edges of `H` to edges of `G` with distinct labels. -/ +def IsRainbow {α V K : Type*} {H : SimpleGraph α} {G : SimpleGraph V} (f : H →g G) + (c : G.EdgeLabeling K) : Prop := + Function.Injective (c.pullback f) /-- -The anti-Ramsey number $\mathrm{AR}(n, H)$: maximum colors to edge-color $K_n$ without rainbow $H$. +The anti-Ramsey number $\mathrm{AR}(n, H)$: the maximum number of colors in an edge coloring of +$K_n$ (that is, a labeling of the edges of $K_n$ using every color) that contains no rainbow copy +of $H$, i.e. no injective homomorphism (copy) of $H$ whose edges all receive different colors. -/ noncomputable def antiRamseyNum {α : Type*} [Fintype α] (H : SimpleGraph α) (n : ℕ) : ℕ := - sSup {k | ∃ c : Sym2 (Fin n) → Fin k, Function.Surjective c ∧ ∀ f : H →g ⊤, ¬IsRainbow f c} + sSup {k | ∃ c : TopEdgeLabeling (Fin n) (Fin k), Function.Surjective c ∧ + ∀ f : H.Copy ⊤, ¬IsRainbow f.toHom c} diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Connectivity.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Connectivity.lean index 6019abf..8f03739 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Connectivity.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Connectivity.lean @@ -18,6 +18,8 @@ module public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected public import Mathlib.Combinatorics.SimpleGraph.Paths public import Mathlib.Combinatorics.SimpleGraph.Walk.Counting +public import Mathlib.Data.Fintype.EquivFin +public import Mathlib.Order.Lattice.Nat @[expose] public section @@ -53,6 +55,33 @@ theorem not_isKConnected_of_card_le {V : Type*} [Fintype V] {G : SimpleGraph V} (h : Fintype.card V ≤ k) : ¬ IsKConnected G k := fun hG => absurd hG.1 (not_lt.mpr h) +/-- The vertex connectivity of a finite graph: the minimum number of vertices whose removal +leaves a disconnected graph, with the complete-graph convention of $|V| - 1$. +Graphs with at most one vertex have vertex connectivity zero. -/ +noncomputable def vertexConnectivity {V : Type*} [Fintype V] (G : SimpleGraph V) : ℕ := + open scoped Classical in + if Fintype.card V ≤ 1 then 0 + else sInf {k | ∃ S : Finset V, S.card = k ∧ + (¬(G.induce ((S : Set V)ᶜ)).Connected ∨ S.card = Fintype.card V - 1)} + +/-- Graphs with at most one vertex have vertex connectivity zero. -/ +@[simp] +theorem vertexConnectivity_of_subsingleton {V : Type*} [Fintype V] [Subsingleton V] + (G : SimpleGraph V) : G.vertexConnectivity = 0 := by + simp [vertexConnectivity, Fintype.card_le_one_iff_subsingleton.mpr inferInstance] + +/-- A disconnected graph has vertex connectivity zero. -/ +theorem vertexConnectivity_eq_zero_of_not_connected {V : Type*} [Fintype V] + (G : SimpleGraph V) (hG : ¬G.Connected) : G.vertexConnectivity = 0 := by + classical + unfold vertexConnectivity + split_ifs + · rfl + · apply Nat.eq_zero_of_le_zero + refine csInf_le' ⟨(∅ : Finset V), rfl, Or.inl ?_⟩ + rw [Finset.coe_empty, Set.compl_empty] + exact mt G.induceUnivIso.connected_iff.mp hG + /-! ### Deciding reachability by breadth-first search diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Cvetkovic.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Cvetkovic.lean index e40a312..7dd42d6 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Cvetkovic.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Cvetkovic.lean @@ -17,7 +17,7 @@ module public import Mathlib.Algebra.Polynomial.Roots public import Mathlib.Combinatorics.SimpleGraph.AdjMatrix -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.LinearAlgebra.Matrix.Charpoly.Basic @[expose] public section diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Decomposition.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Decomposition.lean new file mode 100644 index 0000000..a4d3f06 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Decomposition.lean @@ -0,0 +1,41 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + + +public import Mathlib.Combinatorics.SimpleGraph.Subgraph +public import Mathlib.Data.Set.Pairwise.Basic + +@[expose] public section + +/-! +# Edge decompositions of simple graphs + +`SimpleGraph.IsDecomposition G D` says that the finite family `D` of subgraphs of `G` +partitions the edge set of `G`. Used by Erdős Problems 184 and 583. +-/ + +namespace SimpleGraph + +/-- +`D` is a decomposition of `G` into edge-disjoint subgraphs: the edge sets of the members of `D` +are pairwise disjoint and their union is the edge set of `G`. +-/ +def IsDecomposition {V : Type*} (G : SimpleGraph V) (D : Finset G.Subgraph) : Prop := + Set.PairwiseDisjoint (D : Set G.Subgraph) (fun H ↦ H.edgeSet) ∧ + (⋃ H ∈ D, H.edgeSet) = G.edgeSet + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Degeneracy.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Degeneracy.lean new file mode 100644 index 0000000..7a19146 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Degeneracy.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. +-/ + +module + +public import Mathlib.Combinatorics.SimpleGraph.Basic +public import Mathlib.Data.Finset.Card + +@[expose] public section + +/-! +# Graph degeneracy + +A graph is $r$-degenerate if each nonempty finite vertex set contains a vertex with at most +$r$ neighbours in that set. +-/ + +namespace SimpleGraph + +open scoped Classical in +/-- The neighbours of `v` lying inside `s`. -/ +noncomputable def neighborsWithin {V : Type*} (H : SimpleGraph V) (s : Finset V) (v : V) : + Finset V := s.filter (H.Adj v) + +/-- `H` is `r`-degenerate when every induced subgraph has a vertex of degree at most `r`, that is, +every nonempty vertex set contains a vertex with at most `r` neighbours inside it. -/ +def IsDegenerate {V : Type*} (H : SimpleGraph V) (r : ℕ) : Prop := + ∀ s : Finset V, s.Nonempty → ∃ v ∈ s, (neighborsWithin H s v).card ≤ r + +@[simp] +lemma neighborsWithin_empty {V : Type*} (H : SimpleGraph V) (v : V) : + H.neighborsWithin ∅ v = ∅ := by + simp [neighborsWithin] + +@[simp] +lemma isDegenerate_bot {V : Type*} (r : ℕ) : (⊥ : SimpleGraph V).IsDegenerate r := by + intro s hs + obtain ⟨v, hv⟩ := hs + exact ⟨v, hv, by simp [neighborsWithin]⟩ + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Degrees.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Degrees.lean index d3bf510..c6db77e 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Degrees.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Degrees.lean @@ -17,10 +17,11 @@ module public import Mathlib.Analysis.Real.Sqrt public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected public import Mathlib.Combinatorics.SimpleGraph.Finite public import Mathlib.Data.ENat.Lattice public import Mathlib.Data.Multiset.Sort -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Data.Set.Card public import Mathlib.Order.CompletePartialOrder @@ -89,6 +90,54 @@ return `0`. -/ noncomputable def secondSmallestDegree (G : SimpleGraph α) [DecidableRel G.Adj] : ℕ := (degreeSequence G).getD 1 0 +omit [DecidableEq α] in +/-- In a nontrivial preconnected finite graph, second-smallest degree one forces two leaves. -/ +lemma exists_distinct_degree_one_of_secondSmallestDegree_eq_one [Nontrivial α] + (G : SimpleGraph α) [DecidableRel G.Adj] (hG : G.Preconnected) + (hσ : secondSmallestDegree G = 1) : + ∃ x y : α, x ≠ y ∧ G.degree x = 1 ∧ G.degree y = 1 := by + let ds := degreeSequence G + have hlen : 2 ≤ ds.length := by + simpa [ds, degreeSequence] using Nat.succ_le_of_lt (Fintype.one_lt_card (α := α)) + obtain ⟨a, b, tail, hds⟩ : ∃ a b tail, ds = a :: b :: tail := by + cases h : ds with + | nil => simp [h] at hlen + | cons a rest => + cases hrest : rest with + | nil => simp [h, hrest] at hlen + | cons b tail => exact ⟨a, b, tail, rfl⟩ + have hb : b = 1 := by + simpa [secondSmallestDegree, ds, hds] using hσ + have hsorted : ds.Pairwise (· ≤ ·) := by + simp [ds, degreeSequence] + have hab : a ≤ b := by + simpa [hds] using hsorted.rel_get_of_lt (a := ⟨0, by simp [hds]⟩) + (b := ⟨1, by simp [hds]⟩) (by simp) + have ha_mem : a ∈ ds := by + simp [hds] + have ha_pos : 0 < a := by + have ha_map : a ∈ Finset.univ.val.map (fun v : α => G.degree v) := by + simpa [ds, degreeSequence] using ha_mem + obtain ⟨v, -, rfl⟩ := Multiset.mem_map.mp ha_map + exact hG.degree_pos_of_nontrivial v + have ha : a = 1 := by + omega + have hcount : 2 ≤ ds.count 1 := by + simp [hds, ha, hb] + have hcoeds : (↑ds : Multiset ℕ) = + Finset.univ.val.map (fun v : α => G.degree v) := by + simp [ds, degreeSequence] + have hcountm : + 2 ≤ (Finset.univ.val.map (fun v : α => G.degree v)).count 1 := by + rw [← hcoeds, Multiset.coe_count] + exact hcount + have hleaves : 2 ≤ (Finset.univ.filter fun v : α => G.degree v = 1).card := by + rw [Multiset.count_map] at hcountm + simpa only [← Finset.filter_val, Finset.card_val, eq_comm] using hcountm + have htwo : 1 < (Finset.univ.filter fun v : α => G.degree v = 1).card := by + omega + obtain ⟨x, hx, y, hy, hxy⟩ := Finset.one_lt_card.mp htwo + exact ⟨x, y, hxy, (Finset.mem_filter.mp hx).2, (Finset.mem_filter.mp hy).2⟩ /-- The number of triangles (3-cliques) of `G` incident to vertex `v`: the number of 3-element cliques containing `v`. -/ noncomputable def numTrianglesAtVertex (G : SimpleGraph α) [DecidableRel G.Adj] (v : α) : ℕ := diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/DiamExtra.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/DiamExtra.lean index 3824b03..3a31863 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/DiamExtra.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/DiamExtra.lean @@ -16,7 +16,6 @@ limitations under the License. module public import Mathlib.Combinatorics.SimpleGraph.Diam -public import Mathlib.Combinatorics.SimpleGraph.Metric @[expose] public section @@ -32,18 +31,4 @@ this will be `0`. lemma diam_eq_zero_of_subsingleton [Subsingleton α] : G.diam = 0 := by simp [diam, ediam_eq_zero_iff_subsingleton.mpr (by assumption)] -proof_wanted diam_ne_zero [Nontrivial α] : G.diam ≠ 0 - -lemma nontrivial_of_diam_ne_zero' (h : G.diam ≠ 0) : Nontrivial α := by - contrapose! h - exact diam_eq_zero_of_subsingleton - -section Path -open Path - -proof_wanted dist_le_diam_of_mem_path {G : SimpleGraph α} {u v : α} (p : G.Walk u v) (w : α) - (hw : w ∈ p.support) : G.dist w u ≤ G.diam - -end Path - end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Eccentricity.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Eccentricity.lean index 343973a..2e56ff6 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Eccentricity.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Eccentricity.lean @@ -16,7 +16,7 @@ limitations under the License. module public import Mathlib.Combinatorics.SimpleGraph.Diam -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.VertexDistance @[expose] public section diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/FractionalChromaticNumber.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/FractionalChromaticNumber.lean new file mode 100644 index 0000000..7a03d70 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/FractionalChromaticNumber.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. +-/ +module + +public import Mathlib.Algebra.Order.Archimedean.Real.Basic +public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Order.BigOperators.Group.Finset +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Data.Fintype.Powerset + +/-! +# The fractional chromatic number + +A **fractional colouring** of a finite graph `G` assigns a nonnegative real weight to every +independent set so that every vertex receives total weight at least `1`; the **fractional +chromatic number** `χ_f(G)` is the infimum of the total weights of fractional colourings. This is +the linear-programming relaxation of the chromatic number. Mathlib (as of 2026-08) has no such +notion. + +We prove that the singleton weighting is a fractional colouring, so that `χ_f(G) ≤ |V|`, and +that `χ_f(G) ≥ 0`. +-/ + +@[expose] public section + +namespace SimpleGraph + +variable {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) + +/-- `w` is a **fractional colouring** of `G`: nonnegative weights supported on independent sets, +covering every vertex with total weight at least `1`. -/ +structure IsFractionalColoring (w : Finset V → ℝ) : Prop where + nonneg : ∀ S, 0 ≤ w S + indep : ∀ S, w S ≠ 0 → G.IsIndepSet (S : Set V) + cover : ∀ v, 1 ≤ ∑ S ∈ (Finset.univ : Finset (Finset V)).filter (fun S => v ∈ S), w S + +/-- The set of total weights of fractional colourings of `G`. -/ +def fractionalColoringWeights : Set ℝ := + {t | ∃ w : Finset V → ℝ, G.IsFractionalColoring w ∧ ∑ S, w S = t} + +/-- The **fractional chromatic number** `χ_f(G)`. -/ +noncomputable def fractionalChromaticNumber : ℝ := + sInf (fractionalColoringWeights G) + +/-- The weighting giving weight `1` to every singleton (and `0` elsewhere). -/ +def singletonWeights : Finset V → ℝ := fun S => if S.card = 1 then 1 else 0 + +/-- The singleton weighting is a fractional colouring. -/ +theorem isFractionalColoring_singletonWeights : G.IsFractionalColoring singletonWeights where + nonneg S := by unfold singletonWeights; split_ifs <;> norm_num + indep S hS := by + unfold singletonWeights at hS + split_ifs at hS with h + · obtain ⟨a, rfl⟩ := Finset.card_eq_one.mp h + intro x hx y hy hxy + simp only [Finset.coe_singleton, Set.mem_singleton_iff] at hx hy + exact absurd (hx.trans hy.symm) hxy + · exact absurd rfl hS + cover v := by + have hmem : {v} ∈ (Finset.univ : Finset (Finset V)).filter (fun S => v ∈ S) := by simp + calc (1 : ℝ) = singletonWeights {v} := by simp [singletonWeights] + _ ≤ ∑ S ∈ (Finset.univ : Finset (Finset V)).filter (fun S => v ∈ S), singletonWeights S := + Finset.single_le_sum (fun S _ => by unfold singletonWeights; split_ifs <;> norm_num) hmem + +/-- The total weight of the singleton weighting is `|V|`. -/ +theorem sum_singletonWeights : ∑ S : Finset V, singletonWeights S = Fintype.card V := by + unfold singletonWeights + rw [Finset.sum_ite, Finset.sum_const_zero, add_zero, Finset.sum_const, nsmul_eq_mul, mul_one] + congr 1 + rw [← Finset.card_univ, + ← Finset.card_map ⟨fun v => ({v} : Finset V), fun _ _ h => Finset.singleton_injective h⟩] + congr 1 + ext S + simp only [Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_map, Finset.card_eq_one] + constructor <;> rintro ⟨a, ha⟩ <;> exact ⟨a, ha.symm⟩ + +/-- There is at least one fractional colouring. -/ +theorem fractionalColoringWeights_nonempty : (fractionalColoringWeights G).Nonempty := + ⟨_, singletonWeights, G.isFractionalColoring_singletonWeights, rfl⟩ + +/-- Total weights of fractional colourings are nonnegative. -/ +theorem fractionalColoringWeights_nonneg {t : ℝ} (ht : t ∈ fractionalColoringWeights G) : 0 ≤ t := by + obtain ⟨w, hw, rfl⟩ := ht + exact Finset.sum_nonneg fun S _ => hw.nonneg S + +/-- `χ_f(G) ≥ 0`. -/ +theorem fractionalChromaticNumber_nonneg : 0 ≤ G.fractionalChromaticNumber := + Real.sInf_nonneg fun _ ht => G.fractionalColoringWeights_nonneg ht + +/-- The trivial upper bound `χ_f(G) ≤ |V|`. -/ +theorem fractionalChromaticNumber_le_card : G.fractionalChromaticNumber ≤ Fintype.card V := by + refine csInf_le ⟨0, fun _ ht => G.fractionalColoringWeights_nonneg ht⟩ ?_ + exact ⟨singletonWeights, G.isFractionalColoring_singletonWeights, sum_singletonWeights⟩ + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/HarmonicIndex.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/HarmonicIndex.lean new file mode 100644 index 0000000..5c24e63 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/HarmonicIndex.lean @@ -0,0 +1,35 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Combinatorics.SimpleGraph.Finite +public import Mathlib.Data.Rat.Defs + +@[expose] public section + +namespace SimpleGraph + +variable {α : Type*} [Fintype α] [DecidableEq α] + +/-- The harmonic index of `G`, defined as `∑_{uv ∈ E(G)} 2 / (deg u + deg v)`, +where `deg` is the degree of a vertex. This is a standard topological index in +chemical graph theory, introduced by Fajtlowicz. -/ +def harmonicIndex (G : SimpleGraph α) [DecidableRel G.Adj] : ℚ := + ∑ e ∈ G.edgeFinset, + e.lift ⟨fun u v => (2 : ℚ) / ((G.degree u : ℚ) + (G.degree v : ℚ)), + fun u v => by simp only [add_comm]⟩ + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Homogeneous.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Homogeneous.lean new file mode 100644 index 0000000..151cf19 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Homogeneous.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. +-/ +module + +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Analysis.SpecialFunctions.Log.Basic + +/-! +# Homogeneous sets and Ramsey graphs + +A homogeneous vertex set is a clique or an independent set. A finite graph is `C`-Ramsey if +every homogeneous set has at most `C * log n` vertices, where `log` is the natural logarithm. + +## References + +* B. Bukh and B. Sudakov, *Induced subgraphs of Ramsey graphs with many distinct degrees*, + J. Combin. Theory Ser. B 97 (2007), 612–619. +-/ + +@[expose] public section + +namespace SimpleGraph + +variable {V : Type*} {G : SimpleGraph V} {s t : Set V} + +/-- A vertex set is homogeneous if it is a clique or an independent set. -/ +def IsHomogeneous (G : SimpleGraph V) (s : Set V) : Prop := + G.IsClique s ∨ G.IsIndepSet s + +theorem IsHomogeneous.subset (h : t ⊆ s) : G.IsHomogeneous s → G.IsHomogeneous t := by + intro hs + exact hs.imp (IsClique.subset h) (fun hi ↦ + G.isClique_compl.mp (IsClique.subset h (G.isClique_compl.mpr hi))) + +@[simp] theorem isHomogeneous_empty : G.IsHomogeneous ∅ := + Or.inl G.isClique_empty + +@[simp] theorem isHomogeneous_singleton (v : V) : G.IsHomogeneous {v} := + Or.inl (G.isClique_singleton v) + +@[simp] theorem isHomogeneous_compl : Gᶜ.IsHomogeneous s ↔ G.IsHomogeneous s := by + simp only [IsHomogeneous, isClique_compl, isIndepSet_compl, or_comm] + +/-- A finite graph is `C`-Ramsey if every homogeneous vertex set has at most +`C * log (Fintype.card V)` vertices. The logarithm is natural. -/ +def IsCRamsey [Fintype V] (G : SimpleGraph V) (C : ℝ) : Prop := + ∀ s : Finset V, G.IsHomogeneous s → + (s.card : ℝ) ≤ C * Real.log (Fintype.card V) + +variable [Fintype V] {C : ℝ} + +@[simp] theorem isCRamsey_compl : Gᶜ.IsCRamsey C ↔ G.IsCRamsey C := by + simp only [IsCRamsey, isHomogeneous_compl] + +/-- The Ramsey bound is equivalent to bounds on the clique and independence numbers. -/ +theorem isCRamsey_iff : G.IsCRamsey C ↔ + (G.cliqueNum : ℝ) ≤ C * Real.log (Fintype.card V) ∧ + (G.indepNum : ℝ) ≤ C * Real.log (Fintype.card V) := by + constructor + · intro h + obtain ⟨s, hs⟩ := G.exists_isNClique_cliqueNum + obtain ⟨t, ht⟩ := G.exists_isNIndepSet_indepNum + constructor + · simpa only [hs.card_eq] using h s (Or.inl hs.isClique) + · simpa only [ht.card_eq] using h t (Or.inr ht.isIndepSet) + · rintro ⟨hc, hi⟩ s (hs | hs) + · exact (Nat.cast_le.mpr hs.card_le_cliqueNum).trans hc + · exact (Nat.cast_le.mpr hs.card_le_indepNum).trans hi + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Hypercube.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Hypercube.lean index e9d3b7a..7a3c84c 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Hypercube.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Hypercube.lean @@ -39,6 +39,9 @@ def hypercube (n : ℕ) : SimpleGraph (Fin n → Bool) where symm.symm _ _ := by simp [eq_comm] loopless.irrefl _ := by simp +instance (n : ℕ) : DecidableRel (hypercube n).Adj := + fun u v ↦ inferInstanceAs (Decidable (#{i | u i ≠ v i} = 1)) + @[simp] theorem hypercube_adj {n : ℕ} {u v : Fin n → Bool} : (hypercube n).Adj u v ↔ #{i | u i ≠ v i} = 1 := Iff.rfl diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Independence.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Independence.lean index 9f7e72c..16487ed 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Independence.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Independence.lean @@ -16,7 +16,7 @@ limitations under the License. module public import Mathlib.Combinatorics.SimpleGraph.Clique -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic @[expose] public section @@ -98,5 +98,31 @@ noncomputable def minLocalIndependence (G : SimpleGraph α) : ℕ := let locals := Finset.univ.image (fun v => (G.induce (G.neighborSet v)).indepNum) (locals.min).getD 0 +/-- Edges of `G` whose two endpoints lie in `S`. -/ +def internalEdges (G : SimpleGraph α) [DecidableRel G.Adj] (S : Finset α) : + Finset (Sym2 α) := + G.edgeFinset.filter fun e => e.toFinset ⊆ S + +/-- A vertex set is 2-independent when its induced graph has maximum degree +at most one. -/ +def IsTwoIndependent (G : SimpleGraph α) [DecidableRel G.Adj] (S : Finset α) : Prop := + ∀ v ∈ S, (S.filter fun w => G.Adj v w).card ≤ 1 + +/-- Maximum cardinality of an independent subset contained in `B`. -/ +noncomputable def indepNumOn (G : SimpleGraph α) [DecidableRel G.Adj] + (B : Finset α) : ℕ := + by + classical + exact (B.powerset.filter fun (A : Finset α) => G.IsIndepSet (A : Set α)).sup card + +/-- Maximum cardinality of a 2-independent vertex set. -/ +noncomputable def alphaTwo (G : SimpleGraph α) [DecidableRel G.Adj] : ℕ := + by + classical + exact (Finset.univ.powerset.filter fun S => IsTwoIndependent G S).sup card + +/-- The set of vertices of degree at most two. -/ +def lowDegreeLayer (G : SimpleGraph α) [DecidableRel G.Adj] : Finset α := + Finset.univ.filter fun v => G.degree v ≤ 2 end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Induced.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Induced.lean index 25bc70e..26fffac 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Induced.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Induced.lean @@ -16,7 +16,7 @@ limitations under the License. module public import Mathlib.Combinatorics.SimpleGraph.Acyclic -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic @[expose] public section @@ -42,7 +42,7 @@ theorem induce_isBipartite_iff_exists_coloring (G : SimpleGraph α) (s : Finset · rintro ⟨c⟩ refine ⟨fun v => if hv : v ∈ s then c ⟨v, hv⟩ else 0, ?_⟩ intro u hu v hv huv - simp only [dif_pos hu, dif_pos hv] + simp only [dite_eq_left hu, dite_eq_left hv] exact c.valid huv · rintro ⟨c, hc⟩ exact ⟨Coloring.mk (fun v => c v) fun {u v} huv => hc u u.prop v v.prop huv⟩ diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/InducedTreeNeighborhood.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/InducedTreeNeighborhood.lean new file mode 100644 index 0000000..73544c9 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/InducedTreeNeighborhood.lean @@ -0,0 +1,490 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Independence +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.LargestInducedTree + +@[expose] public section + +/-! +# Induced trees, neighbourhood independence, and girth + +Supporting API for WOWII (Graffiti.pc) Conjecture 141. Main results: + +* `SimpleGraph.indepNeighborsCard_add_one_le_largestInducedTreeSize`: an + independent set in a neighbourhood plus its centre induces a star, so + `indepNeighborsCard G v + 1 ≤ largestInducedTreeSize G`. +* `SimpleGraph.isIndepSet_neighborSet_of_four_le_girth`: girth at least four + makes every neighbourhood independent. +* `SimpleGraph.maxDegree_add_girth_le_largestInducedTreeSize_add_three`: for a + connected cyclic graph of girth at least four, + `Δ(G) + girth(G) ≤ largestInducedTreeSize G + 3` — a maximum-order induced + tree containing the closed neighbourhood of a maximum-degree vertex admits an + outside vertex with two neighbours on the tree; the tree path joining them + closes a cycle (so has length at least `girth - 2`) and shares at most three + vertices with the closed neighbourhood. +-/ +namespace SimpleGraph + +section PathHelpers + +variable {β : Type*} {H : SimpleGraph β} + +/-- In a path, at most one edge is incident to the first vertex. -/ +private lemma path_start_unique_edge {a b u₁ u₂ : β} {p : H.Walk a b} + (hp : p.IsPath) (h₁ : s(a, u₁) ∈ p.edges) (h₂ : s(a, u₂) ∈ p.edges) : + u₁ = u₂ := by + cases p with + | nil => simp at h₁ + | @cons _ c _ h q => + rw [Walk.cons_isPath_iff] at hp + have key : ∀ u : β, s(a, u) ∈ (Walk.cons h q).edges → u = c := by + intro u hu + rw [Walk.edges_cons, List.mem_cons] at hu + rcases hu with heq | hmem + · rcases Sym2.eq_iff.mp heq with ⟨-, huc⟩ | ⟨hac, -⟩ + · exact huc + · exact absurd hac h.ne + · exact absurd (Walk.fst_mem_support_of_mem_edges q hmem) hp.2 + rw [key u₁ h₁, key u₂ h₂] + +/-- In a path, at most two edges are incident to any fixed vertex `w`: among +any three vertices joined to `w` by edges of the path, two coincide. -/ +private lemma path_incident_edges_le_two {a b w u₁ u₂ u₃ : β} {p : H.Walk a b} + (hp : p.IsPath) (h₁ : s(w, u₁) ∈ p.edges) (h₂ : s(w, u₂) ∈ p.edges) + (h₃ : s(w, u₃) ∈ p.edges) : + u₁ = u₂ ∨ u₁ = u₃ ∨ u₂ = u₃ := by + induction p with + | nil => simp at h₁ + | @cons x c y h q ih => + by_cases hwx : w = x + · subst hwx + exact Or.inl (path_start_unique_edge hp h₁ h₂) + · rw [Walk.cons_isPath_iff] at hp + have key : ∀ u : β, s(w, u) ∈ (Walk.cons h q).edges → + (u = x ∧ w = c) ∨ s(w, u) ∈ q.edges := by + intro u hu + rw [Walk.edges_cons, List.mem_cons] at hu + rcases hu with heq | hmem + · rcases Sym2.eq_iff.mp heq with ⟨hwx', -⟩ | ⟨hwc, hux⟩ + · exact absurd hwx' hwx + · exact Or.inl ⟨hux, hwc⟩ + · exact Or.inr hmem + rcases key u₁ h₁ with ⟨hu₁, hwc⟩ | m₁ + · rcases key u₂ h₂ with ⟨hu₂, -⟩ | m₂ + · exact Or.inl (hu₁.trans hu₂.symm) + · rcases key u₃ h₃ with ⟨hu₃, -⟩ | m₃ + · exact Or.inr (Or.inl (hu₁.trans hu₃.symm)) + · subst hwc + exact Or.inr (Or.inr (path_start_unique_edge hp.1 m₂ m₃)) + · rcases key u₂ h₂ with ⟨hu₂, hwc⟩ | m₂ + · rcases key u₃ h₃ with ⟨hu₃, -⟩ | m₃ + · exact Or.inr (Or.inr (hu₂.trans hu₃.symm)) + · subst hwc + exact Or.inr (Or.inl (path_start_unique_edge hp.1 m₁ m₃)) + · rcases key u₃ h₃ with ⟨-, hwc⟩ | m₃ + · subst hwc + exact Or.inl (path_start_unique_edge hp.1 m₁ m₂) + · exact ih hp.1 m₁ m₂ m₃ + +/-- A path visiting `a` and `b` contains a subpath between `a` and `b` (in one +of the two directions) whose support and edges lie in the original path. -/ +private lemma exists_subpath_between {x y a b : β} {p : H.Walk x y} (hp : p.IsPath) + (ha : a ∈ p.support) (hb : b ∈ p.support) : + (∃ q : H.Walk a b, q.IsPath ∧ q.support ⊆ p.support ∧ q.edges ⊆ p.edges) ∨ + (∃ q : H.Walk b a, q.IsPath ∧ q.support ⊆ p.support ∧ q.edges ⊆ p.edges) := by + classical + by_cases hbt : b ∈ (p.takeUntil a ha).support + · exact Or.inr ⟨(p.takeUntil a ha).dropUntil b hbt, (hp.takeUntil ha).dropUntil hbt, + List.Subset.trans ((p.takeUntil a ha).support_dropUntil_subset_support hbt) + (p.support_takeUntil_subset_support ha), + List.Subset.trans ((p.takeUntil a ha).edges_dropUntil_subset_edges hbt) + (p.edges_takeUntil_subset_edges ha)⟩ + · have hbd : b ∈ (p.dropUntil a ha).support := by + have h2 : b ∈ ((p.takeUntil a ha).append (p.dropUntil a ha)).support := by + rw [p.take_spec ha] + exact hb + rcases (Walk.mem_support_append_iff _ _).mp h2 with hcase | hcase + · exact absurd hcase hbt + · exact hcase + exact Or.inl ⟨(p.dropUntil a ha).takeUntil b hbd, (hp.dropUntil ha).takeUntil hbd, + List.Subset.trans ((p.dropUntil a ha).support_takeUntil_subset_support hbd) + (p.support_dropUntil_subset_support ha), + List.Subset.trans ((p.dropUntil a ha).edges_takeUntil_subset_edges hbd) + (p.edges_dropUntil_subset_edges ha)⟩ + +/-- In a tree, the unique path between two adjacent vertices is the single edge. -/ +private lemma tree_isPath_eq_cons_nil (hH : H.IsTree) {a b : β} (hab : H.Adj a b) + {q : H.Walk a b} (hq : q.IsPath) : + q = Walk.cons hab Walk.nil := by + obtain ⟨P, -, huniq⟩ := hH.existsUnique_path a b + exact (huniq q hq).trans + (huniq (Walk.cons hab Walk.nil) (Walk.IsPath.nil.cons (by simp [hab.ne]))).symm + +/-- Two path-vertices adjacent (in a tree) to a common vertex `v` force `v` +onto the path: the unique tree path between them is the two-edge path through +`v`, and the subpath of `p` between them must be that path. -/ +private lemma tree_center_mem_support (hH : H.IsTree) + {v a b x y : β} (hva : H.Adj v a) (hvb : H.Adj v b) (hab : a ≠ b) + {p : H.Walk x y} (hp : p.IsPath) (hap : a ∈ p.support) (hbp : b ∈ p.support) : + v ∈ p.support := by + rcases exists_subpath_between hp hap hbp with ⟨q, hq, hqs, -⟩ | ⟨q, hq, hqs, -⟩ + · have hr : (Walk.cons hva.symm (Walk.cons hvb Walk.nil)).IsPath := + (Walk.IsPath.nil.cons (by simp [hvb.ne])).cons (by simp [hva.ne', hab]) + obtain ⟨P, -, huniq⟩ := hH.existsUnique_path a b + have heq : q = Walk.cons hva.symm (Walk.cons hvb Walk.nil) := + (huniq q hq).trans (huniq _ hr).symm + apply hqs + rw [heq] + simp + · have hr : (Walk.cons hvb.symm (Walk.cons hva Walk.nil)).IsPath := + (Walk.IsPath.nil.cons (by simp [hva.ne])).cons (by simp [hvb.ne', hab.symm]) + obtain ⟨P, -, huniq⟩ := hH.existsUnique_path b a + have heq : q = Walk.cons hvb.symm (Walk.cons hva Walk.nil) := + (huniq q hq).trans (huniq _ hr).symm + apply hqs + rw [heq] + simp + +/-- If `v` lies on a path in a tree and `a` is a path-vertex adjacent to `v`, +then the edge `s(v, a)` is an edge of the path: the subpath of `p` between `v` +and `a` is the unique tree path, which is the single edge. -/ +private lemma tree_edge_mem_of_center_mem (hH : H.IsTree) + {v a x y : β} (hva : H.Adj v a) + {p : H.Walk x y} (hp : p.IsPath) (hvp : v ∈ p.support) (hap : a ∈ p.support) : + s(v, a) ∈ p.edges := by + rcases exists_subpath_between hp hvp hap with ⟨q, hq, -, hqe⟩ | ⟨q, hq, -, hqe⟩ + · have heq := tree_isPath_eq_cons_nil hH hva hq + apply hqe + rw [heq] + simp + · have heq := tree_isPath_eq_cons_nil hH hva.symm hq + have hmem : s(a, v) ∈ p.edges := by + apply hqe + rw [heq] + simp + rwa [Sym2.eq_swap] at hmem + +end PathHelpers + +section TreePath + +variable {α : Type*} {G : SimpleGraph α} + +/-- Mapping a path of an induced tree into `G` and closing it up through an +outside vertex `z` adjacent to both endpoints produces a cycle of length +`p.length + 2`, so the girth is at most `p.length + 2`. -/ +lemma IsTree.girth_le_length_add_two_of_two_adj + {s : Finset α} + (_hT : (G.induce (s : Set α)).IsTree) + {z a b : α} + (hz : z ∉ s) (ha : a ∈ s) (hb : b ∈ s) + (hab : a ≠ b) (hza : G.Adj z a) (hzb : G.Adj z b) + (p : (G.induce (s : Set α)).Walk ⟨a, Finset.mem_coe.mpr ha⟩ ⟨b, Finset.mem_coe.mpr hb⟩) + (hp : p.IsPath) : + G.girth ≤ p.length + 2 := by + let e : G.induce (s : Set α) ↪g G := SimpleGraph.Embedding.induce _ + let q : G.Walk a b := p.map e.toHom + have hq : q.IsPath := by + dsimp [q] + exact (Walk.isPath_map_iff_of_injective e.injective).2 hp + have hq_length : q.length = p.length := p.length_map e.toHom + have hq_s : ∀ w ∈ q.support, w ∈ s := by + intro w hw + change w ∈ (p.map e.toHom).support at hw + rw [Walk.support_map] at hw + obtain ⟨w', hw', rfl⟩ := List.mem_map.mp hw + exact w'.property + have hzq : z ∉ q.support := fun hzmem => hz (hq_s z hzmem) + let r : G.Walk a z := q.concat hzb.symm + have hr : r.IsPath := hq.concat hzq hzb.symm + have hclose : s(z, a) ∉ r.edges := by + intro he + dsimp [r] at he + simp only [Walk.edges_concat, List.concat_eq_append, List.mem_append, List.mem_singleton] at he + rcases he with he | he + · exact hzq (q.fst_mem_support_of_mem_edges he) + · simp only [Sym2.eq, Sym2.rel_iff', Prod.mk.injEq, Prod.swap_prod_mk] at he + rcases he with ⟨hzb', haz⟩ | ⟨_, hab'⟩ + · exact hza.ne haz.symm + · exact hab hab' + let c : G.Walk z z := r.cons hza + have hc : c.IsCycle := by + dsimp [c] + exact (Walk.cons_isCycle_iff r hza).2 ⟨hr, hclose⟩ + have hclen : c.length = q.length + 2 := by simp [c, r] + have hg := hc.girth_le_length + omega + +/-- **Triangle-free bridge**: in a graph of girth at least `4`, the +neighborhood of any vertex is an independent set. An edge inside a +neighborhood would close a `3`-cycle with the two star edges. -/ +lemma isIndepSet_neighborSet_of_four_le_girth (hg4 : 4 ≤ G.girth) (v : α) : + G.IsIndepSet (G.neighborSet v) := by + intro x hx y hy _ hadj + have hvx : G.Adj v x := hx + have hvy : G.Adj v y := hy + have hxv : x ≠ v := hvx.ne' + have hr : (Walk.cons hadj (Walk.cons hvy.symm Walk.nil)).IsPath := + (Walk.IsPath.nil.cons (by simp [hvy.ne'])).cons (by simp [hadj.ne, hxv]) + have hclose : s(v, x) ∉ (Walk.cons hadj (Walk.cons hvy.symm Walk.nil)).edges := by + intro he + rw [Walk.edges_cons, Walk.edges_cons, Walk.edges_nil] at he + rcases List.mem_cons.mp he with he1 | he2 + · rcases Sym2.eq_iff.mp he1 with ⟨hvx', -⟩ | ⟨hvy', -⟩ + · exact hvx.ne hvx' + · exact hvy.ne hvy' + · rcases List.mem_cons.mp he2 with he3 | he4 + · rcases Sym2.eq_iff.mp he3 with ⟨hvy', -⟩ | ⟨-, hxy'⟩ + · exact hvy.ne hvy' + · exact hadj.ne hxy' + · simp at he4 + have hc : ((Walk.cons hadj (Walk.cons hvy.symm Walk.nil)).cons hvx).IsCycle := + (Walk.cons_isCycle_iff _ hvx).2 ⟨hr, hclose⟩ + have hg : G.girth ≤ 3 := by + have hlen := hc.girth_le_length + simpa using hlen + omega + +end TreePath + +section Main + +variable {α : Type*} [Fintype α] [DecidableEq α] {G : SimpleGraph α} + +/-- **Overlap lemma**: on a path `p` in an induced tree on `s`, at most `3` +vertices lie in the closed neighborhood of a fixed vertex `v ∈ s`. Here the +path support is read off in `α` via `Subtype.val`. -/ +lemma IsTree.card_support_inter_closedNeighborFinset_le_three + [DecidableRel G.Adj] {s : Finset α} + (hT : (G.induce (s : Set α)).IsTree) {v : α} (hv : v ∈ s) + {x y : ↥(s : Set α)} {p : (G.induce (s : Set α)).Walk x y} (hp : p.IsPath) : + ((p.support.map Subtype.val).toFinset ∩ insert v (G.neighborFinset v)).card ≤ 3 := by + classical + have hvs : v ∈ (s : Set α) := Finset.mem_coe.mpr hv + set W : Finset α := (p.support.map Subtype.val).toFinset with hW + have hmemW : ∀ u : α, u ∈ W ↔ ∃ û : ↥(s : Set α), û ∈ p.support ∧ (û : α) = u := by + intro u + simp [hW] + have hadj_of_mem : ∀ (û : ↥(s : Set α)) (u : α), (û : α) = u → u ∈ G.neighborFinset v → + (G.induce (s : Set α)).Adj ⟨v, hvs⟩ û := by + intro û u hûu hu + rw [induce_adj] + show G.Adj v (û : α) + rw [hûu] + exact (G.mem_neighborFinset v u).mp hu + have hinter : (W ∩ G.neighborFinset v).card ≤ 2 := by + by_cases hvW : v ∈ W + · -- `v` lies on the path: each neighbor of `v` on the path yields an edge of + -- `p` at `v`, and a path has at most two edges at a fixed vertex. + have hv'p : (⟨v, hvs⟩ : ↥(s : Set α)) ∈ p.support := by + obtain ⟨û, hûp, hûv⟩ := (hmemW v).mp hvW + have hûeq : û = (⟨v, hvs⟩ : ↥(s : Set α)) := Subtype.ext hûv + rwa [hûeq] at hûp + by_contra hgt + push Not at hgt + obtain ⟨u₁, u₂, u₃, h1, h2, h3, h12, h13, h23⟩ := Finset.two_lt_card_iff.mp hgt + obtain ⟨û₁, hû₁p, hû₁⟩ := (hmemW u₁).mp (Finset.mem_inter.mp h1).1 + obtain ⟨û₂, hû₂p, hû₂⟩ := (hmemW u₂).mp (Finset.mem_inter.mp h2).1 + obtain ⟨û₃, hû₃p, hû₃⟩ := (hmemW u₃).mp (Finset.mem_inter.mp h3).1 + have e₁ := tree_edge_mem_of_center_mem hT + (hadj_of_mem û₁ u₁ hû₁ (Finset.mem_inter.mp h1).2) hp hv'p hû₁p + have e₂ := tree_edge_mem_of_center_mem hT + (hadj_of_mem û₂ u₂ hû₂ (Finset.mem_inter.mp h2).2) hp hv'p hû₂p + have e₃ := tree_edge_mem_of_center_mem hT + (hadj_of_mem û₃ u₃ hû₃ (Finset.mem_inter.mp h3).2) hp hv'p hû₃p + rcases path_incident_edges_le_two hp e₁ e₂ e₃ with h | h | h + · exact h12 (by rw [← hû₁, ← hû₂, h]) + · exact h13 (by rw [← hû₁, ← hû₃, h]) + · exact h23 (by rw [← hû₂, ← hû₃, h]) + · -- `v` off the path: two distinct neighbors of `v` on the path would force + -- `v` onto the path via the unique two-edge tree path through `v`. + have hone : (W ∩ G.neighborFinset v).card ≤ 1 := by + rw [Finset.card_le_one] + intro u₁ hu₁ u₂ hu₂ + by_contra hne + obtain ⟨û₁, hû₁p, hû₁⟩ := (hmemW u₁).mp (Finset.mem_inter.mp hu₁).1 + obtain ⟨û₂, hû₂p, hû₂⟩ := (hmemW u₂).mp (Finset.mem_inter.mp hu₂).1 + have hne' : û₁ ≠ û₂ := fun h => hne (by rw [← hû₁, ← hû₂, h]) + have hv'p := tree_center_mem_support hT + (hadj_of_mem û₁ u₁ hû₁ (Finset.mem_inter.mp hu₁).2) + (hadj_of_mem û₂ u₂ hû₂ (Finset.mem_inter.mp hu₂).2) + hne' hp hû₁p hû₂p + exact hvW ((hmemW v).mpr ⟨⟨v, hvs⟩, hv'p, rfl⟩) + omega + have hsub : W ∩ insert v (G.neighborFinset v) ⊆ insert v (W ∩ G.neighborFinset v) := by + intro u hu + rw [Finset.mem_inter, Finset.mem_insert] at hu + rcases hu.2 with rfl | huN + · exact Finset.mem_insert_self _ _ + · exact Finset.mem_insert_of_mem (Finset.mem_inter.mpr ⟨hu.1, huN⟩) + calc (W ∩ insert v (G.neighborFinset v)).card + ≤ (insert v (W ∩ G.neighborFinset v)).card := Finset.card_le_card hsub + _ ≤ (W ∩ G.neighborFinset v).card + 1 := Finset.card_insert_le _ _ + _ ≤ 3 := by omega + +omit [Fintype α] in +/-- Extract an explicit independent neighbour set witnessing `indepNeighborsCard`. -/ +lemma exists_indepSet_finset_neighbors (G : SimpleGraph α) (v : α) : + ∃ S : Finset α, (∀ s ∈ S, G.Adj v s) ∧ G.IsIndepSet (S : Set α) ∧ + S.card = indepNeighborsCard G v := by + classical + obtain ⟨s, hs⟩ := (G.induce (G.neighborSet v)).exists_isNIndepSet_indepNum + refine ⟨s.image Subtype.val, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨y, _, rfl⟩ := Finset.mem_image.mp hx + exact y.property + · intro x hx y hy hxy + obtain ⟨x', hx', rfl⟩ := Finset.mem_image.mp (Finset.mem_coe.mp hx) + obtain ⟨y', hy', rfl⟩ := Finset.mem_image.mp (Finset.mem_coe.mp hy) + exact hs.1 hx' hy' (fun h => hxy (congrArg Subtype.val h)) + · rw [Finset.card_image_of_injective _ Subtype.val_injective] + exact hs.2 + +omit [Fintype α] in +/-- A vertex together with an independent set of its neighbours induces a star, +hence a tree. -/ +lemma isTree_induce_insert_indepSet_neighbors (v : α) (S : Finset α) : + (∀ s ∈ S, G.Adj v s) → G.IsIndepSet (S : Set α) → + (G.induce ((insert v S : Finset α) : Set α)).IsTree := by + classical + induction S using Finset.induction_on with + | empty => + intro _ _ + have hset : ((insert v (∅ : Finset α) : Finset α) : Set α) = {v} := by simp + rw [hset] + let : Nonempty ↥({v} : Set α) := ⟨⟨v, by simp⟩⟩ + let : Subsingleton ↥({v} : Set α) := ⟨fun a b => by + apply Subtype.ext + have ha : (a : α) = v := by simpa only [Set.mem_singleton_iff] using a.property + have hb : (b : α) = v := by simpa only [Set.mem_singleton_iff] using b.property + exact ha.trans hb.symm⟩ + exact IsTree.of_subsingleton + | @insert s S₀ hs ih => + intro hadj hind + have hadj₀ : ∀ x ∈ S₀, G.Adj v x := fun x hx => + hadj x (Finset.mem_insert_of_mem hx) + have hind₀ : G.IsIndepSet (S₀ : Set α) := + hind.mono (Finset.coe_subset.mpr (Finset.subset_insert s S₀)) + have hT := ih hadj₀ hind₀ + have hsv : s ≠ v := (hadj s (Finset.mem_insert_self s S₀)).ne' + have hzs : s ∉ insert v S₀ := by + simp only [Finset.mem_insert, not_or] + exact ⟨hsv, hs⟩ + have hza : G.Adj s v := (hadj s (Finset.mem_insert_self s S₀)).symm + have huniq : ∀ ⦃b : α⦄, b ∈ insert v S₀ → G.Adj s b → b = v := by + intro b hb hsb + rcases Finset.mem_insert.mp hb with rfl | hbS₀ + · rfl + · exfalso + have hsS : s ∈ ((insert s S₀ : Finset α) : Set α) := by simp + have hbS : b ∈ ((insert s S₀ : Finset α) : Set α) := by + simp only [Finset.coe_insert, Set.mem_insert_iff, Finset.mem_coe] + exact Or.inr hbS₀ + have hne : s ≠ b := fun h => hs (h ▸ hbS₀) + exact hind hsS hbS hne hsb + have hT' := hT.induce_insert_of_unique_adj hzs (Finset.mem_insert_self v S₀) hza huniq + have hcomm : (insert v (insert s S₀) : Finset α) = insert s (insert v S₀) := + Finset.insert_comm v s S₀ + rw [hcomm] + exact hT' + +/-- The star bound: `indepNeighborsCard G v + 1 ≤ largestInducedTreeSize G`. -/ +lemma indepNeighborsCard_add_one_le_largestInducedTreeSize (G : SimpleGraph α) (v : α) : + indepNeighborsCard G v + 1 ≤ largestInducedTreeSize G := by + classical + obtain ⟨S, hadj, hind, hcard⟩ := exists_indepSet_finset_neighbors G v + have hvS : v ∉ S := fun hv => G.irrefl (hadj v hv) + have hT := isTree_induce_insert_indepSet_neighbors v S hadj hind + have hbound := card_le_largestInducedTreeSize hT + rwa [Finset.card_insert_of_notMem hvS, hcard] at hbound + +omit [DecidableEq α] in +/-- The independence number of a neighbourhood is at most the degree. -/ +lemma indepNeighborsCard_le_degree (G : SimpleGraph α) [DecidableRel G.Adj] (v : α) : + indepNeighborsCard G v ≤ G.degree v := by + classical + obtain ⟨s, hs⟩ := (G.induce (G.neighborSet v)).exists_isNIndepSet_indepNum + calc indepNeighborsCard G v = s.card := hs.2.symm + _ ≤ Fintype.card (G.neighborSet v) := Finset.card_le_univ s + _ = G.degree v := by + rw [← G.card_neighborSet_eq_degree] + +/-- **Main counting theorem**: in a connected graph with a cycle and girth at +least `4`, `Δ(G) + girth(G) ≤ largestInducedTreeSize G + 3`. + +Proof: grow a maximum induced tree `s` through the closed neighborhood of a +maximum-degree vertex `v`; a boundary vertex `z` of `s` has two neighbors +`a ≠ b` in `s`, and the tree path from `a` to `b` closes through `z` into a +cycle, so it has at least `girth − 2` edges; the path meets the closed +neighborhood of `v` in at most `3` vertices, so inclusion–exclusion inside `s` +gives the bound. -/ +theorem maxDegree_add_girth_le_largestInducedTreeSize_add_three + (G : SimpleGraph α) [DecidableRel G.Adj] [Nontrivial α] (hG : G.Connected) + (hcyc : ¬ G.IsAcyclic) (hg4 : 4 ≤ G.girth) : + G.maxDegree + G.girth ≤ largestInducedTreeSize G + 3 := by + classical + obtain ⟨v, hvdeg⟩ := G.exists_maximal_degree_vertex + have hadjS : ∀ u ∈ G.neighborFinset v, G.Adj v u := fun u hu => + (G.mem_neighborFinset v u).mp hu + have hind : G.IsIndepSet ((G.neighborFinset v : Finset α) : Set α) := by + rw [coe_neighborFinset] + exact isIndepSet_neighborSet_of_four_le_girth hg4 v + have hT0 := isTree_induce_insert_indepSet_neighbors v (G.neighborFinset v) hadjS hind + obtain ⟨s, hrs, hT, hmax⟩ := exists_maximum_induced_tree_containing G + (insert v (G.neighborFinset v)) + ⟨insert v (G.neighborFinset v), Finset.Subset.refl _, hT0⟩ + have hvs : v ∈ s := hrs (Finset.mem_insert_self v _) + have hsne : s.Nonempty := ⟨v, hvs⟩ + have hsu : s ≠ Finset.univ := by + intro hsu + subst s + have hset : (↑(Finset.univ : Finset α) : Set α) = Set.univ := by + ext w + simp + rw [hset] at hT + have hTuniv : (G.induce Set.univ).IsTree := hT + have hGtree : G.IsTree := (induceUnivIso G).isTree_iff.mp hTuniv + exact hcyc hGtree.isAcyclic + obtain ⟨z, hz, a, ha, b, hb, hab, hza, hzb⟩ := + exists_two_adj_of_maximum_induced_tree_containing hG hrs hsne hT hmax hsu + obtain ⟨p, hp, -⟩ := + hT.existsUnique_path ⟨a, Finset.mem_coe.mpr ha⟩ ⟨b, Finset.mem_coe.mpr hb⟩ + have hgirth : G.girth ≤ p.length + 2 := + hT.girth_le_length_add_two_of_two_adj hz ha hb hab hza hzb p hp + have hoverlap := hT.card_support_inter_closedNeighborFinset_le_three hvs hp + have hWcard : (p.support.map Subtype.val).toFinset.card = p.length + 1 := by + rw [List.toFinset_card_of_nodup (hp.support_nodup.map Subtype.val_injective), + List.length_map, Walk.length_support] + have hr0card : (insert v (G.neighborFinset v)).card = G.maxDegree + 1 := by + rw [Finset.card_insert_of_notMem (G.notMem_neighborFinset_self v), + card_neighborFinset_eq_degree, ← hvdeg] + have hWsub : (p.support.map Subtype.val).toFinset ⊆ s := by + intro u hu + rw [List.mem_toFinset] at hu + obtain ⟨û, hûp, rfl⟩ := List.mem_map.mp hu + exact Finset.mem_coe.mp û.property + have hie := Finset.card_union_add_card_inter + (p.support.map Subtype.val).toFinset (insert v (G.neighborFinset v)) + have hle : ((p.support.map Subtype.val).toFinset ∪ insert v (G.neighborFinset v)).card ≤ + s.card := Finset.card_le_card (Finset.union_subset hWsub hrs) + have hscard : s.card ≤ largestInducedTreeSize G := card_le_largestInducedTreeSize hT + omega + +end Main + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/LargestInducedTree.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/LargestInducedTree.lean index 8ebf4c9..5539723 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/LargestInducedTree.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/LargestInducedTree.lean @@ -18,6 +18,8 @@ module public import Mathlib.Combinatorics.SimpleGraph.Acyclic public import Mathlib.Combinatorics.SimpleGraph.Basic public import Mathlib.Combinatorics.SimpleGraph.Finite +public import Mathlib.Combinatorics.SimpleGraph.Girth +public import Mathlib.Data.Set.Finite.Lemmas @[expose] public section @@ -37,4 +39,414 @@ A tree is a connected acyclic graph; an induced tree is an induced subgraph that noncomputable def largestInducedTreeSize (G : SimpleGraph α) : ℕ := sSup { n | ∃ s : Finset α, s.card = n ∧ (G.induce (s : Set α)).IsTree } +omit [DecidableEq α] in +/-- The order of any induced tree is bounded by `largestInducedTreeSize`. -/ +lemma card_le_largestInducedTreeSize {G : SimpleGraph α} {s : Finset α} + (hs : (G.induce (s : Set α)).IsTree) : + s.card ≤ largestInducedTreeSize G := by + unfold largestInducedTreeSize + apply le_csSup + · refine ⟨Fintype.card α, ?_⟩ + intro n hn + obtain ⟨t, rfl, _⟩ := hn + exact Finset.card_le_univ t + · exact ⟨s, rfl, hs⟩ + +omit [DecidableEq α] in +/-- Every finite graph with a vertex has a nonempty induced tree. -/ +lemma one_le_largestInducedTreeSize (G : SimpleGraph α) [Nonempty α] : + 1 ≤ largestInducedTreeSize G := by + classical + let x : α := Classical.choice (inferInstance : Nonempty α) + let s : Finset α := {x} + have hs : (s : Set α) = {x} := by + simp [s] + have hT : (G.induce (s : Set α)).IsTree := by + rw [hs] + let : Nonempty ↥({x} : Set α) := ⟨⟨x, by simp⟩⟩ + let : Subsingleton ↥({x} : Set α) := ⟨fun a b => by + apply Subtype.ext + have ha : (a : α) = x := Set.mem_singleton_iff.mp a.property + have hb : (b : α) = x := Set.mem_singleton_iff.mp b.property + exact ha.trans hb.symm⟩ + exact IsTree.of_subsingleton + have hle := card_le_largestInducedTreeSize hT + simpa [s] using hle +omit [Fintype α] in +/-- Attaching a new vertex along its unique neighbor in an induced tree gives a larger +induced tree. -/ +lemma IsTree.induce_insert_of_unique_adj {G : SimpleGraph α} {s : Finset α} {z a : α} + (hT : (G.induce (s : Set α)).IsTree) + (_hz : z ∉ s) (ha : a ∈ s) (hza : G.Adj z a) + (huniq : ∀ ⦃b : α⦄, b ∈ s → G.Adj z b → b = a) : + (G.induce ((insert z s : Finset α) : Set α)).IsTree := by + classical + constructor + · have hsconn : (G.induce (s : Set α)).Preconnected := hT.connected.preconnected + have hzconn : (G.induce ({z} : Set α)).Preconnected := .of_subsingleton + have hconn := connected_induce_union (v := z) (w := a) (s := ({z} : Set α)) + (t := (s : Set α)) hzconn hsconn (by simp) (by simpa using ha) hza + rw [Finset.coe_insert] + simpa only [Set.singleton_union] using hconn + · intro v c hc + let e : G.induce ((insert z s : Finset α) : Set α) ↪g G := + SimpleGraph.Embedding.induce _ + let q : G.Walk (e v) (e v) := c.map e.toHom + have hq : q.IsCycle := by + dsimp [q] + exact (Walk.isCycle_map_iff_of_injective e.injective).2 hc + have hq_mem (w : α) (hw : w ∈ q.support) : w ∈ insert z s := by + dsimp [q] at hw + rw [Walk.support_map] at hw + obtain ⟨w', hw', rfl⟩ := List.mem_map.mp hw + change (w' : α) ∈ insert z s + exact w'.property + by_cases hzq : z ∈ q.support + · let r : G.Walk z z := q.rotate z hzq + have hr : r.IsCycle := by + dsimp [r] + exact hq.rotate hzq + have hrsnd : r.snd ∈ q.support := by + apply (q.mem_support_rotate_iff z hzq).mp + simpa only [r] using r.getVert_mem_support 1 + have hrpenultimate : r.penultimate ∈ q.support := by + apply (q.mem_support_rotate_iff z hzq).mp + simpa only [r] using r.getVert_mem_support (r.length - 1) + have hadj_snd : G.Adj z r.snd := r.adj_snd hr.not_nil + have hadj_penultimate : G.Adj z r.penultimate := + (r.adj_penultimate hr.not_nil).symm + have hsnd : r.snd ∈ s := by + rcases Finset.mem_insert.mp (hq_mem _ hrsnd) with heq | hmem + · exact (hadj_snd.ne heq.symm).elim + · exact hmem + have hpenultimate : r.penultimate ∈ s := by + rcases Finset.mem_insert.mp (hq_mem _ hrpenultimate) with heq | hmem + · exact (hadj_penultimate.ne heq.symm).elim + · exact hmem + exact hr.snd_ne_penultimate <| + (huniq hsnd hadj_snd).trans (huniq hpenultimate hadj_penultimate).symm + · have hqs : ∀ w ∈ q.support, w ∈ (s : Set α) := by + intro w hw + rcases Finset.mem_insert.mp (hq_mem w hw) with heq | hmem + · subst w + exact (hzq hw).elim + · simpa using hmem + let qi := q.induce (s : Set α) hqs + have hqi : qi.IsCycle := by + apply (Walk.isCycle_map_iff_of_injective + (f := (SimpleGraph.Embedding.induce (G := G) (s : Set α)).toHom) + (SimpleGraph.Embedding.induce (G := G) (s : Set α)).injective).mp + rw [show qi.map (SimpleGraph.Embedding.induce (G := G) (s : Set α)).toHom = q by + dsimp [qi] + exact Walk.map_induce q hqs] + exact hq + exact hT.isAcyclic qi hqi + + +omit [Fintype α] in +/-- A shortest walk induces a tree on its support. -/ +lemma Walk.induce_support_isTree_of_length_eq_dist {G : SimpleGraph α} {u v : α} + (p : G.Walk u v) (hp : p.length = G.dist u v) : + (G.induce (p.support.toFinset : Set α)).IsTree := by + induction p with + | @nil u => + have hset : (↑(Walk.nil : G.Walk u u).support.toFinset : Set α) = {u} := by + ext + simp + have hsingle : (G.induce ({u} : Set α)).IsTree := by + let : Nonempty ↥({u} : Set α) := ⟨⟨u, by simp⟩⟩ + let : Subsingleton ↥({u} : Set α) := ⟨fun a b => by + apply Subtype.ext + have ha : (a : α) = u := by + simpa only [Set.mem_singleton_iff] using a.property + have hb : (b : α) = u := by + simpa only [Set.mem_singleton_iff] using b.property + exact ha.trans hb.symm⟩ + exact IsTree.of_subsingleton + rw [hset] + exact hsingle + | @cons u v w huv p ih => + have hptail : p.length = G.dist v w := + length_eq_dist_of_subwalk hp (Walk.isSubwalk_cons p huv) + have hT := ih hptail + have hpath : (p.cons huv).IsPath := + (p.cons huv).isPath_of_length_eq_dist hp + have hu_not : u ∉ p.support.toFinset := by + simpa using (List.nodup_cons.mp hpath.support_nodup).1 + have huniq : ∀ ⦃b : α⦄, b ∈ p.support.toFinset → G.Adj u b → b = v := by + intro b hb hub + have hbmem : b ∈ p.support := by simpa using hb + obtain ⟨i, hi, hib⟩ := List.mem_iff_getElem.mp hbmem + have hget : p.getVert i = b := by + rw [← p.support_getElem_eq_getVert hi, hib] + have hi_le : i ≤ p.length := by + have hlen := p.length_support + omega + have hub' : G.Adj u (p.getVert i) := by simpa [hget] using hub + let r : G.Walk u w := (p.drop i).cons hub' + have hdistle : G.dist u w ≤ r.length := G.dist_le r + have hlen : (p.cons huv).length ≤ r.length := by simpa [hp] using hdistle + have hi0 : i = 0 := by + simp only [Walk.length_cons, r, Walk.drop_length] at hlen + omega + subst i + simpa using hget.symm + have hsupp : (Walk.cons huv p).support.toFinset = insert u p.support.toFinset := by + simp + rw [hsupp] + exact hT.induce_insert_of_unique_adj hu_not (by simp) huv huniq + +/-- Removing one vertex from a shortest cycle gives an induced tree. -/ +theorem girth_sub_one_le_largestInducedTreeSize (G : SimpleGraph α) + (hcyc : ¬ G.IsAcyclic) : + G.girth - 1 ≤ largestInducedTreeSize G := by + classical + obtain ⟨v, c, hc, hc_length⟩ := G.exists_girth_eq_length.mpr hcyc + let p := c.tail.dropLast + let s : Finset α := p.support.toFinset + have hthree : 3 ≤ G.girth := hc.three_le_length.trans_eq hc_length.symm + have hc_tail_path : c.tail.IsPath := by + rw [Walk.isPath_def, c.support_tail_of_not_nil hc.not_nil] + exact hc.support_nodup + have hp_path : p.IsPath := by + exact Walk.isPath_of_isSubwalk + (Walk.isSubwalk_take c.tail (c.tail.length - 1)) hc_tail_path + have hp_length : p.length = G.girth - 2 := by + dsimp [p, Walk.dropLast] + rw [Walk.take_length, Nat.min_eq_left (Nat.sub_le _ _)] + have hlen := c.length_tail_add_one hc.not_nil + rw [← hc_length] at hlen + omega + have hs_card : s.card = G.girth - 1 := by + dsimp [s] + rw [List.toFinset_card_of_nodup hp_path.support_nodup, Walk.length_support, hp_length] + omega + have hp_tree : (G.induce (s : Set α)).IsTree := by + constructor + · have hs_set : (s : Set α) = {y : α | y ∈ p.support} := by + ext y + simp [s] + rw [hs_set] + exact p.connected_induce_support + · intro x d hd + let e : G.induce (s : Set α) ↪g G := SimpleGraph.Embedding.induce _ + let q : G.Walk (e x) (e x) := d.map e.toHom + have hq : q.IsCycle := by + dsimp [q] + exact (Walk.isCycle_map_iff_of_injective e.injective).2 hd + have hd_tail_path : d.tail.IsPath := by + rw [Walk.isPath_def, d.support_tail_of_not_nil hd.not_nil] + exact hd.support_nodup + have hd_length_le : d.length ≤ Fintype.card (s : Set α) := by + have hlt := hd_tail_path.length_lt + have hlen := d.length_tail_add_one hd.not_nil + omega + have hq_length : q.length = d.length := by + simp [q] + have hg_le : G.girth ≤ q.length := hq.girth_le_length + have hs_type_card : Fintype.card (s : Set α) = s.card := by + simp + rw [hq_length] at hg_le + rw [hs_type_card, hs_card] at hd_length_le + omega + have hbound := card_le_largestInducedTreeSize hp_tree + omega + +omit [Fintype α] in +/-- Every pair of vertices in a connected graph lies in an induced tree. -/ +lemma Connected.exists_induced_tree_containing_pair {G : SimpleGraph α} + (hG : G.Connected) (x y : α) : + ∃ s : Finset α, x ∈ s ∧ y ∈ s ∧ (G.induce (s : Set α)).IsTree := by + obtain ⟨p, _, hp⟩ := hG.exists_path_of_dist x y + refine ⟨p.support.toFinset, ?_, ?_, ?_⟩ + · simp + · simp + · exact Walk.induce_support_isTree_of_length_eq_dist p hp + +omit [DecidableEq α] in +/-- A nonempty family of induced trees with prescribed vertices has a largest member. -/ +lemma exists_maximum_induced_tree_containing (G : SimpleGraph α) (r : Finset α) + (hr : ∃ s : Finset α, r ⊆ s ∧ (G.induce (s : Set α)).IsTree) : + ∃ s : Finset α, + r ⊆ s ∧ + (G.induce (s : Set α)).IsTree ∧ + ∀ t : Finset α, r ⊆ t → + (G.induce (t : Set α)).IsTree → t.card ≤ s.card := by + let A : Set (Finset α) := + {s | r ⊆ s ∧ (G.induce (s : Set α)).IsTree} + have hAfin : A.Finite := Set.toFinite A + have hAne : A.Nonempty := by + obtain ⟨s, hrs, hT⟩ := hr + exact ⟨s, hrs, hT⟩ + obtain ⟨s, hsA, hmax⟩ := Set.exists_max_image A Finset.card hAfin hAne + dsimp [A] at hsA hmax + refine ⟨s, hsA.1, hsA.2, ?_⟩ + intro t hrt hT + exact hmax t ⟨hrt, hT⟩ + +/-- A nonempty proper vertex set in a connected graph has an edge across its boundary. -/ +lemma Connected.exists_adj_finset_compl {G : SimpleGraph α} + (hG : G.Connected) {s : Finset α} (hs : s.Nonempty) (hsu : s ≠ Finset.univ) : + ∃ z ∉ s, ∃ a ∈ s, G.Adj z a := by + obtain ⟨u, hu⟩ := hs + have hzex : ∃ z : α, z ∉ s := by + by_contra hn + push Not at hn + apply hsu + exact Finset.eq_univ_of_forall hn + obtain ⟨z, hz⟩ := hzex + obtain ⟨p⟩ := hG u z + obtain ⟨d, _, hd_in, hd_out⟩ := + p.exists_boundary_dart (s : Set α) (by simpa) (by simpa) + exact ⟨d.snd, by simpa using hd_out, d.fst, by simpa using hd_in, d.adj.symm⟩ + +/-- A boundary vertex of a largest prescribed induced tree has two neighbors in the tree. -/ +lemma exists_two_adj_of_maximum_induced_tree_containing + {G : SimpleGraph α} {r s : Finset α} + (hG : G.Connected) (hrs : r ⊆ s) (hs : s.Nonempty) + (hT : (G.induce (s : Set α)).IsTree) + (hmax : ∀ t : Finset α, r ⊆ t → + (G.induce (t : Set α)).IsTree → t.card ≤ s.card) + (hsu : s ≠ Finset.univ) : + ∃ z ∉ s, ∃ a ∈ s, ∃ b ∈ s, + a ≠ b ∧ G.Adj z a ∧ G.Adj z b := by + obtain ⟨z, hz, a, ha, hza⟩ := hG.exists_adj_finset_compl hs hsu + by_cases hex : ∃ b ∈ s, b ≠ a ∧ G.Adj z b + · obtain ⟨b, hb, hba, hzb⟩ := hex + exact ⟨z, hz, a, ha, b, hb, hba.symm, hza, hzb⟩ + · have huniq : ∀ ⦃b : α⦄, b ∈ s → G.Adj z b → b = a := by + intro b hb hzb + by_contra hba + exact hex ⟨b, hb, hba, hzb⟩ + have hT' := hT.induce_insert_of_unique_adj hz ha hza huniq + have hrs' : r ⊆ insert z s := by + intro v hv + exact Finset.mem_insert_of_mem (hrs hv) + have hle := hmax (insert z s) hrs' hT' + have hcard := Finset.card_insert_of_notMem hz + omega + +/-- Two leaves outside the boundary cycle force an extra two vertices in the induced tree. -/ +lemma IsTree.girth_add_one_le_card_of_two_leaves_of_two_adj + {G : SimpleGraph α} [DecidableRel G.Adj] {s : Finset α} + (hT : (G.induce (s : Set α)).IsTree) + {x y z a b : α} + (hxs : x ∈ s) (hys : y ∈ s) (hxy : x ≠ y) + (hx : G.degree x = 1) (hy : G.degree y = 1) + (hz : z ∉ s) (ha : a ∈ s) (hb : b ∈ s) + (hab : a ≠ b) (hza : G.Adj z a) (hzb : G.Adj z b) : + G.girth + 1 ≤ s.card := by + let e : G.induce (s : Set α) ↪g G := SimpleGraph.Embedding.induce _ + obtain ⟨p, hp, _⟩ := hT.existsUnique_path ⟨a, by simpa⟩ ⟨b, by simpa⟩ + let q : G.Walk a b := p.map e.toHom + have hq : q.IsPath := by + dsimp [q] + exact (Walk.isPath_map_iff_of_injective e.injective).2 hp + have hq_s : ∀ w ∈ q.support, w ∈ s := by + intro w hw + change w ∈ (p.map e.toHom).support at hw + rw [Walk.support_map] at hw + obtain ⟨w', hw', rfl⟩ := List.mem_map.mp hw + exact w'.property + have hzq : z ∉ q.support := fun hzmem => hz (hq_s z hzmem) + let r : G.Walk a z := q.concat hzb.symm + have hr : r.IsPath := hq.concat hzq hzb.symm + have hclose : s(z, a) ∉ r.edges := by + intro he + dsimp [r] at he + simp only [Walk.edges_concat, List.concat_eq_append, List.mem_append, List.mem_singleton] at he + rcases he with he | he + · exact hzq (q.fst_mem_support_of_mem_edges he) + · simp only [Sym2.eq, Sym2.rel_iff', Prod.mk.injEq, Prod.swap_prod_mk] at he + rcases he with ⟨hzb', haz⟩ | ⟨_, hab'⟩ + · exact hza.ne haz.symm + · exact hab hab' + let c : G.Walk z z := r.cons hza + have hc : c.IsCycle := by + dsimp [c] + exact (Walk.cons_isCycle_iff r hza).2 ⟨hr, hclose⟩ + have hsubx : (G.neighborSet x).Subsingleton := by + obtain ⟨nx, hnx, huniqx⟩ := degree_eq_one_iff_existsUnique_adj.mp hx + intro u hu v hv + exact (huniqx u hu).trans (huniqx v hv).symm + have hsuby : (G.neighborSet y).Subsingleton := by + obtain ⟨ny, hny, huniqy⟩ := degree_eq_one_iff_existsUnique_adj.mp hy + intro u hu v hv + exact (huniqy u hu).trans (huniqy v hv).symm + have hxz : x ≠ z := fun hxz => hz (hxz ▸ hxs) + have hyz : y ≠ z := fun hyz => hz (hyz ▸ hys) + have hxnot : x ∉ c.support := + hc.isTrail.not_mem_support_of_subsingleton_neighborSet hxz hxz hsubx + have hynot : y ∉ c.support := + hc.isTrail.not_mem_support_of_subsingleton_neighborSet hyz hyz hsuby + have hqC : ∀ ⦃w : α⦄, w ∈ q.support → w ∈ c.support := by + intro w hw + have hwr : w ∈ r.support := by + dsimp [r] + exact q.support_subset_support_concat hzb.symm hw + dsimp [c] + exact r.support_subset_support_cons hza hwr + have hqsub : q.support.toFinset ⊆ (s.erase x).erase y := by + intro w hw + have hwq : w ∈ q.support := by simpa using hw + have hws : w ∈ s := hq_s w hwq + have hwx : w ≠ x := by + intro hwx + subst w + exact hxnot (hqC hwq) + have hwy : w ≠ y := by + intro hwy + subst w + exact hynot (hqC hwq) + simp [hws, hwx, hwy] + have hqcard : q.support.toFinset.card = q.length + 1 := by + rw [List.toFinset_card_of_nodup hq.support_nodup, q.length_support] + have hy_erase : y ∈ s.erase x := by simp [hys, hxy.symm] + have hcard := Finset.card_le_card hqsub + rw [hqcard, Finset.card_erase_of_mem hy_erase, + Finset.card_erase_of_mem hxs] at hcard + have hclen : c.length = q.length + 2 := by simp [c, r] + have hg := hc.girth_le_length + omega + +/-- Two distinct leaves in a connected cyclic graph yield an induced tree of order at least girth plus one. -/ +lemma girth_add_one_le_largestInducedTreeSize_of_two_leaves + (G : SimpleGraph α) [DecidableRel G.Adj] + (hG : G.Connected) (hcyc : ¬ G.IsAcyclic) + {x y : α} (hxy : x ≠ y) + (hx : G.degree x = 1) (hy : G.degree y = 1) : + G.girth + 1 ≤ largestInducedTreeSize G := by + obtain ⟨t, hxt, hyt, hTt⟩ := + Connected.exists_induced_tree_containing_pair hG x y + have hr : ∃ u : Finset α, + ({x, y} : Finset α) ⊆ u ∧ (G.induce (u : Set α)).IsTree := by + refine ⟨t, ?_, hTt⟩ + intro v hv + rcases Finset.mem_insert.mp hv with rfl | hv + · exact hxt + · have hvy : v = y := Finset.mem_singleton.mp hv + subst v + exact hyt + obtain ⟨s, hrs, hT, hmax⟩ := + exists_maximum_induced_tree_containing G {x, y} hr + have hxs : x ∈ s := hrs (by simp) + have hys : y ∈ s := hrs (by simp) + have hs : s.Nonempty := ⟨x, hxs⟩ + have hsu : s ≠ Finset.univ := by + intro hsu + subst s + have hset : (↑(Finset.univ : Finset α) : Set α) = Set.univ := by + ext v + simp + rw [hset] at hT + have hTuniv : (G.induce Set.univ).IsTree := hT + have hGtree : G.IsTree := (induceUnivIso G).isTree_iff.mp hTuniv + exact hcyc hGtree.isAcyclic + obtain ⟨z, hz, a, ha, b, hb, hab, hza, hzb⟩ := + exists_two_adj_of_maximum_induced_tree_containing + hG hrs hs hT hmax hsu + have hbound : G.girth + 1 ≤ s.card := + IsTree.girth_add_one_le_card_of_two_leaves_of_two_adj + hT hxs hys hxy hx hy hz ha hb hab hza hzb + exact hbound.trans (card_le_largestInducedTreeSize hT) end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/LovaszTheta.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/LovaszTheta.lean index bad4ef5..0904634 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/LovaszTheta.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/LovaszTheta.lean @@ -25,20 +25,184 @@ namespace SimpleGraph variable {α : Type*} [Fintype α] [DecidableEq α] /-- -Lovász Theta Function (ϑ(G)) +Lovász Theta Function ($\vartheta(G)$). The Lovász theta function is defined as: -ϑ(G) = min λ_max(A) -where the minimum is taken over all symmetric matrices A such that: +$$\vartheta(G) = \min \lambda_{\max}(A)$$ +where the minimum is taken over all real symmetric (Hermitian) matrices $A$ such that: -A_ij = 1 for all i = j (diagonal entries are 1) -A_ij = 0 for all {i,j} ∈ E (entries corresponding to edges are 0) -A is positive semidefinite +* $A_{ii} = 1$ for all $i$ (diagonal entries are $1$), and +* $A_{ij} = 1$ for all $\{i,j\} \notin E(G)$ (entries corresponding to non-edges are $1$). -Here λ_max(A) denotes the maximum eigenvalue of A. +Here $\lambda_{\max}(A)$ denotes the maximum eigenvalue of $A$. -/ noncomputable def lovaszThetaFunction (G : SimpleGraph α) [DecidableRel G.Adj] : ℝ := sInf {(Matrix.IsHermitian.maxEigenvalue hA) | (A : Matrix α α ℝ) (hA : A.IsHermitian) - (_ : ∀ i, A i i = 1) (_ : ∀ i j, G.Adj i j → A i j = 0)} + (_ : ∀ i, A i i = 1) (_ : ∀ i j, ¬G.Adj i j → A i j = 1)} + +/-- The Lovász theta function of a graph on an empty vertex type is $0$. -/ +theorem lovaszThetaFunction_isEmpty [IsEmpty α] (G : SimpleGraph α) [DecidableRel G.Adj] : + lovaszThetaFunction G = 0 := by + have hset : {(Matrix.IsHermitian.maxEigenvalue hA) | (A : Matrix α α ℝ) (hA : A.IsHermitian) + (_ : ∀ i, A i i = 1) (_ : ∀ i j, ¬G.Adj i j → A i j = 1)} = {0} := by + ext x + simp only [Set.mem_singleton_iff] + constructor + · rintro ⟨A, hA, _, _, rfl⟩ + simp [Matrix.IsHermitian.maxEigenvalue] + · rintro rfl + refine ⟨0, Matrix.isHermitian_zero, fun i => IsEmpty.elim ‹_› i, + fun i => IsEmpty.elim ‹_› i, ?_⟩ + simp [Matrix.IsHermitian.maxEigenvalue] + rw [lovaszThetaFunction, hset, csInf_singleton] + +lemma one_le_maxEigenvalue_of_diag_eq_one [Nonempty α] {A : Matrix α α ℝ} + (hA : A.IsHermitian) (hdiag : ∀ i, A i i = 1) : + 1 ≤ hA.maxEigenvalue := by + have htrace : (Fintype.card α : ℝ) = ∑ i, hA.eigenvalues i := by + have h := hA.trace_eq_sum_eigenvalues + simp only [Matrix.trace, Matrix.diag_apply, hdiag, Finset.sum_const, Finset.card_univ, + nsmul_eq_mul, mul_one, RCLike.ofReal_real_eq_id, id_eq] at h + exact h + have hle : ∑ i : α, hA.eigenvalues i ≤ ∑ _i : α, hA.maxEigenvalue := + Finset.sum_le_sum fun i _ => le_ciSup (Finite.bddAbove_range _) i + rw [← htrace, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] at hle + have hpos : (0 : ℝ) < Fintype.card α := Nat.cast_pos.mpr Fintype.card_pos + exact (le_mul_iff_one_le_right hpos).mp hle + +lemma bddBelow_lovaszThetaSet (G : SimpleGraph α) [DecidableRel G.Adj] : + BddBelow {(Matrix.IsHermitian.maxEigenvalue hA) | (A : Matrix α α ℝ) (hA : A.IsHermitian) + (_ : ∀ i, A i i = 1) (_ : ∀ i j, ¬G.Adj i j → A i j = 1)} := by + by_cases hα : Nonempty α + · refine ⟨1, ?_⟩ + rintro _ ⟨A, hA, hdiag, _, rfl⟩ + exact one_le_maxEigenvalue_of_diag_eq_one hA hdiag + · rw [not_nonempty_iff] at hα + refine ⟨0, ?_⟩ + rintro _ ⟨A, hA, _, _, rfl⟩ + simp [Matrix.IsHermitian.maxEigenvalue] + +lemma nonempty_lovaszThetaSet (G : SimpleGraph α) [DecidableRel G.Adj] : + {(Matrix.IsHermitian.maxEigenvalue hA) | (A : Matrix α α ℝ) (hA : A.IsHermitian) + (_ : ∀ i, A i i = 1) (_ : ∀ i j, ¬G.Adj i j → A i j = 1)}.Nonempty := by + let J : Matrix α α ℝ := Matrix.of fun _ _ => 1 + have hJ : J.IsHermitian := by + ext i j + simp [J, Matrix.conjTranspose_apply] + exact ⟨hJ.maxEigenvalue, J, hJ, fun _ => rfl, fun _ _ _ => rfl, rfl⟩ + +/-- The Lovász theta function of any nonempty graph is at least $1$. -/ +theorem one_le_lovaszThetaFunction [Nonempty α] (G : SimpleGraph α) [DecidableRel G.Adj] : + 1 ≤ lovaszThetaFunction G := by + apply le_csInf (nonempty_lovaszThetaSet G) + rintro _ ⟨A, hA, hdiag, _, rfl⟩ + exact one_le_maxEigenvalue_of_diag_eq_one hA hdiag + +/-- Adding edges to a graph can only decrease or preserve its Lovász theta function. -/ +theorem lovaszThetaFunction_anti {G H : SimpleGraph α} [DecidableRel G.Adj] [DecidableRel H.Adj] + (h : G ≤ H) : + lovaszThetaFunction H ≤ lovaszThetaFunction G := by + apply csInf_le_csInf (bddBelow_lovaszThetaSet H) (nonempty_lovaszThetaSet G) + rintro _ ⟨A, hA, hdiag, hnonadj, rfl⟩ + exact ⟨A, hA, hdiag, fun i j hij => hnonadj i j (fun hG => hij (h hG)), rfl⟩ + +/-- The Lovász theta function of the complete graph $K_n$ ($n \ge 1$) is $1$. -/ +theorem lovaszThetaFunction_top [Nonempty α] : + lovaszThetaFunction (⊤ : SimpleGraph α) = 1 := by + apply le_antisymm + · have h1 : (1 : Matrix α α ℝ).IsHermitian := Matrix.isHermitian_one + have hmem : h1.maxEigenvalue ∈ {(Matrix.IsHermitian.maxEigenvalue hA) | (A : Matrix α α ℝ) + (hA : A.IsHermitian) (_ : ∀ i, A i i = 1) (_ : ∀ i j, ¬(⊤ : SimpleGraph α).Adj i j → A i j = 1)} := by + refine ⟨1, h1, fun _ => by simp, fun i j hij => ?_, rfl⟩ + simp only [top_adj, ne_eq, not_not] at hij + subst hij + simp + refine (csInf_le (bddBelow_lovaszThetaSet ⊤) hmem).trans ?_ + apply ciSup_le + intro i + have hmv := h1.mulVec_eigenvectorBasis i + rw [Matrix.one_mulVec] at hmv + by_contra! hgt + have hzero : ⇑(h1.eigenvectorBasis i) = 0 := by + ext k + have hk := congr_fun hmv k + simp only [Pi.smul_apply, smul_eq_mul, Pi.zero_apply] at hk ⊢ + nlinarith + exact h1.eigenvectorBasis.orthonormal.ne_zero i (by ext k; exact congr_fun hzero k) + · exact one_le_lovaszThetaFunction ⊤ + +/-- The Lovász theta function of the edgeless graph $\overline{K_n}$ is $n$. -/ +theorem lovaszThetaFunction_bot : + lovaszThetaFunction (⊥ : SimpleGraph α) = Fintype.card α := by + by_cases hα : Nonempty α + · let J : Matrix α α ℝ := Matrix.of fun _ _ => 1 + have hJ : J.IsHermitian := by + ext i j + simp [J, Matrix.conjTranspose_apply] + have hset : {(Matrix.IsHermitian.maxEigenvalue hA) | (A : Matrix α α ℝ) (hA : A.IsHermitian) + (_ : ∀ i, A i i = 1) (_ : ∀ i j, ¬(⊥ : SimpleGraph α).Adj i j → A i j = 1)} = {hJ.maxEigenvalue} := by + ext x + simp only [Set.mem_singleton_iff] + constructor + · rintro ⟨A, hA, _, hnonadj, rfl⟩ + have hAJ : A = J := by + ext i j + exact hnonadj i j (by simp) + subst hAJ + rfl + · rintro rfl + exact ⟨J, hJ, fun _ => rfl, fun _ _ _ => rfl, rfl⟩ + rw [lovaszThetaFunction, hset, csInf_singleton] + have heig_dic : ∀ i : α, hJ.eigenvalues i = 0 ∨ hJ.eigenvalues i = Fintype.card α := by + intro i + let u : α → ℝ := ⇑(hJ.eigenvectorBasis i) + let s : ℝ := ∑ m : α, u m + have hmul : ∀ k : α, hJ.eigenvalues i * u k = s := by + intro k + have hk := congr_fun (hJ.mulVec_eigenvectorBasis i) k + simp only [J, Matrix.mulVec, dotProduct, Matrix.of_apply, one_mul, Pi.smul_apply, + smul_eq_mul] at hk + exact hk.symm + have hsum : hJ.eigenvalues i * s = (Fintype.card α : ℝ) * s := by + calc hJ.eigenvalues i * s + = ∑ k : α, hJ.eigenvalues i * u k := by rw [Finset.mul_sum] + _ = ∑ _k : α, s := Finset.sum_congr rfl fun k _ => hmul k + _ = (Fintype.card α : ℝ) * s := by simp [Finset.sum_const, nsmul_eq_mul] + by_cases hs : s = 0 + · left + have hzero : ∀ k, hJ.eigenvalues i * u k = 0 := fun k => by rw [hmul k, hs] + by_contra hne + have hu : u = 0 := by + ext k + exact (mul_eq_zero.mp (hzero k)).resolve_left hne + exact hJ.eigenvectorBasis.orthonormal.ne_zero i (by ext k; exact congr_fun hu k) + · right + exact mul_right_cancel₀ hs hsum + apply le_antisymm + · apply ciSup_le + intro i + rcases heig_dic i with h0 | hcard + · linarith [show (0 : ℝ) ≤ Fintype.card α by positivity] + · linarith + · have htrace : (Fintype.card α : ℝ) = ∑ i, hJ.eigenvalues i := by + have h := hJ.trace_eq_sum_eigenvalues + simp only [J, Matrix.trace, Matrix.diag_apply, Matrix.of_apply, Finset.sum_const, + Finset.card_univ, nsmul_eq_mul, mul_one, RCLike.ofReal_real_eq_id, id_eq] at h + exact h + obtain ⟨i, hi⟩ : ∃ i : α, hJ.eigenvalues i = Fintype.card α := by + by_contra! hall + have hall0 : ∀ i, hJ.eigenvalues i = 0 := fun i => + (heig_dic i).resolve_right (hall i) + have hpos : (0 : ℝ) < Fintype.card α := Nat.cast_pos.mpr Fintype.card_pos + simp only [hall0, Finset.sum_const_zero] at htrace + linarith + exact hi ▸ le_ciSup (Finite.bddAbove_range _) i + · rw [not_nonempty_iff] at hα + simp [lovaszThetaFunction_isEmpty] + +/-- The Lovász theta function of any graph is at most its number of vertices. -/ +theorem lovaszThetaFunction_le_card (G : SimpleGraph α) [DecidableRel G.Adj] : + lovaszThetaFunction G ≤ Fintype.card α := + (lovaszThetaFunction_anti bot_le).trans_eq lovaszThetaFunction_bot end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Matching.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Matching.lean index b5cc214..16430b4 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Matching.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Matching.lean @@ -31,6 +31,26 @@ noncomputable def matchingNumber (G : SimpleGraph α) [DecidableRel G.Adj] : ℝ let matchings := { M : Subgraph G | M.IsMatching } sSup (Set.image (fun M => (M.edgeSet.toFinset.card : ℝ)) matchings) +/-- A finite set of edges `M` is a *matching* of `G` if every element of `M` is +an edge of `G` and any two edges of `M` are equal or share no vertex (no vertex +is covered twice). -/ +def IsEdgeMatching (G : SimpleGraph α) (M : Finset (Sym2 α)) : Prop := + (∀ e ∈ M, e ∈ G.edgeSet) ∧ + ∀ e₁ ∈ M, ∀ e₂ ∈ M, e₁ = e₂ ∨ ∀ v : α, ¬ (v ∈ e₁ ∧ v ∈ e₂) + +instance (G : SimpleGraph α) [DecidableRel G.Adj] (M : Finset (Sym2 α)) : + Decidable (G.IsEdgeMatching M) := by + unfold IsEdgeMatching; infer_instance + +/-- A matching `M` of `G` is *maximal* if no further edge of `G` can be added to +`M` while keeping the matching property. -/ +def IsMaximalEdgeMatching (G : SimpleGraph α) (M : Finset (Sym2 α)) : Prop := + G.IsEdgeMatching M ∧ + ∀ e ∈ G.edgeSet, e ∉ M → ¬ G.IsEdgeMatching (insert e M) + +instance (G : SimpleGraph α) [DecidableRel G.Adj] (M : Finset (Sym2 α)) : + Decidable (G.IsMaximalEdgeMatching M) := by + unfold IsMaximalEdgeMatching; infer_instance /-- In a finite graph, twice the number of edges of any matching is at most the number of vertices: each edge contributes two distinct vertices, and a matching's edges are vertex-disjoint. -/ diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Mycielski.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Mycielski.lean new file mode 100644 index 0000000..6dbfd46 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Mycielski.lean @@ -0,0 +1,205 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Combinatorics.SimpleGraph.Coloring.Vertex +public import Mathlib.Basic.Finite.Sum +public import Mathlib.Data.Fintype.Option +public import Mathlib.Tactic.SplitIfs + +/-! +# The Mycielski construction + +The Mycielski construction preserves triangle-freeness and increases a finite chromatic +number by one. Iteration gives finite graphs of clique number two with every chromatic +number at least two. + +## References + +- J. Mycielski, *Sur le coloriage des graphs*, Colloquium Mathematicum 3 (1955), 161–162. + [doi:10.4064/cm-3-2-161-162](https://doi.org/10.4064/cm-3-2-161-162) +- [Erdős problem 627](https://www.erdosproblems.com/627) +-/ + +@[expose] public section + +namespace SimpleGraph + +variable {V : Type*} + +/-- The adjacency relation of the Mycielski construction. The apex is `none`; +original vertices use `Sum.inl`, and shadow vertices use `Sum.inr`. -/ +def mycielskiAdj (G : SimpleGraph V) : Option (V ⊕ V) → Option (V ⊕ V) → Prop + | none, some (.inr _) => True + | some (.inr _), none => True + | some (.inl v), some (.inl w) => G.Adj v w + | some (.inl v), some (.inr w) => G.Adj v w + | some (.inr v), some (.inl w) => G.Adj v w + | _, _ => False + +/-- The Mycielski construction adds a shadow copy of the vertices and an apex. -/ +def mycielski (G : SimpleGraph V) : SimpleGraph (Option (V ⊕ V)) where + Adj := mycielskiAdj G + symm := ⟨by + rintro (_ | (_ | _)) (_ | (_ | _)) <;> simp [mycielskiAdj, G.adj_comm]⟩ + loopless := ⟨by + rintro (_ | (_ | _)) <;> simp [mycielskiAdj]⟩ + +@[simp] theorem mycielski_adj (G : SimpleGraph V) (v w : Option (V ⊕ V)) : + G.mycielski.Adj v w ↔ mycielskiAdj G v w := Iff.rfl + + +variable {G : SimpleGraph V} {α : Type*} {k : ℕ} + +/-- Extend a coloring by giving the apex a new color and each shadow its +original vertex's color. -/ +def Coloring.mycielski (C : G.Coloring α) : G.mycielski.Coloring (Option α) := + Coloring.mk + (fun + | none => none + | some (.inl v) => some (C v) + | some (.inr v) => some (C v)) + (by + rintro (_ | (_ | v)) (_ | (_ | w)) h <;> + simp_all [mycielskiAdj, C.valid]) + +/-- A `k`-coloring extends to a `(k + 1)`-coloring of the Mycielski graph. -/ +theorem Colorable.mycielski (h : G.Colorable k) : G.mycielski.Colorable (k + 1) := by + simpa using h.some.mycielski.colorable + +/-- Recolor every original vertex with the apex color using its shadow's +color. This produces a coloring of the original graph that omits the apex color. -/ +noncomputable def Coloring.ofMycielski (C : G.mycielski.Coloring α) : G.Coloring α := by + classical + refine Coloring.mk (fun v => if C (some (.inl v)) = C none + then C (some (.inr v)) else C (some (.inl v))) ?_ + intro v w h + have hoo : C (some (.inl v)) ≠ C (some (.inl w)) := C.valid h + have hos : C (some (.inl v)) ≠ C (some (.inr w)) := C.valid h + have hso : C (some (.inr v)) ≠ C (some (.inl w)) := C.valid h + split_ifs with hv hw + · exact False.elim (hoo (hv.trans hw.symm)) + · exact hso + · exact hos + · exact hoo + +/-- The recolored original graph omits the apex color. -/ +theorem Coloring.ofMycielski_ne_apex (C : G.mycielski.Coloring α) (v : V) : + C.ofMycielski v ≠ C none := by + classical + change (if C (some (.inl v)) = C none then C (some (.inr v)) + else C (some (.inl v))) ≠ C none + split_ifs with h + · exact C.valid (show G.mycielski.Adj (some (.inr v)) none from trivial) + · exact h + +/-- A Mycielski graph is not `k`-colorable if the original graph has chromatic number at least `k`. -/ +theorem not_colorable_mycielski (h : (k : ℕ∞) ≤ G.chromaticNumber) : + ¬G.mycielski.Colorable k := by + rintro ⟨C⟩ + obtain ⟨v, hv⟩ := (le_chromaticNumber_iff_forall_surjective.mp h) + C.ofMycielski (C none) + exact C.ofMycielski_ne_apex v hv + +/-- The Mycielski construction increases a finite chromatic number by one. -/ +theorem chromaticNumber_mycielski (h : G.chromaticNumber = (k : ℕ∞)) : + G.mycielski.chromaticNumber = ((k + 1 : ℕ) : ℕ∞) := by + simpa only [Nat.cast_add, Nat.cast_one] using + (chromaticNumber_eq_iff_colorable_not_colorable.mpr + ⟨(chromaticNumber_le_iff_colorable.mp h.le).mycielski, + not_colorable_mycielski h.ge⟩) + +/-- The Mycielski construction preserves triangle-freeness. -/ +theorem CliqueFree.mycielski {G : SimpleGraph V} (hG : G.CliqueFree 3) : + G.mycielski.CliqueFree 3 := by + classical + have htri (a b c : V) (hab : G.Adj a b) (hac : G.Adj a c) (hbc : G.Adj b c) : + False := hG {a, b, c} (is3Clique_triple_iff.mpr ⟨hab, hac, hbc⟩) + intro s hs + obtain ⟨a, b, c, hab, hac, hbc, -⟩ := is3Clique_iff.mp hs + rcases a with _ | (_ | _) <;> rcases b with _ | (_ | _) <;> + rcases c with _ | (_ | _) <;> simp_all only [mycielski_adj, mycielskiAdj] + all_goals exact htri _ _ _ hab hac hbc + +/-- A triangle-free graph has clique number at most two. -/ +theorem CliqueFree.cliqueNum_le_two {G : SimpleGraph V} (hG : G.CliqueFree 3) : + G.cliqueNum ≤ 2 := by + by_contra h + obtain ⟨s, hs⟩ := G.exists_isNClique_cliqueNum + exact (CliqueFree.mono (by omega : 3 ≤ G.cliqueNum) hG) s hs + +/-- The Mycielski graph of a nonempty triangle-free finite graph has clique number two. -/ +theorem cliqueNum_mycielski [Finite V] [Nonempty V] {G : SimpleGraph V} + (hG : G.CliqueFree 3) : G.mycielski.cliqueNum = 2 := by + classical + apply Nat.le_antisymm hG.mycielski.cliqueNum_le_two + obtain ⟨v⟩ := ‹Nonempty V› + have hpair : G.mycielski.IsClique + ({none, some (Sum.inr v)} : Finset (Option (V ⊕ V))) := by + simp [mycielskiAdj] + simpa using hpair.card_le_cliqueNum + +variable {W : Type*} + +/-- Relabelling vertices preserves the clique number. -/ +theorem cliqueNum_map_equiv (G : SimpleGraph V) (e : V ≃ W) : + (G.map e).cliqueNum = G.cliqueNum := by + unfold cliqueNum + congr 1 + ext n + change ((G.map e).cliqueSet n).Nonempty ↔ (G.cliqueSet n).Nonempty + rw [cliqueSet_map_of_equiv] + exact Set.image_nonempty + +/-- Relabelling vertices preserves the chromatic number. -/ +theorem chromaticNumber_map_equiv (G : SimpleGraph V) (e : V ≃ W) : + (G.map e).chromaticNumber = G.chromaticNumber := by + exact le_antisymm + (chromaticNumber_mono_of_hom (Iso.map e G).symm.toHom) + (chromaticNumber_mono_of_hom (Iso.map e G).toHom) + +/-- For every `k ≥ 2`, a finite graph has clique number two and chromatic number `k`. -/ +theorem exists_cliqueNum_eq_two_chromaticNumber_eq (k : ℕ) (hk : 2 ≤ k) : + ∃ (n : ℕ) (G : SimpleGraph (Fin n)), + G.cliqueNum = 2 ∧ G.chromaticNumber = (k : ℕ∞) := by + classical + have hex (j : ℕ) : ∃ (V : Type) (_ : Fintype V) (_ : Nonempty V) (G : SimpleGraph V), + G.CliqueFree 3 ∧ G.cliqueNum = 2 ∧ G.chromaticNumber = ((j + 2 : ℕ) : ℕ∞) := by + induction j with + | zero => + refine ⟨Fin 2, inferInstance, inferInstance, ⊤, ?_, ?_, by simp⟩ + · exact cliqueFree_of_chromaticNumber_lt (by simp; decide) + · apply Nat.le_antisymm + · exact (cliqueFree_of_chromaticNumber_lt (by simp; decide) : + (⊤ : SimpleGraph (Fin 2)).CliqueFree 3).cliqueNum_le_two + · have h : (⊤ : SimpleGraph (Fin 2)).IsClique (Finset.univ : Finset (Fin 2)) := + by simp + simp + | succ j ih => + obtain ⟨V, hV, hne, G, htri, _, hχ⟩ := ih + let := hV + let := hne + refine ⟨Option (V ⊕ V), inferInstance, inferInstance, G.mycielski, + htri.mycielski, cliqueNum_mycielski htri, ?_⟩ + simpa only [Nat.succ_eq_add_one, Nat.add_assoc, Nat.add_comm 1 2] using + chromaticNumber_mycielski hχ + obtain ⟨V, hV, _, G, _, hω, hχ⟩ := hex (k - 2) + let := hV + refine ⟨Fintype.card V, G.map (Fintype.equivFin V), ?_, ?_⟩ + · simpa only [cliqueNum_map_equiv] using hω + · simpa only [chromaticNumber_map_equiv, Nat.sub_add_cancel hk] using hχ + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/PathCover.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/PathCover.lean index 3d28484..bea1098 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/PathCover.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/PathCover.lean @@ -16,7 +16,7 @@ limitations under the License. module public import Mathlib.Combinatorics.SimpleGraph.Paths -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Order.Lattice.Nat @[expose] public section diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Petersen.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Petersen.lean new file mode 100644 index 0000000..cb5f730 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Petersen.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. +-/ +module + +public import Mathlib.Combinatorics.SimpleGraph.Finite +public import Mathlib.Data.Fintype.Powerset + +/-! +# The Petersen graph + +The **Petersen graph** as the Kneser graph $K(5, 2)$: vertices are the $2$-element subsets of a +$5$-element set, adjacent when disjoint. We record that it has $10$ vertices and is cubic. +-/ + +@[expose] public section + +namespace SimpleGraph + +/-- The vertex type of the Petersen graph: `2`-element subsets of `Fin 5`. -/ +abbrev PetersenVertex : Type := {s : Finset (Fin 5) // s.card = 2} + +/-- The **Petersen graph** $K(5,2)$: two `2`-subsets of `Fin 5` are adjacent iff disjoint. -/ +def petersenGraph : SimpleGraph PetersenVertex where + Adj s t := Disjoint s.1 t.1 + symm := ⟨fun _ _ h => h.symm⟩ + loopless := ⟨fun s h => by + have hc := s.2 + rw [disjoint_self.mp h] at hc + simp at hc⟩ + +instance : DecidableRel petersenGraph.Adj := fun s t => + inferInstanceAs (Decidable (Disjoint s.1 t.1)) + +/-- A canonical vertex `{0, 1}` of the Petersen graph. -/ +def petersenVertex01 : PetersenVertex := ⟨{0, 1}, by decide⟩ + +instance : Nonempty PetersenVertex := ⟨petersenVertex01⟩ + +/-- The Petersen graph has `10` vertices. -/ +theorem card_petersenVertex : Fintype.card PetersenVertex = 10 := by decide + +/-- The Petersen graph is cubic. -/ +theorem petersenGraph_degree (v : PetersenVertex) : petersenGraph.degree v = 3 := by + revert v; decide + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Prod.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Prod.lean new file mode 100644 index 0000000..e41326d --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Prod.lean @@ -0,0 +1,38 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Combinatorics.SimpleGraph.Prod + +@[expose] public section + +/-! +# Decidable adjacency in box products + +Adjacency in `G □ H` is decidable when adjacency in `G` and `H` is and the vertex types have +decidable equality. This lets `decide` handle finite questions about box products. +-/ + +namespace SimpleGraph + +variable {α β : Type*} [DecidableEq α] [DecidableEq β] (G : SimpleGraph α) (H : SimpleGraph β) + +/-- Adjacency in a box product of graphs with decidable adjacency is decidable. -/ +instance boxProd.decidableRel [DecidableRel G.Adj] [DecidableRel H.Adj] : + DecidableRel (G □ H).Adj := + fun _ _ => decidable_of_iff _ boxProd_adj.symm + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Ramsey.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Ramsey.lean index ef3c9f5..d516f22 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Ramsey.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Ramsey.lean @@ -17,6 +17,9 @@ module public import Mathlib.Combinatorics.SimpleGraph.Basic public import Mathlib.Combinatorics.SimpleGraph.Copy +public import Mathlib.Basic.Real.Basic +public import Mathlib.Data.Set.Card +public import Mathlib.Order.Lattice.Nat public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.EdgeColouring @[expose] public section @@ -34,6 +37,15 @@ The Erdős–Hajnal "exceptional pair" trio of predicates: These were introduced for Erdős Problem 596 but are reusable for Problem 595 and other Ramsey-type questions; we factor them out per mo271's review. + +It also defines the two-colour graph Ramsey number `graphRamsey G H`, the `k`-colour Ramsey +number `multicolourRamsey G k` of a single graph `G`, and the notion of a **Ramsey size +linear** graph `IsRamseySizeLinear G` of Erdős, Faudree, Rousseau and Schelp. + +## References + +* Erdős, Faudree, Rousseau and Schelp, *Ramsey size linear graphs*, + Combin. Probab. Comput. 2 (1993), 389–399. -/ namespace SimpleGraph @@ -65,4 +77,62 @@ def IsErdosHajnalExceptional {U₁ U₂ : Type*} (G₁ : SimpleGraph U₁) (G₂ : SimpleGraph U₂) : Prop := HasFiniteRamseyProperty G₁ G₂ ∧ HasCountableRamseyEscape G₁ G₂ +/-- +The two-color Ramsey number `graphRamsey G H` is the minimum number of vertices `n` +such that every 2-coloring of the edges of the complete graph on `n` vertices contains +a copy of `G` in the first color or a copy of `H` in the second color. + +A 2-coloring of the complete graph on `Fin n` is represented by a graph `C` (the edges of the +first color) and its complement `Cᶜ` (the edges of the second color). +-/ +noncomputable def graphRamsey {α β : Type*} [Fintype α] [Fintype β] + (G : SimpleGraph α) (H : SimpleGraph β) : ℕ := + sInf { n : ℕ | ∀ (C : SimpleGraph (Fin n)), G.IsContained C ∨ H.IsContained Cᶜ } + +/-- The diagonal graph Ramsey number `R(G, G)`. -/ +noncomputable def diagonalGraphRamsey {α : Type*} [Fintype α] (G : SimpleGraph α) : ℕ := + graphRamsey G G + +/-- The classical two-color Ramsey number `R(k, l) = R(K_k, K_l)`. -/ +noncomputable def classicalRamsey (k l : ℕ) : ℕ := + graphRamsey (completeGraph (Fin k)) (completeGraph (Fin l)) + +/-- The diagonal classical Ramsey number `R(k) = R(K_k, K_k)`. -/ +noncomputable def diagonalRamsey (k : ℕ) : ℕ := + classicalRamsey k k + +/-- +The `k`-colour Ramsey number of a graph `G`: the least `N` such that every `k`-colouring of +the edges of the complete graph on `Fin N` (an edge-colouring `c : Fin k → SimpleGraph (Fin N)` +of `⊤`) contains a monochromatic copy of `G`, i.e. `G ⊑ c i` for some colour `i`. +-/ +noncomputable def multicolourRamsey {V : Type*} (G : SimpleGraph V) (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ c : Fin k → SimpleGraph (Fin N), + (⊤ : SimpleGraph (Fin N)).IsEdgeColouring c → ∃ i, G ⊑ c i} + +/-- +A graph `G` is **Ramsey size linear** if there exists a constant `c > 0` such that +for all graphs `H` with `m` edges and no isolated vertices, the Ramsey number satisfies +`R(G, H) ≤ c · m`. + +Note that this is about the (vertex) Ramsey number `graphRamsey G H`, not the size Ramsey +number `sizeRamsey G H`. +-/ +def IsRamseySizeLinear {α : Type*} [Fintype α] (G : SimpleGraph α) : Prop := + ∃ c > (0 : ℝ), ∀ (n : ℕ) (H : SimpleGraph (Fin n)) [DecidableRel H.Adj], + (∀ v, 0 < H.degree v) → + (graphRamsey G H : ℝ) ≤ c * H.edgeSet.ncard + +/-- +The `k`-colour Ramsey number `multicolourGraphRamsey k G` is the minimum number of vertices `n` +such that every `k`-colouring of the edges of the complete graph on `n` vertices contains a +monochromatic copy of `G`. + +A `k`-colouring of the edges of the complete graph on `Fin n` is a `TopEdgeLabeling (Fin n) (Fin k)`, +and `C.labelGraph i` is the graph formed by the edges of colour `i`. For `k = 2` this agrees with +`diagonalGraphRamsey`. +-/ +noncomputable def multicolourGraphRamsey {α : Type*} [Fintype α] (k : ℕ) (G : SimpleGraph α) : ℕ := + sInf {n : ℕ | ∀ C : TopEdgeLabeling (Fin n) (Fin k), ∃ i, G.IsContained (C.labelGraph i)} + end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Residue.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Residue.lean index 34785a8..72f8d98 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Residue.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Residue.lean @@ -73,7 +73,6 @@ termination_by l => l.length decreasing_by simp_wf rw [havelHakimiStep_length_cons] - omega /-- Computes the residue of a graph `G`, i.e. the number of zeros remaining after iteratively diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Saturation.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Saturation.lean new file mode 100644 index 0000000..d3aaab6 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Saturation.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. +-/ +module + +public import Mathlib.Data.Finset.Powerset +public import Mathlib.Order.Lattice.Nat +public import Mathlib.Order.ConditionallyCompleteLattice.Finset +public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Matching + +@[expose] public section + +/-! +The saturation number of a graph. + +Main definitions + +* `SimpleGraph.saturationNumber` : the saturation number `μ*(G)`, the minimum + size of a maximal matching. +* `SimpleGraph.computableSaturationNumber` : a computable companion definition. +* `SimpleGraph.saturationNumber_eq_computable` : bridge equation + `saturationNumber G = computableSaturationNumber G`. +-/ + +namespace SimpleGraph + +variable {α : Type*} [Fintype α] [DecidableEq α] + +/-! ### Saturation number -/ + +/-- The *saturation number* `μ*(G)` (also called the lower matching number): the +minimum number of edges in a maximal matching of `G`. + +Every finite graph has a maximal matching (extend the empty matching greedily), +so this set is nonempty and the infimum is a genuine minimum. -/ +noncomputable def saturationNumber (G : SimpleGraph α) : ℕ := + sInf {n | ∃ M : Finset (Sym2 α), G.IsMaximalEdgeMatching M ∧ M.card = n} + +/-- Computable saturation number via powerset enumeration over the edge set. -/ +def computableSaturationNumber (G : SimpleGraph α) [DecidableRel G.Adj] : ℕ := + ((G.edgeFinset.powerset.filter fun M => G.IsMaximalEdgeMatching M).image + Finset.card).min.getD 0 + +/-! ### Saturation number equivalence -/ + +theorem saturationNumber_eq_computable (G : SimpleGraph α) [DecidableRel G.Adj] : + saturationNumber G = computableSaturationNumber G := by + unfold saturationNumber computableSaturationNumber + have hset : {n | ∃ M : Finset (Sym2 α), G.IsMaximalEdgeMatching M ∧ M.card = n} + = ↑((G.edgeFinset.powerset.filter fun M => G.IsMaximalEdgeMatching M).image + Finset.card) := by + ext n + simp only [Finset.coe_image, Set.mem_image, Finset.mem_coe, Finset.mem_filter, + Finset.mem_powerset, Set.mem_ofPred_eq] + refine ⟨fun ⟨M, hM, hn⟩ => + ⟨M, ⟨fun e he => mem_edgeFinset.mpr (hM.1.1 e he), hM⟩, hn⟩, + fun ⟨M, ⟨_, hM⟩, hn⟩ => ⟨M, hM, hn⟩⟩ + rw [hset] + set s : Finset ℕ := + (G.edgeFinset.powerset.filter fun M => G.IsMaximalEdgeMatching M).image Finset.card + rcases s.eq_empty_or_nonempty with hs | hs + · rw [hs, Finset.coe_empty, Nat.sInf_empty, Finset.min_empty]; rfl + · rw [hs.csInf_eq_min', ← Finset.coe_min' hs]; rfl + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean index 26a86a3..3e7f2b5 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean @@ -16,7 +16,6 @@ limitations under the License. module public import Mathlib.Combinatorics.SimpleGraph.Copy -public import Mathlib.Data.Real.Basic public import Mathlib.Data.Set.Card public import Mathlib.Order.Lattice.Nat @@ -48,13 +47,4 @@ noncomputable def sizeRamsey {α β : Type*} [Fintype α] [Fintype β] ∀ (R : SimpleGraph (Fin n)), R ≤ F → G.IsContained R ∨ H.IsContained (F \ R) } -/-- -A graph `G` is **Ramsey size linear** if there exists a constant `c > 0` such that -for all graphs `H` with `m` edges and no isolated vertices, `r̂(G, H) ≤ c · m`. --/ -def IsRamseySizeLinear {α : Type*} [Fintype α] (G : SimpleGraph α) : Prop := - ∃ c > (0 : ℝ), ∀ (n : ℕ) (H : SimpleGraph (Fin n)) [DecidableRel H.Adj], - (∀ v, 0 < H.degree v) → - (sizeRamsey G H : ℝ) ≤ c * H.edgeSet.ncard - end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Temperature.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Temperature.lean index 17a4a54..6f30cc8 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Temperature.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Temperature.lean @@ -16,7 +16,7 @@ limitations under the License. module public import Mathlib.Combinatorics.SimpleGraph.Finite -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic @[expose] public section diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/TotalColouring.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/TotalColouring.lean new file mode 100644 index 0000000..a5b8f12 --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/TotalColouring.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. +-/ +module + +public import Mathlib.Combinatorics.SimpleGraph.Finite +public import Mathlib.Order.Lattice.Nat + +@[expose] public section + +/-! +# Total colourings + +A *total colouring* of a simple graph `G` colours both its vertices and its edges so that +adjacent vertices, incident edges, and each vertex with its incident edges all receive distinct +colours. This file defines `SimpleGraph.IsTotalColoring`, `SimpleGraph.TotalColorable` and the +*total chromatic number* `SimpleGraph.totalChromaticNumber`, and proves the trivial upper bound +`|V| + |E|`. +-/ + +namespace SimpleGraph + +variable {V : Type*} (G : SimpleGraph V) + +/-- A function `c` on the vertices and edges of `G` (an element of `V ⊕ G.edgeSet`) is a +**total colouring** if adjacent vertices, incident (distinct) edges, and each vertex together +with its incident edges receive different colours. -/ +def IsTotalColoring {ι : Type*} (c : V ⊕ G.edgeSet → ι) : Prop := + (∀ u v, G.Adj u v → c (Sum.inl u) ≠ c (Sum.inl v)) ∧ + (∀ e f : G.edgeSet, e ≠ f → (∃ v, v ∈ (e : Sym2 V) ∧ v ∈ (f : Sym2 V)) → + c (Sum.inr e) ≠ c (Sum.inr f)) ∧ + (∀ (v : V) (e : G.edgeSet), v ∈ (e : Sym2 V) → c (Sum.inl v) ≠ c (Sum.inr e)) + +/-- `G` is **totally `n`-colourable** if it has a total colouring with `n` colours. -/ +def TotalColorable (n : ℕ) : Prop := + ∃ c : V ⊕ G.edgeSet → Fin n, G.IsTotalColoring c + +/-- The **total chromatic number** `χ''(G)`: the least number of colours in a total colouring. -/ +noncomputable def totalChromaticNumber : ℕ := + sInf {n | G.TotalColorable n} + +/-- Any injective colouring of `V ⊕ G.edgeSet` is a total colouring. -/ +theorem isTotalColoring_of_injective {ι : Type*} {c : V ⊕ G.edgeSet → ι} + (hc : Function.Injective c) : G.IsTotalColoring c := + ⟨fun _ _ huv h => G.ne_of_adj huv (Sum.inl_injective (hc h)), + fun _ _ hef _ h => hef (Sum.inr_injective (hc h)), + fun _ _ _ h => Sum.inl_ne_inr (hc h)⟩ + +variable [Fintype V] [DecidableRel G.Adj] + +/-- Colouring every vertex and edge differently is a total colouring, so `G` is totally +`|V| + |E|`-colourable. -/ +theorem totalColorable_card_add_card : + G.TotalColorable (Fintype.card V + Fintype.card G.edgeSet) := + ⟨fun x => (Fintype.equivFin (V ⊕ G.edgeSet) x).cast (Fintype.card_sum ..), + G.isTotalColoring_of_injective fun _ _ h => + (Fintype.equivFin _).injective (Fin.cast_injective _ h)⟩ + +/-- The trivial upper bound `χ''(G) ≤ |V| + |E|`. -/ +theorem totalChromaticNumber_le_card_add_card : + G.totalChromaticNumber ≤ Fintype.card V + Fintype.card G.edgeSet := + Nat.sInf_le G.totalColorable_card_add_card + +end SimpleGraph diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/UnitDistancePlaneGraph.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/UnitDistancePlaneGraph.lean index 6c4312f..384f7ee 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/UnitDistancePlaneGraph.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/UnitDistancePlaneGraph.lean @@ -44,6 +44,33 @@ def IntegerDistancePlaneGraph (V : Set (EuclideanSpace ℝ (Fin 2))) : SimpleGra rw [dist_self, eq_comm, Nat.cast_eq_zero] at h lia +/-- A distance graph in ℝ² for an arbitrary set `A` of distances: +two distinct points are adjacent exactly when the distance between them is a member of `A`. +The condition `x ≠ y` keeps the graph loopless; it is redundant when `A ⊆ (0, ∞)`. -/ +def DistancePlaneGraph (A : Set ℝ) (V : Set (EuclideanSpace ℝ (Fin 2))) : SimpleGraph V where + Adj x y := x ≠ y ∧ dist x y ∈ A + symm.symm x y := fun ⟨hne, hd⟩ ↦ ⟨hne.symm, by rw [dist_comm]; exact hd⟩ + loopless.irrefl x := by + rintro ⟨hne, -⟩ + exact hne rfl + +theorem distancePlaneGraph_adj {A : Set ℝ} {V : Set (EuclideanSpace ℝ (Fin 2))} {x y : V} : + (DistancePlaneGraph A V).Adj x y ↔ x ≠ y ∧ dist x y ∈ A := + Iff.rfl + +/-- With no allowed distances, the distance graph has no edges. -/ +theorem distancePlaneGraph_empty (V : Set (EuclideanSpace ℝ (Fin 2))) : + DistancePlaneGraph ∅ V = ⊥ := by + ext x y + simp [distancePlaneGraph_adj] + +/-- With the single allowed distance `1`, the distance graph is the unit distance graph. -/ +theorem distancePlaneGraph_singleton_one (V : Set (EuclideanSpace ℝ (Fin 2))) : + DistancePlaneGraph {1} V = UnitDistancePlaneGraph V := by + ext x y + rw [distancePlaneGraph_adj] + exact ⟨fun h ↦ h.2, fun h ↦ ⟨h.ne, h⟩⟩ + open scoped EuclideanGeometry /-- `G` can be embedded in `ℝ^n` with every edge a unit line segment if there is an injective map diff --git a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/VertexDistance.lean b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/VertexDistance.lean index 1b4d7a7..e3c0c10 100644 --- a/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/VertexDistance.lean +++ b/FormalConjecturesForMathlib/Combinatorics/SimpleGraph/VertexDistance.lean @@ -53,6 +53,71 @@ noncomputable def path (G : SimpleGraph α) : ℕ := ∃ l : List α, l.toFinset = s ∧ isInducedPath G l) (induced_paths.image Finset.card).max.getD 0 +/-- An explicit induced path witnesses a lower bound for `path`. -/ +theorem length_le_path_of_isInducedPath (G : SimpleGraph α) (l : List α) + (hl : G.isInducedPath l) : l.length ≤ path G := by + classical + unfold path + let inducedPaths := Finset.univ.filter (fun s : Finset α ↦ + ∃ vertices : List α, vertices.toFinset = s ∧ G.isInducedPath vertices) + have hmem : l.toFinset ∈ inducedPaths := by + simp [inducedPaths] + exact ⟨l, rfl, hl⟩ + have hcard : l.toFinset.card ∈ inducedPaths.image Finset.card := + Finset.mem_image.mpr ⟨l.toFinset, hmem, rfl⟩ + change l.length ≤ (inducedPaths.image Finset.card).max.getD 0 + rw [← List.toFinset_card_of_nodup hl.1] + have hle := Finset.le_max hcard + cases hmaximum : (inducedPaths.image Finset.card).max with + | bot => simp [hmaximum] at hle + | coe maximum => + rw [hmaximum] at hle + have hleNat : l.toFinset.card ≤ maximum := WithBot.coe_le_coe.mp hle + simpa [hmaximum, Option.getD] using hleNat + +/-- A uniform upper bound on the lengths of induced paths bounds `path`. -/ +theorem path_le_of_isInducedPath_length_le (G : SimpleGraph α) (k : ℕ) + (h : ∀ l : List α, G.isInducedPath l → l.length ≤ k) : path G ≤ k := by + classical + unfold path + let inducedPaths := Finset.univ.filter (fun s : Finset α ↦ + ∃ vertices : List α, vertices.toFinset = s ∧ G.isInducedPath vertices) + change (inducedPaths.image Finset.card).max.getD 0 ≤ k + have hmax : (inducedPaths.image Finset.card).max ≤ (k : WithBot ℕ) := by + apply Finset.max_le + intro cardinality hcardinality + obtain ⟨s, hs, rfl⟩ := Finset.mem_image.mp hcardinality + obtain ⟨_, vertices, rfl, hvertices⟩ := Finset.mem_filter.mp hs + rw [List.toFinset_card_of_nodup hvertices.1] + exact WithBot.coe_le_coe.mpr (h vertices hvertices) + cases hmaximum : (inducedPaths.image Finset.card).max with + | bot => exact Nat.zero_le k + | coe maximum => + have : maximum ≤ k := by + rw [hmaximum] at hmax + exact WithBot.coe_le_coe.mp hmax + simpa [hmaximum, Option.getD] using this + +/-- If `G` has no induced path on `k + 1` vertices, then `path G ≤ k`. -/ +theorem path_le_of_not_exists_inducedPath_succ (G : SimpleGraph α) (k : ℕ) + (h : ¬ ∃ e : Fin (k + 1) → α, Function.Injective e ∧ + ∀ i j : Fin (k + 1), G.Adj (e i) (e j) ↔ + i.val + 1 = j.val ∨ j.val + 1 = i.val) : path G ≤ k := by + classical + apply path_le_of_isInducedPath_length_le G k + intro l hl + by_contra hlength + have hprefix : k + 1 ≤ l.length := by omega + apply h + let e : Fin (k + 1) → α := fun i ↦ l.get ⟨i.val, lt_of_lt_of_le i.isLt hprefix⟩ + refine ⟨e, ?_, ?_⟩ + · intro i j hij + apply Fin.ext + exact congrArg (fun n : Fin l.length ↦ n.val) (hl.1.injective_get hij) + · intro i j + simpa only [e] using + hl.2 ⟨i.val, lt_of_lt_of_le i.isLt hprefix⟩ ⟨j.val, lt_of_lt_of_le j.isLt hprefix⟩ + /-- Auxiliary quantity `ecc` used in conjecture 34. -/ noncomputable def ecc (G : SimpleGraph α) (S : Set α) : ℕ := open scoped Classical in @@ -95,6 +160,21 @@ noncomputable def distMaxSet (G : SimpleGraph α) (S : Set α) : ℕ := let members := Finset.univ.filter (fun v : α => v ∈ S) (members ×ˢ members).sup (fun p => G.dist p.1 p.2) +/-- The average distance between distinct vertices of a set `S`: +$\operatorname{dist}_{\operatorname{avg}}(S)$ is the mean of $\operatorname{dist}_G(u, v)$ over +all ordered pairs $(u, v)$ of distinct vertices of $S$. Returns `0` when $S$ contains fewer than +two vertices. + +This is DeLaVina's `dist_avg(S)` invariant ("average distance between maximum degree +vertices" when `S = M`), used in WOWII conjecture 23. It is distinct from `distavg`, +which averages the distances from *all* vertices of `G` to the set. -/ +noncomputable def distAvgSet (G : SimpleGraph α) (S : Set α) : ℝ := + open scoped Classical in + let pairs := (S.toFinset ×ˢ S.toFinset).filter (fun p => p.1 ≠ p.2) + if pairs.Nonempty then + (∑ p ∈ pairs, (G.dist p.1 p.2 : ℝ)) / (pairs.card : ℝ) + else 0 + /-- Average distance from all vertices to a given set. -/ noncomputable def distavg (G : SimpleGraph α) (S : Set α) : ℝ := if Fintype.card α > 0 then @@ -103,10 +183,15 @@ noncomputable def distavg (G : SimpleGraph α) (S : Set α) : ℝ := 0 /-- The **square** of a graph `G`, denoted `G²`: two distinct vertices are adjacent -iff their distance in `G` is at most 2. -/ +iff their distance in `G` is at most 2. + +The bound uses the extended distance `SimpleGraph.edist`, which is `⊤` for unreachable +vertices. The natural-valued `SimpleGraph.dist` is `0` there, so it would make distinct +vertices in different components adjacent: the square of the edgeless graph on two vertices +would be the complete graph. -/ def graphSquare (G : SimpleGraph α) : SimpleGraph α where - Adj u v := u ≠ v ∧ G.dist u v ≤ 2 - symm.symm _ _ := fun ⟨hne, hd⟩ => ⟨hne.symm, by rwa [dist_comm]⟩ + Adj u v := u ≠ v ∧ G.edist u v ≤ 2 + symm.symm _ _ := fun ⟨hne, hd⟩ => ⟨hne.symm, by rwa [edist_comm]⟩ loopless.irrefl v := by simp /-- Check whether four distinct vertices form an induced 4-cycle in `G`. diff --git a/FormalConjecturesForMathlib/Combinatorics/StableMarriage.lean b/FormalConjecturesForMathlib/Combinatorics/StableMarriage.lean new file mode 100644 index 0000000..7af152d --- /dev/null +++ b/FormalConjecturesForMathlib/Combinatorics/StableMarriage.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. +-/ +module + +public import Mathlib.Data.Fintype.Perm +public import Mathlib.Data.Fintype.Pi +public import Mathlib.Data.Fintype.Prod +public import Mathlib.Probability.Distributions.Uniform +public import Mathlib.Probability.ProbabilityMassFunction.Integrals + +@[expose] public section + +/-! +# Stable marriage + +A minimal finite model of the stable marriage problem with complete strict preferences. +-/ + +namespace StableMarriage + +/-- A preference profile for `n` men and `n` women. Each permutation maps a candidate to their +rank, with lower ranks preferred. -/ +structure Profile (n : ℕ) where + /-- The rank that each man assigns to each woman. -/ + manRank : Fin n → Equiv.Perm (Fin n) + /-- The rank that each woman assigns to each man. -/ + womanRank : Fin n → Equiv.Perm (Fin n) + deriving Inhabited + +/-- Preference profiles form a finite type. -/ +instance {n : ℕ} : Fintype (Profile n) := + Fintype.ofEquiv + ((Fin n → Equiv.Perm (Fin n)) × (Fin n → Equiv.Perm (Fin n))) + { toFun := fun p => ⟨p.1, p.2⟩ + invFun := fun p => (p.manRank, p.womanRank) + left_inv := fun _ => rfl + right_inv := fun _ => rfl } + +/-- A complete matching of `n` men to `n` women. -/ +abbrev Matching (n : ℕ) := Equiv.Perm (Fin n) + +/-- A man and woman form a blocking pair when they are not matched to each other and each ranks +the other above their current partner. -/ +def IsBlockingPair {n : ℕ} (p : Profile n) (μ : Matching n) (m w : Fin n) : Prop := + μ m ≠ w ∧ + p.manRank m w < p.manRank m (μ m) ∧ + p.womanRank w m < p.womanRank w (μ.symm w) + +/-- A matching is stable when it has no blocking pair. -/ +def IsStable {n : ℕ} (p : Profile n) (μ : Matching n) : Prop := + ∀ m w, ¬ IsBlockingPair p μ m w + +/-- The number of stable complete matchings for a preference profile. -/ +noncomputable def numStableMatchings {n : ℕ} (p : Profile n) : ℕ := by + classical + exact Fintype.card {μ : Matching n // IsStable p μ} + +/-- The discrete measurable structure on preference profiles. -/ +instance {n : ℕ} : MeasurableSpace (Profile n) := ⊤ + +/-- The uniform probability mass function on preference profiles. -/ +noncomputable def uniformProfile (n : ℕ) : PMF (Profile n) := + PMF.uniformOfFintype (Profile n) + +/-- The expected number of stable matchings under the uniform profile distribution. -/ +noncomputable def expectedNumStableMatchings (n : ℕ) : ℝ := + ∫ p, (numStableMatchings p : ℝ) ∂((uniformProfile n).toMeasure) + +end StableMarriage diff --git a/FormalConjecturesForMathlib/Computability/AutomaticSequence.lean b/FormalConjecturesForMathlib/Computability/AutomaticSequence.lean new file mode 100644 index 0000000..ebc6084 --- /dev/null +++ b/FormalConjecturesForMathlib/Computability/AutomaticSequence.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. +-/ +module + +public import Mathlib.Data.Set.Finite.Basic + +@[expose] public section + +/-! +# Automatic sequences + +A sequence `a : ℕ → α` is *`k`-automatic* if it is the output of a deterministic finite +automaton fed the base-`k` digits of the index. By the kernel criterion of [Eil74] this holds +exactly when the `k`-kernel of `a` is finite, and that is the definition used here: it needs no +automaton, and finiteness of the kernel is what proofs about automatic sequences consume. + +For `k ≥ 2`, `IsAutomatic k a` already forces the range of `a` to be finite, by +`AutomaticSequence.IsAutomatic.finite_range`. For `k ≤ 1` the `k`-kernel of `a` is `{a}`, so +every sequence is `k`-automatic. + +*References:* + - [AS03] Allouche, Jean-Paul, and Jeffrey Shallit. "Automatic Sequences: Theory, + Applications, Generalizations." Cambridge University Press, 2003. + - [Eil74] Eilenberg, Samuel. "Automata, Languages, and Machines. Vol. A." + Academic Press, 1974. Chapter V, Proposition 3.3. + +## Main definitions + +* `AutomaticSequence.kKernel`: the `k`-kernel of a sequence. +* `AutomaticSequence.IsAutomatic`: `k`-automaticity, as finiteness of the `k`-kernel. +-/ + +namespace AutomaticSequence + +variable {α : Type*} + +/-- +The *`k`-kernel* of a sequence `a` is the set of subsequences +$(a_{k^e n + r})_{n \ge 0}$ with $e \ge 0$ and $0 \le r < k^e$. +-/ +def kKernel (k : ℕ) (a : ℕ → α) : Set (ℕ → α) := + {b | ∃ e r : ℕ, r < k ^ e ∧ b = fun n => a (k ^ e * n + r)} + +/-- A sequence is a member of its own `k`-kernel, via `e = r = 0`. -/ +theorem self_mem_kKernel (k : ℕ) (a : ℕ → α) : a ∈ kKernel k a := + ⟨0, 0, by simp, by simp⟩ + +/-- +A sequence `a` is *`k`-automatic* if its `k`-kernel is finite. By [Eil74] this is equivalent to +`a` being generated by a deterministic finite automaton reading the base-`k` digits of the +index. +-/ +def IsAutomatic (k : ℕ) (a : ℕ → α) : Prop := (kKernel k a).Finite + +/-- +A `k`-automatic sequence with `k ≥ 2` takes finitely many values: `a m` is the value at `0` of +the kernel element `n ↦ a (k ^ m * n + m)`. +-/ +theorem IsAutomatic.finite_range {k : ℕ} {a : ℕ → α} (hk : 2 ≤ k) (h : IsAutomatic k a) : + (Set.range a).Finite := + (h.image fun b => b 0).subset <| Set.range_subset_iff.2 fun m => + ⟨fun n => a (k ^ m * n + m), ⟨m, m, Nat.lt_pow_self hk, rfl⟩, by simp⟩ + +/-- The `k`-kernel of a constant sequence is a singleton. -/ +@[simp] +theorem kKernel_const (k : ℕ) (c : α) : kKernel k (fun _ : ℕ => c) = {fun _ => c} := by + ext b + simp only [kKernel, Set.mem_ofPred_eq, Set.mem_singleton_iff] + exact ⟨fun ⟨_, _, _, hb⟩ => hb, fun hb => ⟨0, 0, by simp, hb⟩⟩ + +/-- A constant sequence is `k`-automatic. -/ +theorem isAutomatic_const (k : ℕ) (c : α) : IsAutomatic k (fun _ => c) := by + rw [IsAutomatic, kKernel_const] + exact Set.finite_singleton _ + +end AutomaticSequence diff --git a/FormalConjecturesForMathlib/Computability/Complexity.lean b/FormalConjecturesForMathlib/Computability/Complexity.lean index 67447ce..9371e77 100644 --- a/FormalConjecturesForMathlib/Computability/Complexity.lean +++ b/FormalConjecturesForMathlib/Computability/Complexity.lean @@ -22,11 +22,15 @@ public import Mathlib.Computability.TuringMachine.Computable # Complexity Classes This file contains formal definitions of notions from complexity theory, -including the complexity classes P, NP, and coNP. +including the complexity classes P, NP, coNP, and BPP. *References:* - Sanjeev Arora and Boaz Barak. Computational Complexity: A Modern Approach. Cambridge University Press, 2009. +- Melissa Antonelli, Ugo Dal Lago, and Paolo Pistone. On Randomized Computational Models + and Complexity Classes: a Historical Overview. 2024. + [arXiv:2409.11999](https://arxiv.org/abs/2409.11999) +- [Wikipedia: Complexity class](https://en.wikipedia.org/wiki/Complexity_class) -/ @[expose] public section @@ -46,7 +50,7 @@ abbrev DecisionProblem := List Bool → Bool /-- The type of complexity classes. We define these as sets of decision problems. -/ -abbrev ComplexityClass := Set DecisionProblem +abbrev DecisionComplexityClass := Set DecisionProblem /-- `IsPolyTimeWithEncoding ea eb f` asserts that `f` is computable in polynomial time @@ -74,18 +78,19 @@ theorem isPolyTime_id {α : Type} [BitstringEncoding α] : IsPolyTime (id : α The class P is the set of decision problems decidable in polynomial time by a deterministic Turing machine. -/ -def P : ComplexityClass := +def P : DecisionComplexityClass := { L | IsPolyTime L } /-- -The class NP is the set of decision problems -such that there exists a polynomial `p` over ℕ and a poly-time Turing machine -where for all `x`, `L x = true` iff there exists a `w` of length at most `p (|x|)` -such that the Turing machine accepts the pair `(x,w)`. +The class NP is the set of decision problems $L$ +such that there exists a polynomial $p$ over ℕ +and a poly-time Turing machine computing a relation $R$ +where for all $x$, $L(x)$ iff there exists a $w$ of length at most $p (|x|)$ +such that $R(x,w)$ accepts. See Definition 2.1 in Arora-Barak (2009). -/ -def NP : ComplexityClass := +def NP : DecisionComplexityClass := { L | ∃ (p : Polynomial ℕ), ∃ R : (List Bool × List Bool) → Bool, IsPolyTime R ∧ ∀ x, L x ↔ ∃ w : List Bool, w.length ≤ p.eval x.length ∧ R (x, w) } @@ -94,7 +99,23 @@ def NP : ComplexityClass := The class coNP is the set of decision problems whose complements are in NP. -/ -def coNP : ComplexityClass := +def coNP : DecisionComplexityClass := { L | Lᶜ ∈ NP } +/-- +The class BPP is the set of decision problems $L$ +such that there exists a polynomial $p$ over ℕ +and a poly-time Turing machine computing a relation $R$ +where for all $x$, a uniformly random string $r$ of length $p (|x|)$ satisfies +$R (x, r) = L (x)$ with probability at least $2/3$. + +See Definition 7.4 in Arora-Barak (2009), or Antonelli et al. (2024). +-/ +def BPP : DecisionComplexityClass := + { L | ∃ (p : Polynomial ℕ), ∃ R : (List Bool × List Bool) → Bool, + IsPolyTime R ∧ + ∀ x, (2 : ℚ) / 3 ≤ + ((Finset.univ.filter fun r : Fin (p.eval x.length) → Bool => + R (x, List.ofFn r) = L x).card : ℚ) / 2 ^ p.eval x.length } + end ComplexityTheory diff --git a/FormalConjecturesForMathlib/Computability/Primrec.lean b/FormalConjecturesForMathlib/Computability/Primrec.lean new file mode 100644 index 0000000..9d1cbf1 --- /dev/null +++ b/FormalConjecturesForMathlib/Computability/Primrec.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. +-/ +module + +public import Mathlib.Computability.Primrec.Basic + +@[expose] public section + +/-! +# `Primcodable` instances from retractions + +`Primcodable.ofLeftInverse` builds a `Primcodable` instance on a type `β` from a map `f : β → α` +into a `Primcodable` type `α` together with a left inverse `finv` of `f` such that `f ∘ finv` is +primitive recursive. This is the `Primcodable` analogue of `Encodable.ofLeftInverse`, and applies +in particular to sigma types, for which Mathlib provides no `Primcodable` instance. +-/ + +namespace Primcodable + +variable {α β : Type*} [Primcodable α] + +/-- If `f : β → α` has a left inverse `finv` such that `f ∘ finv` is primitive recursive, then `β` +is `Primcodable`, with `b` encoded as `Encodable.encode (f b)`. -/ +@[instance_reducible] +def ofLeftInverse (f : β → α) (finv : α → β) (linv : ∀ b, finv (f b) = b) + (hf : Primrec fun a => f (finv a)) : Primcodable β := + letI : Encodable β := Encodable.ofLeftInverse f finv linv + { prim := Primrec.nat_iff.1 <| (Primrec.encode.comp + (Primrec.option_map Primrec.decode (hf.comp₂ Primrec₂.right))).of_eq fun n => by + have key : ∀ o : Option α, Encodable.encode (o.map fun a => f (finv a)) = + Encodable.encode (α := Option β) (o.bind (some ∘ finv)) := fun o => by cases o <;> rfl + exact key _ } + +end Primcodable diff --git a/FormalConjecturesForMathlib/Computability/TuringMachine/BusyBeavers.lean b/FormalConjecturesForMathlib/Computability/TuringMachine/BusyBeavers.lean index fd77881..4b0f1eb 100644 --- a/FormalConjecturesForMathlib/Computability/TuringMachine/BusyBeavers.lean +++ b/FormalConjecturesForMathlib/Computability/TuringMachine/BusyBeavers.lean @@ -220,11 +220,16 @@ noncomputable def haltingNumber : ENat := theorem haltingNumber_def (n : ℕ) (hn : ∃ a, M.multiStep (init []) n = some a) (ha' : M.multiStep (init []) (n + 1) = none) : M.haltingNumber = n := by - refine IsGLB.sInf_eq (IsLeast.isGLB ⟨⟨n, by rwa [HaltsAfter], rfl⟩, fun m ⟨k, _, _⟩ ↦ ?_⟩) - cases m - · exact le_top - · by_contra! hc - simp_all [multiStep_eq_none_mono ‹_› (show k + 1 ≤ n by aesop)] + refine IsGLB.sInf_eq (IsLeast.isGLB ⟨⟨n, by rwa [HaltsAfter], rfl⟩, + fun m hm ↦ ?_⟩) + rcases hm with ⟨k, hk, hkm⟩ + subst m + have hnk : n ≤ k := by + by_contra h + have hnone := multiStep_eq_none_mono hk (Nat.succ_le_of_lt (Nat.lt_of_not_ge h)) + obtain ⟨a, ha⟩ := hn + simp [ha] at hnone + exact_mod_cast hnk end Machine diff --git a/FormalConjecturesForMathlib/Computability/TuringMachine/Notation.lean b/FormalConjecturesForMathlib/Computability/TuringMachine/Notation.lean index bd2fb97..7d5452d 100644 --- a/FormalConjecturesForMathlib/Computability/TuringMachine/Notation.lean +++ b/FormalConjecturesForMathlib/Computability/TuringMachine/Notation.lean @@ -17,6 +17,7 @@ module public import FormalConjecturesForMathlib.Computability.TuringMachine.BusyBeavers public meta import Mathlib.Data.List.Defs +import Mathlib.Tactic.FinCases public meta section @@ -45,7 +46,7 @@ a transition to the halting state without writing or moving. Example of a tape: `1RA0LB_0LA---` -There are more examples in `ForMathlib/Test/Computability`. +There are more examples at the end of this file. -/ open Turing BusyBeaver @@ -215,3 +216,92 @@ elab "turing_machine%" str:Lean.Parser.strLit : term => parseTuring str.getString end Main + +end + +/-! ## Examples + +The examples below check the parser and the halting API on small machines. +-/ + +section Examples + +open Turing BusyBeaver Machine + +example : turing_machine% "------" = fun _ _ => none := by + aesop + +example : turing_machine% "1RA0LB_0LA---" = fun a b => + match a, b with + | .A, 0 => some (some .A, Stmt.write 1 .right) + | .A, 1 => some (some .B, Stmt.write 0 .left) + | .B, 0 => some (some .A, Stmt.write 0 .left) + | .B, 1 => none := by + aesop + +example : turing_machine% "1RZ0LZ_------" = fun a b => + match a, b with + | .A, 0 => some (none, Stmt.write 1 .right) + | .A, 1 => some (none, Stmt.write 0 .left) + | .B, 0 => none + | .B, 1 => none := + rfl + +example : turing_machine% "1RZ0LZ2LZ_---------" = fun a b => + match a, b with + | .A, 0 => some (none, Stmt.write 1 .right) + | .A, 1 => some (none, Stmt.write 0 .left) + | .A, 2 => some (none, Stmt.write 2 .left) + | .B, 0 => none + | .B, 1 => none + | .B, 2 => none := + rfl + +/-- error: Invalid write instruction: A is not a numeral. -/ +#guard_msgs in +#check turing_machine% "---ALZ_------" + +/-- error: Invalid direction A. -/ +#guard_msgs in +#check turing_machine% "---0AZ_------" + +/-- +info: fun a b ↦ + match a, b with + | State2.A, 0 => none + | State2.A, 1 => some (none, { symbol := 0, dir := Dir.left }) + | State2.B, 0 => none + | State2.B, 1 => none : State2 → Fin 2 → Option (Option State2 × Stmt (Fin 2)) +-/ +#guard_msgs in +#check turing_machine% "---0LZ_------" + +/-- error: All portions of the string separated by `_` should have the same length. -/ +#guard_msgs in +#check turing_machine% "---0LZ_-----" + +/-- error: Each chunk of the string should consist of several groups of length 3. -/ +#guard_msgs in +#check turing_machine% "---0L_-----" + +-- A machine with no transitions halts after zero steps. +example : IsHalting (turing_machine% "------") := + (isHalting_iff_exists_haltsAt _).mpr ⟨0, by aesop⟩ + +-- A machine that moves to a state without transitions halts after one step. +example : IsHalting (turing_machine% "0RB0RB_------") := + (isHalting_iff_exists_haltsAt _).mpr ⟨1, by aesop⟩ + +example : haltingNumber (turing_machine% "0RB0RB_------") = 1 := by + apply haltingNumber_def + · use { q := some State2.B, tape := ⟨0, Quotient.mk'' [0], default⟩ } + rfl + · rfl + +-- A machine whose transitions never enter the halting state does not halt. +example : ¬ IsHalting (turing_machine% "0RB0LB_0RA0LB") := by + apply not_isHalting_of_forall_isSome + intro l s + cases l <;> fin_cases s <;> exact ⟨_, _, rfl⟩ + +end Examples diff --git a/FormalConjecturesForMathlib/Data/Finset/Powerset.lean b/FormalConjecturesForMathlib/Data/Finset/Powerset.lean index 31de78d..926a616 100644 --- a/FormalConjecturesForMathlib/Data/Finset/Powerset.lean +++ b/FormalConjecturesForMathlib/Data/Finset/Powerset.lean @@ -24,11 +24,32 @@ variable {α : Type*} [DecidableEq α] {s t : Finset α} {n : ℕ} attribute [gcongr] powersetCard_mono -lemma powersetCard_inter : powersetCard n (s ∩ t) = powersetCard n s ∩ powersetCard n t := by - ext; simpa [subset_inter_iff] using and_and_right - -@[simp] lemma disjoint_powersetCard_powersetCard : - Disjoint (powersetCard n s) (powersetCard n t) ↔ #(s ∩ t) < n := by - simp [disjoint_iff_inter_eq_empty, ← powersetCard_inter] +/-- The `(#t + 1)`-subsets of `s` that contain `t ⊆ s` are exactly the sets `insert a t` with +`a ∈ s \ t`. -/ +lemma filter_subset_powersetCard_card_add_one (h : t ⊆ s) : + (powersetCard (#t + 1) s).filter (t ⊆ ·) = (s \ t).image (insert · t) := by + ext u + simp only [mem_filter, mem_powersetCard, mem_image, mem_sdiff] + constructor + · rintro ⟨⟨hus, hu⟩, htu⟩ + have h1 : #(u \ t) = 1 := by rw [card_sdiff_of_subset htu, hu]; omega + obtain ⟨a, ha⟩ := card_eq_one.1 h1 + have hat : a ∈ u \ t := by rw [ha]; exact mem_singleton_self a + rw [mem_sdiff] at hat + refine ⟨a, ⟨hus hat.1, hat.2⟩, ?_⟩ + rw [insert_eq, ← ha, sdiff_union_of_subset htu] + · rintro ⟨a, ⟨has, hat⟩, rfl⟩ + exact ⟨⟨insert_subset has h, card_insert_of_notMem hat⟩, subset_insert _ _⟩ + +/-- A `k`-subset `t` of `s` lies in exactly `#s - k` of the `(k + 1)`-subsets of `s`. -/ +lemma card_filter_subset_powersetCard_card_add_one (h : t ⊆ s) : + #((powersetCard (#t + 1) s).filter (t ⊆ ·)) = #s - #t := by + rw [filter_subset_powersetCard_card_add_one h, card_image_of_injOn, card_sdiff_of_subset h] + intro a ha b _ hab + have : a ∈ insert b t := by + rw [← show insert a t = insert b t from hab] + exact mem_insert_self a t + rw [mem_insert] at this + exact this.resolve_right (mem_sdiff.1 ha).2 end Finset diff --git a/FormalConjecturesForMathlib/Data/Finset/Prod.lean b/FormalConjecturesForMathlib/Data/Finset/Prod.lean new file mode 100644 index 0000000..242c442 --- /dev/null +++ b/FormalConjecturesForMathlib/Data/Finset/Prod.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. +-/ +module + +public import Mathlib.Algebra.Ring.Nat +public import Mathlib.Data.Finset.Prod + +/-! +# Counting strictly ordered pairs in a finset +-/ + +@[expose] public section + +namespace Finset + +/-- Twice the number of pairs `(a, b) ∈ A ×ˢ A` with `a < b` is `|A| * (|A| - 1)`. -/ +theorem two_mul_card_product_filter_lt {β : Type*} [LinearOrder β] (A : Finset β) : + 2 * #{p ∈ A ×ˢ A | p.1 < p.2} = #A * (#A - 1) := by + have h_swap : #{p ∈ A ×ˢ A | p.2 < p.1} = #{p ∈ A ×ˢ A | p.1 < p.2} := + card_equiv (.prodComm ..) (by simp [and_comm]) + have h_union : A.offDiag = {p ∈ A ×ˢ A | p.1 < p.2} ∪ {p ∈ A ×ˢ A | p.2 < p.1} := by + ext ⟨a, b⟩ + simp only [mem_offDiag, mem_union, mem_filter, mem_product, ne_iff_lt_or_gt] + tauto + have h_disj : Disjoint {p ∈ A ×ˢ A | p.1 < p.2} {p ∈ A ×ˢ A | p.2 < p.1} := + disjoint_filter.2 fun _ _ h₁ h₂ ↦ absurd h₂ h₁.not_gt + rw [Nat.mul_sub_one, ← A.offDiag_card, h_union, card_union_of_disjoint h_disj, h_swap, two_mul] + +/-- Twice the number of pairs `(a, b) ∈ A ×ˢ A` with `b < a` is `|A| * (|A| - 1)`. -/ +theorem two_mul_card_product_filter_gt {β : Type*} [LinearOrder β] (A : Finset β) : + 2 * #{p ∈ A ×ˢ A | p.2 < p.1} = #A * (#A - 1) := by + rw [← two_mul_card_product_filter_lt] + congr 1 + exact card_equiv (.prodComm ..) (by simp [and_comm]) + +end Finset diff --git a/FormalConjecturesForMathlib/Data/Finset/ReciprocalSum.lean b/FormalConjecturesForMathlib/Data/Finset/ReciprocalSum.lean index 2d37d20..2b3a797 100644 --- a/FormalConjecturesForMathlib/Data/Finset/ReciprocalSum.lean +++ b/FormalConjecturesForMathlib/Data/Finset/ReciprocalSum.lean @@ -16,7 +16,7 @@ limitations under the License. module public import Mathlib.Algebra.BigOperators.Group.Finset.Basic -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic @[expose] public section diff --git a/FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean b/FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean index e1f06e7..d6ac017 100644 --- a/FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean +++ b/FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean @@ -15,171 +15,25 @@ limitations under the License. -/ module -public import Mathlib.Data.Nat.PrimeFin -public import Mathlib.Order.Lattice.Nat +public import Mathlib.Data.Nat.MaxPrimeFac @[expose] public section namespace Nat -/-- The greatest prime divisor of a natural number `n > 1`. - -Takes the junk value `0` for `n = 0` and `1` for `n = 1`. -/ -def maxPrimeFac (n : ℕ) : ℕ := if n = 1 then 1 else n.primeFactorsList.getLastI - -example : maxPrimeFac 0 = 0 := by decide +kernel -example : maxPrimeFac 1 = 1 := rfl -example : maxPrimeFac 12 = 3 := by decide +kernel -example : maxPrimeFac 97 = 97 := by decide +kernel -example : maxPrimeFac 125 = 5 := by decide +kernel -example : maxPrimeFac 360 = 5 := by decide +kernel - -@[simp] -lemma maxPrimeFac_zero : - maxPrimeFac 0 = 0 := by - simp [maxPrimeFac, List.getLastI] - -@[simp] -lemma maxPrimeFac_one : - maxPrimeFac 1 = 1 := rfl - -lemma prime_maxPrimeFac_of_one_lt (n : ℕ) (h : 1 < n) : - Prime (maxPrimeFac n) := by - have hn : n.primeFactorsList ≠ [] := (primeFactorsList_ne_nil n).2 h - have hmem : n.primeFactorsList.getLast hn ∈ n.primeFactorsList := List.getLast_mem hn - have hprime : Prime (n.primeFactorsList.getLast hn) := prime_of_mem_primeFactorsList hmem - simpa [maxPrimeFac, h.ne', List.getLastI_eq_getLast?_getD, - List.getLast?_eq_getLast_of_ne_nil hn] using hprime - -/-- The greatest prime factor of a natural number divides it. -/ -lemma maxPrimeFac_dvd : ∀ {n : ℕ}, maxPrimeFac n ∣ n - | 0 => by simp - | 1 => by simp - | n + 2 => by - have hn : 1 < n + 2 := by omega - have hlist : (n + 2).primeFactorsList ≠ [] := - (primeFactorsList_ne_nil (n + 2)).2 hn - have hmem : (n + 2).primeFactorsList.getLast hlist ∈ (n + 2).primeFactorsList := - List.getLast_mem hlist - have hdvd : (n + 2).primeFactorsList.getLast hlist ∣ n + 2 := - dvd_of_mem_primeFactorsList hmem - simpa [maxPrimeFac, hn.ne', List.getLastI_eq_getLast?_getD, - List.getLast?_eq_getLast_of_ne_nil hlist] using hdvd - -/-- Every prime factor of a nonzero natural number is at most its greatest prime factor. -/ -lemma le_maxPrimeFac - {n p : ℕ} (hn : n ≠ 0) (hp : p.Prime) (h_dvd : p ∣ n) : - p ≤ maxPrimeFac n := by - have hmem : p ∈ n.primeFactorsList := (mem_primeFactorsList hn).2 ⟨hp, h_dvd⟩ - have hlist : n.primeFactorsList ≠ [] := List.ne_nil_of_mem hmem - have hn_one : n ≠ 1 := ((primeFactorsList_ne_nil n).1 hlist).ne' - have hp_last : p ≤ n.primeFactorsList.getLast hlist := - (primeFactorsList_sorted n).pairwise.rel_getLast hmem - simpa [maxPrimeFac, hn_one, List.getLastI_eq_getLast?_getD, - List.getLast?_eq_getLast_of_ne_nil hlist] using hp_last - -lemma maxPrimeFac_eq_of_dvd_of_le - (n p : ℕ) (hn : 0 < n) (hp : p.Prime) (h_dvd : p ∣ n) (h_le : maxPrimeFac n ≤ p) : - maxPrimeFac n = p := by - exact le_antisymm h_le (le_maxPrimeFac hn.ne' hp h_dvd) - -/-- The greatest prime factor of a prime is the prime itself. -/ -@[simp] -lemma Prime.maxPrimeFac_eq_self {p : ℕ} (hp : p.Prime) : - maxPrimeFac p = p := by - apply maxPrimeFac_eq_of_dvd_of_le p p hp.pos hp (dvd_refl p) - exact Nat.le_of_dvd hp.pos maxPrimeFac_dvd - -/-- The fixed points of `maxPrimeFac` are zero, one, and the primes. -/ -@[simp] -lemma maxPrimeFac_eq_self_iff {n : ℕ} : - maxPrimeFac n = n ↔ n ≤ 1 ∨ n.Prime := by - constructor - · intro h - by_cases hn : n ≤ 1 - · exact Or.inl hn - · exact Or.inr <| h ▸ prime_maxPrimeFac_of_one_lt n (lt_of_not_ge hn) - · rintro (hn | hn) - · obtain rfl | rfl := Nat.le_one_iff_eq_zero_or_eq_one.mp hn <;> simp - · exact hn.maxPrimeFac_eq_self - -/-- The greatest prime factor of a product of nonzero natural numbers is the maximum of their -greatest prime factors. -/ -lemma maxPrimeFac_mul {m n : ℕ} (hm : m ≠ 0) (hn : n ≠ 0) : - maxPrimeFac (m * n) = max (maxPrimeFac m) (maxPrimeFac n) := by - obtain rfl | hm_lt : m = 1 ∨ 1 < m := by omega - · have hle : 1 ≤ maxPrimeFac n := by - obtain rfl | hn_lt : n = 1 ∨ 1 < n := by omega - · simp - · exact (prime_maxPrimeFac_of_one_lt n hn_lt).one_lt.le - simp [hle] - obtain rfl | hn_lt : n = 1 ∨ 1 < n := by omega - · have hle : 1 ≤ maxPrimeFac m := (prime_maxPrimeFac_of_one_lt m hm_lt).one_lt.le - simp [hle] - have hmn_lt : 1 < m * n := Nat.one_lt_mul_iff.mpr - ⟨zero_lt_of_lt hm_lt, zero_lt_of_lt hn_lt, Or.inl hm_lt⟩ - apply le_antisymm - · have hp : Prime (maxPrimeFac (m * n)) := prime_maxPrimeFac_of_one_lt (m * n) hmn_lt - rcases hp.dvd_mul.mp maxPrimeFac_dvd with hpm | hpn - · exact (le_maxPrimeFac hm hp hpm).trans (le_max_left _ _) - · exact (le_maxPrimeFac hn hp hpn).trans (le_max_right _ _) - · apply max_le - · have hp : Prime (maxPrimeFac m) := prime_maxPrimeFac_of_one_lt m hm_lt - apply le_maxPrimeFac (mul_ne_zero hm hn) hp - exact dvd_mul_of_dvd_left maxPrimeFac_dvd n - · have hp : Prime (maxPrimeFac n) := prime_maxPrimeFac_of_one_lt n hn_lt - apply le_maxPrimeFac (mul_ne_zero hm hn) hp - exact dvd_mul_of_dvd_right maxPrimeFac_dvd m - -/-- The greatest prime factor of a nonzero power is the greatest prime factor of its base. -/ -@[simp] -lemma maxPrimeFac_pow {k : ℕ} (hk : k ≠ 0) (n : ℕ) : - maxPrimeFac (n ^ k) = maxPrimeFac n := - match k, hk with - | k + 1, _ => by - by_cases hn : n = 0 - · subst n - simp - induction k with - | zero => simp - | succ k ih => - rw [pow_succ, maxPrimeFac_mul (pow_ne_zero _ hn) hn, ih (by omega)] - simp - -/-- The greatest prime factor of a natural number is at most that number. -/ -lemma maxPrimeFac_le : ∀ {n : ℕ}, maxPrimeFac n ≤ n - | 0 => by simp - | 1 => by simp - | n + 2 => Nat.le_of_dvd (by omega) maxPrimeFac_dvd - -/-- The greatest prime factor of a natural number greater than one is the least upper bound of -its prime factors. -/ -lemma isLeast_maxPrimeFac {n : ℕ} (hn : 1 < n) : - IsLeast (upperBounds {p : ℕ | p.Prime ∧ p ∣ n}) (maxPrimeFac n) := by - constructor - · rintro p ⟨hp, h_dvd⟩ - exact le_maxPrimeFac (zero_lt_of_lt hn).ne' hp h_dvd - · intro b hb - exact hb ⟨prime_maxPrimeFac_of_one_lt n hn, maxPrimeFac_dvd⟩ - -/-- Away from `n = 1`, the computable greatest prime factor agrees with its supremum -characterization. -/ -lemma maxPrimeFac_eq_sSup {n : ℕ} (hn_one : n ≠ 1) : - maxPrimeFac n = sSup {p : ℕ | p.Prime ∧ p ∣ n} := by - obtain rfl | hn : n = 0 ∨ 1 < n := by lia - · simpa using (Set.Infinite.Nat.sSup_eq_zero infinite_setOfPred_prime).symm - · have h_lub : IsLUB {p : ℕ | p.Prime ∧ p ∣ n} (maxPrimeFac n) := - isLeast_maxPrimeFac hn - exact (h_lub.csSup_eq - ⟨maxPrimeFac n, prime_maxPrimeFac_of_one_lt n hn, maxPrimeFac_dvd⟩).symm - -@[simp] -lemma one_lt_maxPrimeFac_iff (n : ℕ) : - 1 < maxPrimeFac n ↔ 1 < n := by - rcases lt_trichotomy n 1 with hn | rfl | hn - · simp only [lt_one_iff] at hn - simp [hn] - · simp - · simpa [hn] using (prime_maxPrimeFac_of_one_lt n hn).one_lt +/-- The upstream implementation agrees with the previously pinned definition, including 0 and 1. -/ +lemma maxPrimeFac_eq_legacy (n : ℕ) : + maxPrimeFac n = if n = 1 then 1 else n.primeFactorsList.getLastI := by + by_cases h : n = 1 + · subst n + simp + · obtain rfl | hn : n = 0 ∨ 1 < n := by omega + · simp [maxPrimeFac, List.getLastI] + · have hlist := (primeFactorsList_ne_nil n).2 hn + cases hs : n.primeFactorsList with + | nil => exact (hlist hs).elim + | cons a as => + simp [maxPrimeFac, h, hs, List.getLastI_eq_getLast?_getD, + List.getLastD_eq_getLast?, List.getLast?_eq_getLast_of_ne_nil (List.cons_ne_nil a as)] end Nat diff --git a/FormalConjecturesForMathlib/Data/Nat/PerfectPower.lean b/FormalConjecturesForMathlib/Data/Nat/PerfectPower.lean index 40df5e4..d4eb7fd 100644 --- a/FormalConjecturesForMathlib/Data/Nat/PerfectPower.lean +++ b/FormalConjecturesForMathlib/Data/Nat/PerfectPower.lean @@ -97,7 +97,7 @@ theorem isPerfectPower_iff_factorization_gcd (n : ℕ) : Nat.div_pos (Nat.le_of_dvd hp_pos h_div) hg_pos have h_ge_p : k ≥ f p := by rw [hk_def] - exact Finset.single_le_prod' (f := f) + exact Finset.single_le_prod (f := f) (fun q hq => Nat.one_le_pow _ _ (Prime.one_le (prime_of_mem_primeFactors hq))) hp have h_ge_2 : f p ≥ 2 := by show p ^ (n.factorization p / g) ≥ 2 diff --git a/FormalConjecturesForMathlib/Data/Nat/Prime/Finset.lean b/FormalConjecturesForMathlib/Data/Nat/Prime/Finset.lean index 59d7a27..80ddb0e 100644 --- a/FormalConjecturesForMathlib/Data/Nat/Prime/Finset.lean +++ b/FormalConjecturesForMathlib/Data/Nat/Prime/Finset.lean @@ -15,7 +15,7 @@ limitations under the License. -/ module -public import Batteries.Data.Nat.Gcd +public import Mathlib.Data.Nat.GCD.Basic public import Mathlib.Algebra.GCDMonoid.Finset public import Mathlib.Algebra.GCDMonoid.Nat diff --git a/FormalConjecturesForMathlib/Data/Set/CountUpTo.lean b/FormalConjecturesForMathlib/Data/Set/CountUpTo.lean new file mode 100644 index 0000000..aff9d12 --- /dev/null +++ b/FormalConjecturesForMathlib/Data/Set/CountUpTo.lean @@ -0,0 +1,46 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Order.Interval.Set.Nat + +/-! +# Counting positive integers in a set + +`Set.countUpTo A N` counts the elements of `A` in the interval `[1, N]`. +-/ + +@[expose] public section + +namespace Set + +/-- The number of elements of a set of natural numbers in $\{1,\ldots,N\}$. -/ +noncomputable def countUpTo (A : Set ℕ) (N : ℕ) : ℕ := + (A ∩ Icc 1 N).ncard + +@[simp] +theorem countUpTo_empty (N : ℕ) : countUpTo ∅ N = 0 := by + simp [countUpTo] + +@[simp] +theorem countUpTo_univ (N : ℕ) : countUpTo univ N = N := by + simp [countUpTo] + +@[simp] +theorem countUpTo_zero (A : Set ℕ) : countUpTo A 0 = 0 := by + simp [countUpTo] + +end Set diff --git a/FormalConjecturesForMathlib/Data/Set/Density.lean b/FormalConjecturesForMathlib/Data/Set/Density.lean index b9431a6..21a7fac 100644 --- a/FormalConjecturesForMathlib/Data/Set/Density.lean +++ b/FormalConjecturesForMathlib/Data/Set/Density.lean @@ -203,6 +203,27 @@ theorem hasDensity_zero_of_finite {S : Set ℕ} (h : S.Finite) : S.HasDensity 0 (tendsto_const_div_atTop_nhds_zero_nat _) (fun _ => div_nonneg (cast_nonneg _) (cast_nonneg _)) this +/-- A finite set of natural numbers has density `0` relative to any infinite set `A` of natural +numbers, because the number of elements of `A` below `b` tends to infinity. -/ +lemma hasDensity_zero_of_finite_of_infinite {T A : Set ℕ} (hT : T.Finite) (hA : A.Infinite) : + T.HasDensity 0 A := by + have hden : Filter.Tendsto (fun b : ℕ => ((A ∩ Set.Iio b).ncard : ℝ)) Filter.atTop + Filter.atTop := by + refine tendsto_natCast_atTop_atTop.comp (Filter.tendsto_atTop_atTop_of_monotone + (fun m n hmn => Set.ncard_le_ncard (Set.inter_subset_inter_right _ + (Set.Iio_subset_Iio hmn)) ((Set.finite_Iio n).inter_of_right A)) fun N => ?_) + obtain ⟨t, htA, htc⟩ := hA.exists_subset_card_eq N + refine ⟨t.sup id + 1, ?_⟩ + have hsub : (t : Set ℕ) ⊆ A ∩ Set.Iio (t.sup id + 1) := fun x hx => + ⟨htA hx, Nat.lt_succ_of_le (Finset.le_sup (f := id) hx)⟩ + simpa [htc] using Set.ncard_le_ncard hsub ((Set.finite_Iio _).inter_of_right A) + refine tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds + (hden.const_div_atTop (T.ncard : ℝ)) (fun b => ?_) (fun b => ?_) + · exact div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _) + · refine div_le_div_of_nonneg_right ?_ (Nat.cast_nonneg _) + refine Nat.cast_le.2 ?_ + exact Set.ncard_le_ncard (fun x hx => hx.1.1) hT + /-- A set of positive natural density is infinite. -/ theorem infinite_of_hasDensity_pos {S : Set ℕ} {α : ℝ} (h : S.HasDensity α) (hα : α ≠ 0) : S.Infinite := diff --git a/FormalConjecturesForMathlib/Data/Sym/Sym2.lean b/FormalConjecturesForMathlib/Data/Sym/Sym2.lean index c72bf9d..e71653f 100644 --- a/FormalConjecturesForMathlib/Data/Sym/Sym2.lean +++ b/FormalConjecturesForMathlib/Data/Sym/Sym2.lean @@ -16,13 +16,3 @@ limitations under the License. module public import Mathlib.Data.Sym.Sym2 - -public section - -namespace Sym2 -variable {α : Type*} {a : α} - -@[simp] lemma fst_out_mk_self : (Quot.out s(a, a)).1 = a := by simpa using out_fst_mem s(a, a) -@[simp] lemma snd_out_mk_self : (Quot.out s(a, a)).2 = a := by simpa using out_snd_mem s(a, a) - -end Sym2 diff --git a/FormalConjecturesForMathlib/Dynamics/SymbolicDynamics/BlockComplexity.lean b/FormalConjecturesForMathlib/Dynamics/SymbolicDynamics/BlockComplexity.lean new file mode 100644 index 0000000..80b6c44 --- /dev/null +++ b/FormalConjecturesForMathlib/Dynamics/SymbolicDynamics/BlockComplexity.lean @@ -0,0 +1,156 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLog +public import Mathlib.Data.EReal.Inv +public import Mathlib.Basic.Real.ENatENNReal +public import Mathlib.Data.Set.Card +public import Mathlib.Order.LiminfLimsup + +/-! +# Block complexity and entropy of a sequence + +The block complexity $p(n, a)$ of a sequence $a$ is the number of distinct blocks of $n$ +consecutive terms of $a$. The entropy of $a$ is the exponential growth rate of $p(n, a)$. + +An eventually periodic sequence has bounded block complexity and zero entropy. In particular +$p(n, a) \le n$ for some $n \ge 1$. This is the easy direction of the Morse–Hedlund theorem. + +*References:* +- [AS03] Allouche, Jean-Paul, and Jeffrey Shallit. "Automatic sequences: theory, applications, + generalizations." Cambridge University Press, 2003. Chapter 10. +- [Bug12] Bugeaud, Yann. "Distribution modulo one and Diophantine approximation." + Vol. 193. Cambridge University Press, 2012. Chapter 10. + +## Main definitions + +* `SymbolicDynamics.blockComplexity`: the number of distinct blocks of length `n` of a sequence. +* `SymbolicDynamics.blockEntropy`: the entropy of a sequence. +* `SymbolicDynamics.IsEventuallyPeriodic`: a sequence is eventually periodic. +-/ + +@[expose] public section + +open Filter + +open scoped ENNReal + +namespace SymbolicDynamics + +/-- +The block complexity $p(n, a)$ of a sequence $a$, that is, the number of distinct blocks +$a_k a_{k+1} \cdots a_{k+n-1}$ of $n$ consecutive terms of $a$. It is `⊤` when $n \ge 1$ and +$a$ takes infinitely many values. +-/ +noncomputable def blockComplexity {α : Type*} (a : ℕ → α) (n : ℕ) : ℝ≥0∞ := + {w : Fin n → α | ∃ k, ∀ i, w i = a (k + i)}.encard + +/-- +The entropy of a sequence $a$, +$$E(a) = \lim_{n \to \infty} \frac{\log p(n, a)}{n}.$$ +The limit exists because $n \mapsto \log p(n, a)$ is subadditive, so it agrees with the `limsup` +used here. The value is `⊤` exactly when $a$ takes infinitely many values. +-/ +noncomputable def blockEntropy {α : Type*} (a : ℕ → α) : EReal := + limsup (fun n : ℕ ↦ (blockComplexity a n).log / (n : EReal)) atTop + +/-- A constant sequence has exactly one block of each length. -/ +theorem blockComplexity_const {α : Type*} (c : α) (n : ℕ) : + blockComplexity (fun _ ↦ c) n = 1 := by + have h : {w : Fin n → α | ∃ k : ℕ, ∀ i, w i = (fun _ : ℕ ↦ c) (k + (i : ℕ))} + = {fun _ ↦ c} := by + ext w + simp [funext_iff] + simp only [blockComplexity, h, Set.encard_singleton, ENat.toENNReal_one] + +/-- A constant sequence has zero entropy. -/ +theorem blockEntropy_const {α : Type*} (c : α) : blockEntropy (fun _ ↦ c) = 0 := by + simp [blockEntropy, blockComplexity_const] + +/-- Every sequence has at least one block of each length. -/ +theorem one_le_blockComplexity {α : Type*} (a : ℕ → α) (n : ℕ) : 1 ≤ blockComplexity a n := by + have : ({fun i : Fin n ↦ a (0 + i)} : Set _) ⊆ {w : Fin n → α | ∃ k, ∀ i, w i = a (k + i)} := by + rintro w rfl + exact ⟨0, fun i ↦ rfl⟩ + simpa [blockComplexity] using ENat.toENNReal_le.2 (Set.encard_le_encard this) + +/-- The block complexity is monotone: every block of length $n$ extends to a block of length +$n + 1$. -/ +theorem blockComplexity_mono {α : Type*} (a : ℕ → α) : Monotone (blockComplexity a) := by + refine monotone_nat_of_le_succ fun n ↦ ENat.toENNReal_le.2 ?_ + calc _ ≤ ((fun (w : Fin (n + 1) → α) (i : Fin n) ↦ w i.castSucc) '' + {w | ∃ k, ∀ i, w i = a (k + i)}).encard := by + refine Set.encard_le_encard ?_ + rintro w ⟨k, hk⟩ + exact ⟨fun i ↦ a (k + i), ⟨k, fun i ↦ rfl⟩, funext fun i ↦ (hk i).symm⟩ + _ ≤ _ := Set.encard_image_le _ _ + +/-- A sequence $a$ is eventually periodic if there is a period $p > 0$ with $a(n + p) = a(n)$ for +all sufficiently large $n$. -/ +def IsEventuallyPeriodic {α : Type*} (a : ℕ → α) : Prop := + ∃ p > 0, ∀ᶠ n in atTop, a (n + p) = a n + +/-- An eventually periodic sequence has bounded block complexity. -/ +theorem IsEventuallyPeriodic.blockComplexity_le {α : Type*} {a : ℕ → α} + (h : IsEventuallyPeriodic a) : ∃ C : ℕ, 0 < C ∧ ∀ n, blockComplexity a n ≤ C := by + obtain ⟨p, hp, hN⟩ := h + obtain ⟨N, hN⟩ := eventually_atTop.1 hN + have hper (m n : ℕ) (hn : N ≤ n) : a (n + m * p) = a n := by + induction m with + | zero => simp + | succ m ih => rw [add_mul, one_mul, ← add_assoc, hN _ (by nlinarith), ih] + refine ⟨N + p, by omega, fun n ↦ ?_⟩ + have : {w : Fin n → α | ∃ k, ∀ i, w i = a (k + i)} ⊆ + (fun k (i : Fin n) ↦ a (k + i)) '' ↑(Finset.range (N + p)) := by + rintro w ⟨k, hk⟩ + by_cases hk' : k < N + p + · exact ⟨k, by simpa using hk', funext fun i ↦ (hk i).symm⟩ + · have h1 := Nat.mod_add_div' (k - N) p + have h2 := Nat.mod_lt (k - N) hp + refine ⟨N + (k - N) % p, Finset.mem_coe.2 (Finset.mem_range.2 (by omega)), + funext fun i ↦ ?_⟩ + dsimp only + rw [hk, ← hper ((k - N) / p) (N + (k - N) % p + i) (by omega)] + congr 1 + omega + have := (Set.encard_le_encard this).trans (Set.encard_image_le _ _) + rw [Set.encard_coe_eq_coe_finsetCard] at this + simpa [blockComplexity] using ENat.toENNReal_le.2 this + +/-- An eventually periodic sequence satisfies $p(n, a) \le n$ for some $n \ge 1$. This is the +easy direction of the Morse–Hedlund theorem. -/ +theorem IsEventuallyPeriodic.exists_blockComplexity_le {α : Type*} {a : ℕ → α} + (h : IsEventuallyPeriodic a) : ∃ n, 0 < n ∧ blockComplexity a n ≤ n := by + obtain ⟨C, hC, hle⟩ := h.blockComplexity_le + exact ⟨C, hC, hle C⟩ + +/-- An eventually periodic sequence has zero entropy. -/ +theorem IsEventuallyPeriodic.blockEntropy_eq_zero {α : Type*} {a : ℕ → α} + (h : IsEventuallyPeriodic a) : blockEntropy a = 0 := by + obtain ⟨C, hC, hle⟩ := h.blockComplexity_le + have hlim : Tendsto (fun n : ℕ ↦ ((Real.log C / n : ℝ) : EReal)) atTop (nhds 0) := + (continuous_coe_real_ereal.tendsto 0).comp (tendsto_const_div_atTop_nhds_zero_nat _) + refine le_antisymm ((limsup_le_limsup (Eventually.of_forall fun n ↦ ?_)).trans_eq + hlim.limsup_eq) (le_limsup_of_le (by isBoundedDefault) fun x hx ↦ ?_) + · rw [EReal.coe_div, EReal.coe_coe_eq_natCast, ← ENNReal.log_ofReal_of_pos (by positivity), + ENNReal.ofReal_natCast] + exact EReal.div_le_div_right_of_nonneg (by positivity) (ENNReal.log_le_log (hle n)) + · obtain ⟨n, hn⟩ := hx.exists + refine le_trans (EReal.div_nonneg ?_ (by positivity)) hn + simpa using ENNReal.log_le_log (one_le_blockComplexity a n) + +end SymbolicDynamics diff --git a/FormalConjecturesForMathlib/FieldTheory/AbsoluteGaloisGroup.lean b/FormalConjecturesForMathlib/FieldTheory/AbsoluteGaloisGroup.lean new file mode 100644 index 0000000..8d9c5ea --- /dev/null +++ b/FormalConjecturesForMathlib/FieldTheory/AbsoluteGaloisGroup.lean @@ -0,0 +1,26 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +/- +The copied Mathlib source carries the following attribution: +Copyright (c) 2023 María Inés de Frutos-Fernández. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: María Inés de Frutos-Fernández +-/ +module + +public import Mathlib.FieldTheory.AbsoluteGaloisGroup + +/-! Production Mathlib already provides these restriction maps. -/ diff --git a/FormalConjecturesForMathlib/FieldTheory/MilnorKTheory.lean b/FormalConjecturesForMathlib/FieldTheory/MilnorKTheory.lean new file mode 100644 index 0000000..755bba6 --- /dev/null +++ b/FormalConjecturesForMathlib/FieldTheory/MilnorKTheory.lean @@ -0,0 +1,337 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Algebra.BigOperators.Fin +public import Mathlib.Algebra.DualNumber +public import Mathlib.Algebra.RingQuot +public import Mathlib.Data.ZMod.Basic +public import Mathlib.LinearAlgebra.TensorAlgebra.Basic + +@[expose] public section + +/-! +# Milnor K-theory of a field modulo `ℓ`, symbols and symbol length + +Milnor [Milnor1970] defined the graded ring $K^M_*(F)$ of a field $F$ as the quotient of the +tensor algebra of the abelian group $F^\times$, written additively, by the two-sided ideal +generated by the elements $\{a\} \otimes \{b\}$ with $a + b = 1$ (the Steinberg relations). +This file defines: + +* `MilnorK F ℓ`: the ring $K^M_*(F)/\ell$, the quotient of `TensorAlgebra ℤ (Additive Fˣ)` by + the Steinberg relations and the relation `ℓ = 0`. For `ℓ = 0` it is $K^M_*(F)$ itself; +* `MilnorK.of ℓ a`: the class $\{a\}$ of a unit `a`; +* `MilnorK.symbol ℓ a`: the symbol $\{a_1, \dots, a_n\} = \{a_1\} \cdots \{a_n\}$ of an + `n`-tuple of units; +* `MilnorK.grade F ℓ n`: the degree-`n` part $K^M_n(F)/\ell$, the additive subgroup generated + by the symbols of degree `n`; +* `MilnorK.symbolLengthBounds F ℓ n`: the set of `m` such that every element of + $K^M_n(F)/\ell$ is a sum of at most `m` symbols. Its least element, when it exists, is the + *symbol length* of $K^M_n(F)/\ell$ [Krashen2024, §2.1.3.4]. +* `MilnorK.augmentation F ℓ`: the augmentation $K^M_*(F)/\ell \to \mathbb{Z}/\ell$, which + shows that `MilnorK F ℓ` is nontrivial for `ℓ ≠ 1` (`MilnorK.nontrivial`); +* `MilnorK.toDualNumber F ℓ φ`: the map to the dual numbers $(\mathbb{Z}/\ell)[\varepsilon]$ + attached to a homomorphism $\varphi \colon F^\times \to \mathbb{Z}/\ell$. It detects degree + one, so the Steinberg relations do not collapse $K^M_1(F)/\ell$ (`MilnorK.of_ne_zero`, + `MilnorK.grade_one_ne_bot`). It says nothing about the degrees `≥ 2`, where the symbol length + problem lives. + +In degree `0` the symbols are all equal to the empty product `1`, so $K^M_0(F)/\ell = \mathbb{Z}/\ell$ +has symbol length `ℓ - 1` for `ℓ ≥ 1` (`MilnorK.isLeast_symbolLengthBounds_zero`). In degree `1` +every class is a single symbol, so the symbol length of $K^M_1(F)/\ell$ is at most `1` +(`MilnorK.one_mem_symbolLengthBounds_one`), with equality as soon as the group is nonzero +(`MilnorK.isLeast_symbolLengthBounds_one`). + +The defining ideal is homogeneous, so the degree-`n` part of the quotient is the image of the +degree-`n` part of the tensor algebra, which is spanned by the symbols. No numeric symbol +length is defined, so that no convention is needed when `symbolLengthBounds F ℓ n` is empty. + +## References + +* [Milnor1970] J. Milnor, *Algebraic K-theory and quadratic forms*, Invent. Math. 9 (1970), + 318–344, [doi:10.1007/BF01425486](https://doi.org/10.1007/BF01425486). +* [Krashen2024] D. Krashen, *PCMI Summer School (not quite) notes*, notes for the minicourse + *Field arithmetic and the complexity of algebraic objects*, PCMI Graduate Summer School on + Motivic Homotopy Theory, 2024, draft of 24 July 2024, + [pdf](https://www.ias.edu/sites/default/files/pcmi-2024-07-24%20krashen.pdf). +-/ + +open TensorAlgebra + +variable (F : Type*) [Field F] + +namespace MilnorK + +/-- The relations defining `K^M_*(F)/ℓ` as a quotient of the tensor algebra of `Fˣ`: the +Steinberg relation `{a}{b} = 0` when `a + b = 1`, and the relation `ℓ = 0`. -/ +inductive Rel (ℓ : ℕ) : TensorAlgebra ℤ (Additive Fˣ) → TensorAlgebra ℤ (Additive Fˣ) → Prop + | steinberg (a b : Fˣ) (h : (a : F) + (b : F) = 1) : + Rel ℓ (ι ℤ (Additive.ofMul a) * ι ℤ (Additive.ofMul b)) 0 + | natCast : Rel ℓ (ℓ : TensorAlgebra ℤ (Additive Fˣ)) 0 + +end MilnorK + +/-- The Milnor K-ring `K^M_*(F)/ℓ` of the field `F` with coefficients in `ℤ/ℓ`. For `ℓ = 0` +this is the Milnor K-ring `K^M_*(F)`. -/ +abbrev MilnorK (ℓ : ℕ) := RingQuot (MilnorK.Rel F ℓ) + +namespace MilnorK + +variable {F} (ℓ : ℕ) + +/-- The class `{a}` of a unit `a` in `K^M_1(F)/ℓ`. -/ +def of (a : Fˣ) : MilnorK F ℓ := RingQuot.mkRingHom (Rel F ℓ) (ι ℤ (Additive.ofMul a)) + +@[simp] +theorem of_one : of ℓ (1 : Fˣ) = 0 := by + simp [of] + +@[simp] +theorem of_mul (a b : Fˣ) : of ℓ (a * b) = of ℓ a + of ℓ b := by + simp [of] + +@[simp] +theorem of_inv (a : Fˣ) : of ℓ a⁻¹ = -of ℓ a := by + simp [of] + +@[simp] +theorem of_pow (a : Fˣ) (k : ℕ) : of ℓ (a ^ k) = k • of ℓ a := by + induction k with + | zero => simp + | succ k ih => rw [pow_succ, of_mul, ih, succ_nsmul] + +/-- The class map `{·} : Fˣ → K^M_1(F)/ℓ` as an additive homomorphism. -/ +def ofHom : Additive Fˣ →+ MilnorK F ℓ where + toFun a := of ℓ a.toMul + map_zero' := by simp + map_add' a b := by simp [of_mul] + +@[simp] +theorem ofHom_apply (a : Additive Fˣ) : ofHom ℓ a = of ℓ a.toMul := rfl + +/-- The Steinberg relation `{a}{b} = 0` when `a + b = 1`. -/ +theorem of_mul_of_eq_zero (a b : Fˣ) (h : (a : F) + (b : F) = 1) : of ℓ a * of ℓ b = 0 := by + rw [of, of, ← map_mul, RingQuot.mkRingHom_rel (Rel.steinberg a b h), map_zero] + +/-- The relation `ℓ = 0` in `K^M_*(F)/ℓ`. -/ +@[simp] +theorem natCast_eq_zero : (ℓ : MilnorK F ℓ) = 0 := by + rw [← map_natCast (RingQuot.mkRingHom (Rel F ℓ)), + RingQuot.mkRingHom_rel (Rel.natCast (F := F) (ℓ := ℓ)), map_zero] + +/-- The symbol `{a 0, …, a (n - 1)} = {a 0} ⋯ {a (n - 1)}` of an `n`-tuple of units. -/ +def symbol {n : ℕ} (a : Fin n → Fˣ) : MilnorK F ℓ := (List.ofFn fun i ↦ of ℓ (a i)).prod + +@[simp] +theorem symbol_zero (a : Fin 0 → Fˣ) : symbol ℓ a = 1 := by + simp [symbol] + +theorem symbol_succ {n : ℕ} (a : Fin (n + 1) → Fˣ) : + symbol ℓ a = of ℓ (a 0) * symbol ℓ (fun i ↦ a i.succ) := by + simp [symbol, List.ofFn_succ] + +@[simp] +theorem symbol_one (a : Fin 1 → Fˣ) : symbol ℓ a = of ℓ (a 0) := by + simp [symbol_succ] + +theorem symbol_pair (a b : Fˣ) : symbol ℓ ![a, b] = of ℓ a * of ℓ b := by + simp [symbol_succ] + +/-- The Steinberg relation `{a, b} = 0` when `a + b = 1`. -/ +theorem symbol_pair_eq_zero (a b : Fˣ) (h : (a : F) + (b : F) = 1) : symbol ℓ ![a, b] = 0 := by + rw [symbol_pair, of_mul_of_eq_zero ℓ a b h] + +variable (F) + +/-- The degree-`n` part `K^M_n(F)/ℓ` of `K^M_*(F)/ℓ`: the additive subgroup generated by the +symbols of degree `n`. -/ +def grade (n : ℕ) : AddSubgroup (MilnorK F ℓ) := + AddSubgroup.closure (Set.range (symbol ℓ : (Fin n → Fˣ) → MilnorK F ℓ)) + +theorem symbol_mem_grade {n : ℕ} (a : Fin n → Fˣ) : symbol ℓ a ∈ grade F ℓ n := + AddSubgroup.subset_closure ⟨a, rfl⟩ + +/-- The set of `m` such that every element of `K^M_n(F)/ℓ` is a sum of at most `m` symbols. +Its least element, when it exists, is the symbol length of `K^M_n(F)/ℓ`. -/ +def symbolLengthBounds (n : ℕ) : Set ℕ := + {m | ∀ x ∈ grade F ℓ n, ∃ k ≤ m, ∃ s : Fin k → Fin n → Fˣ, x = ∑ i, symbol ℓ (s i)} + +theorem mem_symbolLengthBounds_of_le {m m' n : ℕ} (h : m ∈ symbolLengthBounds F ℓ n) + (hm : m ≤ m') : m' ∈ symbolLengthBounds F ℓ n := + fun x hx ↦ let ⟨k, hk, s, hs⟩ := h x hx; ⟨k, hk.trans hm, s, hs⟩ + +theorem zero_mem_symbolLengthBounds_iff {n : ℕ} : + 0 ∈ symbolLengthBounds F ℓ n ↔ grade F ℓ n = ⊥ := by + constructor + · intro h + rw [eq_bot_iff] + intro x hx + obtain ⟨k, hk, s, rfl⟩ := h x hx + obtain rfl : k = 0 := Nat.le_zero.mp hk + simp + · intro h x hx + rw [h, AddSubgroup.mem_bot] at hx + exact ⟨0, le_rfl, Fin.elim0, by simp [hx]⟩ + +/-- If every unit of `F` is an `ℓ`-th power, then `K^M_n(F)/ℓ = 0` for `n ≥ 1`. -/ +theorem grade_eq_bot_of_forall_exists_pow_eq (h : ∀ a : Fˣ, ∃ b : Fˣ, b ^ ℓ = a) {n : ℕ} + (hn : n ≠ 0) : grade F ℓ n = ⊥ := by + rw [eq_bot_iff, grade, AddSubgroup.closure_le] + rintro _ ⟨a, rfl⟩ + obtain ⟨k, rfl⟩ := Nat.exists_eq_add_one_of_ne_zero hn + obtain ⟨b, hb⟩ := h (a 0) + rw [SetLike.mem_coe, AddSubgroup.mem_bot, symbol_succ, ← hb, of_pow, nsmul_eq_mul, + natCast_eq_zero, zero_mul, zero_mul] + +/-- The augmentation `K^M_*(F)/ℓ → ℤ/ℓ`, which sends every class `{a}` to `0`. -/ +def augmentation : MilnorK F ℓ →+* ZMod ℓ := + RingQuot.lift ⟨(TensorAlgebra.lift ℤ (0 : Additive Fˣ →ₗ[ℤ] ZMod ℓ)).toRingHom, by + intro x y h + cases h with + | steinberg a b h => simp + | natCast => simp⟩ + +@[simp] +theorem augmentation_of (a : Fˣ) : augmentation F ℓ (of ℓ a) = 0 := by + simp [augmentation, of, RingQuot.lift_mkRingHom_apply] + +/-- `K^M_*(F)/ℓ` is nontrivial for `ℓ ≠ 1`, since the augmentation maps it onto `ℤ/ℓ`. -/ +theorem nontrivial (hℓ : ℓ ≠ 1) : Nontrivial (MilnorK F ℓ) := by + have : Nontrivial (ZMod ℓ) := by + obtain _ | _ | k := ℓ + · exact ZMod.nontrivial' + · exact absurd rfl hℓ + · have : Fact (1 < k + 2) := ⟨by omega⟩ + infer_instance + exact (augmentation F ℓ).domain_nontrivial + +/-- The empty symbol is `1`, so `1 ∈ K^M_0(F)/ℓ`. -/ +theorem one_mem_grade_zero : (1 : MilnorK F ℓ) ∈ grade F ℓ 0 := by + simpa using symbol_mem_grade F ℓ (Fin.elim0 : Fin 0 → Fˣ) + +/-- `K^M_0(F)/ℓ = ℤ/ℓ` is generated by the empty symbol `1`. -/ +theorem mem_grade_zero_iff {x : MilnorK F ℓ} : x ∈ grade F ℓ 0 ↔ ∃ z : ℤ, (z : MilnorK F ℓ) = x := by + simp [grade, Set.range_unique, AddSubgroup.mem_closure_singleton] + +/-- Every bound on the symbol length of `K^M_0(F)/ℓ = ℤ/ℓ` is at least `ℓ - 1`: the augmentation +sends a sum of `j` empty symbols to `j`, so the class of `ℓ - 1` needs at least `ℓ - 1` symbols. -/ +theorem sub_one_le_of_mem_symbolLengthBounds_zero {k : ℕ} (hℓ : 0 < ℓ) + (hk : k ∈ symbolLengthBounds F ℓ 0) : ℓ - 1 ≤ k := by + have hx : ((ℓ - 1 : ℕ) : MilnorK F ℓ) ∈ grade F ℓ 0 := by + simpa using (grade F ℓ 0).nsmul_mem (one_mem_grade_zero F ℓ) (ℓ - 1) + obtain ⟨j, hj, s, hs⟩ := hk _ hx + have heq : ((ℓ - 1 : ℕ) : ZMod ℓ) = (j : ZMod ℓ) := by + simpa using congrArg (augmentation F ℓ) hs + by_contra h + have := congrArg ZMod.val heq + rw [ZMod.val_natCast_of_lt (by omega), ZMod.val_natCast_of_lt (by omega)] at this + omega + +/-- Every element of `K^M_0(F)/ℓ = ℤ/ℓ` is a sum of at most `ℓ - 1` empty symbols. -/ +theorem sub_one_mem_symbolLengthBounds_zero (hℓ : 0 < ℓ) : ℓ - 1 ∈ symbolLengthBounds F ℓ 0 := by + intro x hx + obtain ⟨z, rfl⟩ := (mem_grade_zero_iff F ℓ).mp hx + have hℓ' : (ℓ : ℤ) ≠ 0 := by omega + refine ⟨(z % ℓ).toNat, ?_, fun _ ↦ Fin.elim0, ?_⟩ + · have := Int.emod_lt_of_pos z (by omega : (0 : ℤ) < ℓ) + omega + · calc (z : MilnorK F ℓ) = ((z % ℓ : ℤ) : MilnorK F ℓ) := by + simp [Int.emod_def, natCast_eq_zero] + _ = ((((z % ℓ).toNat : ℕ) : ℤ) : MilnorK F ℓ) := by + rw [Int.toNat_of_nonneg (Int.emod_nonneg z hℓ')] + _ = (((z % ℓ).toNat : ℕ) : MilnorK F ℓ) := Int.cast_natCast _ + _ = ∑ _i : Fin (z % ℓ).toNat, symbol ℓ (Fin.elim0 : Fin 0 → Fˣ) := by simp + +/-- For `ℓ ≥ 1`, the symbol length of `K^M_0(F)/ℓ = ℤ/ℓ` is `ℓ - 1`. -/ +theorem isLeast_symbolLengthBounds_zero (hℓ : 0 < ℓ) : + IsLeast (symbolLengthBounds F ℓ 0) (ℓ - 1) := + ⟨sub_one_mem_symbolLengthBounds_zero F ℓ hℓ, + fun _ hk ↦ sub_one_le_of_mem_symbolLengthBounds_zero F ℓ hℓ hk⟩ + +/-! ### Degree one + +Degree one is completely understood: every class of `K^M_1(F)/ℓ` is a single symbol, and the +dual-number map below shows that `K^M_1(F)/ℓ` is nonzero as soon as some homomorphism +`Fˣ → ℤ/ℓ` is. So the symbol length question in degree `1` is not vacuous. Degrees `≥ 2` get no +such certificate here: that `K^M_n(F)/ℓ ≠ 0` for `n ≥ 2` needs genuine input, such as a +nontrivial division algebra for `n = 2`. -/ + +/-- The map to the dual numbers `(ℤ/ℓ)[ε]` attached to a homomorphism `φ : Fˣ → ℤ/ℓ`: it sends +`{a}` to `φ(a) ε` and kills every product of two classes of degree one, so in particular it +kills the Steinberg relations. -/ +noncomputable def toDualNumber (φ : Additive Fˣ →+ ZMod ℓ) : + MilnorK F ℓ →+* DualNumber (ZMod ℓ) := + RingQuot.lift ⟨(TensorAlgebra.lift ℤ + ((TrivSqZeroExt.inrHom (ZMod ℓ) (ZMod ℓ)).restrictScalars ℤ ∘ₗ + φ.toIntLinearMap)).toRingHom, by + intro x y h + cases h with + | steinberg a b _ => + simp + apply TrivSqZeroExt.ext <;> simp + | natCast => + refine (TrivSqZeroExt.ext ?_ ?_).trans (map_zero _).symm <;> + simp [TrivSqZeroExt.fst_natCast, TrivSqZeroExt.snd_natCast]⟩ + +@[simp] +theorem toDualNumber_of (φ : Additive Fˣ →+ ZMod ℓ) (a : Fˣ) : + toDualNumber F ℓ φ (of ℓ a) = TrivSqZeroExt.inr (φ (Additive.ofMul a)) := by + simp [toDualNumber, of, RingQuot.lift_mkRingHom_apply] + +/-- Degree one does not collapse: if a homomorphism `φ : Fˣ → ℤ/ℓ` is nonzero on `a`, then the +class `{a}` is nonzero in `K^M_1(F)/ℓ`. -/ +theorem of_ne_zero (φ : Additive Fˣ →+ ZMod ℓ) (a : Fˣ) + (hφ : φ (Additive.ofMul a) ≠ 0) : of ℓ a ≠ 0 := + fun h ↦ hφ (by simpa using congrArg (fun x ↦ (toDualNumber F ℓ φ x).snd) h) + +/-- `K^M_1(F)/ℓ ≠ 0` whenever some homomorphism `φ : Fˣ → ℤ/ℓ` is nonzero. -/ +theorem grade_one_ne_bot (φ : Additive Fˣ →+ ZMod ℓ) (a : Fˣ) + (hφ : φ (Additive.ofMul a) ≠ 0) : grade F ℓ 1 ≠ ⊥ := by + intro h + refine of_ne_zero F ℓ φ a hφ ?_ + have ha := symbol_mem_grade F ℓ (fun _ ↦ a : Fin 1 → Fˣ) + rw [h, AddSubgroup.mem_bot] at ha + simpa using ha + +/-- `K^M_1(F)/ℓ` is the image of `Fˣ`, since sums and negatives of degree-one symbols are again +degree-one symbols. -/ +theorem grade_one : grade F ℓ 1 = (ofHom (F := F) ℓ).range := by + refine le_antisymm ?_ ?_ + · rw [grade, AddSubgroup.closure_le] + rintro _ ⟨s, rfl⟩ + exact ⟨Additive.ofMul (s 0), by simp⟩ + · rintro _ ⟨a, rfl⟩ + simpa using symbol_mem_grade F ℓ (fun _ ↦ a.toMul : Fin 1 → Fˣ) + +/-- Every class in `K^M_1(F)/ℓ` is a single symbol. -/ +theorem one_mem_symbolLengthBounds_one : 1 ∈ symbolLengthBounds F ℓ 1 := by + intro x hx + obtain ⟨a, rfl⟩ := (grade_one F ℓ).le hx + exact ⟨1, le_rfl, fun _ _ ↦ a.toMul, by simp⟩ + +/-- `0` is not a bound for the symbol length in degree `1` when `K^M_1(F)/ℓ ≠ 0`. -/ +theorem zero_notMem_symbolLengthBounds_one (h : grade F ℓ 1 ≠ ⊥) : + 0 ∉ symbolLengthBounds F ℓ 1 := + fun hk ↦ h ((zero_mem_symbolLengthBounds_iff F ℓ).mp hk) + +/-- The symbol length of `K^M_1(F)/ℓ` is `1` as soon as the group is nonzero. Use +`MilnorK.grade_one_ne_bot` to get the hypothesis from a homomorphism `Fˣ → ℤ/ℓ`. -/ +theorem isLeast_symbolLengthBounds_one (h : grade F ℓ 1 ≠ ⊥) : + IsLeast (symbolLengthBounds F ℓ 1) 1 := + ⟨one_mem_symbolLengthBounds_one F ℓ, fun _ hk ↦ Nat.one_le_iff_ne_zero.mpr fun hk0 ↦ + zero_notMem_symbolLengthBounds_one F ℓ h (hk0 ▸ hk)⟩ + +end MilnorK diff --git a/FormalConjecturesForMathlib/Geometry/2d.lean b/FormalConjecturesForMathlib/Geometry/2d.lean index 8dc9f7f..d3040a5 100644 --- a/FormalConjecturesForMathlib/Geometry/2d.lean +++ b/FormalConjecturesForMathlib/Geometry/2d.lean @@ -217,6 +217,14 @@ Let $g(n)$ be the maximum number of distinct values the $R(x_i)$ can take.-/ noncomputable def maximalDistinctDistancesFrom (n : ℕ) : ℕ := sSup {#(X.image (distinctDistancesFrom X)) | (X : Finset ℝ²) (_ : #X = n)} +/-- `NoFourConcyclic X` means that no four distinct points of `X` lie on a common circle. + +In the plane, `Cospherical` means lying on a common circle. Four distinct collinear points are +never cospherical, so collinear points are allowed. Stated for `Set ℝ²`; a `Finset` argument +coerces. -/ +def NoFourConcyclic (X : Set ℝ²) : Prop := + ∀ T ⊆ X, T.ncard = 4 → ¬Cospherical T + /-- A collection $x_1, \dots, x_n\in\mathbb{R}^2$ is in _general position_ if no three are collinear and no four lie on a circle. @@ -241,6 +249,20 @@ def IsIsoscelesTrapezoid (a b c d : ℝ²) : Prop := (affineSpan ℝ {a, b}).Parallel (affineSpan ℝ {c, d}) ∧ dist a c = dist b d +/-- A line in the plane: an affine subspace of `ℝ²` whose direction is one-dimensional. -/ +def IsLine (L : AffineSubspace ℝ ℝ²) : Prop := + Module.finrank ℝ L.direction = 1 + +/-- +The set of lines in $\mathbb{R}^2$ containing exactly $k$ points from a given set $S$. + +Only lines through two distinct points of $S$ are considered, so a line with fewer than two +points of $S$ is never counted. +-/ +noncomputable def linesWithPointsFor (k : ℕ) (S : Set ℝ²) : Set (AffineSubspace ℝ ℝ²) := + let determined_lines := { affineSpan ℝ {p, q} | (p ∈ S) (q ∈ S) (_ : p ≠ q) } + { L ∈ determined_lines | (↑L ∩ S).ncard = k } + end EuclideanGeometry def IsIsosceles {α : Type*} [Dist α] (p q r : α) : Prop := @@ -248,3 +270,11 @@ def IsIsosceles {α : Type*} [Dist α] (p q r : α) : Prop := nonrec def Set.IsIsosceles {α : Type} [Dist α] (A : Set α) := Nonempty A ∧ A.Triplewise (IsIsosceles · · ·) + +/-- A set is isosceles-free if no three distinct points in it form an isosceles triangle. -/ +def Set.IsIsoscelesFree {α : Type*} [Dist α] (A : Set α) : Prop := + A.Triplewise fun x y z ↦ ¬ _root_.IsIsosceles x y z + +theorem Set.IsIsoscelesFree.mono {α : Type*} [Dist α] {s t : Set α} (h : t ⊆ s) + (hs : s.IsIsoscelesFree) : t.IsIsoscelesFree := + Set.Triplewise.mono h hs diff --git a/FormalConjecturesForMathlib/Geometry/Group/Hyperbolic.lean b/FormalConjecturesForMathlib/Geometry/Group/Hyperbolic.lean new file mode 100644 index 0000000..63a3897 --- /dev/null +++ b/FormalConjecturesForMathlib/Geometry/Group/Hyperbolic.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. +-/ +/- Original Mathlib authors: Hang Lu Su, Katerina Hristova. -/ +module + +public import FormalConjecturesForMathlib.Geometry.Group.WordMetric +public import FormalConjecturesForMathlib.Topology.MetricSpace.Hyperbolic + +/-! +# Hyperbolic groups + +A finitely generated group is hyperbolic if its induced metric space with respect to a chosen family +of `Group.Generators` satisfies the Gromov hyperbolicity condition. + +This is being upstreamed to Mathlib in leanprover-community/mathlib4#44339. + +TODO: delete this file when this repository moves to a Mathlib version that contains it. + +## Main definitions + +* `Group.Generators.IsHyperbolicWith`: A group is `δ`-hyperbolic with respect to a generating + family `P` if its induced metric space is `δ`-hyperbolic. +* `Group.IsHyperbolic`: A group `G` is hyperbolic if there exists a finite generating family `P` + and a constant `δ` such that `G` is `δ`-hyperbolic with respect to `P`. + +## Main results + +* `[Group.IsHyperbolic G] : Group.FG G`: Every hyperbolic group is finitely generated. +* `[Finite G] : Group.IsHyperbolic G`: Every finite group is hyperbolic. + +## Implementation notes + +The hyperbolicity condition applies directly to the word metric, without requiring the Cayley graph. +-/ + +@[expose] public section + +namespace Group + +variable {G ι : Type*} [Group G] + +/-- A group is `δ`-hyperbolic with respect to a generating family `P` if its induced metric space is +`δ`-hyperbolic. -/ +def Generators.IsHyperbolicWith (P : Generators G ι) (δ : ℝ) : Prop := + letI := P.normedGroup + Metric.IsHyperbolicWith G δ + +/-- A group `G` is hyperbolic if there exists a finite generating family `P` and a constant `δ` such +that `G` is `δ`-hyperbolic with respect to `P`. -/ +class IsHyperbolic (G : Type*) [Group G] : Prop where + exists_isHyperbolicWith (G) : ∃ (n : ℕ) (P : Generators G (Fin n)) (δ : ℝ), P.IsHyperbolicWith δ + +/-- Every hyperbolic group is finitely generated. -/ +instance [IsHyperbolic G] : FG G := by + obtain ⟨_, P, _, _⟩ := IsHyperbolic.exists_isHyperbolicWith G + exact P.fg + +/-- Every finite group is hyperbolic. -/ +instance [Finite G] : IsHyperbolic G := + let ⟨n, ⟨P⟩⟩ := fg_iff_nonempty_finite_generators.mp inferInstance + ⟨n, P, Metric.IsHyperbolic.exists_isHyperbolicWith⟩ + +end Group diff --git a/FormalConjecturesForMathlib/Geometry/Group/WordMetric.lean b/FormalConjecturesForMathlib/Geometry/Group/WordMetric.lean new file mode 100644 index 0000000..6e9b66b --- /dev/null +++ b/FormalConjecturesForMathlib/Geometry/Group/WordMetric.lean @@ -0,0 +1,21 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +/- Original Mathlib author: Hang Lu Su. -/ +module + +public import Mathlib.Geometry.Group.WordMetric + +/-! This backport is provided by production Mathlib. -/ diff --git a/FormalConjecturesForMathlib/Geometry/Group/WordProd.lean b/FormalConjecturesForMathlib/Geometry/Group/WordProd.lean new file mode 100644 index 0000000..bea4a4f --- /dev/null +++ b/FormalConjecturesForMathlib/Geometry/Group/WordProd.lean @@ -0,0 +1,21 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +/- Original Mathlib author: Hang Lu Su. -/ +module + +public import Mathlib.Geometry.Group.WordProd + +/-! This backport is provided by production Mathlib. -/ diff --git a/FormalConjecturesForMathlib/Geometry/Manifold/LieGroupPresentation.lean b/FormalConjecturesForMathlib/Geometry/Manifold/LieGroupPresentation.lean new file mode 100644 index 0000000..6f75a87 --- /dev/null +++ b/FormalConjecturesForMathlib/Geometry/Manifold/LieGroupPresentation.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. +-/ +module + +public import Mathlib.Geometry.Manifold.Algebra.LieGroup +public import Mathlib.Geometry.Manifold.Instances.Real +public import Mathlib.Topology.Algebra.ContinuousMonoidHom + +/-! +# Topological groups admitting a Lie group structure + +A topological group `G` *admits a Lie group structure* if it is continuously isomorphic to a +finite-dimensional real-analytic Lie group. Lie groups are Hausdorff but not assumed to be second +countable: every discrete group is a `0`-dimensional Lie group. + +## Main definitions + +- `LieGroupPresentation G n`: a continuous group isomorphism from `G` to an `n`-dimensional + real-analytic Lie group. +- `AdmitsLieGroupStructure G`: `G` has a `LieGroupPresentation` in some finite dimension. + +## Main results + +- `admitsLieGroupStructure_of_lieGroup`: a Hausdorff real-analytic Lie group admits a Lie group + structure. +- `admitsLieGroupStructure_of_discreteTopology`: a discrete group admits a Lie group structure. +- `AdmitsLieGroupStructure.locallyCompactSpace`: a group admitting a Lie group structure is + locally compact. +-/ + +@[expose] public section + +open scoped Manifold ContDiff + +universe u + +variable {G : Type*} [Group G] [TopologicalSpace G] + +/-- A continuous group isomorphism from `G` to an `n`-dimensional real-analytic Lie group. +The Lie group is not assumed to be second countable. -/ +structure LieGroupPresentation (G : Type u) [TopologicalSpace G] [Group G] (n : ℕ) where + carrier : Type u + [topologicalSpace : TopologicalSpace carrier] + [group : Group carrier] + [t2Space : T2Space carrier] + [chartedSpace : ChartedSpace (EuclideanSpace ℝ (Fin n)) carrier] + [isManifold : IsManifold (𝓡 n) ω carrier] + [lieGroup : LieGroup (𝓡 n) ω carrier] + equiv : G ≃ₜ* carrier + +/-- A topological group admits a Lie group structure if it has a `LieGroupPresentation` in some +finite dimension. -/ +def AdmitsLieGroupStructure (G : Type u) [Group G] [TopologicalSpace G] : Prop := + ∃ n, Nonempty (LieGroupPresentation G n) + +/-- Every Hausdorff finite-dimensional real-analytic Lie group admits a Lie group structure. -/ +theorem admitsLieGroupStructure_of_lieGroup {n : ℕ} [T2Space G] + [ChartedSpace (EuclideanSpace ℝ (Fin n)) G] [LieGroup (𝓡 n) ω G] : + AdmitsLieGroupStructure G := + ⟨n, ⟨{ carrier := G, equiv := ContinuousMulEquiv.refl G }⟩⟩ + +/-- Every discrete group is a `0`-dimensional Lie group. -/ +theorem admitsLieGroupStructure_of_discreteTopology [DiscreteTopology G] : + AdmitsLieGroupStructure G := by + let := ChartedSpace.ofDiscreteTopology (M := G) (H := EuclideanSpace ℝ (Fin 0)) + have := IsManifold.of_discreteTopology (𝕜 := ℝ) (M := G) (E := EuclideanSpace ℝ (Fin 0)) ω + have : LieGroup (𝓡 0) ω G := + { contMDiff_mul := contMDiff_of_discreteTopology + contMDiff_inv := contMDiff_of_discreteTopology } + exact admitsLieGroupStructure_of_lieGroup (n := 0) + +/-- A group admitting a Lie group structure is locally compact. -/ +theorem AdmitsLieGroupStructure.locallyCompactSpace (h : AdmitsLieGroupStructure G) : + LocallyCompactSpace G := by + obtain ⟨k, ⟨p⟩⟩ := h + let := p.topologicalSpace + let := p.group + let := p.chartedSpace + have := (𝓡 k).locallyCompactSpace + have : LocallyCompactSpace p.carrier := + ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin k)) p.carrier + exact p.equiv.toHomeomorph.locallyCompactSpace_iff.mpr inferInstance diff --git a/FormalConjecturesForMathlib/Geometry/Metric.lean b/FormalConjecturesForMathlib/Geometry/Metric.lean index 5c059ed..53006c4 100644 --- a/FormalConjecturesForMathlib/Geometry/Metric.lean +++ b/FormalConjecturesForMathlib/Geometry/Metric.lean @@ -16,8 +16,12 @@ limitations under the License. module public import FormalConjecturesForMathlib.Data.Sym.Sym2 +public import Mathlib.Algebra.BigOperators.Ring.Finset public import Mathlib.Data.Finset.Sym +public import Mathlib.Data.Nat.Choose.Basic public import Mathlib.Data.Sym.Card +public import Mathlib.Data.ZMod.Basic +public import Mathlib.Order.Lattice.Nat public import Mathlib.Topology.MetricSpace.Defs @[expose] public section @@ -41,6 +45,11 @@ between pairs of points. noncomputable def distinctDistances (points : Finset X) : ℕ := #(distanceSet points) +variable (X) in +/-- The minimum number of distinct distances determined by a set of `n` points in `X`. -/ +noncomputable def minimalDistinctDistancesIn (n : ℕ) : ℕ := + sInf {m : ℕ | ∃ points : Finset X, #points = n ∧ distinctDistances points = m} + /-- The multiplicity of the distance `d` determined by `points`, that is, the number of unordered pairs of distinct points at distance `d` apart. -/ noncomputable def distanceMultiplicity (points : Finset X) (d : ℝ) : ℕ := @@ -51,6 +60,12 @@ between a given point and all other points. -/ noncomputable def distinctDistancesFrom (points : Finset X) (pt : X) : ℕ := #(points.image fun x => dist x pt) +open Classical in +/-- Given a finite set of points in a metric space, we define the number of distinct distances +between a given point and all other points. -/ +noncomputable def distinctDistancesFromOther (points : Finset X) (pt : X) : ℕ := + #((points.erase pt).image fun x => dist x pt) + open Classical in /-- The number of unit-distance pairs of a finite set of `n` points is at most $\binom{n}{2}$, the total number of unordered pairs of distinct points. -/ @@ -64,3 +79,34 @@ theorem unitDistNum_le_choose_two (s : Finset X) : unitDistNum s ≤ (#s).choose obtain ⟨-, rfl⟩ : _ ∧ x = y := Finset.mem_diag.mp hxy simp at hpd · exact h + +/-- The ordered pairs of distinct points of `points` at distance `d` come in swapped pairs, so +there are evenly many of them. -/ +theorem even_card_offDiag_filter_dist_eq (points : Finset X) (d : ℝ) : + Even #(points.offDiag.filter fun (pair : X × X) => dist pair.1 pair.2 = d) := by + set F := points.offDiag.filter fun (pair : X × X) => dist pair.1 pair.2 = d with hF + rw [← ZMod.natCast_eq_zero_iff_even] + have h : ∑ _a ∈ F, (1 : ZMod 2) = 0 := by + refine Finset.sum_involution (fun a _ => a.swap) (fun a _ => by decide) ?_ ?_ + (fun a _ => Prod.swap_swap a) + · intro a ha _ hsw + have := (Finset.mem_offDiag.1 (Finset.mem_filter.1 ha).1).2.2 + exact this (Prod.ext_iff.1 hsw).1.symm + · intro a ha + obtain ⟨hoff, hd⟩ := Finset.mem_filter.1 ha + obtain ⟨h1, h2, h3⟩ := Finset.mem_offDiag.1 hoff + exact Finset.mem_filter.2 ⟨Finset.mem_offDiag.2 ⟨h2, h1, Ne.symm h3⟩, by + simpa [dist_comm] using hd⟩ + simpa [Finset.sum_const, nsmul_eq_mul] using h + +/-- The multiplicities of the distances determined by `points` add up to the number of +unordered pairs of distinct points. -/ +theorem sum_distanceMultiplicity (points : Finset X) : + ∑ d ∈ distanceSet points, distanceMultiplicity points d = (#points).choose 2 := by + unfold distanceSet distanceMultiplicity + rw [← Nat.sum_div (fun d _ => even_iff_two_dvd.1 (even_card_offDiag_filter_dist_eq points d)), + ← Finset.card_eq_sum_card_image (fun (pair : X × X) => dist pair.1 pair.2) points.offDiag, + Finset.offDiag_card, Nat.choose_two_right] + rcases Nat.eq_zero_or_pos #points with h | h + · simp [h] + · rw [Nat.mul_sub_one] diff --git a/FormalConjecturesForMathlib/Geometry/OrdinaryLines.lean b/FormalConjecturesForMathlib/Geometry/OrdinaryLines.lean new file mode 100644 index 0000000..cc18db6 --- /dev/null +++ b/FormalConjecturesForMathlib/Geometry/OrdinaryLines.lean @@ -0,0 +1,330 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Analysis.InnerProductSpace.Basic +public import Mathlib.Data.Finset.Max +public import Mathlib.Data.Set.Card +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional +public import Mathlib.Tactic.Abel +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.FinCases +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.Module +public import Mathlib.Tactic.NormNum +public import Mathlib.Tactic.Positivity +public import Mathlib.Tactic.Ring + +/-! +# Ordinary lines and the Sylvester–Gallai theorem + +An ordinary line meets a finite point set in exactly two points. Every finite +noncollinear set in a real inner product space has an ordinary line. + +The proof uses the minimum positive point-to-line distance argument. + +*Reference:* [Mo51] Motzkin, T. S., *The lines and planes connecting the points of a finite set*. +Transactions of the American Mathematical Society 70 (1951), 451–464. +-/ + +@[expose] public section + +namespace SylvesterGallai + +open RealInnerProductSpace + +variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] + +private noncomputable def areaSq (u v : V) : ℝ := + ‖u‖ ^ 2 * ‖v‖ ^ 2 - ⟪u, v⟫ ^ 2 + +private lemma areaSq_nonneg (u v : V) : 0 ≤ areaSq u v := by + have h := abs_real_inner_le_norm u v + have := pow_le_pow_left₀ (abs_nonneg ⟪u, v⟫) h 2 + dsimp [areaSq] + nlinarith [sq_abs ⟪u, v⟫] + +private lemma areaSq_comm (u v : V) : areaSq u v = areaSq v u := by + simp only [areaSq, real_inner_comm v u] + ring + +private lemma areaSq_smul (u v : V) (t : ℝ) : + areaSq (t • u) v = t ^ 2 * areaSq u v := by + simp [areaSq, norm_smul, real_inner_smul_left, mul_pow] + ring + +private lemma areaSq_shear (u v : V) (t : ℝ) : areaSq u (v + t • u) = areaSq u v := by + simp only [areaSq, norm_add_sq_real, inner_add_right, real_inner_smul_right, + norm_smul, Real.norm_eq_abs, mul_pow, sq_abs, real_inner_self_eq_norm_sq, + real_inner_comm v u] + ring + +private lemma areaSq_zero_iff {u v : V} (hu : u ≠ 0) : + areaSq u v = 0 ↔ ∃ t : ℝ, v = t • u := by + have hn : 0 < ‖u‖ ^ 2 := by positivity + constructor + · intro h + refine ⟨⟪u, v⟫ / ‖u‖ ^ 2, ?_⟩ + have hz : ‖v - (⟪u, v⟫ / ‖u‖ ^ 2) • u‖ ^ 2 = 0 := by + rw [norm_sub_sq_real] + simp only [real_inner_smul_right, norm_smul, Real.norm_eq_abs, mul_pow, sq_abs, + real_inner_comm v u] + dsimp [areaSq] at h + field_simp + rw [← real_inner_comm u v] at h + nlinarith + have : v - (⟪u, v⟫ / ‖u‖ ^ 2) • u = 0 := by + exact norm_eq_zero.mp ((pow_eq_zero_iff (by norm_num : 2 ≠ 0)).mp hz) + exact sub_eq_zero.mp this + · rintro ⟨t, rfl⟩ + simp [areaSq, norm_smul, real_inner_smul_right, mul_pow] + ring + +private lemma mem_line {a b x : V} : + x ∈ line[ℝ, a, b] ↔ ∃ t : ℝ, x = a + t • (b - a) := by + rw [mem_affineSpan_pair_iff_exists_lineMap_eq] + simp only [AffineMap.lineMap_apply, vsub_eq_sub, vadd_eq_add] + constructor <;> rintro ⟨t, ht⟩ <;> exact ⟨t, by simpa [add_comm] using ht.symm⟩ + +private noncomputable def heightSq (p a b : V) : ℝ := + areaSq (b - a) (p - a) / ‖b - a‖ ^ 2 + +private lemma areaSq_pos {p a b : V} (hab : a ≠ b) (hp : p ∉ line[ℝ, a, b]) : + 0 < areaSq (b - a) (p - a) := by + refine lt_of_le_of_ne (areaSq_nonneg _ _) ?_ + intro h + obtain ⟨t, ht⟩ := (areaSq_zero_iff (sub_ne_zero.mpr hab.symm)).mp h.symm + apply hp + exact mem_line.mpr ⟨t, by rw [← ht]; abel⟩ + +private lemma off_line {a b p x y : V} (hp : p ∉ line[ℝ, a, b]) + (hx : x ∈ line[ℝ, a, b]) (hy : y ∈ line[ℝ, a, b]) (hxy : x ≠ y) : + x ∉ line[ℝ, p, y] := by + intro h + have hc := collinear_insert_of_mem_affineSpan_pair h + have hp' : p ∈ line[ℝ, x, y] := + hc.mem_affineSpan_of_mem_of_ne (by simp) (by simp) (by simp) hxy + exact hp ((affineSpan_pair_le_of_mem_of_mem hx hy) hp') + +private lemma areaSq_triangle (p x y : V) : + areaSq (y - p) (x - p) = areaSq (x - y) (p - y) := by + have h₁ : x - p = (x - y) + (y - p) := by abel + have h₂ : p - y = -(y - p) := by abel + rw [h₁] + have he := areaSq_shear (y - p) (x - y) 1 + simp only [one_smul] at he + rw [he, areaSq_comm, h₂] + simp only [areaSq, norm_neg, inner_neg_right, neg_sq] + +/-- Kelly's strict inequality for two points on the same side of the perpendicular foot. -/ +private lemma heightSq_lt {a b p x y : V} (hab : a ≠ b) (hp : p ∉ line[ℝ, a, b]) + (hx : x ∈ line[ℝ, a, b]) (hy : y ∈ line[ℝ, a, b]) + (hs : 0 ≤ ⟪x - p, b - a⟫ * ⟪y - p, b - a⟫) + (ho : ⟪x - p, b - a⟫ ^ 2 ≤ ⟪y - p, b - a⟫ ^ 2) : + heightSq x p y < heightSq p a b := by + obtain ⟨s, hx'⟩ := mem_line.mp hx + obtain ⟨t, hy'⟩ := mem_line.mp hy + let v := b - a + let A := areaSq v (p - a) + let X := ⟪x - p, v⟫ + let Y := ⟪y - p, v⟫ + have hv : 0 < ‖v‖ ^ 2 := by + have : v ≠ 0 := sub_ne_zero.mpr hab.symm + positivity + have hA : 0 < A := areaSq_pos hab hp + have hy₀ : y - p ≠ 0 := sub_ne_zero.mpr (fun h => hp (h ▸ hy)) + have hypos : 0 < ‖y - p‖ ^ 2 := by positivity + have hd : Y - X = (t - s) * ‖v‖ ^ 2 := by + dsimp [X, Y] + rw [← inner_sub_left] + have : y - p - (x - p) = (t - s) • v := by rw [hx', hy']; module + rw [this, real_inner_smul_left, real_inner_self_eq_norm_sq] + have ha : areaSq (y - p) (x - p) = (s - t) ^ 2 * A := by + rw [areaSq_triangle] + have h₁ : x - y = (s - t) • v := by rw [hx', hy']; module + have h₂ : p - y = (p - a) + (-t) • v := by rw [hy']; module + rw [h₁, h₂, areaSq_smul, areaSq_shear] + have hn : ‖y - p‖ ^ 2 * ‖v‖ ^ 2 = A + Y ^ 2 := by + have h : areaSq v (y - p) = A := by + have : y - p = -(p - a) + t • v := by rw [hy']; module + rw [this, areaSq_shear] + change areaSq v (-(p - a)) = areaSq v (p - a) + simp only [areaSq, norm_neg, inner_neg_right, neg_sq] + dsimp [areaSq, A, Y] at h ⊢ + rw [← real_inner_comm v (y - p)] at h + linarith + have hXY : X ^ 2 ≤ X * Y := by + nlinarith [sq_nonneg (X * Y - X ^ 2)] + have hstrict : (Y - X) ^ 2 < A + Y ^ 2 := by nlinarith + rw [heightSq, heightSq, div_lt_div_iff₀ hypos hv] + have heq : areaSq (y - p) (x - p) * ‖v‖ ^ 2 * ‖v‖ ^ 2 = A * (Y - X) ^ 2 := by + rw [ha, hd] + ring + have hmul := mul_lt_mul_of_pos_left hstrict hA + rw [← hn, ← heq] at hmul + nlinarith + +private lemma same_side_pair (f : Fin 3 → ℝ) : + ∃ i j, i ≠ j ∧ 0 ≤ f i * f j ∧ (f i) ^ 2 ≤ (f j) ^ 2 := by + have hsign : 0 ≤ f 0 * f 1 ∨ 0 ≤ f 1 * f 2 ∨ 0 ≤ f 0 * f 2 := by + rcases le_total 0 (f 0) with h₀ | h₀ <;> + rcases le_total 0 (f 1) with h₁ | h₁ <;> + rcases le_total 0 (f 2) with h₂ | h₂ <;> + first | (left; nlinarith) | (right; left; nlinarith) | (right; right; nlinarith) + have hpair (i j : Fin 3) (hij : i ≠ j) (hs : 0 ≤ f i * f j) : + ∃ i j, i ≠ j ∧ 0 ≤ f i * f j ∧ (f i) ^ 2 ≤ (f j) ^ 2 := by + rcases le_total ((f i) ^ 2) ((f j) ^ 2) with ho | ho + · exact ⟨i, j, hij, hs, ho⟩ + · exact ⟨j, i, hij.symm, by simpa [mul_comm] using hs, ho⟩ + rcases hsign with h | h | h + · exact hpair 0 1 (by decide) h + · exact hpair 1 2 (by decide) h + · exact hpair 0 2 (by decide) h + +private lemma exists_off_line (s : Finset V) (hs : ¬ Collinear ℝ (s : Set V)) : + ∃ p ∈ s, ∃ a ∈ s, ∃ b ∈ s, a ≠ b ∧ p ∉ line[ℝ, a, b] := by + classical + by_contra! h + apply hs + rcases s.eq_empty_or_nonempty with rfl | ⟨a, ha⟩ + · simpa using collinear_empty ℝ V + by_cases hall : ∀ b ∈ s, b = a + · exact (collinear_singleton ℝ a).subset (by simpa using hall) + push Not at hall + obtain ⟨b, hb, hba⟩ := hall + rw [collinear_iff_of_mem ha] + refine ⟨b - a, ?_⟩ + intro p hp + obtain ⟨t, ht⟩ := mem_line.mp (h p hp a ha b hb hba.symm) + exact ⟨t, by simpa [vadd_eq_add, add_comm] using ht⟩ + +/-- A finite noncollinear subset of a real inner product space has an ordinary line. -/ +theorem exists_ordinary_line (s : Finset V) (hs : ¬ Collinear ℝ (s : Set V)) : + ∃ a ∈ s, ∃ b ∈ s, a ≠ b ∧ ∀ p ∈ s, p ∈ line[ℝ, a, b] → p = a ∨ p = b := by + classical + let T := (s ×ˢ s ×ˢ s).filter + (fun q : V × V × V => q.2.1 ≠ q.2.2 ∧ q.1 ∉ line[ℝ, q.2.1, q.2.2]) + have hT (p a b : V) : (p, a, b) ∈ T ↔ + p ∈ s ∧ a ∈ s ∧ b ∈ s ∧ a ≠ b ∧ p ∉ line[ℝ, a, b] := by + simp [T, and_assoc] + obtain ⟨p, hp, a, ha, b, hb, hab, hpab⟩ := exists_off_line s hs + have hne : T.Nonempty := ⟨(p, a, b), (hT p a b).mpr ⟨hp, ha, hb, hab, hpab⟩⟩ + obtain ⟨⟨p, a, b⟩, hmem, hmin⟩ := + T.exists_min_image (fun q => heightSq q.1 q.2.1 q.2.2) hne + obtain ⟨hp, ha, hb, hab, hpab⟩ := (hT p a b).mp hmem + refine ⟨a, ha, b, hb, hab, ?_⟩ + intro c hc hcL + by_contra! h + let q : Fin 3 → V := ![a, b, c] + have hqS (i) : q i ∈ s := by fin_cases i <;> assumption + have hqL (i) : q i ∈ line[ℝ, a, b] := by + fin_cases i + · exact left_mem_affineSpan_pair ℝ a b + · exact right_mem_affineSpan_pair ℝ a b + · exact hcL + have hq : Function.Injective q := by + intro i j hij + fin_cases i <;> fin_cases j <;> simp_all [q] + let f : Fin 3 → ℝ := fun i => ⟪q i - p, b - a⟫ + obtain ⟨i, j, hij, hsign, horder⟩ := same_side_pair f + have hpj : p ≠ q j := fun he => hpab (he ▸ hqL j) + have hnew : (q i, p, q j) ∈ T := (hT _ _ _).mpr + ⟨hqS i, hp, hqS j, hpj, off_line hpab (hqL i) (hqL j) (fun he => hij (hq he))⟩ + exact (not_lt_of_ge (hmin _ hnew)) + (heightSq_lt hab hpab (hqL i) (hqL j) hsign horder) + +end SylvesterGallai + +namespace EuclideanGeometry + +variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] + +/-- The distinct ordinary lines of a finite point set. The image removes duplicate lines. -/ +noncomputable def ordinaryLines (s : Finset V) : Finset (AffineSubspace ℝ V) := by + classical + exact (((s ×ˢ s).filter fun p => p.1 ≠ p.2).image + fun p => line[ℝ, p.1, p.2]).filter fun L => (s.filter fun p => p ∈ L).card = 2 + +open scoped Classical in +/-- Membership records two distinct points generating a line with exactly two incidences. -/ +theorem mem_ordinaryLines {s : Finset V} {L : AffineSubspace ℝ V} : + L ∈ ordinaryLines s ↔ + (∃ a ∈ s, ∃ b ∈ s, a ≠ b ∧ line[ℝ, a, b] = L) ∧ + (s.filter fun p => p ∈ L).card = 2 := by + classical + simp only [ordinaryLines, Finset.mem_filter, Finset.mem_image, Finset.mem_product] + aesop + +/-- Every line counted by `ordinaryLines` is one-dimensional. -/ +theorem isLine_of_mem_ordinaryLines {s : Finset V} {L : AffineSubspace ℝ V} + (hL : L ∈ ordinaryLines s) : Module.finrank ℝ L.direction = 1 := by + obtain ⟨⟨a, _, b, _, hab, rfl⟩, _⟩ := mem_ordinaryLines.mp hL + rw [direction_affineSpan, vectorSpan_pair] + exact finrank_span_singleton (vsub_ne_zero.mpr hab) + +/-- The counted lines are precisely the geometric lines meeting the point set in two points. -/ +theorem ordinaryLines_eq {s : Finset V} {L : AffineSubspace ℝ V} : + L ∈ ordinaryLines s ↔ + Module.finrank ℝ L.direction = 1 ∧ ((s : Set V) ∩ (L : Set V)).ncard = 2 := by + classical + have hcard : ((s : Set V) ∩ (L : Set V)).ncard = + (s.filter fun p => p ∈ L).card := by + rw [← Set.ncard_coe_finset] + congr 1 + ext p + simp + rw [hcard] + constructor + · exact fun h => ⟨isLine_of_mem_ordinaryLines h, (mem_ordinaryLines.mp h).2⟩ + · rintro ⟨hline, h⟩ + obtain ⟨a, b, hab, habs⟩ := Finset.card_eq_two.mp h + have ha : a ∈ s ∧ a ∈ L := by + have : a ∈ s.filter fun p => p ∈ L := by rw [habs]; simp + exact Finset.mem_filter.mp this + have hb : b ∈ s ∧ b ∈ L := by + have : b ∈ s.filter fun p => p ∈ L := by rw [habs]; simp + exact Finset.mem_filter.mp this + have : FiniteDimensional ℝ L.direction := + FiniteDimensional.of_finrank_pos (by rw [hline]; norm_num) + have heq : line[ℝ, a, b] = L := by + apply (AffineSubspace.eq_iff_direction_eq_of_mem + (left_mem_affineSpan_pair ℝ a b) ha.2).mpr + apply Submodule.eq_of_le_of_finrank_eq + · exact AffineSubspace.direction_le (affineSpan_pair_le_of_mem_of_mem ha.2 hb.2) + · rw [direction_affineSpan, vectorSpan_pair, finrank_span_singleton (vsub_ne_zero.mpr hab)] + exact hline.symm + exact mem_ordinaryLines.mpr ⟨⟨a, ha.1, b, hb.1, hab, heq⟩, h⟩ + +/-- Sylvester–Gallai supplies an ordinary line for every noncollinear finite set. -/ +theorem ordinaryLines_nonempty {s : Finset V} (hs : ¬ Collinear ℝ (s : Set V)) : + (ordinaryLines s).Nonempty := by + classical + obtain ⟨a, ha, b, hb, hab, h⟩ := SylvesterGallai.exists_ordinary_line s hs + refine ⟨line[ℝ, a, b], mem_ordinaryLines.mpr ⟨⟨a, ha, b, hb, hab, rfl⟩, ?_⟩⟩ + have heq : (s.filter fun p => p ∈ line[ℝ, a, b]) = {a, b} := by + ext p + simp only [Finset.mem_filter, Finset.mem_insert, Finset.mem_singleton] + constructor + · exact fun hp => h p hp.1 hp.2 + · intro hp + rcases hp with hp | hp + · subst p + exact ⟨ha, left_mem_affineSpan_pair ℝ a b⟩ + · subst p + exact ⟨hb, right_mem_affineSpan_pair ℝ a b⟩ + simp [heq, hab] + +end EuclideanGeometry diff --git a/FormalConjecturesForMathlib/GroupTheory/DerivedLength.lean b/FormalConjecturesForMathlib/GroupTheory/DerivedLength.lean new file mode 100644 index 0000000..291269e --- /dev/null +++ b/FormalConjecturesForMathlib/GroupTheory/DerivedLength.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. +-/ +module + +public import Mathlib.GroupTheory.Solvable +public import Mathlib.Order.Lattice.Nat + +@[expose] public section + +/-! +# Derived length + +`Group.derivedLength G` is the length of the derived series of `G`: the least `k` with +`derivedSeries G k = ⊥`, which exists exactly when `G` is solvable (`Group.IsSolvable`). +-/ + +namespace Group + +variable (G : Type*) [Group G] + +/-- The derived length of `G`: the least `k` with `derivedSeries G k = ⊥`. It is `0` if there is +none, that is, if `G` is not solvable. -/ +noncomputable def derivedLength : ℕ := sInf {k : ℕ | derivedSeries G k = ⊥} + + +theorem derivedLength_of_not_isSolvable (h : ¬ IsSolvable G) : derivedLength G = 0 := by + have : {k : ℕ | derivedSeries G k = ⊥} = ∅ := + Set.eq_empty_of_forall_notMem fun k hk => h ⟨⟨k, hk⟩⟩ + simp [derivedLength, this] + +theorem derivedLength_of_subsingleton [Subsingleton G] : derivedLength G = 0 := + Nat.sInf_eq_zero.mpr (Or.inl (by simpa using Subgroup.eq_bot_of_subsingleton ⊤)) + +example [IsSimpleGroup G] : derivedLength G = 1 ↔ IsMulCommutative G := by + rw [←commutator_eq_bot_iff, derivedLength, ←derivedSeries_one] + refine ⟨fun hk => ?_, fun hk => ?_⟩ + · change 1 ∈ {k : ℕ | derivedSeries G k = ⊥} + rw [←hk] + apply Nat.sInf_mem (by grind [Nat.nonempty_of_pos_sInf]) + · apply le_antisymm + · apply Nat.sInf_le + grind + · by_contra! h + change 1 ∈ {k : ℕ | derivedSeries G k = ⊥} at hk + grind [ Nat.sInf_eq_zero, derivedSeries_zero, top_ne_bot] + +end Group diff --git a/FormalConjecturesForMathlib/GroupTheory/ElementOrders.lean b/FormalConjecturesForMathlib/GroupTheory/ElementOrders.lean new file mode 100644 index 0000000..bc4a6f1 --- /dev/null +++ b/FormalConjecturesForMathlib/GroupTheory/ElementOrders.lean @@ -0,0 +1,48 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Data.Set.Card +public import Mathlib.GroupTheory.OrderOfElement + +@[expose] public section + +/-! +# Orders of elements + +* `Group.numElementOrders G`: the number of distinct orders of elements of `G`; +* `Group.maxElementOrder G`: the largest order of an element; +* `Group.numInvolutions G`: the number of elements of order `2`. +-/ + +namespace Group + +variable (G : Type*) [Group G] + +/-- The number of distinct orders of elements of `G`. -/ +noncomputable def numElementOrders : ℕ := (Set.range (orderOf : G → ℕ)).ncard + +/-- The largest order of an element of `G` (`0` if the orders are unbounded). -/ +noncomputable def maxElementOrder : ℕ := sSup (Set.range (orderOf : G → ℕ)) + +/-- The number of involutions of `G`, its elements of order `2`. -/ +noncomputable def numInvolutions : ℕ := {g : G | orderOf g = 2}.ncard + + +theorem numInvolutions_le_card [Finite G] : numInvolutions G ≤ Nat.card G := + Set.ncard_le_card _ + +end Group diff --git a/FormalConjecturesForMathlib/GroupTheory/GroupAction/InvolutionFixedPoints.lean b/FormalConjecturesForMathlib/GroupTheory/GroupAction/InvolutionFixedPoints.lean new file mode 100644 index 0000000..3d349ec --- /dev/null +++ b/FormalConjecturesForMathlib/GroupTheory/GroupAction/InvolutionFixedPoints.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. +-/ +module + +public import Mathlib.Data.Set.Card +public import Mathlib.GroupTheory.GroupAction.Defs +public import Mathlib.GroupTheory.GroupAction.FixedPoints +public import Mathlib.GroupTheory.OrderOfElement + +@[expose] public section + +/-! +# Fixed points of involutions + +* `MulAction.minInvolutionFixedPoints G α`: the least number of points fixed by an element of + order at most `2`; +* `MulAction.maxInvolutionFixedPoints G α`: the largest number of points fixed by an involution. + +If `G` is the Galois group of a polynomial over $\mathbb{Q}$, acting on its complex roots, then +complex conjugation restricts to an element of `G` of order at most `2`, and the real roots are +the points that it fixes. So the number of real roots is at least `minInvolutionFixedPoints G α`. +If some root is not real, complex conjugation has order `2`, and the number of real roots is also +at most `maxInvolutionFixedPoints G α`. This upper bound needs a non-real root: the roots of +$x^2 - 2$ are real and the only involution swaps them, so the maximum is `0`. +-/ + +namespace MulAction + +variable (G α : Type*) [Group G] [MulAction G α] + +/-- The least number of points fixed by an element of order at most `2`; it is `Nat.card α` +if `G` has no involution, since the identity fixes every point. -/ +noncomputable def minInvolutionFixedPoints : ℕ := + sInf {k : ℕ | ∃ g : G, g ^ 2 = 1 ∧ (fixedBy α g).ncard = k} + +/-- The largest number of points fixed by an involution (`0` if `G` has none). -/ +noncomputable def maxInvolutionFixedPoints : ℕ := + sSup {k : ℕ | ∃ g : G, orderOf g = 2 ∧ (fixedBy α g).ncard = k} + + +/-- The identity has order at most `2` and fixes every point. -/ +theorem minInvolutionFixedPoints_le_card [Finite α] : + minInvolutionFixedPoints G α ≤ Nat.card α := + Nat.sInf_le ⟨1, one_pow 2, by rw [fixedBy_one_eq_univ, Set.ncard_univ]⟩ + +end MulAction diff --git a/FormalConjecturesForMathlib/GroupTheory/GroupAction/MovedPoints.lean b/FormalConjecturesForMathlib/GroupTheory/GroupAction/MovedPoints.lean new file mode 100644 index 0000000..f65fb27 --- /dev/null +++ b/FormalConjecturesForMathlib/GroupTheory/GroupAction/MovedPoints.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. +-/ +module + +public import Mathlib.Data.Set.Card +public import Mathlib.GroupTheory.GroupAction.Defs +public import Mathlib.Order.Lattice.Nat + +@[expose] public section + +/-! +# Moved points and the minimal degree + +* `MulAction.movedPoints G α`: the points of `α` moved by some element of `G`; +* `MulAction.numMovedPoints G α`: their number, the degree of a permutation group; +* `MulAction.minimalDegree G α`: the least number of points moved by an element that moves one. +-/ + +namespace MulAction + +variable (G α : Type*) [Group G] [MulAction G α] + +/-- The points moved by some element of `G`. -/ +def movedPoints : Set α := {a : α | ∃ g : G, g • a ≠ a} + +/-- The number of points moved by some element of `G`. -/ +noncomputable def numMovedPoints : ℕ := (movedPoints G α).ncard + +/-- The least number of points moved by an element that moves some point (`0` if no element +moves a point). -/ +noncomputable def minimalDegree : ℕ := + sInf {k : ℕ | ∃ g : G, (fixedBy α g)ᶜ.Nonempty ∧ (fixedBy α g)ᶜ.ncard = k} + + +@[simp] +theorem movedPoints_of_subsingleton [Subsingleton G] : movedPoints G α = ∅ := by + ext a + simp [movedPoints, Subsingleton.elim _ (1 : G)] + +@[simp] +theorem numMovedPoints_of_subsingleton [Subsingleton G] : numMovedPoints G α = 0 := by + simp [numMovedPoints] + +end MulAction diff --git a/FormalConjecturesForMathlib/GroupTheory/GroupAction/OrbitCounts.lean b/FormalConjecturesForMathlib/GroupTheory/GroupAction/OrbitCounts.lean new file mode 100644 index 0000000..24b9b41 --- /dev/null +++ b/FormalConjecturesForMathlib/GroupTheory/GroupAction/OrbitCounts.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. +-/ +module + +public import Mathlib.GroupTheory.GroupAction.Quotient +public import Mathlib.SetTheory.Cardinal.Finite + +@[expose] public section + +/-! +# Numbers of orbits and orbitals + +* `MulAction.numOrbits G α`: the number of orbits of `G` on `α`, fixed points included; +* `MulAction.numOrbitals G α`: the number of orbitals, the orbits of `G` on `α × α`; for a + transitive action this is its rank, the number of orbits of a point stabiliser. +-/ + +namespace MulAction + +variable (G α : Type*) [Group G] [MulAction G α] + +/-- The number of orbits of `G` on `α`, fixed points included. -/ +noncomputable def numOrbits : ℕ := Nat.card (orbitRel.Quotient G α) + +/-- The number of orbits of `G` on `α × α`. -/ +noncomputable def numOrbitals : ℕ := Nat.card (orbitRel.Quotient G (α × α)) + + +theorem numOrbits_eq_one [IsPretransitive G α] [Nonempty α] : numOrbits G α = 1 := by + rw [numOrbits, Nat.card_eq_one_iff_unique] + refine ⟨⟨fun a b => Quotient.inductionOn₂ a b fun x y => ?_⟩, + ⟨Quotient.mk _ (Classical.arbitrary α)⟩⟩ + obtain ⟨g, hg⟩ := exists_smul_eq G y x + exact Quotient.sound (orbitRel_apply.mpr ⟨g, hg⟩) + +end MulAction diff --git a/FormalConjecturesForMathlib/GroupTheory/GroupAction/TransitivityDegree.lean b/FormalConjecturesForMathlib/GroupTheory/GroupAction/TransitivityDegree.lean new file mode 100644 index 0000000..5154239 --- /dev/null +++ b/FormalConjecturesForMathlib/GroupTheory/GroupAction/TransitivityDegree.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. +-/ +module + +public import Mathlib.GroupTheory.GroupAction.MultipleTransitivity + +@[expose] public section + +/-! +# The degree of transitivity + +`MulAction.transitivityDegree G α` is the largest `k ≤ Nat.card α` such that the action of `G` on +`α` is `k`-transitive (`MulAction.IsMultiplyPretransitive`). For finite `α`, every action is +`k`-transitive for `k > Nat.card α`, because there is no injection `Fin k ↪ α`; hence the bound. +For infinite `α`, `Nat.card α = 0`, so `transitivityDegree G α = 0` +(`transitivityDegree_of_infinite`). +-/ + +namespace MulAction + +variable (G α : Type*) [Group G] [MulAction G α] + +/-- The largest `k ≤ Nat.card α` such that the action is `k`-transitive; it is `0` for infinite +`α`. -/ +noncomputable def transitivityDegree : ℕ := + sSup {k : ℕ | k ≤ Nat.card α ∧ IsMultiplyPretransitive G α k} + + +theorem transitivityDegree_le_card [Finite α] : transitivityDegree G α ≤ Nat.card α := + csSup_le' fun _ hk => hk.1 + +/-- For infinite `α`, `Nat.card α = 0`, so the degree is `0`. -/ +theorem transitivityDegree_of_infinite [Infinite α] : transitivityDegree G α = 0 := + Nat.eq_zero_of_le_zero <| csSup_le' fun _ hk => by + simpa [Nat.card_eq_zero_of_infinite] using hk.1 + +end MulAction diff --git a/FormalConjecturesForMathlib/GroupTheory/PrimeDivisors.lean b/FormalConjecturesForMathlib/GroupTheory/PrimeDivisors.lean new file mode 100644 index 0000000..bcb8b0e --- /dev/null +++ b/FormalConjecturesForMathlib/GroupTheory/PrimeDivisors.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. +-/ +module + +public import Mathlib.Algebra.Group.Defs +public import Mathlib.Data.Nat.PrimeFin +public import Mathlib.SetTheory.Cardinal.Finite +public import Mathlib.NumberTheory.ArithmeticFunction.Misc +public import FormalConjecturesForMathlib.Data.Nat.MaxPrimeFac + +@[expose] public section + +/-! +# Prime divisors of the order of a group + +* `Group.numPrimeDivisors G`: the number of distinct primes dividing `Nat.card G`; +* `Group.largestPrimeDivisor G`: the largest of them, or `0` if there is none. +-/ + +namespace Group + +variable (G : Type*) [Group G] + +open scoped Nat ArithmeticFunction.sigma + +/-- The number of distinct primes dividing the order of `G`. -/ +noncomputable def numPrimeDivisors : ℕ := σ 0 (Nat.card G).primeFactors.card + +/-- The largest prime dividing the order of `G`, or `0` if there is none (`G` trivial or +infinite). -/ +noncomputable def largestPrimeDivisor : ℕ := (Nat.card G).maxPrimeFac + + +@[simp] +theorem numPrimeDivisors_of_subsingleton [Subsingleton G] : numPrimeDivisors G = 0 := by + simp [numPrimeDivisors] + +@[simp] +theorem largestPrimeDivisor_of_subsingleton [Subsingleton G] : largestPrimeDivisor G = 1 := by + simp [largestPrimeDivisor] + +end Group diff --git a/FormalConjecturesForMathlib/GroupTheory/RationalClasses.lean b/FormalConjecturesForMathlib/GroupTheory/RationalClasses.lean new file mode 100644 index 0000000..3e1f976 --- /dev/null +++ b/FormalConjecturesForMathlib/GroupTheory/RationalClasses.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. +-/ +module + +public import Mathlib.Algebra.Group.Conj +public import Mathlib.Algebra.Group.Subgroup.Pointwise +public import Mathlib.Algebra.Group.Subgroup.ZPowers.Basic +public import Mathlib.Data.Set.Card +public import Mathlib.GroupTheory.GroupAction.ConjAct +public import Mathlib.GroupTheory.OrderOfElement + +@[expose] public section + +/-! +# Rational classes and Galois-stable conjugacy classes + +The absolute Galois group of `ℚ` acts on the conjugacy classes of a finite group `G`: it maps the +class of `g` to the class of `g ^ k` for `k` coprime to the order of `g`. + +* `Group.numRationalClasses G`: the number of orbits of this action on the conjugacy classes, the + rational classes; two elements are in the same rational class exactly when they generate + conjugate cyclic subgroups, so this is the number of conjugacy classes of cyclic subgroups; +* `Group.numGaloisStableClasses G`: the number of conjugacy classes fixed by the action, the + classes on which every complex character of `G` takes rational values. +-/ + +open scoped Pointwise + +namespace Group + +variable (G : Type*) [Group G] + +/-- The number of rational classes of `G`, the conjugacy classes of its cyclic subgroups. -/ +noncomputable def numRationalClasses : ℕ := + (Set.range fun g : G => MulAction.orbit (ConjAct G) (Subgroup.zpowers g)).ncard + +/-- The number of conjugacy classes of `G` that contain `g ^ k` together with `g` for every `k` +coprime to the order of `g`. -/ +noncomputable def numGaloisStableClasses : ℕ := + ((ConjClasses.mk : G → ConjClasses G) '' + {g : G | ∀ k : ℕ, k.Coprime (orderOf g) → IsConj g (g ^ k)}).ncard + + +instance [Finite G] : Finite (ConjClasses G) := + Finite.of_surjective _ ConjClasses.mk_surjective + +theorem numGaloisStableClasses_le [Finite G] : + numGaloisStableClasses G ≤ Nat.card (ConjClasses G) := + Set.ncard_le_card _ + +end Group diff --git a/FormalConjecturesForMathlib/GroupTheory/SubgroupCounts.lean b/FormalConjecturesForMathlib/GroupTheory/SubgroupCounts.lean new file mode 100644 index 0000000..5733bf0 --- /dev/null +++ b/FormalConjecturesForMathlib/GroupTheory/SubgroupCounts.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. +-/ +module + +public import Mathlib.Algebra.Group.Subgroup.Pointwise +public import Mathlib.Data.Set.Card +public import Mathlib.GroupTheory.GroupAction.ConjAct +public import Mathlib.Order.Atoms + +@[expose] public section + +/-! +# Numbers of subgroups + +* `Group.numNormalSubgroups G`: the number of normal subgroups of `G`; +* `Group.numMaximalSubgroupClasses G`: the number of conjugacy classes of maximal subgroups. +-/ + +open scoped Pointwise + +namespace Group + +variable (G : Type*) [Group G] + +/-- The number of normal subgroups of `G`. -/ +noncomputable def numNormalSubgroups : ℕ := {H : Subgroup G | H.Normal}.ncard + +/-- The number of conjugacy classes of maximal subgroups of `G`. -/ +noncomputable def numMaximalSubgroupClasses : ℕ := + ((fun H : Subgroup G => MulAction.orbit (ConjAct G) H) '' {H : Subgroup G | IsCoatom H}).ncard + +instance [Finite G] : Finite (Subgroup G) := + Finite.of_injective _ SetLike.coe_injective + +theorem numNormalSubgroups_pos [Finite G] : 0 < numNormalSubgroups G := + (Set.ncard_pos (Set.toFinite _)).mpr ⟨⊥, Subgroup.normal_bot⟩ + +example [Finite G] : 1 ≤ numNormalSubgroups G := by + exact (Set.ncard_pos (Finite.of_injective _ Subtype.coe_injective)).mpr + ⟨⊥, Subgroup.normal_bot⟩ + +end Group diff --git a/FormalConjecturesForMathlib/GroupTheory/Torsion.lean b/FormalConjecturesForMathlib/GroupTheory/Torsion.lean new file mode 100644 index 0000000..1b349ea --- /dev/null +++ b/FormalConjecturesForMathlib/GroupTheory/Torsion.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. +-/ +module + +public import Mathlib.GroupTheory.OrderOfElement + +@[expose] public section + +/-! +# Torsion-free monoids + +This file defines `Monoid.IsTorsionFree G`, the predicate saying that `1` is the only element of +finite order in `G`. + +Mathlib's `IsMulTorsionFree G` asks instead that `a ↦ a ^ n` be injective for every `n ≠ 0` +(uniqueness of roots). The two notions agree for commutative groups +(`isMulTorsionFree_iff_not_isOfFinOrder`), but for noncommutative groups `IsMulTorsionFree` is +strictly stronger: the Klein bottle group `⟨a, b | b⁻¹ab = a⁻¹⟩` is torsion-free, yet +`(ab)² = b²` with `ab ≠ b`. Statements about torsion-free groups in the literature, such as +Kaplansky's conjectures on group rings, use the weaker notion defined here. + +TODO(mo271): refactor after https://github.com/leanprover-community/mathlib4/pull/43727 lands +-/ + +variable {G : Type*} + +/-- A predicate on a monoid saying that only `1` has finite order. -/ +@[to_additive /-- A predicate on an additive monoid saying that only `0` has finite order. -/] +def Monoid.IsTorsionFree (G : Type*) [Monoid G] : Prop := + ∀ g : G, g ≠ 1 → ¬IsOfFinOrder g + +namespace Monoid.IsTorsionFree + +variable [Monoid G] + +@[to_additive] +theorem eq_one_of_isOfFinOrder (hG : Monoid.IsTorsionFree G) {g : G} (hg : IsOfFinOrder g) : + g = 1 := + by_contra fun h ↦ hG g h hg + +@[to_additive] +theorem isOfFinOrder_iff_eq_one (hG : Monoid.IsTorsionFree G) {g : G} : + IsOfFinOrder g ↔ g = 1 := + ⟨hG.eq_one_of_isOfFinOrder, fun h ↦ h ▸ IsOfFinOrder.one⟩ + +end Monoid.IsTorsionFree + +@[to_additive] +theorem Monoid.isTorsionFree_iff_forall_isOfFinOrder_imp_eq_one [Monoid G] : + Monoid.IsTorsionFree G ↔ ∀ g : G, IsOfFinOrder g → g = 1 := + ⟨fun hG _ ↦ hG.eq_one_of_isOfFinOrder, fun h g hg hfin ↦ hg (h g hfin)⟩ + +/-- Uniqueness of roots implies torsion-freeness. -/ +@[to_additive /-- Uniqueness of roots implies torsion-freeness. -/] +theorem Monoid.IsTorsionFree.of_isMulTorsionFree [Monoid G] [IsMulTorsionFree G] : + Monoid.IsTorsionFree G := + fun _ hg ↦ not_isOfFinOrder_of_isMulTorsionFree hg + +/-- For commutative groups, torsion-freeness is equivalent to uniqueness of roots. -/ +@[to_additive /-- For additive commutative groups, torsion-freeness is equivalent to uniqueness +of roots. -/] +theorem Monoid.isTorsionFree_iff_isMulTorsionFree [CommGroup G] : + Monoid.IsTorsionFree G ↔ IsMulTorsionFree G := + isMulTorsionFree_iff_not_isOfFinOrder.symm diff --git a/FormalConjecturesForMathlib/InformationTheory/FiniteEntropy.lean b/FormalConjecturesForMathlib/InformationTheory/FiniteEntropy.lean new file mode 100644 index 0000000..9d6c919 --- /dev/null +++ b/FormalConjecturesForMathlib/InformationTheory/FiniteEntropy.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. +-/ +module + +public import Mathlib.Analysis.SpecialFunctions.BinaryEntropy +public import Mathlib.MeasureTheory.Measure.Prod +public import Mathlib.MeasureTheory.Measure.Real +public import Mathlib.Tactic.FunProp + +/-! +# Shannon entropy of finite-valued random variables + +This file defines Shannon entropy and mutual information, in bits, for finite-valued random +variables. + +For a probability measure `μ` and a function `U` with measurable fibers, write +`q_U(a) = μ.real (U ⁻¹' {a})` for the probability that `U = a`. For a probability `q`, +`Real.negMulLog q` is `-q ln q` when `q > 0` and `0` when `q = 0`, so + +`H(U) = (∑ a, Real.negMulLog (q_U a)) / Real.log 2 = -∑ a, q_U(a) log₂ q_U(a)`, + +with the convention `0 log₂ 0 = 0`; dividing by `Real.log 2` converts nats to bits. Mutual +information is `I(U; V) = H(U) + H(V) - H(U, V)`. + +Measurable fibers are automatic when `U` is measurable and its finite target has measurable +singletons, in particular for finite discrete targets. The definitions are total expressions for +arbitrary measures and functions; without normalization and measurable fibers they need not have +their usual probabilistic interpretation. + +The main results are invariance under measurable pushforward and the formula for the mutual +information of the coordinate projections of a finite joint law. +-/ + +@[expose] public section + +open MeasureTheory +open scoped BigOperators + +namespace InformationTheory + +variable {Ω : Type*} [MeasurableSpace Ω] + +/-- Shannon entropy, in bits, of a finite-valued random variable. + +For a probability measure `μ`, this is the usual Shannon entropy when every fiber +`U ⁻¹' {a}` is measurable. In particular, this holds when `U` is measurable and its target +has measurable singletons. + +Zero-probability values contribute zero. The expression is also defined without these +hypotheses, but then need not have a probabilistic interpretation. +-/ +noncomputable def shannonEntropyBits {α : Type*} [Fintype α] + (μ : Measure Ω) (U : Ω → α) : ℝ := + (∑ a, Real.negMulLog (μ.real (U ⁻¹' {a}))) / Real.log 2 + +/-- Mutual information, in bits, of two finite-valued random variables, defined by +`I(U; V) = H(U) + H(V) - H(U, V)`. + +For a probability measure `μ`, this is the usual mutual information when the fibers of +both `U` and `V` are measurable. In particular, this holds for measurable functions into +finite targets with measurable singletons. + +The expression is also defined without these hypotheses, but then need not have a +probabilistic interpretation. +-/ +noncomputable def mutualInformationBits {α : Type*} {β : Type*} + [Fintype α] [Fintype β] (μ : Measure Ω) (U : Ω → α) (V : Ω → β) : ℝ := + shannonEntropyBits μ U + shannonEntropyBits μ V - + shannonEntropyBits μ (fun ω => (U ω, V ω)) + +section Map + +variable {Ω' : Type*} {α : Type*} {β : Type*} + [MeasurableSpace Ω'] + [Fintype α] [MeasurableSpace α] [MeasurableSingletonClass α] + [Fintype β] [MeasurableSpace β] [MeasurableSingletonClass β] + +/-- Entropy commutes with measurable pushforward of the sample-space measure. +No normalization assumption on the measure is required. -/ +theorem shannonEntropyBits_map (μ : Measure Ω) {T : Ω → Ω'} + (hT : Measurable T) {U : Ω' → α} (hU : Measurable U) : + shannonEntropyBits (μ.map T) U = shannonEntropyBits μ (U ∘ T) := by + unfold shannonEntropyBits + congr 1 + apply Finset.sum_congr rfl + intro a _ + congr 1 + change ((μ.map T) (U ⁻¹' {a})).toReal = + (μ ((U ∘ T) ⁻¹' {a})).toReal + rw [Measure.map_apply hT (hU (measurableSet_singleton a))] + rfl + +/-- Mutual information commutes with measurable pushforward of the sample-space measure. +No normalization assumption on the measure is required. -/ +theorem mutualInformationBits_map (μ : Measure Ω) {T : Ω → Ω'} + (hT : Measurable T) {U : Ω' → α} {V : Ω' → β} + (hU : Measurable U) (hV : Measurable V) : + mutualInformationBits (μ.map T) U V = + mutualInformationBits μ (U ∘ T) (V ∘ T) := by + have hUV : Measurable (fun ω => (U ω, V ω)) := by fun_prop + unfold mutualInformationBits + rw [shannonEntropyBits_map μ hT hU, shannonEntropyBits_map μ hT hV, + shannonEntropyBits_map μ hT hUV] + rfl + +end Map + +/-- The mutual information of the coordinate projections, written using the singleton masses of +a finite measure on a finite product. -/ +theorem mutualInformationBits_fst_snd {α : Type*} {β : Type*} + [Fintype α] [MeasurableSpace α] [MeasurableSingletonClass α] + [Fintype β] [MeasurableSpace β] [MeasurableSingletonClass β] + (ν : Measure (α × β)) [IsFiniteMeasure ν] : + mutualInformationBits ν Prod.fst Prod.snd = + (∑ a, Real.negMulLog (∑ b, ν.real {(a, b)})) / Real.log 2 + + (∑ b, Real.negMulLog (∑ a, ν.real {(a, b)})) / Real.log 2 - + (∑ ab : α × β, Real.negMulLog (ν.real {ab})) / Real.log 2 := by + classical + have hsum (s : Set (α × β)) : + ν.real s = ∑ w, if w ∈ s then ν.real {w} else 0 := by + simpa [Finset.sum_filter] using + (sum_measureReal_singleton (μ := ν) (Finset.univ.filter (fun w => w ∈ s))).symm + have hfst (a : α) : + ν.real (Prod.fst ⁻¹' {a}) = ∑ b, ν.real {(a, b)} := by + rw [hsum] + simp only [Fintype.sum_prod_type, Set.mem_preimage, Set.mem_singleton_iff] + rw [Finset.sum_eq_single a (fun x _ hx => by simp [hx]) (by simp)] + simp + have hsnd (b : β) : + ν.real (Prod.snd ⁻¹' {b}) = ∑ a, ν.real {(a, b)} := by + rw [hsum] + simp [Fintype.sum_prod_type] + simp [mutualInformationBits, shannonEntropyBits, hfst, hsnd] + +end InformationTheory diff --git a/FormalConjecturesForMathlib/LinearAlgebra/QuadraticForm/UInvariant.lean b/FormalConjecturesForMathlib/LinearAlgebra/QuadraticForm/UInvariant.lean new file mode 100644 index 0000000..7e6a1f0 --- /dev/null +++ b/FormalConjecturesForMathlib/LinearAlgebra/QuadraticForm/UInvariant.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. +-/ +module + +public import Mathlib.LinearAlgebra.QuadraticForm.Radical + +@[expose] public section + +/-! +# Dimensions of anisotropic quadratic forms + +The *$u$-invariant* $u(F)$ of a field $F$ is the largest dimension of an anisotropic quadratic +form over $F$, or $\infty$ if there is no largest one [Kaplansky1953, p. 201]; in characteristic $2$ +the forms are required to be nondegenerate [EKM2008, §36]. This file defines + +* `QuadraticForm.anisotropicDims F`: the set of `n` such that there is a nondegenerate anisotropic + quadratic form on `Fin n → F`. + +The $u$-invariant of `F` is `n` exactly when `IsGreatest (QuadraticForm.anisotropicDims F) n`, and +it is infinite exactly when `¬ BddAbove (QuadraticForm.anisotropicDims F)`. No numeric invariant +is defined, so that no convention for the infinite case is needed. + +The set contains `0` and `1` for every field. In characteristic not `2` every anisotropic form is +nondegenerate (`QuadraticMap.Anisotropic.nondegenerate`), so the nondegeneracy condition can be +dropped (`QuadraticForm.mem_anisotropicDims_iff`). Over a linearly ordered field the sum of `n` +squares is anisotropic for every `n`, so the set is all of `ℕ` +(`QuadraticForm.anisotropicDims_eq_univ`). + +## References + +* [Kaplansky1953] I. Kaplansky, *Quadratic forms*, J. Math. Soc. Japan 5 (1953), 200–207. +* [EKM2008] R. Elman, N. Karpenko, A. Merkurjev, *The algebraic and geometric theory of + quadratic forms*, Amer. Math. Soc. Colloq. Publ. 56, 2008. +-/ + +open Finset QuadraticMap + +namespace QuadraticMap + +variable {F M : Type*} [Field F] [AddCommGroup M] [Module F M] {Q : QuadraticForm F M} + +/-- The radical of an anisotropic quadratic form is trivial. -/ +theorem Anisotropic.radical_eq_bot (hQ : Q.Anisotropic) : Q.radical = ⊥ := + (Submodule.eq_bot_iff _).mpr fun m hm ↦ hQ m (mem_radical_iff'.mp hm).1 + +/-- An anisotropic quadratic form on a module of rank at most `1` is nondegenerate. -/ +theorem Anisotropic.nondegenerate_of_rank_le_one (hQ : Q.Anisotropic) + (hM : Module.rank F M ≤ 1) : Q.Nondegenerate where + radical_eq_bot := hQ.radical_eq_bot + rank_rad_polar_le := (Submodule.rank_le _).trans hM + +/-- In characteristic not `2`, an anisotropic quadratic form is nondegenerate. -/ +theorem Anisotropic.nondegenerate [NeZero (2 : F)] (hQ : Q.Anisotropic) : Q.Nondegenerate := by + have := invertibleOfNonzero (two_ne_zero : (2 : F) ≠ 0) + exact nondegenerate_iff_radical_eq_bot.mpr hQ.radical_eq_bot + +end QuadraticMap + +namespace QuadraticForm + +variable (F : Type*) [Field F] + +/-- The set of `n` such that there is a nondegenerate anisotropic quadratic form on `Fin n → F`. +Its greatest element, when it exists, is the $u$-invariant of `F`; the set is not bounded above +exactly when the $u$-invariant of `F` is infinite. -/ +def anisotropicDims : Set ℕ := + {n | ∃ Q : QuadraticForm F (Fin n → F), Q.Anisotropic ∧ Q.Nondegenerate} + +theorem zero_mem_anisotropicDims : 0 ∈ anisotropicDims F := + have h : (0 : QuadraticForm F (Fin 0 → F)).Anisotropic := fun x _ ↦ Subsingleton.elim x 0 + ⟨0, h, h.nondegenerate_of_rank_le_one (by simp)⟩ + +theorem one_mem_anisotropicDims : 1 ∈ anisotropicDims F := + have h : (weightedSumSquares F (1 : Fin 1 → F)).Anisotropic := fun v hv ↦ by + simp only [weightedSumSquares_apply, Pi.one_apply, one_smul, Fin.sum_univ_one, + mul_self_eq_zero] at hv + exact funext fun i ↦ by rw [Fin.fin_one_eq_zero i]; exact hv + ⟨_, h, h.nondegenerate_of_rank_le_one (by simp)⟩ + +variable {F} + +/-- In characteristic not `2`, the nondegeneracy condition in `anisotropicDims` is automatic. -/ +theorem mem_anisotropicDims_iff [NeZero (2 : F)] {n : ℕ} : + n ∈ anisotropicDims F ↔ ∃ Q : QuadraticForm F (Fin n → F), Q.Anisotropic := + ⟨fun ⟨Q, hQ, _⟩ ↦ ⟨Q, hQ⟩, fun ⟨Q, hQ⟩ ↦ ⟨Q, hQ, hQ.nondegenerate⟩⟩ + +/-- Over a linearly ordered field, the sum of `n` squares is anisotropic for every `n`, so every +`n` is the dimension of an anisotropic quadratic form. -/ +theorem anisotropicDims_eq_univ [LinearOrder F] [IsStrictOrderedRing F] : + anisotropicDims F = Set.univ := + Set.eq_univ_of_forall fun n ↦ mem_anisotropicDims_iff.mpr + ⟨weightedSumSquares F (1 : Fin n → F), fun v hv ↦ by + simp only [weightedSumSquares_apply, Pi.one_apply, one_smul] at hv + rw [sum_eq_zero_iff_of_nonneg fun i _ ↦ mul_self_nonneg (v i)] at hv + exact funext fun i ↦ mul_self_eq_zero.mp (hv i (mem_univ i))⟩ + +end QuadraticForm diff --git a/FormalConjecturesForMathlib/ModelTheory/Decidability.lean b/FormalConjecturesForMathlib/ModelTheory/Decidability.lean new file mode 100644 index 0000000..6b2d10a --- /dev/null +++ b/FormalConjecturesForMathlib/ModelTheory/Decidability.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. +-/ +module + +public import FormalConjecturesForMathlib.ModelTheory.Encoding +public import Mathlib.Computability.Partrec + +/-! +# Recursive and decidable theories + +Mathlib's `FirstOrder.Language.Theory` is an arbitrary set of sentences, which need not be +closed under logical consequence. Two computability notions are therefore distinct: + +- `T` is *recursive* if membership in `T` is computable: there is an algorithm which, given a + sentence `φ`, decides whether `φ ∈ T`. This is a property of the set of axioms. +- `T` is *decidable* if the set of consequences `{φ | T ⊨ᵇ φ}` is recursive: there is an + algorithm which decides whether `φ` holds in every model of `T`. This only depends on the + consequences of `T`, so it is invariant under replacing `T` by a logically equivalent set of + axioms (`FirstOrder.Language.Theory.isDecidable_congr`). + +The two notions agree when `T` is closed under consequence, in particular for the complete +theory `L.completeTheory M` of a structure `M` +(`FirstOrder.Language.Theory.isDecidable_completeTheory_iff`). + +Both notions use the Gödel numbering of sentences from +`FormalConjecturesForMathlib.ModelTheory.Encoding` and the notion of a computable function +`ℕ → Bool` from Mathlib's computability library. As usual, they are relative to the chosen +encoding of the symbols of `L`. For a language with finitely many symbols, all injective +encodings of the symbols give the same notions. + +## Main declarations + +- `FirstOrder.Language.Theory.IsRecursive`: membership in the set of sentences is computable. +- `FirstOrder.Language.Theory.IsDecidable`: the set of consequences is recursive. +- `FirstOrder.Language.Theory.isDecidable_iff_isRecursive`: for a theory closed under + consequence, the two notions agree. +-/ + +@[expose] public section + +namespace FirstOrder.Language.Theory + +variable {L : Language} [Encodable (Σ n, L.Functions n)] [Encodable (Σ n, L.Relations n)] + +/-- A set of sentences `T` is *recursive* if there is a computable function `f : ℕ → Bool` such +that, for every sentence `φ`, `f` returns `true` on the Gödel number of `φ` if and only if +`φ ∈ T`. -/ +def IsRecursive (T : L.Theory) : Prop := + ∃ f : ℕ → Bool, Computable f ∧ ∀ φ : L.Sentence, f (Encodable.encode φ) = true ↔ φ ∈ T + +/-- A theory `T` is *decidable* if the set of its consequences `{φ | T ⊨ᵇ φ}` is recursive: +there is an algorithm which, given a sentence `φ`, decides whether `φ` holds in every model of +`T`. -/ +def IsDecidable (T : L.Theory) : Prop := + IsRecursive {φ | T ⊨ᵇ φ} + +variable {T T' : L.Theory} + +/-- The empty set of sentences is recursive. -/ +theorem isRecursive_empty : (∅ : L.Theory).IsRecursive := + ⟨fun _ => false, Computable.const false, fun _ => by simp⟩ + +/-- The set of all sentences is recursive. -/ +theorem isRecursive_univ : IsRecursive (Set.univ : L.Theory) := + ⟨fun _ => true, Computable.const true, fun _ => by simp⟩ + +/-- The complement of a recursive set of sentences is recursive. -/ +theorem IsRecursive.compl (hT : T.IsRecursive) : Tᶜ.IsRecursive := by + obtain ⟨f, hf, hfT⟩ := hT + refine ⟨fun n => !f n, ?_, fun φ => ?_⟩ + · exact (hf.cond (Computable.const false) (Computable.const true)).of_eq fun n => by + cases f n <;> rfl + · have key : ∀ (b : Bool) (P : Prop), (b = true ↔ P) → ((!b) = true ↔ ¬P) := by + rintro b P h + cases b <;> simp_all + exact key _ _ (hfT φ) + +/-- Decidability only depends on the consequences of a theory. In particular, logically +equivalent sets of axioms are decidable together. -/ +theorem isDecidable_congr (h : ∀ φ : L.Sentence, T ⊨ᵇ φ ↔ T' ⊨ᵇ φ) : + T.IsDecidable ↔ T'.IsDecidable := by + unfold IsDecidable + rw [show {φ : L.Sentence | T ⊨ᵇ φ} = {φ | T' ⊨ᵇ φ} from Set.ext h] + +/-- For a theory closed under consequence, decidability is the same as recursiveness. -/ +theorem isDecidable_iff_isRecursive (hT : ∀ φ : L.Sentence, T ⊨ᵇ φ → φ ∈ T) : + T.IsDecidable ↔ T.IsRecursive := by + unfold IsDecidable + rw [show {φ : L.Sentence | T ⊨ᵇ φ} = T from Set.ext fun φ => ⟨hT φ, models_sentence_of_mem⟩] + +/-- The complete theory of a structure `M` contains all its consequences, so it is decidable +if and only if membership in it is computable. -/ +theorem isDecidable_completeTheory_iff (M : Type*) [L.Structure M] [Nonempty M] : + (L.completeTheory M).IsDecidable ↔ (L.completeTheory M).IsRecursive := + isDecidable_iff_isRecursive fun _ h => mem_completeTheory.2 (h.realize_sentence M) + +/-- The inconsistent theory of all sentences is decidable. -/ +theorem isDecidable_univ : IsDecidable (Set.univ : L.Theory) := + (isDecidable_iff_isRecursive fun φ _ => Set.mem_univ φ).2 isRecursive_univ + +end FirstOrder.Language.Theory diff --git a/FormalConjecturesForMathlib/ModelTheory/Encoding.lean b/FormalConjecturesForMathlib/ModelTheory/Encoding.lean new file mode 100644 index 0000000..8be705f --- /dev/null +++ b/FormalConjecturesForMathlib/ModelTheory/Encoding.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. +-/ +module + +public import Mathlib.ModelTheory.Algebra.Ring.Basic +public import Mathlib.ModelTheory.Encoding +public import Mathlib.ModelTheory.Order + +/-! +# Gödel numberings of first-order formulas + +Mathlib encodes the terms and the bounded formulas of a first-order language `L` as lists of +symbols (`FirstOrder.Language.Term.listEncode` and +`FirstOrder.Language.BoundedFormula.listEncode`), and derives from this an `Encodable` +instance on terms. This file derives `Encodable` instances on bounded formulas, formulas and +sentences in the same way. Given `Encodable` instances on the function symbols +`Σ n, L.Functions n` and on the relation symbols `Σ n, L.Relations n`, every sentence `φ` of +`L` gets a Gödel number `Encodable.encode φ : ℕ`. + +The file also provides `Encodable` instances on the symbols of `Language.ring`, +`Language.order`, and of sums of languages. + +## Main declarations + +- `FirstOrder.Language.BoundedFormula.encodableSigma`: Gödel numbering of + `Σ n, L.BoundedFormula α n`. +- `FirstOrder.Language.BoundedFormula.encodable`: Gödel numbering of `L.BoundedFormula α n`, + hence of `L.Formula α` and `L.Sentence`. + +## Implementation notes + +The numbering is the composition of Mathlib's list encoding of formulas with Mathlib's +`Encodable` instance on lists and the given encodings of the symbols, so it is effective in the +usual informal sense. For a language with finitely many symbols, any two injective encodings of +the symbols yield Gödel numberings that are computably inter-translatable, so notions such as +decidability of a theory do not depend on the choice made here. No `Primcodable` instance is +provided; computability statements about theories are phrased on `ℕ` through `Encodable.encode`. +-/ + +@[expose] public section + +namespace FirstOrder.Language + +open Encodable + +variable {L : Language} {α : Type*} + +section Symbols + +/-- The function symbols of a sum of two languages are encodable when those of both summands +are. -/ +instance sum.encodableFunctions {L' : Language} [Encodable (Σ n, L.Functions n)] + [Encodable (Σ n, L'.Functions n)] : Encodable (Σ n, (L.sum L').Functions n) := + ofEquiv _ (Equiv.sigmaSumDistrib L.Functions L'.Functions) + +/-- The relation symbols of a sum of two languages are encodable when those of both summands +are. -/ +instance sum.encodableRelations {L' : Language} [Encodable (Σ n, L.Relations n)] + [Encodable (Σ n, L'.Relations n)] : Encodable (Σ n, (L.sum L').Relations n) := + ofEquiv _ (Equiv.sigmaSumDistrib L.Relations L'.Relations) + +/-- A relational language has no function symbols. -/ +instance IsRelational.encodableFunctions [L.IsRelational] : Encodable (Σ n, L.Functions n) := + ⟨fun f => isEmptyElim f.2, fun _ => none, fun f => isEmptyElim f.2⟩ + +/-- An algebraic language has no relation symbols. -/ +instance IsAlgebraic.encodableRelations [L.IsAlgebraic] : Encodable (Σ n, L.Relations n) := + ⟨fun r => isEmptyElim r.2, fun _ => none, fun r => isEmptyElim r.2⟩ + +/-- The function symbols `+`, `*`, `-`, `0`, `1` of the language of rings are encoded as +`0`, `1`, `2`, `3`, `4`. -/ +instance ring.encodableFunctions : Encodable (Σ n, Language.ring.Functions n) := + ofLeftInjection + (fun f => match f with + | ⟨_, .add⟩ => 0 + | ⟨_, .mul⟩ => 1 + | ⟨_, .neg⟩ => 2 + | ⟨_, .zero⟩ => 3 + | ⟨_, .one⟩ => 4) + (fun n => match n with + | 0 => some ⟨2, Ring.addFunc⟩ + | 1 => some ⟨2, Ring.mulFunc⟩ + | 2 => some ⟨1, Ring.negFunc⟩ + | 3 => some ⟨0, Ring.zeroFunc⟩ + | 4 => some ⟨0, Ring.oneFunc⟩ + | _ => none) + (fun f => by rcases f with ⟨_, f⟩; cases f <;> rfl) + +/-- The unique relation symbol `≤` of the language of orders is encoded as `0`. -/ +instance order.encodableRelations : Encodable (Σ n, Language.order.Relations n) := + ofLeftInjection (fun _ => (0 : ℕ)) (fun _ => some default) fun _ => + congrArg some (Subsingleton.elim _ _) + +end Symbols + +namespace BoundedFormula + +variable [Encodable α] [Encodable (Σ n, L.Functions n)] [Encodable (Σ n, L.Relations n)] + +/-- The Gödel numbering of bounded formulas, obtained from the list encoding +`BoundedFormula.encoding` and the `Encodable` instances on lists and on the symbols. -/ +instance encodableSigma : Encodable (Σ n, L.BoundedFormula α n) := + ofLeftInjection BoundedFormula.encoding.encode BoundedFormula.encoding.decode + BoundedFormula.encoding.decode_encode + +/-- The Gödel numbering of bounded formulas with `n` bound variables, and in particular of +formulas (`n = 0`) and sentences (`n = 0` and `α = Empty`). -/ +instance encodable (n : ℕ) : Encodable (L.BoundedFormula α n) := + ofLeftInjection (fun φ => (⟨n, φ⟩ : Σ n, L.BoundedFormula α n)) + (fun ψ => if h : ψ.1 = n then some (h ▸ ψ.2) else none) fun _ => dite_eq_left rfl + +end BoundedFormula + +end FirstOrder.Language diff --git a/FormalConjecturesForMathlib/ModelTheory/Real.lean b/FormalConjecturesForMathlib/ModelTheory/Real.lean new file mode 100644 index 0000000..c230e96 --- /dev/null +++ b/FormalConjecturesForMathlib/ModelTheory/Real.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. +-/ +module + +public import FormalConjecturesForMathlib.ModelTheory.Encoding +public import Mathlib.Analysis.SpecialFunctions.Exp + +/-! +# Expansions of the real field + +This file makes `ℝ` a structure for the language of rings and for the language of orders. It +defines the language `Language.exp` with a single unary function symbol `exp`, the language +`Language.orderedExpField` of ordered exponential fields, and the *real exponential field* +`(ℝ, +, *, -, 0, 1, ≤, exp)` as a structure for that language. + +## Main declarations + +- `FirstOrder.Language.exp`: the language with one unary function symbol `exp`. +- `FirstOrder.Language.orderedExpField`: the language of ordered exponential fields. + +## Implementation notes + +Mathlib deliberately does not make `Ring.compatibleRingOfRing` or `orderStructure` instances, +because for a general type `R` the round trip `Ring R → Language.ring.Structure R → Ring R` +need not commute definitionally. Here they are declared as instances for the single type `ℝ`. +Mathlib has no instance producing a `Ring` or `LE` structure from a first-order structure on a +concrete type, so no such round trip arises. +-/ + +@[expose] public section + +namespace FirstOrder + +/-- The type of function symbols of `Language.exp`: a single unary symbol `exp`. -/ +inductive expFunc : ℕ → Type + | exp : expFunc 1 + deriving DecidableEq + +namespace Language + +/-- The language with a single unary function symbol `exp` and no relation symbols. -/ +protected def exp : Language := ⟨expFunc, fun _ => Empty⟩ + deriving IsAlgebraic + +/-- The language of ordered exponential fields: the language of rings, together with a unary +function symbol `exp` and the order relation `≤`. -/ +protected abbrev orderedExpField : Language := + Language.ring.sum (Language.exp.sum Language.order) + +/-- The language of ordered exponential fields contains the order symbol `≤`. -/ +instance orderedExpField.instIsOrdered : Language.orderedExpField.IsOrdered := + ⟨Sum.inr leSymb⟩ + +/-- The function symbol `exp` is encoded as `0`. -/ +instance exp.encodableFunctions : Encodable (Σ n, Language.exp.Functions n) := + Encodable.ofLeftInjection (fun _ => (0 : ℕ)) (fun _ => some ⟨1, expFunc.exp⟩) fun f => by + rcases f with ⟨_, f⟩ + cases f + rfl + +noncomputable section Real + +/-- `ℝ` as a structure for the language of rings, with the usual ring operations. -/ +instance compatibleRingReal : Ring.CompatibleRing ℝ := Ring.compatibleRingOfRing ℝ + +/-- `ℝ` as a structure for the language of orders, with `≤` interpreted as `≤`. -/ +instance orderStructureReal : Language.order.Structure ℝ := orderStructure ℝ + +instance orderOrderedStructureReal : Language.order.OrderedStructure ℝ := ⟨fun _ => Iff.rfl⟩ + +/-- `ℝ` as a structure for `Language.exp`, with `exp` interpreted as the exponential function. -/ +instance expStructureReal : Language.exp.Structure ℝ where + funMap {n} f := match n, f with + | _, .exp => fun x => Real.exp (x 0) + +@[simp] +theorem funMap_exp (x : Fin 1 → ℝ) : + Structure.funMap (L := Language.exp) expFunc.exp x = Real.exp (x 0) := + rfl + +/-- In the real exponential field, `≤` is interpreted as `≤`. -/ +instance orderedExpFieldOrderedStructureReal : Language.orderedExpField.OrderedStructure ℝ := + ⟨fun _ => Iff.rfl⟩ + +-- In the real exponential field, the symbol `exp` is interpreted as the exponential function. +example (x : ℝ) : + Structure.funMap (L := Language.orderedExpField) (Sum.inr (Sum.inl expFunc.exp)) ![x] = + Real.exp x := + rfl + +-- In the real exponential field, the symbol `+` is interpreted as addition. +example (x y : ℝ) : + Structure.funMap (L := Language.orderedExpField) (Sum.inl Ring.addFunc) ![x, y] = x + y := + rfl + +-- In the real exponential field, the symbol `≤` is interpreted as the order of `ℝ`. +example (x y : ℝ) : + Structure.RelMap (L := Language.orderedExpField) leSymb ![x, y] ↔ x ≤ y := + Iff.rfl + +-- The Gödel numbering of sentences of `Language.orderedExpField` is found by instance resolution. +example : Encodable Language.orderedExpField.Sentence := inferInstance + +end Real + +end Language + +end FirstOrder diff --git a/FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean b/FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean index 155cfdb..6b1bf6f 100644 --- a/FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean +++ b/FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean @@ -16,8 +16,20 @@ limitations under the License. module public import Mathlib.Algebra.BigOperators.Group.Finset.Basic +public import Mathlib.Algebra.Order.BigOperators.Group.Finset public import Mathlib.Data.Set.Finite.Lattice +public import Mathlib.Order.Filter.AtTopBot.Basic public import Mathlib.Order.Filter.AtTopBot.Defs +public import Mathlib.Order.Interval.Finset.Nat +public import Mathlib.Order.Lattice.Nat +public import Mathlib.Order.WellFounded + +/-! +# Complete and subcomplete sets + +A complete set has all sufficiently large elements among its finite subset sums. +A subcomplete set of natural numbers has an infinite arithmetic progression among those sums. +-/ @[expose] public section @@ -38,6 +50,44 @@ theorem subsetSums_mono {A B : Set M} (h : A ⊆ B) : subsetSums A ⊆ subsetSum def subseqSums' (A : ℕ → M) : Set M := {n | ∃ B : Finset ℕ, n = ∑ i ∈ B, A i} +/-- Zero is a finite subset sum of every set. -/ +@[simp] +theorem zero_mem_subsetSums (A : Set M) : 0 ∈ subsetSums A := by + exact ⟨∅, by simp, by simp⟩ + +/-- A set of natural numbers is subcomplete if its finite subset sums contain an infinite +arithmetic progression with positive common difference. -/ +def IsSubcomplete (A : Set ℕ) : Prop := + ∃ a d : ℕ, 0 < d ∧ ∀ k : ℕ, a + k * d ∈ subsetSums A + +/-- A superset of a subcomplete set is subcomplete. -/ +theorem IsSubcomplete.mono {A B : Set ℕ} (hAB : A ⊆ B) (hA : IsSubcomplete A) : + IsSubcomplete B := by + obtain ⟨a, d, hd, hk⟩ := hA + exact ⟨a, d, hd, fun k ↦ subsetSums_mono hAB (hk k)⟩ + +/-- A finite set is not subcomplete because its finite subset sums are bounded. -/ +theorem not_isSubcomplete_of_finite {A : Set ℕ} (hA : A.Finite) : ¬ IsSubcomplete A := by + rintro ⟨a, d, hd, hk⟩ + have hbound : ∀ s ∈ subsetSums A, s ≤ ∑ n ∈ hA.toFinset, n := by + rintro s ⟨B, hB, rfl⟩ + exact Finset.sum_le_sum_of_subset (fun x hx ↦ by simpa using hB hx) + set S := ∑ n ∈ hA.toFinset, n + have h1 := hbound _ (hk (S + 1)) + have h2 : S + 1 ≤ (S + 1) * d := Nat.le_mul_of_pos_right _ hd + omega + +/-- The set of all natural numbers is subcomplete. -/ +@[simp] +theorem isSubcomplete_univ : IsSubcomplete Set.univ := by + refine ⟨0, 1, one_pos, fun k ↦ ?_⟩ + exact ⟨{k}, by simp, by simp⟩ + +/-- The empty set is not subcomplete. -/ +@[simp] +theorem not_isSubcomplete_empty : ¬ IsSubcomplete ∅ := + not_isSubcomplete_of_finite Set.finite_empty + variable [Preorder M] /-- A set `A ⊆ M` is complete if every sufficiently large element of `M` is a subset sum of `A`. -/ @@ -50,6 +100,58 @@ theorem IsAddComplete.mono {A B : Set M} (h : A ⊆ B) (ha : IsAddComplete A) : filter_upwards [ha] with x hx exact (subsetSums_mono h) hx +namespace IsAddComplete + +/-- The admissible thresholds of a set of natural numbers: every integer at or above the +threshold is a finite subset sum of the set. -/ +def thresholds (A : Set ℕ) : Set ℕ := + {m | ∀ n, m ≤ n → n ∈ subsetSums A} + +/-- The least admissible threshold of a set of natural numbers. For an incomplete set this +returns `0`. See `threshold_isLeast` for complete sets. -/ +noncomputable def threshold (A : Set ℕ) : ℕ := + sInf (thresholds A) + +/-- Every natural number at or above an admissible threshold is also an admissible threshold. -/ +theorem thresholds_mono {A : Set ℕ} {m m' : ℕ} (hm : m ∈ thresholds A) (h : m ≤ m') : + m' ∈ thresholds A := + fun n hn ↦ hm n (h.trans hn) + +/-- The threshold of a complete set is its least admissible threshold. -/ +theorem threshold_isLeast {A : Set ℕ} (hA : IsAddComplete A) : + IsLeast (thresholds A) (threshold A) := by + obtain ⟨m, hm⟩ := Filter.eventually_atTop.mp hA + exact ⟨Nat.sInf_mem ⟨m, hm⟩, fun _ hn ↦ Nat.sInf_le hn⟩ + +/-- A least admissible threshold equals the threshold of the set. -/ +theorem threshold_eq_of_isLeast {A : Set ℕ} {a : ℕ} (h : IsLeast (thresholds A) a) : + threshold A = a := + le_antisymm (Nat.sInf_le h.1) (h.2 (Nat.sInf_mem ⟨a, h.1⟩)) + +/-- Comparing thresholds of complete sets is equivalent to comparing their least-threshold +witnesses. -/ +theorem threshold_descent_iff {A B : Set ℕ} (hA : IsAddComplete A) (hB : IsAddComplete B) : + threshold B < threshold A ↔ + ∃ a b : ℕ, IsLeast (thresholds A) a ∧ IsLeast (thresholds B) b ∧ b < a := by + constructor + · intro h + exact ⟨_, _, threshold_isLeast hA, threshold_isLeast hB, h⟩ + · rintro ⟨a, b, ha, hb, hab⟩ + rw [threshold_eq_of_isLeast ha, threshold_eq_of_isLeast hb] + exact hab + +/-- The empty set has no admissible threshold, so its threshold has the fallback value `0`. -/ +theorem threshold_empty : threshold ∅ = 0 := by + have h : thresholds (∅ : Set ℕ) = ∅ := by + apply Set.eq_empty_iff_forall_notMem.mpr + intro m hm + obtain ⟨B, hB, hs⟩ := hm (m + 1) (Nat.le_succ m) + have hB0 : B = ∅ := Finset.eq_empty_iff_forall_notMem.mpr fun x hx ↦ hB hx + simp [hB0] at hs + simp [threshold, h] + +end IsAddComplete + /-- A set `A ⊆ M` is complete if every sufficiently large element of `M` is a subset sum of `A`. -/ def IsAddStronglyComplete (A : Set M) : Prop := ∀ ⦃B : Set M⦄, B.Finite → IsAddComplete (A \ B) @@ -95,3 +197,83 @@ theorem IsAddStronglyCompleteNatSeq.isAddStronglyComplete {A : ℕ → M} (not necessarily distinct) terms of `A`. -/ def IsAddCompleteNatSeq' (A : ℕ → M) : Prop := ∀ᶠ k in Filter.atTop, k ∈ subseqSums' A + +/-! ### Sequences whose partial sums are dominated by the next term + +If `A : ℕ → ℕ` is strictly increasing from index `n₀` on and `A 0 + ⋯ + A (m - 1) ≤ A (m + 1)` +for `m ≥ n₀`, then removing infinitely many terms from `A` destroys completeness. This is the +argument of Graham [Gr64d] for the sequence `n ↦ fib n - (-1) ^ n`: once three terms +`A m₁ < A m₂ < A m` are removed, the remaining terms below `A (m + 1)` sum to at most +`A (m + 1) - 2`, so `A (m + 1) - 1` is not a sum of distinct remaining terms. -/ + +/-- Let `A : ℕ → ℕ` be strictly increasing from index `n₀` on, with +`A 0 + ⋯ + A (m - 1) ≤ A (m + 1)` for all `m ≥ n₀`. Then `Set.range A \ B` is not complete for +any infinite `B ⊆ Set.range A`. -/ +theorem not_isAddComplete_range_diff_of_sum_range_le {A : ℕ → ℕ} {n₀ : ℕ} + (hA : StrictMono fun k => A (n₀ + k)) + (hsum : ∀ m, n₀ ≤ m → ∑ i ∈ Finset.range m, A i ≤ A (m + 1)) + {B : Set ℕ} (hB : B ⊆ Set.range A) (hB' : B.Infinite) : + ¬ IsAddComplete (Set.range A \ B) := by + -- Infinitely many indices `m` have `A m ∈ B`. + have hpre : (A ⁻¹' B).Infinite := by + intro hfin + refine hB' <| (hfin.image A).subset fun b hb => ?_ + obtain ⟨m, rfl⟩ := hB hb + exact ⟨m, hb, rfl⟩ + -- `A` grows at least linearly from `n₀` on. + have hlin : ∀ k, n₀ ≤ k → k - n₀ ≤ A k := fun k hk => by + have := hA.id_le (k - n₀) + rwa [show n₀ + (k - n₀) = k by omega] at this + have hlt : ∀ i j, n₀ ≤ i → n₀ ≤ j → (A i < A j ↔ i < j) := by + intro i j hi hj + obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le hi + obtain ⟨l, rfl⟩ := Nat.exists_eq_add_of_le hj + rw [hA.lt_iff_lt] + omega + rw [IsAddComplete, Filter.not_eventually, Filter.frequently_atTop] + intro N + -- Three removed indices `n₀ < m₁ < m₂ < m`, with `m₁` large. + obtain ⟨m₁, hm₁B, hm₁⟩ := hpre.exists_gt (n₀ + N) + obtain ⟨m₂, hm₂B, hm₂⟩ := hpre.exists_gt m₁ + obtain ⟨m, hmB, hm⟩ := hpre.exists_gt m₂ + have hAm₁ := hlin m₁ (by omega) + have hAm₂ := hlin m₂ (by omega) + have hAm := hlin (m + 1) (by omega) + refine ⟨A (m + 1) - 1, by omega, ?_⟩ + rintro ⟨C, hC, hsumC⟩ + -- Every element of `C` is `A i` with `i < m`, `A i ≠ A m₁` and `A i ≠ A m₂`. + set S := (Finset.range m).filter (fun i => A i ≠ A m₁ ∧ A i ≠ A m₂) with hS + have hCsub : C ⊆ S.image A := by + intro c hc + obtain ⟨⟨i, rfl⟩, hcB⟩ := hC hc + have hle : A i ≤ ∑ j ∈ C, j := + Finset.single_le_sum (f := fun j => j) (fun _ _ => Nat.zero_le _) hc + have hi : i < m := by + by_contra hcon + rcases Nat.lt_or_ge i (m + 1) with h | h + · obtain rfl : i = m := by omega + exact hcB hmB + · have : A (m + 1) ≤ A i := + not_lt.1 fun h' => by have := (hlt i (m + 1) (by omega) (by omega)).1 h'; omega + omega + refine Finset.mem_image.2 ⟨i, Finset.mem_filter.2 ⟨Finset.mem_range.2 hi, ?_, ?_⟩, rfl⟩ + · rintro h; exact hcB (h ▸ hm₁B) + · rintro h; exact hcB (h ▸ hm₂B) + have h1 : ∑ j ∈ C, j ≤ ∑ i ∈ S, A i := + (Finset.sum_le_sum_of_subset hCsub).trans + (Finset.sum_image_le_of_nonneg fun _ _ => Nat.zero_le _) + -- `S` avoids `m₁` and `m₂`, whose terms are at least `1` each. + have h2 : ∑ i ∈ S, A i + A m₁ + A m₂ ≤ ∑ i ∈ Finset.range m, A i := by + have hsub : S ⊆ ((Finset.range m).erase m₁).erase m₂ := by + intro i hi + obtain ⟨hi, h₁, h₂⟩ := Finset.mem_filter.1 hi + refine Finset.mem_erase.2 ⟨?_, Finset.mem_erase.2 ⟨?_, hi⟩⟩ + · rintro rfl; exact h₂ rfl + · rintro rfl; exact h₁ rfl + have e1 := Finset.add_sum_erase (Finset.range m) A (Finset.mem_range.2 (by omega : m₁ < m)) + have e2 := Finset.add_sum_erase ((Finset.range m).erase m₁) A + (Finset.mem_erase.2 ⟨by omega, Finset.mem_range.2 (by omega : m₂ < m)⟩) + have := Finset.sum_le_sum_of_subset (f := A) hsub + omega + have := hsum m (by omega) + omega diff --git a/FormalConjecturesForMathlib/NumberTheory/Amicable.lean b/FormalConjecturesForMathlib/NumberTheory/Amicable.lean index 6645fdc..3725caf 100644 --- a/FormalConjecturesForMathlib/NumberTheory/Amicable.lean +++ b/FormalConjecturesForMathlib/NumberTheory/Amicable.lean @@ -35,3 +35,4 @@ We say that $a,b\in \mathbb{N}$ are an amicable pair if $\sigma(a)=\sigma(b)=a+b structure IsAmicable (a b : ℕ) : Prop where left : σ 1 a = a + b right : σ 1 b = a + b + ne : a ≠ b diff --git a/FormalConjecturesForMathlib/NumberTheory/ArithmeticFunction/PrimeSeries.lean b/FormalConjecturesForMathlib/NumberTheory/ArithmeticFunction/PrimeSeries.lean new file mode 100644 index 0000000..542bf00 --- /dev/null +++ b/FormalConjecturesForMathlib/NumberTheory/ArithmeticFunction/PrimeSeries.lean @@ -0,0 +1,160 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Analysis.SpecificLimits.Normed +public import Mathlib.NumberTheory.ArithmeticFunction.Misc +public import Mathlib.Topology.Algebra.InfiniteSum.Real +public import Mathlib.Tactic.FieldSimp +public import Mathlib.Tactic.Linarith +public import Mathlib.Tactic.NormNum +public import Mathlib.Tactic.Positivity + +/-! +# Prime-divisor generating series + +The generating series of the number of distinct prime divisors, evaluated at one half, +can be rearranged into a sum over primes using absolute summability. +-/ + +@[expose] public section + +open scoped ArithmeticFunction.omega + +namespace ArithmeticFunction + +/-- The number of distinct prime factors is the cardinality of `Nat.primeFactors`. -/ +lemma cardDistinctFactors_eq_card_primeFactors (m : ℕ) : (ω m) = m.primeFactors.card := by + rw [ArithmeticFunction.cardDistinctFactors_apply, Nat.primeFactors, List.card_toFinset] + +/-- The term `primeDivTerm m p` is `(1 / 2) ^ m` when `p` is a prime dividing the positive +integer `m`, and `0` otherwise. -/ +private noncomputable def primeDivTerm (m p : ℕ) : ℝ := + if p.Prime ∧ p ∣ m ∧ m ≠ 0 then (1 / 2 : ℝ) ^ m else 0 + +/-- Summing `primeDivTerm m p` over the primes `p` gives `ω m / 2 ^ m`. -/ +private lemma tsum_primeDivTerm_right (m : ℕ) : ∑' p, primeDivTerm m p = (ω m : ℝ) / 2 ^ m := by + rcases eq_or_ne m 0 with rfl | hm + · simp [primeDivTerm] + have hsupp : Function.support (primeDivTerm m) ⊆ ↑m.primeFactors := by + intro p hp + by_contra h + apply hp + have : ¬ (p.Prime ∧ p ∣ m) := fun ⟨h1, h2⟩ => + h (Finset.mem_coe.mpr (Nat.mem_primeFactors.mpr ⟨h1, h2, hm⟩)) + unfold primeDivTerm + rw [ite_eq_right (fun ⟨h1, h2, _⟩ => this ⟨h1, h2⟩)] + rw [tsum_eq_sum (s := m.primeFactors) (fun p hp => by + by_contra h + exact hp (hsupp (by simpa using h)))] + have : ∀ p ∈ m.primeFactors, primeDivTerm m p = (1 / 2 : ℝ) ^ m := by + intro p hp + obtain ⟨h1, h2, -⟩ := Nat.mem_primeFactors.mp hp + simp [primeDivTerm, h1, h2, hm] + rw [Finset.sum_congr rfl this, Finset.sum_const, nsmul_eq_mul, + cardDistinctFactors_eq_card_primeFactors] + simp [div_eq_mul_inv] + +/-- Summing `primeDivTerm m p` over `m` for a prime `p` gives `1 / (2 ^ p - 1)`. -/ +private lemma tsum_primeDivTerm_left {p : ℕ} (hp : p.Prime) : + ∑' m, primeDivTerm m p = 1 / (2 ^ p - 1 : ℝ) := by + have hinj : Function.Injective (fun k : ℕ => p * (k + 1)) := by + intro a b h + have := Nat.eq_of_mul_eq_mul_left hp.pos h + omega + have hsupp : Function.support (fun m => primeDivTerm m p) ⊆ + Set.range (fun k : ℕ => p * (k + 1)) := by + intro m hm + have h : p.Prime ∧ p ∣ m ∧ m ≠ 0 := by + by_contra h + exact hm (by simp [primeDivTerm, h]) + obtain ⟨-, ⟨c, rfl⟩, hm0⟩ := h + have hc : c ≠ 0 := fun h => hm0 (by simp [h]) + exact ⟨c - 1, by simp [Nat.sub_add_cancel (Nat.pos_of_ne_zero hc)]⟩ + rw [← hinj.tsum_eq hsupp] + have hr0 : (0 : ℝ) ≤ (1 / 2) ^ p := by positivity + have hr1 : ((1 : ℝ) / 2) ^ p < 1 := pow_lt_one₀ (by norm_num) (by norm_num) hp.ne_zero + have : ∀ k : ℕ, + primeDivTerm (p * (k + 1)) p = (1 / 2 : ℝ) ^ p * ((1 / 2 : ℝ) ^ p) ^ k := by + intro k + have h : p.Prime ∧ p ∣ p * (k + 1) ∧ p * (k + 1) ≠ 0 := + ⟨hp, dvd_mul_right _ _, by have := hp.pos; positivity⟩ + simp [primeDivTerm, h, pow_mul, pow_succ, mul_comm] + rw [tsum_congr this, tsum_mul_left, tsum_geometric_of_lt_one hr0 hr1] + have h2 : (1 : ℝ) < 2 ^ p := one_lt_pow₀ (by norm_num) hp.ne_zero + rw [one_div, inv_pow] + have : (2 : ℝ) ^ p - 1 ≠ 0 := by linarith + have h3 : (2 : ℝ) ^ p ≠ 0 := by positivity + field_simp + +/-- The double series defining `primeDivTerm` is summable. -/ +private lemma summable_primeDivTerm : Summable (fun x : ℕ × ℕ => primeDivTerm x.1 x.2) := by + have hnn : 0 ≤ (fun x : ℕ × ℕ => primeDivTerm x.1 x.2) := fun x => by + simp only [Pi.zero_apply] + unfold primeDivTerm + split_ifs <;> positivity + rw [summable_prod_of_nonneg hnn] + refine ⟨fun m => ?_, ?_⟩ + · apply summable_of_hasFiniteSupport + refine (Finset.range (m + 1)).finite_toSet.subset ?_ + intro p hp + by_contra h + apply hp + have : ¬ (p.Prime ∧ p ∣ m ∧ m ≠ 0) := by + rintro ⟨-, h2, h3⟩ + exact h (by simpa [Nat.lt_succ_iff] using Nat.le_of_dvd (Nat.pos_of_ne_zero h3) h2) + simp [primeDivTerm, this] + · have hs : Summable (fun m : ℕ => (m : ℝ) ^ 1 * (1 / 2 : ℝ) ^ m) := + summable_pow_mul_geometric_of_norm_lt_one 1 (by norm_num) + refine Summable.of_nonneg_of_le (fun m => tsum_nonneg (fun p => hnn (m, p))) (fun m => ?_) hs + simp only + rw [tsum_primeDivTerm_right, one_div, inv_pow, pow_one, div_eq_mul_inv] + have : (ω m : ℝ) ≤ m := by + rw [cardDistinctFactors_eq_card_primeFactors] + have hsub : m.primeFactors ⊆ Finset.Icc 1 m := by + intro p hp + obtain ⟨h1, h2, h3⟩ := Nat.mem_primeFactors.mp hp + exact Finset.mem_Icc.mpr ⟨h1.pos, Nat.le_of_dvd (Nat.pos_of_ne_zero h3) h2⟩ + have := Finset.card_le_card hsub + simp only [Nat.card_Icc, Nat.add_sub_cancel] at this + exact_mod_cast this + exact mul_le_mul_of_nonneg_right this (by positivity) + +/-- The generating series for the number of distinct prime divisors converges at one half. -/ +lemma summable_cardDistinctFactors_div_two_pow : + Summable (fun n : ℕ => (ω n : ℝ) / 2 ^ n) := + summable_primeDivTerm.prod.congr (fun n => tsum_primeDivTerm_right n) + +/-- The generating series for the number of distinct prime divisors, evaluated at one half, +is a sum over primes of reciprocals of Mersenne numbers. -/ +lemma tsum_cardDistinctFactors_div_two_pow : + ∑' n : ℕ, (ω n : ℝ) / 2 ^ n = ∑' p : {n : ℕ | n.Prime}, 1 / (2 ^ p.1 - 1) := by + let A := { n : ℕ | n.Prime } + have h2 : ∑' m : ℕ, (ω m : ℝ) / 2 ^ m = ∑' m, ∑' p, primeDivTerm m p := + tsum_congr fun m => (tsum_primeDivTerm_right m).symm + have h3 : ∑' m, ∑' p, primeDivTerm m p = ∑' p, ∑' m, primeDivTerm m p := + (Summable.tsum_comm (f := primeDivTerm) summable_primeDivTerm).symm + have h4 : ∑' p, ∑' m, primeDivTerm m p = + ∑' p, A.indicator (fun p : ℕ => 1 / (2 ^ p - 1 : ℝ)) p := by + refine tsum_congr fun p => ?_ + by_cases hp : p ∈ A + · rw [Set.indicator_of_mem hp, tsum_primeDivTerm_left hp] + · rw [Set.indicator_of_notMem hp] + have hp' : ¬ p.Prime := hp + simp [primeDivTerm, hp'] + rw [h2, h3, h4, tsum_subtype A (fun p : ℕ => 1 / (2 ^ p - 1 : ℝ))] + +end ArithmeticFunction diff --git a/FormalConjecturesForMathlib/NumberTheory/AutomaticNumber.lean b/FormalConjecturesForMathlib/NumberTheory/AutomaticNumber.lean new file mode 100644 index 0000000..50b9d60 --- /dev/null +++ b/FormalConjecturesForMathlib/NumberTheory/AutomaticNumber.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. +-/ +module + +public import FormalConjecturesForMathlib.Computability.AutomaticSequence +public import FormalConjecturesForMathlib.NumberTheory.NormalNumber + +@[expose] public section + +/-! +# Automatic numbers + +A real number is *automatic in base `b`* if its base-`b` digit sequence is generated by a +finite automaton. Two readings of this are in use, and they differ: + +* the classical one, that the digit sequence is `b`-automatic; +* the broad one, that the digit sequence is `k`-automatic for some `k ≥ 2`, which need not + be `b`. + +The broad reading is the weaker hypothesis on the number, so a theorem that rules out +automatic numbers is stronger when stated with it. Adamczewski and Faverjon prove their +two-base rigidity results in the broad form. + +Only the digits after the radix point are used, as in `NormalNumber.digitSeq`. The integer +part of a real number contributes finitely many digits, so it does not affect automaticity. + +*References:* + - [AF20](https://arxiv.org/abs/2012.08283) Adamczewski, Boris, and Colin Faverjon. + "Mahler's method in several variables and finite automata." arXiv:2012.08283 (2020). + Appendix A. + - [AS03] Allouche, Jean-Paul, and Jeffrey Shallit. "Automatic Sequences: Theory, + Applications, Generalizations." Cambridge University Press, 2003. + +## Main definitions + +* `AutomaticSequence.IsAutomaticInBase`: the classical reading. +* `AutomaticSequence.IsBroadlyAutomaticInBase`: the broad reading. +-/ + +namespace AutomaticSequence + +/-- +The base-`b` expansion of `ξ` is generated by a finite automaton, in the classical sense: its +digit sequence is `b`-automatic. +-/ +def IsAutomaticInBase (b : ℕ) (ξ : ℝ) : Prop := IsAutomatic b (NormalNumber.digitSeq b ξ) + +/-- +The base-`b` expansion of `ξ` is generated by a finite automaton, in the broad sense: its +digit sequence is `k`-automatic for some `k ≥ 2`, not necessarily for `k = b`. +-/ +def IsBroadlyAutomaticInBase (b : ℕ) (ξ : ℝ) : Prop := + ∃ k, 2 ≤ k ∧ IsAutomatic k (NormalNumber.digitSeq b ξ) + +/-- The classical reading implies the broad one, by taking `k = b`. -/ +theorem IsAutomaticInBase.broad {b : ℕ} {ξ : ℝ} (hb : 2 ≤ b) (h : IsAutomaticInBase b ξ) : + IsBroadlyAutomaticInBase b ξ := ⟨b, hb, h⟩ + +end AutomaticSequence diff --git a/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet.lean b/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet.lean new file mode 100644 index 0000000..4afea35 --- /dev/null +++ b/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet.lean @@ -0,0 +1,519 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet.CenterAction +public import FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet.LieDeriv +public import FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet.Subgroups +public import Mathlib.Analysis.SpecialFunctions.Pow.Real +public import Mathlib.LinearAlgebra.FiniteDimensional.Defs +public import Mathlib.RingTheory.Ideal.Quotient.Operations +public import Mathlib.Topology.Algebra.OpenSubgroup +public import Mathlib.Topology.LocallyConstant.Basic + +@[expose] public section + +/-! +# Automorphic forms in the sense of Borel-Jacquet + +*Borel-Jacquet* means the definition of an automorphic form given by Armand Borel and Hervé +Jacquet in their article in the Corvallis proceedings (the first reference below) — the +standard adelic definition. It is formalised here for `G = GL n / ℚ` with maximal compact +subgroup `K = O n ℝ`, in the shape Buzzard states it for `GL₂`. + +Writing `G(𝔸) = G(𝔸_f) × G(ℝ)`, where `G(𝔸_f) = GL n 𝔸ᶠ[ℤ, ℚ]` is the points of +`GL n` in the finite adeles of `ℚ`, an automorphic form is a smooth `f : G(𝔸) → ℂ` such that + +* (a) `f (γ x) = f x` for all `γ ∈ G(ℚ)`, embedded diagonally; +* (b1) `f (x u) = f x` for all `u` in some compact open subgroup of `G(𝔸_f)`; +* (b2) the `ℂ`-span of the right translates `x ↦ f (x k)`, for `k ∈ K`, is + finite-dimensional; +* (c) `f` is annihilated by an ideal of finite codimension of the centre of the universal + enveloping algebra of the complexified Lie algebra of `G(ℝ)`, acting by left invariant + differential operators; +* (d) for each `x ∈ G(𝔸_f)`, the function `y ↦ f (x, y)` on `G(ℝ)` is slowly increasing. + +Smooth means continuous, locally constant in the finite variable and `C^∞` in the archimedean +one. The further condition (e) cutting out cusp forms, that the constant term along every +unipotent radical vanishes, is not formalised here: it needs Haar integration over +`N(ℚ) \ N(𝔸)`. + +## Main declarations + +All in the namespace `Matrix.GeneralLinearGroup` unless qualified otherwise: + +* `AutomorphicForm.IsKFinite` and `AutomorphicForm.IsZFinite`: the finiteness conditions (b2) + and (c), for an abstract group and module respectively. +* `gnorm` and `IsSlowlyIncreasing`: the norm `‖y‖ = max (|y|, |y⁻¹|)` on `GL n ℝ` and + condition (d), slow increase. +* `IsSmoothAdelic` and `IsAutomorphicForm`: smoothness on `G(𝔸)`, and the definition itself. +* `isAutomorphicForm_one`: the constant function `1` is an automorphic form — a sanity check + exercising every condition; condition (c) holds through `constantsCharacter`, the character + by which the centre acts on constants. +* `automorphicForms` and `rightTranslation`: the automorphic forms as a `ℂ`-submodule of the + functions on `G(𝔸)`, with the right translation representation of `G(𝔸_f)` on it. + +The remaining ingredients of the definition are developed in the `BorelJacquet` subdirectory: + +* `BorelJacquet.LieDeriv`: the `C^∞` functions on `GL n ℝ` (`IsSmoothOnGL`, `smoothGL`) and + the action on them of `𝔤𝔩 n ℝ` and its complexification (`lieDeriv`, `lieDerivC`). +* `BorelJacquet.CenterAction`: the enveloping algebra `universalEnveloping`, its centre + `centerUniversalEnveloping`, their action (`envelopingAction`, `centerAction`) — the action + of condition (c) — and the character `constantsCharacter`. +* `BorelJacquet.Subgroups`: the subgroups `ratDiagonal` (condition (a)), `orthogonalSubgroup` + (condition (b2)) and `integralAdelicSubgroup` (the compact open subgroup witnessing condition + (b1)). + +## Relation to the literature + +Buzzard states (b2) through a finite-dimensional representation `σ` of `K`; for compact `K` +that formulation is equivalent to the one used here, since the span of the translates is a +continuous, hence semisimple, finite-dimensional representation of `K`. Conditions (b1) and +(b2) together are the `K`-finiteness of Getz-Hahn's Definition 6.5 for `K = K_∞ K^∞` with +`K^∞ ≤ G(𝔸_f)` compact open. + +Condition (d) follows Buzzard in letting the constants depend on the finite variable. +Getz-Hahn's Definition 6.4 instead imposes one global bound `|f g| ≤ c * H g ^ r` for their +adelic height `H`; for `GL n` that height factors as `H (x, y) = H_f x * gnorm y`, so the +global bound implies (d). Only these implications are asserted; no equivalence with +Getz-Hahn's full definition is claimed. + +## Implementation notes + +The action of condition (c) is constructed, not assumed; see +`FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet.LieDeriv` and +`FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet.CenterAction` for the +construction. The action lives on `smoothGL n`, not on all of `G(𝔸) → ℂ` — a differential +operator has nothing to act on at a non-differentiable function — so condition (c) asks for +one ideal annihilating every slice `y ↦ f (x, y)` at once, the finite variable being a +spectator. + +*References:* +- A. Borel and H. Jacquet, *Automorphic forms and automorphic representations*, in Automorphic + Forms, Representations and L-functions (Corvallis), Proc. Sympos. Pure Math. 33, Part 1, + Amer. Math. Soc. (1979), 189–207; §4. +- K. Buzzard, *Automorphic forms for GL2 over Q*, §1. + https://www.ma.imperial.ac.uk/~buzzard/maths/research/notes/automorphic_forms_for_gl2_over_Q.pdf +- J. R. Getz and H. Hahn, *An Introduction to Automorphic Representations*, GTM 300, Springer + (2024), §6.2 and §6.3; in the numbering of that text, Definitions 6.1 (moderate growth), + 6.2 (`Z(𝔤)`-finiteness), 6.4 (adelic moderate growth) and 6.5 (adelic automorphic form). + https://sites.duke.edu/jgetz/files/2022/04/Graduate_Text.pdf +-/ + +namespace AutomorphicForm + +/-! ### The finiteness conditions (b2) and (c), abstractly -/ + +section KFinite + +variable {G : Type*} [Group G] (K : Subgroup G) (k : Type*) [Field k] (f : G → k) + +/-- The `k`-span of the right translates of `f` by the subgroup `K`. -/ +def rightTranslateSpan : Submodule k (G → k) := + Submodule.span k (Set.range fun u : K => fun x => f (x * (u : G))) + +lemma self_mem_rightTranslateSpan : f ∈ rightTranslateSpan K k f := + Submodule.subset_span ⟨1, funext fun x => by simp⟩ + +/-- `f` is `K`-finite: the span of its right `K`-translates is finite-dimensional. This is +condition (b2) in the definition of an automorphic form. -/ +abbrev IsKFinite : Prop := FiniteDimensional k (rightTranslateSpan K k f) + +variable {K k f} + +/-- A function invariant under right translation by `K` is `K`-finite. -/ +lemma isKFinite_of_rightInvariant (h : ∀ (x : G) (u : K), f (x * (u : G)) = f x) : + IsKFinite K k f := + FiniteDimensional.span_of_finite k <| (Set.finite_singleton f).subset <| + Set.range_subset_iff.mpr fun u => funext fun x => h x u + +/-- If `K` is finite then every function is `K`-finite. -/ +lemma isKFinite_of_finite [Finite K] : IsKFinite K k f := + FiniteDimensional.span_of_finite k (Set.finite_range _) + +/-- `K`-finiteness is closed under addition: the translate span of `f + g` sits inside the sum +of the translate spans. -/ +protected lemma IsKFinite.add {f g : G → k} (hf : IsKFinite K k f) (hg : IsKFinite K k g) : + IsKFinite K k (f + g) := + Submodule.finiteDimensional_of_le + (S₂ := rightTranslateSpan K k f ⊔ rightTranslateSpan K k g) <| + Submodule.span_le.mpr <| Set.range_subset_iff.mpr fun u => + add_mem (Submodule.mem_sup_left (Submodule.subset_span ⟨u, rfl⟩)) + (Submodule.mem_sup_right (Submodule.subset_span ⟨u, rfl⟩)) + +protected lemma IsKFinite.const_smul {f : G → k} (hf : IsKFinite K k f) (c : k) : + IsKFinite K k (c • f) := + Submodule.finiteDimensional_of_le (S₂ := rightTranslateSpan K k f) <| Submodule.span_le.mpr <| + Set.range_subset_iff.mpr fun u => Submodule.smul_mem _ c (Submodule.subset_span ⟨u, rfl⟩) + +end KFinite + +section ZFinite + +variable (k : Type*) [Field k] (Z : Type*) [CommRing Z] [Algebra k Z] + {M : Type*} [AddCommGroup M] [Module Z M] + +/-- `m` is *`Z`-finite*: it is annihilated by an ideal of `Z` of finite codimension over `k`. +This is condition (c), with `Z` the centre of the universal enveloping algebra of the +complexified Lie algebra of `G(ℝ)`, i.e. +`Matrix.GeneralLinearGroup.centerUniversalEnveloping n`. + +This is Getz-Hahn's Definition 6.2, in the form they state for a vector of an arbitrary +`Z(𝔤)`-module. They note it is equivalent to `Z • m` being finite-dimensional over `k`. -/ +def IsZFinite (m : M) : Prop := + ∃ I : Ideal Z, FiniteDimensional k (Z ⧸ I) ∧ ∀ z ∈ I, z • m = 0 + +variable {k Z} + +lemma isZFinite_zero : IsZFinite k Z (0 : M) := ⟨⊤, inferInstance, fun z _ => smul_zero z⟩ + +/-- `Z`-finiteness is closed under addition: the intersection of the two annihilating ideals +works, since `Z ⧸ (I ⊓ J)` embeds in `(Z ⧸ I) × (Z ⧸ J)`. -/ +protected lemma IsZFinite.add {m₁ m₂ : M} (h₁ : IsZFinite k Z m₁) (h₂ : IsZFinite k Z m₂) : + IsZFinite k Z (m₁ + m₂) := by + obtain ⟨I, hI, hIann⟩ := h₁; obtain ⟨J, hJ, hJann⟩ := h₂ + have hker : LinearMap.ker (I.mkQ.prod J.mkQ) = I ⊓ J := by simp [LinearMap.ker_prod] + refine ⟨I ⊓ J, FiniteDimensional.of_injective (((I ⊓ J).liftQ (I.mkQ.prod J.mkQ) + hker.ge).restrictScalars k) ?_, fun z hz => by simp [smul_add, hIann z hz.1, hJann z hz.2]⟩ + simpa [← LinearMap.ker_eq_bot] using Submodule.ker_liftQ_eq_bot _ _ _ hker.le + +/-- `Z`-finiteness is preserved by scalar multiplication: the same ideal works. -/ +protected lemma IsZFinite.const_smul [Module k M] [IsScalarTower k Z M] {m : M} + (h : IsZFinite k Z m) (c : k) : IsZFinite k Z (c • m) := + h.imp fun _ => And.imp_right fun hann z hz => by + rw [← algebraMap_smul Z c m, smul_smul, mul_comm, ← smul_smul, hann z hz, smul_zero] + +/-- An element on which `Z` acts through a `k`-algebra character is `Z`-finite: the kernel of +the character is an ideal of finite codimension annihilating it. -/ +lemma IsZFinite.of_forall_smul_eq_algHom_smul [Module k M] (χ : Z →ₐ[k] k) {m : M} + (h : ∀ z, z • m = χ z • m) : IsZFinite k Z m := + ⟨RingHom.ker χ, FiniteDimensional.of_injective (Ideal.kerLiftAlg χ).toLinearMap + (Ideal.kerLiftAlg_injective χ), fun z hz => by rw [h z, RingHom.mem_ker.mp hz, zero_smul]⟩ + +/-- A constant family with `Z`-finite value is `Z`-finite, with the same ideal. -/ +protected lemma IsZFinite.pi_const {ι : Type*} {m₀ : M} (h : IsZFinite k Z m₀) : + IsZFinite k Z (fun _ : ι => m₀) := + h.imp fun _ => And.imp_right fun hann z hz => funext fun _ => hann z hz + +/-- Precomposition preserves `Z`-finiteness of a family, with the same ideal. -/ +protected lemma IsZFinite.comp {ι' ι : Type*} {m : ι → M} (h : IsZFinite k Z m) (σ : ι' → ι) : + IsZFinite k Z (m ∘ σ) := + h.imp fun _ => And.imp_right fun hann z hz => funext fun x => congrFun (hann z hz) (σ x) + +end ZFinite + +end AutomorphicForm + +namespace Matrix.GeneralLinearGroup + +open AutomorphicForm + +open scoped IsDedekindDomain.FiniteAdeleRing NNReal + +variable {n : Type*} [Fintype n] + +/-! ### Slow increase: condition (d) -/ + +/-- The sup norm on the entries of a matrix: for `n = 2` this is +`|(a b; c d)| = max {|a|, |b|, |c|, |d|}`. + +The supremum is taken in `ℝ≥0` rather than `ℝ` so that it is also defined when `n` is empty, +where it takes the value `0` — the right answer, since then `Matrix n n ℝ` is the zero ring. -/ +noncomputable def entrySup (M : Matrix n n ℝ) : ℝ := + ((Finset.univ.sup fun i => Finset.univ.sup fun j => ‖M i j‖₊ : ℝ≥0) : ℝ) + +lemma le_entrySup (M : Matrix n n ℝ) (i j : n) : |M i j| ≤ entrySup M := by + have h : ‖M i j‖₊ ≤ (Finset.univ.sup fun i => Finset.univ.sup fun j => ‖M i j‖₊) := + (Finset.le_sup (f := fun j => ‖M i j‖₊) (Finset.mem_univ j)).trans + (Finset.le_sup (f := fun i => Finset.univ.sup fun j => ‖M i j‖₊) (Finset.mem_univ i)) + simpa [entrySup, Real.norm_eq_abs] using NNReal.coe_le_coe.mpr h + +lemma entrySup_nonneg (M : Matrix n n ℝ) : 0 ≤ entrySup M := by + simp only [entrySup]; exact NNReal.coe_nonneg _ + +variable [DecidableEq n] + +/-- The norm `‖y‖ = max (|y|, |y⁻¹|)` on `GL n ℝ`, with `|·|` the sup norm on matrix entries. +This is the norm used to define slow increase. + +For `G = GL n` this is exactly the archimedean factor of the norm Getz-Hahn use for a general +reductive `G`: theirs is the sup of the entries of `ι y`, for `ι : G → SL (2 * n)` the embedding +`y ↦ (y, (y⁻¹)ᵗ)`, whose entries are those of `y` together with those of `y⁻¹`. -/ +noncomputable def gnorm (y : GL n ℝ) : ℝ := + max (entrySup (y : Matrix n n ℝ)) (entrySup ((y⁻¹ : GL n ℝ) : Matrix n n ℝ)) + +lemma gnorm_nonneg (y : GL n ℝ) : 0 ≤ gnorm y := + le_max_of_le_left (entrySup_nonneg _) + +@[simp] +lemma gnorm_inv (y : GL n ℝ) : gnorm y⁻¹ = gnorm y := by + rw [gnorm, gnorm, inv_inv, max_comm] + +/-- `gnorm` is uniformly bounded below: since `y * y⁻¹ = 1`, the entries of `y` and `y⁻¹` +cannot all be small. This makes the exponent in a slow-increase bound enlargeable, hence +`IsSlowlyIncreasing` closed under addition. -/ +lemma inv_card_le_gnorm (y : GL n ℝ) : (Fintype.card n : ℝ)⁻¹ ≤ gnorm y := by + rcases isEmpty_or_nonempty n with _ | hn + · simpa using gnorm_nonneg y + have hcard : (1 : ℝ) ≤ Fintype.card n := by + exact_mod_cast Fintype.card_pos_iff.mpr hn + obtain ⟨i⟩ := hn + have hy : ∑ k, (y : Matrix n n ℝ) i k * ((y⁻¹ : GL n ℝ) : Matrix n n ℝ) k i = 1 := by + simpa [Matrix.mul_apply, Matrix.one_apply_eq] using congrFun (congrFun y.mul_inv i) i + have hk : ∀ k, |(y : Matrix n n ℝ) i k * ((y⁻¹ : GL n ℝ) : Matrix n n ℝ) k i| + ≤ gnorm y * gnorm y := fun k => by + rw [abs_mul]; exact mul_le_mul ((le_entrySup _ i k).trans (le_max_left _ _)) + ((le_entrySup _ k i).trans (le_max_right _ _)) (abs_nonneg _) (gnorm_nonneg _) + have hbound : (1 : ℝ) ≤ Fintype.card n * (gnorm y * gnorm y) := by + rw [← abs_one, ← hy]; refine (Finset.abs_sum_le_sum_abs _ _).trans ((Finset.sum_le_sum + fun k _ => hk k).trans (le_of_eq ?_)) + rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + rw [inv_le_iff_one_le_mul₀ (zero_lt_one.trans_le hcard)]; nlinarith [gnorm_nonneg y] + +lemma gnorm_pos [Nonempty n] (y : GL n ℝ) : 0 < gnorm y := + ((inv_pos.mpr (by exact_mod_cast Fintype.card_pos)).trans_le (inv_card_le_gnorm y)) + +/-- A function `φ : GL n ℝ → ℂ` is *slowly increasing*, or of *moderate growth*, if +`‖φ y‖ ≤ C * ‖y‖ ^ r` for some real `C` and natural number `r`. This is condition (d) in the +definition of an automorphic form. + +Taking the exponent to be a natural number rather than a real is no loss — a real exponent can +always be rounded up, since `gnorm ≥ 1 / Fintype.card n` — and it makes the definition come out +right for `GL 0`, where `gnorm` is identically `0` and `(0 : ℝ) ^ (0 : ℕ) = 1`. -/ +def IsSlowlyIncreasing (φ : GL n ℝ → ℂ) : Prop := + ∃ (C : ℝ) (r : ℕ), ∀ y : GL n ℝ, ‖φ y‖ ≤ C * gnorm y ^ r + +lemma IsSlowlyIncreasing.of_bounded {φ : GL n ℝ → ℂ} {C : ℝ} (h : ∀ y, ‖φ y‖ ≤ C) : + IsSlowlyIncreasing φ := + ⟨C, 0, fun y => by simpa using h y⟩ + +lemma isSlowlyIncreasing_const (c : ℂ) : IsSlowlyIncreasing (fun _ : GL n ℝ => c) := + IsSlowlyIncreasing.of_bounded fun _ => le_rfl + +lemma IsSlowlyIncreasing.const_mul {φ : GL n ℝ → ℂ} (hφ : IsSlowlyIncreasing φ) (c : ℂ) : + IsSlowlyIncreasing fun y => c * φ y := by + obtain ⟨C, r, hC⟩ := hφ + refine ⟨‖c‖ * C, r, fun y => ?_⟩ + rw [norm_mul, mul_assoc] + exact mul_le_mul_of_nonneg_left (hC y) (norm_nonneg c) + +/-- A slow-increase bound with exponent `r` gives one with any exponent `r' ≥ r`: `gnorm` is +bounded below by `(Fintype.card n)⁻¹ > 0`, so enlarging the exponent costs only the constant +factor `(Fintype.card n) ^ (r' - r)`. -/ +lemma exists_forall_norm_le_pow_of_le [Nonempty n] {φ : GL n ℝ → ℂ} {C : ℝ} {r : ℕ} + (h : ∀ y, ‖φ y‖ ≤ C * gnorm y ^ r) {r' : ℕ} (hr : r ≤ r') : + ∃ C', ∀ y, ‖φ y‖ ≤ C' * gnorm y ^ r' := by + have hcard : (0 : ℝ) < Fintype.card n := by exact_mod_cast Fintype.card_pos + have hC0 : 0 ≤ C := + (mul_nonneg_iff_of_pos_right (pow_pos (gnorm_pos 1) r)).mp ((norm_nonneg (φ 1)).trans (h 1)) + obtain ⟨d, rfl⟩ := Nat.exists_eq_add_of_le hr + refine ⟨C * (Fintype.card n : ℝ) ^ d, fun y => (h y).trans ?_⟩ + have hcg : (1 : ℝ) ≤ (Fintype.card n : ℝ) * gnorm y := by + have := mul_le_mul_of_nonneg_left (inv_card_le_gnorm y) hcard.le + rwa [mul_inv_cancel₀ hcard.ne'] at this + calc C * gnorm y ^ r ≤ ((Fintype.card n : ℝ) * gnorm y) ^ d * (C * gnorm y ^ r) := + le_mul_of_one_le_left (mul_nonneg hC0 (pow_nonneg (gnorm_nonneg y) r)) + (one_le_pow₀ hcg) + _ = C * (Fintype.card n : ℝ) ^ d * gnorm y ^ (r + d) := by rw [pow_add, mul_pow]; ring + +protected lemma IsSlowlyIncreasing.add {φ ψ : GL n ℝ → ℂ} (hφ : IsSlowlyIncreasing φ) + (hψ : IsSlowlyIncreasing ψ) : IsSlowlyIncreasing (φ + ψ) := by + obtain ⟨C₁, r₁, h₁⟩ := hφ; obtain ⟨C₂, r₂, h₂⟩ := hψ + rcases isEmpty_or_nonempty n with _ | _ + · -- `GL 0 ℝ` is trivial, so every function on it is bounded. + have : Subsingleton (GL n ℝ) := ⟨fun a b => Units.ext (Subsingleton.elim _ _)⟩ + exact IsSlowlyIncreasing.of_bounded (C := ‖φ 1‖ + ‖ψ 1‖) fun y => by + obtain rfl : y = 1 := Subsingleton.elim y 1 + exact norm_add_le _ _ + · obtain ⟨C₁', h₁'⟩ := exists_forall_norm_le_pow_of_le h₁ (le_max_left r₁ r₂) + obtain ⟨C₂', h₂'⟩ := exists_forall_norm_le_pow_of_le h₂ (le_max_right r₁ r₂) + exact ⟨C₁' + C₂', max r₁ r₂, fun y => ((norm_add_le _ _).trans + (add_le_add (h₁' y) (h₂' y))).trans_eq (add_mul _ _ _).symm⟩ + +/-! ### Constant functions are `Z(𝔤)`-finite -/ + +/-- The constant function `1` is `Z(𝔤)`-finite: the kernel of `constantsCharacter` is an ideal +of finite codimension annihilating it. -/ +lemma isZFinite_oneSmoothGL : + IsZFinite ℂ ↥(centerUniversalEnveloping n) (oneSmoothGL n) := + IsZFinite.of_forall_smul_eq_algHom_smul (constantsCharacter n) fun z => + eq_smul_oneSmoothGL_of_mem_span (smul_oneSmoothGL_mem_span z) + +/-- Every constant function is `Z(𝔤)`-finite. -/ +lemma isZFinite_const_smoothGL (c : ℂ) : + IsZFinite ℂ ↥(centerUniversalEnveloping n) + (⟨fun _ => c, isSmoothOnGL_const c⟩ : smoothGL n) := + (Subtype.ext (funext fun _ => mul_one c) : + c • oneSmoothGL n = ⟨fun _ => c, _⟩) ▸ isZFinite_oneSmoothGL.const_smul c + +/-! ### The definition -/ + +/-- Smoothness of a function on `G(𝔸) = G(𝔸_f) × G(ℝ)`, with `G(𝔸_f) = GL n 𝔸ᶠ[ℤ, ℚ]`: +continuous, locally constant in the finite variable, and `C^∞` in the archimedean variable. -/ +structure IsSmoothAdelic (f : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ → ℂ) : Prop where + continuous : Continuous f + locallyConstant : ∀ y : GL n ℝ, IsLocallyConstant fun x : GL n 𝔸ᶠ[ℤ, ℚ] => f (x, y) + smoothOnGL : ∀ x : GL n 𝔸ᶠ[ℤ, ℚ], IsSmoothOnGL fun y : GL n ℝ => f (x, y) + +/-- An automorphic form for `(G, K)` in the sense of Borel-Jacquet, with +`G = GL n / ℚ` and `K = O n ℝ`: `G(𝔸)` is written as +`G(𝔸_f) × G(ℝ) = GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ`, condition (a) is invariance under `ratDiagonal n`, +the rational points embedded diagonally, condition (b2) is finiteness under the maximal compact +`orthogonalSubgroup n`, and condition (c) is with respect to the action of the centre of the +universal enveloping algebra by left invariant differential operators, `centerAction`. -/ +structure IsAutomorphicForm (f : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ → ℂ) : Prop where + /-- `f` is smooth. -/ + smooth : IsSmoothAdelic f + /-- (a) `f (γ x) = f x` for `γ ∈ G(ℚ)`. -/ + left_invariant : ∀ γ ∈ ratDiagonal n, ∀ x, f (γ * x) = f x + /-- (b1) `f` is right invariant under some compact open subgroup of `G(𝔸_f)`. -/ + right_invariant : ∃ U : Subgroup (GL n 𝔸ᶠ[ℤ, ℚ]), IsOpen (U : Set (GL n 𝔸ᶠ[ℤ, ℚ])) ∧ + IsCompact (U : Set (GL n 𝔸ᶠ[ℤ, ℚ])) ∧ + ∀ u ∈ U, ∀ x : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ, f (x.1 * u, x.2) = f x + /-- (b2) `f` is `K`-finite. -/ + kFinite : IsKFinite ((⊥ : Subgroup (GL n 𝔸ᶠ[ℤ, ℚ])).prod (orthogonalSubgroup n)) ℂ f + /-- (c) `f` is annihilated by an ideal of finite codimension of the centre of the universal + enveloping algebra, acting in the archimedean variable. One ideal annihilates every + finite-adelic slice at once. -/ + zFinite : IsZFinite ℂ ↥(centerUniversalEnveloping n) + (fun x : GL n 𝔸ᶠ[ℤ, ℚ] => (⟨fun y => f (x, y), smooth.smoothOnGL x⟩ : smoothGL n)) + /-- (d) `y ↦ f (x, y)` is slowly increasing for each `x ∈ G(𝔸_f)`. -/ + slowlyIncreasing : ∀ x : GL n 𝔸ᶠ[ℤ, ℚ], IsSlowlyIncreasing fun y => f (x, y) + +/-! ### The submodule of automorphic forms and the right translation action -/ + +lemma isSmoothAdelic_const (c : ℂ) : + IsSmoothAdelic (fun _ : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ => c) where + continuous := continuous_const + locallyConstant _ := IsLocallyConstant.const c + smoothOnGL _ := isSmoothOnGL_const c + +protected lemma IsSmoothAdelic.add {f g : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ → ℂ} + (hf : IsSmoothAdelic f) (hg : IsSmoothAdelic g) : IsSmoothAdelic (f + g) where + continuous := hf.continuous.add hg.continuous + locallyConstant y := (hf.locallyConstant y).add (hg.locallyConstant y) + smoothOnGL x := (hf.smoothOnGL x).add (hg.smoothOnGL x) + +protected lemma IsSmoothAdelic.const_smul {f : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ → ℂ} + (hf : IsSmoothAdelic f) (c : ℂ) : IsSmoothAdelic (c • f) where + continuous := hf.continuous.const_smul c + locallyConstant y := (hf.locallyConstant y).comp (c • ·) + smoothOnGL x := (hf.smoothOnGL x).const_smul c + +variable (n) in +/-- Sanity check: the constant functions are automorphic forms. This exercises every condition +of the definition: condition (b1) is witnessed by the compact open subgroup +`integralAdelicSubgroup n` and condition (c) by the kernel of `constantsCharacter n`. -/ +theorem isAutomorphicForm_const (c : ℂ) : + IsAutomorphicForm (fun _ : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ => c) where + smooth := isSmoothAdelic_const c + left_invariant _ _ _ := rfl + right_invariant := ⟨integralAdelicSubgroup n, isOpen_integralAdelicSubgroup, + isCompact_integralAdelicSubgroup, fun _ _ _ => rfl⟩ + kFinite := isKFinite_of_rightInvariant fun _ _ => rfl + zFinite := (isZFinite_const_smoothGL c).pi_const + slowlyIncreasing _ := isSlowlyIncreasing_const c + +variable (n) in +/-- Sanity check: the constant function `1` is an automorphic form. -/ +theorem isAutomorphicForm_one : + IsAutomorphicForm (fun _ : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ => (1 : ℂ)) := + isAutomorphicForm_const n 1 + +protected lemma IsAutomorphicForm.add {f g : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ → ℂ} + (hf : IsAutomorphicForm f) (hg : IsAutomorphicForm g) : IsAutomorphicForm (f + g) where + smooth := hf.smooth.add hg.smooth + left_invariant γ hγ x := by + simp [hf.left_invariant γ hγ x, hg.left_invariant γ hγ x] + right_invariant := by + obtain ⟨⟨U₁, o₁, c₁, h₁⟩, U₂, o₂, c₂, h₂⟩ := And.intro hf.right_invariant hg.right_invariant + exact ⟨U₁ ⊓ U₂, Subgroup.coe_inf U₁ U₂ ▸ o₁.inter o₂, + Subgroup.coe_inf U₁ U₂ ▸ c₁.inter_right (U₂.isClosed_of_isOpen o₂), + fun u hu x => by simp [h₁ u hu.1 x, h₂ u hu.2 x]⟩ + kFinite := hf.kFinite.add hg.kFinite + zFinite := hf.zFinite.add hg.zFinite + slowlyIncreasing x := (hf.slowlyIncreasing x).add (hg.slowlyIncreasing x) + +protected lemma IsAutomorphicForm.const_smul {f : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ → ℂ} + (hf : IsAutomorphicForm f) (c : ℂ) : IsAutomorphicForm (c • f) where + smooth := hf.smooth.const_smul c + left_invariant γ hγ x := by simp [hf.left_invariant γ hγ x] + right_invariant := by + obtain ⟨U, ho, hc', hU⟩ := hf.right_invariant + exact ⟨U, ho, hc', fun u hu x => by simp [hU u hu x]⟩ + kFinite := hf.kFinite.const_smul c + zFinite := hf.zFinite.const_smul c + slowlyIncreasing x := (hf.slowlyIncreasing x).const_mul c + +variable (n) in +/-- The automorphic forms for `GL n / ℚ` as a `ℂ`-submodule of the functions on `G(𝔸)`. -/ +def automorphicForms : Submodule ℂ (GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ → ℂ) where + carrier := {f | IsAutomorphicForm f} + add_mem' hf hg := hf.add hg + zero_mem' := isAutomorphicForm_const n 0 + smul_mem' c _ hf := hf.const_smul c + +@[simp] +lemma mem_automorphicForms {f : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ → ℂ} : + f ∈ automorphicForms n ↔ IsAutomorphicForm f := Iff.rfl + +/-- Automorphy is preserved by right translation in the finite variable. -/ +protected lemma IsAutomorphicForm.rightTranslate {f : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ → ℂ} + (hf : IsAutomorphicForm f) (g : GL n 𝔸ᶠ[ℤ, ℚ]) : + IsAutomorphicForm (fun p => f (p.1 * g, p.2)) where + smooth := + { continuous := hf.smooth.continuous.comp + ((continuous_fst.mul continuous_const).prodMk continuous_snd) + locallyConstant := fun y => (hf.smooth.locallyConstant y).comp_continuous + (continuous_mul_const g) + smoothOnGL := fun x => hf.smooth.smoothOnGL (x * g) } + left_invariant γ hγ x := by + simpa [Prod.mul_def, mul_assoc] using hf.left_invariant γ hγ (x.1 * g, x.2) + right_invariant := by + obtain ⟨U, ho, hc, hU⟩ := hf.right_invariant + have hset : (Subgroup.map (MulAut.conj g).toMonoidHom U : Set (GL n 𝔸ᶠ[ℤ, ℚ])) + = (fun x => g * x * g⁻¹) '' U := by rw [Subgroup.coe_map]; rfl + refine ⟨_, hset ▸ ((Homeomorph.mulRight g⁻¹).isOpenMap.comp + (Homeomorph.mulLeft g).isOpenMap) _ ho, + hset ▸ hc.image ((continuous_const_mul g).mul continuous_const), fun u hu x => ?_⟩ + obtain ⟨w, hw, rfl⟩ := Subgroup.mem_map.mp hu + simpa [MulAut.conj_apply, mul_assoc] using hU w hw (x.1 * g, x.2) + kFinite := by + have := hf.kFinite + refine Submodule.finiteDimensional_of_le (S₂ := Submodule.map + (LinearMap.funLeft ℂ ℂ fun p : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ => (p.1 * g, p.2)) + (rightTranslateSpan ((⊥ : Subgroup (GL n 𝔸ᶠ[ℤ, ℚ])).prod (orthogonalSubgroup n)) ℂ f)) + (Submodule.span_le.mpr <| Set.range_subset_iff.mpr fun u => Submodule.mem_map.mpr + ⟨_, Submodule.subset_span ⟨u, rfl⟩, funext fun p => by + simp [Subgroup.mem_bot.mp (Subgroup.mem_prod.mp u.2).1, Prod.mul_def]⟩) + zFinite := hf.zFinite.comp (· * g) + slowlyIncreasing x := hf.slowlyIncreasing (x * g) + +variable (n) in +/-- The right translation representation of `G(𝔸_f)` on the automorphic forms: +`g` acts by `f ↦ fun (x, y) => f (x * g, y)`. -/ +noncomputable def rightTranslation : + GL n 𝔸ᶠ[ℤ, ℚ] →* (automorphicForms n →ₗ[ℂ] automorphicForms n) where + toFun g := + { toFun := fun f => ⟨fun p => (f : GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ → ℂ) (p.1 * g, p.2), + f.2.rightTranslate g⟩ + map_add' := fun _ _ => Subtype.ext rfl + map_smul' := fun _ _ => Subtype.ext rfl } + map_one' := LinearMap.ext fun f => Subtype.ext (funext fun p => by simp) + map_mul' g h := LinearMap.ext fun f => Subtype.ext (funext fun p => by + simp [mul_assoc]) + +end Matrix.GeneralLinearGroup diff --git a/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet/CenterAction.lean b/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet/CenterAction.lean new file mode 100644 index 0000000..1b8abc9 --- /dev/null +++ b/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet/CenterAction.lean @@ -0,0 +1,177 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet.LieDeriv +public import Mathlib.Algebra.Lie.OfAssociative +public import Mathlib.Algebra.Lie.UniversalEnveloping + +@[expose] public section + +/-! +# The enveloping algebra of `𝔤𝔩 n ℂ`, its centre, and their action + +The universal enveloping algebra `U(𝔤𝔩 n ℂ)` of the complexified Lie algebra of `GL n ℝ` and +the action of its centre on the complex-valued `C^∞` functions on `GL n ℝ` by left invariant +differential operators. This is the action that condition (c) in the Borel-Jacquet definition +of an automorphic form refers to; see +`FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet` for that definition, +and Borel and Jacquet's Corvallis article, the reference below, for its source. + +## Main declarations + +All in the namespace `Matrix.GeneralLinearGroup`: + +* `universalEnveloping` and `centerUniversalEnveloping`: `U(𝔤𝔩 n ℂ)` and its centre. +* `lieDerivHom`, `envelopingAction`, `centerAction`: the action of `𝔤𝔩 n ℂ` on `smoothGL n` + as a homomorphism of Lie algebras, its extension to `U(𝔤𝔩 n ℂ)` by the universal property, + and the restriction to the centre, which also makes `smoothGL n` a module over the centre. +* `constantsCharacter`: the character by which the centre acts on the line of constant + functions; its kernel is an ideal of finite codimension annihilating the constants, which + gives condition (c) for constant automorphic forms. + +*References:* +- A. Borel and H. Jacquet, *Automorphic forms and automorphic representations*, in Automorphic + Forms, Representations and L-functions (Corvallis), Proc. Sympos. Pure Math. 33, Part 1, + Amer. Math. Soc. (1979), 189–207; §4. +-/ + +namespace Matrix.GeneralLinearGroup + +variable {n : Type*} [Fintype n] [DecidableEq n] + +-- `Matrix n n ℂ` is a Lie ring under the commutator; Mathlib keeps this instance local, since +-- it competes with the bracket of a Lie algebra given abstractly. +attribute [local instance 100] LieRing.ofAssociativeRing + +/-- The universal enveloping algebra `U(𝔤𝔩 n ℂ)` of the complexified Lie algebra of `GL n ℝ`. +The complexification of `𝔤𝔩 n ℝ` is `𝔤𝔩 n ℂ = Matrix n n ℂ` with its commutator bracket. + +This abbreviation records the choice of `LieRing.ofAssociativeRing` as the bracket, so that +downstream files can name the algebra without re-enabling that local instance. -/ +abbrev universalEnveloping (n : Type*) [Fintype n] [DecidableEq n] : Type _ := + UniversalEnvelopingAlgebra ℂ (Matrix n n ℂ) + +/-- The centre of the universal enveloping algebra of the complexified Lie algebra of `GL n ℝ`. +This is the algebra acting in condition (c) in the definition of an automorphic form. -/ +abbrev centerUniversalEnveloping (n : Type*) [Fintype n] [DecidableEq n] : + Subalgebra ℂ (universalEnveloping n) := + Subalgebra.center ℂ (universalEnveloping n) + +/-- The action of `𝔤𝔩 n ℂ` on the `C^∞` functions on `GL n ℝ` by left invariant differential +operators, as a homomorphism of `ℂ`-Lie algebras. -/ +noncomputable def lieDerivHom : Matrix n n ℂ →ₗ⁅ℂ⁆ Module.End ℂ (smoothGL n) where + toFun := lieDerivC + map_add' := lieDerivC_add + map_smul' := lieDerivC_smul + map_lie' {Z W} := by simpa [Ring.lie_def] using lieDerivC_bracket Z W + +/-- The action of the universal enveloping algebra `U(𝔤𝔩 n ℂ)` on the `C^∞` functions on +`GL n ℝ`, obtained from `lieDerivHom` by the universal property. A monomial `X₁ ⋯ Xₖ` acts as +the composite of the corresponding left invariant derivatives. -/ +noncomputable def envelopingAction : + universalEnveloping n →ₐ[ℂ] Module.End ℂ (smoothGL n) := + UniversalEnvelopingAlgebra.lift ℂ lieDerivHom + +/-- The centre of the universal enveloping algebra acting on the `C^∞` functions on `GL n ℝ`. +Restricting `envelopingAction` to the centre, this is the action condition (c) in the definition +of an automorphic form refers to. -/ +noncomputable def centerAction : + ↥(centerUniversalEnveloping n) →ₐ[ℂ] Module.End ℂ (smoothGL n) := + envelopingAction.comp (centerUniversalEnveloping n).val + +/-- The `C^∞` functions on `GL n ℝ` as a module over the centre of the universal enveloping +algebra, via left invariant differential operators. -/ +noncomputable instance instModuleCenterSmoothGL : + Module ↥(centerUniversalEnveloping n) (smoothGL n) := + Module.compHom (smoothGL n) (centerAction (n := n)).toRingHom + +lemma centerAction_smul (z : ↥(centerUniversalEnveloping n)) (φ : smoothGL n) : + z • φ = centerAction z φ := rfl + +instance : SMulCommClass ↥(centerUniversalEnveloping n) ℂ (smoothGL n) where + smul_comm z c φ := by rw [centerAction_smul, centerAction_smul, map_smul] + +instance : IsScalarTower ℂ ↥(centerUniversalEnveloping n) (smoothGL n) where + smul_assoc c z φ := by + rw [centerAction_smul, centerAction_smul, map_smul, LinearMap.smul_apply] + +/-! +### Constant functions span an invariant line + +Left invariant derivatives kill constants, so the enveloping algebra maps the line of constant +functions to itself, through the character `constantsCharacter`; its kernel is an ideal of +finite codimension annihilating the constants. +-/ + +variable (n) in +/-- The constant function `1` as an element of `smoothGL n`; the constant functions are the +line it spans. -/ +def oneSmoothGL : smoothGL n := ⟨fun _ => 1, isSmoothOnGL_const 1⟩ + +/-- An element of the line of constant functions is determined by its value at `1`. -/ +lemma eq_smul_oneSmoothGL_of_mem_span {φ : smoothGL n} (hφ : φ ∈ (ℂ ∙ oneSmoothGL n)) : + φ = (φ : GL n ℝ → ℂ) 1 • oneSmoothGL n := by + obtain ⟨a, rfl⟩ := Submodule.mem_span_singleton.mp hφ + simp [oneSmoothGL] + +/-- Left invariant differential operators map the constant functions to constant functions: +the generators `lieDerivC X` kill them. -/ +lemma envelopingAction_mem_span_oneSmoothGL (u : universalEnveloping n) : + ∀ φ ∈ (ℂ ∙ oneSmoothGL n), envelopingAction u φ ∈ (ℂ ∙ oneSmoothGL n) := by + have hsurj : Function.Surjective (UniversalEnvelopingAlgebra.mkAlgHom ℂ (Matrix n n ℂ)) := + RingCon.mkₐ_surjective _ + obtain ⟨t, rfl⟩ := hsurj u + induction t using TensorAlgebra.induction with + | algebraMap c => + exact fun φ hφ => by simpa [Module.algebraMap_end_apply] using Submodule.smul_mem _ c hφ + | ι X => + intro φ hφ + obtain ⟨a, rfl⟩ := Submodule.mem_span_singleton.mp hφ + have hone : lieDerivC X (oneSmoothGL n) = 0 := by + simp [lieDerivC, show ∀ Y, lieDeriv Y (oneSmoothGL n) = 0 from fun Y => + Subtype.ext (by simpa [oneSmoothGL] using lieDerivFun_const Y 1)] + simp [envelopingAction, UniversalEnvelopingAlgebra.lift_ι_apply', + show lieDerivHom X = lieDerivC X from rfl, hone] + | mul a b ha hb => + exact fun φ hφ => by simpa [Module.End.mul_apply] using ha _ (hb _ hφ) + | add a b ha hb => + exact fun φ hφ => by simpa using Submodule.add_mem _ (ha _ hφ) (hb _ hφ) + +lemma smul_oneSmoothGL_mem_span (z : ↥(centerUniversalEnveloping n)) : + z • oneSmoothGL n ∈ (ℂ ∙ oneSmoothGL n) := by + rw [centerAction_smul] + exact envelopingAction_mem_span_oneSmoothGL (z : universalEnveloping n) _ + (Submodule.mem_span_singleton_self _) + +variable (n) in +/-- The character by which the centre of the enveloping algebra acts on the constant +functions: `z • 1 = constantsCharacter n z • 1`. Its kernel is an ideal of finite codimension +annihilating the constants, which gives condition (c) for constant automorphic forms. -/ +noncomputable def constantsCharacter : ↥(centerUniversalEnveloping n) →ₐ[ℂ] ℂ where + toFun z := ((z • oneSmoothGL n : smoothGL n) : GL n ℝ → ℂ) 1 + map_one' := by rw [one_smul]; simp [oneSmoothGL] + map_mul' z w := by + rw [mul_smul, eq_smul_oneSmoothGL_of_mem_span (smul_oneSmoothGL_mem_span w), + smul_comm z, Submodule.coe_smul, Pi.smul_apply] + simp [oneSmoothGL, mul_comm] + map_zero' := by rw [zero_smul]; simp + map_add' z w := by rw [add_smul]; simp + commutes' c := by + rw [algebraMap_smul, Submodule.coe_smul, Pi.smul_apply] + simp [oneSmoothGL] + +end Matrix.GeneralLinearGroup diff --git a/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet/LieDeriv.lean b/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet/LieDeriv.lean new file mode 100644 index 0000000..0cb4ba5 --- /dev/null +++ b/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet/LieDeriv.lean @@ -0,0 +1,488 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Analysis.Calculus.ContDiff.Comp +public import Mathlib.Analysis.Calculus.ContDiff.Operations +public import Mathlib.Analysis.Calculus.FDeriv.Bilinear +public import Mathlib.Analysis.Calculus.FDeriv.Symmetric +public import Mathlib.Analysis.Matrix.Normed +public import Mathlib.Analysis.Normed.Module.FiniteDimension +public import Mathlib.Analysis.SpecialFunctions.Exponential +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs +public import Mathlib.Topology.Instances.Matrix + +@[expose] public section + +/-! +# Lie derivatives of smooth functions on `GL n ℝ` + +The `C^∞` functions on `GL n ℝ` and the action on them of `𝔤𝔩 n ℝ` and of its +complexification `𝔤𝔩 n ℂ` by left invariant differential operators. This is the analytic +machinery behind condition (c) in the Borel-Jacquet definition of an automorphic form; see +`FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet` for that definition, +and Borel and Jacquet's Corvallis article, the reference below, for its source. + +## Main declarations + +All in the namespace `Matrix.GeneralLinearGroup` unless qualified otherwise: + +* `AutomorphicForm.LieDerivAux.fderiv_rightDeriv_apply` and `…_sub_comm`: the product rule and + bracket identity for the operator `F ↦ fun M => fderiv ℝ F M (M * X)` over an abstract + normed algebra. +* `IsSmoothOnGL` and `smoothGL`: the `C^∞` functions on `GL n ℝ`, as a predicate and as a + `ℂ`-submodule. +* `expGL` and `lieDerivFun`: the matrix exponential as an element of `GL n ℝ`, and the left + invariant derivative `(X • φ) y = d/dt φ (y * exp (t • X)) |_{t = 0}`. +* `lieDeriv` and `lieDerivC`: the actions on `smoothGL n` of `𝔤𝔩 n ℝ` and of its + complexification `𝔤𝔩 n ℂ`, with their bracket identities `lieDeriv_bracket` and + `lieDerivC_bracket`. + +## Implementation notes + +Smoothness on `GL n ℝ` is phrased as the existence of a `C^∞` extension to the open set of +invertible matrices (`IsSmoothOnGL`), rather than through a manifold structure: the normed +ring instances on `Matrix n n ℝ` that would give `GL n ℝ` a chart are scoped, and conflict +with the product topology that `GL n ℝ` already carries. + +`X ∈ 𝔤𝔩 n ℝ` acts by differentiating along the one-parameter subgroup, +`(X • φ) y = d/dt φ (y * exp (t • X)) |_{t = 0}`; this equals `fderiv ℝ F y (y * X)` for any +`C^∞` extension `F` of `φ` (`lieDerivFun_eq_fderiv`), through which every algebraic property +is proved. The bracket identity is the product rule plus symmetry of the second derivative. + +The product rule is proved over an abstract finite-dimensional normed `ℝ`-algebra and +instantiated at `Matrix n n ℝ`. That is forced: Mathlib's norms on `Matrix n n ℝ` are scoped +instances while its topology is global, so instance search cannot assemble +`SeminormedAddCommGroup (Matrix n n ℝ →L[ℝ] ℂ)` for the written-out type even though the +instance term typechecks, and the second-derivative lemmas behind the product rule need that +instance as an argument. Instantiating an abstract lemma supplies its instance arguments +instead of searching for them. + +*References:* +- A. Borel and H. Jacquet, *Automorphic forms and automorphic representations*, in Automorphic + Forms, Representations and L-functions (Corvallis), Proc. Sympos. Pure Math. 33, Part 1, + Amer. Math. Soc. (1979), 189–207; §4. +-/ + +open scoped ContDiff + +/-! +### The product rule, over an abstract normed algebra + +In a group of units, left translation is the restriction of a linear map, so the left +invariant vector field with value `X` at `1` has value `M * X` at `M`, and the first-order +operator is `F ↦ fun M => fderiv ℝ F M (M * X)` — no manifold structure needed. This section +proves its product rule and bracket identity over an abstract algebra `A`; see the +implementation notes for why `A` cannot simply be `Matrix n n ℝ`. +-/ + +namespace AutomorphicForm.LieDerivAux + +variable {A : Type*} [NormedRing A] [NormedAlgebra ℝ A] + [FiniteDimensional ℝ A] + +/-- Right multiplication by `X`, as a continuous linear map. -/ +noncomputable def mulRightL (X : A) : A →L[ℝ] A := + LinearMap.toContinuousLinearMap (LinearMap.mulRight ℝ X) + +@[simp] +lemma mulRightL_apply (X M : A) : mulRightL X M = M * X := by simp [mulRightL] + +/-- The product rule for the left invariant derivative `F ↦ fun M => D F M (M * X)`: its +derivative at `y` in the direction `v` picks up the first-order term `D F y (v * X)`, from +differentiating `M ↦ M * X`, and the second-order term `D² F y v (y * X)`. -/ +lemma fderiv_rightDeriv_apply {F : A → ℂ} {y : A} (hF : ContDiffAt ℝ ∞ F y) (X v : A) : + fderiv ℝ (fun M => fderiv ℝ F M (M * X)) y v + = fderiv ℝ F y (v * X) + fderiv ℝ (fderiv ℝ F) y v (y * X) := by + have h₁ : HasFDerivAt (fderiv ℝ F) (fderiv ℝ (fderiv ℝ F) y) y := + ((hF.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)).hasFDerivAt + have h₂ : HasFDerivAt (fun M : A => M * X) (mulRightL X) y := (mulRightL X).hasFDerivAt + have h₃ := ((isBoundedBilinearMap_apply (𝕜 := ℝ) (E := A) (F := ℂ)).hasFDerivAt + (fderiv ℝ F y, y * X)).comp y (h₁.prodMk h₂) + have h₄ : HasFDerivAt (fun M : A => fderiv ℝ F M (M * X)) _ y := h₃ + rw [h₄.fderiv] + simp [IsBoundedBilinearMap.deriv_apply] + +/-- The commutator of two left invariant derivatives is the left invariant derivative along +the commutator: the second-order terms cancel by symmetry of the second derivative. -/ +lemma fderiv_rightDeriv_sub_comm {F : A → ℂ} {y : A} (hF : ContDiffAt ℝ ∞ F y) (X Y : A) : + fderiv ℝ (fun M => fderiv ℝ F M (M * Y)) y (y * X) + - fderiv ℝ (fun M => fderiv ℝ F M (M * X)) y (y * Y) + = fderiv ℝ F y (y * (X * Y - Y * X)) := by + have hle : minSmoothness ℝ 2 ≤ (∞ : WithTop ℕ∞) := by + rw [minSmoothness_of_isRCLikeNormedField]; exact WithTop.coe_le_coe.mpr le_top + have hsymm := (hF.isSymmSndFDerivAt hle).eq (y * X) (y * Y) + rw [fderiv_rightDeriv_apply hF Y (y * X), fderiv_rightDeriv_apply hF X (y * Y), + show y * (X * Y - Y * X) = y * X * Y - y * Y * X by noncomm_ring, map_sub] + linear_combination hsymm + +end AutomorphicForm.LieDerivAux + +namespace Matrix.GeneralLinearGroup + +variable {n : Type*} [Fintype n] [DecidableEq n] + +/-! ### Smooth functions on `GL n ℝ` -/ + +section Smooth + +open scoped Matrix.Norms.Frobenius + +/-- `φ : GL n ℝ → ℂ` is `C^∞`: it extends to a `C^∞` function on the open set of invertible +matrices. Stating it this way avoids putting a manifold structure on `GL n ℝ`. -/ +def IsSmoothOnGL (φ : GL n ℝ → ℂ) : Prop := + ∃ F : Matrix n n ℝ → ℂ, ContDiffOn ℝ ∞ F {M : Matrix n n ℝ | IsUnit M} ∧ + ∀ y : GL n ℝ, F (y : Matrix n n ℝ) = φ y + +lemma isSmoothOnGL_const (c : ℂ) : IsSmoothOnGL (fun _ : GL n ℝ => c) := + ⟨fun _ => c, contDiffOn_const, fun _ => rfl⟩ + +lemma IsSmoothOnGL.add {φ ψ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (hψ : IsSmoothOnGL ψ) : + IsSmoothOnGL (φ + ψ) := by + obtain ⟨F, hF, hFφ⟩ := hφ + obtain ⟨G, hG, hGψ⟩ := hψ + exact ⟨F + G, ContDiffOn.add hF hG, fun y => by simp [hFφ, hGψ]⟩ + +lemma IsSmoothOnGL.const_smul {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (c : ℂ) : + IsSmoothOnGL (c • φ) := by + obtain ⟨F, hF, hFφ⟩ := hφ + exact ⟨c • F, ContDiffOn.const_smul c hF, fun y => by simp [hFφ]⟩ + +/-- The invertible matrices are an open set: they are the nonvanishing locus of `det`. -/ +lemma isOpen_setOf_isUnit : IsOpen {M : Matrix n n ℝ | IsUnit M} := by + have h : {M : Matrix n n ℝ | IsUnit M} + = (fun M : Matrix n n ℝ => M.det) ⁻¹' {x : ℝ | x ≠ 0} := by + ext M + simp [Matrix.isUnit_iff_isUnit_det, isUnit_iff_ne_zero] + rw [h] + exact isOpen_ne.preimage (by fun_prop) + +lemma isUnit_coe (y : GL n ℝ) : IsUnit (y : Matrix n n ℝ) := ⟨y, rfl⟩ + +/-- A choice of `C^∞` extension of `φ` to the invertible matrices, when one exists. Only its +germ at each invertible matrix matters, by `fderiv_extendGL_eq`. -/ +noncomputable def extendGL (φ : GL n ℝ → ℂ) : Matrix n n ℝ → ℂ := + haveI := Classical.propDecidable (IsSmoothOnGL φ) + if h : IsSmoothOnGL φ then h.choose else 0 + +lemma contDiffOn_extendGL {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) : + ContDiffOn ℝ ∞ (extendGL φ) {M : Matrix n n ℝ | IsUnit M} := by + rw [extendGL, dite_eq_left hφ] + exact hφ.choose_spec.1 + +@[simp] +lemma extendGL_coe {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (y : GL n ℝ) : + extendGL φ (y : Matrix n n ℝ) = φ y := by + rw [extendGL, dite_eq_left hφ] + exact hφ.choose_spec.2 y + +lemma contDiffAt_extendGL {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (y : GL n ℝ) : + ContDiffAt ℝ ∞ (extendGL φ) (y : Matrix n n ℝ) := + (contDiffOn_extendGL hφ).contDiffAt (isOpen_setOf_isUnit.mem_nhds (isUnit_coe y)) + +/-- The derivative of the chosen extension at an invertible matrix does not depend on the +choice: any two extensions of `φ` agree on the open set of invertible matrices. -/ +lemma fderiv_extendGL_eq {φ : GL n ℝ → ℂ} {F : Matrix n n ℝ → ℂ} (hφ : IsSmoothOnGL φ) + (hF : ∀ y : GL n ℝ, F (y : Matrix n n ℝ) = φ y) (y : GL n ℝ) : + fderiv ℝ (extendGL φ) (y : Matrix n n ℝ) = fderiv ℝ F (y : Matrix n n ℝ) := by + refine Filter.EventuallyEq.fderiv_eq ?_ + filter_upwards [isOpen_setOf_isUnit.mem_nhds (isUnit_coe y)] with M hM + obtain ⟨u, rfl⟩ := hM + rw [extendGL_coe hφ, hF] + +/-! +#### Left invariant derivatives + +`(X • φ) y = d/dt φ (y * exp (t • X)) |_{t = 0}`, proved equal to the directional derivative +`fderiv ℝ F y (y * X)` of any smooth extension `F` (`lieDerivFun_eq_fderiv`), which is the +form all its properties are established in. +-/ + +/-- The exponential of a matrix, as an element of `GL n ℝ`: `exp X` is invertible with +inverse `exp (-X)`. -/ +noncomputable def expGL (X : Matrix n n ℝ) : GL n ℝ := (NormedSpace.isUnit_exp X).unit + +@[simp] +lemma coe_expGL (X : Matrix n n ℝ) : (expGL X : Matrix n n ℝ) = NormedSpace.exp X := + (NormedSpace.isUnit_exp X).unit_spec + +@[simp] +lemma expGL_zero : expGL (0 : Matrix n n ℝ) = 1 := Units.ext (by simp) + +/-- The left invariant derivative of `φ` along `X`: differentiate `φ` along the one-parameter +subgroup `t ↦ exp (t • X)` acting on the right, + +`(X • φ) y = d/dt φ (y * exp (t • X)) |_{t = 0}`. + +This is the derivative that condition (c) of the definition of an automorphic form is about: +the left invariant vector field with value `X` at `1` has value `y * X` at `y`, and +`lieDerivFun_eq_fderiv` identifies the two descriptions for `C^∞` functions. -/ +noncomputable def lieDerivFun (X : Matrix n n ℝ) (φ : GL n ℝ → ℂ) (y : GL n ℝ) : ℂ := + deriv (fun t : ℝ => φ (y * expGL (t • X))) 0 + +/-- Differentiating along the one-parameter subgroup computes the derivative of any smooth +extension in the direction `y * X`. -/ +lemma hasDerivAt_lieDerivFun {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (X : Matrix n n ℝ) + (y : GL n ℝ) : + HasDerivAt (fun t : ℝ => φ (y * expGL (t • X))) + (fderiv ℝ (extendGL φ) (y : Matrix n n ℝ) ((y : Matrix n n ℝ) * X)) 0 := by + -- The instance arguments on `Matrix n n ℝ` are deliberately never written out here: see the + -- implementation notes. Every one of them arrives by unification from a Mathlib lemma. + have hexp := (hasDerivAt_exp_smul_const X (0 : ℝ)).const_mul (y : Matrix n n ℝ) + simp only [zero_smul, NormedSpace.exp_zero, one_mul] at hexp + have hfun : (fun t : ℝ => φ (y * expGL (t • X))) + = fun t : ℝ => extendGL φ ((y : Matrix n n ℝ) * NormedSpace.exp (t • X)) := by + funext t + rw [← extendGL_coe hφ (y * expGL (t • X))] + simp + rw [hfun] + exact HasFDerivAt.comp_hasDerivAt_of_eq + (hl := ((contDiffAt_extendGL hφ y).differentiableAt (by simp)).hasFDerivAt) + (hf := hexp) (hy := by simp) + +/-- The one-parameter-subgroup description of the left invariant derivative agrees with the +directional-derivative one. Every algebraic property below is proved through this bridge. -/ +lemma lieDerivFun_eq_fderiv {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (X : Matrix n n ℝ) + (y : GL n ℝ) : + lieDerivFun X φ y + = fderiv ℝ (extendGL φ) (y : Matrix n n ℝ) ((y : Matrix n n ℝ) * X) := + (hasDerivAt_lieDerivFun hφ X y).deriv + +lemma IsSmoothOnGL.lieDerivFun {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (X : Matrix n n ℝ) : + IsSmoothOnGL (lieDerivFun X φ) := by + refine ⟨fun M => fderiv ℝ (extendGL φ) M (M * X), fun M hM => ?_, + fun y => (lieDerivFun_eq_fderiv hφ X y).symm⟩ + have h : ContDiffAt ℝ ∞ (extendGL φ) M := + (contDiffOn_extendGL hφ).contDiffAt (isOpen_setOf_isUnit.mem_nhds hM) + exact (((h.fderiv_right (m := ∞) (by simp)).clm_apply + (contDiffAt_id.mul contDiffAt_const))).contDiffWithinAt + +/-- The `ℂ`-submodule of `C^∞` functions on `GL n ℝ`, which is what the Lie algebra and hence +the universal enveloping algebra acts on. -/ +def smoothGL (n : Type*) [Fintype n] [DecidableEq n] : Submodule ℂ (GL n ℝ → ℂ) where + carrier := {φ | IsSmoothOnGL φ} + zero_mem' := isSmoothOnGL_const 0 + add_mem' hφ hψ := hφ.add hψ + smul_mem' c _ hφ := hφ.const_smul c + +@[simp] +lemma mem_smoothGL {φ : GL n ℝ → ℂ} : φ ∈ smoothGL n ↔ IsSmoothOnGL φ := Iff.rfl + +lemma lieDerivFun_add {φ ψ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (hψ : IsSmoothOnGL ψ) + (X : Matrix n n ℝ) : lieDerivFun X (φ + ψ) = lieDerivFun X φ + lieDerivFun X ψ := by + funext y + have hadd : fderiv ℝ (extendGL φ + extendGL ψ) (y : Matrix n n ℝ) + = fderiv ℝ (extendGL φ) (y : Matrix n n ℝ) + fderiv ℝ (extendGL ψ) (y : Matrix n n ℝ) := + ((((contDiffAt_extendGL hφ y).differentiableAt (by simp)).hasFDerivAt).add + (((contDiffAt_extendGL hψ y).differentiableAt (by simp)).hasFDerivAt)).fderiv + rw [lieDerivFun_eq_fderiv (hφ.add hψ), fderiv_extendGL_eq (hφ.add hψ) + (F := extendGL φ + extendGL ψ) + (fun z => by simp [extendGL_coe hφ, extendGL_coe hψ]) y, hadd] + simp [lieDerivFun_eq_fderiv hφ, lieDerivFun_eq_fderiv hψ] + +lemma lieDerivFun_const_smul {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (c : ℂ) + (X : Matrix n n ℝ) : lieDerivFun X (c • φ) = c • lieDerivFun X φ := by + funext y + have hsmul : fderiv ℝ (c • extendGL φ) (y : Matrix n n ℝ) + = c • fderiv ℝ (extendGL φ) (y : Matrix n n ℝ) := + ((((contDiffAt_extendGL hφ y).differentiableAt (by simp)).hasFDerivAt).const_smul c).fderiv + rw [lieDerivFun_eq_fderiv (hφ.const_smul c), fderiv_extendGL_eq (hφ.const_smul c) + (F := c • extendGL φ) (fun z => by simp [extendGL_coe hφ]) y, hsmul] + simp [lieDerivFun_eq_fderiv hφ] + +@[simp] +lemma lieDerivFun_zero_left (φ : GL n ℝ → ℂ) : lieDerivFun 0 φ = 0 := by + funext y; simp [lieDerivFun] + +lemma lieDerivFun_add_left {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (X X' : Matrix n n ℝ) : + lieDerivFun (X + X') φ = lieDerivFun X φ + lieDerivFun X' φ := by + funext y + simp [lieDerivFun_eq_fderiv hφ, mul_add] + +lemma lieDerivFun_smul_left {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (r : ℝ) (X : Matrix n n ℝ) : + lieDerivFun (r • X) φ = r • lieDerivFun X φ := by + funext y + simp [lieDerivFun_eq_fderiv hφ] + +lemma lieDerivFun_const (X : Matrix n n ℝ) (c : ℂ) : + lieDerivFun X (fun _ : GL n ℝ => c) = 0 := by + funext y + simp [lieDerivFun] + +/-- The left invariant derivative along `X` as a `ℂ`-linear endomorphism of the `C^∞` +functions on `GL n ℝ`. -/ +noncomputable def lieDeriv (X : Matrix n n ℝ) : smoothGL n →ₗ[ℂ] smoothGL n where + toFun φ := ⟨lieDerivFun X (φ : GL n ℝ → ℂ), φ.2.lieDerivFun X⟩ + map_add' φ ψ := Subtype.ext (by simpa using lieDerivFun_add φ.2 ψ.2 X) + map_smul' c φ := Subtype.ext (by simpa using lieDerivFun_const_smul φ.2 c X) + +@[simp] +lemma coe_lieDeriv (X : Matrix n n ℝ) (φ : smoothGL n) : + (lieDeriv X φ : GL n ℝ → ℂ) = lieDerivFun X (φ : GL n ℝ → ℂ) := rfl + +/-- The commutator of two left invariant derivatives is the left invariant derivative along the +commutator of the directions. This is the bracket identity that makes `lieDeriv` a Lie algebra +homomorphism; the second-order terms cancel by symmetry of the second derivative. -/ +lemma lieDerivFun_bracket {φ : GL n ℝ → ℂ} (hφ : IsSmoothOnGL φ) (X Y : Matrix n n ℝ) : + lieDerivFun (X * Y - Y * X) φ + = lieDerivFun X (lieDerivFun Y φ) - lieDerivFun Y (lieDerivFun X φ) := by + funext y + have hY : fderiv ℝ (extendGL (lieDerivFun Y φ)) (y : Matrix n n ℝ) + = fderiv ℝ (fun M => fderiv ℝ (extendGL φ) M (M * Y)) (y : Matrix n n ℝ) := + fderiv_extendGL_eq (hφ.lieDerivFun Y) (fun z => (lieDerivFun_eq_fderiv hφ Y z).symm) y + have hX : fderiv ℝ (extendGL (lieDerivFun X φ)) (y : Matrix n n ℝ) + = fderiv ℝ (fun M => fderiv ℝ (extendGL φ) M (M * X)) (y : Matrix n n ℝ) := + fderiv_extendGL_eq (hφ.lieDerivFun X) (fun z => (lieDerivFun_eq_fderiv hφ X z).symm) y + rw [Pi.sub_apply, lieDerivFun_eq_fderiv hφ (X * Y - Y * X) y, + lieDerivFun_eq_fderiv (hφ.lieDerivFun Y) X y, lieDerivFun_eq_fderiv (hφ.lieDerivFun X) Y y, + hX, hY] + exact (AutomorphicForm.LieDerivAux.fderiv_rightDeriv_sub_comm + (contDiffAt_extendGL hφ y) X Y).symm + +lemma lieDeriv_bracket (X Y : Matrix n n ℝ) : + lieDeriv (X * Y - Y * X) = lieDeriv X * lieDeriv Y - lieDeriv Y * lieDeriv X := by + refine LinearMap.ext fun φ => Subtype.ext ?_ + simpa using lieDerivFun_bracket φ.2 X Y + +@[simp] +lemma lieDeriv_zero : lieDeriv (0 : Matrix n n ℝ) = 0 := + LinearMap.ext fun φ => Subtype.ext (by simp) + +lemma lieDeriv_add (X X' : Matrix n n ℝ) : lieDeriv (X + X') = lieDeriv X + lieDeriv X' := + LinearMap.ext fun φ => Subtype.ext (by simpa using lieDerivFun_add_left φ.2 X X') + +lemma lieDeriv_real_smul (r : ℝ) (X : Matrix n n ℝ) : + lieDeriv (r • X) = (r : ℂ) • lieDeriv X := + LinearMap.ext fun φ => Subtype.ext (by simpa using lieDerivFun_smul_left φ.2 r X) + +lemma lieDeriv_neg (X : Matrix n n ℝ) : lieDeriv (-X) = -lieDeriv X := by + rw [show -X = (-1 : ℝ) • X by simp, lieDeriv_real_smul] + push_cast + module + +lemma lieDeriv_sub (X X' : Matrix n n ℝ) : lieDeriv (X - X') = lieDeriv X - lieDeriv X' := by + rw [sub_eq_add_neg, lieDeriv_add, lieDeriv_neg] + abel + +/-! +#### Complexification + +`𝔤𝔩 n ℂ = 𝔤𝔩 n ℝ ⊗ ℂ` acts by `X + i Y ↦ lieDeriv X + i • lieDeriv Y`. Since the entrywise +real and imaginary parts turn complex matrix multiplication into the expected pair of real +products, the bracket identity over `ℝ` gives the bracket identity over `ℂ`. +-/ + +section +omit [Fintype n] [DecidableEq n] + +lemma map_re_add (Z W : Matrix n n ℂ) : + (Z + W).map Complex.re = Z.map Complex.re + W.map Complex.re := + Matrix.map_add _ Complex.add_re Z W + +lemma map_im_add (Z W : Matrix n n ℂ) : + (Z + W).map Complex.im = Z.map Complex.im + W.map Complex.im := + Matrix.map_add _ Complex.add_im Z W + +lemma map_re_sub (Z W : Matrix n n ℂ) : + (Z - W).map Complex.re = Z.map Complex.re - W.map Complex.re := + Matrix.map_sub _ Complex.sub_re Z W + +lemma map_im_sub (Z W : Matrix n n ℂ) : + (Z - W).map Complex.im = Z.map Complex.im - W.map Complex.im := + Matrix.map_sub _ Complex.sub_im Z W + +lemma map_re_smul (c : ℂ) (Z : Matrix n n ℂ) : + (c • Z).map Complex.re = c.re • Z.map Complex.re - c.im • Z.map Complex.im := by + ext i j; simp [Complex.mul_re] + +lemma map_im_smul (c : ℂ) (Z : Matrix n n ℂ) : + (c • Z).map Complex.im = c.re • Z.map Complex.im + c.im • Z.map Complex.re := by + ext i j; simp [Complex.mul_im] + +end + +section +omit [DecidableEq n] + +lemma map_re_mul (Z W : Matrix n n ℂ) : + (Z * W).map Complex.re + = Z.map Complex.re * W.map Complex.re - Z.map Complex.im * W.map Complex.im := by + ext i j + simp [Matrix.mul_apply, Complex.mul_re, Finset.sum_sub_distrib] + +lemma map_im_mul (Z W : Matrix n n ℂ) : + (Z * W).map Complex.im + = Z.map Complex.re * W.map Complex.im + Z.map Complex.im * W.map Complex.re := by + ext i j + simp [Matrix.mul_apply, Complex.mul_im, Finset.sum_add_distrib] + +/-- The real part of a complex commutator, arranged as a difference of two real commutators. -/ +lemma map_re_bracket (Z W : Matrix n n ℂ) : + (Z * W - W * Z).map Complex.re + = (Z.map Complex.re * W.map Complex.re - W.map Complex.re * Z.map Complex.re) + - (Z.map Complex.im * W.map Complex.im - W.map Complex.im * Z.map Complex.im) := by + rw [map_re_sub, map_re_mul, map_re_mul] + abel + +/-- The imaginary part of a complex commutator, arranged as a sum of two real commutators. -/ +lemma map_im_bracket (Z W : Matrix n n ℂ) : + (Z * W - W * Z).map Complex.im + = (Z.map Complex.re * W.map Complex.im - W.map Complex.im * Z.map Complex.re) + + (Z.map Complex.im * W.map Complex.re - W.map Complex.re * Z.map Complex.im) := by + rw [map_im_sub, map_im_mul, map_im_mul] + abel + +end + +/-- The action of the complexified Lie algebra `𝔤𝔩 n ℂ` of `GL n ℝ` on the `C^∞` functions: +`X + i Y` acts as `lieDeriv X + i • lieDeriv Y`. -/ +noncomputable def lieDerivC (Z : Matrix n n ℂ) : Module.End ℂ (smoothGL n) := + lieDeriv (Z.map Complex.re) + Complex.I • lieDeriv (Z.map Complex.im) + +lemma lieDerivC_add (Z W : Matrix n n ℂ) : lieDerivC (Z + W) = lieDerivC Z + lieDerivC W := by + simp only [lieDerivC, map_re_add, map_im_add, lieDeriv_add, smul_add] + abel + +lemma lieDerivC_smul (c : ℂ) (Z : Matrix n n ℂ) : lieDerivC (c • Z) = c • lieDerivC Z := by + have key : ∀ (a b : ℝ) (W : Matrix n n ℂ), + lieDerivC (((a : ℂ) + (b : ℂ) * Complex.I) • W) + = ((a : ℂ) + (b : ℂ) * Complex.I) • lieDerivC W := by + intro a b W + simp only [lieDerivC, map_re_smul, map_im_smul, lieDeriv_sub, lieDeriv_add, + lieDeriv_real_smul, Complex.add_re, Complex.add_im, Complex.ofReal_re, Complex.ofReal_im, + Complex.mul_re, Complex.mul_im, Complex.I_re, Complex.I_im] + match_scalars + all_goals ring_nf + all_goals (try simp only [Complex.I_sq]) + all_goals ring + simpa [Complex.re_add_im] using key c.re c.im Z + +lemma lieDerivC_bracket (Z W : Matrix n n ℂ) : + lieDerivC (Z * W - W * Z) = lieDerivC Z * lieDerivC W - lieDerivC W * lieDerivC Z := by + -- The two commutators have to be assembled before `lieDeriv_sub` is allowed near them, + -- or it splits `lieDeriv (A * C - C * A)` and the bracket identity no longer applies. + simp only [lieDerivC] + rw [map_re_bracket, map_im_bracket, lieDeriv_sub, lieDeriv_add] + simp only [lieDeriv_bracket, mul_add, add_mul, smul_mul_assoc, + mul_smul_comm, smul_smul, smul_add] + match_scalars + all_goals ring_nf + all_goals (try simp only [Complex.I_sq]) + all_goals ring + +end Smooth + +end Matrix.GeneralLinearGroup diff --git a/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet/Subgroups.lean b/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet/Subgroups.lean new file mode 100644 index 0000000..8c4bd5d --- /dev/null +++ b/FormalConjecturesForMathlib/NumberTheory/AutomorphicForm/BorelJacquet/Subgroups.lean @@ -0,0 +1,234 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs +public import Mathlib.LinearAlgebra.UnitaryGroup +public import Mathlib.NumberTheory.Padics.HeightOneSpectrum +public import Mathlib.NumberTheory.Padics.ProperSpace +public import Mathlib.RingTheory.DedekindDomain.FiniteAdeleRing +public import Mathlib.Topology.Algebra.Group.Matrix +public import Mathlib.Topology.Algebra.RestrictedProduct.TopologicalSpace +public import Mathlib.Topology.Instances.Matrix + +@[expose] public section + +/-! +# The subgroups in the Borel-Jacquet definition of an automorphic form + +The subgroups of `G(𝔸) = G(𝔸_f) × G(ℝ)`, for `G = GL n / ℚ`, that the Borel-Jacquet +definition of an automorphic form quantifies over; see +`FormalConjecturesForMathlib.NumberTheory.AutomorphicForm.BorelJacquet` for that definition, +and Borel and Jacquet's Corvallis article, the reference below, for its source. + +## Main declarations + +All in the namespace `Matrix.GeneralLinearGroup`: + +* `diagonalEmbedding` and `ratDiagonal`: the diagonal copy of the rational points + `Γ = G(ℚ) = GL n ℚ` in `G(𝔸_f) × G(ℝ)`, the subgroup of condition (a). +* `orthogonalSubgroup`: the orthogonal group `K = O n ℝ` inside `GL n ℝ`, the maximal compact + subgroup of condition (b2) — mathlib's `Matrix.orthogonalGroup n ℝ`, a submonoid of + `Matrix n n ℝ`, transported along the coercion to a subgroup of `GL n ℝ`. +* `integralAdeles` and `integralAdelicSubgroup`: the integral adeles `Ẑ` and the compact open + subgroup `GL n Ẑ` of `G(𝔸_f)` (`isOpen_integralAdelicSubgroup`, + `isCompact_integralAdelicSubgroup`), which witnesses condition (b1) for constant automorphic + forms. + +## Implementation notes + +Compactness of `orthogonalSubgroup n` and its maximality (Cartan-Iwasawa-Malcev, which also +makes it unique up to conjugacy) are asserted in its docstring but not formalised; of +compactness, the boundedness half is proved (`abs_coe_le_one_of_mem_orthogonalSubgroup`). + +*References:* +- A. Borel and H. Jacquet, *Automorphic forms and automorphic representations*, in Automorphic + Forms, Representations and L-functions (Corvallis), Proc. Sympos. Pure Math. 33, Part 1, + Amer. Math. Soc. (1979), 189–207; §4. +-/ + +namespace Matrix.GeneralLinearGroup + +open scoped IsDedekindDomain.FiniteAdeleRing + +variable {n : Type*} [Fintype n] [DecidableEq n] + +/-! ### The subgroups `Γ = G(ℚ)` and `K = O n ℝ`: conditions (a) and (b2) -/ + +variable (n) in +/-- The diagonal embedding of the rational points `G(ℚ) = GL n ℚ` into +`G(𝔸_f) × G(ℝ) = GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ`, through the inclusions of `ℚ` into the finite +adeles and into `ℝ`. -/ +noncomputable def diagonalEmbedding : GL n ℚ →* GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ := + (map (algebraMap ℚ 𝔸ᶠ[ℤ, ℚ])).prod (map (algebraMap ℚ ℝ)) + +variable (n) in +/-- The subgroup `Γ = G(ℚ)` of `G(𝔸_f) × G(ℝ)`: the range of the diagonal embedding of +`GL n ℚ`. Condition (a) for an automorphic form is left invariance under this subgroup. -/ +noncomputable def ratDiagonal : Subgroup (GL n 𝔸ᶠ[ℤ, ℚ] × GL n ℝ) := + (diagonalEmbedding n).range + +/-- The orthogonal group `O n ℝ` as a subgroup of `GL n ℝ`: the units of `Matrix n n ℝ` whose +underlying matrix lies in mathlib's `Matrix.orthogonalGroup n ℝ`, the submonoid of matrices +whose transpose is their inverse. This is the maximal compact subgroup of `GL n ℝ` — up to +conjugacy the only one, by the Cartan-Iwasawa-Malcev theorem — and it is the `K` of the pair +`(G, K)` in the definition of an automorphic form for `GL n`. + +Mathlib's `Matrix.orthogonalGroup n ℝ` is a `Submonoid (Matrix n n ℝ)`; what the definition of +an automorphic form needs is a `Subgroup (GL n ℝ)`, so we transport it along the coercion +`GL n ℝ → Matrix n n ℝ` rather than restate the orthogonality condition. -/ +def orthogonalSubgroup (n : Type*) [Fintype n] [DecidableEq n] : Subgroup (GL n ℝ) where + carrier := {y | (y : Matrix n n ℝ) ∈ Matrix.orthogonalGroup n ℝ} + one_mem' := by simp [Matrix.mem_orthogonalGroup_iff] + mul_mem' {a b} ha hb := by + simp only [Set.mem_ofPred_eq, Units.val_mul] at ha hb ⊢ + exact mul_mem ha hb + inv_mem' {a} ha := by + simp only [Set.mem_ofPred_eq, Matrix.mem_orthogonalGroup_iff] at ha ⊢ + rw [Matrix.GeneralLinearGroup.coe_inv, Matrix.inv_eq_right_inv ha, + Matrix.transpose_transpose] + exact (Matrix.mem_orthogonalGroup_iff' n ℝ).mp ((Matrix.mem_orthogonalGroup_iff n ℝ).mpr ha) + +lemma mem_orthogonalSubgroup {y : GL n ℝ} : + y ∈ orthogonalSubgroup n ↔ (y : Matrix n n ℝ) ∈ Matrix.orthogonalGroup n ℝ := + Set.mem_ofPred_eq ▸ Iff.rfl + +@[simp] +lemma mem_orthogonalSubgroup_iff_mul_transpose {y : GL n ℝ} : + y ∈ orthogonalSubgroup n ↔ (y : Matrix n n ℝ) * (y : Matrix n n ℝ)ᵀ = 1 := + mem_orthogonalSubgroup.trans (Matrix.mem_orthogonalGroup_iff n ℝ) + +lemma mem_orthogonalSubgroup_iff_transpose_eq_coe_inv {y : GL n ℝ} : + y ∈ orthogonalSubgroup n ↔ (y : Matrix n n ℝ)ᵀ = (↑y⁻¹ : Matrix n n ℝ) := by + rw [mem_orthogonalSubgroup_iff_mul_transpose] + refine ⟨fun h => ?_, fun h => ?_⟩ + · rw [← Matrix.inv_eq_right_inv h, Matrix.GeneralLinearGroup.coe_inv] + · rw [h]; exact y.mul_inv + +/-- The entries of an orthogonal matrix are bounded by `1`: each row is a unit vector. This is +the boundedness half of the compactness of `orthogonalSubgroup n`; see the implementation notes +on what is and is not formalised about that. -/ +lemma abs_coe_le_one_of_mem_orthogonalSubgroup {y : GL n ℝ} (hy : y ∈ orthogonalSubgroup n) + (i j : n) : |(y : Matrix n n ℝ) i j| ≤ 1 := by + set M := (y : Matrix n n ℝ) with hM + have hd : ∑ k, M i k * M i k = 1 := by + simpa [Matrix.mul_apply, Matrix.one_apply] using congrArg (fun A => A i i) + (mem_orthogonalSubgroup_iff_mul_transpose.mp hy) + exact abs_le_one_iff_mul_self_le_one.mpr (hd ▸ Finset.single_le_sum + (f := fun k => M i k * M i k) (fun k _ => mul_self_nonneg _) (Finset.mem_univ j)) + +/-! ### The compact open subgroup `GL n Ẑ`: condition (b1) -/ + +section IntegralSubgroup + +open IsDedekindDomain RestrictedProduct + +/-- The `v`-adic integers of `ℚ` are compact: they are homeomorphic to `ℤ_[p]` for the +corresponding prime `p`. -/ +instance (v : HeightOneSpectrum ℤ) : CompactSpace (v.adicCompletionIntegers ℚ) := by + have : Fact (Rat.HeightOneSpectrum.primesEquiv v : ℕ).Prime := + ⟨(Rat.HeightOneSpectrum.primesEquiv v).2⟩ + let _ : Algebra ℤ ↥(v.adicCompletionIntegers ℚ) := Ring.toIntAlgebra _ + exact (Rat.HeightOneSpectrum.adicCompletionIntegers.padicIntEquiv + v).toHomeomorph.symm.compactSpace + +instance : T2Space 𝔸ᶠ[ℤ, ℚ] := + inferInstanceAs (T2Space (Πʳ v : HeightOneSpectrum ℤ, + [v.adicCompletion ℚ, v.adicCompletionIntegers ℚ])) + +/-- The integral adeles `Ẑ = ∏ᵥ ℤᵥ` as a subring of the finite adeles of `ℚ`: the adeles that +are integral at every place. -/ +def integralAdeles : Subring 𝔸ᶠ[ℤ, ℚ] where + carrier := {x | ∀ v, x v ∈ v.adicCompletionIntegers ℚ} + one_mem' _v := one_mem _ + mul_mem' hx hy v := mul_mem (hx v) (hy v) + zero_mem' _v := zero_mem _ + add_mem' hx hy v := add_mem (hx v) (hy v) + neg_mem' hx v := neg_mem (hx v) + +lemma isOpen_integralAdeles : IsOpen (integralAdeles : Set 𝔸ᶠ[ℤ, ℚ]) := + RestrictedProduct.isOpen_forall_mem fun _ => Valued.isOpen_valuationSubring _ + +lemma isCompact_integralAdeles : IsCompact (integralAdeles : Set 𝔸ᶠ[ℤ, ℚ]) := by + have h : (integralAdeles : Set 𝔸ᶠ[ℤ, ℚ]) + = Set.range (structureMap (fun v : HeightOneSpectrum ℤ => v.adicCompletion ℚ) + (fun v => v.adicCompletionIntegers ℚ) Filter.cofinite) := by + rw [range_structureMap] + rfl + rw [h, ← Set.image_univ] + exact (CompactSpace.isCompact_univ + (X := Π v : HeightOneSpectrum ℤ, v.adicCompletionIntegers ℚ)).image + isEmbedding_structureMap.continuous + +variable (n) in +/-- `GL n Ẑ` inside `GL n 𝔸ᶠ[ℤ, ℚ]`: the matrices whose entries, and whose inverse's entries, +are integral adeles. It is a compact open subgroup of `G(𝔸_f)` +(`isOpen_integralAdelicSubgroup`, `isCompact_integralAdelicSubgroup`), as condition (b1) +requires. -/ +def integralAdelicSubgroup : Subgroup (GL n 𝔸ᶠ[ℤ, ℚ]) where + carrier := {g | (∀ i j, (g : Matrix n n 𝔸ᶠ[ℤ, ℚ]) i j ∈ integralAdeles) ∧ + ∀ i j, (↑g⁻¹ : Matrix n n 𝔸ᶠ[ℤ, ℚ]) i j ∈ integralAdeles} + one_mem' := by + have h1 : ∀ i j : n, (1 : Matrix n n 𝔸ᶠ[ℤ, ℚ]) i j ∈ integralAdeles := fun i j => by + rcases eq_or_ne i j with rfl | h + · rw [Matrix.one_apply_eq]; exact one_mem _ + · rw [Matrix.one_apply_ne h]; exact zero_mem _ + exact ⟨fun i j => by simpa using h1 i j, fun i j => by simpa using h1 i j⟩ + mul_mem' {a b} ha hb := by + refine ⟨fun i j => ?_, fun i j => ?_⟩ + · rw [Units.val_mul, Matrix.mul_apply] + exact Subring.sum_mem _ fun k _ => mul_mem (ha.1 i k) (hb.1 k j) + · have hrev : ((a * b)⁻¹ : GL n 𝔸ᶠ[ℤ, ℚ]) = b⁻¹ * a⁻¹ := _root_.mul_inv_rev a b + rw [hrev, Units.val_mul, Matrix.mul_apply] + exact Subring.sum_mem _ fun k _ => mul_mem (hb.2 i k) (ha.2 k j) + inv_mem' {a} ha := ⟨ha.2, by rw [inv_inv]; exact ha.1⟩ + +lemma isOpen_integralAdelicSubgroup : + IsOpen ((integralAdelicSubgroup n) : Set (GL n 𝔸ᶠ[ℤ, ℚ])) := by + have hW : IsOpen {M : Matrix n n 𝔸ᶠ[ℤ, ℚ] | ∀ i j, M i j ∈ integralAdeles} := by + have h : {M : Matrix n n 𝔸ᶠ[ℤ, ℚ] | ∀ i j, M i j ∈ integralAdeles} + = ⋂ i, ⋂ j, (fun M : Matrix n n 𝔸ᶠ[ℤ, ℚ] => M i j) ⁻¹' integralAdeles := by + ext M; simp + rw [h] + exact isOpen_iInter_of_finite fun i => isOpen_iInter_of_finite fun j => + isOpen_integralAdeles.preimage (continuous_id.matrix_elem i j) + exact (hW.preimage Units.continuous_val).inter (hW.preimage Units.continuous_coe_inv) + +lemma isCompact_integralAdelicSubgroup : + IsCompact ((integralAdelicSubgroup n) : Set (GL n 𝔸ᶠ[ℤ, ℚ])) := by + set W : Set (Matrix n n 𝔸ᶠ[ℤ, ℚ]) := {M | ∀ i j, M i j ∈ integralAdeles} with hWdef + have hWc : IsCompact W := + (Set.ext fun M => ⟨fun h i _ j _ => h i j, fun h i j => h i trivial j trivial⟩ : + W = Set.univ.pi fun _ : n => Set.univ.pi fun _ => (integralAdeles : Set 𝔸ᶠ[ℤ, ℚ])) ▸ + isCompact_univ_pi fun _ => isCompact_univ_pi fun _ => isCompact_integralAdeles + have himg : Units.embedProduct _ '' (integralAdelicSubgroup n) + = (fun p : Matrix n n 𝔸ᶠ[ℤ, ℚ] × Matrix n n 𝔸ᶠ[ℤ, ℚ] => (p.1, MulOpposite.op p.2)) '' + ((W ×ˢ W) ∩ {p | p.1 * p.2 = 1} ∩ {p | p.2 * p.1 = 1}) := by + ext p + constructor + · rintro ⟨g, hg, rfl⟩ + exact ⟨(↑g, ↑g⁻¹), ⟨⟨⟨hg.1, hg.2⟩, g.mul_inv⟩, g.inv_mul⟩, rfl⟩ + · rintro ⟨⟨A, B⟩, ⟨⟨⟨hA, hB⟩, h1⟩, h2⟩, rfl⟩ + exact ⟨⟨A, B, h1, h2⟩, ⟨hA, hB⟩, rfl⟩ + rw [Units.isEmbedding_embedProduct.isCompact_iff, himg] + exact (((hWc.prod hWc).inter_right (isClosed_eq (continuous_fst.mul continuous_snd) + continuous_const)).inter_right (isClosed_eq (continuous_snd.mul continuous_fst) + continuous_const)).image + (continuous_fst.prodMk (MulOpposite.continuous_op.comp continuous_snd)) + +end IntegralSubgroup + +end Matrix.GeneralLinearGroup diff --git a/FormalConjecturesForMathlib/NumberTheory/BeurlingPrimes.lean b/FormalConjecturesForMathlib/NumberTheory/BeurlingPrimes.lean index 5c65f6b..0f63def 100644 --- a/FormalConjecturesForMathlib/NumberTheory/BeurlingPrimes.lean +++ b/FormalConjecturesForMathlib/NumberTheory/BeurlingPrimes.lean @@ -16,7 +16,7 @@ limitations under the License. module public import Mathlib.Algebra.BigOperators.Finsupp.Basic -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Order.Filter.AtTopBot.Defs @[expose] public section diff --git a/FormalConjecturesForMathlib/NumberTheory/ExpansionEntropy.lean b/FormalConjecturesForMathlib/NumberTheory/ExpansionEntropy.lean new file mode 100644 index 0000000..25a2d07 --- /dev/null +++ b/FormalConjecturesForMathlib/NumberTheory/ExpansionEntropy.lean @@ -0,0 +1,163 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import FormalConjecturesForMathlib.Dynamics.SymbolicDynamics.BlockComplexity +public import FormalConjecturesForMathlib.NumberTheory.NormalNumber +public import Mathlib.Algebra.ContinuedFractions.Computation.Basic + +/-! +# Entropy of the expansions of a real number + +The entropy of the continued fraction expansion of a real number $\xi$ and of its expansion in +an integer base $b$. Both are the entropy `SymbolicDynamics.blockEntropy` of the sequence of +digits. + +A real number is rich in base $b$ if and only if its base-$b$ expansion has the maximal block +complexity $p(n) = b^n$ for all $n$. Then its entropy is the maximal value $\log b$. In +particular, this holds for numbers that are normal in base $b$. + +*References:* +- [Bug12] Bugeaud, Yann. "Distribution modulo one and Diophantine approximation." + Vol. 193. Cambridge University Press, 2012. Chapter 10. + +## Main definitions + +* `Real.partQuot`: the sequence of partial quotients of a real number. +* `Real.cfEntropy`: the entropy of the continued fraction expansion of a real number. +* `Real.baseEntropy`: the entropy of the base `b` expansion of a real number. + +## Main statements + +* `NormalNumber.isRichInBase_iff_blockComplexity`: a number is rich in base `b` if and only if + its expansion has block complexity `b ^ n` for all `n`. +* `Real.baseEntropy_le`: the entropy of a base `b` expansion is at most `log b`. +* `NormalNumber.IsRichInBase.baseEntropy_eq`, `NormalNumber.IsNormalInBase.baseEntropy_eq`: + rich and normal numbers have entropy `log b`. +* `NormalNumber.IsRichInBase.not_isEventuallyPeriodic`: the expansion of a rich number is not + eventually periodic. +-/ + +@[expose] public section + +open Filter SymbolicDynamics + +open scoped ENNReal + +namespace Real + +/-- +The sequence $(c_n)_{n \ge 1}$ of partial quotients of the continued fraction expansion +$\xi = [c_0; c_1, c_2, \ldots]$, indexed from $0$. The integer part $c_0$ is not part of the +sequence. The expansion of an irrational number never terminates, so the default value `0` is +never used for such $\xi$. +-/ +noncomputable def partQuot (ξ : ℝ) (n : ℕ) : ℝ := + ((GenContFract.of ξ).partDens.get? n).getD 0 + +/-- The entropy $E(\xi)$ of the continued fraction expansion of $\xi$. -/ +noncomputable def cfEntropy (ξ : ℝ) : EReal := blockEntropy (partQuot ξ) + +/-- The entropy $E(\xi, b)$ of the base $b$ expansion of $\xi$. -/ +noncomputable def baseEntropy (b : ℕ) (ξ : ℝ) : EReal := + blockEntropy (NormalNumber.digitSeq b ξ) + +end Real + +namespace NormalNumber + +private theorem blocks_subset {b : ℕ} (hb : 1 ≤ b) (ξ : ℝ) (n : ℕ) : + {w : Fin n → ℕ | ∃ k, ∀ i, w i = digitSeq b ξ (k + i)} ⊆ {w | ∀ i, w i < b} := + fun _ ⟨_, hk⟩ i => hk i ▸ Nat.mod_lt _ hb + +private theorem encard_digits (b n : ℕ) : {w : Fin n → ℕ | ∀ i, w i < b}.encard = b ^ n := by + have : {w : Fin n → ℕ | ∀ i, w i < b} = ↑(Fintype.piFinset fun _ : Fin n => Finset.range b) := by + ext w + simp + rw [this, Set.encard_coe_eq_coe_finsetCard, Fintype.card_piFinset] + simp + +/-- A base-$b$ expansion has at most $b^n$ distinct blocks of length $n$. -/ +theorem blockComplexity_digitSeq_le {b : ℕ} (hb : 1 ≤ b) (ξ : ℝ) (n : ℕ) : + blockComplexity (digitSeq b ξ) n ≤ (b : ℝ≥0∞) ^ n := by + simpa [blockComplexity, encard_digits] using + ENat.toENNReal_le.2 (Set.encard_le_encard (blocks_subset hb ξ n)) + +/-- A real number is rich in base $b$ if and only if its base-$b$ expansion has $b^n$ distinct +blocks of length $n$ for every $n$. -/ +theorem isRichInBase_iff_blockComplexity {b : ℕ} (hb : 1 ≤ b) (ξ : ℝ) : + IsRichInBase b ξ ↔ ∀ n, blockComplexity (digitSeq b ξ) n = (b : ℝ≥0∞) ^ n := by + refine ⟨fun h n => ?_, fun h n w hw => ?_⟩ + · have : {w : Fin n → ℕ | ∃ k, ∀ i, w i = digitSeq b ξ (k + i)} = {w | ∀ i, w i < b} := + (blocks_subset hb ξ n).antisymm fun w hw => (h n w hw).imp fun k hk i => (hk i).symm + simp [blockComplexity, this, encard_digits] + · have hfin : {w : Fin n → ℕ | ∀ i, w i < b}.Finite := + Set.finite_of_encard_eq_coe (encard_digits b n) + have heq := (hfin.subset (blocks_subset hb ξ n)).eq_of_subset_of_encard_le + (blocks_subset hb ξ n) + (ENat.toENNReal_le.1 (by simpa [blockComplexity, encard_digits] using (h n).ge)) + obtain ⟨k, hk⟩ := (Set.ext_iff.1 heq w).2 hw + exact ⟨k, fun i => (hk i).symm⟩ + +/-- A number that is normal in base $b$ has $b^n$ distinct blocks of length $n$ in its base-$b$ +expansion. -/ +theorem IsNormalInBase.blockComplexity_eq {b : ℕ} (hb : 1 ≤ b) {ξ : ℝ} (h : IsNormalInBase b ξ) + (n : ℕ) : blockComplexity (digitSeq b ξ) n = (b : ℝ≥0∞) ^ n := + (isRichInBase_iff_blockComplexity hb ξ).1 h.isRichInBase n + +private theorem log_pow_div {b : ℕ} (hb : 1 ≤ b) {n : ℕ} (hn : n ≠ 0) : + ((b : ℝ≥0∞) ^ n).log / (n : EReal) = (Real.log b : EReal) := by + have : (b : ℝ≥0∞) ^ n = ENNReal.ofReal ((b : ℝ) ^ n) := by + rw [ENNReal.ofReal_pow (by positivity)] + simp + rw [this, ENNReal.log_ofReal_of_pos (by positivity), Real.log_pow, ← EReal.coe_coe_eq_natCast, + ← EReal.coe_div, mul_div_cancel_left₀ _ (by exact_mod_cast hn)] + +/-- The entropy of a base-$b$ expansion is at most $\log b$. -/ +theorem _root_.Real.baseEntropy_le {b : ℕ} (hb : 1 ≤ b) (ξ : ℝ) : + Real.baseEntropy b ξ ≤ (Real.log b : EReal) := by + refine limsup_le_of_le (by isBoundedDefault) (eventually_atTop.2 ⟨1, fun n hn => ?_⟩) + rw [← log_pow_div hb (n := n) (by omega)] + exact EReal.div_le_div_right_of_nonneg (by positivity) + (ENNReal.log_le_log (blockComplexity_digitSeq_le hb ξ n)) + +/-- A number that is rich in base $b$ has base-$b$ entropy $\log b$. -/ +theorem IsRichInBase.baseEntropy_eq {b : ℕ} (hb : 1 ≤ b) {ξ : ℝ} (h : IsRichInBase b ξ) : + Real.baseEntropy b ξ = (Real.log b : EReal) := by + refine Tendsto.limsup_eq (tendsto_atTop_of_eventually_const (i₀ := 1) fun n hn => ?_) + rw [(isRichInBase_iff_blockComplexity hb ξ).1 h n, log_pow_div hb (by omega)] + +/-- A number that is normal in base $b$ has base-$b$ entropy $\log b$. -/ +theorem IsNormalInBase.baseEntropy_eq {b : ℕ} (hb : 1 ≤ b) {ξ : ℝ} (h : IsNormalInBase b ξ) : + Real.baseEntropy b ξ = (Real.log b : EReal) := + h.isRichInBase.baseEntropy_eq hb + +/-- The base-$b$ expansion of a number that is rich in base $b \ge 2$ is not eventually +periodic. -/ +theorem IsRichInBase.not_isEventuallyPeriodic {b : ℕ} (hb : 2 ≤ b) {ξ : ℝ} + (h : IsRichInBase b ξ) : ¬ IsEventuallyPeriodic (digitSeq b ξ) := fun hp ↦ by + obtain ⟨C, -, hC⟩ := hp.blockComplexity_le + have := hC C + rw [(isRichInBase_iff_blockComplexity (by omega) ξ).1 h C] at this + exact this.not_gt (by exact_mod_cast Nat.lt_pow_self (by omega)) + +/-- The base-$b$ expansion of a number that is normal in base $b \ge 2$ is not eventually +periodic. -/ +theorem IsNormalInBase.not_isEventuallyPeriodic {b : ℕ} (hb : 2 ≤ b) {ξ : ℝ} + (h : IsNormalInBase b ξ) : ¬ IsEventuallyPeriodic (digitSeq b ξ) := + h.isRichInBase.not_isEventuallyPeriodic hb + +end NormalNumber diff --git a/FormalConjecturesForMathlib/NumberTheory/MultiplicativelyIndependent.lean b/FormalConjecturesForMathlib/NumberTheory/MultiplicativelyIndependent.lean new file mode 100644 index 0000000..46ad522 --- /dev/null +++ b/FormalConjecturesForMathlib/NumberTheory/MultiplicativelyIndependent.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. +-/ +module + +public import Mathlib.Analysis.SpecialFunctions.Log.Basic +public import Mathlib.LinearAlgebra.LinearIndependent.Lemmas +public import Mathlib.NumberTheory.Real.Irrational + +@[expose] public section + +/-! +# Multiplicatively independent integers + +Two integers $p, q \ge 2$ are *multiplicatively independent* if $\log p / \log q$ is +irrational, equivalently if $p^m = q^n$ holds only for $m = n = 0$. The condition separates +bases whose expansions carry unrelated information, as in Cobham's theorem and in +Furstenberg's $\times p$, $\times q$ problems. + +For a family of more than two integers the notion is the joint one: no nonzero integer tuple +`n` satisfies `∏ i, b i ^ n i = 1`. That is strictly stronger than pairwise independence, and +is what results such as Adamczewski–Faverjon's Mahler-method theorems assume. + +## Main definitions + +* `Nat.MultiplicativelyIndependent`: the relation for a pair of integers. +* `Nat.MultiplicativelyIndependentFamily`: the joint relation for a family of integers. +-/ + +namespace Nat + +/-- +Two integers $p, q \ge 2$ are *multiplicatively independent* if $\log p / \log q$ is +irrational, equivalently if $p^m = q^n$ holds only for $m = n = 0$. +-/ +def MultiplicativelyIndependent (p q : ℕ) : Prop := Irrational (Real.log p / Real.log q) + +/-- Multiplicative independence is symmetric. -/ +theorem MultiplicativelyIndependent.symm {p q : ℕ} (h : MultiplicativelyIndependent p q) : + MultiplicativelyIndependent q p := by + rw [MultiplicativelyIndependent, ← inv_div] + exact Irrational.inv h + +/-- +A family of integers is *multiplicatively independent* if there is no nonzero tuple of +integers $(n_i)$ with $\prod_i b_i^{n_i} = 1$; equivalently, the numbers $\log b_i$ are +linearly independent over $\mathbb{Q}$, which is the form used here. + +This is the joint notion, which is strictly stronger than pairwise multiplicative +independence of the `b i` (`Nat.MultiplicativelyIndependentFamily.pairwise`). For a family of +two it agrees with `Nat.MultiplicativelyIndependent`, by `Nat.MultiplicativelyIndependent.family`. +-/ +def MultiplicativelyIndependentFamily {ι : Type*} (b : ι → ℕ) : Prop := + LinearIndependent ℚ fun i => Real.log (b i) + +/-- A multiplicatively independent family is pairwise multiplicatively independent. -/ +theorem MultiplicativelyIndependentFamily.pairwise {ι : Type*} {b : ι → ℕ} + (h : MultiplicativelyIndependentFamily b) : + Pairwise fun i j => MultiplicativelyIndependent (b i) (b j) := by + intro i j hij ⟨q, hq⟩ + have hj := h.ne_zero j + refine (linearIndepOn_pair_iff _ hij.symm hj).1 (h.linearIndepOn _) q ?_ + rw [Rat.smul_def, hq, div_mul_cancel₀ _ hj] + +/-- A multiplicatively independent pair is a multiplicatively independent family. -/ +theorem MultiplicativelyIndependent.family {p q : ℕ} (h : MultiplicativelyIndependent p q) : + MultiplicativelyIndependentFamily ![p, q] := by + have hq : Real.log q ≠ 0 := by + rintro hq + rw [MultiplicativelyIndependent, hq, div_zero] at h + exact h ⟨0, by norm_num⟩ + rw [MultiplicativelyIndependentFamily, linearIndependent_fin2] + refine ⟨by simpa using hq, fun a ha => h ⟨a, ?_⟩⟩ + simp only [Matrix.cons_val_zero, Matrix.cons_val_one] at ha + rw [← ha, Rat.smul_def, mul_div_assoc, div_self hq, mul_one] + +end Nat diff --git a/FormalConjecturesForMathlib/NumberTheory/NormalNumber.lean b/FormalConjecturesForMathlib/NumberTheory/NormalNumber.lean index faaae83..03a1665 100644 --- a/FormalConjecturesForMathlib/NumberTheory/NormalNumber.lean +++ b/FormalConjecturesForMathlib/NumberTheory/NormalNumber.lean @@ -16,17 +16,19 @@ limitations under the License. module public import Mathlib.Algebra.Order.Archimedean.Real.Basic -public import Mathlib.Topology.MetricSpace.Pseudo.Defs +public import Mathlib.Topology.MetricSpace.Basic /-! # Normal numbers -A real number $x$ is *normal in base* $b$ if every digit +A real number $x$ is *simply normal in base* $b$ if every digit $d \in \{0,1,\dots,b-1\}$ appears with asymptotic frequency $1/b$ -in the base-$b$ expansion of $x$. +in the base-$b$ expansion of $x$. It is *normal in base* $b$ if, for every +$k \ge 1$, every string of $k$ digits appears with asymptotic frequency $1/b^k$. A number that is normal in every integer base $b \ge 2$ -is called *absolutely normal*. +is called *absolutely normal*. A number is *rich* (or *disjunctive*) in base $b$ if every +finite string of digits $< b$ occurs in its base-$b$ expansion. Despite extensive empirical evidence, it remains unknown whether classical constants such as $\pi$, $e$, or $\sqrt{2}$ are normal in any base. @@ -38,8 +40,10 @@ classical constants such as $\pi$, $e$, or $\sqrt{2}$ are normal in any base. ## Main definitions * `digitSeq`: the sequence of digits in the base-`b` fractional expansion of a real number. +* `IsSimplyNormalInBase`: a real number is simply normal in base `b`. * `IsNormalInBase`: a real number is normal in base `b`. * `IsAbsolutelyNormal`: a real number is normal in every base `b ≥ 2`. +* `IsRichInBase`: every finite string of base-`b` digits occurs in the expansion. -/ @[expose] public section @@ -57,10 +61,10 @@ where `{x}` denotes the fractional part of `x`. -/ noncomputable def digitSeq (b : ℕ) (x : ℝ) (n : ℕ) : ℕ := ⌊(b : ℝ) ^ (n + 1) * Int.fract x⌋₊ % b -/-- A real number `x` is *normal in base* `b` +/-- A real number `x` is *simply normal in base* `b` if every digit `d < b` appears with asymptotic frequency `1 / b` in the base-`b` fractional expansion of `x`. -/ -noncomputable def IsNormalInBase (b : ℕ) (x : ℝ) : Prop := +noncomputable def IsSimplyNormalInBase (b : ℕ) (x : ℝ) : Prop := ∀ d : ℕ, d < b → Tendsto (fun n : ℕ => @@ -68,9 +72,49 @@ noncomputable def IsNormalInBase (b : ℕ) (x : ℝ) : Prop := atTop (nhds (1 / (b : ℝ))) +/-- A real number `x` is *normal in base* `b` +if every string `w` of `k` digits `< b` appears with asymptotic frequency `1 / b ^ k` +in the base-`b` fractional expansion of `x`, that is, the proportion of positions `i < n` +at which `w` occurs tends to `1 / b ^ k`. -/ +noncomputable def IsNormalInBase (b : ℕ) (x : ℝ) : Prop := + ∀ (k : ℕ) (w : Fin k → ℕ), (∀ j, w j < b) → + Tendsto + (fun n : ℕ => + (((Finset.range n).filter (fun i => ∀ j : Fin k, digitSeq b x (i + j) = w j)).card : ℝ) / n) + atTop + (nhds (1 / (b : ℝ) ^ k)) + +/-- A number that is normal in base `b` is simply normal in base `b`. -/ +theorem IsNormalInBase.isSimplyNormalInBase {b : ℕ} {x : ℝ} (h : IsNormalInBase b x) : + IsSimplyNormalInBase b x := by + intro d hd + simpa [Fin.forall_fin_one] using h 1 (fun _ => d) (fun _ => hd) + /-- A real number `x` is *absolutely normal* if it is normal in every integer base `b ≥ 2`. -/ noncomputable def IsAbsolutelyNormal (x : ℝ) : Prop := ∀ b : ℕ, 2 ≤ b → IsNormalInBase b x +/-- A real number `x` is *rich* (or *disjunctive*) in base `b` +if every string `w` of `k` digits `< b` occurs at least once +in the base-`b` fractional expansion of `x`. -/ +def IsRichInBase (b : ℕ) (x : ℝ) : Prop := + ∀ (k : ℕ) (w : Fin k → ℕ), (∀ j, w j < b) → ∃ i, ∀ j : Fin k, digitSeq b x (i + j) = w j + +/-- A number that is normal in base `b` is rich in base `b`: every string has positive +asymptotic frequency, so it occurs. -/ +theorem IsNormalInBase.isRichInBase {b : ℕ} {x : ℝ} (h : IsNormalInBase b x) : + IsRichInBase b x := by + intro k w hw + by_contra hne + push Not at hne + have hb : 0 < b := (hne 0).elim fun j _ => Nat.zero_lt_of_lt (hw j) + have hfil (n : ℕ) : + ((Finset.range n).filter fun i => ∀ j : Fin k, digitSeq b x (i + j) = w j) = ∅ := + Finset.filter_eq_empty_iff.2 fun i _ hi => (hne i).elim fun j hj => hj (hi j) + have key := h k w hw + simp only [hfil, Finset.card_empty, Nat.cast_zero, zero_div] at key + exact one_div_ne_zero (pow_ne_zero _ (Nat.cast_ne_zero.2 hb.ne')) + (tendsto_nhds_unique key tendsto_const_nhds) + end NormalNumber diff --git a/FormalConjecturesForMathlib/NumberTheory/NumberField/Quadratic.lean b/FormalConjecturesForMathlib/NumberTheory/NumberField/Quadratic.lean index 71aed30..a17783a 100644 --- a/FormalConjecturesForMathlib/NumberTheory/NumberField/Quadratic.lean +++ b/FormalConjecturesForMathlib/NumberTheory/NumberField/Quadratic.lean @@ -16,6 +16,7 @@ limitations under the License. module public import Mathlib.NumberTheory.NumberField.Basic +public import Mathlib.Algebra.QuadraticAlgebra.IsQuadraticExtension public import FormalConjecturesForMathlib.Algebra.QuadraticAlgebra.Instances public section @@ -23,13 +24,6 @@ public section open Algebra (IsQuadraticExtension) open Module NumberField -/-- Any `QuadraticAlgebra ℚ a b` that is a field is automatically a quadratic extension -of `ℚ`, i.e., a degree-2 extension. Combined with `IsQuadraticField.instNumberField`, -this gives `NumberField (QuadraticAlgebra ℚ a b)` for free. -/ -instance QuadraticAlgebra.instIsQuadraticExtension (a b : ℚ) [Fact (∀ r : ℚ, r ^ 2 ≠ a + b * r)] : - IsQuadraticExtension ℚ (QuadraticAlgebra ℚ a b) where - finrank_eq_two' := QuadraticAlgebra.finrank_eq_two a b - /-- A quadratic field is a number field: it has characteristic zero and is finite-dimensional over `ℚ`. -/ instance Algebra.IsQuadraticExtension.to_numberField (K : Type*) [Field K] [CharZero K] diff --git a/FormalConjecturesForMathlib/NumberTheory/PerfectNumber.lean b/FormalConjecturesForMathlib/NumberTheory/PerfectNumber.lean new file mode 100644 index 0000000..7baa852 --- /dev/null +++ b/FormalConjecturesForMathlib/NumberTheory/PerfectNumber.lean @@ -0,0 +1,45 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.NumberTheory.ArithmeticFunction.Misc + +/-! +# Iterated perfect numbers + +A positive integer is $(m,k)$-perfect if the $m$-fold iterate of the sum-of-divisors +function equals $k$ times that integer. +-/ + +@[expose] public section + +open scoped ArithmeticFunction.sigma + +namespace Nat + +/-- +A positive integer $n$ is $(m,k)$-perfect if $\sigma^m(n) = kn$, where $\sigma^m$ is +the $m$-th iterate of the sum-of-divisors function $\sigma$. +-/ +def IsPerfectFor (n m k : ℕ) : Prop := + 0 < n ∧ Nat.iterate (fun x => σ 1 x) m n = k * n + +/-- Zero is excluded from the definition of an iterated perfect number. -/ +@[simp] +theorem not_isPerfectFor_zero (m k : ℕ) : ¬ IsPerfectFor 0 m k := by + simp [IsPerfectFor] + +end Nat diff --git a/FormalConjecturesForMathlib/NumberTheory/WallSunSunPrimes.lean b/FormalConjecturesForMathlib/NumberTheory/WallSunSunPrimes.lean index 3c9e0d0..87117a7 100644 --- a/FormalConjecturesForMathlib/NumberTheory/WallSunSunPrimes.lean +++ b/FormalConjecturesForMathlib/NumberTheory/WallSunSunPrimes.lean @@ -79,3 +79,36 @@ structure IsLucasWieferichPrime (a b : ℤ) (p : ℕ) : Prop where odd : Odd p not_dvd : ¬(p : ℤ) ∣ a ^ 2 - 4 * b modeq : LucasSequence.U a b (p - J(a^2 - 4*b | p)).toNat ≡ 0 [ZMOD (p^2)] + +/-- The parameter $P$ divides every even-indexed term of the Lucas sequence $U(P, Q)$. -/ +theorem LucasSequence.dvd_U_two_mul (P Q : ℤ) (k : ℕ) : P ∣ LucasSequence.U P Q (2 * k) := by + induction k with + | zero => simp [LucasSequence.U] + | succ k ih => + rw [Nat.mul_succ] + simp only [LucasSequence.U] + exact dvd_sub (dvd_mul_right P _) (dvd_mul_of_dvd_right ih Q) + +/-- If $p^2 \mid a$, then every odd prime $p$ not dividing $a^2 - 4b$ is a Lucas–Wieferich prime +associated with $(a, b)$: the index $p - \left(\tfrac{a^2-4b}{p}\right)$ is even, and $a$ divides +every even-indexed term of $U(a, b)$. -/ +theorem IsLucasWieferichPrime.of_sq_dvd {a b : ℤ} {p : ℕ} (hp : p.Prime) (hodd : Odd p) + (hpd : ¬(p : ℤ) ∣ a ^ 2 - 4 * b) (ha : (p : ℤ) ^ 2 ∣ a) : IsLucasWieferichPrime a b p := by + refine ⟨hp, hodd, hpd, ?_⟩ + rw [Int.modEq_zero_iff_dvd] + have hgcd : (a ^ 2 - 4 * b).gcd (p : ℤ) = 1 := by + have hpnat : ¬p ∣ (a ^ 2 - 4 * b).natAbs := fun h ↦ hpd (Int.natCast_dvd.mpr h) + rw [Int.gcd_eq_natAbs, Int.natAbs_natCast, Nat.gcd_comm] + exact hp.coprime_iff_not_dvd.mpr hpnat + obtain ⟨k, hk⟩ := hodd + rcases jacobiSym.eq_one_or_neg_one hgcd with hJ | hJ + · have hindex : ((p : ℤ) - J(a ^ 2 - 4 * b | p)).toNat = 2 * k := by + rw [hJ, hk] + omega + rw [hindex] + exact ha.trans (LucasSequence.dvd_U_two_mul a b k) + · have hindex : ((p : ℤ) - J(a ^ 2 - 4 * b | p)).toNat = 2 * (k + 1) := by + rw [hJ, hk] + omega + rw [hindex] + exact ha.trans (LucasSequence.dvd_U_two_mul a b (k + 1)) diff --git a/FormalConjecturesForMathlib/NumberTheory/WieferichPrime.lean b/FormalConjecturesForMathlib/NumberTheory/WieferichPrime.lean new file mode 100644 index 0000000..63580d9 --- /dev/null +++ b/FormalConjecturesForMathlib/NumberTheory/WieferichPrime.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. +-/ +module + +public import Mathlib.Data.Nat.ModEq +public import Mathlib.Data.Nat.Prime.Defs + +@[expose] public section + +/-! +# Wieferich primes + +A prime $p$ is a *Wieferich prime to base $a$* if $p^2$ divides $a^{p-1} - 1$, i.e. if the +congruence $a^{p-1} \equiv 1 \pmod{p}$ of Fermat's little theorem holds modulo $p^2$. +A *Wieferich prime* is a Wieferich prime to base $2$. The only known Wieferich primes are $1093$ +and $3511$. A *Mirimanoff prime* is a Wieferich prime to base $3$. The only known Mirimanoff primes +are $11$ and $1006003$. + +*References:* +- [Wikipedia, Wieferich prime](https://en.wikipedia.org/wiki/Wieferich_prime) +- [OEIS A001220](https://oeis.org/A001220) (Wieferich primes) +- [OEIS A014127](https://oeis.org/A014127) (Mirimanoff primes) +- D. Mirimanoff, *Sur le dernier théorème de Fermat*, C. R. Acad. Sci. Paris 150 (1910), 204–206. +-/ + +/-- +**Wieferich prime to base `a`** +A prime $p$ is a Wieferich prime to base $a$ if $p^2 \mid a^{p-1} - 1$, i.e. if +$a^{p-1} \equiv 1 \pmod{p^2}$. + +The subtraction is truncated, so, as with `Nat.ProbablePrime`, every prime is a Wieferich prime to +base $0$. For `a ≠ 0` the definition agrees with the congruence, see +`isWieferichPrimeBase_iff_pow_modEq`. +-/ +@[mk_iff] +structure IsWieferichPrimeBase (a p : ℕ) : Prop where + prime : p.Prime + sq_dvd_pow_sub_one : p ^ 2 ∣ a ^ (p - 1) - 1 + +instance (a p : ℕ) : Decidable (IsWieferichPrimeBase a p) := + decidable_of_iff _ (isWieferichPrimeBase_iff a p).symm + +namespace IsWieferichPrimeBase + +variable {a p : ℕ} + +theorem of_pow_modEq (hp : p.Prime) (h : a ^ (p - 1) ≡ 1 [MOD p ^ 2]) : + IsWieferichPrimeBase a p := + ⟨hp, h.symm.dvd'⟩ + +theorem pow_modEq (h : IsWieferichPrimeBase a p) (ha : a ≠ 0) : a ^ (p - 1) ≡ 1 [MOD p ^ 2] := + ((Nat.modEq_iff_dvd' (Nat.one_le_pow _ _ (Nat.pos_of_ne_zero ha))).2 h.sq_dvd_pow_sub_one).symm + +/-- Every prime `p` is a Wieferich prime to any base `a ≡ 1 [MOD p ^ 2]`. -/ +theorem of_modEq_one (hp : p.Prime) (h : a ≡ 1 [MOD p ^ 2]) : IsWieferichPrimeBase a p := + .of_pow_modEq hp (by simpa using h.pow (p - 1)) + +end IsWieferichPrimeBase + +/-- For a nonzero base `a`, being a Wieferich prime to base `a` is the congruence +`a ^ (p - 1) ≡ 1 [MOD p ^ 2]`. This fails for `a = 0`: see `isWieferichPrimeBase_zero_iff`. -/ +theorem isWieferichPrimeBase_iff_pow_modEq {a p : ℕ} (ha : a ≠ 0) : + IsWieferichPrimeBase a p ↔ p.Prime ∧ a ^ (p - 1) ≡ 1 [MOD p ^ 2] := + ⟨fun h => ⟨h.prime, h.pow_modEq ha⟩, fun h => .of_pow_modEq h.1 h.2⟩ + +/-- Every prime is a Wieferich prime to base `0`, because `0 ^ (p - 1) - 1 = 0` in `ℕ`. -/ +@[simp] +theorem isWieferichPrimeBase_zero_iff {p : ℕ} : IsWieferichPrimeBase 0 p ↔ p.Prime := + ⟨fun h => h.prime, fun hp => ⟨hp, by simp [zero_pow (Nat.sub_ne_zero_of_lt hp.one_lt)]⟩⟩ + +/-- Every prime is a Wieferich prime to base `1`. -/ +@[simp] +theorem isWieferichPrimeBase_one_iff {p : ℕ} : IsWieferichPrimeBase 1 p ↔ p.Prime := by + simp [isWieferichPrimeBase_iff] + +/-- +**Wieferich prime** +A Wieferich prime is a prime $p$ with $2^{p-1} \equiv 1 \pmod{p^2}$, i.e. a Wieferich prime to +base $2$. +-/ +abbrev IsWieferichPrime (p : ℕ) : Prop := IsWieferichPrimeBase 2 p + +/-- +**Mirimanoff prime** +A Mirimanoff prime is a prime $p$ with $3^{p-1} \equiv 1 \pmod{p^2}$, i.e. a Wieferich prime to +base $3$. The name comes from Mirimanoff's 1910 result that a failure of the first case of +Fermat's Last Theorem for the exponent $p$ forces this congruence. +-/ +abbrev IsMirimanoffPrime (p : ℕ) : Prop := IsWieferichPrimeBase 3 p diff --git a/FormalConjecturesForMathlib/Order/Unimodular.lean b/FormalConjecturesForMathlib/Order/Unimodular.lean index a6fff20..026744f 100644 --- a/FormalConjecturesForMathlib/Order/Unimodular.lean +++ b/FormalConjecturesForMathlib/Order/Unimodular.lean @@ -16,7 +16,7 @@ limitations under the License. module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Order.Interval.Set.Defs public import Mathlib.Order.Monotone.Basic diff --git a/FormalConjecturesForMathlib/Probability/FiniteMethod.lean b/FormalConjecturesForMathlib/Probability/FiniteMethod.lean index 78539d8..be81a28 100644 --- a/FormalConjecturesForMathlib/Probability/FiniteMethod.lean +++ b/FormalConjecturesForMathlib/Probability/FiniteMethod.lean @@ -17,7 +17,7 @@ module public import Mathlib.Algebra.BigOperators.Ring.Finset public import Mathlib.Algebra.Order.BigOperators.Group.Finset -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic @[expose] public section diff --git a/FormalConjecturesForMathlib/RepresentationTheory/CharacterDegree.lean b/FormalConjecturesForMathlib/RepresentationTheory/CharacterDegree.lean new file mode 100644 index 0000000..bc7970f --- /dev/null +++ b/FormalConjecturesForMathlib/RepresentationTheory/CharacterDegree.lean @@ -0,0 +1,38 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Basic.Complex.Basic +public import Mathlib.RepresentationTheory.FDRep + +@[expose] public section + +/-! +# The largest character degree + +`Group.maxCharacterDegree G` is the largest degree of an irreducible complex character of `G`: +the largest dimension of a simple finite-dimensional complex representation of `G`. +-/ + +namespace Group + +variable (G : Type*) [Group G] + +/-- The largest dimension of a simple finite-dimensional complex representation of `G`. -/ +noncomputable def maxCharacterDegree : ℕ := + sSup {d : ℕ | ∃ V : FDRep ℂ G, CategoryTheory.Simple V ∧ Module.finrank ℂ V = d} + +end Group diff --git a/FormalConjecturesForMathlib/RepresentationTheory/Homological/ContCohomology/Sha.lean b/FormalConjecturesForMathlib/RepresentationTheory/Homological/ContCohomology/Sha.lean new file mode 100644 index 0000000..f1b4982 --- /dev/null +++ b/FormalConjecturesForMathlib/RepresentationTheory/Homological/ContCohomology/Sha.lean @@ -0,0 +1,26 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +/- +The copied Mathlib source carries the following attribution: +Copyright (c) 2026 Edison Xie. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Edison Xie, David Kurniadi Angdinata +-/ +module + +public import Mathlib.RepresentationTheory.Homological.ContCohomology.Sha + +/-! The backported definitions are now provided by production Mathlib. -/ diff --git a/FormalConjecturesForMathlib/RingTheory/Bialgebra/Cohomology.lean b/FormalConjecturesForMathlib/RingTheory/Bialgebra/Cohomology.lean new file mode 100644 index 0000000..834ad02 --- /dev/null +++ b/FormalConjecturesForMathlib/RingTheory/Bialgebra/Cohomology.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. +-/ +module + +public import Mathlib.Algebra.Category.ModuleCat.Ext.HasExt +public import FormalConjecturesForMathlib.Algebra.Homology.DerivedCategory.Ext.GradedAlgebra +public import FormalConjecturesForMathlib.RingTheory.Bialgebra.TrivialModule + +@[expose] public noncomputable section + +/-! +# Cohomology of a bialgebra + +Let `A` be a bialgebra over a field `k`, and let `k` be the trivial `A`-module through the counit +(`Bialgebra.trivialModuleCat k A`). We define + +* `Bialgebra.cohomologyRing k A`: the cohomology ring `H^*(A, k) = ⨁ n, Ext^n_A(k, k)`, a graded + `k`-algebra under the Yoneda product; +* `Bialgebra.cohomology k A M`: the cohomology `H^*(A, M) = ⨁ n, Ext^n_A(k, M)` with coefficients + in an `A`-module `M`, a graded module over `H^*(A, k)`. + +Here `Ext` is taken in `ModuleCat A`, the category of all `A`-modules, and not in the category of +finite-dimensional ones. When `A` is finite-dimensional over a field the two give the same groups +on finite-dimensional modules: such a module admits a resolution by finitely generated free +`A`-modules, which are again finite-dimensional and are projective in both categories, and `Ext` +is computed from that single resolution either way. So `cohomologyRing k A` is the cohomology of +the finite tensor category of finite-dimensional `A`-modules, which is what the literature means +by `H^*(A, k)`. + +Two `k`-structures on `ModuleCat A` are involved, and only one of them is scoped. +`ModuleCat.linearOverField`, giving `Linear k (ModuleCat A)`, is a global instance, so the +`k`-algebra structure on `cohomologyRing k A` registered below needs no `open scoped`. The +`k`-module structure on an individual object, `ModuleCat.moduleOfAlgebraModule`, is a *scoped* +instance; in both, `k` acts through `algebraMap k A`. A file that mentions `FiniteDimensional k M` +for `M : ModuleCat A` therefore does have to `open scoped ModuleCat.Algebra`. +-/ + +open CategoryTheory Abelian +open scoped DirectSum ModuleCat.Algebra + +universe u + +namespace Bialgebra + +variable (k : Type u) [Field k] (A : Type u) [Ring A] [Bialgebra k A] + +/-- The cohomology ring `H^*(A, k) = ⨁ n, Ext^n_A(k, k)` of the bialgebra `A` over `k`, where `k` +is the trivial `A`-module through the counit and `Ext` is taken in `ModuleCat A`. It is a graded +`k`-algebra under the Yoneda product. -/ +abbrev cohomologyRing : Type u := + ⨁ n, Ext (trivialModuleCat k A) (trivialModuleCat k A) n + +/-- The cohomology `H^*(A, M) = ⨁ n, Ext^n_A(k, M)` of the bialgebra `A` over `k` with +coefficients in the `A`-module `M`. It is a graded module over `cohomologyRing k A` under the +Yoneda product. -/ +abbrev cohomology (M : ModuleCat.{u} A) : Type u := + ⨁ n, Ext (trivialModuleCat k A) M n + +instance : Algebra k (cohomologyRing k A) := + inferInstance + +instance (M : ModuleCat.{u} A) : Module (cohomologyRing k A) (cohomology k A M) := + inferInstance + +variable {k A} + +/-- The product on `cohomologyRing k A` is the Yoneda composition of extensions. -/ +lemma cohomologyRing_of_mul_of {a b : ℕ} + (x : Ext (trivialModuleCat k A) (trivialModuleCat k A) a) + (y : Ext (trivialModuleCat k A) (trivialModuleCat k A) b) : + (DirectSum.of _ a x : cohomologyRing k A) * DirectSum.of _ b y = + DirectSum.of _ (a + b) (x.comp y rfl) := + DirectSum.of_mul_of x y + +variable (k A) in +/-- A scalar `c : k` acts on `cohomologyRing k A` as `c` times the identity in degree `0`. -/ +lemma cohomologyRing_algebraMap_apply (c : k) : + algebraMap k (cohomologyRing k A) c = + DirectSum.of _ 0 (Ext.mk₀ (c • 𝟙 (trivialModuleCat k A))) := + rfl + +/-- The cohomology ring is not the zero ring: its degree-zero part contains the identity of the +trivial module. In particular a finiteness statement about `cohomologyRing k A` is not vacuous. -/ +lemma nontrivial_cohomologyRing : Nontrivial (cohomologyRing k A) := by + have hid : (𝟙 (trivialModuleCat k A)) ≠ 0 := by + intro h + have h1 : (1 : k) = 0 := congrArg (fun f => ModuleCat.Hom.hom f (1 : k)) h + exact one_ne_zero h1 + have hmk : (Ext.mk₀ (𝟙 (trivialModuleCat k A)) : Ext _ _ 0) ≠ 0 := fun h => + hid ((Ext.mk₀_bijective (trivialModuleCat k A) (trivialModuleCat k A)).injective + (by simpa using h)) + refine ⟨⟨1, 0, ?_⟩⟩ + intro h + apply hmk + rw [DirectSum.one_def] at h + rw [← Ext.gOne_eq] + exact DirectSum.of_injective + (β := fun n ↦ Ext (trivialModuleCat k A) (trivialModuleCat k A) n) 0 (by simpa using h) + +/-- The action of `cohomologyRing k A` on `cohomology k A M` is the Yoneda composition of +extensions. -/ +lemma cohomology_of_smul_of {M : ModuleCat.{u} A} {a b : ℕ} + (x : Ext (trivialModuleCat k A) (trivialModuleCat k A) a) + (y : Ext (trivialModuleCat k A) M b) : + (DirectSum.of _ a x : cohomologyRing k A) • (DirectSum.of _ b y : cohomology k A M) = + DirectSum.of _ (a + b) (x.comp y rfl) := + DirectSum.Gmodule.of_smul_of (A := fun n ↦ Ext (trivialModuleCat k A) (trivialModuleCat k A) n) + (M := fun n ↦ Ext (trivialModuleCat k A) M n) x y + +end Bialgebra diff --git a/FormalConjecturesForMathlib/RingTheory/Bialgebra/TrivialModule.lean b/FormalConjecturesForMathlib/RingTheory/Bialgebra/TrivialModule.lean new file mode 100644 index 0000000..fbf7edf --- /dev/null +++ b/FormalConjecturesForMathlib/RingTheory/Bialgebra/TrivialModule.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. +-/ +module + +public import Mathlib.Algebra.Category.ModuleCat.Algebra +public import Mathlib.Algebra.Category.ModuleCat.Basic +public import Mathlib.LinearAlgebra.FiniteDimensional.Defs +public import Mathlib.RingTheory.Bialgebra.Basic + +@[expose] public noncomputable section + +/-! +# The trivial module of a bialgebra + +If `A` is a bialgebra over a commutative ring `R`, the counit `A →ₐ[R] R` makes `R` into an +`A`-module, the trivial module. We package it as the object `Bialgebra.trivialModuleCat R A` of +`ModuleCat A`. + +Over a field `k`, restricting scalars along `algebraMap k A` recovers the `k`-module structure of +`k` itself (`Bialgebra.trivialModuleCat_smul_base`), so the trivial module is one-dimensional; +`Bialgebra.trivialModuleCatLinearEquiv` and the `FiniteDimensional` instance record this. That +`k`-module structure is `ModuleCat.moduleOfAlgebraModule`, a *scoped* instance, so a file stating +`FiniteDimensional k (trivialModuleCat k A)` must `open scoped ModuleCat.Algebra`. +-/ + +universe u v + +namespace Bialgebra + +variable (R : Type u) (A : Type v) [CommRing R] [Ring A] [Bialgebra R A] + +/-- The trivial module of the bialgebra `A` over `R`: the ring `R` on which `A` acts through the +counit `A →ₐ[R] R`, as an object of `ModuleCat A`. -/ +def trivialModuleCat : ModuleCat.{u} A := + letI := Module.compHom R (counitAlgHom R A).toRingHom + ModuleCat.of A R + +variable {R A} + +/-- The bialgebra `A` acts on its trivial module through the counit. The carrier of +`trivialModuleCat R A` is `R` by definition, so the product on the right is the product of `R`. -/ +lemma trivialModuleCat_smul (a : A) (r : trivialModuleCat R A) : + a • r = HMul.hMul (α := R) (β := R) (counitAlgHom R A a) r := + rfl + +section Field + +open scoped ModuleCat.Algebra + +variable {k : Type u} {B : Type v} [Field k] [Ring B] [Bialgebra k B] + +/-- The `k`-module structure on the trivial module of a bialgebra over a field `k`, obtained by +restricting scalars along `algebraMap k B`, is the module structure of `k` itself: the counit is a +`k`-algebra map, so it sends `algebraMap k B c` to `c`. -/ +lemma trivialModuleCat_smul_base (c : k) (r : trivialModuleCat k B) : + c • r = HMul.hMul (α := k) (β := k) c r := by + rw [show c • r = (algebraMap k B c) • r from rfl, trivialModuleCat_smul, + AlgHom.commutes] + rfl + +variable (k B) in +/-- The trivial module of a bialgebra over a field `k` is `k` itself as a `k`-module; in +particular it is one-dimensional. -/ +def trivialModuleCatLinearEquiv : trivialModuleCat k B ≃ₗ[k] k where + toFun r := r + map_add' _ _ := rfl + map_smul' := trivialModuleCat_smul_base + invFun r := r + left_inv _ := rfl + right_inv _ := rfl + +instance : FiniteDimensional k (trivialModuleCat k B) := + Module.Finite.equiv (trivialModuleCatLinearEquiv k B).symm + +end Field + +end Bialgebra diff --git a/FormalConjecturesForMathlib/RingTheory/CohenMacaulayModule.lean b/FormalConjecturesForMathlib/RingTheory/CohenMacaulayModule.lean new file mode 100644 index 0000000..21560a5 --- /dev/null +++ b/FormalConjecturesForMathlib/RingTheory/CohenMacaulayModule.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. +-/ +module + +public import FormalConjecturesForMathlib.RingTheory.SystemOfParameters + +/-! +# Small and big Cohen-Macaulay modules + +Let `R` be a local ring. A *small Cohen-Macaulay module*, also called a maximal Cohen-Macaulay +module, is a finitely generated nonzero `R`-module `M` such that some system of parameters of `R` +is a regular sequence on `M`. A *balanced big Cohen-Macaulay module* is an `R`-module `W`, not +necessarily finitely generated, with `m • W ≠ W` and such that every system of parameters of `R` +is a regular sequence on `W`. Over a Noetherian local ring the two notions agree for finitely +generated modules. + +Both definitions are only intended for Noetherian local rings, where systems of parameters exist. + +## Main declarations + +- `Module.IsSmallCohenMacaulay R M`: `M` is a small Cohen-Macaulay `R`-module. +- `Module.IsBalancedBigCohenMacaulay R W`: `W` is a balanced big Cohen-Macaulay `R`-module. +-/ + +@[expose] public section + +open IsLocalRing + +namespace Module + +variable (R : Type*) [CommRing R] [IsLocalRing R] +variable (M : Type*) [AddCommGroup M] [Module R M] + +/-- +A *small Cohen-Macaulay module* over a local ring `R` is a finitely generated `R`-module `M`, +necessarily nonzero, such that some system of parameters of `R` is a regular sequence on `M`. +Such a module is also called a maximal Cohen-Macaulay module. Nonzeroness is automatic, see +`Module.IsSmallCohenMacaulay.nontrivial`. +-/ +structure IsSmallCohenMacaulay : Prop where + /-- A small Cohen-Macaulay module is finitely generated. -/ + finite : Module.Finite R M + /-- Some system of parameters of `R` is a regular sequence on `M`. -/ + exists_isRegular : ∃ rs, IsSystemOfParameters R rs ∧ RingTheory.Sequence.IsRegular M rs + +/-- +A *balanced big Cohen-Macaulay module* over a local ring `R` is an `R`-module `M`, not necessarily +finitely generated, with `m • M ≠ M` and such that every system of parameters of `R` is a regular +sequence on `M`. + +Part of the literature calls this simply a big Cohen-Macaulay module, and reserves the weaker +condition that *some* system of parameters is a regular sequence for that name. Over a Noetherian +local ring the field `smul_top_ne_top` follows from `isRegular`, see +`Module.smul_top_ne_top_of_isRegular`. +-/ +structure IsBalancedBigCohenMacaulay : Prop where + /-- The maximal ideal does not act by the identity on the module. -/ + smul_top_ne_top : maximalIdeal R • (⊤ : Submodule R M) ≠ ⊤ + /-- Every system of parameters of `R` is a regular sequence on `M`. -/ + isRegular : ∀ rs, IsSystemOfParameters R rs → RingTheory.Sequence.IsRegular M rs + +variable {R M} + +/-- +A small Cohen-Macaulay module is nonzero: a regular sequence on `M` is one for which `M` is not +killed by the ideal it generates. +-/ +theorem IsSmallCohenMacaulay.nontrivial (h : IsSmallCohenMacaulay R M) : Nontrivial M := by + obtain ⟨rs, -, hrs⟩ := h.exists_isRegular + by_contra hM + rw [not_nontrivial_iff_subsingleton] at hM + exact hrs.top_ne_smul (@Subsingleton.elim _ ((Submodule.subsingleton_iff R).mpr hM) _ _) + +/-- +A balanced big Cohen-Macaulay module is nonzero: on the zero module the maximal ideal acts by the +identity. +-/ +theorem IsBalancedBigCohenMacaulay.nontrivial (h : IsBalancedBigCohenMacaulay R M) : + Nontrivial M := by + by_contra hM + rw [not_nontrivial_iff_subsingleton] at hM + exact h.smul_top_ne_top (@Subsingleton.elim _ ((Submodule.subsingleton_iff R).mpr hM) _ _) + +/-- +Over a Noetherian local ring, `m • M ≠ M` follows from the regularity of a single system of +parameters, because the ideal that a system of parameters generates contains a power of the +maximal ideal. +-/ +theorem smul_top_ne_top_of_isRegular [IsNoetherianRing R] {rs : List R} + (hrs : IsSystemOfParameters R rs) (h : RingTheory.Sequence.IsRegular M rs) : + maximalIdeal R • (⊤ : Submodule R M) ≠ ⊤ := by + intro hm + obtain ⟨n, hn⟩ := Ideal.exists_pow_le_of_le_radical_of_fg hrs.radical_eq.ge + (IsNoetherian.noetherian _) + have key : ∀ k : ℕ, (maximalIdeal R ^ k) • (⊤ : Submodule R M) = ⊤ := by + intro k + induction k with + | zero => simp + | succ k ih => rw [pow_succ, mul_smul, hm, ih] + exact h.top_ne_smul (le_antisymm ((key n).ge.trans (Submodule.smul_mono hn le_rfl)) le_top) + +/-- Over a field `K`, the module `K` is a small Cohen-Macaulay module. -/ +theorem isSmallCohenMacaulay_self (K : Type*) [Field K] : IsSmallCohenMacaulay K K where + finite := inferInstance + exists_isRegular := ⟨[], isSystemOfParameters_nil K, RingTheory.Sequence.IsRegular.nil K K⟩ + +end Module diff --git a/FormalConjecturesForMathlib/RingTheory/IntersectionMultiplicity.lean b/FormalConjecturesForMathlib/RingTheory/IntersectionMultiplicity.lean new file mode 100644 index 0000000..b142b48 --- /dev/null +++ b/FormalConjecturesForMathlib/RingTheory/IntersectionMultiplicity.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. +-/ +module + +public import Mathlib.Algebra.BigOperators.Finprod +public import Mathlib.Algebra.Category.ModuleCat.Abelian +public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed +public import Mathlib.Algebra.Category.ModuleCat.Projective +public import Mathlib.CategoryTheory.Monoidal.Tor +public import Mathlib.RingTheory.Length + +/-! +# Serre's intersection multiplicity + +For a commutative ring `R` and `R`-modules `M`, `N`, this file defines Serre's intersection +multiplicity +$$\chi(M, N) = \sum_{i \ge 0} (-1)^i \ell_R(\operatorname{Tor}_i^R(M, N)),$$ +using `CategoryTheory.Tor` on `ModuleCat R`. + +The definition is meaningful when `R` is a regular local ring, `M` and `N` are finitely generated +and `M ⊗[R] N` has finite length: then `Tor_i` vanishes for `i > dim R`, so the sum is finite, and +every `Tor_i` has finite length, so `ENat.toNat` truncates nothing. + +## Main declarations + +- `Module.intersectionMultiplicity R M N`: the alternating sum above. +- `Module.intersectionMultiplicity_of_projective`: if `N` is projective, `χ(M, N) = ℓ(M ⊗ N)`. +- `Module.intersectionMultiplicity_eq_zero_of_subsingleton`: if `M = 0`, then `χ(M, N) = 0`. +- `Module.intersectionMultiplicity_self_self`: over a field `k`, `χ(k, k) = 1`. +-/ + +@[expose] public section + +open CategoryTheory Limits MonoidalCategory TensorProduct + +universe u + +namespace Module + +variable (R : Type u) [CommRing R] + (M N : Type u) [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] + +/-- +The **intersection multiplicity** of two modules `M` and `N` over a commutative ring `R`, +$$\chi(M, N) = \sum_{i \ge 0} (-1)^i \ell_R(\operatorname{Tor}_i^R(M, N)).$$ +Here `Tor` is `CategoryTheory.Tor` on `ModuleCat R`, the sum is a `finsum` over `ℕ`, and the +length of each Tor module is converted to a natural number by `ENat.toNat`. +-/ +noncomputable def intersectionMultiplicity : ℤ := + ∑ᶠ i : ℕ, (-1 : ℤ) ^ i * + (Module.length R (((Tor (ModuleCat.{u} R) i).obj (ModuleCat.of R M)).obj + (ModuleCat.of R N))).toNat + +variable {R M N} + +/-- If `N` is projective, only `Tor₀(M, N) = M ⊗ N` contributes to `χ(M, N)`. -/ +theorem intersectionMultiplicity_of_projective [Module.Projective R N] : + intersectionMultiplicity R M N = (Module.length R (M ⊗[R] N)).toNat := by + unfold intersectionMultiplicity + rw [finsum_eq_single _ 0] + · have e : ((Tor (ModuleCat.{u} R) 0).obj (ModuleCat.of R M)).obj (ModuleCat.of R N) ≅ + ModuleCat.of R M ⊗ ModuleCat.of R N := + ((tensoringLeft (ModuleCat.{u} R)).obj (ModuleCat.of R M)).leftDerivedZeroIsoSelf.app _ + rw [pow_zero, one_mul, e.toLinearEquiv.length_eq] + rfl + · intro i hi + obtain ⟨n, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hi + have : Subsingleton (((Tor (ModuleCat.{u} R) (n + 1)).obj (ModuleCat.of R M)).obj + (ModuleCat.of R N)) := + ModuleCat.isZero_iff_subsingleton.mp + (isZero_Tor_succ_of_projective (ModuleCat.{u} R) (ModuleCat.of R M) (ModuleCat.of R N) n) + simp + +/-- If `M` is the zero module, then `χ(M, N) = 0`: the functor `M ⊗ -` is zero, so all its left +derived functors vanish. -/ +theorem intersectionMultiplicity_eq_zero_of_subsingleton [Subsingleton M] : + intersectionMultiplicity R M N = 0 := by + have hM := ModuleCat.isZero_of_subsingleton (ModuleCat.of R M) + have hTor (i : ℕ) : IsZero (((Tor (ModuleCat.{u} R) i).obj (ModuleCat.of R M)).obj + (ModuleCat.of R N)) := by + refine IsZero.of_iso ?_ ((projectiveResolution (ModuleCat.of R N)).isoLeftDerivedObj _ i) + exact ShortComplex.isZero_homology_of_isZero_X₂ _ + (((tensoringRight (ModuleCat.{u} R)).obj _).map_isZero hM) + unfold intersectionMultiplicity + refine finsum_eq_zero_of_forall_eq_zero fun i => ?_ + have := ModuleCat.isZero_iff_subsingleton.mp (hTor i) + simp + +/-- Normalisation: over a field `k`, `χ(k, k) = 1`. -/ +theorem intersectionMultiplicity_self_self (k : Type u) [Field k] : + intersectionMultiplicity k k k = 1 := by + rw [intersectionMultiplicity_of_projective, (TensorProduct.lid k k).length_eq, + Module.length_eq_one] + rfl + +end Module diff --git a/FormalConjecturesForMathlib/RingTheory/SystemOfParameters.lean b/FormalConjecturesForMathlib/RingTheory/SystemOfParameters.lean new file mode 100644 index 0000000..a367554 --- /dev/null +++ b/FormalConjecturesForMathlib/RingTheory/SystemOfParameters.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. +-/ +module + +public import Mathlib.RingTheory.KrullDimension.Zero +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.Regular.RegularSequence + +/-! +# Systems of parameters + +For a local ring `R` of Krull dimension `d`, a *system of parameters* is a list of `d` elements +of `R` generating an ideal whose radical is the maximal ideal. Over a Noetherian local ring this +is the usual notion: a list of `d` elements of the maximal ideal with `R ⧸ Ideal.ofList rs` +Artinian. Krull's height theorem gives a system of parameters over every Noetherian local ring, +and that is the only case in which this definition is intended to be used. + +## Main declarations + +- `IsLocalRing.IsSystemOfParameters R rs`: the list `rs` is a system of parameters of `R`. +-/ + +@[expose] public section + +namespace IsLocalRing + +variable (R : Type*) [CommRing R] [IsLocalRing R] + +/-- +A *system of parameters* of a local ring `R` is a list of `ringKrullDim R` elements of `R` +generating an ideal whose radical is the maximal ideal. +-/ +structure IsSystemOfParameters (rs : List R) : Prop where + /-- A system of parameters has `ringKrullDim R` elements. -/ + length_eq : (rs.length : WithBot ℕ∞) = ringKrullDim R + /-- A system of parameters generates an ideal with radical the maximal ideal. -/ + radical_eq : (Ideal.ofList rs).radical = maximalIdeal R + +variable {R} + +/-- The elements of a system of parameters lie in the maximal ideal. -/ +theorem IsSystemOfParameters.mem_maximalIdeal {rs : List R} (h : IsSystemOfParameters R rs) + {r : R} (hr : r ∈ rs) : r ∈ maximalIdeal R := + h.radical_eq ▸ Ideal.le_radical (Ideal.subset_span hr) + +variable (R) + +/-- Over a local ring of Krull dimension zero, the empty list is a system of parameters. -/ +theorem isSystemOfParameters_nil [Ring.KrullDimLE 0 R] : + IsSystemOfParameters R ([] : List R) where + length_eq := by + simpa using ((ringKrullDimZero_iff_ringKrullDim_eq_zero (R := R)).mp ‹_›).symm + radical_eq := by + rw [Ideal.ofList_nil] + exact Ring.KrullDimLE.nilradical_eq_maximalIdeal R + +end IsLocalRing diff --git a/FormalConjecturesForMathlib/RingTheory/Valuation/LocalUniformization.lean b/FormalConjecturesForMathlib/RingTheory/Valuation/LocalUniformization.lean new file mode 100644 index 0000000..1748380 --- /dev/null +++ b/FormalConjecturesForMathlib/RingTheory/Valuation/LocalUniformization.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. +-/ +module + +public import Mathlib.RingTheory.RegularLocalRing.Defs +public import Mathlib.RingTheory.Valuation.ValuationSubring + +/-! +# Centres of valuation subrings and local uniformization + +Let `F` be a field over a field `k` and let `𝒪` be a valuation subring of `F`. For a +`k`-subalgebra `A` of `F` contained in `𝒪`, the *centre* of `𝒪` on `A` is the prime ideal +`𝔪_𝒪 ∩ A` of `A`: the point of the affine model `Spec A` whose local ring `𝒪` dominates. + +`𝒪` *admits local uniformization over* `k` if some finitely generated `k`-subalgebra `A ⊆ 𝒪` with +fraction field `F` is regular at the centre of `𝒪`. Following Knaf and Kuhlmann, the condition is +that the centre is a regular point, not a smooth one, which is the right notion over an imperfect +ground field. + +## Main definitions + +* `ValuationSubring.centerOn`: the centre of a valuation subring on a subalgebra it contains. +* `ValuationSubring.HasLocalUniformization`: some affine model is regular at the centre. + +## References + +- H. Knaf and F.-V. Kuhlmann, [Every place admits local uniformization in a finite extension of + the function field](https://doi.org/10.1016/j.aim.2008.12.009), Adv. Math. 221 (2009), 428--453. +-/ + +@[expose] public section + +open IsLocalRing + +namespace ValuationSubring + +variable {F : Type*} [Field F] {k : Type*} [Field k] [Algebra k F] + +/-- +The *centre* of a valuation subring `𝒪` of `F` on a `k`-subalgebra `A` of `F` contained in `𝒪`: +the prime ideal `𝔪_𝒪 ∩ A` of `A`. +-/ +def centerOn (𝒪 : ValuationSubring F) (A : Subalgebra k F) (hA : ∀ a : A, (a : F) ∈ 𝒪) : + Ideal A := + (maximalIdeal 𝒪).comap (A.val.toRingHom.codRestrict 𝒪 hA) + +/-- The centre of `𝒪` on `A` is a prime ideal of `A`. -/ +instance (𝒪 : ValuationSubring F) (A : Subalgebra k F) (hA : ∀ a : A, (a : F) ∈ 𝒪) : + (𝒪.centerOn A hA).IsPrime := + Ideal.IsPrime.comap _ + +/-- The centre of `𝒪` on `A` consists of the elements of `A` of valuation less than one. -/ +theorem mem_centerOn_iff (𝒪 : ValuationSubring F) (A : Subalgebra k F) + (hA : ∀ a : A, (a : F) ∈ 𝒪) (a : A) : + a ∈ 𝒪.centerOn A hA ↔ 𝒪.valuation (a : F) < 1 := by + rw [centerOn, Ideal.mem_comap, valuation_lt_one_iff] + rfl + +/-- +A valuation subring `𝒪` of `F` *admits local uniformization over* `k` if some affine model of +`F` over `k` inside `𝒪` is regular at the centre of `𝒪`: there is a finitely generated +`k`-subalgebra `A` of `F` with `A ⊆ 𝒪` and fraction field `F` whose localisation at the centre +of `𝒪` is a regular local ring. +-/ +def HasLocalUniformization (𝒪 : ValuationSubring F) (k : Type*) [Field k] [Algebra k F] : Prop := + ∃ (A : Subalgebra k F) (hA : ∀ a : A, (a : F) ∈ 𝒪), + Algebra.FiniteType k A ∧ IsFractionRing A F ∧ + IsRegularLocalRing (Localization.AtPrime (𝒪.centerOn A hA)) + +/-- A regular affine model of `F` over `k` inside `𝒪` uniformizes `𝒪`. -/ +theorem hasLocalUniformization_of_isRegularRing (𝒪 : ValuationSubring F) (A : Subalgebra k F) + (hA : ∀ a : A, (a : F) ∈ 𝒪) [Algebra.FiniteType k A] [IsFractionRing A F] + [IsRegularRing A] : 𝒪.HasLocalUniformization k := + ⟨A, hA, ‹_›, ‹_›, IsRegularRing.isRegularLocalRing_localization _⟩ + +end ValuationSubring diff --git a/FormalConjecturesForMathlib/SetTheory/Cardinal/Arithmetic.lean b/FormalConjecturesForMathlib/SetTheory/Cardinal/Arithmetic.lean index c04cc77..c87a40a 100644 --- a/FormalConjecturesForMathlib/SetTheory/Cardinal/Arithmetic.lean +++ b/FormalConjecturesForMathlib/SetTheory/Cardinal/Arithmetic.lean @@ -16,31 +16,3 @@ limitations under the License. module public import Mathlib.SetTheory.Cardinal.Arithmetic - -@[expose] public section - -namespace Cardinal -variable {α : Type*} {s t : Set α} - -@[simp] lemma aleph0_le_mk_set : ℵ₀ ≤ #s ↔ s.Infinite := by - rw [aleph0_le_mk_iff, Set.infinite_coe_iff] - -@[simp] -lemma mk_sdiff_eq_left' (hs : s.Infinite) (hst : #↑(s ∩ t) < #s) : #↑(s \ t) = #s := by - refine (mk_le_mk_of_subset Set.sdiff_subset).eq_of_not_lt - fun h ↦ (add_lt_of_lt (by simpa) hst h).not_ge ?_ - grw [← mk_union_le .., Set.inter_union_sdiff] - -@[simp] -lemma mk_sdiff_eq_left (hs : s.Infinite) (hts : #t < #s) : #↑(s \ t) = #s := - mk_sdiff_eq_left' hs <| hts.trans_le' <| mk_subtype_mono Set.inter_subset_right - -@[simp] -lemma mk_sdiff_eq_left_of_finite' (hs : s.Infinite) (hst : (s ∩ t).Finite) : #↑(s \ t) = #s := - mk_sdiff_eq_left' hs <| (aleph0_le_mk_set.2 hs).trans_lt' <| by simpa - -@[simp] -lemma mk_sdiff_eq_left_of_finite (hs : s.Infinite) (ht : t.Finite) : #↑(s \ t) = #s := - mk_sdiff_eq_left hs <| (aleph0_le_mk_set.2 hs).trans_lt' <| by simpa - -end Cardinal diff --git a/FormalConjecturesForMathlib/SetTheory/Cardinal/ContinuumHypothesis.lean b/FormalConjecturesForMathlib/SetTheory/Cardinal/ContinuumHypothesis.lean new file mode 100644 index 0000000..2dc4ec4 --- /dev/null +++ b/FormalConjecturesForMathlib/SetTheory/Cardinal/ContinuumHypothesis.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. +-/ +module + +public import Mathlib.SetTheory.Cardinal.Aleph +public import Mathlib.SetTheory.Cardinal.Continuum + +@[expose] public section + +/-! +# Continuum Hypothesis and Generalized Continuum Hypothesis + +This file defines the `Cardinal.CH` (Continuum Hypothesis) and +`Cardinal.GCH` (Generalized Continuum Hypothesis) predicates, together with +basic API: the unfolding lemma `Cardinal.CH_iff`, the accessor +`Cardinal.GCH.aleph_succ`, the elementary implication `Cardinal.GCH.toCH`, +and the beth-aleph characterisation `Cardinal.GCH_iff_beth_eq_aleph`. + +Mathlib has no built-in CH/GCH axiom; these are recorded here as `Prop`s to be +passed as hypotheses where needed in set-theoretic problems. + +The formulation follows Jech/Kunen: `GCH` asserts that for every ordinal `o`, +`2 ^ ℵ_ o = ℵ_ (Order.succ o)`; equivalently, `ℶ_ o = ℵ_ o` for every `o` +(`Cardinal.GCH_iff_beth_eq_aleph`). +-/ + +namespace Cardinal + +/-- The **Continuum Hypothesis**: $\mathfrak{c} = \aleph_1$. -/ +def CH : Prop := (𝔠 : Cardinal.{0}) = ℵ_ 1 + +/-- The Continuum Hypothesis, unfolded to the power form $2^{\aleph_0} = \aleph_1$. -/ +theorem CH_iff : CH ↔ (2 : Cardinal.{0}) ^ ℵ₀ = ℵ_ 1 := by + rw [two_power_aleph0] + exact Iff.rfl + +/-- The **Generalized Continuum Hypothesis**: for every ordinal `o`, +$2^{\aleph_o} = \aleph_{o+1}$. -/ +def GCH : Prop := ∀ o : Ordinal.{0}, (2 : Cardinal.{0}) ^ ℵ_ o = ℵ_ (Order.succ o) + +/-- Accessor for `GCH` at a single ordinal, in the $\aleph_{o+1} = 2^{\aleph_o}$ +orientation. -/ +theorem GCH.aleph_succ (h : GCH) (o : Ordinal.{0}) : + ℵ_ (Order.succ o) = (2 : Cardinal.{0}) ^ ℵ_ o := + (h o).symm + +/-- GCH implies CH: apply GCH at `o = 0` and use `ℵ_ (Order.succ 0) = ℵ_ 1`. -/ +theorem GCH.toCH (h : GCH) : CH := by + unfold GCH at h + unfold CH + have h0 := h 0 + simpa [Cardinal.aleph_zero, zero_add, two_power_aleph0] using h0 + +/-- The **beth-aleph characterisation of GCH**: `GCH` holds if and only if +$\beth_o = \aleph_o$ for every ordinal `o`. The forward direction is a transfinite +induction using `Cardinal.beth_succ` at successors and cofinality of the suprema at +limits; the backward direction rewrites $2^{\aleph_o} = 2^{\beth_o} = \beth_{o+1} = +\aleph_{o+1}$. -/ +theorem GCH_iff_beth_eq_aleph : GCH ↔ ∀ o : Ordinal.{0}, ℶ_ o = ℵ_ o := by + constructor + · intro h o + induction o using Ordinal.limitRecOn with + | zero => rw [beth_zero, aleph_zero] + | add_one o ih => rw [beth_add_one, ih, h o, Order.succ_eq_add_one] + | limit o ho ih => + rw [beth_limit ho, aleph_limit ho] + exact iSup_congr fun i => ih i i.2 + · intro h o + rw [← h o, ← beth_succ, h (Order.succ o)] + +end Cardinal diff --git a/FormalConjecturesForMathlib/SetTheory/Ordinal/PartitionRelation.lean b/FormalConjecturesForMathlib/SetTheory/Ordinal/PartitionRelation.lean new file mode 100644 index 0000000..a2b5225 --- /dev/null +++ b/FormalConjecturesForMathlib/SetTheory/Ordinal/PartitionRelation.lean @@ -0,0 +1,161 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.Combinatorics.SimpleGraph.Clique +public import Mathlib.Data.Sym.Sym2 +public import Mathlib.SetTheory.Cardinal.Aleph +public import Mathlib.SetTheory.Ordinal.Exponential +public import FormalConjecturesForMathlib.SetTheory.Cardinal.SimpleGraph + +@[expose] public section + +open Cardinal Ordinal + +/-! +# Ordinal and cardinal partition relations (binary) + +This file consolidates the binary ordinal/cardinal partition relations used in several +Erdős set-theory problems: + +* `OrdinalRamsey α β γ` — `α → (β, γ)²`: 2-coloring of pairs of `α`, finding + monochromatic subsets of ordinal types `β` (red) or `γ` (blue). +* `OrdinalMultiColorRamsey α β γ k` — `α → (β, γ, …, γ)²_{k+1}`: multicolor partition + with `k` "small" colors targeting cardinality `γ` and one "large" color targeting + ordinal type `β`. +* `CardinalCountableColorRamsey κ` — `κ → (κ, 3, 3, …)²_{ℵ₀}`: countably-colored + partition relation with a large color-0 class and triangle targets in every other + color. + +These complement `OrdinalCardinalRamsey` (see +`FormalConjecturesForMathlib.SetTheory.Cardinal.SimpleGraph`) which uses a cardinality +target on the blue side instead of an ordinal-type target; the bridge lemma +`ordinalMultiColorRamsey_one_iff_ordinalCardinalRamsey` identifies the `k = 1` case of +the `Sym2`-coloring style with that `SimpleGraph`-pair style. +-/ + +universe u + +/-- +`OrdinalRamsey α β γ` asserts the ordinal Ramsey property `α → (β, γ)²`. + +It states that for any 2-coloring of the complete graph on the ordinal `α`, +one of the following must hold: +* There is a red clique which is order-isomorphic to `β` (a red `K_β`). +* There is a blue clique which is order-isomorphic to `γ` (a blue `K_γ`). +-/ +def OrdinalRamsey (α β γ : Ordinal.{u}) : Prop := + ∀ red blue : SimpleGraph α.ToType, IsCompl red blue → + (∃ s, red.IsClique s ∧ typeLT s = β) ∨ + (∃ s, blue.IsClique s ∧ typeLT s = γ) + +/-- +`OrdinalMultiColorRamsey α β γ k` asserts the multicolor partition relation +`α → (β, γ, γ, …, γ)²_{k+1}` (with `k` copies of `γ`). + +For any function `col : Sym2 α.ToType → Fin (k + 1)` assigning one of `k+1` colors +to each pair from `α`, one of the following holds: +* **Color 0**: there is a set `A ⊆ α.ToType` of order type `β` that is monochromatic + in color 0. +* **Color `i+1`** (for some `i : Fin k`): there is a set `A ⊆ α.ToType` with `#A = γ` + that is monochromatic in color `i.succ`. + +When `k = 1` this reduces to the binary partition relation `α → (β, γ)²` on the +cardinality side (see `ordinalMultiColorRamsey_one_iff_ordinalCardinalRamsey`). +-/ +def OrdinalMultiColorRamsey (α β : Ordinal.{u}) (γ : Cardinal.{u}) (k : ℕ) : Prop := + ∀ col : Sym2 α.ToType → Fin (k + 1), + (∃ A : Set α.ToType, + (∀ x ∈ A, ∀ y ∈ A, x ≠ y → col s(x, y) = 0) ∧ + typeLT A = β) ∨ + (∃ (i : Fin k) (A : Set α.ToType), + (∀ x ∈ A, ∀ y ∈ A, x ≠ y → col s(x, y) = i.succ) ∧ + #A = γ) + +/-- +`CardinalCountableColorRamsey κ` asserts the partition relation +`κ → (κ, 3, 3, …)²_{ℵ₀}` with countably many colors (indexed by `ℕ`). + +For any coloring `col : Sym2 κ.ord.ToType → ℕ` of pairs from the initial ordinal of `κ`, +one of the following holds: +* **Color 0** (*large monochromatic set*): there is a set `A ⊆ κ.ord.ToType` with + `#A = κ` such that every pair in `A` gets color 0. +* **Some positive color** (*triangle*): there are `n : ℕ` and three distinct elements + `x y z : κ.ord.ToType` such that all three pairs are colored `n + 1`. + +This is the countably-colored analogue of `OrdinalMultiColorRamsey`, replacing +`Fin (k+1)` with `ℕ` (so `ℵ_0`-many colors) and requiring monochromatic *triangles* +(rather than arbitrary monochromatic cliques) in the positive colors. +-/ +def CardinalCountableColorRamsey (κ : Cardinal.{u}) : Prop := + ∀ col : Sym2 κ.ord.ToType → ℕ, + (∃ A : Set κ.ord.ToType, + (∀ x ∈ A, ∀ y ∈ A, x ≠ y → col s(x, y) = 0) ∧ + #A = κ) ∨ + (∃ (n : ℕ) (x y z : κ.ord.ToType), + x ≠ y ∧ x ≠ z ∧ y ≠ z ∧ + col s(x, y) = n + 1 ∧ + col s(x, z) = n + 1 ∧ + col s(y, z) = n + 1) + +/-- +**Bridge between the two coloring styles.** For `k = 1`, the `Sym2`-coloring relation +`OrdinalMultiColorRamsey α β γ 1` coincides with the `SimpleGraph`-style relation +`OrdinalCardinalRamsey α β γ` (a complementary pair of graphs, with an order-type +target `β` on the red side and a cardinality target `γ` on the blue side). +-/ +theorem ordinalMultiColorRamsey_one_iff_ordinalCardinalRamsey + (α β : Ordinal.{u}) (γ : Cardinal.{u}) : + OrdinalMultiColorRamsey α β γ 1 ↔ OrdinalCardinalRamsey α β γ := by + classical + constructor + · intro h red blue hcompl + -- Color a pair with `0` when it is a red edge, `1` otherwise. + obtain ⟨A, hmono, htype⟩ | ⟨i, A, hmono, hcard⟩ := + h (Sym2.lift ⟨fun x y => if red.Adj x y then 0 else 1, fun x y => by + simp [SimpleGraph.adj_comm]⟩) + · refine Or.inl ⟨A, fun x hx y hy hne => ?_, htype⟩ + have hcol := hmono x hx y hy hne + simp only [Sym2.lift_mk] at hcol + by_contra hadj + rw [ite_eq_right hadj] at hcol + exact absurd hcol (by decide) + · obtain rfl : i = 0 := Subsingleton.elim i 0 + refine Or.inr ⟨A, fun x hx y hy hne => ?_, hcard⟩ + have hcol := hmono x hx y hy hne + simp only [Sym2.lift_mk] at hcol + have hnred : ¬ red.Adj x y := by + intro hadj + rw [ite_eq_left hadj] at hcol + exact absurd hcol (by decide) + have hsup : (red ⊔ blue).Adj x y := by + rw [hcompl.sup_eq_top] + simpa using hne + exact ((SimpleGraph.sup_adj red blue x y).mp hsup).resolve_left hnred + · intro h col + -- Turn the coloring into the graph of `0`-colored pairs and its complement. + let red : SimpleGraph α.ToType := + { Adj := fun x y => x ≠ y ∧ col s(x, y) = 0 + symm := ⟨fun _ _ hxy => ⟨hxy.1.symm, by rw [Sym2.eq_swap]; exact hxy.2⟩⟩ + loopless := ⟨fun _ hx => hx.1 rfl⟩ } + obtain ⟨A, hclique, htype⟩ | ⟨A, hclique, hcard⟩ := h red redᶜ isCompl_compl + · exact Or.inl ⟨A, fun x hx y hy hne => (hclique hx hy hne).2, htype⟩ + · refine Or.inr ⟨0, A, fun x hx y hy hne => ?_, hcard⟩ + have hadj := hclique hx hy hne + rw [SimpleGraph.compl_adj] at hadj + have hne0 : col s(x, y) ≠ 0 := fun h0 => hadj.2 ⟨hne, h0⟩ + have key : ∀ c : Fin 2, c ≠ 0 → c = 1 := by decide + rw [key _ hne0, Fin.succ_zero_eq_one] diff --git a/FormalConjecturesForMathlib/Tactic/Linter/Term.lean b/FormalConjecturesForMathlib/Tactic/Linter/Term.lean index ffce3f5..38a3568 100644 --- a/FormalConjecturesForMathlib/Tactic/Linter/Term.lean +++ b/FormalConjecturesForMathlib/Tactic/Linter/Term.lean @@ -20,7 +20,7 @@ public import FormalConjecturesForMathlib.Lean.Elab.InfoTree.Util public import Lean.Elab.Command public import Lean.Linter.Basic public import Lean.Meta.Basic -public import Lean.Server.InfoUtils +public import Lean.Elab.InfoTree.Util open Lean Meta Elab Command diff --git a/FormalConjecturesForMathlib/Topology/CardinalInvariants.lean b/FormalConjecturesForMathlib/Topology/CardinalInvariants.lean new file mode 100644 index 0000000..ac8850e --- /dev/null +++ b/FormalConjecturesForMathlib/Topology/CardinalInvariants.lean @@ -0,0 +1,156 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +module + +public import Mathlib.SetTheory.Cardinal.Basic +public import Mathlib.Topology.Bases + +/-! +# Cardinal invariants of topological spaces + +This file defines networks of a topological space and two cardinal invariants: +the *density* `d(X)` and the *network weight* `nw(X)`. As usual, both are made infinite by adding +`ℵ₀`, following the convention for cardinal invariants in Felix Pernegger's +[pibase-lean](https://github.com/felixpernegger/pibase-lean) +(`PiBaseLean/AdditionalDefs/Cardinal.lean`). +-/ + +@[expose] public section + +universe u + +open Cardinal Set Topology + +namespace TopologicalSpace + +variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] + +/-- A family `N` of subsets of a topological space `X` is a *network* for `X` if every open +subset of `X` is a union of members of `N`. Unlike the members of a topological basis, the members +of a network need not be open. -/ +def IsNetwork (N : Set (Set X)) : Prop := + ∀ ⦃U : Set X⦄, IsOpen U → ∀ x ∈ U, ∃ n ∈ N, x ∈ n ∧ n ⊆ U + +theorem IsTopologicalBasis.isNetwork {B : Set (Set X)} (hB : IsTopologicalBasis B) : + IsNetwork B := + fun _ hU _ hx => hB.exists_subset_of_mem_open hx hU + +theorem isNetwork_setOf_isOpen : IsNetwork {U : Set X | IsOpen U} := + isTopologicalBasis_opens.isNetwork + +/-- The preimage of a network under an inducing map is a network. -/ +theorem IsNetwork.preimage {N : Set (Set Y)} (hN : IsNetwork N) {f : X → Y} + (hf : IsInducing f) : IsNetwork ((f ⁻¹' ·) '' N) := by + intro U hU x hx + obtain ⟨V, hV, rfl⟩ := hf.isOpen_iff.mp hU + obtain ⟨n, hn, hfx, hnV⟩ := hN hV (f x) hx + exact ⟨f ⁻¹' n, mem_image_of_mem _ hn, hfx, preimage_mono hnV⟩ + +variable (X) + +/-- The *density* `d(X)` of a topological space `X`: the least cardinality of a dense subset, +plus `ℵ₀`. -/ +noncomputable def density : Cardinal := + (⨅ s : {s : Set X // Dense s}, #s.1) + ℵ₀ + +/-- The *network weight* `nw(X)` of a topological space `X`: the least cardinality of a network, +plus `ℵ₀`. -/ +noncomputable def networkWeight : Cardinal := + (⨅ N : {N : Set (Set X) // IsNetwork N}, #N.1) + ℵ₀ + +variable {X} + +instance : Nonempty {s : Set X // Dense s} := ⟨⟨univ, dense_univ⟩⟩ + +instance : Nonempty {N : Set (Set X) // IsNetwork N} := ⟨⟨_, isNetwork_setOf_isOpen⟩⟩ + +theorem aleph0_le_density : ℵ₀ ≤ density X := le_add_self + +theorem aleph0_le_networkWeight : ℵ₀ ≤ networkWeight X := le_add_self + +theorem _root_.Dense.density_le {s : Set X} (hs : Dense s) : density X ≤ #s + ℵ₀ := + add_le_add_left (ciInf_le' (fun s : {s : Set X // Dense s} => #s.1) ⟨s, hs⟩) _ + +theorem IsNetwork.networkWeight_le {N : Set (Set X)} (hN : IsNetwork N) : + networkWeight X ≤ #N + ℵ₀ := + add_le_add_left (ciInf_le' (fun N : {N : Set (Set X) // IsNetwork N} => #N.1) ⟨N, hN⟩) _ + +theorem density_le_mk_add_aleph0 : density X ≤ #X + ℵ₀ := + dense_univ.density_le.trans_eq (by rw [mk_univ]) + +/-- The sets `⋂₀ {U | IsOpen U ∧ x ∈ U}`, for `x : X`, form a network of `X`. -/ +theorem isNetwork_range_sInter : IsNetwork (range fun x : X => ⋂₀ {U | IsOpen U ∧ x ∈ U}) := + fun _ hU x hx => ⟨_, mem_range_self x, fun _ hV => hV.2, fun _ hy => hy _ ⟨hU, hx⟩⟩ + +theorem networkWeight_le_mk_add_aleph0 : networkWeight X ≤ #X + ℵ₀ := + isNetwork_range_sInter.networkWeight_le.trans (add_le_add_left mk_range_le _) + +/-- The density is attained by some dense subset. -/ +theorem exists_dense_mk_add_aleph0_eq_density : ∃ s : Set X, Dense s ∧ #s + ℵ₀ = density X := + let ⟨⟨s, hs⟩, h⟩ := ciInf_mem fun s : {s : Set X // Dense s} => #s.1 + ⟨s, hs, congrArg (· + ℵ₀) h⟩ + +/-- The network weight is attained by some network. -/ +theorem exists_isNetwork_mk_add_aleph0_eq_networkWeight : + ∃ N : Set (Set X), IsNetwork N ∧ #N + ℵ₀ = networkWeight X := + let ⟨⟨N, hN⟩, h⟩ := ciInf_mem fun N : {N : Set (Set X) // IsNetwork N} => #N.1 + ⟨N, hN, congrArg (· + ℵ₀) h⟩ + +theorem le_density {c : Cardinal} (h : ∀ s : Set X, Dense s → c ≤ #s + ℵ₀) : c ≤ density X := + let ⟨s, hs, h'⟩ := exists_dense_mk_add_aleph0_eq_density (X := X) + h' ▸ h s hs + +theorem le_networkWeight {c : Cardinal} (h : ∀ N : Set (Set X), IsNetwork N → c ≤ #N + ℵ₀) : + c ≤ networkWeight X := + let ⟨N, hN, h'⟩ := exists_isNetwork_mk_add_aleph0_eq_networkWeight (X := X) + h' ▸ h N hN + +theorem density_le_aleph0_iff : density X ≤ ℵ₀ ↔ SeparableSpace X := by + constructor + · intro h + obtain ⟨s, hs, hs'⟩ := exists_dense_mk_add_aleph0_eq_density (X := X) + exact ⟨s, countable_coe_iff.mp (mk_le_aleph0_iff.mp (le_self_add.trans (hs'.trans_le h))), + hs⟩ + · rintro ⟨s, hsc, hsd⟩ + exact hsd.density_le.trans ((add_le_add_left (mk_le_aleph0_iff.mpr hsc.to_subtype) _).trans_eq + aleph0_add_aleph0) + +theorem networkWeight_le_aleph0 [SecondCountableTopology X] : networkWeight X ≤ ℵ₀ := + let ⟨_, hbc, _, hb⟩ := exists_countable_basis (α := X) + hb.isNetwork.networkWeight_le.trans + ((add_le_add_left (mk_le_aleph0_iff.mpr hbc.to_subtype) _).trans_eq aleph0_add_aleph0) + +/-- The network weight of a subspace is at most that of the ambient space. -/ +theorem _root_.Topology.IsInducing.networkWeight_le {X Y : Type u} [TopologicalSpace X] + [TopologicalSpace Y] {f : X → Y} (hf : IsInducing f) : + networkWeight X ≤ networkWeight Y := + let ⟨_, hN, hN'⟩ := exists_isNetwork_mk_add_aleph0_eq_networkWeight (X := Y) + (hN.preimage hf).networkWeight_le.trans (hN' ▸ add_le_add_left mk_image_le _) + +theorem density_discrete [DiscreteTopology X] : density X = #X + ℵ₀ := by + refine le_antisymm density_le_mk_add_aleph0 (le_density fun s hs => ?_) + obtain rfl := dense_discrete.mp hs + rw [mk_univ] + +theorem networkWeight_discrete [DiscreteTopology X] : networkWeight X = #X + ℵ₀ := by + refine le_antisymm networkWeight_le_mk_add_aleph0 (le_networkWeight fun N hN => ?_) + have h (x : X) : {x} ∈ N := by + obtain ⟨n, hn, hx, hsub⟩ := hN (isOpen_discrete {x}) x rfl + rwa [subset_antisymm hsub (singleton_subset_iff.mpr hx)] at hn + exact add_le_add_left (mk_le_of_injective (f := fun x => (⟨{x}, h x⟩ : N)) + fun _ _ h => singleton_injective (congrArg Subtype.val h)) _ + +end TopologicalSpace diff --git a/FormalConjecturesForMathlib/Topology/MetricSpace/GromovProduct.lean b/FormalConjecturesForMathlib/Topology/MetricSpace/GromovProduct.lean new file mode 100644 index 0000000..2ce7405 --- /dev/null +++ b/FormalConjecturesForMathlib/Topology/MetricSpace/GromovProduct.lean @@ -0,0 +1,21 @@ +/- +Copyright 2026 The Formal Conjectures Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ +/- Original Mathlib authors: Hang Lu Su, Katerina Hristova. -/ +module + +public import Mathlib.Topology.MetricSpace.GromovProduct + +/-! This backport is provided by production Mathlib. -/ diff --git a/FormalConjecturesForMathlib/Topology/MetricSpace/Hyperbolic.lean b/FormalConjecturesForMathlib/Topology/MetricSpace/Hyperbolic.lean new file mode 100644 index 0000000..313ed8f --- /dev/null +++ b/FormalConjecturesForMathlib/Topology/MetricSpace/Hyperbolic.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. +-/ +/- Original Mathlib authors: Hang Lu Su, Katerina Hristova. -/ +module + +public import Mathlib.Topology.MetricSpace.Bounded +public import FormalConjecturesForMathlib.Topology.MetricSpace.GromovProduct + +/-! +# Gromov hyperbolic pseudometric spaces + +This is being upstreamed to Mathlib in leanprover-community/mathlib4#43723. + +TODO: delete this file when this repository moves to a Mathlib version that contains it. + +## Main definitions + +* `Metric.IsHyperbolicWith`: A pseudometric space is hyperbolic with constant `δ` + if and only if for all `w x y z` the four-point condition + `min (gromovProduct w x y) (gromovProduct w y z) - δ ≤ gromovProduct w x z` holds. +* `Metric.IsHyperbolic`: A pseudometric space is hyperbolic if it is `δ`-hyperbolic for some + constant `δ`. + +## Main results + +* `Metric.isHyperbolicWith_diam_univ`: A bounded space is `δ`-hyperbolic with respect to its + diameter. + +## Implementation notes + +The constant `δ` in `IsHyperbolicWith X δ` is a real number. For a non-empty space, +taking `w = x = y = z` in the four-point condition yields `0 ≤ δ`. +-/ + +@[expose] public section + +namespace Metric + +/-! ### δ-hyperbolic spaces -/ + +/-- A pseudometric space is `δ`-hyperbolic if for all `w x y z` the four-point condition +`min (gromovProduct w x y) (gromovProduct w y z) - δ ≤ gromovProduct w x z` holds. -/ +def IsHyperbolicWith (X : Type*) [PseudoMetricSpace X] (δ : ℝ) : Prop := + ∀ w x y z : X, min (gromovProduct w x y) (gromovProduct w y z) - δ ≤ gromovProduct w x z + +variable {X : Type*} [PseudoMetricSpace X] + +/-- A pseudometric space with all distances bounded above by `k` is `k`-hyperbolic. -/ +@[grind .] +lemma isHyperbolicWith_of_forall_dist_le {k : ℝ} (hk : ∀ x y : X, dist x y ≤ k) : + IsHyperbolicWith X k := by + grind [IsHyperbolicWith, gromovProduct_le_dist_left] + +/-- A bounded space is `δ`-hyperbolic with respect to its diameter. -/ +theorem isHyperbolicWith_diam_univ [BoundedSpace X] : + IsHyperbolicWith X (diam (Set.univ : Set X)) := by + grind [dist_le_diam_of_mem, Bornology.isBounded_univ] + +/-! ### Hyperbolic spaces -/ + +/-- A pseudometric space is hyperbolic if it is `δ`-hyperbolic for some real constant `δ`. -/ +class IsHyperbolic (X : Type*) [PseudoMetricSpace X] : Prop where + exists_isHyperbolicWith : ∃ δ, IsHyperbolicWith X δ + +/-- Every bounded pseudometric space is hyperbolic. -/ +instance [BoundedSpace X] : IsHyperbolic X := ⟨_, isHyperbolicWith_diam_univ⟩ + +end Metric diff --git a/FormalConjecturesUtil/Attributes/Basic.lean b/FormalConjecturesUtil/Attributes/Basic.lean index f5362d9..dc1cc1a 100644 --- a/FormalConjecturesUtil/Attributes/Basic.lean +++ b/FormalConjecturesUtil/Attributes/Basic.lean @@ -518,4 +518,103 @@ def verifyCategoryCounts (problems : List Name) (expected : List (String × Nat) if total != expectedTotal then throwError s!"Expected total {expectedTotal} problems, got {total}" +/-- The kind of question a source asks. -/ +inductive QuestionKind + /-- A yes-or-no question. The statement is the proposition asked about. -/ + | yesNo + /-- A question asking for a value. The unknown is the definition `.answer`. -/ + | value + deriving Inhabited, BEq, Hashable, Repr, ToExpr + +instance : ToString QuestionKind where + toString + | .yesNo => "yes_no" + | .value => "value" + +/-- A tag recording that a declaration is posed as a question by its source. -/ +structure QuestionTag where + /-- The name of the declaration with the given tag. -/ + declName : Name + /-- The kind of question. -/ + kind : QuestionKind + deriving Inhabited, BEq, Hashable, ToExpr + +/-- Defines the `questionExt` extension recording which declarations are posed as +questions by their source, keyed by declaration name. -/ +initialize questionExt : + SimplePersistentEnvExtension QuestionTag (Std.HashMap Name QuestionKind) ← + registerSimplePersistentEnvExtension { + addImportedFn := fun as => + as.foldl (fun m tags => tags.foldl (fun m t => m.insert t.declName t.kind) m) {} + addEntryFn := fun m t => m.insert t.declName t.kind + } + +def addQuestionEntry {m : Type → Type} [MonadEnv m] (declName : Name) (kind : QuestionKind) : + m Unit := + modifyEnv (questionExt.addEntry · { declName := declName, kind := kind }) + +/-- Fails unless `cat` is a research category. A question is something a source asked and left +open at some point, so it belongs to a research problem, not to a textbook exercise, a test, or +an API statement. The `question` and `category` attributes both call this, so the check runs +whichever of the two is applied second, and also for `attribute [question] foo`. -/ +def checkQuestionCategory (declName : Name) (cat : Category) : CoreM Unit := + unless cat matches .research _ do + throwError "the `question` attribute belongs to a `research open` or `research solved` \ + problem, but '{declName}' has a non-research category" + +/-- Whether the statement of `decl`, of type `type`, refers to the definition `decl.answer`, +the unknown of a value question. -/ +def hasValueAnswer (decl : Name) (type : Expr) : Bool := + type.getUsedConstants.contains (decl ++ `answer) + +syntax (name := Question_attr) &"question" (&"value")? : attr + +/-- Records that the source asks a question rather than makes a claim. + +Usage, together with a `research` category: +- `@[question]` for a yes-or-no question. The statement is the proposition asked about; once + answered, it is the one that holds: unchanged for a yes, negated with `¬` for a no. +- `@[question value]` for a question that asks for a value. The unknown is a definition + `.answer`, which the statement refers to by that name. + +The attribute checks the form against the statement: `value` requires a reference to +`.answer`, and plain `question` forbids it. -/ +initialize Lean.registerBuiltinAttribute { + name := `Question_attr + descr := "Annotation that a statement is posed as a question." + add decl stx _attrKind := do + let kind ← match stx with + | `(attr| question) => pure QuestionKind.yesNo + | `(attr| question value) => pure QuestionKind.value + | _ => throwUnsupportedSyntax + -- Inside a `module`, a theorem is still registered as an axiom when attributes run, so + -- the check is on the type rather than on the kind of the constant. + let some info := (← getEnv).find? decl + | throwError "unknown declaration '{decl}'" + unless ← Meta.MetaM.run' (Meta.isProp info.type) do + throwError "the `question` attribute only applies to theorems, \ + but the type of '{decl}' is not a proposition" + if let some tag := (categoryExt.getState (← getEnv)).toArray.find? (·.declName == decl) then + checkQuestionCategory decl tag.category + match kind, hasValueAnswer decl info.type with + | .value, false => + throwError "`question value` requires the statement of '{decl}' to refer to the \ + definition `{decl ++ `answer}`; for a yes-or-no question use `question`" + | .yesNo, true => + throwError "the statement of '{decl}' refers to the unknown of a value question; \ + use `question value`" + | _, _ => pure () + addQuestionEntry decl kind + applicationTime := .afterTypeChecking +} + + +section +variable {m : Type → Type} [Monad m] [MonadEnv m] + +def getQuestionKind? (declName : Name) : m (Option QuestionKind) := do + return (questionExt.getState (← MonadEnv.getEnv))[declName]? + +end + end ProblemAttributes diff --git a/FormalConjecturesUtil/Linters/ImportLinter.lean b/FormalConjecturesUtil/Linters/ImportLinter.lean index 9cb0355..60e2b35 100644 --- a/FormalConjecturesUtil/Linters/ImportLinter.lean +++ b/FormalConjecturesUtil/Linters/ImportLinter.lean @@ -41,6 +41,15 @@ register_option linter.style.imports : Bool := { namespace ImportLinter +/-- Extract import identifiers while retaining their source locations for lint messages. -/ +private def getImportIds (header : TSyntax ``Parser.Module.header) : Array Syntax := + match header with + | `(Parser.Module.header| $[module]? $[prelude]? $imports*) => + imports.filterMap fun + | `(Parser.Module.import| $[public]? $[meta]? import $[all]? $n:ident) => some n.raw + | _ => none + | _ => #[] + /-- Checks an array of import identifiers against Formal Conjectures import rules. -/ def checkImports (importIds : Array Syntax) (isFormalConjecturesModule : Bool := true) (firstCmdStx : Syntax := .missing) : CommandElabM Unit := do @@ -83,7 +92,7 @@ def importLinter : Linter where run := withSetOptionIn fun stx ↦ do let fm ← getFileMap let (headerStx, _) ← Parser.parseHeader { inputString := fm.source, fileName := fileName, fileMap := fm } - let importIds := Mathlib.Linter.getImportIds headerStx + let importIds := getImportIds headerStx checkImports importIds (isFormalConjecturesModule := true) stx initialize addLinter importLinter @@ -93,7 +102,7 @@ elab "#check_imports " headerStr:str : command => do let s := headerStr.getString let fm : FileMap := { source := s, positions := #[0] } let (headerStx, _) ← Parser.parseHeader { inputString := s, fileName := "test.lean", fileMap := fm } - let importIds := Mathlib.Linter.getImportIds headerStx + let importIds := getImportIds headerStx checkImports importIds (isFormalConjecturesModule := true) headerStr end ImportLinter diff --git a/FormalConjecturesUtil/Linters/StubLinter.lean b/FormalConjecturesUtil/Linters/StubLinter.lean index e60ea82..6f73de9 100644 --- a/FormalConjecturesUtil/Linters/StubLinter.lean +++ b/FormalConjecturesUtil/Linters/StubLinter.lean @@ -21,6 +21,10 @@ public import Mathlib.Tactic.Linter.Header The `StubLinter` ensures that no stubs, placeholder definitions (e.g. `opaque`, `def ... := sorry`), or new axioms are introduced in the repository. + +The one allowed placeholder is the unknown of a value question: a definition named +`.answer` whose value is `sorry` until the question is answered (see the `question` +attribute). -/ public meta section @@ -44,6 +48,12 @@ def hasSorry (stx : Syntax) : Bool := s.getId.eraseMacroScopes == `sorry || s.getId.eraseMacroScopes == `sorryAx)) ) != none +/-- Whether a definition is the unknown of a value question, i.e. its name ends in `answer`. -/ +def isAnswerDef (decl : Syntax) : Bool := + match decl.find? (·.isOfKind ``Lean.Parser.Command.declId) with + | some declId => declId[0].getId.getString! == "answer" + | none => false + /-- Checks a declaration command for stubs, placeholder definitions, and axioms. -/ def checkDecl (stx : Syntax) : CommandElabM Unit := do if stx.getKind == ``Lean.Parser.Command.declaration then @@ -59,7 +69,7 @@ def checkDecl (stx : Syntax) : CommandElabM Unit := do kind == ``Lean.Parser.Command.abbrev || kind == ``Lean.Parser.Command.instance || kind == ``Lean.Parser.Command.structure then - if hasSorry decl then + if hasSorry decl && !isAnswerDef decl then logLintIf linter.style.stubs stx "Placeholder definitions (e.g., `def foo : Type := sorry`) are not allowed." diff --git a/FullOldProblems.lean b/FullOldProblems.lean new file mode 100644 index 0000000..6dc94b9 --- /dev/null +++ b/FullOldProblems.lean @@ -0,0 +1,341 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import Mathlib + +/-! +# Seventeen longstanding problems — statements only + +Closed definitions of the seventeen propositions used by the HistoricalOpen +problem files. Finite labels lose no generality. Sources are cited in those files. +-/ + +open Finset +open scoped BigOperators + +noncomputable section +local instance (p : Prop) : Decidable p := Classical.propDecidable p + +namespace FullOldProblems + +/-! Shared encodings for finite simple graphs. -/ + +def maximumDegree {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + univ.sup fun v => (G.neighborSet v).ncard + +/-- The palette bound applies to actual edges only, including when k = 0. -/ +def ProperEdgeColoring {n : ℕ} (G : SimpleGraph (Fin n)) (k : ℕ) + (c : Sym2 (Fin n) → ℕ) : Prop := + (∀ e ∈ G.edgeSet, c e < k) ∧ + ∀ u v w : Fin n, G.Adj u v → G.Adj u w → v ≠ w → + c s(u, v) ≠ c s(u, w) + +def EdgeColorable {n : ℕ} (G : SimpleGraph (Fin n)) (k : ℕ) : Prop := + ∃ c, ProperEdgeColoring G k c + +def HasHamiltonPath {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∃ a b : Fin n, ∃ w : G.Walk a b, w.IsPath ∧ ∀ v, v ∈ w.support + +def HasHamiltonCycle {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∃ a : Fin n, ∃ w : G.Walk a a, w.IsCycle ∧ ∀ v, v ∈ w.support + +/-- Edge disjointness, with full coverage. Vertices may be shared. -/ +def PartitionsEdges {n r : ℕ} (G : SimpleGraph (Fin n)) + (E : Fin r → Set (Sym2 (Fin n))) : Prop := + (∀ i j : Fin r, i ≠ j → Disjoint (E i) (E j)) ∧ + ∀ e : Sym2 (Fin n), e ∈ G.edgeSet ↔ ∃ i : Fin r, e ∈ E i + +/-! 1. Hajós (1968): the exact cycle count for every finite even simple graph. -/ + +def HajosCycleDecomposition : Prop := + ∀ n : ℕ, 1 ≤ n → ∀ G : SimpleGraph (Fin n), + (∀ v : Fin n, Even (G.neighborSet v).ncard) → + ∃ r : ℕ, r ≤ (n - 1) / 2 ∧ ∃ a : Fin r → Fin n, + ∃ w : (i : Fin r) → G.Walk (a i) (a i), + (∀ i : Fin r, (w i).IsCycle) ∧ + PartitionsEdges G (fun i => (w i).edgeSet) + +/-! Multigraphs retain parallel edges as distinct labels. Loops are allowed; +they count twice in degrees, never cross a cut, and cancel in flow conservation. +The chosen endpoint order is a reference orientation, not a restriction. -/ + +structure MultiGraph (n m : ℕ) where + tail : Fin m → Fin n + head : Fin m → Fin n + +namespace MultiGraph + +def degreeIn {n m : ℕ} (G : MultiGraph n m) (E : Finset (Fin m)) (v : Fin n) : ℕ := + (E.filter (fun e => G.tail e = v)).card + (E.filter (fun e => G.head e = v)).card + +def cutSize {n m : ℕ} (G : MultiGraph n m) (S : Finset (Fin n)) : ℕ := + (univ.filter (fun e => ¬ (G.tail e ∈ S ↔ G.head e ∈ S))).card + +/-- An edge is a bridge iff some vertex cut consists of that single edge. -/ +def Bridgeless {n m : ℕ} (G : MultiGraph n m) : Prop := + ∀ S : Finset (Fin n), G.cutSize S ≠ 1 + +def Cubic {n m : ℕ} (G : MultiGraph n m) : Prop := + ∀ v : Fin n, G.degreeIn univ v = 3 + +def PerfectMatching {n m : ℕ} (G : MultiGraph n m) (M : Finset (Fin m)) : Prop := + ∀ v : Fin n, G.degreeIn M v = 1 + +/-- Signed integer flows are equivalent to orienting edges and using positive +values 1,...,k-1: reverse an edge whenever its signed value is negative. -/ +def IsNowhereZeroFlow {n m : ℕ} (G : MultiGraph n m) (k : ℕ) + (f : Fin m → ℤ) : Prop := + (∀ e, f e ≠ 0 ∧ |f e| < (k : ℤ)) ∧ + ∀ v : Fin n, + (∑ e ∈ univ.filter (fun e => G.tail e = v), f e) = + ∑ e ∈ univ.filter (fun e => G.head e = v), f e + +def HasNowhereZeroFlow {n m : ℕ} (G : MultiGraph n m) (k : ℕ) : Prop := + ∃ f, G.IsNowhereZeroFlow k f + +def FourEdgeConnected {n m : ℕ} (G : MultiGraph n m) : Prop := + ∀ S : Finset (Fin n), S.Nonempty → S ≠ univ → 4 ≤ G.cutSize S + +end MultiGraph + +/-! 2. Berge–Fulkerson (1971): six matchings, with multiplicity exactly two. -/ + +def BergeFulkerson : Prop := + ∀ n m : ℕ, ∀ G : MultiGraph n m, G.Bridgeless → G.Cubic → + ∃ M : Fin 6 → Finset (Fin m), + (∀ i, G.PerfectMatching (M i)) ∧ + ∀ e : Fin m, (univ.filter (fun i => e ∈ M i)).card = 2 + +/-! 3. Vizing (1968): independence number of edge-chromatic critical graphs. -/ + +/-- For finite simple graphs Vizing's theorem makes this equivalent to: +connected, chromatic index Δ+1, and deleting any edge lowers the index to Δ. -/ +def DeltaCritical {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + G.Connected ∧ ¬ EdgeColorable G (maximumDegree G) ∧ + ∀ e ∈ G.edgeSet, EdgeColorable (G.deleteEdges {e}) (maximumDegree G) + +def VizingIndependence : Prop := + ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), DeltaCritical G → + ∀ S : Finset (Fin n), (∀ u ∈ S, ∀ v ∈ S, ¬ G.Adj u v) → 2 * S.card ≤ n + +/-! 4. Chvátal (1973): existence of a universal toughness threshold. -/ + +def componentsAfterDeletion {n : ℕ} (G : SimpleGraph (Fin n)) + (S : Finset (Fin n)) : ℕ := + Nat.card (G.induce {v | v ∉ S}).ConnectedComponent + +def IsTough {n : ℕ} (G : SimpleGraph (Fin n)) (t : ℝ) : Prop := + ∀ S : Finset (Fin n), 1 < componentsAfterDeletion G S → + t * (componentsAfterDeletion G S : ℝ) ≤ (S.card : ℝ) + +def ChvatalToughness : Prop := + ∃ t : ℝ, 0 < t ∧ ∀ n : ℕ, 3 ≤ n → + ∀ G : SimpleGraph (Fin n), IsTough G t → HasHamiltonCycle G + +/-! 5. Lovász (1969): spanning paths in all connected vertex-transitive graphs. -/ + +def VertexTransitive {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∀ u v : Fin n, ∃ φ : G ≃g G, φ u = v + +def LovaszHamiltonPath : Prop := + ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + G.Connected → VertexTransitive G → HasHamiltonPath G + +/-! 6. Kotzig (1963/1964): a perfect 1-factorization for every even order. -/ + +def SimplePerfectMatching {n : ℕ} (G : SimpleGraph (Fin n)) + (M : Finset (Sym2 (Fin n))) : Prop := + (∀ e ∈ M, e ∈ G.edgeSet) ∧ + ∀ v : Fin n, (M.filter (fun e => v ∈ e)).card = 1 + +def KotzigPerfectFactorization : Prop := + ∀ n : ℕ, 4 ≤ n → Even n → + ∃ M : Fin (n - 1) → Finset (Sym2 (Fin n)), + (∀ i, SimplePerfectMatching (⊤ : SimpleGraph (Fin n)) (M i)) ∧ + PartitionsEdges (⊤ : SimpleGraph (Fin n)) (fun i => (M i : Set _)) ∧ + ∀ i j, i ≠ j → ∃ a : Fin n, + ∃ w : (⊤ : SimpleGraph (Fin n)).Walk a a, + w.IsCycle ∧ (∀ v, v ∈ w.support) ∧ + w.edgeSet = ((M i : Set _) ∪ (M j : Set _)) + +/-! 7. Riddell–Erdős / Erdős 530 (1969/1973): exact Sidon-subset asymptotic. -/ + +def IsSidon (S : Finset ℝ) : Prop := + ∀ a ∈ S, ∀ b ∈ S, ∀ c ∈ S, ∀ d ∈ S, + a + b = c + d → (a = c ∧ b = d) ∨ (a = d ∧ b = c) + +/-- Both bounds for ℓ(N) / √N → 1 are stated explicitly: a uniform guarantee +for every real N-element set, and an N-element set witnessing the upper bound. +Repeated summands are permitted in the definition of Sidon. -/ +def SidonSubsetAsymptotic : Prop := + ∀ ε : ℝ, 0 < ε → ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + (∀ A : Finset ℝ, A.card = N → ∃ S : Finset ℝ, + S ⊆ A ∧ IsSidon S ∧ (1 - ε) * Real.sqrt N ≤ (S.card : ℝ)) ∧ + (∃ A : Finset ℝ, A.card = N ∧ ∀ S : Finset ℝ, S ⊆ A → IsSidon S → + (S.card : ℝ) ≤ (1 + ε) * Real.sqrt N) + +/-! 8. Tutte (1954): a nowhere-zero 5-flow on every bridgeless multigraph. -/ + +def TutteFiveFlow : Prop := + ∀ n m : ℕ, ∀ G : MultiGraph n m, G.Bridgeless → G.HasNowhereZeroFlow 5 + +/-! 9. Tutte (1972): a nowhere-zero 3-flow on every 4-edge-connected multigraph. +This is the separate classical 3-flow conjecture, at its original threshold. -/ + +def TutteThreeFlow : Prop := + ∀ n m : ℕ, ∀ G : MultiGraph n m, G.FourEdgeConnected → G.HasNowhereZeroFlow 3 + +/-! 10. Riddell–Erdős (1969/1975): the full progression-length family +asked in Erdős 1975, pp. 306–307. The current Erdős 201 page highlights k=3; +we retain every fixed k >= 3 from the original source. -/ + +def ProgressionFree (k : ℕ) (A : Finset ℤ) : Prop := + ∀ a d : ℤ, d ≠ 0 → ¬ ∀ i : Fin k, a + (i.val : ℤ) * d ∈ A + +def maxProgressionFreeSubset (k : ℕ) (A : Finset ℤ) : ℕ := + (A.powerset.filter (ProgressionFree k)).sup Finset.card + +def intervalProgressionNumber (k N : ℕ) : ℕ := + maxProgressionFreeSubset k (Icc 1 (N : ℤ)) + +/-- The minimum is over all N-element integer sets, not only intervals. -/ +def universalProgressionNumber (k N : ℕ) : ℕ := + sInf {r : ℕ | ∃ A : Finset ℤ, A.card = N ∧ maxProgressionFreeSubset k A = r} + +/-- We use the largest progression-free subset convention for R_k, as on +the modern problem page. The original uses the forcing threshold R_k+1; +for each fixed k >= 3, R_k tends to infinity, so the limits are equivalent. -/ +def RiddellErdosProgressionRatio : Prop := + ∀ k : ℕ, 3 ≤ k → Filter.Tendsto (fun N : ℕ => + (intervalProgressionNumber k N : ℝ) / (universalProgressionNumber k N : ℝ)) + Filter.atTop (nhds 1) + +/-! 11. Erdős (asked before 1973): linear minimum degree in arbitrarily +large edge-critical four-chromatic graphs. This is the positive answer to +the original yes/no question, not an assertion that the answer is positive. -/ + +def FourChromaticCritical {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + G.chromaticNumber = 4 ∧ ∀ e ∈ G.edgeSet, (G.deleteEdges {e}).chromaticNumber = 3 + +def ErdosCriticalMinimumDegree : Prop := + ∃ ε : ℝ, 0 < ε ∧ ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + ∃ G : SimpleGraph (Fin n), FourChromaticCritical G ∧ + ∀ v : Fin n, ε * (n : ℝ) ≤ ((G.neighborSet v).ncard : ℝ) + +/-! 12. Erdős–Purdy (1971): all four-point subsets with fewer than six +distinct distances, including equal distances on pairs sharing a vertex. -/ + +abbrev Plane := EuclideanSpace ℝ (Fin 2) + +def DegenerateQuadruple (Q : Finset Plane) : Prop := + Q.card = 4 ∧ ∃ a ∈ Q, ∃ b ∈ Q, ∃ c ∈ Q, ∃ d ∈ Q, + a ≠ b ∧ c ≠ d ∧ s(a, b) ≠ s(c, d) ∧ dist a b = dist c d + +def degenerateQuadrupleCount (A : Finset Plane) : ℕ := + (A.powerset.filter DegenerateQuadruple).card + +def ErdosPurdyDegenerateQuadruples : Prop := + ∀ ε : ℝ, 0 < ε → ∃ N : ℕ, ∀ A : Finset Plane, N ≤ A.card → + (degenerateQuadrupleCount A : ℝ) ≤ (A.card : ℝ) ^ (3 + ε) + +/-! 13. Marcus (1973), independently de Oliveira (1982): determinant of +the sum of arbitrary complex normal matrices. Characteristic polynomials +specify the complete eigenvalue lists with algebraic multiplicities. -/ + +def HasEigenvalueList {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (a : Fin n → ℂ) : Prop := + A.charpoly = ∏ i, (Polynomial.X - Polynomial.C (a i)) + +def MarcusDeOliveira : Prop := + ∀ n : ℕ, 1 ≤ n → ∀ A B : Matrix (Fin n) (Fin n) ℂ, + A * A.conjTranspose = A.conjTranspose * A → + B * B.conjTranspose = B.conjTranspose * B → + ∀ a b : Fin n → ℂ, HasEigenvalueList A a → HasEigenvalueList B b → + (A + B).det ∈ convexHull ℝ + (Set.range (fun σ : Equiv.Perm (Fin n) => ∏ i, (a i + b (σ i)))) + +/-! 14. Minkowski (documented by 1956): the full inhomogeneous product +bound in every dimension, for every nonsingular real matrix and shift. -/ + +def MinkowskiInhomogeneousProduct : Prop := + ∀ n : ℕ, 1 ≤ n → ∀ A : Matrix (Fin n) (Fin n) ℝ, A.det ≠ 0 → + ∀ b : Fin n → ℝ, ∃ z : Fin n → ℤ, + (∏ i, |(∑ j, A i j * (z j : ℝ)) - b i|) ≤ |A.det| / (2 : ℝ) ^ n + +/-! 15. Cantoni (1950): planar cubic graphs with exactly three Hamilton +cycles contain a triangle. Cycles are counted by undirected edge sets. +Fáry's theorem makes this straight-line definition of planarity equivalent +to ordinary planarity for finite simple graphs; no convex-position assumption. -/ + +def StraightLinePlanar {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∃ p : Fin n → Plane, Function.Injective p ∧ + (∀ u v, G.Adj u v → ∀ w, p w ∈ segment ℝ (p u) (p v) → w = u ∨ w = v) ∧ + ∀ u v x y, G.Adj u v → G.Adj x y → s(u, v) ≠ s(x, y) → + ∀ z ∈ segment ℝ (p u) (p v), z ∈ segment ℝ (p x) (p y) → + (z = p u ∨ z = p v) ∧ (z = p x ∨ z = p y) + +def hamiltonCycleEdgeSets {n : ℕ} (G : SimpleGraph (Fin n)) : + Set (Finset (Sym2 (Fin n))) := + {E | ∃ a : Fin n, ∃ w : G.Walk a a, + w.IsCycle ∧ (∀ v, v ∈ w.support) ∧ w.edges.toFinset = E} + +def Cantoni : Prop := + ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), StraightLinePlanar G → + (∀ v, (G.neighborSet v).ncard = 3) → (hamiltonCycleEdgeSets G).ncard = 3 → + ∃ a b c : Fin n, G.Adj a b ∧ G.Adj b c ∧ G.Adj c a + +/-! 16. Marcus (1965): permanent of a matrix versus the permanent of its +block permanents, including the original equality characterization. The whole +matrix is complex Hermitian positive semidefinite; off-diagonal blocks need +not themselves be positive semidefinite. -/ + +open scoped ComplexOrder + +def matrixBlock {m k : ℕ} + (A : Matrix (Fin m × Fin k) (Fin m × Fin k) ℂ) (i j : Fin m) : + Matrix (Fin k) (Fin k) ℂ := fun a b => A (i, a) (j, b) + +def blockPermanentMatrix {m k : ℕ} + (A : Matrix (Fin m × Fin k) (Fin m × Fin k) ℂ) : Matrix (Fin m) (Fin m) ℂ := + fun i j => (matrixBlock A i j).permanent + +def MarcusBlockPermanent : Prop := + ∀ m k : ℕ, 1 ≤ m → 1 ≤ k → + ∀ A : Matrix (Fin m × Fin k) (Fin m × Fin k) ℂ, A.PosSemidef → + (blockPermanentMatrix A).permanent ≤ A.permanent ∧ + (2 ≤ k → (∀ i, (matrixBlock A i i).PosDef) → + (A.permanent = (blockPermanentMatrix A).permanent ↔ + ∀ i j : Fin m, i ≠ j → ∀ a b : Fin k, A (i, a) (j, b) = 0)) + +/-! 17. Wang (1974): can a real Hadamard matrix of order greater than two +have zero permanent? We encode the negative answer, in every order, without +restricting to Sylvester or circulant matrices. Proving or disproving this +proposition answers the original yes/no question. -/ + +def IsSignHadamard {n : ℕ} (H : Matrix (Fin n) (Fin n) ℤ) : Prop := + (∀ i j, H i j = 1 ∨ H i j = -1) ∧ H * H.transpose = (n : ℤ) • 1 + +def WangHadamardPermanentNonvanishing : Prop := + ∀ n : ℕ, 2 < n → ∀ H : Matrix (Fin n) (Fin n) ℤ, + IsSignHadamard H → H.permanent ≠ 0 + +def statements : Fin 17 → Prop := ![ + HajosCycleDecomposition, BergeFulkerson, VizingIndependence, + ChvatalToughness, LovaszHamiltonPath, KotzigPerfectFactorization, + SidonSubsetAsymptotic, TutteFiveFlow, TutteThreeFlow, + RiddellErdosProgressionRatio, ErdosCriticalMinimumDegree, + ErdosPurdyDegenerateQuadruples, MarcusDeOliveira, + MinkowskiInhomogeneousProduct, Cantoni, MarcusBlockPermanent, + WangHadamardPermanentNonvanishing] + +end FullOldProblems diff --git a/FullOldProblems/Audit.lean b/FullOldProblems/Audit.lean new file mode 100644 index 0000000..0adf7ff --- /dev/null +++ b/FullOldProblems/Audit.lean @@ -0,0 +1,182 @@ +/- +Copyright 2026 The Formal Conjectures Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + https://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-/ + +import FullOldProblems +import Lean.Util.CollectAxioms + +open FullOldProblems Finset +open scoped BigOperators + +/- Boundary checks target possible encoding errors, not the open conjectures. -/ + +example (n : ℕ) : EdgeColorable (⊥ : SimpleGraph (Fin n)) 0 := by + refine ⟨fun _ => 0, ?_, ?_⟩ <;> simp + +example : ¬ EdgeColorable (⊤ : SimpleGraph (Fin 2)) 0 := by + rintro ⟨c, h, _⟩ + have h01 : s((0 : Fin 2), 1) ∈ (⊤ : SimpleGraph (Fin 2)).edgeSet := by simp + have := h _ h01 + omega + +example {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (v : Fin n) : + (G.neighborSet v).ncard = G.degree v := by + classical + calc + _ = (G.neighborFinset v : Set (Fin n)).ncard := + congrArg Set.ncard (G.coe_neighborFinset v).symm + _ = (G.neighborFinset v).card := Set.ncard_coe_finset _ + _ = G.degree v := rfl + +example : HasHamiltonPath (⊥ : SimpleGraph (Fin 1)) := by + refine ⟨0, 0, SimpleGraph.Walk.nil, ?_, ?_⟩ + · simp + · intro v + have : v = 0 := Subsingleton.elim _ _ + simp [this] + +example (n : ℕ) : + PartitionsEdges (⊥ : SimpleGraph (Fin n)) (Fin.elim0 : Fin 0 → Set (Sym2 (Fin n))) := by + constructor + · intro i + exact Fin.elim0 i + · intro e + simp + +/- A two-vertex cubic multigraph with three distinct parallel edges. -/ +private def parallelThree : MultiGraph 2 3 := ⟨fun _ => 0, fun _ => 1⟩ + +example : parallelThree.Cubic := by + intro v + fin_cases v <;> norm_num [MultiGraph.degreeIn, parallelThree] + +example : parallelThree.cutSize {0} = 3 := by + norm_num [MultiGraph.cutSize, parallelThree] + +example : parallelThree.PerfectMatching {0} := by + intro v + fin_cases v <;> norm_num [MultiGraph.degreeIn, parallelThree] + +/- Three reference-oriented parallel edges need signed values, e.g. 1, 1, -2. -/ +example : parallelThree.IsNowhereZeroFlow 3 ![1, 1, -2] := by + constructor + · intro e + fin_cases e <;> norm_num + · intro v + fin_cases v <;> + norm_num [parallelThree, Fin.sum_univ_succ] + +/- A loop contributes two to degree and zero to every cut. -/ +private def oneLoop : MultiGraph 1 1 := ⟨fun _ => 0, fun _ => 0⟩ + +example : oneLoop.degreeIn univ 0 = 2 := by + norm_num [MultiGraph.degreeIn, oneLoop] + +example (S : Finset (Fin 1)) : oneLoop.cutSize S = 0 := by + simp [MultiGraph.cutSize, oneLoop] + +example : oneLoop.IsNowhereZeroFlow 5 (fun _ => 4) := by + constructor + · norm_num + · intro v + rfl + +example : ¬ oneLoop.IsNowhereZeroFlow 5 (fun _ => 5) := by + intro h + have := (h.1 0).2 + norm_num at this + +/- Repeated summands matter: 0+2=1+1 excludes this set from Sidon sets. -/ +example : ¬ IsSidon ({0, 1, 2} : Finset ℝ) := by + intro h + have := h 0 (by simp) 2 (by simp) 1 (by simp) 1 (by simp) (by norm_num) + norm_num at this + +/- Nonzero common difference excludes 0,1,2 but allows a singleton. -/ +example : ¬ ProgressionFree 3 ({0, 1, 2} : Finset ℤ) := by + intro h + apply h 0 1 (by norm_num) + intro i + fin_cases i <;> norm_num + +example : ProgressionFree 3 ({7} : Finset ℤ) := by + intro a d hd h + have h0 := h 0 + have h1 := h 1 + simp at h0 h1 + omega + +/- A diagonal matrix retains repeated eigenvalues with their multiplicity. -/ +example : HasEigenvalueList (Matrix.diagonal (![2, 2] : Fin 2 → ℂ)) ![2, 2] := by + exact Matrix.charpoly_diagonal _ + +example : ¬ HasEigenvalueList (Matrix.diagonal (![2, 2] : Fin 2 → ℂ)) ![2, 3] := by + intro h + have he := congrArg (Polynomial.eval (3 : ℂ)) h + norm_num [HasEigenvalueList, Matrix.charpoly_diagonal, Fin.prod_univ_succ] at he + +/- The sharp scalar Minkowski constant is 1/2, not 1 or 1/4. -/ +example : (∏ i : Fin 1, |(∑ j : Fin 1, + (1 : Matrix (Fin 1) (Fin 1) ℝ) i j * ((0 : Fin 1 → ℤ) j : ℝ)) - 1/2|) = + |(1 : Matrix (Fin 1) (Fin 1) ℝ).det| / (2 : ℝ) ^ 1 := by + norm_num + +/- Counting edge sets identifies the two orientations of a Hamilton cycle. -/ +example {n : ℕ} (G : SimpleGraph (Fin n)) (a : Fin n) (w : G.Walk a a) : + w.reverse.edges.toFinset = w.edges.toFinset := by + simp + +/- Blocks of size one recover the original matrix, so the nontrivial +Marcus equality clause must not apply to block size one. -/ +example {m : ℕ} (B : Matrix (Fin m) (Fin m) ℂ) : + blockPermanentMatrix (fun (i a : Fin m × Fin 1) => B i.1 a.1) = B := by + ext i j + simp [blockPermanentMatrix, matrixBlock, Matrix.permanent] + +/- The order-two exception in Wang's question is essential. -/ +example : IsSignHadamard (!![1, 1; 1, -1] : Matrix (Fin 2) (Fin 2) ℤ) := by + constructor + · intro i j + fin_cases i <;> fin_cases j <;> norm_num + · ext i j + fin_cases i <;> fin_cases j <;> + norm_num [Matrix.mul_apply, Fin.sum_univ_succ, Matrix.one_apply] + +example : (!![1, 1; 1, -1] : Matrix (Fin 2) (Fin 2) ℤ).permanent = 0 := by + decide + +/- Audit the bodies transitively, not merely the type `Prop`. -/ +open Lean Elab Command in +run_elab do + let names : Array Name := #[ + ``HajosCycleDecomposition, ``BergeFulkerson, + ``VizingIndependence, ``ChvatalToughness, ``LovaszHamiltonPath, + ``KotzigPerfectFactorization, ``SidonSubsetAsymptotic, + ``TutteFiveFlow, ``TutteThreeFlow, + ``RiddellErdosProgressionRatio, ``ErdosCriticalMinimumDegree, + ``ErdosPurdyDegenerateQuadruples, ``MarcusDeOliveira, + ``MinkowskiInhomogeneousProduct, ``Cantoni, ``MarcusBlockPermanent, + ``WangHadamardPermanentNonvanishing] + for name in names do + let info ← getConstInfo name + unless info.type == .sort .zero do + throwError "{name} is not a closed proposition definition" + let .defnInfo _ := info | throwError "{name} must be a definition" + let axs ← collectAxioms name + let bad := axs.filter (fun a => a != ``propext && a != ``Classical.choice && a != ``Quot.sound) + unless bad.isEmpty do + throwError "{name} has unexpected axioms: {bad}" + logInfo m!"AUDITED {name}: {axs}" + let axs ← collectAxioms ``statements + unless axs.all (fun a => a == ``propext || a == ``Classical.choice || a == ``Quot.sound) do + throwError "Registry has unexpected axioms: {axs}" + logInfo "PASS: seventeen closed proposition definitions; no conjecture axioms or admitted dependencies." diff --git a/HilbertDrafts/Hilbert12.lean b/HilbertDrafts/Hilbert12.lean new file mode 100644 index 0000000..ed41eb5 --- /dev/null +++ b/HilbertDrafts/Hilbert12.lean @@ -0,0 +1,818 @@ +import Mathlib + +/-! +Hilbert 12: arithmetic classification and class-field theory specifications, +rational and imaginary-quadratic special-value benchmarks, free contracts for +proposed general constructions, and the rank-one abelian Stark conjecture. +Hilbert's original text supplies the scope; specialist sources supply the +precise mathematical interpretations. The free contracts do not certify +explicitness, and the Stark route is not identified with the entire problem. +-/ + +namespace HilbertDrafts.Hilbert12 + +noncomputable section + +/- These algebraic contracts work over any field. Their intended application +is to number fields; no closed Hilbert-12 proposition is declared here. -/ +variable (K : Type) [Field K] + +abbrev Ambient := AlgebraicClosure K + +/-- The extension is finite, normal, separable, and has commuting automorphisms. -/ +def IsFiniteAbelian (E : IntermediateField K (Ambient K)) : Prop := + FiniteDimensional K E ∧ IsGalois K E ∧ + ∀ σ τ : E ≃ₐ[K] E, σ * τ = τ * σ + +def IsAbelianElement (α : Ambient K) : Prop := + ∃ E : IntermediateField K (Ambient K), IsFiniteAbelian K E ∧ α ∈ E + +/-- Fixed values must be abelian, and their generated field must contain every +finite abelian extension. Containment allows taking subfields, as is necessary +even for the cyclotomic description over the rationals. This contract alone +does not say that the values are analytic, explicit, or effectively computable. -/ +def FixedValueCoverage (values : Set (Ambient K)) : Prop := + (∀ α ∈ values, IsAbelianElement K α) ∧ + ∀ E : IntermediateField K (Ambient K), IsFiniteAbelian K E → + E ≤ IntermediateField.adjoin K values + +/-- A deliberately too-permissive notion of analytic presentation. The missing +restriction is NOT replaced by an opaque admissibility axiom. -/ +structure LooseAnalyticPresentation (ι : Ambient K →+* ℂ) where + Parameter : Type + function : Parameter → ℂ → ℂ + argument : Parameter → ℂ + value : Parameter → Ambient K + analytic : ∀ p, Differentiable ℂ (function p) + evaluation : ∀ p, function p (argument p) = ι (value p) + +/-- A regression check, not a solution: naming all desired algebraic elements +as the allowed values makes the algebraic coverage contract automatic. -/ +theorem unrestrictedValues_cover : + FixedValueCoverage K {α | IsAbelianElement K α} := by + refine ⟨fun α h => h, ?_⟩ + intro E hE α hα + exact IntermediateField.subset_adjoin K _ ⟨E, hE, hα⟩ + +/-- Even requiring entire functions does not fix the problem: constants can +encode the unknown answers. A real Hilbert-12 candidate must exclude this +circular presentation by specifying its analytic family independently. -/ +def constantOraclePresentation (ι : Ambient K →+* ℂ) : + LooseAnalyticPresentation K ι where + Parameter := {α : Ambient K // IsAbelianElement K α} + function := fun p _ => ι p.val + argument := fun _ => 0 + value := Subtype.val + analytic := fun _ => differentiable_const _ + evaluation := fun _ => rfl + +theorem constantOracle_covers (ι : Ambient K →+* ℂ) : + FixedValueCoverage K (Set.range (constantOraclePresentation K ι).value) := by + have hr : Set.range (constantOraclePresentation K ι).value = + {α | IsAbelianElement K α} := by + ext α + constructor + · rintro ⟨p, rfl⟩ + exact p.property + · intro h + exact ⟨⟨α, h⟩, rfl⟩ + rw [hr] + exact unrestrictedValues_cover K + +end +end HilbertDrafts.Hilbert12 + +namespace HilbertDrafts.Hilbert12Stark + +open NumberField +open scoped NumberField Topology + +noncomputable section + +variable (K L : Type) [Field K] [NumberField K] [Field L] [NumberField L] + [Algebra K L] + +abbrev FinitePrime (K : Type) [Field K] := IsDedekindDomain.HeightOneSpectrum (𝓞 K) +abbrev Place (K : Type) [Field K] := FinitePrime K ⊕ InfinitePlace K +abbrev GaloisGroup := L ≃ₐ[K] L + +/-- Product-formula normalization: N(p)^(-ord_p), |.| at real places, +and |.|^2 at complex places. -/ +def placeAbs (w : Place L) (x : L) : ℝ := + match w with + | .inl p => NumberField.HeightOneSpectrum.adicAbv L p x + | .inr v => v x ^ v.mult + +/-- Restriction of places, expressed without selecting a prime above a prime. -/ +def LiesAbove (w : Place L) (v : Place K) : Prop := + match w, v with + | .inl P, .inl p => + P.asIdeal.comap (RingOfIntegers.mapRingHom (algebraMap K L)) = p.asIdeal + | .inr W, .inr V => W.comap (algebraMap K L) = V + | _, _ => False + +/-- For a finite Galois extension, trivial stabilizer of one place over v is +equivalent to complete splitting. -/ +def SplitsAt (v : Place K) (w : Place L) : Prop := + LiesAbove K L w v ∧ + ∀ σ : GaloisGroup K L, (∀ x : L, placeAbs L w (σ x) = placeAbs L w x) → σ = 1 + +def AdmissiblePlaces (S : Finset (Place K)) (v : Place K) (w : Place L) : Prop := + 2 ≤ S.card ∧ v ∈ S ∧ + (∀ V : InfinitePlace K, Sum.inr V ∈ S) ∧ + (∀ p : FinitePrime K, Sum.inl p ∉ S → + ∀ P : FinitePrime L, LiesAbove K L (.inl P) (.inl p) → + p.asIdeal.ramificationIdx' P.asIdeal = 1) ∧ + SplitsAt K L v w + +/-- The arithmetic Frobenius convention is x ↦ x^(N p) modulo every prime +above p. Multiplicativity fixes Artin symbols on ideals coprime to S. -/ +def IsArtinMap (S : Finset (Place K)) (A : Ideal (𝓞 K) → GaloisGroup K L) : Prop := + A ⊤ = 1 ∧ + (∀ I J, I ≠ ⊥ → J ≠ ⊥ → A (I * J) = A I * A J) ∧ + ∀ p : FinitePrime K, Sum.inl p ∉ S → + ∀ P : FinitePrime L, LiesAbove K L (.inl P) (.inl p) → ∀ x : 𝓞 L, + RingOfIntegers.mapRingHom (A p.asIdeal).toRingHom x - + x ^ Ideal.absNorm p.asIdeal ∈ P.asIdeal + +def CoprimeToS (S : Finset (Place K)) (I : Ideal (𝓞 K)) : Prop := + I ≠ ⊥ ∧ ∀ p : FinitePrime K, Sum.inl p ∈ S → ¬ I ≤ p.asIdeal + +/-- The convergent partial-zeta series, used only on Re(s)>1. -/ +def zetaTerm (S : Finset (Place K)) (A : Ideal (𝓞 K) → GaloisGroup K L) + (σ : GaloisGroup K L) (s : ℂ) (I : Ideal (𝓞 K)) : ℂ := by + classical + exact if CoprimeToS K S I ∧ A I = σ then (Ideal.absNorm I : ℂ) ^ (-s) else 0 + +/-- Analytic continuation is specified by agreement with a convergent series +on an open half-plane and holomorphy on the connected domain C \ {1}. +Existence is a conclusion of the closed target, not an assumed oracle. -/ +def IsPartialZeta (S : Finset (Place K)) (A : Ideal (𝓞 K) → GaloisGroup K L) + (Z : GaloisGroup K L → ℂ → ℂ) : Prop := + ∀ σ, DifferentiableOn ℂ (Z σ) ({1}ᶜ : Set ℂ) ∧ + ∀ s : ℂ, 1 < s.re → HasSum (zetaTerm K L S A σ s) (Z σ s) + +/-- The exact U_{v,S} condition, including the exceptional two-place case. -/ +def StarkUnitCondition (S : Finset (Place K)) (v : Place K) (u : L) : Prop := + u ≠ 0 ∧ + (∀ W : Place L, (¬ ∃ V ∈ S, LiesAbove K L W V) → placeAbs L W u = 1) ∧ + (3 ≤ S.card → ∀ W : Place L, ¬ LiesAbove K L W v → placeAbs L W u = 1) ∧ + (S.card = 2 → ∀ V ∈ S, V ≠ v → ∀ W₁ W₂ : Place L, + LiesAbove K L W₁ V → LiesAbove K L W₂ V → placeAbs L W₁ u = placeAbs L W₂ u) + +/-- Adjoining an e_L-th root must still give a finite abelian extension of K; +the copy of L is explicitly included in the generated field. -/ +def AbelianRootExtension (u : L) : Prop := + ∃ α : AlgebraicClosure L, + α ^ NumberField.Units.torsionOrder L = algebraMap L (AlgebraicClosure L) u ∧ + let E := IntermediateField.adjoin K + (Set.range (algebraMap L (AlgebraicClosure L)) ∪ {α}) + FiniteDimensional K E ∧ IsGalois K E ∧ + ∀ σ τ : E ≃ₐ[K] E, σ * τ = τ * σ + +/-- A complete closed proposition for the rank-one abelian Stark conjecture. +Known Artin-map/continuation existence is included to prevent empty-interface +vacuity. This is a statement to prove, not a theorem assumed by this file. -/ +def RankOneAbelianStark : Prop := + ∀ (K L : Type) [Field K] [NumberField K] [Field L] [NumberField L] + [Algebra K L] [FiniteDimensional K L] [IsGalois K L], + (∀ σ τ : L ≃ₐ[K] L, σ * τ = τ * σ) → + ∀ (S : Finset (Place K)) (v : Place K) (w : Place L), + AdmissiblePlaces K L S v w → + (∃ A : Ideal (𝓞 K) → GaloisGroup K L, IsArtinMap K L S A) ∧ + ∀ A : Ideal (𝓞 K) → GaloisGroup K L, IsArtinMap K L S A → + (∃ Z : GaloisGroup K L → ℂ → ℂ, IsPartialZeta K L S A Z) ∧ + ∀ Z : GaloisGroup K L → ℂ → ℂ, IsPartialZeta K L S A Z → + ∃ u : L, StarkUnitCondition K L S v u ∧ AbelianRootExtension K L u ∧ + ∀ σ : GaloisGroup K L, + HasDerivAt (Z σ) + ((-(Real.log (placeAbs L w (σ u))) / + (NumberField.Units.torsionOrder L : ℝ) : ℝ) : ℂ) 0 + +/-- The logarithmic denominator cannot vanish in a number field. -/ +theorem rootsOfUnity_order_pos : 0 < NumberField.Units.torsionOrder L := + NumberField.Units.torsionOrder_pos L + +omit [NumberField L] in +/-- The divergent zero-ideal term is never included. -/ +theorem zetaTerm_zeroIdeal (S : Finset (Place K)) + (A : Ideal (𝓞 K) → GaloisGroup K L) (σ : GaloisGroup K L) (s : ℂ) : + zetaTerm K L S A σ s ⊥ = 0 := by + simp [zetaTerm, CoprimeToS] + +omit [NumberField L] in +/-- The analytic continuation is fixed by its defining half-plane series. +Its values near zero cannot be independently chosen to encode desired units. -/ +theorem partialZeta_unique (S : Finset (Place K)) + (A : Ideal (𝓞 K) → GaloisGroup K L) + (Z₁ Z₂ : GaloisGroup K L → ℂ → ℂ) + (h₁ : IsPartialZeta K L S A Z₁) (h₂ : IsPartialZeta K L S A Z₂) + (σ : GaloisGroup K L) : Set.EqOn (Z₁ σ) (Z₂ σ) ({1}ᶜ : Set ℂ) := by + have hU : IsOpen ({1}ᶜ : Set ℂ) := isClosed_singleton.isOpen_compl + apply ((h₁ σ).1.analyticOnNhd hU).eqOn_of_preconnected_of_eventuallyEq + ((h₂ σ).1.analyticOnNhd hU) + (isConnected_compl_singleton_of_one_lt_rank (by simp) (1 : ℂ)).isPreconnected + (z₀ := (2 : ℂ)) (by norm_num) + have hn : ∀ᶠ s : ℂ in 𝓝 (2 : ℂ), 1 < s.re := + (isOpen_lt continuous_const Complex.continuous_re).mem_nhds (by norm_num) + filter_upwards [hn] with s hs + exact ((h₁ σ).2 s hs).unique ((h₂ σ).2 s hs) + +end +end HilbertDrafts.Hilbert12Stark + +namespace HilbertDrafts.Hilbert12Universal + +open HilbertDrafts.Hilbert12 + +noncomputable section + +/-- A fixed, countably indexed analytic family in finitely many complex +variables. Domains are open and the functions are analytic on them. This is +input to the problem, not an existentially chosen list of desired answers. -/ +structure AnalyticFamily where + arity : ℕ → ℕ + domain : (i : ℕ) → Set (Fin (arity i) → ℂ) + function : (i : ℕ) → (Fin (arity i) → ℂ) → ℂ + domain_open : ∀ i, IsOpen (domain i) + analytic : ∀ i, AnalyticOnNhd ℂ (function i) (domain i) + +/-- A countable list of evaluation instructions for a fixed analytic family. +No target extension, automorphism group, or desired generator is an argument. -/ +structure Parameters (F : AnalyticFamily) where + index : ℕ → ℕ + argument : (n : ℕ) → Fin (F.arity (index n)) → ℂ + in_domain : ∀ n, argument n ∈ F.domain (index n) + +def Parameters.evaluate {F : AnalyticFamily} (p : Parameters F) (n : ℕ) : ℂ := + F.function (p.index n) (p.argument n) + +/-- A proposed recipe must supply one analytic family and instructions from +only the base field and its complex realization. This structure does not by +itself certify that a recipe is explicit or historically appropriate. In +particular, arbitrary functions in a Lean structure can still hide an oracle. -/ +structure Recipe where + family : AnalyticFamily + parameters : (K : Type) → [Field K] → [NumberField K] → + (Ambient K →+* ℂ) → Parameters family + +variable (K : Type) [Field K] (ι : Ambient K →+* ℂ) + {F : AnalyticFamily} (p : Parameters F) + +/-- Algebraic preimages of the actual evaluations. Desired algebraic values +are not supplied as an extra, freely chosen field of the recipe. -/ +def specialValues : Set (Ambient K) := + {α | ∃ n : ℕ, p.evaluate n = ι α} + +/-- A finite stage adjoins only the evaluations with indices in s. -/ +def stage (s : Finset ℕ) : IntermediateField K (Ambient K) := + IntermediateField.adjoin K {α | ∃ n ∈ s, p.evaluate n = ι α} + +/-- The maximal abelian extension as a subfield of the chosen algebraic +closure, characterized by all of its finite abelian subextensions. -/ +def maximalAbelian : IntermediateField K (Ambient K) := + ⨆ E : IntermediateField K (Ambient K), ⨆ (_ : IsFiniteAbelian K E), E + +/-- The algebraic and analytic evaluation obligations for a specified recipe: +all evaluations are algebraic; every finite stage is abelian; every finite +abelian extension occurs in a finite stage. The last clause is deliberately +containment, since subfields are essential already in Kronecker--Weber. -/ +def GenerationContract : Prop := + (∀ n : ℕ, ∃ α : Ambient K, p.evaluate n = ι α) ∧ + (∀ s : Finset ℕ, IsFiniteAbelian K (stage K ι p s)) ∧ + ∀ E : IntermediateField K (Ambient K), IsFiniteAbelian K E → + ∃ s : Finset ℕ, E ≤ stage K ι p s + +/-- A source-derived generation contract for a FIXED proposed recipe. It ranges +over every number field and every embedding of its algebraic closure in C. +Existentially quantifying over Recipe alone would discard the essential +"explicit analogue" requirement and is intentionally not called Hilbert 12. -/ +def Hilbert12For (R : Recipe) : Prop := + ∀ (K : Type) [Field K] [NumberField K] (ι : Ambient K →+* ℂ), + GenerationContract K ι (R.parameters K ι) + +/-- Monotonicity: allowing more evaluation instructions cannot remove values. -/ +theorem stage_mono {s t : Finset ℕ} (h : s ⊆ t) : + stage K ι p s ≤ stage K ι p t := by + apply IntermediateField.adjoin.mono + rintro α ⟨n, hn, he⟩ + exact ⟨n, h hn, he⟩ + +theorem stage_le_generated (s : Finset ℕ) : + stage K ι p s ≤ IntermediateField.adjoin K (specialValues K ι p) := by + apply IntermediateField.adjoin.mono + rintro α ⟨n, _, he⟩ + exact ⟨n, he⟩ + +/-- Each evaluation has one algebraic preimage, since the complex embedding +is injective. This prevents unrelated algebraic labels for one special value. -/ +theorem evaluation_unique (n : ℕ) {α β : Ambient K} + (hα : p.evaluate n = ι α) (hβ : p.evaluate n = ι β) : α = β := + ι.injective (hα.symm.trans hβ) + +/-- The universal contract implies the earlier coverage contract, with actual +analytic evaluations rather than a supplied list of algebraic generators. -/ +theorem generation_implies_coverage (h : GenerationContract K ι p) : + FixedValueCoverage K (specialValues K ι p) := by + constructor + · rintro α ⟨n, he⟩ + refine ⟨stage K ι p {n}, h.2.1 {n}, ?_⟩ + exact IntermediateField.subset_adjoin K _ ⟨n, Finset.mem_singleton_self n, he⟩ + · intro E hE + obtain ⟨s, hs⟩ := h.2.2 E hE + exact hs.trans (stage_le_generated K ι p s) + +/-- A faithful recipe generates exactly K^ab, not a larger nonabelian field. -/ +theorem generated_eq_maximalAbelian (h : GenerationContract K ι p) : + IntermediateField.adjoin K (specialValues K ι p) = maximalAbelian K := by + apply le_antisymm + · apply IntermediateField.adjoin_le_iff.mpr + intro α hα + obtain ⟨E, hE, ha⟩ := (generation_implies_coverage K ι p h).1 α hα + have hle : E ≤ maximalAbelian K := le_iSup_of_le E (le_iSup_of_le hE le_rfl) + exact hle ha + · apply iSup_le + intro E + apply iSup_le + intro hE + exact (generation_implies_coverage K ι p h).2 E hE + +end +end HilbertDrafts.Hilbert12Universal + +namespace HilbertDrafts.Hilbert12Universal + +open HilbertDrafts.Hilbert12 + +noncomputable section + +/-- The normalized exponential accepts rational arguments. Repeating it in +the index does not introduce arbitrary functions or select target extensions. -/ +def exponentialFamily : AnalyticFamily where + arity := fun _ => 1 + domain := fun _ => Set.univ + function := fun _ z => Complex.exp (2 * (Real.pi : ℂ) * Complex.I * z 0) + domain_open := fun _ => isOpen_univ + analytic := fun _ z _ => by + have h : AnalyticAt ℂ (fun w : Fin 1 → ℂ => w 0) z := + (ContinuousLinearMap.proj (0 : Fin 1) : (Fin 1 → ℂ) →L[ℂ] ℂ).analyticAt z + exact (analyticAt_const.mul h).cexp + +/-- The instructions are explicit: exp(2πi/(n+1)). -/ +def cyclotomicParameters : Parameters exponentialFamily where + index := fun _ => 0 + argument := fun n _ => 1 / ((n + 1 : ℕ) : ℂ) + in_domain := fun _ => Set.mem_univ _ + +/-- A closed benchmark statement for the already known rational case. +It is a formulation, not a claim to have formalized a proof of Kronecker--Weber. -/ +def RationalBenchmark : Prop := + ∀ ι : Ambient ℚ →+* ℂ, GenerationContract ℚ ι cyclotomicParameters + +/-- Complex realizations exist for every base number field: universal +quantification over these embeddings is not an empty-interface loophole. -/ +theorem complex_embedding_exists (K : Type) [Field K] [NumberField K] : + Nonempty (Ambient K →+* ℂ) := by + have : Algebra.IsAlgebraic ℚ (Ambient K) := + Algebra.IsAlgebraic.trans ℚ K (Ambient K) + exact ⟨(IsAlgClosed.lift (R := ℚ) (S := Ambient K) (M := ℂ)).toRingHom⟩ + +/-- The benchmark really evaluates to primitive roots of the required order. -/ +theorem cyclotomic_evaluation_primitive (n : ℕ) : + IsPrimitiveRoot (cyclotomicParameters.evaluate n) (n + 1) := by + simpa [Parameters.evaluate, cyclotomicParameters, exponentialFamily, div_eq_mul_inv] using + Complex.isPrimitiveRoot_exp (n + 1) (Nat.succ_ne_zero n) + +/-- The family and every argument of the displayed sequence are fixed over Q. -/ +theorem cyclotomic_argument_rational (n : ℕ) : + ∃ q : ℚ, ∀ i, cyclotomicParameters.argument n i = (q : ℂ) := by + exact ⟨1 / ((n + 1 : ℕ) : ℚ), by simp [cyclotomicParameters]⟩ + +/-- All rational inputs, with no target-dependent selection rule. -/ +def rationalValues (ι : Ambient ℚ →+* ℂ) : Set (Ambient ℚ) := + {α | ∃ q : ℚ, Complex.exp (2 * (Real.pi : ℂ) * Complex.I * q) = ι α} + +/-- The all-rational-arguments version of the known benchmark. Every actual +evaluation must be algebraic and abelian, and their field covers all abelian +extensions. This is a theorem statement, not a proof of Kronecker--Weber. -/ +def RationalAllArguments : Prop := + ∀ ι : Ambient ℚ →+* ℂ, + (∀ q : ℚ, ∃ α : Ambient ℚ, + Complex.exp (2 * (Real.pi : ℂ) * Complex.I * q) = ι α) ∧ + FixedValueCoverage ℚ (rationalValues ι) + +end +end HilbertDrafts.Hilbert12Universal + +namespace HilbertDrafts.Hilbert12Arithmetic + +open HilbertDrafts.Hilbert12 NumberField +open scoped NumberField + +noncomputable section + +variable (K : Type) [Field K] [NumberField K] + +/-- Relative discriminant via determinants of trace pairings of integral +n-tuples, n = [E:K]. Taking the ideal generated by all such determinants avoids +assuming that the ring of integers has a global relative integral basis. +Only finite extensions are used in the arithmetic specification below. -/ +def relativeDiscriminant (E : IntermediateField K (Ambient K)) : Ideal (𝓞 K) := + Ideal.span {d : 𝓞 K | ∃ b : Fin (Module.finrank K E) → 𝓞 E, + (d : K) = Matrix.det (fun i j => Algebra.trace K E ((b i : E) * (b j : E)))} + +/-- The arithmetic fibre singled out in Hilbert's first clause: specified +relative degree, abelian automorphism group, and relative discriminant ideal. -/ +def HasArithmeticData (E : IntermediateField K (Ambient K)) + (n : ℕ) (G : Type) [CommGroup G] [Finite G] (D : Ideal (𝓞 K)) : Prop := + IsFiniteAbelian K E ∧ Module.finrank K E = n ∧ + Nonempty ((E ≃ₐ[K] E) ≃* G) ∧ relativeDiscriminant K E = D + +/-- Exact finite classification output for the prescribed arithmetic fibre. +This is an output contract. Merely asserting that such a finite set exists +is weaker than supplying an effective class-field construction. -/ +structure ArithmeticCatalogue (n : ℕ) (G : Type) [CommGroup G] [Finite G] + (D : Ideal (𝓞 K)) where + entries : Finset (IntermediateField K (Ambient K)) + exact : ∀ E, E ∈ entries ↔ HasArithmeticData K E n G D + +/-- The number and existence questions are both fixed by an exact catalogue. -/ +def ArithmeticCatalogue.count {n : ℕ} {G : Type} [CommGroup G] [Finite G] + {D : Ideal (𝓞 K)} (C : ArithmeticCatalogue K n G D) : ℕ := C.entries.card + +omit [NumberField K] in +theorem ArithmeticCatalogue.exists_iff_count_pos {n : ℕ} {G : Type} + [CommGroup G] [Finite G] {D : Ideal (𝓞 K)} (C : ArithmeticCatalogue K n G D) : + (∃ E, HasArithmeticData K E n G D) ↔ 0 < C.count := by + change (∃ E, HasArithmeticData K E n G D) ↔ 0 < C.entries.card + rw [Finset.card_pos] + constructor + · rintro ⟨E, hE⟩ + exact ⟨E, (C.exact E).mpr hE⟩ + · rintro ⟨E, hE⟩ + exact ⟨E, (C.exact E).mp hE⟩ + +omit [NumberField K] in +/-- Exact catalogues cannot disagree on the answer, even though they may be +constructed by different methods. Intermediate fields are actual subfields +of the fixed algebraic closure, rather than arbitrary presentation labels. -/ +theorem ArithmeticCatalogue.entries_unique {n : ℕ} {G : Type} + [CommGroup G] [Finite G] {D : Ideal (𝓞 K)} + (C₁ C₂ : ArithmeticCatalogue K n G D) : C₁.entries = C₂.entries := by + ext E + exact (C₁.exact E).trans (C₂.exact E).symm + +end +end HilbertDrafts.Hilbert12Arithmetic + +namespace HilbertDrafts.Hilbert12CM + +open HilbertDrafts.Hilbert12 +open scoped NumberField + +noncomputable section + +/-- Degree two with no real embedding. This concerns the base field alone. -/ +def ImaginaryQuadratic (K : Type) [Field K] [NumberField K] : Prop := + Module.finrank ℚ K = 2 ∧ ∀ _ : K →+* ℝ, False + +/-- The period lattice is exactly the image of the full ring of integers. +It is selected from the base field, independently of any target extension. -/ +def FullIntegerLattice (K : Type) [Field K] [NumberField K] + (ι : Ambient K →+* ℂ) (L : PeriodPair) : Prop := + (L.lattice : Set ℂ) = + Set.range (fun x : 𝓞 K => ι (algebraMap K (Ambient K) (x : K))) + +/-- The classical lattice discriminant, with the Weierstrass normalization +g₂=60G₄ and g₃=140G₆ already defined by convergent series in Mathlib. -/ +def discriminant (L : PeriodPair) : ℂ := L.g₂ ^ 3 - 27 * L.g₃ ^ 2 + +def jInvariant (L : PeriodPair) : ℂ := 1728 * L.g₂ ^ 3 / discriminant L + +/-- Silverman, Arithmetic of Elliptic Curves, second edition, C.11.5--11.6. +The two exceptional automorphism groups require powers two and three. +Only values away from the period lattice are used below. -/ +def weber (L : PeriodPair) (z : ℂ) : ℂ := by + classical + exact if L.g₃ = 0 then L.g₂ ^ 2 / discriminant L * L.weierstrassP z ^ 2 + else if L.g₂ = 0 then L.g₃ / discriminant L * L.weierstrassP z ^ 3 + else L.g₂ * L.g₃ / discriminant L * L.weierstrassP z + +/-- Nonidentity torsion classes in C/L, represented by complex numbers. +Excluding the lattice removes the pole at the identity; it cannot become a +spurious generator through Lean's totalized division at zero. -/ +def NonzeroTorsion (L : PeriodPair) (z : ℂ) : Prop := + z ∉ L.lattice ∧ ∃ n : ℕ, 0 < n ∧ (n : ℂ) * z ∈ L.lattice + +def complexValues (L : PeriodPair) : Set ℂ := + {jInvariant L} ∪ weber L '' {z | NonzeroTorsion L z} + +def algebraicValues (K : Type) [Field K] (ι : Ambient K →+* ℂ) + (L : PeriodPair) : Set (Ambient K) := ι ⁻¹' complexValues L + +/-- Closed specification of the corrected imaginary-quadratic benchmark. +Lattice existence, a nonzero discriminant, and algebraicity of every actual +evaluation are conclusions, followed by generation of all finite abelian +extensions. This specifies the known CM theorem; it does not prove it here +or identify it with the general all-number-fields Hilbert-12 problem. -/ +def ImaginaryQuadraticBenchmark : Prop := + ∀ (K : Type) [Field K] [NumberField K], ImaginaryQuadratic K → + ∀ ι : Ambient K →+* ℂ, + (∃ L : PeriodPair, FullIntegerLattice K ι L) ∧ + ∀ L : PeriodPair, FullIntegerLattice K ι L → + discriminant L ≠ 0 ∧ + (∀ z ∈ complexValues L, ∃ α : Ambient K, ι α = z) ∧ + FixedValueCoverage K (algebraicValues K ι L) + +/-- The chosen Weber function is analytic at every permitted evaluation. -/ +theorem weber_analyticAt (L : PeriodPair) (z : ℂ) (hz : z ∉ L.lattice) : + AnalyticAt ℂ (weber L) z := by + have hp := L.analyticOnNhd_weierstrassP z hz + unfold weber + split_ifs <;> fun_prop + +/-- Period translations give the same Weber value. -/ +theorem weber_add_period (L : PeriodPair) (z : ℂ) (l : L.lattice) : + weber L (z + l) = weber L z := by + unfold weber + rw [L.weierstrassP_add_coe] + +/-- There is a permitted torsion evaluation for every genuine period pair. -/ +theorem half_period_is_nonzero_torsion (L : PeriodPair) : + NonzeroTorsion L (L.ω₁ / 2) := by + refine ⟨L.ω₁_div_two_notMem_lattice, 2, by norm_num, ?_⟩ + convert L.ω₁_mem_lattice using 1 + push_cast + ring + +/-- The benchmark's coverage contract gives exactly K^ab. In particular it +cannot be satisfied by adjoining every algebraic number indiscriminately. -/ +theorem benchmark_generated_eq_maximalAbelian (h : ImaginaryQuadraticBenchmark) + (K : Type) [Field K] [NumberField K] (hK : ImaginaryQuadratic K) + (ι : Ambient K →+* ℂ) (L : PeriodPair) (hL : FullIntegerLattice K ι L) : + IntermediateField.adjoin K (algebraicValues K ι L) = + Hilbert12Universal.maximalAbelian K := by + have hc := ((h K hK ι).2 L hL).2.2 + apply le_antisymm + · apply IntermediateField.adjoin_le_iff.mpr + intro α hα + obtain ⟨E, hE, ha⟩ := hc.1 α hα + have hle : E ≤ Hilbert12Universal.maximalAbelian K := + le_iSup_of_le E (le_iSup_of_le hE le_rfl) + exact hle ha + · apply iSup_le + intro E + apply iSup_le + intro hE + exact hc.2 E hE + +end +end HilbertDrafts.Hilbert12CM + +namespace HilbertDrafts.Hilbert12Universal + +noncomputable section + +/-- A fixed, nonconstant entire function still does not prevent answer +encodings: arbitrary instructions can move every desired output into its input. -/ +def identityFamily : AnalyticFamily where + arity := fun _ => 1 + domain := fun _ => Set.univ + function := fun _ z => z 0 + domain_open := fun _ => isOpen_univ + analytic := fun _ z _ => + (ContinuousLinearMap.proj (0 : Fin 1) : (Fin 1 → ℂ) →L[ℂ] ℂ).analyticAt z + +def identityParameters {F : AnalyticFamily} (p : Parameters F) : + Parameters identityFamily where + index := fun _ => 0 + argument := fun n _ => p.evaluate n + in_domain := fun _ => Set.mem_univ _ + +def identityReencode (R : Recipe) : Recipe where + family := identityFamily + parameters := fun K _ _ ι => identityParameters (R.parameters K ι) + +/-- Checked trivialisation of the unrestricted interface: replacing every +analytic function by the identity and putting its outputs in the arguments +preserves the entire contract. This is not an impossibility theorem about +every conceivable restriction on recipes. -/ +theorem identity_reencoding_preserves_contract (R : Recipe) : + Hilbert12For (identityReencode R) ↔ Hilbert12For R := Iff.rfl + +end +end HilbertDrafts.Hilbert12Universal + +namespace HilbertDrafts.Hilbert12Universal + +open HilbertDrafts.Hilbert12 + +noncomputable section + +/-- The actual embedded base field; equivalent abstract presentations give +identical inputs to a field-attached recipe. -/ +def embeddedField (K : Type) [Field K] (ι : Ambient K →+* ℂ) : Subfield ℂ := + (ι.comp (algebraMap K (Ambient K))).fieldRange + +/-- Field-attached analytic data. Unlike the older global-family interface, +this allows different analytic families for different embedded base fields. +It is an interface for proposed recipes, not a sufficient explicitness test. -/ +structure FieldRecipe where + family : Subfield ℂ → AnalyticFamily + parameters : (F : Subfield ℂ) → Parameters (family F) + +def FieldHilbert12For (R : FieldRecipe) : Prop := + ∀ (K : Type) [Field K] [NumberField K] (ι : Ambient K →+* ℂ), + GenerationContract K ι (R.parameters (embeddedField K ι)) + +/-- All base-field points of the specified domain, with no selected subset. -/ +def RationalPoints (F : Subfield ℂ) {a : ℕ} (D : Set (Fin a → ℂ)) : Set (Fin a → ℂ) := + {x | x ∈ D ∧ ∀ j, x j ∈ F} + +/-- An optional profile matching RationalAllArguments. The analogous relation +to the CM benchmark is expected but not stated here. This is stronger than the +general source wording and still does not certify explicitness. -/ +def RationalPointContract (K : Type) [Field K] (ι : Ambient K →+* ℂ) + (F : AnalyticFamily) : Prop := + (∀ i, ∀ x ∈ RationalPoints (embeddedField K ι) (F.domain i), + ∃ α : Ambient K, IsAbelianElement K α ∧ ι α = F.function i x) ∧ + ∀ E : IntermediateField K (Ambient K), IsFiniteAbelian K E → + E ≤ IntermediateField.adjoin K + {α | ∃ i, ∃ x ∈ RationalPoints (embeddedField K ι) (F.domain i), + ι α = F.function i x} + +end +end HilbertDrafts.Hilbert12Universal + +namespace HilbertDrafts.Hilbert12ClassField + +open HilbertDrafts.Hilbert12 HilbertDrafts.Hilbert12Arithmetic NumberField +open scoped NumberField + +noncomputable section + +variable (K : Type) [Field K] [NumberField K] + +abbrev Prime := IsDedekindDomain.HeightOneSpectrum (𝓞 K) +abbrev Divisor := Prime K →₀ ℤ + +/-- A finite modulus and a set of real embeddings at which positivity is +required. Complex places do not occur in the infinite part of a modulus. -/ +structure Modulus where + exponent : Prime K →₀ ℕ + realPlaces : Finset (K →+* ℝ) + +def Modulus.Divides (m n : Modulus K) : Prop := + (∀ p, m.exponent p ≤ n.exponent p) ∧ m.realPlaces ⊆ n.realPlaces + +/-- The group of fractional ideals coprime to the finite modulus, represented +canonically by their finite prime-exponent divisors. -/ +def divisorsAway (m : Modulus K) : AddSubgroup (Divisor K) where + carrier := {D | ∀ p, m.exponent p ≠ 0 → D p = 0} + zero_mem' := by simp + add_mem' := by + intro D E hD hE p hp + simp [hD p hp, hE p hp] + neg_mem' := by + intro D hD p hp + simp [hD p hp] + +/-- The principal divisor is pinned by all normalized finite-place absolute +values. Finite support is part of the divisor type, not an implicit oracle. -/ +def IsPrincipalDivisor (x : K) (D : Divisor K) : Prop := + x ≠ 0 ∧ ∀ p : Prime K, + NumberField.HeightOneSpectrum.adicAbv K p x = + (Ideal.absNorm p.asIdeal : ℝ) ^ (-(D p)) + +def CongruentOne (m : Modulus K) (x : K) : Prop := + (∀ p : Prime K, m.exponent p ≠ 0 → + NumberField.HeightOneSpectrum.adicAbv K p (x - 1) ≤ + (Ideal.absNorm p.asIdeal : ℝ) ^ (-(m.exponent p : ℤ))) ∧ + ∀ σ ∈ m.realPlaces, 0 < σ x + +/-- Principal ray relations; additive subgroup closure is explicit. -/ +def principalRay (m : Modulus K) : AddSubgroup (divisorsAway K m) := + AddSubgroup.closure {D | ∃ x : K, IsPrincipalDivisor K x D.val ∧ CongruentOne K m x} + +abbrev RayClass (m : Modulus K) := divisorsAway K m ⧸ principalRay K m + +def primeDivisor (m : Modulus K) (p : Prime K) (hp : m.exponent p = 0) : + divisorsAway K m := + ⟨Finsupp.single p 1, by + intro q hq + by_cases h : p = q + · subst q + exact (hq hp).elim + · simp [h]⟩ + +def primeClass (m : Modulus K) (p : Prime K) (hp : m.exponent p = 0) : RayClass K m := + QuotientAddGroup.mk' (principalRay K m) (primeDivisor K m p hp) + +/-- Arithmetic Frobenius at an unramified prime, with the base-field norm. -/ +def FrobeniusAt (E : IntermediateField K (Ambient K)) (p : Prime K) + (σ : E ≃ₐ[K] E) : Prop := + ∀ P : IsDedekindDomain.HeightOneSpectrum (𝓞 E), + P.asIdeal.comap (RingOfIntegers.mapRingHom (algebraMap K E)) = p.asIdeal → + p.asIdeal.ramificationIdx' P.asIdeal = 1 ∧ + ∀ x : 𝓞 E, RingOfIntegers.mapRingHom σ.toRingHom x - + x ^ Ideal.absNorm p.asIdeal ∈ P.asIdeal + +/-- Real places absent from the modulus must remain real in the extension. -/ +def UnramifiedAtRealPlaces (m : Modulus K) (E : IntermediateField K (Ambient K)) : Prop := + ∀ σ : K →+* ℝ, σ ∉ m.realPlaces → ∀ τ : E →+* ℂ, + τ.comp (algebraMap K E) = Complex.ofRealHom.comp σ → ∀ x, (τ x).im = 0 + +/-- The class field of a subgroup is defined by a surjective Artin map with +that exact kernel, and its specified Frobenius values. No field is chosen +from an unexplained class-field oracle. -/ +def IsClassField (m : Modulus K) (H : AddSubgroup (RayClass K m)) + (E : IntermediateField K (Ambient K)) : Prop := + IsFiniteAbelian K E ∧ UnramifiedAtRealPlaces K m E ∧ + ∃ A : RayClass K m →+ Additive (E ≃ₐ[K] E), + Function.Surjective A ∧ A.ker = H ∧ + ∀ (p : Prime K) (hp : m.exponent p = 0), + FrobeniusAt K E p (Additive.toMul (A (primeClass K m p hp))) + +/-- Artin reciprocity and the existence theorem, including all finite abelian +extensions and the order-reversing subgroup/field correspondence. This is +known class field theory stated as an arithmetic obligation, not proved here. -/ +def ClassFieldClassification : Prop := + ∀ (K : Type) [Field K] [NumberField K], + (∀ m : Modulus K, Finite (RayClass K m)) ∧ + (∀ (m : Modulus K) (H : AddSubgroup (RayClass K m)), + ∃! E : IntermediateField K (Ambient K), IsClassField K m H E) ∧ + (∀ E : IntermediateField K (Ambient K), IsFiniteAbelian K E → + ∃ (m : Modulus K) (H : AddSubgroup (RayClass K m)), IsClassField K m H E) ∧ + ∀ (m : Modulus K) (H J : AddSubgroup (RayClass K m)) + (E F : IntermediateField K (Ambient K)), + IsClassField K m H E → IsClassField K m J F → (H ≤ J ↔ F ≤ E) + +/-- The least ray modulus for the specified extension, including real signs. -/ +def IsConductor (E : IntermediateField K (Ambient K)) (m : Modulus K) : Prop := + (∃ H, IsClassField K m H E) ∧ + ∀ (n : Modulus K) (H : AddSubgroup (RayClass K n)), + IsClassField K n H E → m.Divides K n + +def finiteModulusIdeal (m : Modulus K) : Ideal (𝓞 K) := + m.exponent.support.prod (fun p => p.asIdeal ^ m.exponent p) + +abbrev Character (E : IntermediateField K (Ambient K)) := (E ≃ₐ[K] E) →* ℂˣ + +/-- The character field is the fixed field of its kernel, embedded back into +our common algebraic closure. Its conductor is the character conductor. -/ +def characterField (E : IntermediateField K (Ambient K)) (χ : Character K E) : + IntermediateField K (Ambient K) := + (IntermediateField.fixedField χ.ker).map E.val + +/-- Existence of least conductors and the conductor-discriminant formula. +The finite list must contain EVERY character, preventing an empty-product +encoding of the discriminant. Infinite conductor factors are correctly +omitted from the ideal discriminant. -/ +def ConductorDiscriminant : Prop := + ∀ (K : Type) [Field K] [NumberField K] + (E : IntermediateField K (Ambient K)), IsFiniteAbelian K E → + (∃! m : Modulus K, IsConductor K E m) ∧ + ∃ (characters : Finset (Character K E)) (conductors : Character K E → Modulus K), + (∀ χ : Character K E, χ ∈ characters) ∧ + (∀ χ, IsConductor K (characterField K E χ) (conductors χ)) ∧ + relativeDiscriminant K E = + ∏ χ ∈ characters, finiteModulusIdeal K (conductors χ) + +end +end HilbertDrafts.Hilbert12ClassField + +namespace HilbertDrafts.Hilbert12ClassField + +open HilbertDrafts.Hilbert12 HilbertDrafts.Hilbert12Arithmetic +open scoped NumberField + +noncomputable section + +/-- The arithmetic task asks for the actual exact catalogues, alongside the +reciprocity and conductor-discriminant theorems that organize them. It is an +output type; no algorithm or numerical classification is claimed supplied. -/ +structure ArithmeticOutput where + reciprocity : ClassFieldClassification + conductor_discriminant : ConductorDiscriminant + catalogue : (K : Type) → [Field K] → [NumberField K] → + (n : ℕ) → (G : Type) → [CommGroup G] → [Finite G] → + (D : Ideal (𝓞 K)) → ArithmeticCatalogue K n G D + +/-- The explicit cyclotomic action, including its Frobenius normalization. +The generator is the actual preimage of exp(2πi/n); automorphisms act by +coprime powers. This is a classical theorem obligation. -/ +def CyclotomicReciprocity : Prop := + ∀ (ι : Ambient ℚ →+* ℂ) (n : ℕ), 0 < n → ∀ ζ : Ambient ℚ, + ι ζ = Complex.exp (2 * (Real.pi : ℂ) * Complex.I / (n : ℂ)) → + let E := IntermediateField.adjoin ℚ ({ζ} : Set (Ambient ℚ)) + let z : E := ⟨ζ, IntermediateField.subset_adjoin ℚ _ (Set.mem_singleton ζ)⟩ + IsFiniteAbelian ℚ E ∧ + (∀ a : ℕ, Nat.Coprime a n → ∃! σ : E ≃ₐ[ℚ] E, (σ z : Ambient ℚ) = ζ ^ a) ∧ + (∀ σ : E ≃ₐ[ℚ] E, ∃ a : ℕ, a < n ∧ Nat.Coprime a n ∧ + (σ z : Ambient ℚ) = ζ ^ a) ∧ + ∀ (p : ℕ), p.Prime → ¬ p ∣ n → ∀ σ : E ≃ₐ[ℚ] E, + (σ z : Ambient ℚ) = ζ ^ p → ∀ P : Prime ℚ, + P.asIdeal = Ideal.span ({(p : 𝓞 ℚ)} : Set (𝓞 ℚ)) → FrobeniusAt ℚ E P σ + +end +end HilbertDrafts.Hilbert12ClassField diff --git a/HilbertDrafts/Hilbert12Lambda.lean b/HilbertDrafts/Hilbert12Lambda.lean new file mode 100644 index 0000000..8d2a11c --- /dev/null +++ b/HilbertDrafts/Hilbert12Lambda.lean @@ -0,0 +1,169 @@ +import HilbertDrafts.Hilbert12 + +/-! +Hilbert 12: a closed general statement using the explicitness criterion of +Borger and de Smit, "Explicit class field theory and the algebraic geometry of +Λ-rings" (arXiv:1809.02295, an unrefereed preprint). Their abstract describes +the framework as "allowing for some precise questions in the spirit of +Hilbert's 12th Problem". It is algebraic-geometric rather than Hilbert's +analytic formulation, and it is not the only modern reading of the problem. + +A Λ-structure on a flat separated scheme of finite type over the ring of +integers of a number field is a family of commuting endomorphisms, one for each +prime, each reducing to the Frobenius map on the fibre over its prime. The +periodic points of such a scheme generate abelian extensions (their Theorem +8.4). The maximal abelian extension is called Λ-geometric when one such scheme +generates all of it (their Section 12.1). The multiplicative group with its +power maps does this for the rational numbers. The Lattès scheme of complex +multiplication does it for imaginary quadratic fields; that case rests on +Gurney's thesis (arXiv:1710.08674). + +* `BorgerDeSmitQuestion4` is their Question 4: some number field other than the + rational numbers and the imaginary quadratic fields has a Λ-geometric maximal + abelian extension. +* `Hilbert12LambdaGeometric` asserts the property for every number field. This + universal form is not posed in the paper; it is the reading of Hilbert's + request for all number fields within their framework. + +Finite type is the explicitness requirement: without it the ray class algebras +themselves would qualify. Neither statement is known in either direction, and +the authors state no expectation. One number field with no such scheme would +refute the universal form. Neither statement is assumed or proved here. +-/ + +namespace HilbertDrafts.Hilbert12Lambda + +open HilbertDrafts.Hilbert12 NumberField AlgebraicGeometry CategoryTheory +open scoped NumberField + +noncomputable section + +variable (K : Type) [Field K] [NumberField K] + +/-- The maximal ideals of the ring of integers. -/ +abbrev Prime := IsDedekindDomain.HeightOneSpectrum (𝓞 K) + +/-- The spectrum of the ring of integers. -/ +abbrev Base : Scheme.{0} := Spec (CommRingCat.of (𝓞 K)) + +/-- A flat separated scheme of finite type over the ring of integers. Finite +type means locally of finite type and quasi-compact, so an infinite disjoint +union is excluded. -/ +structure IntegralScheme where + X : Scheme.{0} + toBase : X ⟶ Base K + flat : Flat toBase + separated : IsSeparated toBase + locallyOfFiniteType : LocallyOfFiniteType toBase + quasiCompact : QuasiCompact toBase + +variable {K} + +/-- An integer, viewed as a regular function on an open subset. -/ +def IntegralScheme.scalar (M : IntegralScheme K) (V : M.X.Opens) : 𝓞 K →+* Γ(M.X, V) := + (M.toBase.appLE ⊤ V le_top).hom.comp (Scheme.ΓSpecIso (CommRingCat.of (𝓞 K))).inv.hom + +/-- The fibre over a prime: the points at which every element of the prime vanishes. -/ +def IntegralScheme.OverPrime (M : IntegralScheme K) (p : Prime K) (x : M.X) : Prop := + ∀ r ∈ p.asIdeal, x ∉ M.X.basicOpen (M.scalar ⊤ r) + +/-- A Frobenius lift at `p`: an endomorphism over the base whose restriction to +the fibre over `p` is the Frobenius map `s ↦ s ^ N(p)`. It fixes every point of +the fibre, and on every affine open `V` inside `U` and inside the preimage of +`U` it agrees with the `N(p)`-th power modulo `p`. Away from the fibre the +congruence is empty, because `p` generates the unit ideal there. -/ +def IntegralScheme.IsFrobeniusLift (M : IntegralScheme K) (p : Prime K) + (ψ : M.X ⟶ M.X) : Prop := + ψ ≫ M.toBase = M.toBase ∧ + (∀ x : M.X, M.OverPrime p x → ψ.base x = x) ∧ + ∀ (U V : M.X.Opens) (hU : V ≤ U) (hψ : V ≤ ψ ⁻¹ᵁ U), IsAffineOpen V → + ∀ s : Γ(M.X, U), + (ψ.appLE U V hψ).hom s - + (M.X.presheaf.map (homOfLE hU).op).hom s ^ Ideal.absNorm p.asIdeal ∈ + Ideal.map (M.scalar V) p.asIdeal + +/-- A Λ-structure: commuting Frobenius lifts at all primes. -/ +structure LambdaStructure (M : IntegralScheme K) where + psi : Prime K → (M.X ⟶ M.X) + frobenius : ∀ p, M.IsFrobeniusLift p (psi p) + commute : ∀ p q, psi p ≫ psi q = psi q ≫ psi p + +/-- The operator of an ideal, written as a list of its prime factors. The +operators commute, so the order of the list does not matter. -/ +def LambdaStructure.psiList {M : IntegralScheme K} (Λ : LambdaStructure M) : + List (Prime K) → (M.X ⟶ M.X) + | [] => 𝟙 M.X + | p :: L => Λ.psi p ≫ Λ.psiList L + +/-- The ideal with a given list of prime factors. The empty list gives the unit ideal. -/ +def idealOfList (L : List (Prime K)) : Ideal (𝓞 K) := (L.map (·.asIdeal)).prod + +variable (K) in +/-- A cycle: a nonzero ideal together with a set of real places. -/ +structure Cycle where + finite : Ideal (𝓞 K) + finite_ne_bot : finite ≠ ⊥ + real : Finset (K →+* ℝ) + +/-- Equivalence of ideals modulo a cycle, in the form of Proposition 4.3 of +Borger and de Smit: `a = x b` for some `x` in `1 + f b⁻¹` that is positive at +the real places of the cycle. The classes form the ray class monoid of Deligne +and Ribet. -/ +def Cycle.Equivalent (f : Cycle K) (a b : Ideal (𝓞 K)) : Prop := + ∃ x : K, (∀ σ ∈ f.real, 0 < σ x) ∧ + (∀ α : K, (∃ a' ∈ a, (a' : K) = α) ↔ ∃ b' ∈ b, x * (b' : K) = α) ∧ + ∀ b' ∈ b, ∃ c ∈ f.finite, (c : K) = (x - 1) * (b' : K) + +/-- A point with coordinates in the algebraic closure, lying over the generic point. -/ +abbrev GeometricPoint (M : IntegralScheme K) := + {P : Spec (CommRingCat.of (Ambient K)) ⟶ M.X // + P ≫ M.toBase = Spec.map (CommRingCat.ofHom + ((algebraMap K (Ambient K)).comp (algebraMap (𝓞 K) K)))} + +/-- A point is periodic for a cycle when equivalent ideals act on it equally. -/ +def IsPeriodic {M : IntegralScheme K} (Λ : LambdaStructure M) (f : Cycle K) + (P : GeometricPoint M) : Prop := + ∀ L₁ L₂ : List (Prime K), f.Equivalent (idealOfList L₁) (idealOfList L₂) → + P.1 ≫ Λ.psiList L₁ = P.1 ≫ Λ.psiList L₂ + +/-- The value at a geometric point of a regular function defined near its image. -/ +def value {M : IntegralScheme K} (P : GeometricPoint M) (U : M.X.Opens) + (h : ⊤ ≤ P.1 ⁻¹ᵁ U) (s : Γ(M.X, U)) : Ambient K := + (Scheme.ΓSpecIso (CommRingCat.of (Ambient K))).hom.hom ((P.1.appLE U ⊤ h).hom s) + +/-- The coordinates of the periodic points, for all cycles. They generate the +field written `K(X)` by Borger and de Smit. -/ +def periodicValues {M : IntegralScheme K} (Λ : LambdaStructure M) : Set (Ambient K) := + {α | ∃ (f : Cycle K) (P : GeometricPoint M), IsPeriodic Λ f P ∧ + ∃ (U : M.X.Opens) (h : ⊤ ≤ P.1 ⁻¹ᵁ U) (s : Γ(M.X, U)), value P U h s = α} + +variable (K) in +/-- The maximal abelian extension is Λ-geometric: one flat separated scheme of +finite type with a Λ-structure has periodic points whose coordinates are +abelian over the field and generate every finite abelian extension. By Theorem +8.4(2) and Proposition 7.3 of Borger and de Smit the coordinates of periodic +points are always abelian; the clause is kept so that the statement checks +itself, and it does not change the question. -/ +def LambdaGeometric : Prop := + ∃ (M : IntegralScheme K) (Λ : LambdaStructure M), FixedValueCoverage K (periodicValues Λ) + +/-- Hilbert 12 in the Λ-geometric form: for every number field, the maximal +abelian extension is generated by the periodic points of one flat separated +scheme of finite type with a Λ-structure over its ring of integers. This is the +universal form of Question 4 of Borger and de Smit. -/ +def Hilbert12LambdaGeometric : Prop := + ∀ (K : Type) [Field K] [NumberField K], LambdaGeometric K + +/-- Question 4 of Borger and de Smit: "Are there number fields other than Q and +imaginary quadratic fields for which the maximal abelian extension is +Λ-geometric?" The proposition is the affirmative answer. A number field of +degree one is the rational field, and an imaginary quadratic field has degree +two and no real embedding. -/ +def BorgerDeSmitQuestion4 : Prop := + ∃ (K : Type) (_ : Field K) (_ : NumberField K), + Module.finrank ℚ K ≠ 1 ∧ ¬ (Module.finrank ℚ K = 2 ∧ IsEmpty (K →+* ℝ)) ∧ + LambdaGeometric K + +end + +end HilbertDrafts.Hilbert12Lambda diff --git a/HilbertDrafts/Hilbert12LambdaChecks.lean b/HilbertDrafts/Hilbert12LambdaChecks.lean new file mode 100644 index 0000000..0b3e7c2 --- /dev/null +++ b/HilbertDrafts/Hilbert12LambdaChecks.lean @@ -0,0 +1,234 @@ +import HilbertDrafts.Hilbert12Lambda + +/-! +Machine-checked consistency checks for the Λ-geometric form of Hilbert 12. +They show that the definitions behave as intended. They are not progress on +the question itself. +-/ + +namespace HilbertDrafts.Hilbert12LambdaChecks + +open HilbertDrafts.Hilbert12 HilbertDrafts.Hilbert12Lambda NumberField AlgebraicGeometry + CategoryTheory +open scoped NumberField + +noncomputable section + +variable {K : Type} [Field K] [NumberField K] + +omit [NumberField K] in +/-- The empty list of primes gives the unit ideal. -/ +theorem idealOfList_nil : idealOfList ([] : List (Prime K)) = ⊤ := by + simp [idealOfList, Ideal.one_eq_top] + +omit [NumberField K] in +/-- Concatenating lists multiplies ideals. -/ +theorem idealOfList_append (L₁ L₂ : List (Prime K)) : + idealOfList (L₁ ++ L₂) = idealOfList L₁ * idealOfList L₂ := by + simp [idealOfList, List.map_append, List.prod_append] + +/-- Concatenating lists composes the operators. -/ +theorem psiList_append {M : IntegralScheme K} (Λ : LambdaStructure M) + (L₁ L₂ : List (Prime K)) : + Λ.psiList (L₁ ++ L₂) = Λ.psiList L₁ ≫ Λ.psiList L₂ := by + induction L₁ with + | nil => simp [LambdaStructure.psiList] + | cons p L ih => simp [LambdaStructure.psiList, ih, Category.assoc] + +/-- The operator of an ideal does not depend on the order of its prime factors. -/ +theorem psiList_perm {M : IntegralScheme K} (Λ : LambdaStructure M) + {L₁ L₂ : List (Prime K)} (h : L₁.Perm L₂) : Λ.psiList L₁ = Λ.psiList L₂ := by + induction h with + | nil => rfl + | cons p _ ih => simp only [LambdaStructure.psiList, ih] + | swap p q L => + simp only [LambdaStructure.psiList] + rw [← Category.assoc, ← Category.assoc, Λ.commute] + | trans _ _ ih₁ ih₂ => exact ih₁.trans ih₂ + +-- `Cycle` also names Mathlib's cyclic lists at the root; make the bare name mean the +-- cycle of `Hilbert12Lambda` inside this namespace. +export HilbertDrafts.Hilbert12Lambda (Cycle) + +omit [NumberField K] in +/-- Every ideal is equivalent to itself modulo every cycle. -/ +theorem equivalent_refl (f : Cycle K) (a : Ideal (𝓞 K)) : f.Equivalent a a := by + refine ⟨1, ?_, ?_, ?_⟩ + · intro σ _ + simp + · intro α + simp + · intro b' _ + exact ⟨0, f.finite.zero_mem, by simp⟩ + +/-- On an affine scheme a Frobenius lift satisfies the ring-level congruence +`ψ(s) ≡ s ^ N(p)` modulo `p` on global functions. The scheme-level condition is +therefore at least as strong as the algebraic definition of Borger and de Smit. -/ +theorem frobeniusLift_global {M : IntegralScheme K} {p : Prime K} {ψ : M.X ⟶ M.X} + (hX : IsAffineOpen (⊤ : M.X.Opens)) (h : M.IsFrobeniusLift p ψ) (s : Γ(M.X, ⊤)) : + (ψ.appLE ⊤ ⊤ le_top).hom s - s ^ Ideal.absNorm p.asIdeal ∈ + Ideal.map (M.scalar ⊤) p.asIdeal := by + have key := h.2.2 ⊤ ⊤ le_rfl le_top hX s + have hid : (M.X.presheaf.map (homOfLE (le_refl (⊤ : M.X.Opens))).op).hom s = s := by + have : (homOfLE (le_refl (⊤ : M.X.Opens))) = 𝟙 _ := rfl + rw [this, op_id, CategoryTheory.Functor.map_id] + rfl + rw [hid] at key + exact key + +/-- The class of schemes is not empty: the base itself is flat, separated and +of finite type over itself. -/ +def baseScheme (K : Type) [Field K] [NumberField K] : IntegralScheme K where + X := Base K + toBase := 𝟙 _ + flat := inferInstance + separated := inferInstance + locallyOfFiniteType := inferInstance + quasiCompact := inferInstance + +/-- The identity morphism acts on functions by restriction. -/ +theorem id_appLE (X : Scheme) (U V : X.Opens) (hU : V ≤ U) (hψ : V ≤ (𝟙 X) ⁻¹ᵁ U) + (s : Γ(X, U)) : + (Scheme.Hom.appLE (𝟙 X) U V hψ).hom s = (X.presheaf.map (homOfLE hU).op).hom s := + congrArg (fun f : Γ(X, U) ⟶ Γ(X, V) => f.hom s) + (Category.id_comp (X.presheaf.map (homOfLE hU).op)) + +/-- The identity morphism acts as the identity on global functions. -/ +theorem id_appLE_top (X : Scheme) (s : Γ(X, ⊤)) : + (Scheme.Hom.appLE (𝟙 X) ⊤ ⊤ le_top).hom s = s := by + simp [Scheme.Hom.appLE] + +/-- The affine line over the ring of integers. -/ +def affineLine (K : Type) [Field K] [NumberField K] : IntegralScheme K where + X := Spec (CommRingCat.of (Polynomial (𝓞 K))) + toBase := Spec.map (CommRingCat.ofHom (Polynomial.C : 𝓞 K →+* Polynomial (𝓞 K))) + flat := by + rw [Flat.SpecMap_iff, CommRingCat.hom_ofHom, ← Polynomial.algebraMap_eq, + RingHom.flat_algebraMap_iff] + infer_instance + separated := inferInstance + locallyOfFiniteType := by + rw [HasRingHomProperty.Spec_iff (P := @LocallyOfFiniteType), CommRingCat.hom_ofHom, + ← Polynomial.algebraMap_eq, RingHom.finiteType_algebraMap] + infer_instance + quasiCompact := inferInstance + +/-- Global functions on the affine line are polynomials, and the integers among +them are the constant polynomials. -/ +theorem affineLine_coordinates : + ∃ φ : Γ((affineLine K).X, ⊤) →+* Polynomial (𝓞 K), + Function.Surjective φ ∧ φ.comp ((affineLine K).scalar ⊤) = Polynomial.C := by + refine ⟨(Scheme.ΓSpecIso (CommRingCat.of (Polynomial (𝓞 K)))).hom.hom, ?_, ?_⟩ + · intro f + exact ⟨(Scheme.ΓSpecIso (CommRingCat.of (Polynomial (𝓞 K)))).inv.hom f, + Iso.inv_hom_id_apply (Scheme.ΓSpecIso (CommRingCat.of (Polynomial (𝓞 K)))) f⟩ + · have h := Scheme.ΓSpecIso_naturality + (CommRingCat.ofHom (Polynomial.C : 𝓞 K →+* Polynomial (𝓞 K))) + have h2 : (Scheme.ΓSpecIso (CommRingCat.of (𝓞 K))).inv ≫ + (Spec.map (CommRingCat.ofHom (Polynomial.C : 𝓞 K →+* Polynomial (𝓞 K)))).appTop ≫ + (Scheme.ΓSpecIso (CommRingCat.of (Polynomial (𝓞 K)))).hom = + CommRingCat.ofHom (Polynomial.C : 𝓞 K →+* Polynomial (𝓞 K)) := by + rw [h, Iso.inv_hom_id_assoc] + exact congrArg CommRingCat.Hom.hom h2 + +/-- The identity is not a Frobenius lift on the affine line: the congruence +`x ≡ x ^ N(p)` fails. The Frobenius condition is therefore not vacuous. -/ +theorem id_not_frobeniusLift_affineLine (p : Prime K) : + ¬ (affineLine K).IsFrobeniusLift p (𝟙 _) := by + intro h + obtain ⟨φ, hφ, hC⟩ := affineLine_coordinates (K := K) + obtain ⟨x, hx⟩ := hφ Polynomial.X + have hX : IsAffineOpen (⊤ : (affineLine K).X.Opens) := + isAffineOpen_top (Spec (CommRingCat.of (Polynomial (𝓞 K)))) + have key := frobeniusLift_global hX h x + rw [id_appLE_top] at key + have key2 := Ideal.mem_map_of_mem φ key + rw [Ideal.map_map, hC, map_sub, map_pow, hx, Ideal.mem_map_C_iff] at key2 + have hN : Ideal.absNorm p.asIdeal ≠ 1 := by + rw [Ne, Ideal.absNorm_eq_one_iff] + exact p.isPrime.ne_top + have h1 : (1 : 𝓞 K) ∈ p.asIdeal := by + simpa [Polynomial.coeff_X_pow, Ne.symm hN] using key2 1 + exact p.isPrime.ne_top ((Ideal.eq_top_iff_one _).mpr h1) + +/-- If `r ≡ r ^ N` modulo `I` for every `r`, the same congruence holds for every +fraction `r / u`, modulo the ideal generated by `I`. -/ +theorem sub_pow_mem_map_of_fraction {R S : Type*} [CommRing R] [CommRing S] (f : R →+* S) + (I : Ideal R) (N : ℕ) (hN : ∀ r : R, r - r ^ N ∈ I) (z : S) + (hz : ∃ r u : R, IsUnit (f u) ∧ z * f u = f r) : z - z ^ N ∈ Ideal.map f I := by + obtain ⟨r, u, hu, h⟩ := hz + have hmem : (r - r ^ N) * u - r * (u - u ^ N) ∈ I := + I.sub_mem (I.mul_mem_right _ (hN r)) (I.mul_mem_left _ (hN u)) + have key : (z - z ^ N) * f u ^ (N + 1) = f ((r - r ^ N) * u - r * (u - u ^ N)) := by + simp only [map_sub, map_mul, map_pow, ← h] + ring + have hmem' := Ideal.mem_map_of_mem f hmem + rw [← key] at hmem' + exact (Ideal.mul_unit_mem_iff_mem _ (hu.pow (N + 1))).mp hmem' + +/-- Fermat's congruence in the ring of integers: `r ≡ r ^ N(p)` modulo `p`. -/ +theorem sub_pow_absNorm_mem (p : Prime K) (r : 𝓞 K) : + r - r ^ Ideal.absNorm p.asIdeal ∈ p.asIdeal := by + have : p.asIdeal.IsMaximal := p.isMaximal + let : Field (𝓞 K ⧸ p.asIdeal) := Ideal.Quotient.field p.asIdeal + have : Finite (𝓞 K ⧸ p.asIdeal) := Ideal.finiteQuotientOfFreeOfNeBot p.asIdeal p.ne_bot + let := Fintype.ofFinite (𝓞 K ⧸ p.asIdeal) + rw [← Ideal.Quotient.eq_zero_iff_mem, map_sub, map_pow, Ideal.absNorm_apply, + Submodule.cardQuot_apply, Nat.card_eq_fintype_card, FiniteField.pow_card, sub_self] + +/-- Every germ of a regular function on the spectrum of a ring is a fraction of +ring elements. -/ +theorem stalk_fraction (R : Type) [CommRing R] (x : PrimeSpectrum R) + (z : (structurePresheafInCommRingCat R).stalk x) : + ∃ r u : R, IsUnit ((StructureSheaf.toStalk R x).hom u) ∧ + z * (StructureSheaf.toStalk R x).hom u = (StructureSheaf.toStalk R x).hom r := by + obtain ⟨⟨r, u⟩, h⟩ := IsLocalization.surj x.asIdeal.primeCompl z + exact ⟨r, u, IsLocalization.map_units _ u, h⟩ + +/-- On every affine open of the spectrum of a ring, a congruence `r ≡ r ^ N` +modulo `I` valid for all ring elements is valid for all regular functions. -/ +theorem spec_sub_pow_mem (R : Type) [CommRing R] (I : Ideal R) (N : ℕ) + (hN : ∀ r : R, r - r ^ N ∈ I) (V : (Spec (CommRingCat.of R)).Opens) (hV : IsAffineOpen V) + (t : Γ(Spec (CommRingCat.of R), V)) : + t - t ^ N ∈ Ideal.map + (((Scheme.Hom.appLE (𝟙 (Spec (CommRingCat.of R))) ⊤ V le_top).hom).comp + (Scheme.ΓSpecIso (CommRingCat.of R)).inv.hom) I := by + refine hV.mem_ideal_iff.mpr fun x hx => ?_ + have hcomp : ((Spec (CommRingCat.of R)).presheaf.germ V x hx).hom.comp + (((Scheme.Hom.appLE (𝟙 (Spec (CommRingCat.of R))) ⊤ V le_top).hom).comp + (Scheme.ΓSpecIso (CommRingCat.of R)).inv.hom) = + (StructureSheaf.toStalk R x).hom := by + rw [← StructureSheaf.algebraMap_germ V x hx] + rfl + rw [Ideal.map_map, hcomp, map_sub, map_pow] + exact sub_pow_mem_map_of_fraction _ I N hN _ (stalk_fraction R x _) + +/-- The identity is a Frobenius lift on the base itself at every prime, so +Λ-structures exist. -/ +theorem id_isFrobeniusLift_base (p : Prime K) : (baseScheme K).IsFrobeniusLift p (𝟙 _) := by + refine ⟨Category.comp_id _, fun x _ => rfl, ?_⟩ + intro U V hU hψ hV s + rw [id_appLE _ U V hU hψ s] + exact spec_sub_pow_mem (𝓞 K) p.asIdeal _ (sub_pow_absNorm_mem p) V hV _ + +/-- The fifth cyclotomic field has degree four over the rational field. -/ +theorem finrank_cyclotomicField_five : Module.finrank ℚ (CyclotomicField 5 ℚ) = 4 := by + have h := @IsCyclotomicExtension.finrank 5 _ ℚ (CyclotomicField 5 ℚ) _ _ _ + (CyclotomicField.algebra 5 ℚ) (CyclotomicField.isCyclotomicExtension 5 ℚ) + (Polynomial.cyclotomic.irreducible_rat (by norm_num)) + rw [show Nat.totient 5 = 4 by decide] at h + exact h + +/-- The universal form implies Question 4, because number fields exist that are +neither the rational field nor imaginary quadratic. -/ +theorem question4_of_universal (h : Hilbert12LambdaGeometric) : BorgerDeSmitQuestion4 := by + refine ⟨CyclotomicField 5 ℚ, inferInstance, inferInstance, ?_, ?_, h _⟩ + · rw [finrank_cyclotomicField_five] + decide + · rw [finrank_cyclotomicField_five] + rintro ⟨h2, -⟩ + exact absurd h2 (by decide) + +end + +end HilbertDrafts.Hilbert12LambdaChecks diff --git a/HilbertDrafts/Hilbert13.lean b/HilbertDrafts/Hilbert13.lean new file mode 100644 index 0000000..defe232 --- /dev/null +++ b/HilbertDrafts/Hilbert13.lean @@ -0,0 +1,163 @@ +import Mathlib + +/-! +Candidate FIELD-TOWER formulation of algebraic Hilbert 13 over the complex numbers. +The remaining lower-bound assertion is that no tower of steps descending to +at most two algebraically independent parameters produces a generic septimic root. +Steps use the tensor-product descent condition of Farb--Wolfson Definition 2.3 +directly. The ambient algebraic closure realizes the finite tower as subfields. +-/ + +namespace HilbertDrafts.Hilbert13 + +noncomputable section + +open scoped TensorProduct + +abbrev ParameterRing := MvPolynomial (Fin 7) ℂ +abbrev ParameterField := FractionRing ParameterRing +abbrev Ambient := AlgebraicClosure ParameterField + +/-- Seven independent coefficients: X^7 + a_6 X^6 + ... + a_0. -/ +def genericSeptimic : Polynomial ParameterField := + Polynomial.X ^ 7 + ∑ i : Fin 7, + Polynomial.C (algebraMap ParameterRing ParameterField (MvPolynomial.X i)) * + Polynomial.X ^ (i : ℕ) + +/-- The image of the coefficient field inside a fixed algebraic closure. -/ +def coefficientField : IntermediateField ℂ Ambient := + IntermediateField.adjoin ℂ (Set.range (algebraMap ParameterField Ambient)) + +/-- Literal finite-extension descent: F is E ⊗[E₀] E₁ as an E-algebra, +where E₁/E₀ is finite and trdeg_C(E₀) ≤ d. An algebra equivalence to the field F +requires the entire tensor product to be a field, not merely a chosen factor. +The coefficient subfield E₀ need not contain the generic coefficient field. -/ +def ParameterStep (d : ℕ) (E F : IntermediateField ℂ Ambient) : Prop := + ∃ (E₀ E₁ : IntermediateField ℂ Ambient) (h₀ : E₀ ≤ E) + (h₁ : E₀ ≤ E₁) (hEF : E ≤ F), + letI : Algebra E₀ E := (IntermediateField.inclusion h₀).toRingHom.toAlgebra + letI : Algebra E₀ E₁ := (IntermediateField.inclusion h₁).toRingHom.toAlgebra + letI : Algebra E F := (IntermediateField.inclusion hEF).toRingHom.toAlgebra + FiniteDimensional E₀ E₁ ∧ Algebra.trdeg ℂ E₀ ≤ (d : Cardinal) ∧ + Nonempty ((E ⊗[E₀] E₁) ≃ₐ[E] F) + +/-- A finite sequence of permitted algebraic adjunctions. -/ +inductive ParameterTower (d : ℕ) : IntermediateField ℂ Ambient → + IntermediateField ℂ Ambient → Prop + | refl (E) : ParameterTower d E E + | snoc {E F G} : ParameterTower d E F → ParameterStep d F G → ParameterTower d E G + +/-- All roots in the fixed algebraic closure must lie in the final tower field. -/ +def ContainsGenericRoots (E : IntermediateField ℂ Ambient) : Prop := + ∀ α : Ambient, + Polynomial.eval₂ (algebraMap ParameterField Ambient) α genericSeptimic = 0 → α ∈ E + +def SplitSolvableWithParameters (d : ℕ) : Prop := + ∃ E : IntermediateField ℂ Ambient, + ParameterTower d coefficientField E ∧ ContainsGenericRoots E + +/-- Root-cover formulation: produce a root of the generic polynomial. -/ +def SolvableWithParameters (d : ℕ) : Prop := + ∃ (E : IntermediateField ℂ Ambient) (α : Ambient), + ParameterTower d coefficientField E ∧ α ∈ E ∧ + Polynomial.eval₂ (algebraMap ParameterField Ambient) α genericSeptimic = 0 + +/-- Candidate for the open lower-bound portion RD_ℂ(7) > 2. +The known upper bound of 3 is deliberately a separate assertion. -/ +def AlgebraicLowerBound : Prop := ¬ SolvableWithParameters 2 + +def ClassicalUpperBound : Prop := SolvableWithParameters 3 + +/-- The full modern algebraic Hilbert-13 assertion, RD_C(7) = 3: a +three-parameter tower exists and no two-parameter tower exists. This records +the classical upper bound as part of the statement, not as an assumed theorem. -/ +def AlgebraicHilbert13 : Prop := ClassicalUpperBound ∧ AlgebraicLowerBound + +/-- Regression check: a permitted step must extend, never replace, the current field. -/ +theorem parameterStep_le {d : ℕ} {E F : IntermediateField ℂ Ambient} + (h : ParameterStep d E F) : E ≤ F := by + obtain ⟨E₀, E₁, h₀, h₁, hEF, _⟩ := h + exact hEF + +/-- The descent condition really forces a finite extension at every step. -/ +theorem parameterStep_finite {d : ℕ} {E F : IntermediateField ℂ Ambient} + (h : ParameterStep d E F) : + ∃ hEF : E ≤ F, + letI : Algebra E F := (IntermediateField.inclusion hEF).toRingHom.toAlgebra + FiniteDimensional E F := by + obtain ⟨E₀, E₁, h₀, h₁, hEF, hfin, htr, ⟨e⟩⟩ := h + refine ⟨hEF, ?_⟩ + let : Algebra E₀ E := (IntermediateField.inclusion h₀).toRingHom.toAlgebra + let : Algebra E₀ E₁ := (IntermediateField.inclusion h₁).toRingHom.toAlgebra + let : Algebra E F := (IntermediateField.inclusion hEF).toRingHom.toAlgebra + let := hfin + exact FiniteDimensional.of_injective e.symm.toLinearMap e.symm.injective + +theorem parameterTower_le {d : ℕ} {E F : IntermediateField ℂ Ambient} + (h : ParameterTower d E F) : E ≤ F := by + induction h with + | refl => exact le_rfl + | snoc ht hs ih => exact ih.trans (parameterStep_le hs) + +theorem parameterStep_mono {d e : ℕ} {E F : IntermediateField ℂ Ambient} + (hde : d ≤ e) (h : ParameterStep d E F) : ParameterStep e E F := by + obtain ⟨E₀, E₁, h₀, h₁, hEF, hfin, htr, hiso⟩ := h + exact ⟨E₀, E₁, h₀, h₁, hEF, hfin, htr.trans (by exact_mod_cast hde), hiso⟩ + +theorem parameterTower_mono {d e : ℕ} {E F : IntermediateField ℂ Ambient} + (hde : d ≤ e) (h : ParameterTower d E F) : ParameterTower e E F := by + induction h with + | refl => exact .refl _ + | snoc ht hs ih => exact .snoc ih (parameterStep_mono hde hs) + +theorem solvable_mono {d e : ℕ} (hde : d ≤ e) + (h : SolvableWithParameters d) : SolvableWithParameters e := by + obtain ⟨E, α, ht, hm, hr⟩ := h + exact ⟨E, α, parameterTower_mono hde ht, hm, hr⟩ + +/-- The combined statement says exactly that three is the least allowable +parameter count; it does not rely on an infimum's default value. -/ +theorem algebraicHilbert13_iff_least : + AlgebraicHilbert13 ↔ + SolvableWithParameters 3 ∧ ∀ d : ℕ, SolvableWithParameters d → 3 ≤ d := by + constructor + · rintro ⟨hu, hl⟩ + refine ⟨hu, ?_⟩ + intro d hd + by_contra hn + have hle : d ≤ 2 := by omega + exact hl (solvable_mono hle hd) + · rintro ⟨hu, hleast⟩ + refine ⟨hu, ?_⟩ + intro htwo + have hbad := hleast 2 htwo + omega + +/-- The target is genuinely degree seven, independently of any conjecture. -/ +theorem genericSeptimic_monic : genericSeptimic.Monic := by + apply Polynomial.monic_X_pow_add + exact Polynomial.degree_sum_fin_lt _ + +theorem genericSeptimic_natDegree : genericSeptimic.natDegree = 7 := by + have hlow : (∑ i : Fin 7, + Polynomial.C (algebraMap ParameterRing ParameterField (MvPolynomial.X i)) * + Polynomial.X ^ (i : ℕ)).degree < (7 : WithBot ℕ) := + Polynomial.degree_sum_fin_lt _ + unfold genericSeptimic + rw [Polynomial.natDegree_add_eq_left_of_degree_lt] + · simp + · simpa using hlow + +/-- The root-cover target is nonempty; it cannot succeed or fail because the +chosen ambient field lacks roots of the generic polynomial. -/ +theorem genericSeptimic_has_root : + ∃ α : Ambient, + Polynomial.eval₂ (algebraMap ParameterField Ambient) α genericSeptimic = 0 := by + apply IsAlgClosed.exists_eval₂_eq_zero + intro hzero + have hn : genericSeptimic.natDegree = 0 := Polynomial.natDegree_eq_of_degree_eq_some hzero + rw [genericSeptimic_natDegree] at hn + omega + +end +end HilbertDrafts.Hilbert13 diff --git a/HilbertDrafts/Hilbert16.lean b/HilbertDrafts/Hilbert16.lean new file mode 100644 index 0000000..ff4081d --- /dev/null +++ b/HilbertDrafts/Hilbert16.lean @@ -0,0 +1,464 @@ +import Mathlib + +/-! +Hilbert 16: the uniform-bound component and an effective-classification proposal +covering real projective curves and surfaces, exact maxima, and affine and +projective cycle arrangements. The target propositions are not assumed or proved. +The effective reading needs semantic review; the 2026 full-bound proof claim +must be reviewed separately before open-bounty admission. +-/ + +namespace HilbertDrafts.Hilbert16 + +abbrev Plane := Fin 2 → ℝ + +structure PolynomialVectorField where + xComponent : MvPolynomial (Fin 2) ℝ + yComponent : MvPolynomial (Fin 2) ℝ + +noncomputable def PolynomialVectorField.eval (V : PolynomialVectorField) (z : Plane) : Plane := + ![MvPolynomial.eval z V.xComponent, MvPolynomial.eval z V.yComponent] + +def PolynomialVectorField.DegreeAtMost (V : PolynomialVectorField) (d : ℕ) : Prop := + V.xComponent.totalDegree ≤ d ∧ V.yComponent.totalDegree ≤ d + +/-- An orbit is its image, rather than a time parametrization. Stationary solutions +are explicitly excluded, and a positive period is required. -/ +def IsPeriodicOrbit (V : PolynomialVectorField) (C : Set Plane) : Prop := + ∃ (γ : ℝ → Plane) (T : ℝ), + 0 < T ∧ + Function.Periodic γ T ∧ + (∃ s t, γ s ≠ γ t) ∧ + (∀ t, HasDerivAt γ (V.eval (γ t)) t) ∧ + Set.range γ = C + +/-- Standard neighbourhood isolation: the neighbourhood contains no other +entire periodic orbit. It need not exclude trajectories that merely enter it. +This is the same isolation convention as the published QuinticLienard comparator. -/ +def IsLimitCycle (V : PolynomialVectorField) (C : Set Plane) : Prop := + IsPeriodicOrbit V C ∧ + ∃ U : Set Plane, IsOpen U ∧ C ⊆ U ∧ + ∀ C' : Set Plane, IsPeriodicOrbit V C' → + C' ⊆ U → C' = C + +/-- The bound depends only on the polynomial degree, not on its coefficients. +The bound on every finite injective family avoids treating an infinite set's +`Nat.card` or `Set.ncard` (which can be zero) as a finite upper bound. -/ +def UniformBound : Prop := + ∀ d : ℕ, ∃ N : ℕ, ∀ V : PolynomialVectorField, + V.DegreeAtMost d → + ∀ (m : ℕ) (cycles : Fin m → Set Plane), + Function.Injective cycles → + (∀ i, IsLimitCycle V (cycles i)) → m ≤ N + +theorem periodicOrbit_nonempty {V : PolynomialVectorField} {C : Set Plane} + (h : IsPeriodicOrbit V C) : C.Nonempty := by + obtain ⟨γ, T, hT, hp, hn, hd, rfl⟩ := h + exact ⟨γ 0, ⟨0, rfl⟩⟩ + +theorem periodicOrbit_not_singleton {V : PolynomialVectorField} {C : Set Plane} + (h : IsPeriodicOrbit V C) (z : Plane) : C ≠ {z} := by + obtain ⟨γ, T, hT, hp, ⟨s, t, hst⟩, hd, rfl⟩ := h + intro heq + have hs : γ s = z := by + have hm : γ s ∈ ({z} : Set Plane) := heq ▸ Set.mem_range_self s + simpa only [Set.mem_singleton_iff] using hm + have ht : γ t = z := by + have hm : γ t ∈ ({z} : Set Plane) := heq ▸ Set.mem_range_self t + simpa only [Set.mem_singleton_iff] using hm + exact hst (hs.trans ht.symm) + +/-- Increasing an allowed degree does not silently restrict the coefficient class. -/ +theorem degreeAtMost_mono {V : PolynomialVectorField} {d e : ℕ} + (h : V.DegreeAtMost d) (hde : d ≤ e) : V.DegreeAtMost e := + ⟨h.1.trans hde, h.2.trans hde⟩ + +/-- The zero differential equation cannot manufacture periodic orbits by +choosing an arbitrary nonconstant parametrization. -/ +theorem zeroField_no_periodicOrbit (C : Set Plane) : + ¬ IsPeriodicOrbit ⟨0, 0⟩ C := by + rintro ⟨γ, T, hT, hp, ⟨s, t, hst⟩, hd, hr⟩ + have heval (z : Plane) : PolynomialVectorField.eval ⟨0, 0⟩ z = 0 := by + funext i + fin_cases i <;> simp [PolynomialVectorField.eval] + have hz : ∀ t, HasDerivAt γ 0 t := by + intro t + simpa only [heval] using hd t + exact hst (is_const_of_deriv_eq_zero + (fun t => (hz t).differentiableAt) (fun t => (hz t).deriv) s t) + +/-- A bounded family really has finitely many limit cycles. This explicitly +rules out the infinite-cardinality-evaluates-to-zero encoding error. -/ +theorem uniformBound_implies_finite (h : UniformBound) + (d : ℕ) (V : PolynomialVectorField) (hd : V.DegreeAtMost d) : + {C : Set Plane | IsLimitCycle V C}.Finite := by + classical + obtain ⟨N, hN⟩ := h d + by_contra hinf + let : Infinite {C : Set Plane // IsLimitCycle V C} := Set.Infinite.to_subtype hinf + let f := Infinite.natEmbedding {C : Set Plane // IsLimitCycle V C} + have hi : Function.Injective (fun i : Fin (N + 1) => (f i).val) := by + intro i j hij + apply Fin.ext + exact f.injective (Subtype.ext hij) + have hbad := hN V hd (N + 1) (fun i => (f i).val) hi (fun i => (f i).property) + omega + +end HilbertDrafts.Hilbert16 + +/-! +Classification specifications for both parts of Hilbert 16. These are candidate +solution requirements, not constructed classifications or proved conjectures. +The output-type interpretation and geometry conventions are documented in +HILBERT16_SPECIFICATION.md; computability is an optional refinement. +-/ + + +namespace HilbertDrafts.Hilbert16Classification + +noncomputable section + +abbrev Vector (n : ℕ) := Fin (n + 1) → ℝ +abbrev Projective (n : ℕ) := Projectivization ℝ (Vector n) + +instance projectiveTopology (n : ℕ) : TopologicalSpace (Projective n) := + inferInstanceAs (TopologicalSpace (Quotient (projectivizationSetoid ℝ (Vector n)))) + +abbrev Interval := Set.Icc (0 : ℝ) 1 + +/-- Ambient isotopy starting at the identity. Both the maps and inverses vary +jointly continuously; intrinsic homeomorphism of the subsets is insufficient. -/ +def AmbientIsotopic {X : Type} [TopologicalSpace X] (A B : Set X) : Prop := + ∃ H : Interval → X ≃ₜ X, + Continuous (fun p : Interval × X => H p.1 p.2) ∧ + Continuous (fun p : Interval × X => (H p.1).symm p.2) ∧ + H ⟨0, by norm_num⟩ = Homeomorph.refl X ∧ + (H ⟨1, by norm_num⟩) '' A = B + +/-- One common ambient isotopy moves all the members of an unlabelled family; +members may not be moved independently, which would forget nesting. -/ +def FamilyAmbientIsotopic {X : Type} [TopologicalSpace X] + (A B : Set (Set X)) : Prop := + ∃ H : Interval → X ≃ₜ X, + Continuous (fun p : Interval × X => H p.1 p.2) ∧ + Continuous (fun p : Interval × X => (H p.1).symm p.2) ∧ + H ⟨0, by norm_num⟩ = Homeomorph.refl X ∧ + (fun C : Set X => (H ⟨1, by norm_num⟩) '' C) '' A = B + +/-- A finite union of projected convex hulls of finite rational vertex lists. +These are explicit finite geometric codes with the standard Encodable instance. -/ +abbrev ProjectivePolyhedron (n : ℕ) := List (List (Fin (n + 1) → ℚ)) + +def polyhedronLocus (n : ℕ) (c : ProjectivePolyhedron n) : Set (Projective n) := + {p | ∃ vertices ∈ c, ∃ x : Vector n, ∃ hx : x ≠ 0, + x ∈ convexHull ℝ {v | ∃ q ∈ vertices, v = fun i => (q i : ℝ)} ∧ + Projectivization.mk ℝ x hx = p} + +/-- Nonzero homogeneous representatives, including points at infinity. -/ +def zeroLocus (n : ℕ) (p : MvPolynomial (Fin (n + 1)) ℝ) : Set (Projective n) := + {q | ∃ x : Vector n, ∃ hx : x ≠ 0, + Projectivization.mk ℝ x hx = q ∧ MvPolynomial.eval x p = 0} + +def ComplexNonsingular (n : ℕ) (p : MvPolynomial (Fin (n + 1)) ℝ) : Prop := + ∀ z : Fin (n + 1) → ℂ, z ≠ 0 → + MvPolynomial.eval₂ (algebraMap ℝ ℂ) z p = 0 → + ∃ i, MvPolynomial.eval₂ (algebraMap ℝ ℂ) z (MvPolynomial.pderiv i p) ≠ 0 + +/-- `true` is the usual complex-nonsingular class. `false` also includes +singular and reducible hypersurfaces, so that broader reading is not discarded. -/ +def Admissible (n d : ℕ) (smooth : Bool) + (p : MvPolynomial (Fin (n + 1)) ℝ) : Prop := + p ≠ 0 ∧ p.IsHomogeneous d ∧ (smooth = true → ComplexNonsingular n p) + +/-- A bijective enumeration of the actual connected components; infinite +component families cannot be mistaken for a zero natural cardinal. -/ +def ExactComponents {X : Type} [TopologicalSpace X] (S : Set X) (m : ℕ) : Prop := + ∃ components : Fin m → Set X, Function.Injective components ∧ + ∀ C : Set X, (∃ x ∈ S, connectedComponentIn S x = C) ↔ C ∈ Set.range components + +/-- Required output of a classification, with exhaustive, +irredundant catalogues, realization in the prescribed degree, and sharp +component maxima. This is an output type, not a claim that its mere +nonemptiness expresses the remaining open classification work. -/ +structure AlgebraicClassification (n : ℕ) (smooth : Bool) where + catalogue : ℕ → List (ProjectivePolyhedron n) + realized : ∀ d c, c ∈ catalogue d → + ∃ p, Admissible n d smooth p ∧ AmbientIsotopic (zeroLocus n p) (polyhedronLocus n c) + exhaustive : ∀ d p, Admissible n d smooth p → + ∃ c ∈ catalogue d, AmbientIsotopic (zeroLocus n p) (polyhedronLocus n c) + irredundant : ∀ d (i j : Fin (catalogue d).length), + AmbientIsotopic (polyhedronLocus n ((catalogue d).get i)) + (polyhedronLocus n ((catalogue d).get j)) → i = j + maximumComponents : ℕ → ℕ + componentBound : ∀ d p, Admissible n d smooth p → + ∃ m ≤ maximumComponents d, ExactComponents (zeroLocus n p) m + maximumAttained : ∀ d, ∃ p, Admissible n d smooth p ∧ + ExactComponents (zeroLocus n p) (maximumComponents d) + +/-- Optional algorithmic refinement of the classification output. -/ +structure EffectiveAlgebraicClassification (n : ℕ) (smooth : Bool) + extends AlgebraicClassification n smooth where + catalogueProgram : Nat.Partrec.Code + catalogueComputed : ∀ d, Encodable.encode (catalogue d) ∈ catalogueProgram.eval d + maximumProgram : Nat.Partrec.Code + maximumComputed : ∀ d, maximumComponents d ∈ maximumProgram.eval d + +/-- Harnack's bound and its sharpness, for nonsingular real projective curves. +This classical benchmark is stated here, not claimed as a new open conjecture. -/ +def HarnackSharpBound : Prop := + ∀ d : ℕ, 0 < d → + (∀ p, Admissible 2 d true p → + ∃ m ≤ (d - 1) * (d - 2) / 2 + 1, ExactComponents (zeroLocus 2 p) m) ∧ + ∃ p, Admissible 2 d true p ∧ + ExactComponents (zeroLocus 2 p) ((d - 1) * (d - 2) / 2 + 1) + +/-- The sharp maximum of ten components for a nonsingular real quartic +surface. This supplies a concrete answer statement for the degree singled +out by Hilbert, rather than merely asserting that a catalogue exists. -/ +def QuarticSurfaceMaximum : Prop := + (∀ p, Admissible 3 4 true p → ∃ m ≤ 10, ExactComponents (zeroLocus 3 p) m) ∧ + ∃ p, Admissible 3 4 true p ∧ ExactComponents (zeroLocus 3 p) 10 + +end +end HilbertDrafts.Hilbert16Classification + +namespace HilbertDrafts.Hilbert16Classification + +noncomputable section + +/-- Finite rational polyhedra in the affine plane, with their actual placement. +Realizability below forces the catalogue entries to represent cycle families; +invalid or higher-dimensional polyhedra cannot pass that requirement. -/ +abbrev AffinePolyhedron := List (List (Fin 2 → ℚ)) + +def affineLocus (c : AffinePolyhedron) : Set Hilbert16.Plane := + {x | ∃ vertices ∈ c, + x ∈ convexHull ℝ {v | ∃ q ∈ vertices, v = fun i => (q i : ℝ)}} + +abbrev AffineArrangement := List AffinePolyhedron + +def affineArrangementLocus (c : AffineArrangement) : Set (Set Hilbert16.Plane) := + {C | ∃ p ∈ c, affineLocus p = C} + +abbrev ProjectiveArrangement := List (ProjectivePolyhedron 2) + +def projectiveArrangementLocus (c : ProjectiveArrangement) : Set (Set (Projective 2)) := + {C | ∃ p ∈ c, polyhedronLocus 2 p = C} + +/-- A general output specification, instantiated below with fully defined +polynomial equations. Computability is a separate optional refinement. -/ +structure CycleClassification (System X Code : Type) [TopologicalSpace X] + [Encodable Code] (allowed : ℕ → System → Prop) + (cycles : System → Set (Set X)) (decode : Code → Set (Set X)) where + maximum : ℕ → ℕ + bounded : ∀ d V, allowed d V → ∀ (m : ℕ) (cs : Fin m → Set X), + Function.Injective cs → (∀ i, cs i ∈ cycles V) → m ≤ maximum d + attained : ∀ d, ∃ V, allowed d V ∧ ∃ cs : Fin (maximum d) → Set X, + Function.Injective cs ∧ Set.range cs = cycles V + catalogue : ℕ → List Code + realized : ∀ d c, c ∈ catalogue d → + ∃ V, allowed d V ∧ FamilyAmbientIsotopic (cycles V) (decode c) + exhaustive : ∀ d V, allowed d V → + ∃ c ∈ catalogue d, FamilyAmbientIsotopic (cycles V) (decode c) + irredundant : ∀ d (i j : Fin (catalogue d).length), + FamilyAmbientIsotopic (decode ((catalogue d).get i)) + (decode ((catalogue d).get j)) → i = j + +/-- Optional uniform algorithms for the maxima and arrangement catalogues; +the historical cycle-bound question does not impose this extra requirement. -/ +structure EffectiveCycleClassification (System X Code : Type) [TopologicalSpace X] + [Encodable Code] (allowed : ℕ → System → Prop) + (cycles : System → Set (Set X)) (decode : Code → Set (Set X)) + extends CycleClassification System X Code allowed cycles decode where + maximumProgram : Nat.Partrec.Code + maximumComputed : ∀ d, maximum d ∈ maximumProgram.eval d + catalogueProgram : Nat.Partrec.Code + catalogueComputed : ∀ d, Encodable.encode (catalogue d) ∈ catalogueProgram.eval d + +abbrev AffineCycleClassification := + CycleClassification Hilbert16.PolynomialVectorField Hilbert16.Plane AffineArrangement + (fun d V => V.DegreeAtMost d) (fun V => {C | Hilbert16.IsLimitCycle V C}) + affineArrangementLocus + +/-- Homogeneous polynomial vector fields on nonzero triples. The induced +projective direction is unchanged by adding a radial component. -/ +structure HomogeneousVectorField where + component : Fin 3 → MvPolynomial (Fin 3) ℝ + +def HomogeneousVectorField.Degree (V : HomogeneousVectorField) (d : ℕ) : Prop := + ∀ i, (V.component i).IsHomogeneous d + +def HomogeneousVectorField.eval (V : HomogeneousVectorField) (x : Vector 2) : Vector 2 := + fun i => MvPolynomial.eval x (V.component i) + +/-- Projective trajectories are defined by nonzero lifts. The nonvanishing +continuous speed permits reparametrization, and the radial term removes the +choice of representative. Periodicity and nonconstancy concern projective +points, so radial motion does not count as an orbit. Lifts need not be periodic. -/ +def IsProjectivePeriodicOrbit (V : HomogeneousVectorField) + (C : Set (Projective 2)) : Prop := + ∃ (γ : ℝ → Vector 2) (hγ : ∀ t, γ t ≠ 0) (a b : ℝ → ℝ) (T : ℝ), + 0 < T ∧ Continuous a ∧ Continuous b ∧ (∀ t, a t ≠ 0) ∧ + (∀ t, HasDerivAt γ (a t • V.eval (γ t) + b t • γ t) t) ∧ + Function.Periodic (fun t => Projectivization.mk ℝ (γ t) (hγ t)) T ∧ + (∃ s t, Projectivization.mk ℝ (γ s) (hγ s) ≠ + Projectivization.mk ℝ (γ t) (hγ t)) ∧ + Set.range (fun t => Projectivization.mk ℝ (γ t) (hγ t)) = C + +def IsProjectiveLimitCycle (V : HomogeneousVectorField) + (C : Set (Projective 2)) : Prop := + IsProjectivePeriodicOrbit V C ∧ + ∃ U : Set (Projective 2), IsOpen U ∧ C ⊆ U ∧ + ∀ C', IsProjectivePeriodicOrbit V C' → C' ⊆ U → C' = C + +abbrev ProjectiveCycleClassification := + CycleClassification HomogeneousVectorField (Projective 2) ProjectiveArrangement + (fun d V => V.Degree d) (fun V => {C | IsProjectiveLimitCycle V C}) + projectiveArrangementLocus + +/-- The full chosen classification task is to supply this output, including +its actual catalogues and sharp maxima. A nonemptiness theorem alone is not +advertised as a completed classification. The primary surface class is +nonsingular; lower-dimensional singular loci remain an optional extension. -/ +structure ClassificationOutput where + curves : AlgebraicClassification 2 true + surfaces : AlgebraicClassification 3 true + affineCycles : AffineCycleClassification + projectiveCycles : ProjectiveCycleClassification + +/-- Optional strengthening: uniform terminating programs for the nonsingular +curve, nonsingular surface, affine-cycle and projective-cycle outputs. +Not the primary target; see ClassificationOutput. -/ +def EffectiveHilbert16 : Prop := + Nonempty (EffectiveAlgebraicClassification 2 true) ∧ + Nonempty (EffectiveAlgebraicClassification 3 true) ∧ + Nonempty (EffectiveCycleClassification Hilbert16.PolynomialVectorField + Hilbert16.Plane AffineArrangement (fun d V => V.DegreeAtMost d) + (fun V => {C | Hilbert16.IsLimitCycle V C}) affineArrangementLocus) ∧ + Nonempty (EffectiveCycleClassification HomogeneousVectorField + (Projective 2) ProjectiveArrangement (fun d V => V.Degree d) + (fun V => {C | IsProjectiveLimitCycle V C}) projectiveArrangementLocus) + +/-- The new affine specification entails the earlier bound question. -/ +theorem effectiveHilbert16_implies_uniformBound (h : EffectiveHilbert16) : + Hilbert16.UniformBound := by + obtain ⟨classification⟩ := h.2.2.1 + intro d + exact ⟨classification.maximum d, classification.bounded d⟩ + +/-- A degree is the actual homogeneous degree, not a permissive label. -/ +theorem admissible_totalDegree {n d : ℕ} {smooth : Bool} + {p : MvPolynomial (Fin (n + 1)) ℝ} (h : Admissible n d smooth p) : + p.totalDegree = d := h.2.1.totalDegree h.1 + +/-- Excluding the zero polynomial prevents the whole ambient space from being +counted as a hypersurface of every possible degree. -/ +theorem zero_not_admissible (n d : ℕ) (smooth : Bool) : + ¬ Admissible n d smooth 0 := by + intro h + exact h.1 rfl + +/-- The two smoothness modes cannot silently omit nonsingular examples. -/ +theorem admissible_forget_smooth {n d : ℕ} + {p : MvPolynomial (Fin (n + 1)) ℝ} (h : Admissible n d true p) : + Admissible n d false p := by + exact ⟨h.1, h.2.1, by simp⟩ + +/-- An empty cycle image cannot be made periodic by a choice of lift. -/ +theorem projectivePeriodicOrbit_nonempty {V : HomogeneousVectorField} + {C : Set (Projective 2)} (h : IsProjectivePeriodicOrbit V C) : C.Nonempty := by + obtain ⟨γ, hγ, a, b, T, hT, ha, hb, hane, hd, hp, hn, rfl⟩ := h + exact ⟨_, Set.mem_range_self 0⟩ + +/-- A maximum is required to be sharp; it is not an arbitrary upper bound. -/ +theorem affine_maximum_attained (s : AffineCycleClassification) (d : ℕ) : + ∃ V : Hilbert16.PolynomialVectorField, V.DegreeAtMost d ∧ + ∃ cs : Fin (s.maximum d) → Set Hilbert16.Plane, + Function.Injective cs ∧ + ∀ C, Hilbert16.IsLimitCycle V C ↔ C ∈ Set.range cs := by + obtain ⟨V, hV, cs, hi, hr⟩ := s.attained d + exact ⟨V, hV, cs, hi, fun C => by rw [hr]; rfl⟩ + +/-- Ambient equivalence cannot collapse an infinite family to a finite one: +the induced map on sets is injective as well as the map on points. -/ +theorem familyAmbientIsotopic_finite_iff {X : Type} [TopologicalSpace X] + {A B : Set (Set X)} (h : FamilyAmbientIsotopic A B) : A.Finite ↔ B.Finite := by + obtain ⟨H, hc, hci, hzero, hAB⟩ := h + rw [← hAB] + exact (Set.finite_image_iff + (H ⟨1, by norm_num⟩).injective.image_injective.injOn).symm + +/-- Exact component counts are unique, including the empty-locus case. -/ +theorem exactComponents_unique {X : Type} [TopologicalSpace X] + {S : Set X} {m n : ℕ} (hm : ExactComponents S m) (hn : ExactComponents S n) : + m = n := by + obtain ⟨f, hf, hfm⟩ := hm + obtain ⟨g, hg, hgn⟩ := hn + have hr : Set.range f = Set.range g := by + ext C + exact (hfm C).symm.trans (hgn C) + have hc := congrArg Set.ncard hr + simpa only [Set.ncard_range_of_injective hf, Set.ncard_range_of_injective hg, + Nat.card_fin] using hc + +/-- Counting zero components cannot silently conceal a nonempty locus. -/ +theorem exactComponents_zero_iff {X : Type} [TopologicalSpace X] (S : Set X) : + ExactComponents S 0 ↔ S = ∅ := by + constructor + · rintro ⟨f, hf, hcover⟩ + apply Set.eq_empty_iff_forall_notMem.mpr + intro x hx + obtain ⟨i, hi⟩ := (hcover (connectedComponentIn S x)).mp ⟨x, hx, rfl⟩ + exact Fin.elim0 i + · intro hS + subst S + refine ⟨Fin.elim0, (fun i => Fin.elim0 i), ?_⟩ + intro C + simp + +/-- Every degree has at least the zero-field configuration to classify. Even +when there are no cycles, an empty catalogue is not an exhaustive answer. -/ +theorem affine_catalogue_nonempty (s : AffineCycleClassification) (d : ℕ) : + s.catalogue d ≠ [] := by + have hz : (Hilbert16.PolynomialVectorField.mk 0 0).DegreeAtMost d := by + simp [Hilbert16.PolynomialVectorField.DegreeAtMost] + obtain ⟨c, hc, hiso⟩ := s.exhaustive d ⟨0, 0⟩ hz + intro he + simp [he] at hc + +end +end HilbertDrafts.Hilbert16Classification + + +namespace HilbertDrafts.Hilbert16Classification + +noncomputable section + +/-- Evaluation scales by the actual homogeneous degree. -/ +theorem homogeneous_eval_smul {n d : ℕ} {p : MvPolynomial (Fin (n + 1)) ℝ} + (hp : p.IsHomogeneous d) (a : ℝ) (x : Vector n) : + MvPolynomial.eval (a • x) p = a ^ d * MvPolynomial.eval x p := by + classical + simp only [MvPolynomial.eval_eq, Pi.smul_apply, smul_eq_mul, mul_pow, + Finset.prod_mul_distrib, Finset.mul_sum] + apply Finset.sum_congr rfl + intro s hs + rw [Finset.prod_pow_eq_pow_sum, ← hp.degree_eq_sum_deg_support hs] + ring + +/-- Projective zero-locus membership agrees with evaluation at any nonzero +representative; the existential representative cannot manufacture extra points. -/ +theorem mem_zeroLocus_mk_iff {n d : ℕ} {p : MvPolynomial (Fin (n + 1)) ℝ} + (hp : p.IsHomogeneous d) (x : Vector n) (hx : x ≠ 0) : + Projectivization.mk ℝ x hx ∈ zeroLocus n p ↔ MvPolynomial.eval x p = 0 := by + constructor + · rintro ⟨y, hy, he, hz⟩ + obtain ⟨a, ha⟩ := (Projectivization.mk_eq_mk_iff ℝ y x hy hx).mp he + have ha' : (a : ℝ) • x = y := ha + rw [← ha', homogeneous_eval_smul hp] at hz + exact (mul_eq_zero.mp hz).resolve_left (pow_ne_zero _ a.ne_zero) + · intro h + exact ⟨x, hx, rfl, h⟩ + +end +end HilbertDrafts.Hilbert16Classification diff --git a/HilbertDrafts/Hilbert16Open.lean b/HilbertDrafts/Hilbert16Open.lean new file mode 100644 index 0000000..6cc10a4 --- /dev/null +++ b/HilbertDrafts/Hilbert16Open.lean @@ -0,0 +1,114 @@ +import HilbertDrafts.Hilbert16 + +/-! +Hilbert 16: two specific open cases stated with the reviewed definitions of +`HilbertDrafts.Hilbert16` and `HilbertDrafts.Hilbert16Classification`. Each is +one case of one clause of the problem, not the whole problem. + +* `QuadraticFourCycles`: every planar polynomial vector field of degree at most + two has at most four limit cycles. Limit cycles are isolated periodic orbits, + counted as point sets in the whole affine plane, without multiplicity. This is + the upper half of the conjecture H(2) = 4 for the second part of the problem. + The lower bound, a quadratic field with four limit cycles, is known in the + literature and is not part of the statement. An existence statement for some + finite bound, such as `Hilbert16.UniformBound`, does not decide it. +* `QuinticSurfaceComponents`: every nonsingular real projective quintic surface + has at most twenty-three connected components. Hilbert asks about the number, + form and position of the sheets of an algebraic surface and names the unknown + maximum only for degree four, where it is now known to be ten. Degree five is + the first degree in which the maximum is unknown: it is twenty-three, + twenty-four or twenty-five. The statement may therefore be true or false. A + quintic with twenty-three components is known in the literature and is not + part of the statement. + +Neither proposition is assumed or proved here. The lemmas are consistency +checks on the statements, not progress on the conjectures. +-/ + +namespace HilbertDrafts.Hilbert16Open + +open HilbertDrafts.Hilbert16 HilbertDrafts.Hilbert16Classification + +/-- Every polynomial vector field of degree at most `d` has at most `N` limit +cycles. Bounding every finite injective family also excludes infinitely many +cycles, exactly as in `Hilbert16.UniformBound`. -/ +def CycleBound (d N : ℕ) : Prop := + ∀ V : PolynomialVectorField, V.DegreeAtMost d → + ∀ (m : ℕ) (cycles : Fin m → Set Plane), + Function.Injective cycles → + (∀ i, IsLimitCycle V (cycles i)) → m ≤ N + +/-- The quadratic case of the second part of Hilbert 16: at most four limit +cycles, in the whole affine plane and without multiplicity, for every vector +field of degree at most two. Only this upper bound is asserted. -/ +def QuadraticFourCycles : Prop := CycleBound 2 4 + +/-- Every nonsingular real projective surface of degree `d` has at most `N` +connected components. The count is an exact enumeration of the components. -/ +def SurfaceComponentBound (d N : ℕ) : Prop := + ∀ p : MvPolynomial (Fin 4) ℝ, Admissible 3 d true p → + ∃ m ≤ N, ExactComponents (zeroLocus 3 p) m + +/-- The quintic case of the question about the number of sheets in the first +part of Hilbert 16: at most twenty-three connected components for every real +projective quintic surface with nonsingular complexification. Only this upper +bound is asserted; whether it holds is not known. -/ +def QuinticSurfaceComponents : Prop := SurfaceComponentBound 5 23 + +/-- The reviewed uniform-bound proposition is exactly the existence of some +bound in every degree. It gives no particular value in degree two. -/ +theorem uniformBound_iff_exists_cycleBound : + UniformBound ↔ ∀ d : ℕ, ∃ N : ℕ, CycleBound d N := Iff.rfl + +/-- A larger number is a weaker bound. -/ +theorem cycleBound_mono_right {d N M : ℕ} (h : CycleBound d N) (hNM : N ≤ M) : + CycleBound d M := + fun V hV m cycles hi hc => (h V hV m cycles hi hc).trans hNM + +/-- A bound for a degree covers every smaller degree. -/ +theorem cycleBound_mono_left {d e N : ℕ} (h : CycleBound e N) (hde : d ≤ e) : + CycleBound d N := + fun V hV => h V (degreeAtMost_mono hV hde) + +/-- The quadratic bound really makes the set of limit cycles finite. -/ +theorem quadraticFourCycles_finite (h : QuadraticFourCycles) + (V : PolynomialVectorField) (hV : V.DegreeAtMost 2) : + {C : Set Plane | IsLimitCycle V C}.Finite := by + classical + by_contra hinf + let : Infinite {C : Set Plane // IsLimitCycle V C} := Set.Infinite.to_subtype hinf + let f := Infinite.natEmbedding {C : Set Plane // IsLimitCycle V C} + have hi : Function.Injective (fun i : Fin 5 => (f i).val) := by + intro i j hij + apply Fin.ext + exact f.injective (Subtype.ext hij) + have hbad := h V hV 5 (fun i => (f i).val) hi (fun i => (f i).property) + omega + +/-- A sharp classification with maximum four in degree two would give the +quadratic bound; the statement asks for no more than that upper bound. -/ +theorem quadraticFourCycles_of_classification (s : AffineCycleClassification) + (h : s.maximum 2 ≤ 4) : QuadraticFourCycles := + fun V hV m cycles hi hc => (s.bounded 2 V hV m cycles hi hc).trans h + +/-- The known quartic answer has the same shape as the quintic statement. -/ +theorem quarticSurfaceMaximum_bound (h : QuarticSurfaceMaximum) : + SurfaceComponentBound 4 10 := h.1 + +/-- A larger number is a weaker bound. -/ +theorem surfaceComponentBound_mono {d N M : ℕ} (h : SurfaceComponentBound d N) + (hNM : N ≤ M) : SurfaceComponentBound d M := by + intro p hp + obtain ⟨m, hm, he⟩ := h p hp + exact ⟨m, hm.trans hNM, he⟩ + +/-- A sharp surface classification with maximum twenty-three in degree five +would give the quintic bound. -/ +theorem quinticSurfaceComponents_of_classification + (s : AlgebraicClassification 3 true) (h : s.maximumComponents 5 ≤ 23) : + QuinticSurfaceComponents := by + intro p hp + obtain ⟨m, hm, he⟩ := s.componentBound 5 p hp + exact ⟨m, hm.trans h, he⟩ + +end HilbertDrafts.Hilbert16Open diff --git a/HilbertDrafts/Hilbert16OpenChecks.lean b/HilbertDrafts/Hilbert16OpenChecks.lean new file mode 100644 index 0000000..36e7e06 --- /dev/null +++ b/HilbertDrafts/Hilbert16OpenChecks.lean @@ -0,0 +1,302 @@ +import HilbertDrafts.Hilbert16Open + +/-! +Machine-checked non-vacuity witnesses for the two open Hilbert 16 cases. +They show that the hypotheses of the statements are satisfiable, so neither +statement can hold for an empty reason. They are not progress on the conjectures. +-/ + +namespace HilbertDrafts.Hilbert16OpenChecks + +open HilbertDrafts.Hilbert16 HilbertDrafts.Hilbert16Classification + HilbertDrafts.Hilbert16Open + +noncomputable section + +/-- The Fermat quintic `x₀⁵ + x₁⁵ + x₂⁵ + x₃⁵`. -/ +def fermatQuintic : MvPolynomial (Fin 4) ℝ := + ∑ i : Fin 4, MvPolynomial.X i ^ 5 + +/-- The partial derivatives of the Fermat quintic. -/ +theorem pderiv_fermatQuintic (i : Fin 4) : + MvPolynomial.pderiv i fermatQuintic = MvPolynomial.C 5 * MvPolynomial.X i ^ 4 := by + unfold fermatQuintic + rw [map_sum, Finset.sum_eq_single i] + · rw [MvPolynomial.pderiv_pow, MvPolynomial.pderiv_X_self, mul_one] + rfl + · intro j _ hj + rw [MvPolynomial.pderiv_pow, MvPolynomial.pderiv_X_of_ne hj, mul_zero] + · intro h + exact absurd (Finset.mem_univ i) h + +/-- The class of nonsingular real quintic surfaces is not empty: the Fermat +quintic is admissible. The quintic statement is therefore not vacuous. -/ +theorem fermatQuintic_admissible : Admissible 3 5 true fermatQuintic := by + refine ⟨?_, ?_, fun _ => ?_⟩ + · intro h + have h1 := congrArg (MvPolynomial.eval (fun _ => (1 : ℝ))) h + simp [fermatQuintic] at h1 + · unfold fermatQuintic + exact MvPolynomial.IsHomogeneous.sum _ _ _ + fun i _ => (MvPolynomial.isHomogeneous_X ℝ i).pow 5 + · intro z hz _ + obtain ⟨i, hi⟩ : ∃ i, z i ≠ 0 := by + by_contra h + exact hz (funext fun j => by_contra fun hj => h ⟨j, hj⟩) + refine ⟨i, ?_⟩ + rw [pderiv_fermatQuintic, MvPolynomial.eval₂_mul, MvPolynomial.eval₂_C, + MvPolynomial.eval₂_pow, MvPolynomial.eval₂_X] + exact mul_ne_zero (by simp) (pow_ne_zero 4 hi) + +/-- The cubic field `x' = -y + x (1 - x² - y²)`, `y' = x + y (1 - x² - y²)`. -/ +def cubicField : PolynomialVectorField where + xComponent := -MvPolynomial.X 1 + + MvPolynomial.X 0 * (1 - MvPolynomial.X 0 ^ 2 - MvPolynomial.X 1 ^ 2) + yComponent := MvPolynomial.X 0 + + MvPolynomial.X 1 * (1 - MvPolynomial.X 0 ^ 2 - MvPolynomial.X 1 ^ 2) + +/-- The unit circle. -/ +def unitCircle : Set Plane := {z | z 0 ^ 2 + z 1 ^ 2 = 1} + +/-- The value of the cubic field at a point of the plane. -/ +theorem cubicField_eval (z : Plane) : + cubicField.eval z = + ![-z 1 + z 0 * (1 - z 0 ^ 2 - z 1 ^ 2), z 0 + z 1 * (1 - z 0 ^ 2 - z 1 ^ 2)] := by + simp [cubicField, PolynomialVectorField.eval] + +/-- The cubic field has degree at most three. -/ +theorem cubicField_degreeAtMost : cubicField.DegreeAtMost 3 := by + have hX : ∀ i : Fin 2, (MvPolynomial.X i : MvPolynomial (Fin 2) ℝ).totalDegree = 1 := + fun i => MvPolynomial.totalDegree_X i + have hsq : ∀ i : Fin 2, + ((MvPolynomial.X i : MvPolynomial (Fin 2) ℝ) ^ 2).totalDegree ≤ 2 := + fun i => (MvPolynomial.totalDegree_X_pow i 2).le + have hq : ((1 : MvPolynomial (Fin 2) ℝ) - MvPolynomial.X 0 ^ 2 - + MvPolynomial.X 1 ^ 2).totalDegree ≤ 2 := by + refine (MvPolynomial.totalDegree_sub _ _).trans (max_le ?_ (hsq 1)) + refine (MvPolynomial.totalDegree_sub _ _).trans (max_le ?_ (hsq 0)) + rw [MvPolynomial.totalDegree_one] + exact Nat.zero_le 2 + have hm : ∀ i : Fin 2, ((MvPolynomial.X i : MvPolynomial (Fin 2) ℝ) * + (1 - MvPolynomial.X 0 ^ 2 - MvPolynomial.X 1 ^ 2)).totalDegree ≤ 3 := by + intro i + refine (MvPolynomial.totalDegree_mul _ _).trans ?_ + rw [hX] + omega + refine ⟨?_, ?_⟩ + · show (-MvPolynomial.X 1 + MvPolynomial.X 0 * + (1 - MvPolynomial.X 0 ^ 2 - MvPolynomial.X 1 ^ 2) : + MvPolynomial (Fin 2) ℝ).totalDegree ≤ 3 + refine (MvPolynomial.totalDegree_add _ _).trans (max_le ?_ (hm 0)) + rw [MvPolynomial.totalDegree_neg, hX] + omega + · show (MvPolynomial.X 0 + MvPolynomial.X 1 * + (1 - MvPolynomial.X 0 ^ 2 - MvPolynomial.X 1 ^ 2) : + MvPolynomial (Fin 2) ℝ).totalDegree ≤ 3 + refine (MvPolynomial.totalDegree_add _ _).trans (max_le ?_ (hm 1)) + rw [hX] + omega + +/-- Every point of the unit circle is `(cos θ, sin θ)` for some angle `θ`. -/ +theorem exists_angle {a b : ℝ} (h : a ^ 2 + b ^ 2 = 1) : + ∃ θ : ℝ, Real.cos θ = a ∧ Real.sin θ = b := by + have hn : ‖(⟨a, b⟩ : ℂ)‖ = 1 := by + rw [Complex.norm_eq_sqrt_sq_add_sq] + simp [h] + obtain ⟨θ, hθ⟩ := (Complex.norm_eq_one_iff _).mp hn + refine ⟨θ, ?_, ?_⟩ + · have h0 := congrArg Complex.re hθ + rwa [Complex.exp_ofReal_mul_I_re] at h0 + · have h1 := congrArg Complex.im hθ + rwa [Complex.exp_ofReal_mul_I_im] at h1 + +/-- The unit circle is a periodic orbit of the cubic field, traced by +`t ↦ (cos t, sin t)`. -/ +theorem unitCircle_isPeriodicOrbit : IsPeriodicOrbit cubicField unitCircle := by + refine ⟨fun t => ![Real.cos t, Real.sin t], 2 * Real.pi, Real.two_pi_pos, ?_, + ⟨0, Real.pi, ?_⟩, ?_, ?_⟩ + · intro t + simp + · intro h + have h0 := congrFun h 0 + simp at h0 + norm_num at h0 + · intro t + have hc : Real.cos t ^ 2 + Real.sin t ^ 2 = 1 := Real.cos_sq_add_sin_sq t + have e : cubicField.eval ![Real.cos t, Real.sin t] = ![-Real.sin t, Real.cos t] := by + rw [cubicField_eval] + have h0 : 1 - (![Real.cos t, Real.sin t] : Plane) 0 ^ 2 - + (![Real.cos t, Real.sin t] : Plane) 1 ^ 2 = 0 := by + show 1 - Real.cos t ^ 2 - Real.sin t ^ 2 = 0 + linarith + rw [h0] + simp + rw [e] + exact hasDerivAt_pi.mpr + (Fin.forall_fin_two.mpr ⟨Real.hasDerivAt_cos t, Real.hasDerivAt_sin t⟩) + · ext z + constructor + · rintro ⟨t, rfl⟩ + show Real.cos t ^ 2 + Real.sin t ^ 2 = 1 + exact Real.cos_sq_add_sin_sq t + · intro hz + have hz' : z 0 ^ 2 + z 1 ^ 2 = 1 := hz + obtain ⟨θ, h0, h1⟩ := exists_angle hz' + exact ⟨θ, funext (Fin.forall_fin_two.mpr ⟨h0, h1⟩)⟩ + +/-- A positive periodic solution of `f' = 2 f (1 - f)` is identically one: +the derivative vanishes at a global maximum and at a global minimum. -/ +theorem periodic_logistic_eq_one {f : ℝ → ℝ} {T : ℝ} (hT : 0 < T) + (hper : Function.Periodic f T) (hpos : ∀ t, 0 < f t) + (hf : ∀ t, HasDerivAt f (2 * f t * (1 - f t)) t) : ∀ t, f t = 1 := by + have hcont : Continuous f := + continuous_iff_continuousAt.mpr fun t => (hf t).continuousAt + have hne : (Set.Icc (0 : ℝ) T).Nonempty := Set.nonempty_Icc.mpr hT.le + obtain ⟨a, -, ha⟩ := isCompact_Icc.exists_isMaxOn hne hcont.continuousOn + obtain ⟨b, -, hb⟩ := isCompact_Icc.exists_isMinOn hne hcont.continuousOn + have hmax : ∀ t, f t ≤ f a := by + intro t + obtain ⟨s, hs, hst⟩ := hper.exists_mem_Ico₀ hT t + rw [hst] + exact isMaxOn_iff.mp ha s (Set.Ico_subset_Icc_self hs) + have hmin : ∀ t, f b ≤ f t := by + intro t + obtain ⟨s, hs, hst⟩ := hper.exists_mem_Ico₀ hT t + rw [hst] + exact isMinOn_iff.mp hb s (Set.Ico_subset_Icc_self hs) + have key : ∀ c, 2 * f c * (1 - f c) = 0 → f c = 1 := by + intro c hc + rcases mul_eq_zero.mp hc with h | h + · have hc0 := hpos c + linarith + · linarith + have hamax : IsLocalMax f a := Filter.Eventually.of_forall hmax + have hbmin : IsLocalMin f b := Filter.Eventually.of_forall hmin + have ha1 : f a = 1 := key a (hamax.hasDerivAt_eq_zero (hf a)) + have hb1 : f b = 1 := key b (hbmin.hasDerivAt_eq_zero (hf b)) + intro t + have h1 := hmax t + have h2 := hmin t + linarith + +/-- The solutions of `x' = -y`, `y' = x` are the rotations of their initial value. -/ +theorem rotation_solution {x y : ℝ → ℝ} (hx : ∀ t, HasDerivAt x (-y t) t) + (hy : ∀ t, HasDerivAt y (x t) t) (t : ℝ) : + x t = x 0 * Real.cos t - y 0 * Real.sin t ∧ + y t = x 0 * Real.sin t + y 0 * Real.cos t := by + have hu : ∀ s, HasDerivAt (fun r => x r * Real.cos r + y r * Real.sin r) 0 s := by + intro s + have h : HasDerivAt (fun r => x r * Real.cos r + y r * Real.sin r) + (-y s * Real.cos s + x s * -Real.sin s + (x s * Real.sin s + y s * Real.cos s)) s := + ((hx s).mul (Real.hasDerivAt_cos s)).add ((hy s).mul (Real.hasDerivAt_sin s)) + exact h.congr_deriv (by ring) + have hv : ∀ s, HasDerivAt (fun r => y r * Real.cos r - x r * Real.sin r) 0 s := by + intro s + have h : HasDerivAt (fun r => y r * Real.cos r - x r * Real.sin r) + (x s * Real.cos s + y s * -Real.sin s - (-y s * Real.sin s + x s * Real.cos s)) s := + ((hy s).mul (Real.hasDerivAt_cos s)).sub ((hx s).mul (Real.hasDerivAt_sin s)) + exact h.congr_deriv (by ring) + have hu0 : x t * Real.cos t + y t * Real.sin t = x 0 := by + have h := is_const_of_deriv_eq_zero (fun s => (hu s).differentiableAt) + (fun s => (hu s).deriv) t 0 + simpa using h + have hv0 : y t * Real.cos t - x t * Real.sin t = y 0 := by + have h := is_const_of_deriv_eq_zero (fun s => (hv s).differentiableAt) + (fun s => (hv s).deriv) t 0 + simpa using h + have hc : Real.cos t ^ 2 + Real.sin t ^ 2 = 1 := Real.cos_sq_add_sin_sq t + constructor + · linear_combination Real.cos t * hu0 - Real.sin t * hv0 - x t * hc + · linear_combination Real.sin t * hu0 + Real.cos t * hv0 - y t * hc + +/-- A periodic orbit of the cubic field that avoids the origin is the unit circle. -/ +theorem periodicOrbit_eq_unitCircle {C : Set Plane} (hC : IsPeriodicOrbit cubicField C) + (hpos : ∀ z ∈ C, 0 < z 0 ^ 2 + z 1 ^ 2) : C = unitCircle := by + obtain ⟨η, T, hT, hper, -, hder, rfl⟩ := hC + have hx : ∀ t, HasDerivAt (fun s => η s 0) + (-η t 1 + η t 0 * (1 - η t 0 ^ 2 - η t 1 ^ 2)) t := by + intro t + have h := hasDerivAt_pi.mp (hder t) 0 + rw [cubicField_eval] at h + exact h + have hy : ∀ t, HasDerivAt (fun s => η s 1) + (η t 0 + η t 1 * (1 - η t 0 ^ 2 - η t 1 ^ 2)) t := by + intro t + have h := hasDerivAt_pi.mp (hder t) 1 + rw [cubicField_eval] at h + exact h + have hf : ∀ t, HasDerivAt (fun s => η s 0 ^ 2 + η s 1 ^ 2) + (2 * (η t 0 ^ 2 + η t 1 ^ 2) * (1 - (η t 0 ^ 2 + η t 1 ^ 2))) t := by + intro t + have e : (fun s => η s 0 ^ 2 + η s 1 ^ 2) = + fun s => η s 0 * η s 0 + η s 1 * η s 1 := by + funext s + ring + have h : HasDerivAt (fun s => η s 0 * η s 0 + η s 1 * η s 1) + ((-η t 1 + η t 0 * (1 - η t 0 ^ 2 - η t 1 ^ 2)) * η t 0 + + η t 0 * (-η t 1 + η t 0 * (1 - η t 0 ^ 2 - η t 1 ^ 2)) + + ((η t 0 + η t 1 * (1 - η t 0 ^ 2 - η t 1 ^ 2)) * η t 1 + + η t 1 * (η t 0 + η t 1 * (1 - η t 0 ^ 2 - η t 1 ^ 2)))) t := + ((hx t).mul (hx t)).add ((hy t).mul (hy t)) + rw [e] + exact h.congr_deriv (by ring) + have hfper : Function.Periodic (fun s => η s 0 ^ 2 + η s 1 ^ 2) T := by + intro t + show η (t + T) 0 ^ 2 + η (t + T) 1 ^ 2 = η t 0 ^ 2 + η t 1 ^ 2 + rw [hper t] + have hone : ∀ t, η t 0 ^ 2 + η t 1 ^ 2 = 1 := + periodic_logistic_eq_one hT hfper (fun t => hpos (η t) (Set.mem_range_self t)) hf + have hzero : ∀ t, 1 - η t 0 ^ 2 - η t 1 ^ 2 = 0 := by + intro t + have h := hone t + linarith + have hx' : ∀ t, HasDerivAt (fun s => η s 0) (-η t 1) t := by + intro t + refine (hx t).congr_deriv ?_ + rw [hzero t] + ring + have hy' : ∀ t, HasDerivAt (fun s => η s 1) (η t 0) t := by + intro t + refine (hy t).congr_deriv ?_ + rw [hzero t] + ring + have hrot := rotation_solution hx' hy' + apply Set.Subset.antisymm + · rintro _ ⟨t, rfl⟩ + exact hone t + · intro z hz + have hz' : z 0 ^ 2 + z 1 ^ 2 = 1 := hz + obtain ⟨α, hα0, hα1⟩ := exists_angle (hone 0) + obtain ⟨β, hβ0, hβ1⟩ := exists_angle hz' + have hα : Real.cos α ^ 2 + Real.sin α ^ 2 = 1 := Real.cos_sq_add_sin_sq α + obtain ⟨h0, h1⟩ := hrot (β - α) + refine ⟨β - α, funext (Fin.forall_fin_two.mpr ⟨?_, ?_⟩)⟩ + · rw [h0, ← hα0, ← hα1, ← hβ0, Real.cos_sub, Real.sin_sub] + linear_combination Real.cos β * hα + · rw [h1, ← hα0, ← hα1, ← hβ1, Real.cos_sub, Real.sin_sub] + linear_combination Real.sin β * hα + +/-- The notion of limit cycle is satisfiable: the unit circle is a limit cycle +of the cubic field. A cycle bound is therefore never true merely because no +set can satisfy `IsLimitCycle`. -/ +theorem unitCircle_isLimitCycle : IsLimitCycle cubicField unitCircle := by + refine ⟨unitCircle_isPeriodicOrbit, {z | 0 < z 0 ^ 2 + z 1 ^ 2}, ?_, ?_, ?_⟩ + · exact isOpen_lt continuous_const (by fun_prop) + · intro z hz + have hz' : z 0 ^ 2 + z 1 ^ 2 = 1 := hz + show 0 < z 0 ^ 2 + z 1 ^ 2 + rw [hz'] + exact one_pos + · intro C' hC' hsub + exact periodicOrbit_eq_unitCircle hC' fun z hz => hsub hz + +/-- Consequently the bound zero fails in degree three. -/ +theorem not_cycleBound_three_zero : ¬ CycleBound 3 0 := by + intro h + have h1 := h cubicField cubicField_degreeAtMost 1 (fun _ => unitCircle) + (fun i j _ => Subsingleton.elim i j) (fun _ => unitCircle_isLimitCycle) + omega + +end + +end HilbertDrafts.Hilbert16OpenChecks diff --git a/HilbertDrafts/Hilbert6.lean b/HilbertDrafts/Hilbert6.lean new file mode 100644 index 0000000..351de6f --- /dev/null +++ b/HilbertDrafts/Hilbert6.lean @@ -0,0 +1,910 @@ +import Mathlib + +/-! +Hilbert 6: probability, mean values, finite classical mechanics, and kinetic/ +fluid-limit formulations in three dimensions. +The second namespace supplies a closed target, with explicit elastic dynamics, +conditioned product initial laws, collision integral, and limiting quantifiers. +This kinetic component is not the entire axiomatization-of-physics program. +-/ + +namespace HilbertDrafts.Hilbert6 + +open MeasureTheory Filter +open scoped Topology + +abbrev Space := EuclideanSpace ℝ (Fin 3) +abbrev Phase := Space × Space +abbrev Configuration (N : ℕ) := Fin N → Phase + +/-- Hard spheres in Euclidean three-space; this is not the periodic box model. -/ +def Nonoverlap {N : ℕ} (diameter : ℝ) (z : Configuration N) : Prop := + 0 < diameter ∧ ∀ i j, i ≠ j → diameter ≤ dist (z i).1 (z j).1 + +/-- Newtonian free flight between collisions. Collision times and boundary +events require their own construction and are not hidden in this predicate. -/ +def FreeFlight {N : ℕ} (z : ℝ → Configuration N) (I : Set ℝ) : Prop := + ∀ t ∈ I, ∀ i, + HasDerivAt (fun s => (z s i).1) (z t i).2 t ∧ + HasDerivAt (fun s => (z s i).2) 0 t + +/-- Three-dimensional Boltzmann--Grad scaling, with a nonzero finite limit. +The indexing uses N+1 particles, so an empty system is never averaged. -/ +def BoltzmannGrad (diameter : ℕ → ℝ) (density : ℝ) : Prop := + 0 < density ∧ (∀ N, 0 < diameter N) ∧ + Tendsto diameter atTop (𝓝 0) ∧ + Tendsto (fun N => ((N + 1 : ℕ) : ℝ) * diameter N ^ 2) atTop (𝓝 density) + +noncomputable def empiricalAverage (N : ℕ) (φ : Phase → ℝ) + (z : Configuration (N + 1)) : ℝ := + (∑ i, φ (z i)) / ((N + 1 : ℕ) : ℝ) + +/-- Expected empirical observable under an N+1-particle probability law. -/ +noncomputable def microscopicObservable (N : ℕ) + (law : Measure (Configuration (N + 1))) (φ : Phase → ℝ) : ℝ := + ∫ z, empiricalAverage N φ z ∂law + +/-- Uniform-in-time convergence of expected one-particle observables on [0,T]. +This does NOT assert concentration, higher marginal convergence, or a PDE. +The laws are normalized; explicit integrability prevents Lean's totalized +Bochner integral from silently assigning zero to nonintegrable observables. -/ +def ObservableLimit + (micro : (N : ℕ) → ℝ → Measure (Configuration (N + 1))) + (continuum : ℝ → Measure Phase) (T : ℝ) : Prop := + 0 < T ∧ + (∀ N t, t ∈ Set.Icc 0 T → IsProbabilityMeasure (micro N t)) ∧ + (∀ t, t ∈ Set.Icc 0 T → IsProbabilityMeasure (continuum t)) ∧ + ∀ φ : Phase → ℝ, Continuous φ → HasCompactSupport φ → + (∀ N t, t ∈ Set.Icc 0 T → Integrable (empiricalAverage N φ) (micro N t)) ∧ + (∀ t, t ∈ Set.Icc 0 T → Integrable φ (continuum t)) ∧ + ∀ η : ℝ, 0 < η → ∃ N₀ : ℕ, ∀ N ≥ N₀, ∀ t ∈ Set.Icc 0 T, + |microscopicObservable N (micro N t) φ - ∫ z, φ z ∂(continuum t)| < η + +/-- A normalization regression: a constant observable has exactly that value +on every nonempty finite configuration. -/ +theorem empiricalAverage_const (N : ℕ) (c : ℝ) (z : Configuration (N + 1)) : + empiricalAverage N (fun _ => c) z = c := by + have hN : (N : ℝ) + 1 ≠ 0 := by positivity + simp [empiricalAverage, mul_comm, hN] + +/-- A warning encoded as a theorem: frozen configurations meet free-flight +equations when velocities vanish. The equations alone do not select a gas law. -/ +theorem staticConfiguration_freeFlight {N : ℕ} (q : Fin N → Space) (I : Set ℝ) : + FreeFlight (fun _ i => (q i, 0)) I := by + intro t ht i + exact ⟨hasDerivAt_const t (q i), hasDerivAt_const t 0⟩ + +end HilbertDrafts.Hilbert6 + +namespace HilbertDrafts.Hilbert6Kinetic + +open HilbertDrafts.Hilbert6 MeasureTheory Filter +open scoped Topology InnerProductSpace + +noncomputable section + +/-- Equal-mass elastic scattering. -/ +def scatterLeft (v w n : Space) : Space := v - inner ℝ (v - w) n • n +def scatterRight (v w n : Space) : Space := w + inner ℝ (v - w) n • n + +/-- A genuine incoming binary collision, with the line of centres fixing the +normal. Every unaffected particle retains its velocity. -/ +def BinaryCollision {N : ℕ} (ε : ℝ) (q : Fin N → Space) + (before after : Fin N → Space) : Prop := + ∃ i j : Fin N, i ≠ j ∧ dist (q i) (q j) = ε ∧ + let n := ε⁻¹ • (q i - q j) + inner ℝ (before i - before j) n < 0 ∧ + after i = scatterLeft (before i) (before j) n ∧ + after j = scatterRight (before i) (before j) n ∧ + ∀ k, k ≠ i → k ≠ j → after k = before k + +/-- Finite collision histories on [0,T]. Positions are continuous, motion +between collisions is exactly affine, and velocities use the right-continuous +convention. Endpoints and the last velocity are specified explicitly. -/ +def CollisionPath {N : ℕ} (ε T : ℝ) (z : ℝ → Configuration N) : Prop := + 0 < ε ∧ 0 < T ∧ + (∀ t ∈ Set.Icc 0 T, Nonoverlap ε (z t)) ∧ + ∃ (m : ℕ) (times : Fin (m + 2) → ℝ) + (velocities : Fin (m + 1) → Fin N → Space), + StrictMono times ∧ times 0 = 0 ∧ times (Fin.last (m + 1)) = T ∧ + (∀ k : Fin (m + 1), ∀ t ∈ Set.Icc (times k.castSucc) (times k.succ), ∀ i, + (z t i).1 = (z (times k.castSucc) i).1 + + (t - times k.castSucc) • velocities k i) ∧ + (∀ k : Fin (m + 1), ∀ t ∈ Set.Ico (times k.castSucc) (times k.succ), ∀ i, + (z t i).2 = velocities k i) ∧ + (∀ i, (z T i).2 = velocities (Fin.last m) i) ∧ + ∀ k : Fin m, + BinaryCollision ε (fun i => (z (times k.succ.castSucc) i).1) + (velocities k.castSucc) (velocities k.succ) + +/-- A measurable realization of hard-sphere dynamics outside a Lebesgue-null +exceptional set. Singular simultaneous/grazing initial conditions are not +required to have a chosen dynamics. No statistical convergence is assumed. -/ +def IsHardSphereFlow {N : ℕ} (ε T : ℝ) + (Φ : ℝ → Configuration N → Configuration N) : Prop := + (∀ t ∈ Set.Icc 0 T, Measurable (Φ t)) ∧ + ∀ᵐ z ∂(volume.restrict {z : Configuration N | Nonoverlap ε z}), + Φ 0 z = z ∧ CollisionPath ε T (fun t => Φ t z) + +/-- Surface-area integration on S² through the usual spherical coordinates; +the sin(theta) Jacobian is explicit, avoiding Hausdorff normalization ambiguity. -/ +def spherePoint (θ ϕ : ℝ) : Space := + WithLp.toLp 2 ![Real.sin θ * Real.cos ϕ, Real.sin θ * Real.sin ϕ, Real.cos θ] + +def collisionIntegrand (f : ℝ → Phase → ℝ) (t : ℝ) (x v w : Space) + (θ ϕ : ℝ) : ℝ := + let n := spherePoint θ ϕ + Real.sin θ * max (inner ℝ (v - w) n) 0 * + (f t (x, scatterLeft v w n) * f t (x, scatterRight v w n) - + f t (x, v) * f t (x, w)) + +def collisionAngular (f : ℝ → Phase → ℝ) (t : ℝ) (x v w : Space) : ℝ := + ∫ θ in (0 : ℝ)..Real.pi, ∫ ϕ in (0 : ℝ)..(2 * Real.pi), + collisionIntegrand f t x v w θ ϕ + +def collisionOperator (f : ℝ → Phase → ℝ) (t : ℝ) (x v : Space) : ℝ := + ∫ w : Space, collisionAngular f t x v w + +def CollisionIntegrable (f : ℝ → Phase → ℝ) (t : ℝ) (x v : Space) : Prop := + Integrable (collisionAngular f t x v) ∧ + (∀ w, IntervalIntegrable (fun θ => ∫ ϕ in (0 : ℝ)..(2 * Real.pi), + collisionIntegrand f t x v w θ ϕ) volume 0 Real.pi) ∧ + ∀ w θ, θ ∈ Set.Icc 0 Real.pi → + IntervalIntegrable (collisionIntegrand f t x v w θ) volume 0 (2 * Real.pi) + +/-- A concrete smooth, compactly supported probability density. This selects +a regular subclass of the weighted initial-data hypotheses in the source. -/ +def InitialDensity (f₀ : Phase → ℝ) : Prop := + ContDiff ℝ 1 f₀ ∧ HasCompactSupport f₀ ∧ + (∀ z, 0 ≤ f₀ z) ∧ Integrable f₀ ∧ ∫ z, f₀ z = 1 + +/-- The hard-sphere Boltzmann equation written along straight characteristics. +The initial trace, positive mass, Gaussian velocity bound, and integrability +of the displayed collision integral are all part of the explicit definition. -/ +def StrongBoltzmannSolution (f₀ : Phase → ℝ) (T : ℝ) (f : ℝ → Phase → ℝ) : Prop := + 0 < T ∧ + ContinuousOn (fun p : ℝ × Phase => f p.1 p.2) (Set.Icc 0 T ×ˢ Set.univ) ∧ + (∀ z, f 0 z = f₀ z) ∧ + (∀ t ∈ Set.Icc 0 T, (∀ z, 0 ≤ f t z) ∧ Integrable (f t) ∧ ∫ z, f t z = 1) ∧ + (∃ β A : ℝ, 0 < β ∧ 0 < A ∧ ∀ t ∈ Set.Icc 0 T, ∀ x v : Space, + f t (x, v) ≤ A * Real.exp (-β * ‖v‖ ^ 2)) ∧ + ∀ t ∈ Set.Ioo 0 T, ∀ x v : Space, + CollisionIntegrable f t x v ∧ + HasDerivAt (fun s => f s (x + (s - t) • v, v)) (collisionOperator f t x v) t + +/-- N+1 particles and diameter (N+1)^(-1/2): collision rate one in dimension 3. -/ +def diameter (N : ℕ) : ℝ := Real.sqrt (1 / ((N + 1 : ℕ) : ℝ)) + +def initialWeight (N : ℕ) (f₀ : Phase → ℝ) (z : Configuration (N + 1)) : ℝ := by + classical + exact if Nonoverlap (diameter N) z then ∏ i, f₀ (z i) else 0 + +def partitionFunction (N : ℕ) (f₀ : Phase → ℝ) : ℝ := ∫ z, initialWeight N f₀ z + +def initialLaw (N : ℕ) (f₀ : Phase → ℝ) : Measure (Configuration (N + 1)) := + (ENNReal.ofReal (partitionFunction N f₀))⁻¹ • + volume.withDensity (fun z => ENNReal.ofReal (initialWeight N f₀ z)) + +def evolvedLaw (N : ℕ) (f₀ : Phase → ℝ) + (Φ : ℝ → Configuration (N + 1) → Configuration (N + 1)) (t : ℝ) : + Measure (Configuration (N + 1)) := Measure.map (Φ t) (initialLaw N f₀) + +/-- Uniform-in-time weak convergence and concentration of empirical means, +for each compactly supported continuous test, under the transported laws. +The probability clause is the kinetic counterpart of the fluid mean-value law. -/ +def KineticConvergence (f₀ : Phase → ℝ) (T : ℝ) (f : ℝ → Phase → ℝ) + (Φ : (N : ℕ) → ℝ → Configuration (N + 1) → Configuration (N + 1)) : Prop := + (∀ᶠ N in atTop, Integrable (initialWeight N f₀) ∧ + 0 < partitionFunction N f₀ ∧ IsProbabilityMeasure (initialLaw N f₀)) ∧ + ∀ φ : Phase → ℝ, Continuous φ → HasCompactSupport φ → + ∀ η : ℝ, 0 < η → ∃ N₀ : ℕ, ∀ N ≥ N₀, ∀ t ∈ Set.Icc 0 T, + Integrable (empiricalAverage N φ) (evolvedLaw N f₀ (Φ N) t) ∧ + Integrable (fun z => φ z * f t z) ∧ + |microscopicObservable N (evolvedLaw N f₀ (Φ N) t) φ - + ∫ z, φ z * f t z| < η ∧ + (evolvedLaw N f₀ (Φ N) t) + {z | η ≤ |empiricalAverage N φ z - ∫ y, φ y * f t y|} < ENNReal.ofReal η + +/-- Closed formulation of the Newton-to-Boltzmann kinetic component of #6. +Existence clauses prevent vacuous quantification over nonexistent flows or PDE +solutions. This canonical-ensemble variant is asserted in the reference's +Remark 1.5(4), whose proof treats the grand-canonical ensemble. Its exact +statement is an obligation here, not a certified transcription or new bounty. -/ +def NewtonBoltzmannLimit : Prop := + (∀ f₀ : Phase → ℝ, InitialDensity f₀ → + ∃ (T : ℝ) (f : ℝ → Phase → ℝ), StrongBoltzmannSolution f₀ T f) ∧ + (∀ (N : ℕ) (ε T : ℝ), 0 < ε → 0 < T → + ∃ Φ : ℝ → Configuration N → Configuration N, IsHardSphereFlow ε T Φ) ∧ + ∀ (f₀ : Phase → ℝ) (T : ℝ) (f : ℝ → Phase → ℝ), + InitialDensity f₀ → StrongBoltzmannSolution f₀ T f → + ∀ Φ : (N : ℕ) → ℝ → Configuration (N + 1) → Configuration (N + 1), + (∀ N, IsHardSphereFlow (diameter N) T (Φ N)) → KineticConvergence f₀ T f Φ + +theorem scatter_momentum (v w n : Space) : + scatterLeft v w n + scatterRight v w n = v + w := by + unfold scatterLeft scatterRight + abel + +theorem diameter_pos (N : ℕ) : 0 < diameter N := by + unfold diameter + positivity + +theorem diameter_scaling (N : ℕ) : ((N + 1 : ℕ) : ℝ) * diameter N ^ 2 = 1 := by + rw [diameter, Real.sq_sqrt (by positivity)] + have hN : ((N + 1 : ℕ) : ℝ) ≠ 0 := by positivity + field_simp + +end +end HilbertDrafts.Hilbert6Kinetic + +/-! Wikipedia-guided additions: probability axioms, mean values, and classical +mechanics. These are concrete mathematical specifications and theorems, not +uninterpreted predicates standing for an unspecified physical theory. -/ +namespace HilbertDrafts.Hilbert6Probability + +open MeasureTheory ProbabilityTheory Filter +open scoped Topology ProbabilityTheory ENNReal + +noncomputable section + +/-- Kolmogorov data on a sigma algebra. Nonnegativity is built into ENNReal; +normalization and countable additivity are explicit. -/ +structure ProbabilityAxioms (Ω : Type) [MeasurableSpace Ω] where + probability : Set Ω → ℝ≥0∞ + empty : probability ∅ = 0 + total : probability Set.univ = 1 + additive : ∀ (s : ℕ → Set Ω), (∀ n, MeasurableSet (s n)) → + Pairwise (fun i j => Disjoint (s i) (s j)) → probability (⋃ n, s n) = ∑' n, probability (s n) + +variable {Ω : Type} [MeasurableSpace Ω] + +def ProbabilityAxioms.toMeasure (P : ProbabilityAxioms Ω) : Measure Ω := + Measure.ofMeasurable (fun s _ => P.probability s) P.empty + (fun s hs hd => P.additive s hs hd) + +theorem ProbabilityAxioms.toMeasure_apply (P : ProbabilityAxioms Ω) + (s : Set Ω) (hs : MeasurableSet s) : P.toMeasure s = P.probability s := + Measure.ofMeasurable_apply s hs + +instance ProbabilityAxioms.isProbabilityMeasure (P : ProbabilityAxioms Ω) : + IsProbabilityMeasure P.toMeasure := + ⟨(P.toMeasure_apply Set.univ MeasurableSet.univ).trans P.total⟩ + +/-- Countable-additivity data determine one and only one measure on the given +sigma algebra. No assertion about nonmeasurable event values is needed. -/ +theorem ProbabilityAxioms.unique_measure (P : ProbabilityAxioms Ω) + (μ : Measure Ω) (h : ∀ s, MeasurableSet s → μ s = P.probability s) : + μ = P.toMeasure := by + apply Measure.ext + intro s hs + rw [h s hs, P.toMeasure_apply s hs] + +/-- Every probability measure supplies a model of the proposed axioms. -/ +def ProbabilityAxioms.ofMeasure (μ : Measure Ω) [IsProbabilityMeasure μ] : + ProbabilityAxioms Ω where + probability := μ + empty := measure_empty + total := measure_univ + additive := fun _s hs hd => measure_iUnion hd hs + +/-- Actual model existence establishes compatibility of the probability +axioms on every nonempty sample space, without a first-order translation. -/ +theorem probability_axioms_consistent [Nonempty Ω] : Nonempty (ProbabilityAxioms Ω) := + ⟨ProbabilityAxioms.ofMeasure (Measure.dirac (Classical.choice ‹Nonempty Ω›))⟩ + +/-- A fully quantified version of the method of mean values: empirical means +of pairwise independent identically distributed integrable real observables +converge almost surely to their expectation. -/ +def MeanValueLaw : Prop := + ∀ (Ω : Type) [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] + (X : ℕ → Ω → ℝ), Integrable (X 0) μ → + Pairwise (fun i j => IndepFun (X i) (X j) μ) → + (∀ i, IdentDistrib (X i) (X 0) μ μ) → + ∀ᵐ ω ∂μ, Tendsto (fun n : ℕ => (∑ i ∈ Finset.range n, X i ω) / n) + atTop (𝓝 (∫ ω, X 0 ω ∂μ)) + +/-- This component is already proved mathematics, via Mathlib's strong law. -/ +theorem meanValueLaw : MeanValueLaw := by + intro Ω _ μ _ X hint hindep hident + exact strong_law_ae_real X hint hindep hident + +end +end HilbertDrafts.Hilbert6Probability + +namespace HilbertDrafts.Hilbert6Mechanics + +open HilbertDrafts.Hilbert6 + +noncomputable section + +/-- A finite classical system with time-dependent forces and positive masses. +Collisional hard-sphere dynamics are specified separately in Hilbert6Kinetic. -/ +structure System (N : ℕ) where + mass : Fin N → ℝ + mass_positive : ∀ i, 0 < mass i + force : ℝ → (Fin N → Space) → Fin N → Space + +/-- Newton's equations on a specified time domain, in velocity variables. -/ +def Newtonian {N : ℕ} (S : System N) (I : Set ℝ) + (q v : ℝ → Fin N → Space) : Prop := + ∀ t ∈ I, ∀ i, + HasDerivAt (fun s => q s i) (v t i) t ∧ + HasDerivAt (fun s => v s i) ((S.mass i)⁻¹ • S.force t (q t) i) t + +/-- The same physical equations in momentum variables. This is not called a +Hamiltonian system: no potential-force hypothesis has been imposed. -/ +def MomentumEquations {N : ℕ} (S : System N) (I : Set ℝ) + (q p : ℝ → Fin N → Space) : Prop := + ∀ t ∈ I, ∀ i, + HasDerivAt (fun s => q s i) ((S.mass i)⁻¹ • p t i) t ∧ + HasDerivAt (fun s => p s i) (S.force t (q t) i) t + +/-- Changing variables p_i = m_i v_i preserves the equations in both + directions. This gives a checked relation between two axiom presentations. -/ +theorem newtonian_iff_momentum {N : ℕ} (S : System N) (I : Set ℝ) + (q v : ℝ → Fin N → Space) : + Newtonian S I q v ↔ + MomentumEquations S I q (fun t i => S.mass i • v t i) := by + constructor + · intro h t ht i + have hm : S.mass i ≠ 0 := ne_of_gt (S.mass_positive i) + refine ⟨by simpa [smul_smul, hm] using (h t ht i).1, ?_⟩ + simpa [Pi.smul_apply, smul_smul, hm] using ((h t ht i).2.fun_const_smul (S.mass i)) + · intro h t ht i + have hm : S.mass i ≠ 0 := ne_of_gt (S.mass_positive i) + refine ⟨by simpa [smul_smul, hm] using (h t ht i).1, ?_⟩ + simpa [Pi.smul_apply, smul_smul, hm] using ((h t ht i).2.fun_const_smul (S.mass i)⁻¹) + +/-- A nonempty class of actual models: arbitrary initial positions and +velocities evolve by free motion when the force vanishes. -/ +theorem freeMotion {N : ℕ} (S : System N) + (hF : ∀ t q i, S.force t q i = 0) (q₀ v₀ : Fin N → Space) (I : Set ℝ) : + Newtonian S I (fun t i => q₀ i + t • v₀ i) (fun _ i => v₀ i) := by + intro t ht i + constructor + · simpa using ((hasDerivAt_id t).smul_const (v₀ i)).const_add (q₀ i) + · simpa [hF] using hasDerivAt_const t (v₀ i) + +end +end HilbertDrafts.Hilbert6Mechanics + +namespace HilbertDrafts.Hilbert6Fluid + +open scoped ContDiff + +open HilbertDrafts.Hilbert6 HilbertDrafts.Hilbert6Kinetic MeasureTheory Filter +open scoped Topology InnerProductSpace + +noncomputable section + +/-- Lift of an integer lattice translation to Euclidean three-space. -/ +def lattice (k : Fin 3 → ℤ) : Space := WithLp.toLp 2 (fun i => (k i : ℝ)) +def cell : Set Space := {x | ∀ i, 0 ≤ x i ∧ x i < 1} +def phaseCell : Set Phase := {z | z.1 ∈ cell} +def Periodic {A : Type} (f : Space → A) : Prop := + ∀ x k, f (x + lattice k) = f x + +/-- Lifted positions are separated from every periodic image. -/ +def TorusNonoverlap {N : ℕ} (ε : ℝ) (z : Configuration N) : Prop := + 0 < ε ∧ ε < 1 / 2 ∧ + ∀ i j, i ≠ j → ∀ k : Fin 3 → ℤ, ε ≤ dist (z i).1 ((z j).1 + lattice k) + +def TorusCollision {N : ℕ} (ε : ℝ) (q : Fin N → Space) + (before after : Fin N → Space) : Prop := + ∃ (i j : Fin N) (k : Fin 3 → ℤ), i ≠ j ∧ dist (q i) (q j + lattice k) = ε ∧ + let n := ε⁻¹ • (q i - (q j + lattice k)) + inner ℝ (before i - before j) n < 0 ∧ + after i = scatterLeft (before i) (before j) n ∧ + after j = scatterRight (before i) (before j) n ∧ + ∀ l, l ≠ i → l ≠ j → after l = before l + +/-- Continuous lifts of torus positions, affine between genuine periodic +collisions. Velocities have the same right-continuous convention as above. -/ +def TorusPath {N : ℕ} (ε T : ℝ) (z : ℝ → Configuration N) : Prop := + 0 < T ∧ (∀ t ∈ Set.Icc 0 T, TorusNonoverlap ε (z t)) ∧ + ∃ (m : ℕ) (times : Fin (m + 2) → ℝ) + (velocities : Fin (m + 1) → Fin N → Space), + StrictMono times ∧ times 0 = 0 ∧ times (Fin.last (m + 1)) = T ∧ + (∀ k : Fin (m + 1), ∀ t ∈ Set.Icc (times k.castSucc) (times k.succ), ∀ i, + (z t i).1 = (z (times k.castSucc) i).1 + + (t - times k.castSucc) • velocities k i) ∧ + (∀ k : Fin (m + 1), ∀ t ∈ Set.Ico (times k.castSucc) (times k.succ), ∀ i, + (z t i).2 = velocities k i) ∧ + (∀ i, (z T i).2 = velocities (Fin.last m) i) ∧ + ∀ k : Fin m, TorusCollision ε (fun i => (z (times k.succ.castSucc) i).1) + (velocities k.castSucc) (velocities k.succ) + +def IsTorusFlow {N : ℕ} (ε T : ℝ) + (Φ : ℝ → Configuration N → Configuration N) : Prop := + (∀ t ∈ Set.Icc 0 T, Measurable (Φ t)) ∧ + ∀ᵐ z ∂(volume.restrict {z : Configuration N | + (∀ i, (z i).1 ∈ cell) ∧ TorusNonoverlap ε z}), + Φ 0 z = z ∧ TorusPath ε T (fun t => Φ t z) + +/-- A mean free path κ corresponds to (N+1) ε² = κ⁻¹. -/ +def fluidDiameter (κ : ℝ) (N : ℕ) : ℝ := + Real.sqrt (1 / (κ * ((N + 1 : ℕ) : ℝ))) + +def torusWeight (κ : ℝ) (N : ℕ) (f₀ : Phase → ℝ) + (z : Configuration (N + 1)) : ℝ := by + classical + exact if (∀ i, (z i).1 ∈ cell) ∧ TorusNonoverlap (fluidDiameter κ N) z + then ∏ i, f₀ (z i) else 0 + +def torusPartition (κ : ℝ) (N : ℕ) (f₀ : Phase → ℝ) : ℝ := + ∫ z, torusWeight κ N f₀ z + +def torusLaw (κ : ℝ) (N : ℕ) (f₀ : Phase → ℝ) : Measure (Configuration (N + 1)) := + (ENNReal.ofReal (torusPartition κ N f₀))⁻¹ • + volume.withDensity (fun z => ENNReal.ofReal (torusWeight κ N f₀ z)) + +def torusEvolvedLaw (κ : ℝ) (N : ℕ) (f₀ : Phase → ℝ) + (Φ : ℝ → Configuration (N + 1) → Configuration (N + 1)) (t : ℝ) : + Measure (Configuration (N + 1)) := Measure.map (Φ t) (torusLaw κ N f₀) + +/-- A local Maxwell distribution with density ρ, bulk velocity u, and + temperature θ. Positivity of θ is required in the solution predicates. -/ +def maxwell (ρ θ : ℝ) (u v : Space) : ℝ := + ρ / (Real.sqrt (2 * Real.pi * θ)) ^ 3 * + Real.exp (-‖v - u‖ ^ 2 / (2 * θ)) + +structure FluidState where + density : ℝ → Space → ℝ + velocity : ℝ → Space → Space + temperature : ℝ → Space → ℝ + +def localMaxwell (U : FluidState) (t : ℝ) (z : Phase) : ℝ := + maxwell (U.density t z.1) (U.temperature t z.1) (U.velocity t z.1) z.2 + +def coordinateDerivative (f : Space → ℝ) (x : Space) (i : Fin 3) : ℝ := + deriv (fun a : ℝ => f (x + a • WithLp.toLp 2 (Pi.single i 1))) 0 + +def divergence (f : Space → Space) (x : Space) : ℝ := + ∑ i, coordinateDerivative (fun y => f y i) x i + +def laplacian (f : Space → ℝ) (x : Space) : ℝ := + ∑ i, coordinateDerivative (fun y => coordinateDerivative f y i) x i + +def energy (U : FluidState) (t : ℝ) (x : Space) : ℝ := + U.density t x * (‖U.velocity t x‖ ^ 2 + 3 * U.temperature t x) / 2 + +/-- Compressible monatomic Euler, in conservation form. Smoothness ensures +that all displayed total derivatives mean genuine derivatives. Periodicity, +positive density/temperature, and unit mass fix the physical interpretation. -/ +def SmoothEuler (U : FluidState) (T : ℝ) : Prop := + 0 < T ∧ + ContDiff ℝ ∞ (fun p : ℝ × Space => U.density p.1 p.2) ∧ + ContDiff ℝ ∞ (fun p : ℝ × Space => U.velocity p.1 p.2) ∧ + ContDiff ℝ ∞ (fun p : ℝ × Space => U.temperature p.1 p.2) ∧ + ∀ t ∈ Set.Icc 0 T, + Periodic (U.density t) ∧ Periodic (U.velocity t) ∧ Periodic (U.temperature t) ∧ + (∀ x, 0 < U.density t x ∧ 0 < U.temperature t x) ∧ + (∫ x in cell, U.density t x) = 1 ∧ + ∀ x, + deriv (fun s => U.density s x) t + + divergence (fun y => U.density t y • U.velocity t y) x = 0 ∧ + (∀ i : Fin 3, + deriv (fun s => U.density s x * U.velocity s x i) t + + (∑ j : Fin 3, coordinateDerivative (fun y => + U.density t y * U.velocity t y i * U.velocity t y j + + if i = j then U.density t y * U.temperature t y else 0) x j) = 0) ∧ + deriv (fun s => energy U s x) t + divergence (fun y => + (energy U t y + U.density t y * U.temperature t y) • U.velocity t y) x = 0 + +/-- Incompressible Navier--Stokes--Fourier with universal positive transport +coefficients. The density fluctuation is fixed to -θ (Boussinesq relation). +Mean-zero temperature makes the initial particle density integrate to one. -/ +def SmoothNSF (ν χ T : ℝ) (u : ℝ → Space → Space) + (θ p : ℝ → Space → ℝ) : Prop := + 0 < ν ∧ 0 < χ ∧ 0 < T ∧ + ContDiff ℝ ∞ (fun q : ℝ × Space => u q.1 q.2) ∧ + ContDiff ℝ ∞ (fun q : ℝ × Space => θ q.1 q.2) ∧ + ContDiff ℝ ∞ (fun q : ℝ × Space => p q.1 q.2) ∧ + ∀ t ∈ Set.Icc 0 T, Periodic (u t) ∧ Periodic (θ t) ∧ Periodic (p t) ∧ + (∫ x in cell, θ t x) = 0 ∧ ∀ x, + divergence (u t) x = 0 ∧ + (∀ i : Fin 3, deriv (fun s => u s x i) t + + (∑ j : Fin 3, u t x j * coordinateDerivative (fun y => u t y i) x j) + + coordinateDerivative (p t) x i = ν * laplacian (fun y => u t y i) x) ∧ + deriv (fun s => θ s x) t + + (∑ j : Fin 3, u t x j * coordinateDerivative (θ t) x j) = + χ * laplacian (θ t) x + +/-- Local existence for arbitrary smooth positive periodic Euler data. +This is a known PDE theorem obligation, stronger than an equilibrium witness. +Global smooth extensions are only a representation convention: the equations +and positivity are imposed on the displayed compact time interval. -/ +def EulerLocalExistence : Prop := + ∀ (ρ θ : Space → ℝ) (u : Space → Space), + ContDiff ℝ ∞ ρ → ContDiff ℝ ∞ θ → ContDiff ℝ ∞ u → + Periodic ρ → Periodic θ → Periodic u → + (∀ x, 0 < ρ x ∧ 0 < θ x) → (∫ x in cell, ρ x) = 1 → + ∃ (U : FluidState) (T : ℝ), SmoothEuler U T ∧ + U.density 0 = ρ ∧ U.temperature 0 = θ ∧ U.velocity 0 = u + +/-- Local existence for arbitrary smooth divergence-free periodic velocity +and mean-zero temperature data, at the specified positive coefficients. -/ +def NSFLocalExistence (ν χ : ℝ) : Prop := + 0 < ν → 0 < χ → ∀ (u₀ : Space → Space) (θ₀ : Space → ℝ), + ContDiff ℝ ∞ u₀ → ContDiff ℝ ∞ θ₀ → Periodic u₀ → Periodic θ₀ → + (∀ x, divergence u₀ x = 0) → (∫ x in cell, θ₀ x) = 0 → + ∃ (T : ℝ) (u : ℝ → Space → Space) (θ p : ℝ → Space → ℝ), + SmoothNSF ν χ T u θ p ∧ u 0 = u₀ ∧ θ 0 = θ₀ + +def nsfInitial (u : Space → Space) (θ : Space → ℝ) (κ : ℝ) (z : Phase) : ℝ := + maxwell (1 - κ * θ z.1) (1 + κ * θ z.1) (κ • u z.1) z.2 + +def nsfFluctuation (u : Space → Space) (θ : Space → ℝ) (z : Phase) : ℝ := + maxwell 1 1 0 z.2 * + (inner ℝ (u z.1) z.2 + θ z.1 * (‖z.2‖ ^ 2 - 5) / 2) + +/-- Periodic, continuous tests with bounded velocity support. -/ +def FluidTest (φ : Phase → ℝ) : Prop := + Continuous φ ∧ (∀ v, Periodic (fun x => φ (x, v))) ∧ + ∃ R : ℝ, 0 < R ∧ ∀ x v, R ≤ ‖v‖ → φ (x, v) = 0 + +/-- A direct particle-to-fluid limit. κ is sent to zero after the particle +limit. rescale=1 gives Euler; rescale=κ and observing at t/κ gives NSF. +Nonzero partition functions, integrability, and probability normalization are +conclusions, so totalized integrals cannot manufacture convergence. -/ +def ParticleFluidLimit (initial : ℝ → Phase → ℝ) (limit : ℝ → Phase → ℝ) + (baseline : Phase → ℝ) (rescale : ℝ → ℝ) (T : ℝ) : Prop := + ∀ Φ : (κ : ℝ) → (N : ℕ) → ℝ → Configuration (N + 1) → Configuration (N + 1), + (∀ κ : ℝ, 0 < κ → ∀ᶠ N in atTop, + IsTorusFlow (fluidDiameter κ N) (T / rescale κ) (Φ κ N)) → + ∀ φ : Phase → ℝ, FluidTest φ → ∀ η : ℝ, 0 < η → + ∃ κ₀ : ℝ, 0 < κ₀ ∧ ∀ κ : ℝ, 0 < κ → κ < κ₀ → + ∃ N₀ : ℕ, ∀ N ≥ N₀, + (∀ z, 0 ≤ initial κ z) ∧ Integrable (torusWeight κ N (initial κ)) ∧ + 0 < torusPartition κ N (initial κ) ∧ + IsProbabilityMeasure (torusLaw κ N (initial κ)) ∧ + ∀ t ∈ Set.Icc 0 T, + let law := torusEvolvedLaw κ N (initial κ) (Φ κ N) (t / rescale κ) + IsProbabilityMeasure law ∧ Integrable (empiricalAverage N φ) law ∧ + IntegrableOn (fun z => φ z * baseline z) phaseCell ∧ + IntegrableOn (fun z => φ z * limit t z) phaseCell ∧ + |(microscopicObservable N law φ - ∫ z in phaseCell, φ z * baseline z) / + rescale κ - ∫ z in phaseCell, φ z * limit t z| < η ∧ + law {z | η ≤ |(empiricalAverage N φ z - + ∫ y in phaseCell, φ y * baseline y) / rescale κ - + ∫ y in phaseCell, φ y * limit t y|} < ENNReal.ofReal η + +/-- Explicit existence of microscopic flows is part of the task. -/ +def TorusFlowExistence : Prop := + ∀ (N : ℕ) (ε T : ℝ), 0 < ε → ε < 1 / 2 → 0 < T → + ∃ Φ : ℝ → Configuration N → Configuration N, IsTorusFlow ε T Φ + +/-- Proposed periodic, canonical-ensemble fluid formulation. This is a +review candidate inspired by the source's fluid limits, not a transcription +of its grand-canonical quantitative theorem. The exact-Maxwellian Euler +initial data also differ from the source's prepared Hilbert-expansion data; +an initial-layer argument is a separate, unverified obligation. -/ +def FluidLimitProgram : Prop := + TorusFlowExistence ∧ + EulerLocalExistence ∧ + (∀ (U : FluidState) (T : ℝ), SmoothEuler U T → + ParticleFluidLimit (fun _ => localMaxwell U 0) (localMaxwell U) + (fun _ => 0) (fun _ => 1) T) ∧ + ∃ ν χ : ℝ, 0 < ν ∧ 0 < χ ∧ + NSFLocalExistence ν χ ∧ + ∀ (T : ℝ) (u : ℝ → Space → Space) (θ p : ℝ → Space → ℝ), + SmoothNSF ν χ T u θ p → + ParticleFluidLimit (nsfInitial (u 0) (θ 0)) + (fun t => nsfFluctuation (u t) (θ t)) (fun z => maxwell 1 1 0 z.2) id T + +/-- A closed statement for the selected classical gas program. Probability +axioms and Newton/momentum equivalence are separately constructed and proved. +This does not purport to axiomatize quantum field theory or general relativity. -/ +def ClassicalGasProgram : Prop := + Hilbert6Probability.MeanValueLaw ∧ NewtonBoltzmannLimit ∧ FluidLimitProgram + +theorem fluidDiameter_scaling {κ : ℝ} (hκ : 0 < κ) (N : ℕ) : + ((N + 1 : ℕ) : ℝ) * fluidDiameter κ N ^ 2 = κ⁻¹ := by + rw [fluidDiameter, Real.sq_sqrt (by positivity)] + have hN : ((N + 1 : ℕ) : ℝ) ≠ 0 := by positivity + field_simp + +theorem classicalGas_implies_fluid (h : ClassicalGasProgram) : FluidLimitProgram := h.2.2 + +theorem classicalGas_implies_kinetic (h : ClassicalGasProgram) : NewtonBoltzmannLimit := h.2.1 + +end +end HilbertDrafts.Hilbert6Fluid + +/-! Optional appendix: general first-order semantic tools. These illustrate +consequence, equivalence and compatibility; they are not required components +of the selected physical-model interpretation of Hilbert 6. -/ +namespace HilbertDrafts.Hilbert6Logic + +open FirstOrder FirstOrder.Language + +universe u v + +variable (L : FirstOrder.Language.{u, v}) + +/-- The semantic deductive closure: exactly the first-order sentences true in +all nonempty models of the specified theory. This does not assert that every +physical theory has already been translated into this language. -/ +def consequences (T : L.Theory) : L.Theory := {φ | T ⊨ᵇ φ} + +/-- Two presentations in the same language have the same logical content. -/ +def EquivalentAxioms (T U : L.Theory) : Prop := + consequences L T = consequences L U + +/-- Adjoining U to T is compatible precisely when the combined axioms have +a nonempty model. This is a mathematical criterion, not an asserted decision +algorithm or a claim that arbitrary extensions are always compatible. -/ +def Compatible (T U : L.Theory) : Prop := (T ∪ U).IsSatisfiable + +/-- An actual common model witnesses compatibility. -/ +theorem compatible_of_common_model (T U : L.Theory) (M : Type*) + [Nonempty M] [L.Structure M] (hT : M ⊨ T) (hU : M ⊨ U) : + Compatible L T U := by + let : M ⊨ T ∪ U := hT.union hU + exact Theory.Model.isSatisfiable M + +/-- Any compatible extension retains a model of the old axioms. -/ +theorem compatible_implies_base_satisfiable (T U : L.Theory) + (h : Compatible L T U) : T.IsSatisfiable := + h.mono Set.subset_union_left + +/-- Equivalence can be checked by mutual semantic derivability of the axioms. -/ +theorem equivalent_iff_mutual_consequence (T U : L.Theory) : + EquivalentAxioms L T U ↔ + (∀ φ ∈ T, U ⊨ᵇ φ) ∧ (∀ φ ∈ U, T ⊨ᵇ φ) := by + constructor + · intro h + constructor + · intro φ hφ + have hmem : φ ∈ consequences L T := Theory.models_sentence_of_mem hφ + rwa [show consequences L T = consequences L U from h] at hmem + · intro φ hφ + have hmem : φ ∈ consequences L U := Theory.models_sentence_of_mem hφ + rwa [← show consequences L T = consequences L U from h] at hmem + · rintro ⟨hTU, hUT⟩ + apply Set.ext + intro φ + exact ⟨Theory.models_of_models_theory hTU, Theory.models_of_models_theory hUT⟩ + +/-- Every semantic consequence is already forced by finitely many axioms. +This is compactness; no effective enumeration of all consequences is claimed. -/ +theorem consequence_has_finite_basis (T : L.Theory) (φ : L.Sentence) : + φ ∈ consequences L T ↔ + ∃ S : Finset L.Sentence, (S : L.Theory) ⊆ T ∧ (S : L.Theory) ⊨ᵇ φ := + Theory.models_iff_finset_models + +/-- All finite fragments must be jointly satisfiable, not merely each new +axiom individually. This is the exact first-order compatibility condition. -/ +theorem compatible_iff_finite_fragments (T U : L.Theory) : + Compatible L T U ↔ + ∀ S : Finset L.Sentence, (S : L.Theory) ⊆ T ∪ U → Theory.IsSatisfiable (S : L.Theory) := + Theory.isSatisfiable_iff_isFinitelySatisfiable + +end HilbertDrafts.Hilbert6Logic + +namespace HilbertDrafts.Hilbert6Rigid + +open scoped Matrix.Norms.Frobenius + +open HilbertDrafts.Hilbert6 MeasureTheory Filter +open scoped Topology + +noncomputable section + +abbrev Mat := Matrix (Fin 3) (Fin 3) ℝ + +def act (A : Mat) (x : Space) : Space := + WithLp.toLp 2 (fun i => ∑ j, A i j * x j) + +def properRotations : Set Mat := {R | R.transpose * R = 1 ∧ R.det = 1} + +def cross (x y : Space) : Space := + WithLp.toLp 2 ![x 1 * y 2 - x 2 * y 1, + x 2 * y 0 - x 0 * y 2, x 0 * y 1 - x 1 * y 0] + +def spin (ω : Space) : Mat := + !![0, -ω 2, ω 1; ω 2, 0, -ω 0; -ω 1, ω 0, 0] + +/-- Reference bodies are rectangular continua of arbitrary positive half-side +lengths and uniform density. Different side lengths permit anisotropic inertia. -/ +def body (a : Fin 3 → ℝ) : Set Space := {x | ∀ i, |x i| ≤ a i} + +/-- Principal moments up to the common positive factor mass/3, which cancels +from Euler's torque-free equations. -/ +def principalMoments (a : Fin 3 → ℝ) : Fin 3 → ℝ := + ![a 1 ^ 2 + a 2 ^ 2, a 0 ^ 2 + a 2 ^ 2, a 0 ^ 2 + a 1 ^ 2] + +/-- Angular acceleration in body coordinates, including the unequal-inertia +terms. No constant-spin assumption is made for an anisotropic body. -/ +def eulerAngular (a : Fin 3 → ℝ) (ω : Space) : Space := + let I := principalMoments a + WithLp.toLp 2 ![(I 1 - I 2) / I 0 * ω 1 * ω 2, + (I 2 - I 0) / I 1 * ω 2 * ω 0, (I 0 - I 1) / I 2 * ω 0 * ω 1] + +def gradient (f : Space → Space) (x : Space) : Mat := + fun i j => fderiv ℝ f x (WithLp.toLp 2 (Pi.single j 1)) i + +def velocity (y : ℝ → Space → Space) (t : ℝ) (x : Space) : Space := + deriv (fun s => y s x) t + +/-- Continuum axioms for a free body becoming stiff. They specify smooth +motion, integrable physical observables, conserved linear/angular momenta, +and a uniform kinetic-plus-stiffness energy bound. They do not assume a rigid +limit, a rotation field, or the Euler equations that occur in the conclusion. +This is an explicit selected model, not a universal constitutive law. -/ +def StiffContinuum (a : Fin 3 → ℝ) (T : ℝ) + (y : ℕ → ℝ → Space → Space) : Prop := + (∀ i, 0 < a i) ∧ 0 < T ∧ + (∀ N, ContDiff ℝ 2 (fun p : ℝ × Space => y N p.1 p.2)) ∧ + ∃ C : ℝ, 0 < C ∧ ∀ N : ℕ, ∀ t ∈ Set.Icc 0 T, + IntegrableOn (y N t) (body a) ∧ + IntegrableOn (velocity (y N) t) (body a) ∧ + IntegrableOn (fun x => cross (y N t x) (velocity (y N) t x)) (body a) ∧ + IntegrableOn (fun x => ‖velocity (y N) t x‖ ^ 2) (body a) ∧ + IntegrableOn (fun x => Metric.infDist (gradient (y N t) x) properRotations ^ 2) + (body a) ∧ + (∫ x in body a, velocity (y N) t x) = (∫ x in body a, velocity (y N) 0 x) ∧ + (∫ x in body a, cross (y N t x) (velocity (y N) t x)) = + (∫ x in body a, cross (y N 0 x) (velocity (y N) 0 x)) ∧ + (∫ x in body a, ‖velocity (y N) t x‖ ^ 2) + ((N + 1 : ℕ) : ℝ) ^ 2 * + (∫ x in body a, Metric.infDist (gradient (y N t) x) properRotations ^ 2) ≤ C + +/-- Well-prepared initial position and velocity, measured in squared L² norm. +The initial spin is in body coordinates, hence R₀(ω₀ × x). -/ +def InitialPreparation (a : Fin 3 → ℝ) (c₀ V₀ ω₀ : Space) (R₀ : Mat) + (y : ℕ → ℝ → Space → Space) : Prop := + R₀ ∈ properRotations ∧ + Tendsto (fun N => ∫ x in body a, ‖y N 0 x - (c₀ + act R₀ x)‖ ^ 2) + atTop (𝓝 0) ∧ + Tendsto (fun N => ∫ x in body a, + ‖velocity (y N) 0 x - (V₀ + act R₀ (cross ω₀ x))‖ ^ 2) atTop (𝓝 0) + +/-- Torque-free Euler equations and rotation kinematics. Translation is +c₀+tV₀ and is included in the convergence statement below. -/ +def FreeRigidMotion (a : Fin 3 → ℝ) (T : ℝ) (R₀ : Mat) (ω₀ : Space) + (R : ℝ → Mat) (ω : ℝ → Space) : Prop := + R 0 = R₀ ∧ ω 0 = ω₀ ∧ ∀ t ∈ Set.Icc 0 T, + R t ∈ properRotations ∧ + (∀ i j, HasDerivAt (fun s => R s i j) ((R t * spin (ω t)) i j) t) ∧ + HasDerivAt ω (eulerAngular a (ω t)) t + +/-- Geometric-rigidity and compactness theorem obligation for the specified +global balances. This is not proposed as a new open conjecture. Existence of +rigid dynamics is required independently of the continuum family. The limit +is uniform in time in squared L² position and concerns the whole sequence. +The separate local-elasticity bridge below supplies the continuum dynamics. -/ +def ContinuumRigidLimit : Prop := + (∀ (a : Fin 3 → ℝ) (T : ℝ) (R₀ : Mat) (ω₀ : Space), + (∀ i, 0 < a i) → 0 < T → R₀ ∈ properRotations → + ∃ (R : ℝ → Mat) (ω : ℝ → Space), FreeRigidMotion a T R₀ ω₀ R ω) ∧ + ∀ (a : Fin 3 → ℝ) (T : ℝ) (c₀ V₀ ω₀ : Space) (R₀ : Mat) + (y : ℕ → ℝ → Space → Space), + StiffContinuum a T y → InitialPreparation a c₀ V₀ ω₀ R₀ y → + ∃ (R : ℝ → Mat) (ω : ℝ → Space), FreeRigidMotion a T R₀ ω₀ R ω ∧ + ∀ η : ℝ, 0 < η → ∃ N₀ : ℕ, ∀ N ≥ N₀, ∀ t ∈ Set.Icc 0 T, + IntegrableOn (fun x => ‖y N t x - (c₀ + t • V₀ + act (R t) x)‖ ^ 2) + (body a) ∧ + (∫ x in body a, ‖y N t x - (c₀ + t • V₀ + act (R t) x)‖ ^ 2) < η + +/-- Empty-distance conventions cannot make every gradient appear rotational. -/ +theorem identity_is_properRotation : (1 : Mat) ∈ properRotations := by + simp [properRotations] + +theorem spin_zero : spin (0 : Space) = 0 := by + ext i j + fin_cases i <;> fin_cases j <;> simp [spin] + +theorem eulerAngular_zero (a : Fin 3 → ℝ) : eulerAngular a 0 = 0 := by + ext i + fin_cases i <;> simp [eulerAngular] + +/-- A genuine nonrotating rigid solution for every proper initial rotation. -/ +theorem zero_spin_motion (a : Fin 3 → ℝ) (T : ℝ) (R₀ : Mat) + (hR₀ : R₀ ∈ properRotations) : + FreeRigidMotion a T R₀ 0 (fun _ => R₀) (fun _ => 0) := by + refine ⟨rfl, rfl, fun t _ => ⟨hR₀, ?_, ?_⟩⟩ + · intro i j + simpa [spin_zero] using hasDerivAt_const t (R₀ i j) + · simpa [eulerAngular_zero] using hasDerivAt_const t (0 : Space) + +/-- A smooth frame-indifferent hyperelastic material, relaxed on proper +rotations and coercive relative to distance from those rotations. These are +local constitutive assumptions, not assumed conservation laws. -/ +structure HyperelasticEnergy where + energy : Mat → ℝ + smooth : ContDiff ℝ 2 energy + frame_indifferent : ∀ R ∈ properRotations, ∀ F, energy (R * F) = energy F + nonnegative : ∀ F, 0 ≤ energy F + relaxed : ∀ R ∈ properRotations, energy R = 0 + coercive : ∃ c : ℝ, 0 < c ∧ ∀ F, + c * Metric.infDist F properRotations ^ 2 ≤ energy F + +/-- First Piola stress DW(F), in the material coordinate basis. -/ +def stress (W : HyperelasticEnergy) (F : Mat) : Mat := + fun i j => fderiv ℝ W.energy F (Pi.single i (Pi.single j 1)) + +def stressDivergence (W : HyperelasticEnergy) (y : Space → Space) (x : Space) : Space := + WithLp.toLp 2 (fun i => ∑ j, + Hilbert6Fluid.coordinateDerivative (fun z => stress W (gradient y z) i j) x j) + +/-- Local equations for a free body of unit reference density, with stiffness +(N+1)²: y_tt=(N+1)² div DW(∇y). Each boundary face has zero traction, expressed +as the corresponding stress column being zero. Only the INITIAL energies are +uniformly bounded. Conservation of energy and momenta are not assumptions. +Smooth solutions on the chosen interval are the input to the limit theorem; +global existence for arbitrary elastic data is not asserted. -/ +def LocalHyperelasticFamily (W : HyperelasticEnergy) (a : Fin 3 → ℝ) (T : ℝ) + (y : ℕ → ℝ → Space → Space) : Prop := + (∀ i, 0 < a i) ∧ 0 < T ∧ + (∀ N, ContDiff ℝ 2 (fun p : ℝ × Space => y N p.1 p.2)) ∧ + (∀ N, ∀ t ∈ Set.Icc 0 T, + (∀ x ∈ interior (body a), + deriv (fun s => velocity (y N) s x) t = + (((N + 1 : ℕ) : ℝ) ^ 2) • stressDivergence W (y N t) x) ∧ + (∀ j, ∀ x ∈ body a, |x j| = a j → ∀ i, + stress W (gradient (y N t) x) i j = 0)) ∧ + ∃ C : ℝ, 0 < C ∧ ∀ N, + (∫ x in body a, ‖velocity (y N) 0 x‖ ^ 2 / 2 + + (((N + 1 : ℕ) : ℝ) ^ 2) * W.energy (gradient (y N 0) x)) ≤ C + +/-- The local-to-global balance theorem that connects the material equations +to the compactness limit. Its proof must use the PDE, traction-free boundary, +and frame indifference to derive linear/angular momentum and energy balances. +Material existence is included. This is an obligation, not an assumed axiom. -/ +def ElasticityToStiff : Prop := + Nonempty HyperelasticEnergy ∧ + ∀ (W : HyperelasticEnergy) (a : Fin 3 → ℝ) (T : ℝ) + (y : ℕ → ℝ → Space → Space), + LocalHyperelasticFamily W a T y → StiffContinuum a T y + +/-- A concrete smooth candidate material, including the orientation penalty. +Its coercivity verification is a known finite-dimensional theorem obligation. -/ +def polynomialStoredEnergy (F : Mat) : ℝ := + ‖F.transpose * F - 1‖ ^ 2 + (F.det - 1) ^ 2 + +def PolynomialMaterialWitness : Prop := + ∃ W : HyperelasticEnergy, W.energy = polynomialStoredEnergy + +theorem gradient_identity (x : Space) : gradient (fun z => z) x = 1 := by + ext i j + fin_cases i <;> fin_cases j <;> simp [gradient] + +theorem relaxed_stress_zero (W : HyperelasticEnergy) : stress W 1 = 0 := by + have hmin : IsLocalMin W.energy (1 : Mat) := by + filter_upwards [] with F + rw [W.relaxed 1 identity_is_properRotation] + exact W.nonnegative F + have hz : fderiv ℝ W.energy (1 : Mat) = 0 := hmin.fderiv_eq_zero + ext i j + simp only [stress, hz] + rfl + +/-- An actual stationary continuum solution for every admitted material. +Rotating rigid motions are deliberately not asserted to solve elasticity. -/ +theorem stationary_elastic_model (W : HyperelasticEnergy) (a : Fin 3 → ℝ) (T : ℝ) + (ha : ∀ i, 0 < a i) (hT : 0 < T) : + LocalHyperelasticFamily W a T (fun _ _ x => x) := by + refine ⟨ha, hT, fun _ => by fun_prop, ?_, 1, by norm_num, ?_⟩ + · intro N t _ + constructor + · intro x _ + simp only [velocity, stressDivergence, gradient_identity, relaxed_stress_zero, + Matrix.zero_apply, + Hilbert6Fluid.coordinateDerivative] + simp only [deriv_const, Finset.sum_const_zero] + change (0 : Space) = _ • (0 : Space) + simp + · intro j x _ _ i + simp [gradient_identity, relaxed_stress_zero] + · intro N + simp [velocity, gradient_identity, W.relaxed 1 identity_is_properRotation] + +/-- Selected classical specifications covering both directions of limiting +process requested in Hilbert's original text. This is a candidate collection, +not a proved equivalence to the entire physical-sciences research program. -/ +def ClassicalLimitsProgram : Prop := + Hilbert6Fluid.ClassicalGasProgram ∧ PolynomialMaterialWitness ∧ + ElasticityToStiff ∧ ContinuumRigidLimit + +end +end HilbertDrafts.Hilbert6Rigid diff --git a/HilbertDrafts/Hilbert6MeanField.lean b/HilbertDrafts/Hilbert6MeanField.lean new file mode 100644 index 0000000..5091852 --- /dev/null +++ b/HilbertDrafts/Hilbert6MeanField.lean @@ -0,0 +1,200 @@ +import HilbertDrafts.Hilbert6 + +/-! +Hilbert 6: a well-known open problem in the programme, going back to Hilbert's +sixth problem, of deriving continuum equations from particle dynamics. It is +stated with the reviewed definitions of `HilbertDrafts.Hilbert6`. It is a modern +instance of that programme, not a question Hilbert posed, and it is separate +from the hard-sphere, Boltzmann and fluid derivations. + +`VlasovPoissonMeanFieldLimit`: point particles in three-space move by Newton's +equations under the repulsive Coulomb force with mean-field scaling. Their +initial positions and velocities are independent samples of a smooth compactly +supported density. The statement asserts that the empirical distribution of the +particles converges in probability, at every later time, to the classical +solution of the Vlasov-Poisson equation with that initial density. The Coulomb +singularity is not truncated and no noise is added. The dimension is three, the +interaction is repulsive and the initial data are general, not monokinetic. + +The statement has two parts. `VlasovPoissonExistence` is a known theorem of +Pfaffelmoser, Schaeffer and Lions and Perthame; it is included so that the +statement cannot be empty, and a proof must still establish it. +`MeanFieldConvergence` is the open part. It is expected to be true. + +The known results do not decide it: the limit with the force truncated at a +radius shrinking like a small power of the particle number, the limit with +velocity noise, the two-dimensional limit for strictly positive data, and the +limit for monokinetic data. A theorem for another class of initial data, for +the torus, or for short times only would not by itself settle this statement. + +The proposition is neither assumed nor proved here. The lemmas are consistency +checks on the statement, not progress on the conjecture. +-/ + +namespace HilbertDrafts.Hilbert6MeanField + +open HilbertDrafts.Hilbert6 HilbertDrafts.Hilbert6Kinetic MeasureTheory Filter +open scoped Topology + +noncomputable section + +/-- A smooth compactly supported probability density on phase space. Smoothness +is stated order by order, so it cannot be read as analyticity, which no +compactly supported density has. -/ +def SmoothDensity (f₀ : Phase → ℝ) : Prop := + (∀ n : ℕ, ContDiff ℝ n f₀) ∧ HasCompactSupport f₀ ∧ + (∀ z, 0 ≤ f₀ z) ∧ Integrable f₀ ∧ ∫ z, f₀ z = 1 + +/-- The Coulomb kernel `x / |x|^3`. Its value at the origin is never used: +particle positions stay distinct, and the origin is a null set in the integral. -/ +def coulomb (x : Space) : Space := (‖x‖ ^ 3)⁻¹ • x + +/-- The mean-field acceleration of particle `i`: the average over all `N + 1` +particles of the repulsive Coulomb force exerted by the others. -/ +def acceleration {N : ℕ} (q : Fin (N + 1) → Space) (i : Fin (N + 1)) : Space := + (((N + 1 : ℕ) : ℝ))⁻¹ • ∑ j ∈ Finset.univ.erase i, coulomb (q i - q j) + +/-- A global solution of Newton's equations for `N + 1` equal particles with +the mean-field scaled repulsive Coulomb interaction. Positions are distinct at +every time, so the kernel is never evaluated at the origin. -/ +def IsCoulombTrajectory {N : ℕ} (z : ℝ → Configuration (N + 1)) : Prop := + ∀ t : ℝ, + (∀ i j, i ≠ j → (z t i).1 ≠ (z t j).1) ∧ + ∀ i, + HasDerivAt (fun s => (z s i).1) (z t i).2 t ∧ + HasDerivAt (fun s => (z s i).2) (acceleration (fun j => (z t j).1) i) t + +/-- The self-consistent force field of a phase-space density. -/ +def meanField (g : Phase → ℝ) (x : Space) : Space := + ∫ z : Phase, g z • coulomb (x - z.1) + +/-- A global classical solution of the repulsive Vlasov-Poisson equation +`∂ₜ f + v · ∇ₓ f + E · ∇ᵥ f = 0`, with `E` the mean field of `f`. The solution +is continuously differentiable, nonnegative, and compactly supported uniformly +on bounded time intervals. Integrability of the force integrand is required, so +the totalized integral cannot silently return zero. -/ +def IsVlasovPoissonSolution (f : ℝ → Phase → ℝ) : Prop := + ContDiff ℝ 1 (fun p : ℝ × Phase => f p.1 p.2) ∧ + (∀ t z, 0 ≤ f t z) ∧ + (∀ T : ℝ, ∃ R : ℝ, ∀ t : ℝ, |t| ≤ T → ∀ z : Phase, R < ‖z‖ → f t z = 0) ∧ + (∀ (t : ℝ) (x : Space), Integrable (fun z : Phase => f t z • coulomb (x - z.1))) ∧ + ∀ (t : ℝ) (x v : Space), + fderiv ℝ (fun p : ℝ × Phase => f p.1 p.2) (t, (x, v)) + (1, (v, meanField (f t) x)) = 0 + +/-- Independent initial particles: the product of the one-particle density. -/ +def productLaw (N : ℕ) (f₀ : Phase → ℝ) : Measure (Configuration (N + 1)) := + volume.withDensity (fun z => ENNReal.ofReal (∏ i, f₀ (z i))) + +/-- Initial configurations from which the particle system fails to follow the +continuum prediction at time `t`: either no global trajectory starts there, or +some trajectory starting there has an empirical average of `φ` at distance at +least `δ` from the Vlasov-Poisson average. -/ +def deviationSet (N : ℕ) (f : ℝ → Phase → ℝ) (t δ : ℝ) (φ : Phase → ℝ) : + Set (Configuration (N + 1)) := + {z₀ | (¬ ∃ z : ℝ → Configuration (N + 1), IsCoulombTrajectory z ∧ z 0 = z₀) ∨ + ∃ z : ℝ → Configuration (N + 1), IsCoulombTrajectory z ∧ z 0 = z₀ ∧ + δ ≤ |empiricalAverage N φ (z t) - ∫ y, φ y * f t y|} + +/-- The mean-field limit for the Vlasov-Poisson equation with the untruncated +repulsive Coulomb interaction. For every admissible initial density a global +classical solution exists, and for every such solution, every later time, every +continuous compactly supported observable and every tolerance, the probability +of the deviation set tends to zero as the number of particles grows. The +existence clause prevents a vacuous statement. Outer measure is used, so no +measurability of the deviation set is assumed. -/ +def VlasovPoissonMeanFieldLimit : Prop := + ∀ f₀ : Phase → ℝ, SmoothDensity f₀ → + (∃ f : ℝ → Phase → ℝ, IsVlasovPoissonSolution f ∧ ∀ z, f 0 z = f₀ z) ∧ + ∀ f : ℝ → Phase → ℝ, IsVlasovPoissonSolution f → (∀ z, f 0 z = f₀ z) → + ∀ t : ℝ, 0 ≤ t → + ∀ φ : Phase → ℝ, Continuous φ → HasCompactSupport φ → + ∀ δ : ℝ, 0 < δ → + Tendsto (fun N => productLaw N f₀ (deviationSet N f t δ φ)) atTop (𝓝 0) + +/-- The kernel has the Coulomb magnitude `1 / |x|^2` away from the origin. -/ +theorem norm_coulomb {x : Space} (hx : x ≠ 0) : ‖coulomb x‖ = (‖x‖ ^ 2)⁻¹ := by + have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx + rw [coulomb, norm_smul, norm_inv, norm_pow, norm_norm] + field_simp + +/-- The force is repulsive: it points from the other particle to this one. -/ +theorem coulomb_neg (x : Space) : coulomb (-x) = -coulomb x := by + simp [coulomb] + +/-- Every smooth density is an initial density in the reviewed kinetic sense. -/ +theorem SmoothDensity.initialDensity {f₀ : Phase → ℝ} (h : SmoothDensity f₀) : + InitialDensity f₀ := + ⟨by simpa using h.1 1, h.2.1, h.2.2.1, h.2.2.2.1, h.2.2.2.2⟩ + +/-- Two particles: each feels half the Coulomb force of the other. -/ +theorem acceleration_pair (q : Fin 2 → Space) : + acceleration (N := 1) q 0 = (2 : ℝ)⁻¹ • coulomb (q 0 - q 1) := by + have h : Finset.univ.erase (0 : Fin 2) = {1} := by decide + unfold acceleration + rw [h, Finset.sum_singleton] + norm_num + +/-- The known part: every admissible initial density has a global classical +solution of the Vlasov-Poisson equation. -/ +def VlasovPoissonExistence : Prop := + ∀ f₀ : Phase → ℝ, SmoothDensity f₀ → + ∃ f : ℝ → Phase → ℝ, IsVlasovPoissonSolution f ∧ ∀ z, f 0 z = f₀ z + +/-- The open part: empirical averages of the particle system converge in +probability to the averages of every classical solution with the same initial +density. -/ +def MeanFieldConvergence : Prop := + ∀ f₀ : Phase → ℝ, SmoothDensity f₀ → + ∀ f : ℝ → Phase → ℝ, IsVlasovPoissonSolution f → (∀ z, f 0 z = f₀ z) → + ∀ t : ℝ, 0 ≤ t → + ∀ φ : Phase → ℝ, Continuous φ → HasCompactSupport φ → + ∀ δ : ℝ, 0 < δ → + Tendsto (fun N => productLaw N f₀ (deviationSet N f t δ φ)) atTop (𝓝 0) + +/-- The statement is exactly the known existence theorem together with the +open convergence statement. -/ +theorem vlasovPoissonMeanFieldLimit_iff : + VlasovPoissonMeanFieldLimit ↔ VlasovPoissonExistence ∧ MeanFieldConvergence := + ⟨fun h => ⟨fun f₀ h₀ => (h f₀ h₀).1, fun f₀ h₀ => (h f₀ h₀).2⟩, + fun h f₀ h₀ => ⟨h.1 f₀ h₀, h.2 f₀ h₀⟩⟩ + +/-- A single particle feels no force. -/ +theorem acceleration_single (q : Fin 1 → Space) (i : Fin 1) : acceleration q i = 0 := by + have h : Finset.univ.erase i = (∅ : Finset (Fin 1)) := by + ext j + simp [Subsingleton.elim j i] + unfold acceleration + rw [h, Finset.sum_empty, smul_zero] + +/-- The notion of trajectory is satisfiable: one particle moves freely. -/ +theorem freeParticle_isCoulombTrajectory (x₀ v₀ : Space) : + IsCoulombTrajectory (N := 0) (fun t _ => (x₀ + t • v₀, v₀)) := by + intro t + have hsub : ∀ i j : Fin (0 + 1), i = j := fun i j => + Fin.ext (by have := i.isLt; have := j.isLt; omega) + refine ⟨fun i j hij => absurd (hsub i j) hij, fun i => ⟨?_, ?_⟩⟩ + · have h : HasDerivAt (fun s : ℝ => x₀ + s • v₀) v₀ t := by + simpa using ((hasDerivAt_id t).smul_const v₀).const_add x₀ + exact h + · rw [acceleration_single] + exact hasDerivAt_const t v₀ + +/-- The zero density solves the equation, so the solution predicate is +consistent. It is not an admissible initial density. -/ +theorem zero_isVlasovPoissonSolution : IsVlasovPoissonSolution (fun _ _ => 0) := by + refine ⟨contDiff_const, fun _ _ => le_rfl, fun _ => ⟨0, fun _ _ _ _ => rfl⟩, ?_, ?_⟩ + · intro t x + simp + · intro t x v + simp + +/-- A trajectory starting at a configuration keeps that configuration's +particles distinct, so coincident initial positions lie in every deviation set. -/ +theorem trajectory_distinct {N : ℕ} {z : ℝ → Configuration (N + 1)} + (h : IsCoulombTrajectory z) (t : ℝ) {i j : Fin (N + 1)} (hij : i ≠ j) : + (z t i).1 ≠ (z t j).1 := (h t).1 i j hij + +end + +end HilbertDrafts.Hilbert6MeanField diff --git a/HilbertDrafts/Hilbert6MeanFieldChecks.lean b/HilbertDrafts/Hilbert6MeanFieldChecks.lean new file mode 100644 index 0000000..cf775c1 --- /dev/null +++ b/HilbertDrafts/Hilbert6MeanFieldChecks.lean @@ -0,0 +1,25 @@ +import HilbertDrafts.Hilbert6MeanField + +/-! +Machine-checked non-vacuity witness for the mean-field statement. It shows the +class of admissible initial densities is not empty. It is not progress on the +conjecture. +-/ + +namespace HilbertDrafts.Hilbert6MeanFieldChecks + +open HilbertDrafts.Hilbert6 HilbertDrafts.Hilbert6MeanField MeasureTheory + +noncomputable section + +/-- A smooth compactly supported probability density exists, so the statement +does not quantify over an empty class of initial data. -/ +theorem exists_smoothDensity : ∃ f₀ : Phase → ℝ, SmoothDensity f₀ := by + let φ : ContDiffBump (0 : Phase) := default + refine ⟨φ.normed volume, fun n => ?_, φ.hasCompactSupport_normed, fun z => φ.nonneg_normed z, + φ.integrable_normed, φ.integral_normed⟩ + exact_mod_cast φ.contDiff_normed (μ := volume) (n := (n : ℕ∞)) + +end + +end HilbertDrafts.Hilbert6MeanFieldChecks diff --git a/Math15.lean b/Math15.lean new file mode 100644 index 0000000..addf730 --- /dev/null +++ b/Math15.lean @@ -0,0 +1 @@ +import Math15.Interfaces diff --git a/Math15/Collatz.lean b/Math15/Collatz.lean new file mode 100644 index 0000000..0a33c01 --- /dev/null +++ b/Math15/Collatz.lean @@ -0,0 +1,58 @@ +import Mathlib.Data.Finset.Card +import Mathlib.Order.Interval.Finset.Nat +import Mathlib.Logic.Function.Iterate +import Mathlib.Tactic + +namespace Math15.Collatz + +def step (n : ℕ) : ℕ := if n % 2 = 0 then n / 2 else (3 * n + 1) / 2 +def ReachesOne (n : ℕ) : Prop := ∃ k : ℕ, step^[k] n = 1 +noncomputable def count (N : ℕ) : ℕ := by + classical + exact ((Finset.Icc 1 N).filter ReachesOne).card + +def Target13 : Prop := ∃ A N₀ : ℕ, 0 < A ∧ 0 < N₀ ∧ + ∀ N, N₀ ≤ N → N ^ 23 ≤ A * count N ^ 25 + +def LeastPeriod (n p : ℕ) : Prop := + 0 < p ∧ step^[p] n = n ∧ ∀ k, 0 < k → k < p → step^[k] n ≠ n + +def LocalMinimum (n p i : ℕ) : Prop := + step^[i] n < step^[((i + p - 1) % p)] n ∧ + step^[i] n < step^[((i + 1) % p)] n + +instance (n p i : ℕ) : Decidable (LocalMinimum n p i) := + inferInstanceAs (Decidable (_ ∧ _)) + +def minimaCount (n p : ℕ) : ℕ := + ((Finset.range p).filter (LocalMinimum n p)).card + +def Target14 : Prop := ¬ ∃ n p : ℕ, 0 < n ∧ LeastPeriod n p ∧ + (∀ i < p, step^[i] n ≠ 1 ∧ step^[i] n ≠ 2) ∧ minimaCount n p = 96 + +def Target15 : Prop := ∀ n : ℕ, 1 ≤ n → n < 2 ^ 72 → ReachesOne n + +/-- A descent certificate must cover every input in the exact interval. -/ +def DescentCoverage (B : ℕ) : Prop := + ∀ n, 2 ≤ n → n < B → ∃ k, 1 ≤ step^[k] n ∧ step^[k] n < n + +theorem reaches_one : ReachesOne 1 := ⟨0, rfl⟩ + +theorem reaches_of_iterate {n k : ℕ} (h : ReachesOne (step^[k] n)) : ReachesOne n := by + obtain ⟨j, hj⟩ := h + exact ⟨j + k, by simpa only [Function.iterate_add_apply] using hj⟩ + +theorem coverage_sound {B : ℕ} (h : DescentCoverage B) : + ∀ n, 1 ≤ n → n < B → ReachesOne n := by + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro hn hB + by_cases he : n = 1 + · simpa [he] using reaches_one + · obtain ⟨k, hkpos, hkn⟩ := h n (by omega) hB + exact reaches_of_iterate (ih _ hkn hkpos (by omega)) + +theorem accept15 (h : DescentCoverage (2 ^ 72)) : Target15 := coverage_sound h + +end Math15.Collatz diff --git a/Math15/CollatzCertificates.lean b/Math15/CollatzCertificates.lean new file mode 100644 index 0000000..2c9e121 --- /dev/null +++ b/Math15/CollatzCertificates.lean @@ -0,0 +1,170 @@ +import Math15.Collatz + +/-! +A concrete finite certificate format for Collatz descent on [2, B). +Each shard stores a starting value and one iteration-count witness per integer. +The Boolean checker checks all orbit descents and exact contiguous coverage. +This format is a sound reference checker, not a practical 2^72 certificate. +-/ + +namespace Math15.CollatzCertificates +open Math15.Collatz + +/-- This shard covers [start, start + steps.length). Entry i certifies start+i. -/ +structure IntervalShard where + start : ℕ + steps : List ℕ + deriving DecidableEq, Repr + +/-- Recompute the exact shortcut orbit; check positivity and strict descent. -/ +def checkDescent (n k : ℕ) : Bool := + decide (1 ≤ step^[k] n ∧ step^[k] n < n) + +/-- A finite row checker; no unbounded convergence predicate is evaluated. -/ +def checkSteps : ℕ → List ℕ → Bool + | _, [] => true + | n, k :: ks => checkDescent n k && checkSteps (n + 1) ks + +/-- Shards must be nonempty, in order, adjacent, and end at exactly B. -/ +def checkFrom (expected B : ℕ) : List IntervalShard → Bool + | [] => decide (expected = B) + | shard :: rest => + (decide (shard.start = expected) && decide (0 < shard.steps.length)) && + (checkSteps shard.start shard.steps && + checkFrom (shard.start + shard.steps.length) B rest) + +/-- The bound is an external checker parameter, not taken on faith from a file. -/ +def checkCertificate (B : ℕ) (shards : List IntervalShard) : Bool := + decide (2 ≤ B) && checkFrom 2 B shards + +/-- This reference format uses one stored witness per checked starting value. -/ +def entryCount : List IntervalShard → ℕ + | [] => 0 + | shard :: rest => shard.steps.length + entryCount rest + +theorem checkDescent_sound {n k : ℕ} (h : checkDescent n k = true) : + 1 ≤ step^[k] n ∧ step^[k] n < n := by + exact of_decide_eq_true h + +theorem checkSteps_sound {start : ℕ} {ks : List ℕ} + (h : checkSteps start ks = true) : + ∀ n, start ≤ n → n < start + ks.length → + ∃ k, 1 ≤ step^[k] n ∧ step^[k] n < n := by + induction ks generalizing start with + | nil => + intro n hlo hhi + simp only [List.length_nil, Nat.add_zero] at hhi + omega + | cons k ks ih => + rcases Bool.and_eq_true_iff.mp h with ⟨hk, hks⟩ + intro n hlo hhi + by_cases he : n = start + · subst n + exact ⟨k, checkDescent_sound hk⟩ + · apply ih hks n + · omega + · simp only [List.length_cons] at hhi + omega + +theorem checkFrom_sound {start B : ℕ} {shards : List IntervalShard} + (h : checkFrom start B shards = true) : + ∀ n, start ≤ n → n < B → + ∃ k, 1 ≤ step^[k] n ∧ step^[k] n < n := by + induction shards generalizing start with + | nil => + have he : start = B := of_decide_eq_true h + intro n hlo hhi + omega + | cons shard rest ih => + rcases Bool.and_eq_true_iff.mp h with ⟨hshape, hbody⟩ + rcases Bool.and_eq_true_iff.mp hshape with ⟨hstart, _⟩ + rcases Bool.and_eq_true_iff.mp hbody with ⟨hsteps, hrest⟩ + have he : shard.start = start := of_decide_eq_true hstart + intro n hlo hhi + by_cases hn : n < shard.start + shard.steps.length + · exact checkSteps_sound hsteps n (by omega) hn + · exact ih hrest n (by omega) hhi + +/-- The checker also proves the exact total size of the covered interval. -/ +theorem checkFrom_size {start B : ℕ} {shards : List IntervalShard} + (h : checkFrom start B shards = true) : start + entryCount shards = B := by + induction shards generalizing start with + | nil => + have he : start = B := of_decide_eq_true h + simpa [entryCount] using he + | cons shard rest ih => + rcases Bool.and_eq_true_iff.mp h with ⟨hshape, hbody⟩ + rcases Bool.and_eq_true_iff.mp hshape with ⟨hstart, _⟩ + rcases Bool.and_eq_true_iff.mp hbody with ⟨_, hrest⟩ + have he : shard.start = start := of_decide_eq_true hstart + have hs := ih hrest + simp only [entryCount] + omega + +theorem certificate_size {B : ℕ} {shards : List IntervalShard} + (h : checkCertificate B shards = true) : 2 + entryCount shards = B := + checkFrom_size (Bool.and_eq_true_iff.mp h).2 + +/-- The executable checker discharges the abstract coverage obligation. -/ +theorem certificate_coverage {B : ℕ} {shards : List IntervalShard} + (h : checkCertificate B shards = true) : DescentCoverage B := by + exact checkFrom_sound (Bool.and_eq_true_iff.mp h).2 + +theorem certificate_convergence {B : ℕ} {shards : List IntervalShard} + (h : checkCertificate B shards = true) : + ∀ n, 1 ≤ n → n < B → ReachesOne n := + coverage_sound (certificate_coverage h) + +/-- A passing concrete certificate for the exact requested bound proves Target15. -/ +theorem acceptTarget15 {shards : List IntervalShard} + (h : checkCertificate (2 ^ 72) shards = true) : Target15 := + certificate_convergence h + +/-! Kernel-checked, bounded data and adversarial controls. -/ + +/-- The two shards cover [2,11) and [11,21), respectively. -/ +def sampleCertificate21 : List IntervalShard := + [⟨2, [1, 4, 1, 2, 1, 7, 1, 2, 1]⟩, + ⟨11, [5, 1, 2, 1, 7, 1, 2, 1, 4, 1]⟩] + +theorem sample21_passes : checkCertificate 21 sampleCertificate21 = true := by + decide + +theorem sample21_has_nineteen_rows : entryCount sampleCertificate21 = 19 := by + decide + +theorem sample21_converges : ∀ n, 1 ≤ n → n < 21 → ReachesOne n := + certificate_convergence sample21_passes + +theorem empty_range_passes : checkCertificate 2 [] = true := by decide + +theorem bound_below_two_rejected : checkCertificate 1 [] = false := by decide + +theorem empty_shard_rejected : checkCertificate 2 [⟨2, []⟩] = false := by decide + +theorem zero_step_rejected (n : ℕ) : checkDescent n 0 = false := by + simp [checkDescent] + +theorem wrong_orbit_witness_rejected : checkDescent 3 1 = false := by decide + +theorem bad_row_rejected : checkCertificate 3 [⟨2, [0]⟩] = false := by decide + +theorem gap_rejected : + checkCertificate 5 [⟨2, [1]⟩, ⟨4, [1]⟩] = false := by decide + +theorem overlap_rejected : + checkCertificate 4 [⟨2, [1]⟩, ⟨2, [1]⟩] = false := by decide + +theorem missing_suffix_rejected : + checkCertificate 4 [⟨2, [1]⟩] = false := by decide + +theorem overshoot_rejected : + checkCertificate 2 [⟨2, [1]⟩] = false := by decide + +theorem reordered_shards_rejected : + checkCertificate 21 sampleCertificate21.reverse = false := by decide + +theorem small_data_cannot_prove_large_range : + checkCertificate (2 ^ 72) sampleCertificate21 = false := by decide + +end Math15.CollatzCertificates diff --git a/Math15/Frankl.lean b/Math15/Frankl.lean new file mode 100644 index 0000000..7e7bc3f --- /dev/null +++ b/Math15/Frankl.lean @@ -0,0 +1,45 @@ +import Mathlib.Data.Finset.Lattice.Union +import Mathlib.Tactic + +namespace Math15.Frankl +open Finset +abbrev Family := Finset (Finset ℕ) +def ground (F : Family) : Finset ℕ := F.biUnion id +def frequency (F : Family) (x : ℕ) : ℕ := (F.filter (x ∈ ·)).card +def UnionClosed (F : Family) : Prop := ∀ A ∈ F, ∀ B ∈ F, A ∪ B ∈ F +/-- Height counts members, so a chain of six is forbidden. -/ +def HeightAtMostFive (F : Family) : Prop := + ¬ ∃ c : Fin 6 → Finset ℕ, (∀ i, c i ∈ F) ∧ + (∀ i j, i < j → c i ⊂ c j) +def CounterexampleFive (F : Family) : Prop := + F.Nonempty ∧ ∅ ∉ F ∧ UnionClosed F ∧ HeightAtMostFive F ∧ + ∀ x ∈ ground F, 2 * frequency F x ≤ F.card +/-- Global lexicographic minimality, across every finite family on ℕ. -/ +def MinimalFive (F : Family) : Prop := + CounterexampleFive F ∧ ∀ G : Family, CounterexampleFive G → + F.card ≤ G.card ∧ (F.card = G.card → (ground F).card ≤ (ground G).card) +def JoinIrreducible (F : Family) (B : Finset ℕ) : Prop := + B ∈ F ∧ ∀ A ∈ F, ∀ C ∈ F, A ∪ C = B → A = B ∨ C = B +def critical (F : Family) : Finset ℕ := + (ground F).filter (fun x => 2 * frequency F x = F.card) +def CriticalCover (F C : Family) : Prop := + C ⊆ F ∧ (∀ B ∈ C, JoinIrreducible F B) ∧ critical F ⊆ ground C +def RhoEq (F : Family) (r : ℕ) : Prop := + (∃ C, CriticalCover F C ∧ C.card = r) ∧ ∀ C, CriticalCover F C → r ≤ C.card + +def Target07 : Prop := ∀ F, MinimalFive F → RhoEq F 4 → + (∃ C, CriticalCover F C ∧ C.card = 4 ∧ ground C ≠ ground F) → False +def Target08 : Prop := ∀ F, MinimalFive F → RhoEq F 3 → False +def Target09 : Prop := ∀ F, MinimalFive F → RhoEq F 4 → + (∃ C, CriticalCover F C ∧ C.card = 4 ∧ ground C = ground F) → False + +/-- The two existential cover cases exhaust rho=4, but need not be disjoint. -/ +theorem rho_four_split {F : Family} (h : RhoEq F 4) : + (∃ C, CriticalCover F C ∧ C.card = 4 ∧ ground C ≠ ground F) ∨ + (∃ C, CriticalCover F C ∧ C.card = 4 ∧ ground C = ground F) := by + obtain ⟨C, hc, hn⟩ := h.1 + by_cases he : ground C = ground F + · exact Or.inr ⟨C, hc, hn, he⟩ + · exact Or.inl ⟨C, hc, hn, he⟩ + +end Math15.Frankl diff --git a/Math15/Graceful.lean b/Math15/Graceful.lean new file mode 100644 index 0000000..f055fcb --- /dev/null +++ b/Math15/Graceful.lean @@ -0,0 +1,53 @@ +import Mathlib.Combinatorics.SimpleGraph.Acyclic +import Mathlib.Combinatorics.SimpleGraph.Finite +import Mathlib.Tactic +import Mathlib.Data.Nat.Dist + +namespace Math15.Graceful +open Finset + +/-- Every edge difference occurs once, using both injectivity and complete coverage. +The `u < v` orientation makes unordered edges count exactly once. -/ +noncomputable def edgeCount {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := by + classical + exact ((univ : Finset (Fin n × Fin n)).filter (fun e => e.1 < e.2 ∧ G.Adj e.1 e.2)).card +noncomputable def degree {n : ℕ} (G : SimpleGraph (Fin n)) (u : Fin n) : ℕ := by + classical + exact ((univ : Finset (Fin n)).filter (G.Adj u)).card + +def IsGraceful {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∃ f : Fin n → ℕ, Function.Injective f ∧ + (∀ v, f v ≤ edgeCount G) ∧ + (∀ d, 1 ≤ d → d ≤ edgeCount G → + ∃! e : Fin n × Fin n, e.1 < e.2 ∧ G.Adj e.1 e.2 ∧ Nat.dist (f e.1) (f e.2) = d) + +def Branch43 {n : ℕ} (G : SimpleGraph (Fin n)) (u v : Fin n) : Prop := + u ≠ v ∧ degree G u = 4 ∧ degree G v = 3 ∧ + ∀ w, w ≠ u → w ≠ v → degree G w ≤ 2 + +def Branch333 {n : ℕ} (G : SimpleGraph (Fin n)) (u v w : Fin n) : Prop := + u ≠ v ∧ u ≠ w ∧ v ≠ w ∧ degree G u = 3 ∧ degree G v = 3 ∧ degree G w = 3 ∧ + ∀ x, x ≠ u → x ≠ v → x ≠ w → degree G x ≤ 2 + +/-- The two arms at v have exactly two edges. Freshness is explicit. -/ +def TwoLengthTwoArms {n : ℕ} (G : SimpleGraph (Fin n)) (v : Fin n) : Prop := + ∃ x₁ x₂ y₁ y₂ : Fin n, + ({v, x₁, x₂, y₁, y₂} : Finset (Fin n)).card = 5 ∧ + G.Adj v x₁ ∧ G.Adj x₁ y₁ ∧ G.Adj v x₂ ∧ G.Adj x₂ y₂ ∧ + degree G x₁ = 2 ∧ degree G x₂ = 2 ∧ degree G y₁ = 1 ∧ degree G y₂ = 1 + +def Target10 : Prop := ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + G.IsTree → (∃ u v, Branch43 G u v) → IsGraceful G + +def Target11 : Prop := ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + G.IsTree → (∃ u v w, Branch333 G u v w) → IsGraceful G + +def Target12 : Prop := ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + G.IsTree → (∃ u v, Branch43 G u v ∧ TwoLengthTwoArms G v) → IsGraceful G + +theorem target10_implies12 (h : Target10) : Target12 := by + intro n G ht hbranch + obtain ⟨u, v, huv, _⟩ := hbranch + exact h n G ht ⟨u, v, huv⟩ + +end Math15.Graceful diff --git a/Math15/Interfaces.lean b/Math15/Interfaces.lean new file mode 100644 index 0000000..da1585f --- /dev/null +++ b/Math15/Interfaces.lean @@ -0,0 +1,37 @@ +import Math15.Ramsey +import Math15.LonelyRunner +import Math15.Frankl +import Math15.Graceful +import Math15.Collatz + +namespace Math15 +inductive CandidateId + | c01 | c02 | c03 | c04 | c05 | c06 | c07 | c08 | c09 | c10 | c11 | c12 | c13 | c14 | c15 + deriving DecidableEq, Repr + +def statement : CandidateId → Prop + | .c01 => Ramsey.Target01 + | .c02 => Ramsey.Target02 + | .c03 => Ramsey.Target03 + | .c04 => LonelyRunner.Target04 + | .c05 => LonelyRunner.Target05 + | .c06 => LonelyRunner.Target06 + | .c07 => Frankl.Target07 + | .c08 => Frankl.Target08 + | .c09 => Frankl.Target09 + | .c10 => Graceful.Target10 + | .c11 => Graceful.Target11 + | .c12 => Graceful.Target12 + | .c13 => Collatz.Target13 + | .c14 => Collatz.Target14 + | .c15 => Collatz.Target15 + +def Proof (id : CandidateId) : Prop := statement id +def Refutation (id : CandidateId) : Prop := ¬ statement id + +theorem proof_refutation_incompatible {id : CandidateId} + (p : Proof id) (r : Refutation id) : False := r p + +/-- A disproof is a theorem of the exact negation, never a failed search. -/ +theorem refutation_iff (id : CandidateId) : Refutation id ↔ (statement id → False) := Iff.rfl +end Math15 diff --git a/Math15/LonelyRunner.lean b/Math15/LonelyRunner.lean new file mode 100644 index 0000000..13f945b --- /dev/null +++ b/Math15/LonelyRunner.lean @@ -0,0 +1,72 @@ +import Mathlib.Analysis.Normed.Group.AddCircle +import Mathlib.Topology.Order.Compact +import Mathlib.Algebra.GCDMonoid.Finset +import Mathlib.Tactic + +noncomputable section +namespace Math15.LonelyRunner +open Finset Set +abbrev Time := AddCircle (1 : ℝ) +/-- Circle norm is exactly distance to the nearest integer, by `AddCircle.norm_eq`. -/ +def distance (t : Time) : ℝ := ‖t‖ +def Positive (V : Finset ℕ) : Prop := ∀ v ∈ V, 0 < v +def Primitive (V : Finset ℕ) : Prop := V.gcd id = 1 + +def score (V : Finset ℕ) (t : Time) : ℝ := + if h : V.Nonempty then V.inf' h (fun v => distance (v • t)) else 0 + +def ML (V : Finset ℕ) : ℝ := sSup (Set.range (score V)) + +theorem score_continuous (V : Finset ℕ) : Continuous (score V) := by + unfold score + split_ifs with h + · apply Continuous.finset_inf'_apply + intro v hv + unfold distance + fun_prop + · exact continuous_const + +/-- This supremum is an attained maximum; no rational-time completeness is assumed. -/ +theorem ML_attained (V : Finset ℕ) : ∃ t : Time, score V t = ML V := by + obtain ⟨t, _, ht⟩ := isCompact_univ.exists_isMaxOn Set.univ_nonempty + (score_continuous V).continuousOn + refine ⟨t, le_antisymm ?_ ?_⟩ + · exact le_csSup ⟨score V t, by rintro _ ⟨s, rfl⟩; exact ht (Set.mem_univ s)⟩ ⟨t, rfl⟩ + · exact csSup_le (Set.range_nonempty _) (by rintro _ ⟨s, rfl⟩; exact ht (Set.mem_univ s)) + +theorem ML_le_half (V : Finset ℕ) : ML V ≤ 1 / 2 := by + apply csSup_le (Set.range_nonempty _) + rintro _ ⟨t, rfl⟩ + by_cases h : V.Nonempty + · simp only [score, dite_eq_left h] + obtain ⟨v, hv⟩ := h + exact (Finset.inf'_le (fun v => distance (v • t)) hv).trans (by + simpa [distance] using AddCircle.norm_le_half_period (1 : ℝ) (by norm_num) (x := v • t)) + · simp [score, h] + +/-- Two deleted upper-half speeds can match in either order. -/ +def ReplacementCondition (n r w : ℕ) : Prop := + ∃ m : ℕ, 0 < m ∧ w = m * r ∧ + ∀ b : ℕ, n - r ≤ b → b < m * (n - r) → 1 < Nat.gcd r b + +def modified (n r₁ r₂ w₁ w₂ : ℕ) : Finset ℕ := + (Finset.Icc 1 (n - 1) \ {r₁, r₂}) ∪ {w₁, w₂} + +def Target04 : Prop := ∀ n r₁ r₂ w₁ w₂ : ℕ, + 3 ≤ n → 1 ≤ r₁ → r₁ < n → 1 ≤ r₂ → r₂ < n → r₁ ≠ r₂ → + n - 1 < 2 * r₁ → n - 1 < 2 * r₂ → n ≤ w₁ → n ≤ w₂ → w₁ ≠ w₂ → + ML (modified n r₁ r₂ w₁ w₂) = 1 / (n : ℝ) → + (ReplacementCondition n r₁ w₁ ∧ ReplacementCondition n r₂ w₂) ∨ + (ReplacementCondition n r₁ w₂ ∧ ReplacementCondition n r₂ w₁) + +def Target05 : Prop := ∀ V : Finset ℕ, + Positive V → V.card = 4 → Primitive V → + (∀ u ∈ V, ∀ v ∈ V, u ≠ v → Nat.gcd u v ≤ 2) → + (1 / 4 : ℝ) ≤ ML V ∨ ∃ s k : ℕ, 1 ≤ k ∧ k ≤ 4 ∧ k ≤ s ∧ + ML V = (s : ℝ) / (4 * (s : ℝ) + k) + +def Target06 : Prop := ∀ (V : Finset ℕ) (p q : ℕ), + Positive V → V.card = 6 → Primitive V → 0 < p → 0 < q → Nat.Coprime p q → + ML V = (p : ℝ) / q → 6 * p < q → ∀ v ∈ V, v < 3 * q + +end Math15.LonelyRunner diff --git a/Math15/Ramsey.lean b/Math15/Ramsey.lean new file mode 100644 index 0000000..e2c9245 --- /dev/null +++ b/Math15/Ramsey.lean @@ -0,0 +1,60 @@ +import Mathlib.Combinatorics.SimpleGraph.Finite +import Mathlib.Tactic + +/-! Exact unrestricted graph-existence targets. Books are ordinary subgraphs. -/ +namespace Math15.Ramsey + +open Finset + +def CommonBound {n : ℕ} (G : SimpleGraph (Fin n)) (a : ℕ) : Prop := + ∀ u v, G.Adj u v → + ∀ S : Finset (Fin n), (∀ w ∈ S, G.Adj u w ∧ G.Adj v w) → S.card ≤ a + +def Admissible {n : ℕ} (G : SimpleGraph (Fin n)) (a b : ℕ) : Prop := + CommonBound G a ∧ CommonBound Gᶜ b + +def Target01 : Prop := ∃ G : SimpleGraph (Fin 22), Admissible G 3 6 +def Target02 : Prop := ∃ G : SimpleGraph (Fin 27), Admissible G 3 8 +def Target03 : Prop := ∃ G : SimpleGraph (Fin 37), Admissible G 6 10 + +/-- Exact finite certificate. Symmetry and the zero diagonal are checked, not assumed. -/ +structure MatrixCertificate (n a b : ℕ) where + adjacency : Fin n → Fin n → Bool + symmetric : ∀ u v, adjacency u v = adjacency v u + irreflexive : ∀ u, adjacency u u = false + edgeBound : ∀ u v, adjacency u v = true → + ((univ : Finset (Fin n)).filter (fun w => adjacency u w && adjacency v w)).card ≤ a + nonedgeBound : ∀ u v, u ≠ v → adjacency u v = false → + ((univ : Finset (Fin n)).filter + (fun w => w ≠ u ∧ w ≠ v ∧ adjacency u w = false ∧ adjacency v w = false)).card ≤ b + +def MatrixCertificate.graph {n a b : ℕ} (c : MatrixCertificate n a b) : SimpleGraph (Fin n) where + Adj u v := c.adjacency u v = true + symm := ⟨by intro u v h; simpa [c.symmetric v u] using h⟩ + loopless := ⟨by intro u h; simp [c.irreflexive] at h⟩ + +theorem MatrixCertificate.sound {n a b : ℕ} (c : MatrixCertificate n a b) : + Admissible c.graph a b := by + constructor + · intro u v huv S hS + apply le_trans (Finset.card_le_card (show S ⊆ _ from ?_)) (c.edgeBound u v huv) + intro w hw + simpa only [Finset.mem_filter, Finset.mem_univ, true_and, Bool.and_eq_true, MatrixCertificate.graph] + using hS w hw + · intro u v huv S hS + have huv' : u ≠ v ∧ c.adjacency u v = false := by + simpa [MatrixCertificate.graph, SimpleGraph.compl_adj] using huv + apply le_trans (Finset.card_le_card (show S ⊆ _ from ?_)) + (c.nonedgeBound u v huv'.1 huv'.2) + intro w hw + have hw' := hS w hw + simp only [SimpleGraph.compl_adj, MatrixCertificate.graph] at hw' + simp only [Finset.mem_filter, Finset.mem_univ, true_and] + exact ⟨Ne.symm hw'.1.1, Ne.symm hw'.2.1, + Bool.eq_false_iff.mpr hw'.1.2, Bool.eq_false_iff.mpr hw'.2.2⟩ + +theorem accept01 (c : MatrixCertificate 22 3 6) : Target01 := ⟨c.graph, c.sound⟩ +theorem accept02 (c : MatrixCertificate 27 3 8) : Target02 := ⟨c.graph, c.sound⟩ +theorem accept03 (c : MatrixCertificate 37 6 10) : Target03 := ⟨c.graph, c.sound⟩ + +end Math15.Ramsey diff --git a/Math30.lean b/Math30.lean new file mode 100644 index 0000000..3063750 --- /dev/null +++ b/Math30.lean @@ -0,0 +1,17 @@ +import Math30.MatrixBoolean +import Math30.MatrixBooleanFixtures +import Math30.WilfMinimal +import Math30.WilfMinimalFixtures +import Math30.Polya +import Math30.PolyaFixtures +import Math30.PolyaDomainFixture +import Math30.Interfaces +import Math30.PolyaReadiness + +/-! +# Research statement formalization: second batch, targets 16–30 + +Importing this package defines fifteen research propositions and checks supporting +lemmas and semantic fixtures. It does not prove the research targets. Consult +README.md, docs/READINESS.md and the family documentation before using a target. +-/ diff --git a/Math30/Interfaces.lean b/Math30/Interfaces.lean new file mode 100644 index 0000000..696419f --- /dev/null +++ b/Math30/Interfaces.lean @@ -0,0 +1,38 @@ +import Math30.MatrixBoolean +import Math30.WilfMinimal +import Math30.Polya + +namespace Math30.Competition + +inductive CandidateId + | c16 | c17 | c18 | c19 | c20 | c21 | c22 | c23 | c24 | c25 | c26 | c27 | c28 | c29 | c30 + deriving DecidableEq, Repr + +def statement : CandidateId → Prop + | .c16 => Math30.MatrixBoolean.Statement16 + | .c17 => Math30.MatrixBoolean.Statement17 + | .c18 => Math30.MatrixBoolean.Statement18 + | .c19 => Math30.MatrixBoolean.Statement19 + | .c20 => Math30.MatrixBoolean.Statement20 + | .c21 => Math30.MatrixBoolean.Statement21 + | .c22 => Math30.Problem22 + | .c23 => Math30.Problem23 + | .c24 => Math30.Problem24 + | .c25 => Math30.Polya.Target25 + | .c26 => Math30.Polya.Target26 + | .c27 => Math30.Polya.Target27 + | .c28 => Math30.Problem28 + | .c29 => Math30.Problem29 + | .c30 => Math30.Problem30 + +def Proof (id : CandidateId) : Prop := statement id +def Refutation (id : CandidateId) : Prop := ¬ statement id + +theorem proof_refutation_incompatible {id : CandidateId} + (p : Proof id) (r : Refutation id) : False := r p + +/-- A refutation proves the exact logical negation; unsuccessful search is not one. -/ +theorem refutation_iff (id : CandidateId) : + Refutation id ↔ (statement id → False) := Iff.rfl + +end Math30.Competition diff --git a/Math30/MatrixBoolean.lean b/Math30/MatrixBoolean.lean new file mode 100644 index 0000000..40ac725 --- /dev/null +++ b/Math30/MatrixBoolean.lean @@ -0,0 +1,371 @@ +import Mathlib.LinearAlgebra.Matrix.StdBasis +import Mathlib.Basic.Complex.Basic +import Mathlib.Algebra.Field.ZMod +import Mathlib.RingTheory.Nullstellensatz +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Data.Fintype.Powerset +import Mathlib.Data.Fintype.Pi +import Mathlib.Data.Finset.Lattice.Fold +import Mathlib.Algebra.BigOperators.Group.Finset.Powerset +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Tauto +import Mathlib.Tactic.FinCases + +/-! +# Statements 16–21: matrix multiplication and Boolean complexity + +These are proposition-valued definitions, not assertions that the open targets hold. +Matrix products are exact unless `zariskiClosure` is explicitly used. Boolean inputs +are total functions on the finite cube, and polynomial degree is real multilinear +degree. See `MATRIX_BOOLEAN.md` for sources, quantifiers, and verification scope. +-/ + +open scoped BigOperators + +noncomputable section + +namespace Math30 +namespace MatrixBoolean + +abbrev SquareMatrix (K : Type*) (n : ℕ) := Matrix (Fin n) (Fin n) K + +/-- An exact bilinear algorithm with `r` scalar products. Zero terms are allowed, +so existence with `r` products means "at most `r`". -/ +def HasBilinearAlgorithm (K : Type*) [Field K] (n r : ℕ) : Prop := + ∃ (left right : Fin r → SquareMatrix K n →ₗ[K] K) + (output : Fin r → SquareMatrix K n), + ∀ A B : SquareMatrix K n, + A * B = ∑ t : Fin r, (left t A * right t B) • output t + +/-- Zero products can be appended without changing any matrix output. -/ +theorem hasBilinearAlgorithm_pad {K : Type*} [Field K] {n r : ℕ} + (h : HasBilinearAlgorithm K n r) (k : ℕ) : HasBilinearAlgorithm K n (r + k) := by + rcases h with ⟨a, b, c, habc⟩ + refine ⟨Fin.addCases a (fun _ => 0), Fin.addCases b (fun _ => 0), + Fin.addCases c (fun _ => 0), ?_⟩ + intro A B + simpa [Fin.sum_univ_add] using habc A B + + theorem hasBilinearAlgorithm_mono {K : Type*} [Field K] {n r s : ℕ} + (hrs : r ≤ s) (h : HasBilinearAlgorithm K n r) : HasBilinearAlgorithm K n s := by + obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le hrs + exact hasBilinearAlgorithm_pad h k + + theorem hasBilinearAlgorithm_iff_at_most {K : Type*} [Field K] (n s : ℕ) : + HasBilinearAlgorithm K n s ↔ ∃ r ≤ s, HasBilinearAlgorithm K n r := by + constructor + · intro h + exact ⟨s, le_rfl, h⟩ + · rintro ⟨r, hrs, h⟩ + exact hasBilinearAlgorithm_mono hrs h + +/-- 16. A complex 4-by-4 multiplication algorithm using at most 47 products. -/ +def Statement16 : Prop := HasBilinearAlgorithm ℂ 4 47 + +/-- 17. Exact bilinear rank 23 over the two-element field. -/ +def Statement17 : Prop := + HasBilinearAlgorithm (ZMod 2) 3 23 ∧ + ∀ r : ℕ, r < 23 → ¬ HasBilinearAlgorithm (ZMod 2) 3 r + +/-- A verified 22-product construction would refute target 17. -/ +theorem products22_refute_statement17 + (h : HasBilinearAlgorithm (ZMod 2) 3 22) : ¬ Statement17 := by + intro hs + exact hs.2 22 (by norm_num) h + +abbrev MatrixIndex (n : ℕ) := Fin n × Fin n +abbrev TensorIndex (n : ℕ) := MatrixIndex n × MatrixIndex n × MatrixIndex n +abbrev CoordinateTensor (n : ℕ) := TensorIndex n → ℂ + +/-- Structure constants of ordinary square matrix multiplication, in the standard +matrix-unit bases: left `(i,j)`, right `(k,l)`, output `(a,b)`. -/ +def multiplicationTensor (n : ℕ) : CoordinateTensor n := fun q => + if q.1.2 = q.2.1.1 ∧ q.1.1 = q.2.2.1 ∧ q.2.1.2 = q.2.2.2 then 1 else 0 + +/-- Contract tensor coefficients with the entries of two input matrices. -/ +noncomputable def contractTensor {n : ℕ} (T : CoordinateTensor n) + (A B : SquareMatrix ℂ n) : SquareMatrix ℂ n := fun i j => + ∑ a : MatrixIndex n, ∑ b : MatrixIndex n, + T (a, b, (i, j)) * A a.1 a.2 * B b.1 b.2 + +/-- The coordinate tensor used for border rank represents exactly the usual +matrix product, so its indexing convention is checked rather than assumed. -/ +theorem contract_multiplicationTensor {n : ℕ} (A B : SquareMatrix ℂ n) : + contractTensor (multiplicationTensor n) A B = A * B := by + ext i j + simp [contractTensor, multiplicationTensor, Fintype.sum_prod_type, + Matrix.mul_apply, ite_and, ite_mul, and_left_comm] + +/-- Concrete rank-at-most locus in affine tensor-coordinate space. Every summand +is decomposable; zero vectors permit padding shorter decompositions. -/ +def TensorRankAtMost (n r : ℕ) (T : CoordinateTensor n) : Prop := + ∃ a b c : Fin r → MatrixIndex n → ℂ, + ∀ q : TensorIndex n, T q = ∑ t : Fin r, a t q.1 * b t q.2.1 * c t q.2.2 + +/-- The common zero set of a set of complex multivariate polynomials. -/ +def polynomialZeroSet {ι : Type*} (P : Set (MvPolynomial ι ℂ)) : Set (ι → ℂ) := + {x | ∀ p ∈ P, MvPolynomial.eval x p = 0} + +/-- The affine Zariski closure, concretely the zero set of *all* polynomials +vanishing on the set. This is not closure in the usual complex metric topology. -/ +def zariskiClosure {ι : Type*} (S : Set (ι → ℂ)) : Set (ι → ℂ) := + polynomialZeroSet {p | ∀ x ∈ S, MvPolynomial.eval x p = 0} + +/-- Membership is exactly the polynomial-vanishing characterization of Zariski +closure, with every complex multivariate polynomial quantified. -/ +theorem mem_zariskiClosure_iff {ι : Type*} (S : Set (ι → ℂ)) (x : ι → ℂ) : + x ∈ zariskiClosure S ↔ + ∀ p : MvPolynomial ι ℂ, + (∀ y ∈ S, MvPolynomial.eval y p = 0) → MvPolynomial.eval x p = 0 := Iff.rfl + +theorem subset_zariskiClosure {ι : Type*} (S : Set (ι → ℂ)) : + S ⊆ zariskiClosure S := by + intro x hx p hp + exact hp x hx + +/-- The closure is contained in every polynomial zero set containing `S`. -/ +theorem zariskiClosure_minimal {ι : Type*} (S : Set (ι → ℂ)) + (P : Set (MvPolynomial ι ℂ)) (h : S ⊆ polynomialZeroSet P) : + zariskiClosure S ⊆ polynomialZeroSet P := by + intro x hx p hp + exact hx p (fun y hy => h hy p hp) + +/-- It is itself a polynomial zero set. Together with minimality, this certifies +that the definition is the intersection of all algebraic closed sets containing S. -/ +theorem zariskiClosure_is_zeroSet {ι : Type*} (S : Set (ι → ℂ)) : + ∃ P : Set (MvPolynomial ι ℂ), zariskiClosure S = polynomialZeroSet P := + ⟨_, rfl⟩ + +/-- Direct agreement with Mathlib's algebraic zero-locus/vanishing-ideal API. -/ +theorem zariskiClosure_eq_mathlib_zeroLocus {ι : Type*} (S : Set (ι → ℂ)) : + zariskiClosure S = MvPolynomial.zeroLocus ℂ (MvPolynomial.vanishingIdeal ℂ S) := rfl + +/-- Complex border rank at most `r`, using the actual affine Zariski closure. -/ +def TensorBorderRankAtMost (n r : ℕ) (T : CoordinateTensor n) : Prop := + T ∈ zariskiClosure {U | TensorRankAtMost n r U} + +/-- 18. Complex 3-by-3 multiplication has border rank at least 18. -/ +def Statement18 : Prop := ¬ TensorBorderRankAtMost 3 17 (multiplicationTensor 3) + +theorem tensorRank_implies_borderRank {n r : ℕ} {T : CoordinateTensor n} + (h : TensorRankAtMost n r T) : TensorBorderRankAtMost n r T := + subset_zariskiClosure _ h + +theorem tensorRank_zero_iff {n : ℕ} (T : CoordinateTensor n) : + TensorRankAtMost n 0 T ↔ T = 0 := by + constructor + · rintro ⟨a, b, c, h⟩ + funext q + simpa using h q + · intro h + subst T + exact ⟨fun t => Fin.elim0 t, fun t => Fin.elim0 t, + fun t => Fin.elim0 t, by simp⟩ + +/-- Zero-rank border closure contains only zero: coordinate polynomials separate +any nonzero tensor from the rank-zero locus. -/ +theorem tensorBorderRank_zero_iff {n : ℕ} (T : CoordinateTensor n) : + TensorBorderRankAtMost n 0 T ↔ T = 0 := by + constructor + · intro h + funext q + have hq := h (MvPolynomial.X q) (by + intro U hU + have hz := (tensorRank_zero_iff U).mp hU + subst U + simp) + simpa using hq + · intro h + exact tensorRank_implies_borderRank ((tensorRank_zero_iff T).mpr h) + +abbrev BooleanInput (n : ℕ) := Fin n → Bool +abbrev BooleanFunction (n : ℕ) := BooleanInput n → Bool + +def boolReal (b : Bool) : ℝ := if b then 1 else 0 + +def zeroInput (n : ℕ) : BooleanInput n := fun _ => false + +def unitInput {n : ℕ} (i : Fin n) : BooleanInput n := fun j => decide (j = i) + +/-- Flip exactly the coordinates in one finite block. -/ +def flipBlock {n : ℕ} (x : BooleanInput n) (B : Finset (Fin n)) : BooleanInput n := + fun i => if i ∈ B then !(x i) else x i + +def flipBit {n : ℕ} (x : BooleanInput n) (i : Fin n) : BooleanInput n := + flipBlock x {i} + +noncomputable def sensitivityAt {n : ℕ} (f : BooleanFunction n) + (x : BooleanInput n) : ℕ := + (Finset.univ.filter fun i => f (flipBit x i) ≠ f x).card + +noncomputable def sensitivity {n : ℕ} (f : BooleanFunction n) : ℕ := + Finset.univ.sup (sensitivityAt f) + +/-- Blocks are distinct (a finset), pairwise disjoint, and each block separately +changes the value at `x`. An empty block can never satisfy the changing condition. -/ +def SensitiveBlockFamily {n : ℕ} (f : BooleanFunction n) (x : BooleanInput n) + (F : Finset (Finset (Fin n))) : Prop := + (∀ B ∈ F, ∀ C ∈ F, B ≠ C → Disjoint B C) ∧ + ∀ B ∈ F, f (flipBlock x B) ≠ f x + +noncomputable def blockSensitivityAt {n : ℕ} (f : BooleanFunction n) + (x : BooleanInput n) : ℕ := by + classical + exact Finset.univ.sup fun F : Finset (Finset (Fin n)) => + if SensitiveBlockFamily f x F then F.card else 0 + +noncomputable def blockSensitivity {n : ℕ} (f : BooleanFunction n) : ℕ := + Finset.univ.sup (blockSensitivityAt f) + +/-- Coefficients of a genuinely multilinear real polynomial. A monomial is +indexed by a *set* of variables, so repeated powers cannot enter this definition. -/ +abbrev MultilinearCoefficients (n : ℕ) := Finset (Fin n) → ℝ + +noncomputable def evalMultilinear {n : ℕ} (c : MultilinearCoefficients n) + (x : BooleanInput n) : ℝ := + ∑ S : Finset (Fin n), c S * ∏ i ∈ S, boolReal (x i) + +/-- Exact equality on every input of the total Boolean cube; not approximation. -/ +def Represents {n : ℕ} (f : BooleanFunction n) (c : MultilinearCoefficients n) : Prop := + ∀ x, evalMultilinear c x = boolReal (f x) + +/-- Real multilinear degree at most `d`. All coefficients of monomials with more +than `d` distinct variables must vanish. -/ +def RealDegreeAtMost {n : ℕ} (f : BooleanFunction n) (d : ℕ) : Prop := + ∃ c : MultilinearCoefficients n, + Represents f c ∧ ∀ S, d < S.card → c S = 0 + +/-- The exact least possible real multilinear degree, with degree zero for both +constant Boolean functions. This does not take the degree of an arbitrary witness. -/ +def ExactRealDegree {n : ℕ} (f : BooleanFunction n) (d : ℕ) : Prop := + RealDegreeAtMost f d ∧ ∀ e : ℕ, e < d → ¬ RealDegreeAtMost f e + +/-- Exact degree is unique, independent of a chosen representing polynomial. -/ +theorem exactRealDegree_unique {n d e : ℕ} {f : BooleanFunction n} + (hd : ExactRealDegree f d) (he : ExactRealDegree f e) : d = e := by + rcases lt_trichotomy d e with h | h | h + · exact False.elim (he.2 d h hd.1) + · exact h + · exact False.elim (hd.2 e h he.1) + +/-- Every function admitting a multilinear representation has an exact degree; +there is no choice of a non-minimal witness in the target definitions. -/ +theorem exists_exactRealDegree_of_representation {n : ℕ} {f : BooleanFunction n} + (h : ∃ d, RealDegreeAtMost f d) : ∃ d, ExactRealDegree f d := by + classical + refine ⟨Nat.find h, Nat.find_spec h, ?_⟩ + intro e he + exact Nat.find_min h he + +/-- The characteristic Boolean input of a finite set of coordinates. -/ +def setInput {n : ℕ} (S : Finset (Fin n)) : BooleanInput n := fun i => decide (i ∈ S) + +/-- Evaluate a multilinear polynomial at a characteristic vector by summing +exactly the coefficients indexed by subsets of that vector's support. -/ +theorem evalMultilinear_setInput {n : ℕ} (c : MultilinearCoefficients n) + (S : Finset (Fin n)) : evalMultilinear c (setInput S) = ∑ T ∈ S.powerset, c T := by + classical + have hfilter : Finset.univ.filter (fun T : Finset (Fin n) => T ⊆ S) = S.powerset := by + ext T + simp + simp only [evalMultilinear, setInput, boolReal, decide_eq_true_eq] + simp_rw [Finset.prod_boole, ← Finset.subset_iff, mul_ite, mul_one, mul_zero] + rw [← Finset.sum_filter, hfilter] + +/-- The triangular interpolation coefficients: subtract all proper-subset +coefficients from the function value at the characteristic input. -/ +noncomputable def interpolationCoefficients {n : ℕ} (f : BooleanFunction n) + (S : Finset (Fin n)) : ℝ := + Finset.strongInductionOn S fun S rec => + boolReal (f (setInput S)) - + ∑ T ∈ S.powerset, if h : T ⊂ S then rec T h else 0 + + theorem interpolationCoefficients_eq {n : ℕ} (f : BooleanFunction n) + (S : Finset (Fin n)) : + interpolationCoefficients f S = boolReal (f (setInput S)) - + ∑ T ∈ S.powerset, if T ⊂ S then interpolationCoefficients f T else 0 := by + rw [interpolationCoefficients, Finset.strongInductionOn_eq] + rfl + + theorem strictSubset_filter {n : ℕ} (S : Finset (Fin n)) : + S.powerset.filter (fun T => T ⊂ S) = S.powerset.erase S := by + ext T + simp only [Finset.mem_filter, Finset.mem_powerset, Finset.mem_erase, + Finset.ssubset_iff_subset_ne] + tauto + + theorem sum_interpolationCoefficients {n : ℕ} (f : BooleanFunction n) + (S : Finset (Fin n)) : + (∑ T ∈ S.powerset, interpolationCoefficients f T) = boolReal (f (setInput S)) := by + have heq := interpolationCoefficients_eq f S + rw [← Finset.sum_filter, strictSubset_filter] at heq + rw [← Finset.sum_erase_add _ _ (Finset.mem_powerset_self S)] + linarith + +/-- Every total Boolean function has a multilinear representation; thus neither +the real-degree relation nor the universal statement relies on missing objects. -/ +theorem interpolation_represents {n : ℕ} (f : BooleanFunction n) : + Represents f (interpolationCoefficients f) := by + intro x + let S : Finset (Fin n) := Finset.univ.filter fun i => x i = true + have hS : setInput S = x := by + funext i + simp [setInput, S] + rw [← hS, evalMultilinear_setInput, sum_interpolationCoefficients] + + theorem realDegreeAtMost_dimension {n : ℕ} (f : BooleanFunction n) : + RealDegreeAtMost f n := by + refine ⟨interpolationCoefficients f, interpolation_represents f, ?_⟩ + intro S hS + have hc : S.card ≤ n := by simpa using Finset.card_le_card (Finset.subset_univ S) + omega + + theorem exists_exactRealDegree {n : ℕ} (f : BooleanFunction n) : + ∃ d, ExactRealDegree f d := + exists_exactRealDegree_of_representation ⟨n, realDegreeAtMost_dimension f⟩ + +/-- The real multilinear representation is unique, not just its least degree. -/ +theorem represents_unique {n : ℕ} {f : BooleanFunction n} + {c d : MultilinearCoefficients n} (hc : Represents f c) (hd : Represents f d) : + c = d := by + funext S + induction S using Finset.strongInductionOn + rename_i S ih + have heq : (∑ T ∈ S.powerset, c T) = ∑ T ∈ S.powerset, d T := by + rw [← evalMultilinear_setInput, ← evalMultilinear_setInput, hc, hd] + have hs : (∑ T ∈ S.powerset.erase S, c T) = ∑ T ∈ S.powerset.erase S, d T := by + apply Finset.sum_congr rfl + intro T hT + apply ih T + rcases Finset.mem_erase.mp hT with ⟨hne, hsub⟩ + exact Finset.ssubset_iff_subset_ne.mpr ⟨Finset.mem_powerset.mp hsub, hne⟩ + rw [← Finset.sum_erase_add _ _ (Finset.mem_powerset_self S), + ← Finset.sum_erase_add _ _ (Finset.mem_powerset_self S), hs] at heq + exact add_left_cancel heq + +/-- 19. A 14-variable Boolean function of real degree at most five which is +fully sensitive at zero, normalized by f(0)=0 and f(e_i)=1. -/ +def Statement19 : Prop := + ∃ f : BooleanFunction 14, + RealDegreeAtMost f 5 ∧ f (zeroInput 14) = false ∧ ∀ i, f (unitInput i) = true + +/-- Nonconstant is witnessed by two cube points with different outputs. -/ +def Nonconstant {n : ℕ} (f : BooleanFunction n) : Prop := ∃ x y, f x ≠ f y + +/-- 20. A uniform subquadratic sensitivity/real-degree bound. The exact degree is +existentially required for every f, so failure to have a degree cannot make this +statement vacuous. Real exponentiation is used, not natural truncated powers. -/ +def Statement20 : Prop := + ∃ C ε : ℝ, 0 < C ∧ 0 < ε ∧ ε < 1 ∧ + ∀ n : ℕ, ∀ f : BooleanFunction n, Nonconstant f → + ∃ d : ℕ, ExactRealDegree f d ∧ + (sensitivity f : ℝ) ≤ C * Real.rpow (d : ℝ) (2 - ε) + +/-- 21. A uniform cubic upper bound of block sensitivity by sensitivity. -/ +def Statement21 : Prop := + ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, ∀ f : BooleanFunction n, + (blockSensitivity f : ℝ) ≤ C * (sensitivity f : ℝ) ^ 3 + +end MatrixBoolean +end Math30 diff --git a/Math30/MatrixBooleanFixtures.lean b/Math30/MatrixBooleanFixtures.lean new file mode 100644 index 0000000..a64d957 --- /dev/null +++ b/Math30/MatrixBooleanFixtures.lean @@ -0,0 +1,215 @@ +import Math30.MatrixBoolean + +open scoped BigOperators + +noncomputable section + +namespace Math30.MatrixBoolean + +/-- The one-by-one entry is an actual linear form, not an arbitrary function. -/ +def scalarEntry (K : Type*) [Field K] : SquareMatrix K 1 →ₗ[K] K where + toFun A := A 0 0 + map_add' _ _ := rfl + map_smul' _ _ := rfl + + theorem scalar_multiplication_one_product (K : Type*) [Field K] : + HasBilinearAlgorithm K 1 1 := by + refine ⟨fun _ => scalarEntry K, fun _ => scalarEntry K, fun _ => 1, ?_⟩ + intro A B + ext i j + fin_cases i + fin_cases j + simp [scalarEntry, Matrix.mul_apply] + rfl + + theorem scalar_multiplication_not_zero_products (K : Type*) [Field K] : + ¬ HasBilinearAlgorithm K 1 0 := by + rintro ⟨a, b, c, h⟩ + have hh := congrArg (fun M : SquareMatrix K 1 => M 0 0) (h 1 1) + simp at hh + + theorem zero_tensor_rank_fixture (n r : ℕ) : TensorRankAtMost n r 0 := by + exact ⟨fun _ _ => 0, fun _ _ => 0, fun _ _ => 0, by simp⟩ + + theorem multiplication_border_rank_positive_fixture : + ¬ TensorBorderRankAtMost 3 0 (multiplicationTensor 3) := by + intro h + have heq := (tensorBorderRank_zero_iff (multiplicationTensor 3)).mp h + have hq := congrFun heq ((0, 0), (0, 0), (0, 0)) + simp [multiplicationTensor] at hq + + theorem zariski_empty_fixture {ι : Type*} : + zariskiClosure (∅ : Set (ι → ℂ)) = ∅ := by + ext x + constructor + · intro hx + have h1 := hx 1 (by simp) + simp at h1 + · simp + +@[simp] theorem flipBlock_empty {n : ℕ} (x : BooleanInput n) : flipBlock x ∅ = x := by + funext i + simp [flipBlock] + +/-- Empty blocks cannot falsely increase block sensitivity. -/ + theorem sensitiveBlockFamily_nonempty_blocks {n : ℕ} {f : BooleanFunction n} + {x : BooleanInput n} {F : Finset (Finset (Fin n))} (hF : SensitiveBlockFamily f x F) + {B : Finset (Fin n)} (hB : B ∈ F) : B.Nonempty := by + by_contra h + have hz : B = ∅ := Finset.not_nonempty_iff_eq_empty.mp h + have hc := hF.2 B hB + simp [hz] at hc + + theorem flipBit_zero_eq_unit {n : ℕ} (i : Fin n) : + flipBit (zeroInput n) i = unitInput i := by + funext j + by_cases h : j = i <;> simp [flipBit, flipBlock, zeroInput, unitInput, h] + +/-- The normalization in statement19 really gives sensitivity14 at zero. -/ + theorem statement19_witness_full_sensitivity + (f : BooleanFunction 14) (h0 : f (zeroInput 14) = false) + (h1 : ∀ i, f (unitInput i) = true) : sensitivityAt f (zeroInput 14) = 14 := by + simp [sensitivityAt, flipBit_zero_eq_unit, h0, h1] + + theorem sensitivityAt_constant (n : ℕ) (b : Bool) (x : BooleanInput n) : + sensitivityAt (fun _ : BooleanInput n => b) x = 0 := by + simp [sensitivityAt] + + theorem sensitivity_constant (n : ℕ) (b : Bool) : + sensitivity (fun _ : BooleanInput n => b) = 0 := by + simp [sensitivity, sensitivityAt_constant] + + theorem sensitiveBlockFamily_constant_iff (n : ℕ) (b : Bool) (x : BooleanInput n) + (F : Finset (Finset (Fin n))) : + SensitiveBlockFamily (fun _ : BooleanInput n => b) x F ↔ F = ∅ := by + constructor + · intro h + apply Finset.eq_empty_iff_forall_notMem.mpr + intro B hB + exact h.2 B hB rfl + · intro h + subst F + simp [SensitiveBlockFamily] + + theorem blockSensitivity_constant (n : ℕ) (b : Bool) : + blockSensitivity (fun _ : BooleanInput n => b) = 0 := by + simp [blockSensitivity, blockSensitivityAt, sensitiveBlockFamily_constant_iff] + +noncomputable def constantCoefficients (n : ℕ) (b : Bool) : MultilinearCoefficients n := + fun S => if S = ∅ then boolReal b else 0 + + theorem constant_representation (n : ℕ) (b : Bool) : + Represents (fun _ : BooleanInput n => b) (constantCoefficients n b) := by + intro x + simp [evalMultilinear, constantCoefficients, ite_mul] + + theorem exactRealDegree_constant (n : ℕ) (b : Bool) : + ExactRealDegree (fun _ : BooleanInput n => b) 0 := by + refine ⟨⟨constantCoefficients n b, constant_representation n b, ?_⟩, ?_⟩ + · intro S hS + have hne : S ≠ ∅ := by intro he; simp [he] at hS + simp [constantCoefficients, hne] + · intro e he + omega + +/-- No zero-variable function can be a spurious nonconstant case. -/ + theorem not_nonconstant_zero_dimension (f : BooleanFunction 0) : ¬ Nonconstant f := by + rintro ⟨x, y, hxy⟩ + have h : x = y := Subsingleton.elim _ _ + exact hxy (congrArg f h) + +/-- Degree-zero multilinear polynomials are constant on the entire cube. -/ + theorem degree_zero_values_equal {n : ℕ} {f : BooleanFunction n} + (h : RealDegreeAtMost f 0) (x y : BooleanInput n) : f x = f y := by + classical + rcases h with ⟨c, hc, hdeg⟩ + have heval (z : BooleanInput n) : evalMultilinear c z = c ∅ := by + unfold evalMultilinear + rw [Finset.sum_eq_single ∅] + · simp + · intro S _ hS + have hp : 0 < S.card := Finset.card_pos.mpr (Finset.nonempty_iff_ne_empty.mpr hS) + simp [hdeg S hp] + · simp + have hb : boolReal (f x) = boolReal (f y) := by rw [← hc x, ← hc y, heval, heval] + cases hx : f x <;> cases hy : f y <;> simp_all [boolReal] + + theorem nonconstant_degree_positive {n d : ℕ} {f : BooleanFunction n} + (hf : Nonconstant f) (hd : ExactRealDegree f d) : 0 < d := by + rcases hf with ⟨x, y, hxy⟩ + by_contra h + have hzero : d = 0 := by omega + subst d + exact hxy (degree_zero_values_equal hd.1 x y) + +noncomputable def dictatorCoefficients {n : ℕ} (i : Fin n) : MultilinearCoefficients n := + fun S => if S = {i} then 1 else 0 + + theorem dictator_representation {n : ℕ} (i : Fin n) : + Represents (fun x => x i) (dictatorCoefficients i) := by + intro x + simp [evalMultilinear, dictatorCoefficients, ite_mul] + + theorem dictator_exact_degree {n : ℕ} (i : Fin n) : ExactRealDegree (fun x => x i) 1 := by + constructor + · refine ⟨dictatorCoefficients i, dictator_representation i, ?_⟩ + intro S hS + have hne : S ≠ {i} := by intro he; simp [he] at hS + simp [dictatorCoefficients, hne] + · intro d hd hrep + have hz : d = 0 := by omega + subst d + have hh := degree_zero_values_equal hrep (zeroInput n) (unitInput i) + simp [zeroInput, unitInput] at hh + + theorem dictator_sensitivity_at {n : ℕ} (i : Fin n) (x : BooleanInput n) : + sensitivityAt (fun x => x i) x = 1 := by + classical + have hfilter : (Finset.univ.filter fun j => flipBit x j i ≠ x i) = {i} := by + ext j + by_cases h : j = i + · subst j + cases hx : x i <;> simp [flipBit, flipBlock, hx] + · simp [flipBit, flipBlock, h, Ne.symm h] + simp only [sensitivityAt, hfilter, Finset.card_singleton] + +/-- Two-bit full parity, used to test degree and individual versus joint flips. -/ +def parityTwo (x : BooleanInput 2) : Bool := Bool.xor (x 0) (x 1) + +noncomputable def parityTwoCoefficients : MultilinearCoefficients 2 := fun S => + (if S = {0} then 1 else 0) + (if S = {1} then 1 else 0) - + 2 * (if S = Finset.univ then 1 else 0) + + theorem parityTwo_representation : Represents parityTwo parityTwoCoefficients := by + intro x + simp [evalMultilinear, parityTwoCoefficients, add_mul, sub_mul, + Finset.sum_add_distrib, Finset.sum_sub_distrib, ite_mul, mul_ite, + Fin.prod_univ_two, parityTwo, boolReal] + cases x 0 <;> cases x 1 <;> norm_num + + theorem parityTwo_exact_degree : ExactRealDegree parityTwo 2 := by + constructor + · refine ⟨parityTwoCoefficients, parityTwo_representation, ?_⟩ + intro S hS + have hc : S.card ≤ 2 := by simpa using Finset.card_le_card (Finset.subset_univ S) + omega + · intro d hd hrep + rcases hrep with ⟨c, hc, hdeg⟩ + have heq := represents_unique hc parityTwo_representation + have hz := hdeg Finset.univ (by simpa using hd) + rw [heq] at hz + have hu0 : (Finset.univ : Finset (Fin 2)) ≠ {0} := by decide + have hu1 : (Finset.univ : Finset (Fin 2)) ≠ {1} := by decide + norm_num [parityTwoCoefficients, hu0, hu1] at hz + + theorem parityTwo_separate_blocks_fixture : + SensitiveBlockFamily parityTwo (zeroInput 2) {{0}, {1}} := by + unfold SensitiveBlockFamily + decide + + theorem parityTwo_joint_flip_fixture : + parityTwo (flipBlock (zeroInput 2) Finset.univ) = parityTwo (zeroInput 2) := by decide + + theorem parityTwo_sensitivity_fixture : sensitivityAt parityTwo (zeroInput 2) = 2 := by decide + +end Math30.MatrixBoolean diff --git a/Math30/Polya.lean b/Math30/Polya.lean new file mode 100644 index 0000000..cdc123b --- /dev/null +++ b/Math30/Polya.lean @@ -0,0 +1,230 @@ +import Mathlib.Analysis.Calculus.Gradient.Basic +import Mathlib.Analysis.Distribution.ContDiffMapSupportedIn +import Mathlib.Analysis.InnerProductSpace.PiL2 +import Mathlib.Analysis.Convex.Basic +import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic +import Mathlib.MeasureTheory.Function.L2Space +import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar +import Mathlib.Analysis.Normed.Lp.MeasurableSpace + +/-! +# Targets 25–27: planar Dirichlet Pólya inequalities + +The spectral quantity below is constructed from the actual Euclidean gradient, +Lebesgue `L²` spaces, and the closure of the `C∞c(Ω)` gradient graph. There is no +eigenvalue parameter, spectral oracle, or assumed Pólya estimate. + +`h01Graph Ω` is the zero-extension graph realization of `H₀¹(Ω)`. Its topology is +the product `L² × L²` topology, equivalent to the usual Sobolev graph norm. +`dirichletMinmax Ω k` is the extended-real Courant–Fischer variational value. +Using `ℝ≥0∞` for the infimum and supremum avoids the arbitrary empty/unbounded +set conventions of conditionally complete `ℝ`. `dirichletEigenvalue` takes its +real value; the intended uses all have `k ≥ 1` and a bounded nonempty open domain. + +The companion modules prove the graph is a closed linear subspace, its +distributional integration-by-parts identity and gradient closability, +injectivity of its value projection, Poincaré coercivity, actual trial spaces +of every finite dimension, and finite positive ordered min–max values. They +also prove that real conversion is lossless, and give exact variational +equivalences for the three unchanged targets. `PolyaReadiness` proves that the +product graph topology is the standard square-sum Sobolev norm topology. + +The package adopts the standard Courant–Fischer variational definition of the +Dirichlet spectral values, with k-dimensional spaces encoding multiplicities. +It does not separately construct an unbounded Laplace operator, prove Rellich +compactness, or claim an operator-identification theorem. That separate +operator reconstruction is not silently assumed as an axiom. The Pólya +targets themselves remain named `Prop` definitions, not claimed proofs. + +Sources: Jiang–Lin, arXiv:2507.04307v3, §1.1, and Frank–Larson, +arXiv:2410.04769v2, §1. The dimension-two specialization is `A λₖ ≥ 4πk`. +The exact H₀¹ closure and whole-space min–max convention is also stated in +De Philippis–Lamboley–Pierre–Velichkov, *Regularity of minimizers of shape +optimization problems involving perimeter*, §§2.1 and 2.4. +-/ + +noncomputable section + +open Set MeasureTheory +open scoped ENNReal NNReal Topology ContDiff + +namespace Math30.Polya + +/-- Euclidean two-space, with its Euclidean norm and canonical Lebesgue measure. -/ +abbrev Plane := EuclideanSpace ℝ (Fin 2) + +/-- The boundary is locally a one-sided Lipschitz graph after an orthogonal +change of coordinates and translation. The graph function is globally +Lipschitz; a local graph function can be extended without changing the local +condition. Disconnected domains are allowed. -/ +def HasLipschitzBoundary (Ω : Set Plane) : Prop := + ∀ p ∈ frontier Ω, ∃ r : ℝ, 0 < r ∧ + ∃ R : Plane ≃ₗᵢ[ℝ] Plane, ∃ f : ℝ → ℝ, ∃ K : ℝ≥0, + LipschitzWith K f ∧ f 0 = 0 ∧ + ∀ x ∈ Metric.ball p r, + (x ∈ Ω ↔ f ((R (x - p)) 0) < (R (x - p)) 1) + +/-- Exactly the geometric hypotheses used in targets 25–27. Finiteness of +area is recorded explicitly, though it also follows from boundedness here. -/ +structure PlanarLipschitzDomain where + carrier : Set Plane + isOpen : IsOpen carrier + nonempty : carrier.Nonempty + bounded : Bornology.IsBounded carrier + lipschitzBoundary : HasLipschitzBoundary carrier + finiteArea : volume carrier ≠ (⊤ : ℝ≥0∞) + +/-- Actual Lebesgue area, converted to a real number. -/ +def area (Ω : Set Plane) : ℝ := (volume Ω).toReal + +theorem area_pos (Ω : PlanarLipschitzDomain) : 0 < area Ω.carrier := by + exact ENNReal.toReal_pos (ne_of_gt (Ω.isOpen.measure_pos volume Ω.nonempty)) Ω.finiteArea + +/-- Values and vector-valued weak gradients, both modulo almost-everywhere +equality with respect to actual planar Lebesgue measure. -/ +abbrev SobolevAmbient := + Lp ℝ 2 (volume : Measure Plane) × Lp Plane 2 (volume : Measure Plane) + +/-- A genuine compactly supported smooth function inside Ω. -/ +def IsTestFunction (Ω : Set Plane) (φ : Plane → ℝ) : Prop := + ContDiff ℝ ∞ φ ∧ HasCompactSupport φ ∧ tsupport φ ⊆ Ω + +/-- The smooth gradient graph inside the two actual `L²` spaces. -/ +def smoothGraph (Ω : Set Plane) : Set SobolevAmbient := + {w | ∃ φ : Plane → ℝ, IsTestFunction Ω φ ∧ + (∀ᵐ x ∂(volume : Measure Plane), w.1 x = φ x) ∧ + (∀ᵐ x ∂(volume : Measure Plane), w.2 x = gradient φ x)} + +/-- Zero-boundary Sobolev space represented by its value/gradient graph. +This is a concrete closure, not an unspecified Sobolev-space predicate. -/ +def h01Graph (Ω : Set Plane) : Set SobolevAmbient := closure (smoothGraph Ω) + +theorem isTestFunction_mono {Ω Ω' : Set Plane} (h : Ω ⊆ Ω') + {φ : Plane → ℝ} (hφ : IsTestFunction Ω φ) : IsTestFunction Ω' φ := + ⟨hφ.1, hφ.2.1, hφ.2.2.trans h⟩ + +theorem smoothGraph_mono {Ω Ω' : Set Plane} (h : Ω ⊆ Ω') : + smoothGraph Ω ⊆ smoothGraph Ω' := by + rintro w ⟨φ, hφ, hu, hg⟩ + exact ⟨φ, isTestFunction_mono h hφ, hu, hg⟩ + +theorem h01Graph_mono {Ω Ω' : Set Plane} (h : Ω ⊆ Ω') : + h01Graph Ω ⊆ h01Graph Ω' := closure_mono (smoothGraph_mono h) + +theorem smoothGraph_subset_h01Graph (Ω : Set Plane) : + smoothGraph Ω ⊆ h01Graph Ω := subset_closure + +theorem isClosed_h01Graph (Ω : Set Plane) : IsClosed (h01Graph Ω) := isClosed_closure + +theorem zero_mem_smoothGraph (Ω : Set Plane) : (0 : SobolevAmbient) ∈ smoothGraph Ω := by + refine ⟨0, ⟨contDiff_const, HasCompactSupport.zero, ?_⟩, ?_, ?_⟩ + · simp + · exact Lp.coeFn_zero ℝ 2 volume + · change ∀ᵐ x ∂(volume : Measure Plane), + (0 : Lp Plane 2 (volume : Measure Plane)) x = gradient (fun _ : Plane => (0 : ℝ)) x + filter_upwards [Lp.coeFn_zero Plane 2 (volume : Measure Plane)] with x hx + rw [gradient_fun_const] + exact hx + +theorem zero_mem_h01Graph (Ω : Set Plane) : (0 : SobolevAmbient) ∈ h01Graph Ω := + smoothGraph_subset_h01Graph Ω (zero_mem_smoothGraph Ω) + +/-- `k`-dimensional trial spaces in the concrete Sobolev graph. These premises +contain no bound on a Rayleigh quotient or eigenvalue. -/ +structure TrialSpace (Ω : Set Plane) (k : ℕ) where + space : Submodule ℝ SobolevAmbient + finiteDimensional : FiniteDimensional ℝ space + dimension : Module.finrank ℝ space = k + contained : (space : Set SobolevAmbient) ⊆ h01Graph Ω + +/-- Squared `L²` norm of the value component: the integral of `u²`. -/ +def mass (w : SobolevAmbient) : ℝ := ‖w.1‖ ^ 2 + +/-- Squared `L²` norm of the Euclidean gradient: the Dirichlet energy. -/ +def energy (w : SobolevAmbient) : ℝ := ‖w.2‖ ^ 2 + +theorem mass_eq_integral (w : SobolevAmbient) : + mass w = ∫ x : Plane, (w.1 x) ^ 2 := by + rw [mass, ← real_inner_self_eq_norm_sq, L2.inner_def] + congr 1 + ext x + simp only [Real.inner_apply, pow_two] + +theorem energy_eq_integral (w : SobolevAmbient) : + energy w = ∫ x : Plane, ‖w.2 x‖ ^ 2 := by + rw [energy, ← real_inner_self_eq_norm_sq, L2.inner_def] + congr 1 + ext x + exact real_inner_self_eq_norm_sq _ + +theorem mass_pos {w : SobolevAmbient} (h : w.1 ≠ 0) : 0 < mass w := by + exact sq_pos_of_pos (norm_pos_iff.mpr h) + +theorem energy_nonneg (w : SobolevAmbient) : 0 ≤ energy w := sq_nonneg _ + +/-- Extended-real Rayleigh quotient. `PolyaClosability` proves its denominator +is positive for every nonzero element of the actual Sobolev graph. -/ +def rayleigh (w : SobolevAmbient) : ℝ≥0∞ := + ENNReal.ofReal (energy w) / ENNReal.ofReal (mass w) + +theorem rayleigh_lt_top {w : SobolevAmbient} (h : w.1 ≠ 0) : rayleigh w < (⊤ : ℝ≥0∞) := by + exact ENNReal.div_lt_top ENNReal.ofReal_ne_top + (ne_of_gt (ENNReal.ofReal_pos.mpr (mass_pos h))) + +theorem rayleigh_zero : rayleigh (0 : SobolevAmbient) = 0 := by + simp [rayleigh, energy, mass] + +/-- The supremum of the Rayleigh quotient on a nonzero finite-dimensional +trial space; `0` itself is excluded. -/ +def trialSup {Ω : Set Plane} {k : ℕ} (V : TrialSpace Ω k) : ℝ≥0∞ := + ⨆ w : {w : SobolevAmbient // w ∈ V.space ∧ w ≠ 0}, rayleigh w.val + +/-- Courant–Fischer inf–sup, indexed by actual `k`-dimensional trial spaces. +The dimension is why repeated eigenvalues are counted with multiplicity. -/ +def dirichletMinmax (Ω : Set Plane) (k : ℕ) : ℝ≥0∞ := + ⨅ V : TrialSpace Ω k, trialSup V + +/-- Real form of the standard Dirichlet variational value. `PolyaFiniteness` +proves all min–max values finite on admissible domains and this conversion +lossless; its positive-index values are positive and nondecreasing. -/ +def dirichletEigenvalue (Ω : Set Plane) (k : ℕ) : ℝ := + (dirichletMinmax Ω k).toReal + +theorem dirichletEigenvalue_nonneg (Ω : Set Plane) (k : ℕ) : + 0 ≤ dirichletEigenvalue Ω k := ENNReal.toReal_nonneg + +theorem dirichletMinmax_le_trialSup {Ω : Set Plane} {k : ℕ} + (V : TrialSpace Ω k) : dirichletMinmax Ω k ≤ trialSup V := iInf_le _ V + +/-- Enlarging the geometric domain enlarges the available trial spaces. -/ +def TrialSpace.enlarge {Ω Ω' : Set Plane} {k : ℕ} + (V : TrialSpace Ω k) (h : Ω ⊆ Ω') : TrialSpace Ω' k where + space := V.space + finiteDimensional := V.finiteDimensional + dimension := V.dimension + contained := V.contained.trans (h01Graph_mono h) + +/-- Domain monotonicity of the actual extended-real variational construction. -/ +theorem dirichletMinmax_antitone {Ω Ω' : Set Plane} (h : Ω ⊆ Ω') (k : ℕ) : + dirichletMinmax Ω' k ≤ dirichletMinmax Ω k := by + apply le_iInf + intro V + exact (iInf_le (fun W : TrialSpace Ω' k => trialSup W) (V.enlarge h)) + +/-- Target 25: the third planar Dirichlet Pólya inequality. -/ +def Target25 : Prop := + ∀ Ω : PlanarLipschitzDomain, + 12 * Real.pi ≤ area Ω.carrier * dirichletEigenvalue Ω.carrier 3 + +/-- Target 26: the fourth planar Dirichlet Pólya inequality. -/ +def Target26 : Prop := + ∀ Ω : PlanarLipschitzDomain, + 16 * Real.pi ≤ area Ω.carrier * dirichletEigenvalue Ω.carrier 4 + +/-- Target 27: all positive indices on convex planar domains. -/ +def Target27 : Prop := + ∀ Ω : PlanarLipschitzDomain, Convex ℝ Ω.carrier → + ∀ k : ℕ, 1 ≤ k → + 4 * Real.pi * (k : ℝ) ≤ area Ω.carrier * dirichletEigenvalue Ω.carrier k + +end Math30.Polya diff --git a/Math30/PolyaClosability.lean b/Math30/PolyaClosability.lean new file mode 100644 index 0000000..360d2ec --- /dev/null +++ b/Math30/PolyaClosability.lean @@ -0,0 +1,148 @@ +import Math30.PolyaSobolev +import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts +import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff + +/-! +# Closability of the concrete smooth gradient graph + +Integration by parts persists under closure in the two actual Lebesgue L² +spaces. The fundamental lemma for compactly supported smooth test functions +then proves that a graph element with zero value has zero gradient. +-/ + +noncomputable section + +open Set MeasureTheory +open scoped ENNReal NNReal Topology ContDiff + +namespace Math30.Polya + +private theorem continuous_test_pairing + {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + (f : Plane → E) (hf : MemLp f 2 (volume : Measure Plane)) : + Continuous (fun g : Lp E 2 (volume : Measure Plane) => + ∫ x : Plane, inner ℝ (f x) (g x)) := by + have hfun : (fun g : Lp E 2 (volume : Measure Plane) => + ∫ x : Plane, inner ℝ (f x) (g x)) = + (fun g => inner ℝ (hf.toLp f) g) := by + funext g + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hf.coeFn_toLp] with x hx + rw [hx] + rw [hfun] + exact continuous_const.inner continuous_id + +private theorem continuous_directional_test {ψ : Plane → ℝ} + (hψ : ContDiff ℝ ∞ ψ) (v : Plane) : + Continuous (fun x => fderiv ℝ ψ x v) := + (hψ.continuous_fderiv (by simp)).clm_apply continuous_const + +private theorem compact_directional_test {ψ : Plane → ℝ} + (hψ : HasCompactSupport ψ) (v : Plane) : + HasCompactSupport (fun x => fderiv ℝ ψ x v) := by + apply hψ.mono' + intro x hx + by_contra hnot + exact hx (by simp [fderiv_of_notMem_tsupport ℝ hnot]) + +/-- Every element of the graph closure satisfies the distributional gradient +identity against an arbitrary compactly supported smooth test function. -/ +theorem h01Graph_integration_by_parts {Ω : Set Plane} {w : SobolevAmbient} + (hw : w ∈ h01Graph Ω) {ψ : Plane → ℝ} + (hψ : ContDiff ℝ ∞ ψ) (hcψ : HasCompactSupport ψ) (v : Plane) : + (∫ x : Plane, ψ x * inner ℝ v (w.2 x)) = + -(∫ x : Plane, fderiv ℝ ψ x v * w.1 x) := by + have hvec : MemLp (fun x : Plane => ψ x • v) 2 (volume : Measure Plane) := + (hψ.continuous.smul continuous_const).memLp_of_hasCompactSupport hcψ.smul_right + have hdir : MemLp (fun x : Plane => fderiv ℝ ψ x v) 2 (volume : Measure Plane) := + (continuous_directional_test hψ v).memLp_of_hasCompactSupport + (compact_directional_test hcψ v) + have hleft : Continuous (fun z : SobolevAmbient => + ∫ x : Plane, ψ x * inner ℝ v (z.2 x)) := by + simpa only [Function.comp_def, inner_smul_left, conj_trivial] using + (continuous_test_pairing _ hvec).comp continuous_snd + have hright : Continuous (fun z : SobolevAmbient => + -(∫ x : Plane, fderiv ℝ ψ x v * z.1 x)) := by + convert ((continuous_test_pairing _ hdir).comp + (continuous_fst : Continuous (fun z : SobolevAmbient => z.1))).neg using 1 + ext z + simp [mul_comm] + have hclosed := isClosed_eq hleft hright + apply (closure_minimal (s := smoothGraph Ω) ?_ hclosed) hw + rintro z ⟨φ, hφ, hz₁, hz₂⟩ + change (∫ x : Plane, ψ x * inner ℝ v (z.2 x)) = + -(∫ x : Plane, fderiv ℝ ψ x v * z.1 x) + have hL : (∫ x : Plane, ψ x * inner ℝ v (z.2 x)) = + ∫ x : Plane, ψ x * fderiv ℝ φ x v := by + apply integral_congr_ae + filter_upwards [hz₂] with x hx + rw [hx, inner_gradient_right] + rfl + have hR : (∫ x : Plane, fderiv ℝ ψ x v * z.1 x) = + ∫ x : Plane, fderiv ℝ ψ x v * φ x := by + apply integral_congr_ae + filter_upwards [hz₁] with x hx + rw [hx] + rw [hL, hR] + apply integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + · exact ((continuous_directional_test hψ v).mul hφ.1.continuous).integrable_of_hasCompactSupport hφ.2.1.mul_left + · exact (hψ.continuous.mul (continuous_directional_test hφ.1 v)).integrable_of_hasCompactSupport hcψ.mul_right + · exact (hψ.continuous.mul hφ.1.continuous).integrable_of_hasCompactSupport hcψ.mul_right + · intro x _ + exact hψ.differentiable (by simp) x + · intro x _ + exact hφ.1.differentiable (by simp) x + +/-- Closability of the Euclidean gradient in actual Lebesgue L²: a graph +closure element whose value component vanishes also has zero gradient. -/ +theorem h01Graph_zero_fst {Ω : Set Plane} {w : SobolevAmbient} + (hw : w ∈ h01Graph Ω) (hzero : w.1 = 0) : w.2 = 0 := by + have hlocal : LocallyIntegrable (fun x : Plane => w.2 x) volume := + (Lp.memLp w.2).locallyIntegrable (by norm_num) + have hae : ∀ᵐ x : Plane ∂volume, w.2 x = 0 := by + apply ae_eq_zero_of_integral_contDiff_smul_eq_zero hlocal + intro ψ hψ hcψ + apply integral_eq_zero_of_forall_integral_inner_eq_zero ℝ _ + (hlocal.integrable_smul_left_of_hasCompactSupport hψ.continuous hcψ) + intro v + have h := h01Graph_integration_by_parts hw hψ hcψ v + have hright : (∫ x : Plane, fderiv ℝ ψ x v * w.1 x) = 0 := by + rw [hzero] + calc + (∫ x : Plane, fderiv ℝ ψ x v * (0 : Lp ℝ 2 (volume : Measure Plane)) x) = + ∫ x : Plane, (0 : ℝ) := by + apply integral_congr_ae + filter_upwards [Lp.coeFn_zero ℝ 2 (volume : Measure Plane)] with x hx + simp + _ = 0 := integral_zero _ _ + simpa only [inner_smul_right, hright, neg_zero] using h + apply Lp.ext + filter_upwards [hae, Lp.coeFn_zero Plane 2 (volume : Measure Plane)] with x hx hz + exact hx.trans hz.symm + +/-- The value component determines whether a graph element is zero. -/ +theorem h01Graph_eq_zero_of_fst_eq_zero {Ω : Set Plane} {w : SobolevAmbient} + (hw : w ∈ h01Graph Ω) (hzero : w.1 = 0) : w = 0 := + Prod.ext hzero (h01Graph_zero_fst hw hzero) + +/-- The first projection is injective on the concrete Sobolev graph. -/ +theorem h01Graph_fst_injective (Ω : Set Plane) : + Set.InjOn Prod.fst (h01Graph Ω) := by + intro w hw z hz heq + apply sub_eq_zero.mp + apply h01Graph_eq_zero_of_fst_eq_zero (h01Graph_sub hw hz) + change w.1 - z.1 = 0 + exact sub_eq_zero.mpr heq + +/-- A nonzero Sobolev graph element has strictly positive actual L² mass. -/ +theorem h01Graph_mass_pos {Ω : Set Plane} {w : SobolevAmbient} + (hw : w ∈ h01Graph Ω) (hne : w ≠ 0) : 0 < mass w := + mass_pos (fun hzero => hne (h01Graph_eq_zero_of_fst_eq_zero hw hzero)) + +/-- Every nonzero Sobolev graph element has a finite Rayleigh quotient. -/ +theorem h01Graph_rayleigh_lt_top {Ω : Set Plane} {w : SobolevAmbient} + (hw : w ∈ h01Graph Ω) (hne : w ≠ 0) : rayleigh w < (⊤ : ℝ≥0∞) := + rayleigh_lt_top (fun hzero => hne (h01Graph_eq_zero_of_fst_eq_zero hw hzero)) + +end Math30.Polya diff --git a/Math30/PolyaDomainFixture.lean b/Math30/PolyaDomainFixture.lean new file mode 100644 index 0000000..d01880d --- /dev/null +++ b/Math30/PolyaDomainFixture.lean @@ -0,0 +1,159 @@ +import Math30.Polya +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring +import Mathlib.Tactic.NormNum + +/-! An explicit bounded nonempty planar Lipschitz domain. This fixture establishes +nonvacuity of the geometric target class; it proves no spectral estimate. -/ + +noncomputable section +open Set MeasureTheory +open scoped ENNReal NNReal + +namespace Math30.Polya.DomainFixture + +def gauge (x : Plane) : ℝ := |x 0| + |x 1| +def diamond : Set Plane := {x | gauge x < 1} + +lemma continuous_gauge : Continuous gauge := by + exact ((PiLp.continuous_apply 2 _ 0).abs).add ((PiLp.continuous_apply 2 _ 1).abs) + +lemma diamond_isOpen : IsOpen diamond := + isOpen_lt continuous_gauge continuous_const + +lemma diamond_nonempty : diamond.Nonempty := by + refine ⟨0, ?_⟩ + norm_num [diamond, gauge] + +lemma diamond_bounded : Bornology.IsBounded diamond := by + apply (Metric.isBounded_ball (x := (0 : Plane)) (r := 1)).subset + intro x hx + have hg : |x 0| + |x 1| < 1 := hx + have hnorm : ‖x‖ ^ 2 = (x 0) ^ 2 + (x 1) ^ 2 := by + simpa [Fin.sum_univ_two] using EuclideanSpace.real_norm_sq_eq x + have ha := abs_nonneg (x 0) + have hb := abs_nonneg (x 1) + have hs0 := sq_abs (x 0) + have hs1 := sq_abs (x 1) + have hm := mul_nonneg ha hb + have hn := norm_nonneg x + have hsq : (|x 0| + |x 1|) ^ 2 < 1 := by nlinarith + have hnormlt : ‖x‖ < 1 := by nlinarith + simpa [Metric.mem_ball, dist_zero_right] using hnormlt + +lemma frontier_gauge {p : Plane} (hp : p ∈ frontier diamond) : gauge p = 1 := by + have h := continuous_gauge.frontier_preimage_subset (Iio 1) hp + simpa [frontier_Iio] using h + +private def swapAxes : Plane ≃ₗᵢ[ℝ] Plane := + LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ (Equiv.swap 0 1) + +private lemma swapAxes_zero (x : Plane) : swapAxes x 0 = x 1 := by + rfl +private lemma swapAxes_one (x : Plane) : swapAxes x 1 = x 0 := by + rfl +private lemma gauge_swap (x : Plane) : gauge (swapAxes x) = gauge x := by + simp only [gauge, swapAxes_zero, swapAxes_one] + ring +private lemma gauge_neg (x : Plane) : gauge (-x) = gauge x := by + simp [gauge] + +/-- An orthogonal coordinate system with negative normal coordinate at a +nonzero diamond boundary point; the diamond gauge is unchanged. -/ +private lemma orient_boundary (p : Plane) (hp : gauge p = 1) : + ∃ R : Plane ≃ₗᵢ[ℝ] Plane, + (∀ x, gauge (R x) = gauge x) ∧ (R p) 1 < 0 := by + by_cases h1 : p 1 = 0 + · have h0 : p 0 ≠ 0 := by + intro hz + simp [gauge, h1, hz] at hp + by_cases hn : p 0 < 0 + · exact ⟨swapAxes, gauge_swap, by simpa only [swapAxes_one] using hn⟩ + · refine ⟨swapAxes.trans (LinearIsometryEquiv.neg ℝ), ?_, ?_⟩ + · intro x + simpa only [LinearIsometryEquiv.trans_apply, LinearIsometryEquiv.coe_neg, + gauge_neg] using gauge_swap x + · change -(swapAxes p 1) < 0 + rw [swapAxes_one] + have hpos : 0 < p 0 := lt_of_le_of_ne (le_of_not_gt hn) (Ne.symm h0) + linarith + · by_cases hn : p 1 < 0 + · exact ⟨LinearIsometryEquiv.refl ℝ Plane, fun _ => rfl, hn⟩ + · refine ⟨LinearIsometryEquiv.neg ℝ, ?_, ?_⟩ + · exact gauge_neg + · change -(p 1) < 0 + have hpos : 0 < p 1 := lt_of_le_of_ne (le_of_not_gt hn) (Ne.symm h1) + linarith + +private lemma graph_lipschitz (a : ℝ) : + LipschitzWith 1 (fun s : ℝ => |a + s| - |a|) := by + rw [lipschitzWith_iff_dist_le_mul] + intro x y + simp only [NNReal.coe_one, one_mul, Real.dist_eq] + calc + |(|a + x| - |a|) - (|a + y| - |a|)| = abs (|a + x| - |a + y|) := by + congr 1 + ring + _ ≤ |(a + x) - (a + y)| := abs_abs_sub_abs_le_abs_sub _ _ + _ = |x - y| := by congr 1; ring + +lemma diamond_lipschitzBoundary : HasLipschitzBoundary diamond := by + intro p hp + obtain ⟨R, hR, hn⟩ := orient_boundary p (frontier_gauge hp) + have hopen : IsOpen {x : Plane | (R x) 1 < 0} := + isOpen_lt ((PiLp.continuous_apply 2 _ 1).comp R.continuous) continuous_const + obtain ⟨r, hr, hball⟩ := Metric.isOpen_iff.mp hopen p hn + refine ⟨r, hr, R, (fun s : ℝ => |(R p) 0 + s| - |(R p) 0|), 1, + graph_lipschitz _, by simp, ?_⟩ + intro x hx + have hxn : (R x) 1 < 0 := hball hx + have hpg : |(R p) 0| - (R p) 1 = 1 := by + have h := (hR p).trans (frontier_gauge hp) + simpa [gauge, abs_of_neg hn, sub_eq_add_neg] using h + have hxg : gauge x = |(R x) 0| - (R x) 1 := by + rw [← hR x] + simp [gauge, abs_of_neg hxn, sub_eq_add_neg] + change gauge x < 1 ↔ _ + rw [hxg, map_sub] + change |(R x) 0| - (R x) 1 < 1 ↔ + |(R p) 0 + ((R x) 0 - (R p) 0)| - |(R p) 0| < (R x) 1 - (R p) 1 + have hadd : (R p) 0 + ((R x) 0 - (R p) 0) = (R x) 0 := by ring + rw [hadd] + constructor <;> intro h <;> linarith + + +lemma diamond_convex : Convex ℝ diamond := by + intro x hx y hy a b ha hb hab + have hbound : gauge (a • x + b • y) ≤ a * gauge x + b * gauge y := by + have h0 := abs_add_le (a * x 0) (b * y 0) + have h1 := abs_add_le (a * x 1) (b * y 1) + simp only [abs_mul, abs_of_nonneg ha, abs_of_nonneg hb] at h0 h1 + simp only [gauge, PiLp.add_apply, PiLp.smul_apply, smul_eq_mul] + nlinarith + change gauge (a • x + b • y) < 1 + change gauge x < 1 at hx + change gauge y < 1 at hy + by_cases ha0 : a = 0 + · have hb1 : b = 1 := by linarith + simpa [ha0, hb1] using hy + · have hap : 0 < a := lt_of_le_of_ne ha (Ne.symm ha0) + have hax : a * gauge x < a := by + simpa only [mul_one] using mul_lt_mul_of_pos_left hx hap + have hby : b * gauge y ≤ b := by + simpa only [mul_one] using mul_le_mul_of_nonneg_left (le_of_lt hy) hb + exact hbound.trans_lt (by linarith) + +/-- The concrete unit ℓ¹ diamond inhabits the full geometric domain class. -/ +def diamondDomain : PlanarLipschitzDomain where + carrier := diamond + isOpen := diamond_isOpen + nonempty := diamond_nonempty + bounded := diamond_bounded + lipschitzBoundary := diamond_lipschitzBoundary + finiteArea := diamond_bounded.measure_lt_top.ne + +theorem domain_class_nonempty : Nonempty PlanarLipschitzDomain := ⟨diamondDomain⟩ + +theorem diamond_area_pos : 0 < area diamond := area_pos diamondDomain + +end Math30.Polya.DomainFixture diff --git a/Math30/PolyaFiniteness.lean b/Math30/PolyaFiniteness.lean new file mode 100644 index 0000000..b5979fd --- /dev/null +++ b/Math30/PolyaFiniteness.lean @@ -0,0 +1,142 @@ +import Math30.PolyaClosability +import Math30.PolyaTrialSpaces +import Math30.PolyaMinmax +import Math30.PolyaPoincare +import Mathlib.Analysis.Normed.Module.FiniteDimension + +/-! +# Finiteness of finite-dimensional Dirichlet trial spaces + +Finite-dimensionality and injectivity of the value projection suffice to +bound the Rayleigh quotient. This elementary part does not use Rellich +compactness or any assertion of the Pólya conjecture. +-/ + +noncomputable section + +open Set MeasureTheory +open scoped ENNReal NNReal + +namespace Math30.Polya + +/-- The quotient is uniformly bounded on a finite-dimensional graph subspace +whose value projection is injective. -/ +theorem TrialSpace.trialSup_lt_top_of_value_injective {Ω : Set Plane} {k : ℕ} + (V : TrialSpace Ω k) + (hvalue : ∀ w ∈ V.space, w.1 = 0 → w = 0) : trialSup V < ∞ := by + let := V.finiteDimensional + let f : V.space →ₗ[ℝ] Lp ℝ 2 (volume : Measure Plane) := + (LinearMap.fst ℝ _ _).comp V.space.subtype + have hf : Function.Injective f := by + intro x y hxy + apply Subtype.ext + apply sub_eq_zero.mp + apply hvalue (x - y) (V.space.sub_mem x.property y.property) + change x.val.1 - y.val.1 = 0 + exact sub_eq_zero.mpr hxy + obtain ⟨K, hK, hbound⟩ := f.injective_iff_antilipschitz.mp hf + have hquot : ∀ w ∈ V.space, w ≠ 0 → rayleigh w ≤ ENNReal.ofReal ((K : ℝ) ^ 2) := by + intro w hw hnz + have hfst : w.1 ≠ 0 := fun hz => hnz (hvalue w hw hz) + have hnorm : ‖w.2‖ ≤ (K : ℝ) * ‖w.1‖ := by + exact (norm_snd_le w).trans (ZeroHomClass.bound_of_antilipschitz f hbound ⟨w, hw⟩) + have henergy : energy w ≤ (K : ℝ) ^ 2 * mass w := by + dsimp [energy, mass] + calc + ‖w.2‖ ^ 2 ≤ ((K : ℝ) * ‖w.1‖) ^ 2 := + pow_le_pow_left₀ (norm_nonneg _) hnorm 2 + _ = (K : ℝ) ^ 2 * ‖w.1‖ ^ 2 := mul_pow _ _ _ + rw [rayleigh, ← ENNReal.ofReal_div_of_pos (mass_pos hfst)] + exact ENNReal.ofReal_le_ofReal ((div_le_iff₀ (mass_pos hfst)).mpr henergy) + apply lt_of_le_of_lt (b := ENNReal.ofReal ((K : ℝ) ^ 2)) ?_ ENNReal.ofReal_lt_top + unfold trialSup + exact iSup_le fun w => hquot w.val w.property.1 w.property.2 + +/-- One suitable trial space proves the concrete min–max value finite. -/ +theorem dirichletMinmax_lt_top_of_trialSpace {Ω : Set Plane} {k : ℕ} + (V : TrialSpace Ω k) + (hvalue : ∀ w ∈ V.space, w.1 = 0 → w = 0) : + dirichletMinmax Ω k < ∞ := + (dirichletMinmax_le_trialSup V).trans_lt + (V.trialSup_lt_top_of_value_injective hvalue) + +/-- Every finite-dimensional trial space in the actual Sobolev graph has a +finite Rayleigh supremum. The needed projection injectivity follows from the +proved distributional closability theorem. -/ +theorem TrialSpace.trialSup_lt_top {Ω : Set Plane} {k : ℕ} + (V : TrialSpace Ω k) : trialSup V < ∞ := by + apply V.trialSup_lt_top_of_value_injective + intro w hw hz + exact h01Graph_eq_zero_of_fst_eq_zero (V.contained hw) hz + +/-- Existence of any k-dimensional trial space suffices for finite min–max. -/ +theorem dirichletMinmax_lt_top_of_nonempty {Ω : Set Plane} {k : ℕ} + (h : Nonempty (TrialSpace Ω k)) : dirichletMinmax Ω k < ∞ := by + obtain ⟨V⟩ := h + exact (dirichletMinmax_le_trialSup V).trans_lt V.trialSup_lt_top + +/-- The concrete Dirichlet min–max is finite at every natural index on every +admissible domain. This follows from actual smooth trial spaces, not from any +spectral oracle or conjectural estimate. -/ +theorem dirichletMinmax_lt_top (Ω : PlanarLipschitzDomain) (k : ℕ) : + dirichletMinmax Ω.carrier k < ∞ := by + obtain ⟨V, _⟩ := exists_trialSpace_injective Ω k + exact dirichletMinmax_lt_top_of_nonempty ⟨V⟩ + +theorem dirichletMinmax_ne_top (Ω : PlanarLipschitzDomain) (k : ℕ) : + dirichletMinmax Ω.carrier k ≠ ∞ := (dirichletMinmax_lt_top Ω k).ne + +/-- Conversion to the real variational value loses no information: the +extended-real min–max is never infinity on the target domain class. -/ +theorem ofReal_dirichletEigenvalue (Ω : PlanarLipschitzDomain) (k : ℕ) : + ENNReal.ofReal (dirichletEigenvalue Ω.carrier k) = dirichletMinmax Ω.carrier k := + ENNReal.ofReal_toReal (dirichletMinmax_ne_top Ω k) + +/-- Real-valued domain monotonicity, now justified by proved finiteness. -/ +theorem dirichletEigenvalue_antitone (Ω Ω' : PlanarLipschitzDomain) + (h : Ω.carrier ⊆ Ω'.carrier) (k : ℕ) : + dirichletEigenvalue Ω'.carrier k ≤ dirichletEigenvalue Ω.carrier k := + (ENNReal.toReal_le_toReal (dirichletMinmax_ne_top Ω' k) + (dirichletMinmax_ne_top Ω k)).mpr (dirichletMinmax_antitone h k) + +/-- An exact variational lower-bound criterion, using the now lossless real +conversion. This is an equivalence of concrete formulas, not a spectral +identification theorem. -/ +theorem dirichletEigenvalue_lower_bound_iff (Ω : PlanarLipschitzDomain) + (k : ℕ) (c : ℝ) : + c ≤ dirichletEigenvalue Ω.carrier k ↔ + ∀ V : TrialSpace Ω.carrier k, ENNReal.ofReal c ≤ trialSup V := by + rw [dirichletEigenvalue, ← ENNReal.ofReal_le_iff_le_toReal + (dirichletMinmax_ne_top Ω k)] + exact le_iInf_iff + +/-- Exact area-scaled variational reformulation of each Pólya target. -/ +theorem area_mul_dirichletEigenvalue_lower_bound_iff (Ω : PlanarLipschitzDomain) + (k : ℕ) (c : ℝ) : + c ≤ area Ω.carrier * dirichletEigenvalue Ω.carrier k ↔ + ∀ V : TrialSpace Ω.carrier k, + ENNReal.ofReal (c / area Ω.carrier) ≤ trialSup V := by + rw [← dirichletEigenvalue_lower_bound_iff Ω k] + rw [div_le_iff₀ (area_pos Ω), mul_comm] + +/-- The finite real variational sequence is ordered nondecreasingly in its +index, with k-dimensional subspaces encoding multiplicity. -/ +theorem dirichletEigenvalue_monotone (Ω : PlanarLipschitzDomain) : + Monotone (dirichletEigenvalue Ω.carrier) := by + intro i j hij + exact ENNReal.toReal_mono (dirichletMinmax_ne_top Ω j) + (dirichletMinmax_monotone Ω.carrier hij) + +/-- Every positive-index real variational value is strictly positive. -/ +theorem dirichletEigenvalue_pos (Ω : PlanarLipschitzDomain) {k : ℕ} (hk : 0 < k) : + 0 < dirichletEigenvalue Ω.carrier k := + ENNReal.toReal_pos (dirichletMinmax_pos Ω hk).ne' (dirichletMinmax_ne_top Ω k) + +/-- A proved ordinary coercive lower bound on each real variational value. -/ +theorem dirichletEigenvalue_poincare_lower (Ω : PlanarLipschitzDomain) + {k : ℕ} (hk : 0 < k) : + 1 / poincareConstant Ω.carrier ^ 2 ≤ dirichletEigenvalue Ω.carrier k := + (ENNReal.ofReal_le_iff_le_toReal (dirichletMinmax_ne_top Ω k)).mp + (dirichletMinmax_lower Ω hk) + +end Math30.Polya diff --git a/Math30/PolyaFixtures.lean b/Math30/PolyaFixtures.lean new file mode 100644 index 0000000..30bd569 --- /dev/null +++ b/Math30/PolyaFixtures.lean @@ -0,0 +1,114 @@ +import Math30.Polya +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Ring +import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension +import Mathlib.MeasureTheory.Function.LpSpace.Indicator + +/-! +Sanity checks for the concrete definitions. None proves or assumes a Pólya +target. The final two checks merely specialize an explicitly supplied +hypothetical proof of target 27 to its third and fourth indices. +-/ + +noncomputable section + +open Set MeasureTheory +open scoped ENNReal + +namespace Math30.Polya.Fixtures + +example (Ω : PlanarLipschitzDomain) : 0 < area Ω.carrier := area_pos Ω + +example (Ω : Set Plane) : (0 : SobolevAmbient) ∈ h01Graph Ω := zero_mem_h01Graph Ω + +example : rayleigh (0 : SobolevAmbient) = 0 := rayleigh_zero + +example (w : SobolevAmbient) (h : w.1 ≠ 0) : rayleigh w < ∞ := rayleigh_lt_top h + +example (w : SobolevAmbient) : mass w = ∫ x : Plane, (w.1 x) ^ 2 := mass_eq_integral w + +example (w : SobolevAmbient) : energy w = ∫ x : Plane, ‖w.2 x‖ ^ 2 := energy_eq_integral w + +/-- Genuine domain monotonicity of the constructed variational quantity. -/ +example (Ω Ω' : Set Plane) (h : Ω ⊆ Ω') (k : ℕ) : + dirichletMinmax Ω' k ≤ dirichletMinmax Ω k := dirichletMinmax_antitone h k + +/-- The local graph boundary condition alone admits the empty set, while the +actual target domain structure separately and explicitly excludes it. -/ +example : HasLipschitzBoundary (∅ : Set Plane) := by + simp [HasLipschitzBoundary] + +example : ¬(∅ : Set Plane).Nonempty := Set.not_nonempty_empty + +/-- A nonvacuous test of the one-sided local graph condition. This unbounded +half-plane is only a boundary-definition fixture, not a target-domain witness. -/ +theorem upperHalfPlane_lipschitz : + HasLipschitzBoundary {x : Plane | 0 < x 1} := by + intro p hp + have hc : Continuous (fun x : Plane => x 1) := + PiLp.continuous_apply 2 (fun _ : Fin 2 => ℝ) 1 + have hboundary := hc.frontier_preimage_subset (Set.Ioi (0 : ℝ)) hp + have hp1 : p 1 = 0 := by simpa using hboundary + refine ⟨1, zero_lt_one, LinearIsometryEquiv.refl ℝ Plane, (fun _ => 0), 0, + LipschitzWith.const _, rfl, ?_⟩ + intro x hx + simp [hp1] + +/-- Every target domain has an actual nonzero compactly supported smooth +function. This does not assume the existence of an eigenfunction. -/ +theorem exists_nonzero_testFunction (Ω : PlanarLipschitzDomain) : + ∃ φ : Plane → ℝ, IsTestFunction Ω.carrier φ ∧ φ ≠ 0 := by + obtain ⟨p, hp⟩ := Ω.nonempty + obtain ⟨φ, hsupp, hcompact, hsmooth, _, hone⟩ := + exists_contDiff_tsupport_subset (n := ⊤) (Ω.isOpen.mem_nhds hp) + refine ⟨φ, ⟨hsmooth, hcompact, hsupp⟩, ?_⟩ + intro hzero + have hz : φ p = 0 := congrFun hzero p + rw [hone] at hz + exact one_ne_zero hz + +/-- Nontriviality of the actual smooth graph, including its nonzero L² value +component. This checks the measure/gradient/Sobolev construction together. -/ +theorem exists_nonzero_smoothGraph (Ω : PlanarLipschitzDomain) : + ∃ w ∈ smoothGraph Ω.carrier, w.1 ≠ 0 := by + obtain ⟨φ, hφ, hnonzero⟩ := exists_nonzero_testFunction Ω + have hvalue : MemLp φ 2 (volume : Measure Plane) := + hφ.1.continuous.memLp_of_hasCompactSupport hφ.2.1 + have hgradContinuous : Continuous (gradient φ) := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp + (hφ.1.continuous_fderiv (by simp)) + have hgradCompact : HasCompactSupport (gradient φ) := by + apply hφ.2.1.mono' + intro x hx + by_contra hnot + exact hx (by simp [gradient, fderiv_of_notMem_tsupport ℝ hnot]) + have hgrad : MemLp (gradient φ) 2 (volume : Measure Plane) := + hgradContinuous.memLp_of_hasCompactSupport hgradCompact + let u := hvalue.toLp φ + let g := hgrad.toLp (gradient φ) + refine ⟨(u, g), ⟨φ, hφ, hvalue.coeFn_toLp, hgrad.coeFn_toLp⟩, ?_⟩ + intro hzero + change u = 0 at hzero + have huae : (fun x => u x) =ᵐ[(volume : Measure Plane)] (0 : Plane → ℝ) := by + rw [hzero] + exact Lp.coeFn_zero ℝ 2 volume + exact hnonzero (MeasureTheory.Measure.eq_of_ae_eq + (hvalue.coeFn_toLp.symm.trans huae) hφ.1.continuous continuous_const) + +theorem target27_third (h : Target27) (Ω : PlanarLipschitzDomain) + (hconvex : Convex ℝ Ω.carrier) : + 12 * Real.pi ≤ area Ω.carrier * dirichletEigenvalue Ω.carrier 3 := by + have h3 := h Ω hconvex 3 (by norm_num) + norm_num at h3 + convert h3 using 1 + ring + +theorem target27_fourth (h : Target27) (Ω : PlanarLipschitzDomain) + (hconvex : Convex ℝ Ω.carrier) : + 16 * Real.pi ≤ area Ω.carrier * dirichletEigenvalue Ω.carrier 4 := by + have h4 := h Ω hconvex 4 (by norm_num) + norm_num at h4 + convert h4 using 1 + ring + +end Math30.Polya.Fixtures diff --git a/Math30/PolyaMinmax.lean b/Math30/PolyaMinmax.lean new file mode 100644 index 0000000..92e4bd2 --- /dev/null +++ b/Math30/PolyaMinmax.lean @@ -0,0 +1,85 @@ +import Math30.Polya +import Mathlib.LinearAlgebra.Dimension.Free + +/-! +# Index monotonicity of the concrete Dirichlet min–max values + +A finite-dimensional trial space contains trial spaces of every smaller +dimension. Restriction decreases the Rayleigh supremum, hence the actual +extended-real Courant–Fischer construction is monotone in its index. +-/ + +noncomputable section + +open Set MeasureTheory +open scoped ENNReal NNReal + +namespace Math30.Polya + +/-- Every trial space contains trial spaces of every smaller dimension. -/ +theorem TrialSpace.exists_subtrial {Ω : Set Plane} {k m : ℕ} + (V : TrialSpace Ω m) (hkm : k ≤ m) : + ∃ W : TrialSpace Ω k, W.space ≤ V.space := by + let := V.finiteDimensional + have hdim : Module.finrank ℝ (Fin k → ℝ) ≤ Module.finrank ℝ V.space := by + simpa [V.dimension] using hkm + obtain ⟨f, hf⟩ := finrank_le_iff_exists_linearMap.mp hdim + let g : (Fin k → ℝ) →ₗ[ℝ] SobolevAmbient := V.space.subtype.comp f + have hg : Function.Injective g := V.space.subtype_injective.comp hf + have hle : LinearMap.range g ≤ V.space := by + rintro w ⟨x, rfl⟩ + exact (f x).property + refine ⟨{ + space := LinearMap.range g + finiteDimensional := inferInstance + dimension := ?_ + contained := fun w hw => V.contained (hle hw) + }, hle⟩ + rw [LinearMap.finrank_range_of_inj hg] + simp + +/-- Restricting a trial space cannot increase its Rayleigh supremum. -/ +theorem trialSup_mono {Ω : Set Plane} {k m : ℕ} + {V : TrialSpace Ω k} {W : TrialSpace Ω m} (hVW : V.space ≤ W.space) : + trialSup V ≤ trialSup W := by + unfold trialSup + apply iSup_le + intro w + exact le_iSup_of_le ⟨w.val, hVW w.property.1, w.property.2⟩ le_rfl + +/-- The actual extended-real min–max sequence is nondecreasing in its index. -/ +theorem dirichletMinmax_monotone (Ω : Set Plane) : Monotone (dirichletMinmax Ω) := by + intro k m hkm + apply le_iInf + intro V + obtain ⟨W, hWV⟩ := V.exists_subtrial hkm + exact (dirichletMinmax_le_trialSup W).trans (trialSup_mono hWV) + +/-- The zero-dimensional trial space, available on every set. -/ +def TrialSpace.zero (Ω : Set Plane) : TrialSpace Ω 0 where + space := ⊥ + finiteDimensional := inferInstance + dimension := by simp + contained := by + intro w hw + have hwzero : w = 0 := by simpa using hw + exact hwzero ▸ zero_mem_h01Graph Ω + +@[simp] theorem trialSup_zero (Ω : Set Plane) : trialSup (TrialSpace.zero Ω) = 0 := by + apply le_antisymm _ zero_le + unfold trialSup + apply iSup_le + rintro ⟨w, hw, hne⟩ + exact (hne (by simpa [TrialSpace.zero] using hw)).elim + +/-- The auxiliary index zero has value zero; positive spectral indices start +at one. -/ +@[simp] theorem dirichletMinmax_zero (Ω : Set Plane) : dirichletMinmax Ω 0 = 0 := by + apply le_antisymm _ zero_le + exact (dirichletMinmax_le_trialSup (TrialSpace.zero Ω)).trans_eq (trialSup_zero Ω) + +@[simp] theorem dirichletEigenvalue_zero (Ω : Set Plane) : + dirichletEigenvalue Ω 0 = 0 := by + simp [dirichletEigenvalue] + +end Math30.Polya diff --git a/Math30/PolyaPoincare.lean b/Math30/PolyaPoincare.lean new file mode 100644 index 0000000..a2286dd --- /dev/null +++ b/Math30/PolyaPoincare.lean @@ -0,0 +1,144 @@ +import Math30.PolyaSobolev +import Math30.PolyaClosability +import Mathlib.Analysis.FunctionalSpaces.SobolevInequality +import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Linarith + +/-! +A Poincaré bound for the concrete zero-boundary Sobolev graph. It is obtained +from the existing dimension-two Gagliardo–Nirenberg–Sobolev inequality followed +by Hölder on the finite-area support. The constant is unrelated to the +conjectural Pólya constants and no eigenvalue bound is assumed. +-/ + +noncomputable section +open Set MeasureTheory +open scoped ENNReal NNReal Topology + +namespace Math30.Polya + +def poincareFactor (Ω : Set Plane) : ℝ≥0∞ := + (eLpNormLESNormFDerivOneConst (volume : Measure Plane) 2 : ℝ≥0∞) * + (volume Ω) ^ (1 / 2 : ℝ) + +def poincareConstant (Ω : Set Plane) : ℝ := 1 + (poincareFactor Ω).toReal + +theorem poincareConstant_pos (Ω : Set Plane) : 0 < poincareConstant Ω := by + have := ENNReal.toReal_nonneg (a := poincareFactor Ω) + unfold poincareConstant + linarith + +theorem poincareFactor_ne_top (Ω : PlanarLipschitzDomain) : + poincareFactor Ω.carrier ≠ ⊤ := by + apply ENNReal.mul_ne_top ENNReal.coe_ne_top + exact ENNReal.rpow_ne_top_of_nonneg (by norm_num) Ω.finiteArea + +theorem smooth_poincare_eLpNorm (Ω : PlanarLipschitzDomain) + {φ : Plane → ℝ} (hφ : IsTestFunction Ω.carrier φ) : + eLpNorm φ 2 volume ≤ poincareFactor Ω.carrier * eLpNorm (gradient φ) 2 volume := by + have hdim : Module.finrank ℝ Plane = 2 := by simp [Plane] + have hholder : NNReal.HolderConjugate (Module.finrank ℝ Plane) 2 := by + simpa [hdim] using NNReal.HolderConjugate.two_two + have hgns := eLpNorm_le_eLpNorm_fderiv_one (volume : Measure Plane) + (hφ.1.of_le (by simp)) hφ.2.1 hholder + have hsupp : Function.support (fderiv ℝ φ) ⊆ Ω.carrier := + (support_fderiv_subset ℝ).trans hφ.2.2 + have hfdCont : Continuous (fderiv ℝ φ) := hφ.1.continuous_fderiv (by simp) + have hholderNorm : eLpNorm (fderiv ℝ φ) 1 volume ≤ + eLpNorm (fderiv ℝ φ) 2 volume * (volume Ω.carrier) ^ (1 / 2 : ℝ) := by + have h := eLpNorm_le_eLpNorm_mul_rpow_measure_univ + (f := fderiv ℝ φ) (μ := volume.restrict Ω.carrier) (p := 1) (q := 2) + (by norm_num) hfdCont.aestronglyMeasurable + rw [eLpNorm_restrict_eq_of_support_subset (f := fderiv ℝ φ) + (μ := (volume : Measure Plane)) (p := 1) hfdCont.aestronglyMeasurable hsupp, + eLpNorm_restrict_eq_of_support_subset (f := fderiv ℝ φ) + (μ := (volume : Measure Plane)) (p := 2) hfdCont.aestronglyMeasurable hsupp] at h + convert h using 1 + norm_num + have hgradNorm : eLpNorm (fderiv ℝ φ) 2 volume = eLpNorm (gradient φ) 2 volume := by + have hgradCont : Continuous (gradient φ) := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp hfdCont + apply eLpNorm_congr_norm_ae hfdCont.aestronglyMeasurable hgradCont.aestronglyMeasurable + exact Filter.Eventually.of_forall fun x => by simp [gradient] + calc + eLpNorm φ 2 volume ≤ + (eLpNormLESNormFDerivOneConst (volume : Measure Plane) 2 : ℝ≥0∞) * + eLpNorm (fderiv ℝ φ) 1 volume := hgns + _ ≤ (eLpNormLESNormFDerivOneConst (volume : Measure Plane) 2 : ℝ≥0∞) * + (eLpNorm (fderiv ℝ φ) 2 volume * (volume Ω.carrier) ^ (1 / 2 : ℝ)) := + by gcongr + _ = poincareFactor Ω.carrier * eLpNorm (gradient φ) 2 volume := by + rw [hgradNorm, poincareFactor] + ac_rfl + +theorem smoothGraph_poincare (Ω : PlanarLipschitzDomain) {w : SobolevAmbient} + (hw : w ∈ smoothGraph Ω.carrier) : + ‖w.1‖ ≤ poincareConstant Ω.carrier * ‖w.2‖ := by + obtain ⟨φ, hφ, hv, hg⟩ := hw + have hvnorm := eLpNorm_congr_ae (p := 2) hv + have hgnorm := eLpNorm_congr_ae (p := 2) hg + have hbound := smooth_poincare_eLpNorm Ω hφ + rw [← hvnorm, ← hgnorm] at hbound + have hfinite : poincareFactor Ω.carrier * eLpNorm w.2 2 volume ≠ ⊤ := + ENNReal.mul_ne_top (poincareFactor_ne_top Ω) (Lp.eLpNorm_ne_top w.2) + have hreal := ENNReal.toReal_mono hfinite hbound + rw [ENNReal.toReal_mul, ← Lp.norm_def, ← Lp.norm_def] at hreal + exact hreal.trans (mul_le_mul_of_nonneg_right + (by simp [poincareConstant]) (norm_nonneg _)) + +/-- Coercivity on the entire graph closure, not merely on smooth functions. -/ +theorem h01Graph_poincare (Ω : PlanarLipschitzDomain) {w : SobolevAmbient} + (hw : w ∈ h01Graph Ω.carrier) : + ‖w.1‖ ≤ poincareConstant Ω.carrier * ‖w.2‖ := by + have hclosed : IsClosed {z : SobolevAmbient | + ‖z.1‖ ≤ poincareConstant Ω.carrier * ‖z.2‖} := + isClosed_le continuous_fst.norm (continuous_const.mul continuous_snd.norm) + exact closure_minimal (fun z hz => smoothGraph_poincare Ω hz) hclosed hw + +theorem h01Graph_zero_gradient (Ω : PlanarLipschitzDomain) {w : SobolevAmbient} + (hw : w ∈ h01Graph Ω.carrier) (hg : w.2 = 0) : w = 0 := by + have hp := h01Graph_poincare Ω hw + have hu : w.1 = 0 := norm_eq_zero.mp (le_antisymm (by simpa [hg] using hp) (norm_nonneg _)) + exact Prod.ext hu hg + +/-- A uniform strictly positive lower bound for every nonzero Rayleigh +quotient in the graph. This is ordinary Poincaré coercivity, not Pólya's bound. -/ +theorem h01Graph_rayleigh_lower (Ω : PlanarLipschitzDomain) {w : SobolevAmbient} + (hw : w ∈ h01Graph Ω.carrier) (hne : w ≠ 0) : + ENNReal.ofReal (1 / poincareConstant Ω.carrier ^ 2) ≤ rayleigh w := by + have hC := poincareConstant_pos Ω.carrier + have hm := h01Graph_mass_pos hw hne + have hp := h01Graph_poincare Ω hw + have hs : mass w ≤ poincareConstant Ω.carrier ^ 2 * energy w := by + have hsq := (sq_le_sq₀ (norm_nonneg w.1) + (mul_nonneg hC.le (norm_nonneg w.2))).mpr hp + simpa only [mass, energy, mul_pow] using hsq + rw [rayleigh, ← ENNReal.ofReal_div_of_pos hm] + apply ENNReal.ofReal_le_ofReal + apply (div_le_div_iff₀ (sq_pos_of_pos hC) hm).mpr + simpa only [one_mul, mul_comm] using hs + +/-- Positive-index min–max values have a uniform positive lower bound. -/ +theorem dirichletMinmax_lower (Ω : PlanarLipschitzDomain) {k : ℕ} (hk : 0 < k) : + ENNReal.ofReal (1 / poincareConstant Ω.carrier ^ 2) ≤ + dirichletMinmax Ω.carrier k := by + apply le_iInf + intro V + let := V.finiteDimensional + have hd : 0 < Module.finrank ℝ V.space := by rw [V.dimension]; exact hk + obtain ⟨w, hw⟩ := Module.finrank_pos_iff_exists_ne_zero.mp hd + have hcoe : (w : SobolevAmbient) ≠ 0 := by + intro h + apply hw + exact Subtype.ext h + exact (h01Graph_rayleigh_lower Ω (V.contained w.property) hcoe).trans + (le_iSup (fun z : {z : SobolevAmbient // z ∈ V.space ∧ z ≠ 0} => rayleigh z.val) + ⟨w, w.property, hcoe⟩) + +theorem dirichletMinmax_pos (Ω : PlanarLipschitzDomain) {k : ℕ} (hk : 0 < k) : + 0 < dirichletMinmax Ω.carrier k := by + apply lt_of_lt_of_le _ (dirichletMinmax_lower Ω hk) + exact ENNReal.ofReal_pos.mpr (one_div_pos.mpr (sq_pos_of_pos (poincareConstant_pos Ω.carrier))) + +end Math30.Polya diff --git a/Math30/PolyaReadiness.lean b/Math30/PolyaReadiness.lean new file mode 100644 index 0000000..406d7ed --- /dev/null +++ b/Math30/PolyaReadiness.lean @@ -0,0 +1,104 @@ +import Math30.PolyaFiniteness +import Math30.PolyaDomainFixture +import Mathlib.Analysis.Real.Sqrt + +/-! +# Verified standard variational formulation of targets 25–27 + +This module collects the exact normalization and well-formedness theorems for +the unchanged target propositions. Dirichlet spectral values are defined by +the standard k-dimensional Courant–Fischer formula on H₀¹. There is no +independently constructed unbounded Laplace operator in this package, and no +operator-identification theorem or Rellich theorem is claimed. + +The whole-space zero-extension H₀¹ closure and inf–sup convention match +De Philippis–Lamboley–Pierre–Velichkov, *Regularity of minimizers of shape +optimization problems involving perimeter*, §§2.1 and 2.4. +-/ + +noncomputable section +open Set MeasureTheory Filter +open scoped ENNReal Topology + +namespace Math30.Polya + +/-- The usual square-sum Sobolev graph norm, expressed in the actual L² factors. -/ +def sobolevGraphNorm (w : SobolevAmbient) : ℝ := Real.sqrt (mass w + energy w) + +theorem norm_le_sobolevGraphNorm (w : SobolevAmbient) : ‖w‖ ≤ sobolevGraphNorm w := by + rw [Prod.norm_def, max_le_iff] + constructor + · calc + ‖w.1‖ = Real.sqrt (mass w) := by simp [mass] + _ ≤ sobolevGraphNorm w := Real.sqrt_le_sqrt (le_add_of_nonneg_right (energy_nonneg w)) + · calc + ‖w.2‖ = Real.sqrt (energy w) := by simp [energy] + _ ≤ sobolevGraphNorm w := Real.sqrt_le_sqrt (le_add_of_nonneg_left (sq_nonneg ‖w.1‖)) + +theorem sobolevGraphNorm_le_two_norm (w : SobolevAmbient) : + sobolevGraphNorm w ≤ 2 * ‖w‖ := by + apply Real.sqrt_le_iff.mpr + refine ⟨mul_nonneg (by norm_num) (norm_nonneg w), ?_⟩ + have hf := norm_fst_le w + have hg := norm_snd_le w + have hfn := norm_nonneg w.1 + have hgn := norm_nonneg w.2 + have hn := norm_nonneg w + dsimp [mass, energy] + nlinarith + +/-- The product topology used for the graph closure is exactly the topology +of the standard square-sum Sobolev norm, as witnessed on every filter. -/ +theorem tendsto_zero_iff_sobolevGraphNorm {ι : Type*} {l : Filter ι} + {u : ι → SobolevAmbient} : + Tendsto u l (𝓝 0) ↔ Tendsto (fun i => sobolevGraphNorm (u i)) l (𝓝 0) := by + constructor + · intro h + have hc : Continuous sobolevGraphNorm := + Real.continuous_sqrt.comp + ((continuous_fst.norm.pow 2).add (continuous_snd.norm.pow 2)) + simpa [Function.comp_def, sobolevGraphNorm, mass, energy] using hc.continuousAt.tendsto.comp h + · intro h + apply tendsto_zero_iff_norm_tendsto_zero.mpr + exact squeeze_zero (fun _ => norm_nonneg _) (fun i => norm_le_sobolevGraphNorm (u i)) h + +/-- The canonical variational sequence has finite, positive, ordered values +at every requested index. This establishes no Pólya inequality. -/ +theorem dirichlet_variational_sequence_wellFormed (Ω : PlanarLipschitzDomain) : + (∀ k : ℕ, dirichletMinmax Ω.carrier k < ⊤) ∧ + (∀ k : ℕ, 0 < k → 0 < dirichletEigenvalue Ω.carrier k) ∧ + Monotone (dirichletEigenvalue Ω.carrier) := + ⟨dirichletMinmax_lt_top Ω, fun _ hk => dirichletEigenvalue_pos Ω hk, + dirichletEigenvalue_monotone Ω⟩ + +/-- Exact whole-space Courant–Fischer form of target 25. -/ +theorem target25_iff_variational : Target25 ↔ + ∀ Ω : PlanarLipschitzDomain, ∀ V : TrialSpace Ω.carrier 3, + ENNReal.ofReal (12 * Real.pi / area Ω.carrier) ≤ trialSup V := by + unfold Target25 + exact forall_congr' fun Ω => area_mul_dirichletEigenvalue_lower_bound_iff Ω 3 _ + +/-- Exact whole-space Courant–Fischer form of target 26. -/ +theorem target26_iff_variational : Target26 ↔ + ∀ Ω : PlanarLipschitzDomain, ∀ V : TrialSpace Ω.carrier 4, + ENNReal.ofReal (16 * Real.pi / area Ω.carrier) ≤ trialSup V := by + unfold Target26 + exact forall_congr' fun Ω => area_mul_dirichletEigenvalue_lower_bound_iff Ω 4 _ + +/-- Exact whole-space Courant–Fischer form of target 27. -/ +theorem target27_iff_variational : Target27 ↔ + ∀ Ω : PlanarLipschitzDomain, Convex ℝ Ω.carrier → ∀ k : ℕ, 1 ≤ k → + ∀ V : TrialSpace Ω.carrier k, + ENNReal.ofReal (4 * Real.pi * (k : ℝ) / area Ω.carrier) ≤ trialSup V := by + unfold Target27 + apply forall_congr' + intro Ω + apply forall_congr' + intro _ + apply forall_congr' + intro k + apply forall_congr' + intro _ + exact area_mul_dirichletEigenvalue_lower_bound_iff Ω k _ + +end Math30.Polya diff --git a/Math30/PolyaSobolev.lean b/Math30/PolyaSobolev.lean new file mode 100644 index 0000000..bddb8fe --- /dev/null +++ b/Math30/PolyaSobolev.lean @@ -0,0 +1,95 @@ +import Math30.Polya +import Mathlib.Analysis.Calculus.FDeriv.Add +import Mathlib.Topology.Algebra.Module.Basic + +/-! +Linear and topological infrastructure for the concrete zero-boundary Sobolev +graph used in the Pólya statements. These are proofs about the existing graph; +the definitions of the targets and of their spectral quantity are unchanged. +-/ + +noncomputable section +open Set MeasureTheory +open scoped Topology ContDiff + +namespace Math30.Polya + +theorem isTestFunction_add {Ω : Set Plane} {φ ψ : Plane → ℝ} + (hφ : IsTestFunction Ω φ) (hψ : IsTestFunction Ω ψ) : + IsTestFunction Ω (φ + ψ) := by + refine ⟨hφ.1.add hψ.1, hφ.2.1.add hψ.2.1, ?_⟩ + exact (tsupport_add φ ψ).trans (union_subset hφ.2.2 hψ.2.2) + +theorem isTestFunction_smul {Ω : Set Plane} {φ : Plane → ℝ} + (hφ : IsTestFunction Ω φ) (c : ℝ) : IsTestFunction Ω (c • φ) := by + refine ⟨hφ.1.const_smul c, ?_, ?_⟩ + · exact hφ.2.1.mono (Function.support_const_smul_subset c φ) + · exact (closure_mono (Function.support_const_smul_subset c φ)).trans hφ.2.2 + +theorem gradient_add_of_smooth {φ ψ : Plane → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hψ : ContDiff ℝ ∞ ψ) (x : Plane) : + gradient (φ + ψ) x = gradient φ x + gradient ψ x := by + simp only [gradient, fderiv_add (hφ.differentiable (by simp) x) + (hψ.differentiable (by simp) x), map_add] + +theorem gradient_smul_of_smooth {φ : Plane → ℝ} + (hφ : ContDiff ℝ ∞ φ) (c : ℝ) (x : Plane) : + gradient (c • φ) x = c • gradient φ x := by + rw [gradient, fderiv_const_smul (hφ.differentiable (by simp) x) c] + change (InnerProductSpace.toDual ℝ Plane).symm (c • fderiv ℝ φ x) = _ + simp only [map_smul, gradient] + +theorem smoothGraph_add {Ω : Set Plane} {w z : SobolevAmbient} + (hw : w ∈ smoothGraph Ω) (hz : z ∈ smoothGraph Ω) : + w + z ∈ smoothGraph Ω := by + obtain ⟨φ, hφ, hwφ, hwg⟩ := hw + obtain ⟨ψ, hψ, hzψ, hzg⟩ := hz + refine ⟨φ + ψ, isTestFunction_add hφ hψ, ?_, ?_⟩ + · filter_upwards [Lp.coeFn_add w.1 z.1, hwφ, hzψ] with x hadd hwx hzx + exact hadd.trans (by simp [hwx, hzx]) + · filter_upwards [Lp.coeFn_add w.2 z.2, hwg, hzg] with x hadd hwx hzx + exact hadd.trans (by simp [hwx, hzx, gradient_add_of_smooth hφ.1 hψ.1]) + +theorem smoothGraph_smul {Ω : Set Plane} {w : SobolevAmbient} + (hw : w ∈ smoothGraph Ω) (c : ℝ) : c • w ∈ smoothGraph Ω := by + obtain ⟨φ, hφ, hwφ, hwg⟩ := hw + refine ⟨c • φ, isTestFunction_smul hφ c, ?_, ?_⟩ + · filter_upwards [Lp.coeFn_smul c w.1, hwφ] with x hsmul hwx + exact hsmul.trans (by simp [hwx]) + · filter_upwards [Lp.coeFn_smul c w.2, hwg] with x hsmul hwx + exact hsmul.trans (by simp [hwx, gradient_smul_of_smooth hφ.1]) + +/-- The actual smooth gradient graph is an ℝ-linear subspace. -/ +def smoothGraphSubmodule (Ω : Set Plane) : Submodule ℝ SobolevAmbient where + carrier := smoothGraph Ω + zero_mem' := zero_mem_smoothGraph Ω + add_mem' := smoothGraph_add + smul_mem' := fun c _ hw => smoothGraph_smul hw c + +@[simp] theorem smoothGraphSubmodule_coe (Ω : Set Plane) : + (smoothGraphSubmodule Ω : Set SobolevAmbient) = smoothGraph Ω := rfl + +/-- The actual closed Sobolev gradient graph as a submodule. -/ +def h01Submodule (Ω : Set Plane) : Submodule ℝ SobolevAmbient := + (smoothGraphSubmodule Ω).topologicalClosure + +@[simp] theorem h01Submodule_coe (Ω : Set Plane) : + (h01Submodule Ω : Set SobolevAmbient) = h01Graph Ω := rfl + +theorem h01Graph_add {Ω : Set Plane} {w z : SobolevAmbient} + (hw : w ∈ h01Graph Ω) (hz : z ∈ h01Graph Ω) : w + z ∈ h01Graph Ω := + (h01Submodule Ω).add_mem hw hz + +theorem h01Graph_smul {Ω : Set Plane} {w : SobolevAmbient} + (hw : w ∈ h01Graph Ω) (c : ℝ) : c • w ∈ h01Graph Ω := + (h01Submodule Ω).smul_mem c hw + +theorem h01Graph_sub {Ω : Set Plane} {w z : SobolevAmbient} + (hw : w ∈ h01Graph Ω) (hz : z ∈ h01Graph Ω) : w - z ∈ h01Graph Ω := + (h01Submodule Ω).sub_mem hw hz + +instance h01Submodule_isClosed (Ω : Set Plane) : + IsClosed ((h01Submodule Ω : Submodule ℝ SobolevAmbient) : Set SobolevAmbient) := + isClosed_h01Graph Ω + +end Math30.Polya diff --git a/Math30/PolyaTrialSpaces.lean b/Math30/PolyaTrialSpaces.lean new file mode 100644 index 0000000..ee426a9 --- /dev/null +++ b/Math30/PolyaTrialSpaces.lean @@ -0,0 +1,170 @@ +import Math30.PolyaSobolev +import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension +import Mathlib.LinearAlgebra.Dimension.Constructions + +/-! +Finite-dimensional trial spaces for the concrete planar Dirichlet graph. +The construction uses compactly supported smooth functions separating a finite +set of interior points. All L² representatives and all dimension and injectivity +claims are proved, without spectral assumptions. +-/ + +noncomputable section +open Set MeasureTheory +open scoped Topology ContDiff + +namespace Math30.Polya + +/-- A test function gives an actual value/gradient pair in the smooth L² graph. -/ +theorem IsTestFunction.exists_smoothGraph {Ω : Set Plane} {φ : Plane → ℝ} + (hφ : IsTestFunction Ω φ) : + ∃ w ∈ smoothGraph Ω, (∀ᵐ x ∂(volume : Measure Plane), w.1 x = φ x) := by + have hvalue : MemLp φ 2 (volume : Measure Plane) := + hφ.1.continuous.memLp_of_hasCompactSupport hφ.2.1 + have hc : Continuous (gradient φ) := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp + (hφ.1.continuous_fderiv (by simp)) + have hs : HasCompactSupport (gradient φ) := by + apply hφ.2.1.mono' + intro x hx + by_contra hnot + exact hx (by simp [gradient, fderiv_of_notMem_tsupport ℝ hnot]) + have hg : MemLp (gradient φ) 2 (volume : Measure Plane) := + hc.memLp_of_hasCompactSupport hs + exact ⟨(hvalue.toLp φ, hg.toLp (gradient φ)), + ⟨φ, hφ, hvalue.coeFn_toLp, hg.coeFn_toLp⟩, hvalue.coeFn_toLp⟩ + +/-- Pointwise equality follows from L² equality for the continuous smooth +representatives, so the smooth graph has no vertical elements. -/ +theorem smoothGraph_value_eq_zero {Ω : Set Plane} {w : SobolevAmbient} + (hw : w ∈ smoothGraph Ω) (hzero : w.1 = 0) : w = 0 := by + obtain ⟨φ, hφ, hv, hg⟩ := hw + have hφae : φ =ᵐ[(volume : Measure Plane)] (0 : Plane → ℝ) := by + have hwae : (fun x => w.1 x) =ᵐ[(volume : Measure Plane)] (0 : Plane → ℝ) := by + rw [hzero] + exact Lp.coeFn_zero ℝ 2 volume + filter_upwards [hv, hwae] with x hvx hwx + exact hvx.symm.trans hwx + have hφzero : φ = 0 := MeasureTheory.Measure.eq_of_ae_eq hφae + hφ.1.continuous continuous_const + have hgrad : w.2 = 0 := by + apply Lp.ext + filter_upwards [hg, Lp.coeFn_zero Plane 2 (volume : Measure Plane)] with x hx hz + simp only [hφzero, Pi.zero_def, gradient_fun_const] at hx + exact hx.trans hz.symm + exact Prod.ext hzero hgrad + +/-- Every finite collection of distinct interior points has compactly supported +smooth interpolation functions with Kronecker-delta values. -/ +theorem exists_testFunction_interpolation {Ω : Set Plane} (hΩ : IsOpen Ω) + {k : ℕ} (p : Fin k → Plane) (hp : ∀ i, p i ∈ Ω) (hinj : Function.Injective p) : + ∃ φ : Fin k → Plane → ℝ, + (∀ i, IsTestFunction Ω (φ i)) ∧ + (∀ i j, φ i (p j) = if i = j then 1 else 0) := by + classical + have hex (i : Fin k) : ∃ φ : Plane → ℝ, + IsTestFunction Ω φ ∧ ∀ j, φ (p j) = if i = j then 1 else 0 := by + let s : Set Plane := p '' {j | j ≠ i} + have hsfin : s.Finite := (Set.toFinite _).image p + have hpi : p i ∉ s := by + rintro ⟨j, hj, heq⟩ + exact hj (hinj heq) + have hnhds : Ω \ s ∈ 𝓝 (p i) := + (hΩ.sdiff hsfin.isClosed).mem_nhds ⟨hp i, hpi⟩ + obtain ⟨φ, hsupp, hcompact, hsmooth, _, hone⟩ := + exists_contDiff_tsupport_subset (n := ⊤) hnhds + refine ⟨φ, ⟨hsmooth, hcompact, hsupp.trans sdiff_subset⟩, ?_⟩ + intro j + split_ifs with hij + · simpa [← hij] using hone + · apply image_eq_zero_of_notMem_tsupport + intro hmem + exact (hsupp hmem).2 ⟨j, Ne.symm hij, rfl⟩ + choose φ hφ hvalues using hex + exact ⟨φ, hφ, hvalues⟩ + +/-- Every nonempty open planar set contains arbitrarily many distinct points. -/ +theorem exists_injective_points {Ω : Set Plane} (hΩ : IsOpen Ω) + (hne : Ω.Nonempty) (k : ℕ) : + ∃ p : Fin k → Plane, (∀ i, p i ∈ Ω) ∧ Function.Injective p := by + obtain ⟨x, hx⟩ := hne + have hinfinite : Ω.Infinite := infinite_of_mem_nhds x (hΩ.mem_nhds hx) + let e := hinfinite.natEmbedding Ω + refine ⟨fun i => (e i.val).val, fun i => (e i.val).property, ?_⟩ + intro i j hij + apply Fin.ext + exact e.injective (Subtype.ext hij) + +/-- Coercion of a finite sum of L² functions agrees almost everywhere with the +pointwise sum of any chosen representatives. -/ +private theorem lp_finset_sum_ae {ι : Type*} [DecidableEq ι] + (s : Finset ι) (u : ι → Lp ℝ 2 (volume : Measure Plane)) + (φ : ι → Plane → ℝ) + (h : ∀ i, ∀ᵐ x ∂(volume : Measure Plane), u i x = φ i x) : + ∀ᵐ x ∂(volume : Measure Plane), (∑ i ∈ s, u i) x = ∑ i ∈ s, φ i x := by + induction s using Finset.induction_on with + | empty => + simp only [Finset.sum_empty] + exact Lp.coeFn_zero ℝ 2 (volume : Measure Plane) + | @insert a s ha ih => + simp only [Finset.sum_insert ha] + filter_upwards [Lp.coeFn_add (u a) (∑ i ∈ s, u i), h a, ih] with x hadd hx hs + exact hadd.trans (congrArg₂ (· + ·) hx hs) + +/-- Actual smooth graph vectors whose L² value components are linearly independent. -/ +theorem exists_independent_smoothGraph {Ω : Set Plane} (hΩ : IsOpen Ω) + (hne : Ω.Nonempty) (k : ℕ) : + ∃ w : Fin k → SobolevAmbient, + (∀ i, w i ∈ smoothGraph Ω) ∧ LinearIndependent ℝ (fun i => (w i).1) := by + classical + obtain ⟨p, hp, hinj⟩ := exists_injective_points hΩ hne k + obtain ⟨φ, hφ, hvalues⟩ := exists_testFunction_interpolation hΩ p hp hinj + choose w hw hrep using fun i => (hφ i).exists_smoothGraph + refine ⟨w, hw, Fintype.linearIndependent_iff.mpr ?_⟩ + intro c hc i + have hsum : ∀ᵐ x ∂(volume : Measure Plane), + (∑ j, c j • (w j).1) x = ∑ j, c j * φ j x := by + apply lp_finset_sum_ae + intro j + filter_upwards [Lp.coeFn_smul (c j) (w j).1, hrep j] with x hsmul hx + exact hsmul.trans (by simp [hx]) + have hae : (fun x => ∑ j, c j * φ j x) =ᵐ[(volume : Measure Plane)] + (0 : Plane → ℝ) := by + rw [hc] at hsum + filter_upwards [hsum, Lp.coeFn_zero ℝ 2 (volume : Measure Plane)] with x hx hz + exact hx.symm.trans hz + have heq : (fun x => ∑ j, c j * φ j x) = (0 : Plane → ℝ) := + MeasureTheory.Measure.eq_of_ae_eq hae + (continuous_finsetSum _ (fun j _ => continuous_const.mul (hφ j).1.continuous)) + continuous_const + have hi := congrFun heq (p i) + simpa [hvalues] using hi + +/-- Arbitrarily large finite-dimensional trial spaces exist already inside the +smooth graph, before taking its Sobolev closure. Their value projection is injective. -/ +theorem exists_trialSpace_injective (Ω : PlanarLipschitzDomain) (k : ℕ) : + ∃ V : TrialSpace Ω.carrier k, + Function.Injective (fun w : V.space => (w : SobolevAmbient).1) := by + classical + obtain ⟨w, hw, hli⟩ := exists_independent_smoothGraph Ω.isOpen Ω.nonempty k + let S := Submodule.span ℝ (Set.range w) + have hS : S ≤ smoothGraphSubmodule Ω.carrier := by + apply Submodule.span_le.mpr + rintro _ ⟨i, rfl⟩ + exact hw i + have hliw : LinearIndependent ℝ w := + hli.of_comp (LinearMap.fst ℝ (Lp ℝ 2 (volume : Measure Plane)) + (Lp Plane 2 (volume : Measure Plane))) + let V : TrialSpace Ω.carrier k := + { space := S + finiteDimensional := FiniteDimensional.span_of_finite ℝ (Set.finite_range w) + dimension := (finrank_span_eq_card hliw).trans (Fintype.card_fin k) + contained := fun _ hs => smoothGraph_subset_h01Graph _ (hS hs) } + refine ⟨V, ?_⟩ + intro u v huv + apply Subtype.ext + apply sub_eq_zero.mp + apply smoothGraph_value_eq_zero (hS (S.sub_mem u.property v.property)) + exact sub_eq_zero.mpr huv + +end Math30.Polya diff --git a/Math30/WilfMinimal.lean b/Math30/WilfMinimal.lean new file mode 100644 index 0000000..f43f9ae --- /dev/null +++ b/Math30/WilfMinimal.lean @@ -0,0 +1,261 @@ +import Mathlib.Algebra.Group.Submonoid.Basic +import Mathlib.Algebra.MvPolynomial.PDeriv +import Mathlib.Algebra.MvPolynomial.NoZeroDivisors +import Mathlib.Data.Finset.Lattice.Fold +import Mathlib.Data.Nat.Find +import Mathlib.Basic.Real.Basic +import Mathlib.Data.Set.Finite.Basic +import Mathlib.Tactic + +/-! +# Statement targets 22–24 and 28–30 + +These declarations encode propositions; they do **not** assert proofs of the six targets. +The supporting lemmas establish that the numerical-semigroup invariants exist and +that their finite implementations have the intended meanings. + +Polynomial minimal graphs are scalar real polynomial functions on the whole of +`ℝ^n`. The minimal-surface equation is imposed as an exact polynomial identity. +See `WilfMinimal.md` for the interpretation, sources, and limitations. +-/ + +namespace Math30 +namespace Wilf + +/-- A proper numerical semigroup: an additive submonoid of the natural numbers +with finite complement, excluding the whole of `ℕ`. -/ +structure NumericalSemigroup where + carrier : AddSubmonoid ℕ + finite_gaps : Set.Finite {n : ℕ | n ∉ carrier} + proper : carrier ≠ ⊤ + +namespace NumericalSemigroup + +/-- `c` is a conductor threshold, not necessarily the least one. -/ +def IsConductor (S : NumericalSemigroup) (c : ℕ) : Prop := + ∀ n : ℕ, c ≤ n → n ∈ S.carrier + +/-- Cofiniteness guarantees a conductor threshold. -/ +theorem exists_conductor (S : NumericalSemigroup) : ∃ c, S.IsConductor c := by + classical + let gaps := S.finite_gaps.toFinset + refine ⟨gaps.sup id + 1, ?_⟩ + intro n hn + by_contra hnot + have hmem : n ∈ gaps := by simpa [gaps] using hnot + have hle : n ≤ gaps.sup id := Finset.le_sup (f := id) hmem + omega + +/-- The least conductor; no default value is used. -/ +noncomputable def conductor (S : NumericalSemigroup) : ℕ := by + classical + exact Nat.find S.exists_conductor + +theorem conductor_spec (S : NumericalSemigroup) : S.IsConductor S.conductor := by + classical + exact Nat.find_spec S.exists_conductor + +theorem conductor_le (S : NumericalSemigroup) {c : ℕ} (hc : S.IsConductor c) : + S.conductor ≤ c := by + classical + exact Nat.find_min' S.exists_conductor hc + +theorem conductor_pos (S : NumericalSemigroup) : 0 < S.conductor := by + by_contra h + have hc : S.conductor = 0 := by omega + apply S.proper + ext n + simp only [AddSubmonoid.mem_top, iff_true] + exact S.conductor_spec n (by omega) + +theorem exists_positive (S : NumericalSemigroup) : ∃ m : ℕ, 0 < m ∧ m ∈ S.carrier := by + exact ⟨S.conductor + 1, by omega, S.conductor_spec _ (by omega)⟩ + +/-- The least positive element; its defining witness is proved to exist. -/ +noncomputable def multiplicity (S : NumericalSemigroup) : ℕ := by + classical + exact Nat.find S.exists_positive + +theorem multiplicity_pos (S : NumericalSemigroup) : 0 < S.multiplicity := by + classical + exact (Nat.find_spec S.exists_positive).1 + +theorem multiplicity_mem (S : NumericalSemigroup) : S.multiplicity ∈ S.carrier := by + classical + exact (Nat.find_spec S.exists_positive).2 + +theorem multiplicity_le (S : NumericalSemigroup) {n : ℕ} + (hn : 0 < n) (hmem : n ∈ S.carrier) : S.multiplicity ≤ n := by + classical + exact Nat.find_min' S.exists_positive ⟨hn, hmem⟩ + +/-- A positive indecomposable element, equivalently an element of the unique +minimal generating set of a numerical semigroup. -/ +def IsPrimitive (S : NumericalSemigroup) (n : ℕ) : Prop := + n ∈ S.carrier ∧ 0 < n ∧ + ∀ a b : ℕ, a ∈ S.carrier → b ∈ S.carrier → n = a + b → a = 0 ∨ b = 0 + +theorem multiplicity_isPrimitive (S : NumericalSemigroup) : + S.IsPrimitive S.multiplicity := by + refine ⟨S.multiplicity_mem, S.multiplicity_pos, ?_⟩ + intro a b ha hb heq + by_cases ha0 : a = 0 + · exact Or.inl ha0 + · by_cases hb0 : b = 0 + · exact Or.inr hb0 + · have hma := S.multiplicity_le (by omega : 0 < a) ha + omega + +/-- Every primitive lies below `c + m`, so there are only finitely many. -/ +theorem primitive_lt (S : NumericalSemigroup) {n : ℕ} (hn : S.IsPrimitive n) : + n < S.conductor + S.multiplicity := by + by_contra h + have hc := S.conductor_pos + have hm := S.multiplicity_pos + have hsub : n - S.multiplicity ∈ S.carrier := + S.conductor_spec _ (by omega) + have heq : n = S.multiplicity + (n - S.multiplicity) := by omega + rcases hn.2.2 S.multiplicity (n - S.multiplicity) S.multiplicity_mem hsub heq with h | h + · omega + · omega + +/-- Exactly the positive indecomposables; the cutoff is justified by `primitive_lt`. -/ +noncomputable def primitiveElements (S : NumericalSemigroup) : Finset ℕ := by + classical + exact (Finset.range (S.conductor + S.multiplicity)).filter S.IsPrimitive + +@[simp] theorem mem_primitiveElements (S : NumericalSemigroup) (n : ℕ) : + n ∈ S.primitiveElements ↔ S.IsPrimitive n := by + classical + simp only [primitiveElements, Finset.mem_filter, Finset.mem_range] + exact ⟨And.right, fun h => ⟨S.primitive_lt h, h⟩⟩ + +theorem finite_primitives (S : NumericalSemigroup) : Set.Finite {n | S.IsPrimitive n} := by + have heq : {n | S.IsPrimitive n} = (S.primitiveElements : Set ℕ) := by + ext n + simp + rw [heq] + exact S.primitiveElements.finite_toSet + +/-- The primitive elements really generate the semigroup. This is proved rather +than assumed as an additional structure field. -/ +theorem closure_primitives (S : NumericalSemigroup) : + AddSubmonoid.closure {n | S.IsPrimitive n} = S.carrier := by + apply le_antisymm + · apply AddSubmonoid.closure_le.mpr + intro n hn + exact hn.1 + · have hgen : ∀ n : ℕ, n ∈ S.carrier → + n ∈ AddSubmonoid.closure {n | S.IsPrimitive n} := by + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro hn + by_cases hz : n = 0 + · subst n + exact AddSubmonoid.zero_mem _ + · by_cases hp : S.IsPrimitive n + · exact AddSubmonoid.subset_closure hp + · have hdec : ¬ ∀ a b : ℕ, a ∈ S.carrier → b ∈ S.carrier → + n = a + b → a = 0 ∨ b = 0 := by + intro hall + exact hp ⟨hn, by omega, hall⟩ + push Not at hdec + obtain ⟨a, b, ha, hb, heq, ha0, hb0⟩ := hdec + rw [heq] + exact AddSubmonoid.add_mem _ (ih a (by omega) ha) (ih b (by omega) hb) + exact hgen + +/-- Embedding dimension is the number of positive indecomposable generators. -/ +noncomputable def embeddingDimension (S : NumericalSemigroup) : ℕ := + S.primitiveElements.card + +theorem embeddingDimension_pos (S : NumericalSemigroup) : 0 < S.embeddingDimension := by + unfold embeddingDimension + apply Finset.card_pos.mpr + exact ⟨S.multiplicity, (S.mem_primitiveElements _).mpr S.multiplicity_isPrimitive⟩ + +/-- The semigroup elements strictly below the conductor, including zero. -/ +noncomputable def leftElements (S : NumericalSemigroup) : Finset ℕ := by + classical + exact (Finset.range S.conductor).filter (fun n => n ∈ S.carrier) + +@[simp] theorem mem_leftElements (S : NumericalSemigroup) (n : ℕ) : + n ∈ S.leftElements ↔ n < S.conductor ∧ n ∈ S.carrier := by + classical + simp [leftElements] + +theorem zero_mem_leftElements (S : NumericalSemigroup) : 0 ∈ S.leftElements := by + exact (S.mem_leftElements 0).2 ⟨S.conductor_pos, S.carrier.zero_mem⟩ + +noncomputable def leftCount (S : NumericalSemigroup) : ℕ := S.leftElements.card + +/-- Wilf's inequality in the `e · |L| ≥ c` convention. -/ +def SatisfiesWilf (S : NumericalSemigroup) : Prop := + S.conductor ≤ S.embeddingDimension * S.leftCount + +end NumericalSemigroup +end Wilf + +/-- Target 22: Wilf's inequality at embedding dimension four. -/ +def Problem22 : Prop := + ∀ S : Wilf.NumericalSemigroup, + S.embeddingDimension = 4 → S.SatisfiesWilf + +/-- Target 23: Wilf's inequality when `c ≤ 4m`. -/ +def Problem23 : Prop := + ∀ S : Wilf.NumericalSemigroup, + S.conductor ≤ 4 * S.multiplicity → S.SatisfiesWilf + +/-- Target 24: Wilf's inequality when `m ≤ 4e`, with no divisibility condition. -/ +def Problem24 : Prop := + ∀ S : Wilf.NumericalSemigroup, + S.multiplicity ≤ 4 * S.embeddingDimension → S.SatisfiesWilf + +namespace MinimalGraphs + +/-- A scalar real polynomial on the entire `n`-dimensional real affine space. -/ +abbrev RealPolynomial (n : ℕ) := MvPolynomial (Fin n) ℝ + +/-- The numerator of the scalar minimal graph equation: +`(1 + Σᵢ Pᵢ²) (Σᵢ Pᵢᵢ) − Σᵢ Σⱼ Pᵢ Pⱼ Pᵢⱼ`. +The equation is a polynomial identity, not a finite set of numerical samples. -/ +noncomputable def minimalGraphOperator {n : ℕ} (P : RealPolynomial n) : + RealPolynomial n := + (1 + ∑ i : Fin n, (MvPolynomial.pderiv i P) ^ 2) * + (∑ i : Fin n, MvPolynomial.pderiv i (MvPolynomial.pderiv i P)) - + ∑ i : Fin n, ∑ j : Fin n, + MvPolynomial.pderiv i P * MvPolynomial.pderiv j P * + MvPolynomial.pderiv i (MvPolynomial.pderiv j P) + +/-- Exact formal minimal-surface equation for an entire real scalar graph. -/ +def SatisfiesMinimalGraphEquation {n : ℕ} (P : RealPolynomial n) : Prop := + minimalGraphOperator P = 0 + +/-- Affineness includes constants and the zero polynomial. Mathlib's natural-valued +`totalDegree` is zero on the zero polynomial; the bound `≤ 1` handles it correctly. -/ +def IsAffine {n : ℕ} (P : RealPolynomial n) : Prop := P.totalDegree ≤ 1 + +end MinimalGraphs + +/-- Target 28: polynomial minimal graphs of degree at most four are affine, +in every dimension. This is not restricted to dimension eight. -/ +def Problem28 : Prop := + ∀ (n : ℕ) (P : MinimalGraphs.RealPolynomial n), + P.totalDegree ≤ 4 → MinimalGraphs.SatisfiesMinimalGraphEquation P → + MinimalGraphs.IsAffine P + +/-- Target 29: every entire scalar real polynomial minimal graph on `ℝ⁸` is affine, +with no upper bound assumed on its degree. -/ +def Problem29 : Prop := + ∀ P : MinimalGraphs.RealPolynomial 8, + MinimalGraphs.SatisfiesMinimalGraphEquation P → MinimalGraphs.IsAffine P + +/-- Target 30: in each dimension at least eight there is a uniform degree bound +for scalar real polynomial minimal graphs. The bound is chosen before `P`. -/ +def Problem30 : Prop := + ∀ n : ℕ, 8 ≤ n → ∃ B : ℕ, + ∀ P : MinimalGraphs.RealPolynomial n, + MinimalGraphs.SatisfiesMinimalGraphEquation P → P.totalDegree ≤ B + +end Math30 diff --git a/Math30/WilfMinimalFixtures.lean b/Math30/WilfMinimalFixtures.lean new file mode 100644 index 0000000..4a425e8 --- /dev/null +++ b/Math30/WilfMinimalFixtures.lean @@ -0,0 +1,280 @@ +import Math30.WilfMinimal + +/-! Executable proof fixtures for the six statement definitions. None is a proof +of an open target. The examples check invariant conventions and equation polarity. -/ + +namespace Math30.Wilf +namespace Fixtures + +/-- The ordinary numerical semigroup `{0} ∪ {k, k+1, ...}`. -/ +def ordinary (k : ℕ) (hk : 2 ≤ k) : NumericalSemigroup where + carrier := { + carrier := {n | n = 0 ∨ k ≤ n} + zero_mem' := Or.inl rfl + add_mem' := by + intro a b ha hb + simp only [Set.mem_ofPred_eq] at * + omega } + finite_gaps := by + apply (Finset.range k).finite_toSet.subset + intro n hn + change ¬ (n = 0 ∨ k ≤ n) at hn + simp only [Finset.mem_coe, Finset.mem_range] + omega + proper := by + intro h + have hmem : (1 : ℕ) ∈ (⊤ : AddSubmonoid ℕ) := by trivial + rw [← h] at hmem + change 1 = 0 ∨ k ≤ 1 at hmem + omega + +@[simp] theorem ordinary_mem (k : ℕ) (hk : 2 ≤ k) (n : ℕ) : + n ∈ (ordinary k hk).carrier ↔ n = 0 ∨ k ≤ n := Iff.rfl + +@[simp] theorem ordinary_conductor (k : ℕ) (hk : 2 ≤ k) : + (ordinary k hk).conductor = k := by + apply Nat.le_antisymm + · apply NumericalSemigroup.conductor_le + intro n hn + exact Or.inr hn + · have h := (ordinary k hk).conductor_spec _ (Nat.le_refl _) + have hp := (ordinary k hk).conductor_pos + rw [ordinary_mem] at h + omega + +@[simp] theorem ordinary_multiplicity (k : ℕ) (hk : 2 ≤ k) : + (ordinary k hk).multiplicity = k := by + apply Nat.le_antisymm + · exact (ordinary k hk).multiplicity_le (by omega) (Or.inr (Nat.le_refl _)) + · have h := (ordinary k hk).multiplicity_mem + have hp := (ordinary k hk).multiplicity_pos + rw [ordinary_mem] at h + omega + +theorem ordinary_primitive_iff (k : ℕ) (hk : 2 ≤ k) (n : ℕ) : + (ordinary k hk).IsPrimitive n ↔ k ≤ n ∧ n < k + k := by + constructor + · intro h + have hmem := h.1 + rw [ordinary_mem] at hmem + have hn : k ≤ n := by have := h.2.1; omega + refine ⟨hn, ?_⟩ + by_contra hlarge + have hsub : k ≤ n - k := by omega + have hz := h.2.2 k (n - k) (Or.inr (Nat.le_refl _)) (Or.inr hsub) (by omega) + omega + · rintro ⟨hn, hnlt⟩ + refine ⟨Or.inr hn, by omega, ?_⟩ + intro a b ha hb heq + rw [ordinary_mem] at ha hb + omega + +@[simp] theorem ordinary_primitives (k : ℕ) (hk : 2 ≤ k) : + (ordinary k hk).primitiveElements = Finset.Ico k (k + k) := by + ext n + simp only [NumericalSemigroup.mem_primitiveElements, ordinary_primitive_iff, Finset.mem_Ico] + +@[simp] theorem ordinary_embeddingDimension (k : ℕ) (hk : 2 ≤ k) : + (ordinary k hk).embeddingDimension = k := by + simp [NumericalSemigroup.embeddingDimension] + +@[simp] theorem ordinary_leftElements (k : ℕ) (hk : 2 ≤ k) : + (ordinary k hk).leftElements = {0} := by + ext n + simp only [NumericalSemigroup.mem_leftElements, ordinary_conductor, ordinary_mem, + Finset.mem_singleton] + omega + +@[simp] theorem ordinary_leftCount (k : ℕ) (hk : 2 ≤ k) : + (ordinary k hk).leftCount = 1 := by + simp [NumericalSemigroup.leftCount] + +theorem ordinary_satisfiesWilf (k : ℕ) (hk : 2 ≤ k) : + (ordinary k hk).SatisfiesWilf := by + simp [NumericalSemigroup.SatisfiesWilf] + +example : (ordinary 4 (by omega)).embeddingDimension = 4 := by simp +example : (ordinary 4 (by omega)).conductor = 4 := by simp +example : (ordinary 4 (by omega)).multiplicity = 4 := by simp +example : (ordinary 4 (by omega)).leftCount = 1 := by simp +example : (ordinary 4 (by omega)).SatisfiesWilf := ordinary_satisfiesWilf _ _ + +/-- Explicit numerical semigroup generated by 3 and 5: `{0,3,5,6} ∪ [8,∞)`. -/ +def threeFive : NumericalSemigroup where + carrier := { + carrier := {n | n = 0 ∨ n = 3 ∨ n = 5 ∨ n = 6 ∨ 8 ≤ n} + zero_mem' := Or.inl rfl + add_mem' := by + intro a b ha hb + simp only [Set.mem_ofPred_eq] at * + omega } + finite_gaps := by + apply (Finset.range 8).finite_toSet.subset + intro n hn + change ¬ (n = 0 ∨ n = 3 ∨ n = 5 ∨ n = 6 ∨ 8 ≤ n) at hn + simp only [Finset.mem_coe, Finset.mem_range] + omega + proper := by + intro h + have hmem : (1 : ℕ) ∈ (⊤ : AddSubmonoid ℕ) := by trivial + rw [← h] at hmem + change 1 = 0 ∨ 1 = 3 ∨ 1 = 5 ∨ 1 = 6 ∨ 8 ≤ 1 at hmem + omega + +@[simp] theorem threeFive_mem (n : ℕ) : + n ∈ threeFive.carrier ↔ n = 0 ∨ n = 3 ∨ n = 5 ∨ n = 6 ∨ 8 ≤ n := Iff.rfl + +@[simp] theorem threeFive_conductor : threeFive.conductor = 8 := by + have hle : threeFive.conductor ≤ 8 := by + apply threeFive.conductor_le + intro n hn + exact Or.inr (Or.inr (Or.inr (Or.inr hn))) + have hgap : 7 ∉ threeFive.carrier := by simp + have hgt : 7 < threeFive.conductor := by + by_contra h + exact hgap (threeFive.conductor_spec 7 (by omega)) + omega + +@[simp] theorem threeFive_multiplicity : threeFive.multiplicity = 3 := by + have hle : threeFive.multiplicity ≤ 3 := + threeFive.multiplicity_le (by omega) (by simp) + have hmem := threeFive.multiplicity_mem + have hp := threeFive.multiplicity_pos + rw [threeFive_mem] at hmem + omega + +theorem threeFive_primitive_iff (n : ℕ) : + threeFive.IsPrimitive n ↔ n = 3 ∨ n = 5 := by + constructor + · intro h + have hmem := h.1 + rw [threeFive_mem] at hmem + have hp := h.2.1 + have h33 := h.2.2 3 3 (by simp) (by simp) + have h55 := h.2.2 5 5 (by simp) (by simp) + have h3sub := h.2.2 3 (n - 3) (by simp) + simp only [threeFive_mem] at h3sub + omega + · intro h + refine ⟨by simp; omega, by omega, ?_⟩ + intro a b ha hb heq + rw [threeFive_mem] at ha hb + omega + +@[simp] theorem threeFive_primitives : threeFive.primitiveElements = {3, 5} := by + ext n + simp [threeFive_primitive_iff] + +@[simp] theorem threeFive_embeddingDimension : threeFive.embeddingDimension = 2 := by + simp [NumericalSemigroup.embeddingDimension] + +@[simp] theorem threeFive_leftElements : threeFive.leftElements = {0, 3, 5, 6} := by + ext n + simp only [NumericalSemigroup.mem_leftElements, threeFive_conductor, threeFive_mem, + Finset.mem_insert, Finset.mem_singleton] + omega + +@[simp] theorem threeFive_leftCount : threeFive.leftCount = 4 := by + simp [NumericalSemigroup.leftCount] + +example : threeFive.SatisfiesWilf := by simp [NumericalSemigroup.SatisfiesWilf] +example : threeFive.multiplicity ≤ 4 * threeFive.embeddingDimension := by simp +example : ¬ threeFive.multiplicity ∣ threeFive.conductor := by simp +example : 0 ∈ threeFive.leftElements := threeFive.zero_mem_leftElements + +end Fixtures +end Math30.Wilf + +namespace Math30.MinimalGraphs +namespace Fixtures + +open MvPolynomial + +/-- Generic affine polynomial, allowing arbitrary constant and linear coefficients. -/ +noncomputable def affinePolynomial {n : ℕ} (b : ℝ) (a : Fin n → ℝ) : RealPolynomial n := + C b + ∑ i : Fin n, C (a i) * X i + + theorem affinePolynomial_pderiv {n : ℕ} (b : ℝ) (a : Fin n → ℝ) (j : Fin n) : + pderiv j (affinePolynomial b a) = C (a j) := by + classical + simp [affinePolynomial, map_add, map_sum, Pi.single_apply] + + theorem affinePolynomial_second_pderiv {n : ℕ} (b : ℝ) (a : Fin n → ℝ) + (i j : Fin n) : pderiv i (pderiv j (affinePolynomial b a)) = 0 := by + rw [affinePolynomial_pderiv, pderiv_C] + + theorem affinePolynomial_satisfies {n : ℕ} (b : ℝ) (a : Fin n → ℝ) : + SatisfiesMinimalGraphEquation (affinePolynomial b a) := by + simp [SatisfiesMinimalGraphEquation, minimalGraphOperator, affinePolynomial_second_pderiv] + + theorem affinePolynomial_isAffine {n : ℕ} (b : ℝ) (a : Fin n → ℝ) : + IsAffine (affinePolynomial b a) := by + unfold IsAffine affinePolynomial + apply (totalDegree_add _ _).trans + apply max_le + · simp + · apply totalDegree_finsetSum_le + intro i hi + exact (totalDegree_mul _ _).trans (by simp) + + theorem constant_satisfies (n : ℕ) (b : ℝ) : + SatisfiesMinimalGraphEquation (C b : RealPolynomial n) := by + simp [SatisfiesMinimalGraphEquation, minimalGraphOperator] + + theorem constant_isAffine (n : ℕ) (b : ℝ) : IsAffine (C b : RealPolynomial n) := by + simp [IsAffine] + +example (n : ℕ) : SatisfiesMinimalGraphEquation (0 : RealPolynomial n) := by + simpa using constant_satisfies n 0 +example (n : ℕ) : IsAffine (0 : RealPolynomial n) := by simp [IsAffine] + +/-- A nonaffine polynomial used to ensure the equation predicate is not vacuous. -/ +noncomputable def quadratic : RealPolynomial 1 := X 0 ^ 2 + + theorem quadratic_degree : quadratic.totalDegree = 2 := by + simp [quadratic] + + theorem quadratic_not_affine : ¬ IsAffine quadratic := by + simp [IsAffine, quadratic_degree] + + theorem quadratic_operator : minimalGraphOperator quadratic = C 2 := by + have h2 : pderiv (0 : Fin 1) (2 : RealPolynomial 1) = 0 := + Derivation.map_natCast _ 2 + simp [minimalGraphOperator, quadratic, h2] + calc + _ = (2 : RealPolynomial 1) := by ring + _ = C 2 := (map_natCast (C : ℝ →+* RealPolynomial 1) 2).symm + + + theorem quadratic_not_satisfies : ¬ SatisfiesMinimalGraphEquation quadratic := by + unfold SatisfiesMinimalGraphEquation + rw [quadratic_operator] + norm_num + +example : quadratic.totalDegree ≤ 4 := by rw [quadratic_degree]; omega + +/-- The mixed monomial detects omission of the off-diagonal Hessian terms. -/ +noncomputable def mixedQuadratic : RealPolynomial 2 := X 0 * X 1 + + theorem mixedQuadratic_degree : mixedQuadratic.totalDegree = 2 := by + rw [mixedQuadratic, totalDegree_mul_of_isDomain (by simp) (by simp)] + simp + + theorem mixedQuadratic_operator : + minimalGraphOperator mixedQuadratic = -(2 * X 0 * X 1) := by + simp [minimalGraphOperator, mixedQuadratic, Fin.sum_univ_two, + map_add, Pi.single_apply] + ring + + theorem mixedQuadratic_not_satisfies : ¬ SatisfiesMinimalGraphEquation mixedQuadratic := by + intro h + change minimalGraphOperator mixedQuadratic = 0 at h + rw [mixedQuadratic_operator] at h + have he := congrArg (MvPolynomial.eval (fun _ : Fin 2 => (1 : ℝ))) h + norm_num at he + + theorem mixedQuadratic_not_affine : ¬ IsAffine mixedQuadratic := by + simp [IsAffine, mixedQuadratic_degree] + +end Fixtures +end Math30.MinimalGraphs diff --git a/lake-manifest.json b/lake-manifest.json index fae5d49..56673c2 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -1,96 +1,117 @@ -{"version": "1.2.0", - "packagesDir": ".lake/packages", - "packages": - [{"url": "https://github.com/leanprover-community/mathlib4", - "type": "git", - "subDir": null, - "scope": "leanprover-community", - "rev": "0df444a360eaa60ab8c11dca51a86af692955474", - "name": "mathlib", - "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.1", - "inherited": false, - "configFile": "lakefile.lean"}, - {"url": "https://github.com/leanprover-community/plausible", - "type": "git", - "subDir": null, - "scope": "leanprover-community", - "rev": "b7eb3304aeae834b12dda98993a37f6a41f6f0bb", - "name": "plausible", - "manifestFile": "lake-manifest.json", - "inputRev": "main", - "inherited": true, - "configFile": "lakefile.toml"}, - {"url": "https://github.com/leanprover-community/LeanSearchClient", - "type": "git", - "subDir": null, - "scope": "leanprover-community", - "rev": "5f4d51b81cbd3f6b32b156bfad9056621a040404", - "name": "LeanSearchClient", - "manifestFile": "lake-manifest.json", - "inputRev": "main", - "inherited": true, - "configFile": "lakefile.toml"}, - {"url": "https://github.com/leanprover-community/import-graph", - "type": "git", - "subDir": null, - "scope": "leanprover-community", - "rev": "16f02aa7642864af59f1ff0e384a015994db9118", - "name": "importGraph", - "manifestFile": "lake-manifest.json", - "inputRev": "main", - "inherited": true, - "configFile": "lakefile.toml"}, - {"url": "https://github.com/leanprover-community/ProofWidgets4", - "type": "git", - "subDir": null, - "scope": "leanprover-community", - "rev": "4be2e3d5087eeb272cf5a8853b8f9dd025ef5957", - "name": "proofwidgets", - "manifestFile": "lake-manifest.json", - "inputRev": "main", - "inherited": true, - "configFile": "lakefile.lean"}, - {"url": "https://github.com/leanprover-community/aesop", - "type": "git", - "subDir": null, - "scope": "leanprover-community", - "rev": "3448c0bcc5ce01b2d1546e483ec3620e32df3d0e", - "name": "aesop", - "manifestFile": "lake-manifest.json", - "inputRev": "master", - "inherited": true, - "configFile": "lakefile.toml"}, - {"url": "https://github.com/leanprover-community/quote4", - "type": "git", - "subDir": null, - "scope": "leanprover-community", - "rev": "92c15be17b7caf78c2ad767ec40f89052d908d81", - "name": "Qq", - "manifestFile": "lake-manifest.json", - "inputRev": "master", - "inherited": true, - "configFile": "lakefile.toml"}, - {"url": "https://github.com/leanprover-community/batteries", - "type": "git", - "subDir": null, - "scope": "leanprover-community", - "rev": "4488d40d070b9700d4d5a6aa342f0d40c31b2a2d", - "name": "batteries", - "manifestFile": "lake-manifest.json", - "inputRev": "main", - "inherited": true, - "configFile": "lakefile.toml"}, - {"url": "https://github.com/leanprover/lean4-cli", - "type": "git", - "subDir": null, - "scope": "leanprover", - "rev": "6130a47896ce867c6a4a55373441e59e565bad0f", - "name": "Cli", - "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.0", - "inherited": true, - "configFile": "lakefile.toml"}], - "name": "formal_conjectures", - "lakeDir": ".lake", - "fixedToolchain": false} +{ + "version": "1.2.0", + "packagesDir": ".lake/packages", + "packages": [ + { + "url": "https://github.com/leanprover-community/mathlib4.git", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "065356127b1dc0016f66b7283ce0ce2c4055aa55", + "name": "mathlib", + "manifestFile": "lake-manifest.json", + "inputRev": "v4.35.0-rc2", + "inherited": false, + "configFile": "lakefile.lean" + }, + { + "url": "https://github.com/leanprover-community/plausible", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "e50948299c4dc4a4c21b1c34b6a6a4fddc19f912", + "name": "plausible", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/LeanSearchClient", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "95e037bfdc31d3916ac615446847fb01960e2719", + "name": "LeanSearchClient", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/import-graph", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "10930f8138f0462dbd744a91fc03a16fae0e046f", + "name": "importGraph", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/ProofWidgets4", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "4c70ac059693669e5756e32a7a94b57ee1e99dc5", + "name": "proofwidgets", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.lean" + }, + { + "url": "https://github.com/leanprover-community/aesop", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "75d936c7af167cc93fac0d31237682fc2204591d", + "name": "aesop", + "manifestFile": "lake-manifest.json", + "inputRev": "master", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/quote4", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "786b7acdca7eb4e9c76c5d1d5bd810e7e5c56334", + "name": "Qq", + "manifestFile": "lake-manifest.json", + "inputRev": "master", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/batteries", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "ed9b316aabe389fec1ef43c3326ab48c7e59be42", + "name": "batteries", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover/lean4-cli", + "type": "git", + "subDir": null, + "scope": "leanprover", + "rev": "2842b9871b04862f944c032e34052cb9448ccb71", + "name": "Cli", + "manifestFile": "lake-manifest.json", + "inputRev": "v4.35.0-rc2", + "inherited": true, + "configFile": "lakefile.toml" + } + ], + "name": "formal_conjectures", + "lakeDir": ".lake", + "fixedToolchain": false +} diff --git a/lakefile.toml b/lakefile.toml index 8cc37c7..6dc11cc 100644 --- a/lakefile.toml +++ b/lakefile.toml @@ -30,7 +30,7 @@ weak.linter.style.openClassical = true [[require]] name = "mathlib" scope = "leanprover-community" -rev = "v4.33.1" +rev = "v4.35.0-rc2" # We make this a separate library so that we can apply different lean options. [[lean_lib]] @@ -61,25 +61,30 @@ weak.linter.style.moduleDocstring = true weak.linter.style.latex_docstring = true weak.linter.style.imports = true -[[lean_lib]] -name = "FormalConjecturesAnswerPostpone" -globs = ["FormalConjectures.+"] -[lean_lib.leanOptions] -# Switch off warnings generated by `sorry` -warn.sorry = false -# our own linters which only make sense for the problems themselves -weak.linter.style.ams_attribute = true -weak.linter.style.category_attribute = true -weak.linter.style.conditional_formal_proof = true -weak.linter.style.moduleDocstring = true -weak.linter.style.latex_docstring = true -weak.linter.style.imports = true -weak.google.answer = "postpone" - - [[lean_exe]] name = "extract_names" srcDir = "scripts" root = "extract_names" exeName = "extract_names" supportInterpreter = true + +[[lean_lib]] +name = "Math15" + +[[lean_lib]] +name = "Math30" + +[[lean_lib]] +name = "FullOldProblems" +globs = ["FullOldProblems", "FullOldProblems.*"] + +[[lean_lib]] +name = "HilbertDrafts" +globs = ["HilbertDrafts.+"] +[lean_lib.leanOptions] +autoImplicit = true +relaxedAutoImplicit = true +weak.linter.style.copyright.formalConjectures = false +weak.linter.style.namespace = false +weak.linter.style.stubs = false +weak.linter.style.openClassical = false diff --git a/lean-toolchain b/lean-toolchain index a8afa7d..acc704f 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.33.1 +leanprover/lean4:v4.35.0-rc2