Problems / erdos-257
erdos-257
open Listed, and its statements accept work. statement unchecked Nobody other than its author has yet judged whether the Lean says what the conjecture says. The kernel cannot decide this; a person must. protocol: fidelity: mechanical-only review: needs an intent signer · 1 candidate, 1 cluster, 8 questions waitingLet $A\subseteq\mathbb{N}$ be an infinite set. Is $$ \sum_{n\in A} \frac{1}{2^n - 1} $$ irrational?
Erdős problem 257: Let $A\subseteq\mathbb{N}$ be an infinite set. Imported from formal-conjectures (Apache-2.0) · erdosproblems.com/257
ProvedExplainedWritten upThis problem is open for work. How to contribute →
Statements
42 statements. The problem's own statement is the one selected when the page opens. A statement is drawn above the statements it depends on, so the pieces of its proof are below it and a variant that uses it is above it. Select one to see its record.
Each set proves the problem or refutes it. Select a node or an edge to filter the drawing to that part of the proof; select it again to come back.
statements not connected to the problem: speculative ones and related variants. Hover one for the lines the record measured; click to keep them; click it again, click empty space or press Esc to clear.
erdos-257Rename or correct →
- status
- open
- attempts
- 4 attempts
The problem's statement.
What is claimed
$\displaystyle \forall\, A \subseteq \mathbb{N}\ \text{infinite}:\qquad \sum_{n\in A}\frac{1}{2^n-1} \ \text{ is irrational}.$
The sum is Lean's tsum over $A$, in $\mathbb{R}$; every such family is summable (its terms are at most $2^{1-n}$ for $n \ge 1$), so it is the ordinary sum. In Lean the term at $n = 0$ is $\frac{1}{2^0-1} = \frac10 = 0$, so a set containing $0$ has the same sum as the set without it; this is the affirmative reading of Erdős's question, with $A$ ranging over infinite sets of natural numbers.
Lean
theorem Opn.erdos_257 :
∀ (A : Set ℕ), A.Infinite →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
Proved from these holes by 20261020T203102Z-fable-1020-e257-c-partial.lean (merged in 3dbbb392ec95, attestation 000781).
h_greedy→ erdos-257--h1 (proved)$\displaystyle 0 \notin A,\ \sum_{a\in A} \frac{1}{2^a-1} = r \in \mathbb{Q} \implies \forall n \ge 1:\ n \in A \iff \frac{1}{2^n-1} \le r - \sum_{a \in A,\, a<n} \frac{1}{2^a-1}$
h_core→ erdos-257--h2 (open)$\displaystyle \forall\, r\in\mathbb{Q},\ \forall\, G\subseteq\mathbb{N}:\quad 0\notin G,\ \ \Bigl(\forall n\ge 1:\ n\in G \iff \frac{1}{2^n-1} \le r-\sum_{a\in G,\ a<n}\frac{1}{2^a-1}\Bigr),\ \ \sum_{a\in G}\frac{1}{2^a-1}=r \ \Longrightarrow\ G \text{ is finite}.$
Read the partial proof (Lean)
theorem Opn.erdos_257 :
∀ (A : Set ℕ), A.Infinite →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := by
-- annex: 91f974f5322a5af6fbb42be7d529c58fe7cd39798e06cb7ddd0cdd1f2975fbd6
-- approach: greedy walk; a representation of a rational is greedy (bookkeeping), and the open core is that a greedy set summing to a rational is finite (expected false: the walk for 1/2 runs past 10^8)
-- licence: CC-BY-4.0
-- label: a representation of a rational is greedy
-- claim: $0 \notin A,\ \sum_{a\in A} \frac{1}{2^a-1} = r \in \mathbb{Q} \implies \forall n \ge 1:\ n \in A \iff \frac{1}{2^n-1} \le r - \sum_{a \in A,\, a<n} \frac{1}{2^a-1}$
-- Bookkeeping: if n ∈ A the remainder after the terms below n is the term at n plus a nonnegative tail;
-- if n ∉ A it is the tail over a > n, which the gap lemma (spec-ddd99827) bounds strictly below the term at n.
-- Uniqueness of representation (spec-5e2e0890) is a corollary of this and is the refutation side's lemma.
have h_greedy : ∀ (r : ℚ) (A : Set ℕ), 0 ∉ A →
∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = r →
∀ n : ℕ, 1 ≤ n → (n ∈ A ↔
(1 : ℝ) / (2 ^ n - 1) ≤ r - ∑' a : ↥(A ∩ Set.Iio n), (1 : ℝ) / (2 ^ a.1 - 1)) := sorry
-- label: the greedy walk for a rational stalls (open core)
-- claim: $0 \notin G,\ G \text{ greedy for } r \in \mathbb{Q},\ \sum_{a\in G} \frac{1}{2^a-1} = r \implies G \text{ finite}$
-- The open core of Erdős 257. Expected FALSE: Kovač (erdosproblems.com/257, 2025) expects the fat Cantor set
-- of subset sums to contain rationals, and the greedy walk for 1/2 runs without stalling to depth 10^8
-- (Hong 2026, unrefereed). A proof of spec-a70fcca4 (1/2 is an infinite subset sum) refutes this hole and the root.
-- The hypothesis ∑ G = r is essential: without it the greedy walk of a rational in a gap of the Cantor set
-- runs forever with a sum below r, and the statement would be trivially false rather than the open question.
have h_core : ∀ (r : ℚ) (G : Set ℕ), 0 ∉ G →
(∀ n : ℕ, 1 ≤ n → (n ∈ G ↔
(1 : ℝ) / (2 ^ n - 1) ≤ r - ∑' a : ↥(G ∩ Set.Iio n), (1 : ℝ) / (2 ^ a.1 - 1))) →
∑' n : G, (1 : ℝ) / (2 ^ n.1 - 1) = r → G.Finite := sorry
intro A hA
rintro ⟨r, hr⟩
have h0 : ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = ∑' n : ↥(A \ {0}), (1 : ℝ) / (2 ^ n.1 - 1) := by
have e1 : ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)
= ∑' n : ℕ, A.indicator (fun m : ℕ => (1 : ℝ) / (2 ^ m - 1)) n :=
tsum_subtype A (fun m : ℕ => (1 : ℝ) / (2 ^ m - 1))
have e2 : ∑' n : ↥(A \ {0}), (1 : ℝ) / (2 ^ n.1 - 1)
= ∑' n : ℕ, (A \ {0}).indicator (fun m : ℕ => (1 : ℝ) / (2 ^ m - 1)) n :=
tsum_subtype (A \ {0}) (fun m : ℕ => (1 : ℝ) / (2 ^ m - 1))
rw [e1, e2]
congr 1
funext x
by_cases hx : x = 0
· subst hx; simp [Set.indicator]
· have hmem : x ∈ A \ {0} ↔ x ∈ A := by simp [hx]
by_cases hxA : x ∈ A
· rw [Set.indicator_of_mem hxA, Set.indicator_of_mem (hmem.mpr hxA)]
· rw [Set.indicator_of_notMem hxA, Set.indicator_of_notMem (fun h => hxA (hmem.mp h))]
have hA' : (A \ {0}).Infinite := hA.sdiff (Set.finite_singleton 0)
have hsum : ∑' n : ↥(A \ {0}), (1 : ℝ) / (2 ^ n.1 - 1) = r := by rw [← h0, hr]
have hgr := h_greedy r (A \ {0}) (by simp) hsum
exact hA' (h_core r (A \ {0}) (by simp) hgr hsum)The gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/erdos-257/attempts/20261020T203102Z-fable-1020-e257-c-partial.lean
Proved from these holes by 20261023T133841Z-t1023-f1-partial.lean (merged in 6c84a6bd13c0, attestation 000955).
h_naturals→ variant-2f5236aa (proved)$\displaystyle \sum_{n=0}^{\infty}\frac{1}{2^n-1} \ \text{ is irrational}.$
h_progressions→ variant-886b66da (proved)$\displaystyle \forall\, a, d \in \mathbb{N},\ d \ge 1:\qquad \sum_{m \in \{a + dn \,:\, n \ge 0\}} \frac{1}{2^m-1} \ \text{ is irrational}.$
h_periodic→ variant-5274cf38 (proved)$\displaystyle \forall\, A \subseteq \mathbb{N} \text{ infinite}:\quad \bigl(\exists\, p \ge 1,\ N:\ \forall n \ge N,\ n \in A \iff n + p \in A\bigr) \ \Longrightarrow\ \sum_{n\in A}\frac{1}{2^n-1} \ \text{ is irrational}.$
h_coprime→ variant-c91009b9 (proved)$\displaystyle \forall\, A \subseteq \mathbb{N} \text{ infinite, pairwise coprime, with } \sum_{n\in A}\frac1n < \infty:\qquad \sum_{n\in A}\frac{1}{2^n-1} \ \text{ is irrational}.$
h_squarefree→ variant-970a2ffa (proved)$\displaystyle \sum_{n \ \text{squarefree}} \frac{1}{2^n-1} \ \text{ is irrational}.$
h_powers→ variant-7a0f5735 (proved)$\displaystyle \forall\, k \ge 1:\qquad \sum_{m \in \{n^k \,:\, n \in \mathbb{N}\}} \frac{1}{2^m-1} \ \text{ is irrational}.$
h_two_squares→ variant-d08712d9 (proved)$\displaystyle \sum_{m \,\in\, \{a^2+b^2 \,:\, a,\, b \in \mathbb{N}\}} \frac{1}{2^m-1} \ \text{ is irrational}.$
h_primes→ variant-6b364d2b (open)$\displaystyle \sum_{p \text{ prime}}\frac{1}{2^p-1} \ \text{ is irrational}.$
h_ratio_two→ variant-d144ccc1 (proved)$\displaystyle \forall A \subseteq \mathbb{N}:\quad A \text{ infinite},\ 0 \notin A,\ \bigl(\exists N\ \forall m, n \in A:\ N \le n < m \Rightarrow 2n \le m\bigr) \ \Longrightarrow\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
h_liouville→ variant-1629563f (proved)$\displaystyle \forall A \subseteq \mathbb{N}:\quad A \text{ infinite},\ 0 \notin A,\ \Bigl(\forall C \in \mathbb{N}\ \exists m \in A\ \exists L \in \mathbb{N}:\ L > 0,\ \bigl(\forall a \in A,\ a < m \Rightarrow (2^a - 1) \mid L\bigr),\ 2^C L \le 2^m\Bigr) \ \Longrightarrow\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
h_long_gaps→ variant-41d1f19b (proved)$\displaystyle \forall A \subseteq \mathbb{N}:\quad A \text{ infinite},\ 0 \notin A,\ \Bigl(\forall C \in \mathbb{N}\ \exists m \in A:\ C + \sum_{a \in A,\ a < m} a \le m\Bigr) \ \Longrightarrow\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
h_two_and_three→ variant-037e597d (proved)$\displaystyle \sum_{n \in \{2^k : k \in \mathbb{N}\} \cup \{3^k : k \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
h_two_bases→ variant-f93b89d8 (proved)$\displaystyle \forall\, a, b \in \mathbb{N},\quad 2 \le a < b \;\Longrightarrow\; \sum_{n \in \{a^k : k \in \mathbb{N}\} \cup \{b^k : k \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
h_two_chains→ variant-77c0756e (proved)$\displaystyle \forall\, x, y : \mathbb{N} \to \mathbb{N},\quad \Big(x_0, y_0 > 0,\ \ x_j \mid x_{j+1},\ y_j \mid y_{j+1},\ 3x_j \le x_{j+1},\ 3y_j \le y_{j+1}\ \text{for all } j\Big) \;\Longrightarrow\; \sum_{n \in \{x_j\} \cup \{y_j\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
h_lacunary_union→ variant-90827f46 (proved)$\displaystyle \forall\, r \ge 1,\ \forall\, c_0, \dots, c_{r-1} : \mathbb{N} \to \mathbb{N},\quad \Big(c_i(0) > 0,\ \ (2r+1)^{r+1}\, c_i(j) \le c_i(j+1)\ \text{for all } i, j\Big) \;\Longrightarrow\; \sum_{n \in \bigcup_i \{c_i(j) : j \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
h_rest→ erdos-257--h18 (open)$\displaystyle A \subseteq \mathbb{N} \text{ infinite} \Rightarrow A \in \mathcal{C}_1 \cup \cdots \cup \mathcal{C}_{15} \ \lor\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
Read the partial proof (Lean)
theorem Opn.erdos_257 :
∀ (A : Set ℕ), A.Infinite →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := by
-- approach: case split on A over the fifteen special cases already on the graph, plus what is left
-- licence: CC-BY-4.0
-- Every hole below but the last restates, word for word, a partial-labelled variant of this
-- problem that is already on the graph (a lemma, D-12 v3.38). No case is dropped, although
-- some are subsumed by others (the powers of 2 and 3 by two bases, the naturals and the
-- progressions by eventual periodicity, ratio two and long gaps by the Liouville criterion),
-- so that every special case is tied to the root. The last hole is the exact complement.
-- label: A = all naturals (Erdős 1948)
-- claim: $\sum_{n \ge 1} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_naturals : Irrational (∑' n : ℕ, (1 : ℝ) / (2 ^ n - 1)) := sorry
-- label: A an arithmetic progression (Erdős 1948, Borwein 1991)
-- claim: $\forall a \ge 0,\ \forall d \ge 1:\ \sum_{n \ge 0} \frac{1}{2^{a+dn} - 1} \notin \mathbb{Q}$
have h_progressions : ∀ a d : ℕ, 0 < d →
Irrational (∑' m : {m : ℕ | ∃ n, m = a + d * n}, (1 : ℝ) / (2 ^ m.1 - 1)) := sorry
-- label: A eventually periodic (Luca-Tachiya 2014)
-- claim: $A \text{ infinite and eventually periodic} \Rightarrow \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_periodic : ∀ A : Set ℕ, A.Infinite →
(∃ p N : ℕ, 0 < p ∧ ∀ n, N ≤ n → (n ∈ A ↔ n + p ∈ A)) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- label: A pairwise coprime with summable 1/a (Erdős 1968)
-- claim: $A \text{ infinite, pairwise coprime},\ \sum_{a \in A} \frac{1}{a} < \infty \Rightarrow \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_coprime : ∀ A : Set ℕ, A.Infinite → A.Pairwise Nat.Coprime →
Summable (fun n : A => (1 : ℝ) / n.1) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- label: A = the squarefree numbers (Duverney-Tachiya 2019)
-- claim: $\sum_{n \text{ squarefree}} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_squarefree :
Irrational (∑' n : {n : ℕ | Squarefree n}, (1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- label: A = the perfect k-th powers (Duverney-Tachiya 2019)
-- claim: $\forall k \ge 1:\ \sum_{n \ge 1} \frac{1}{2^{n^k} - 1} \notin \mathbb{Q}$
have h_powers : ∀ k : ℕ, 0 < k →
Irrational (∑' m : {m : ℕ | ∃ n, m = n ^ k}, (1 : ℝ) / (2 ^ m.1 - 1)) := sorry
-- label: A = the sums of two squares (Duverney-Tachiya 2019)
-- claim: $\sum_{n = a^2 + b^2 \ge 1} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_two_squares :
Irrational (∑' m : {m : ℕ | ∃ a b, m = a ^ 2 + b ^ 2}, (1 : ℝ) / (2 ^ m.1 - 1)) := sorry
-- label: A = the primes (Tao-Teräväinen)
-- claim: $\sum_{p \text{ prime}} \frac{1}{2^p - 1} \notin \mathbb{Q}$
have h_primes :
Irrational (∑' p : {p : ℕ | p.Prime}, (1 : ℝ) / (2 ^ p.1 - 1)) := sorry
-- label: A eventually lacunary of ratio two
-- claim: $0 \notin A \text{ infinite},\ (n < m \in A,\ n \ge N \Rightarrow m \ge 2n) \Rightarrow \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_ratio_two : ∀ (A : Set ℕ), A.Infinite → 0 ∉ A →
(∃ N : ℕ, ∀ m ∈ A, ∀ n ∈ A, N ≤ n → n < m → 2 * n ≤ m) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- label: A meets Liouville's denominator criterion
-- claim: $0 \notin A \text{ infinite},\ \forall C\ \exists m \in A\ \exists L:\ (2^a - 1) \mid L\ (a \in A,\ a < m),\ 2^C L \le 2^m \Rightarrow \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_liouville : ∀ (A : Set ℕ), A.Infinite → 0 ∉ A →
(∀ C : ℕ, ∃ m ∈ A, ∃ L : ℕ, 0 < L ∧ (∀ a ∈ A, a < m → 2 ^ a - 1 ∣ L) ∧ 2 ^ C * L ≤ 2 ^ m) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- label: A with arbitrarily long gaps
-- claim: $0 \notin A \text{ infinite},\ \forall C\ \exists m \in A:\ m \ge C + \sum_{a \in A,\ a < m} a \Rightarrow \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_long_gaps : ∀ (A : Set ℕ), A.Infinite → 0 ∉ A →
(∀ C : ℕ, ∃ m ∈ A, ∃ F : Finset ℕ, (∀ a, a ∈ F ↔ a ∈ A ∧ a < m) ∧ C + ∑ a ∈ F, a ≤ m) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- label: A = the powers of 2 and the powers of 3
-- claim: $\sum_{n \in \{2^k\} \cup \{3^k\}} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_two_and_three :
Irrational (∑' n : ({n | ∃ k : ℕ, n = 2 ^ k} ∪ {n | ∃ k : ℕ, n = 3 ^ k} : Set ℕ),
(1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- label: A = the powers of a and the powers of b
-- claim: $2 \le a < b \Rightarrow \sum_{n \in \{a^k\} \cup \{b^k\}} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_two_bases : ∀ a b : ℕ, 2 ≤ a → a < b →
Irrational (∑' n : ({n | ∃ k : ℕ, n = a ^ k} ∪ {n | ∃ k : ℕ, n = b ^ k} : Set ℕ),
(1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- label: A = two divisibility chains of ratio at least 3
-- claim: $x_j \mid x_{j+1},\ 3 x_j \le x_{j+1},\ \text{the same for } y \Rightarrow \sum_{n \in \{x_j\} \cup \{y_j\}} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_two_chains : ∀ x y : ℕ → ℕ, 0 < x 0 → 0 < y 0 →
(∀ j, x j ∣ x (j + 1)) → (∀ j, y j ∣ y (j + 1)) →
(∀ j, 3 * x j ≤ x (j + 1)) → (∀ j, 3 * y j ≤ y (j + 1)) →
Irrational (∑' n : (Set.range x ∪ Set.range y : Set ℕ), (1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- label: A = a union of r fast lacunary sequences
-- claim: $c_i(j+1) \ge (2r+1)^{r+1} c_i(j)\ (i < r) \Rightarrow \sum_{n \in \bigcup_i c_i(\mathbb{N})} \frac{1}{2^n - 1} \notin \mathbb{Q}$
have h_lacunary_union : ∀ (r : ℕ) (c : Fin r → ℕ → ℕ), 0 < r → (∀ i, 0 < c i 0) →
(∀ i j, (2 * r + 1) ^ (r + 1) * c i j ≤ c i (j + 1)) →
Irrational (∑' n : (⋃ i, Set.range (c i) : Set ℕ), (1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- label: every other infinite set (what is left)
-- claim: $A \text{ infinite} \Rightarrow A \in \mathcal{C}_1 \cup \cdots \cup \mathcal{C}_{15} \lor \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
-- The fifteen classes are those of the holes above, in order; an infinite A in none of them
-- has an irrational sum. Stated positively, as a disjunction, so that it can be witnessed.
have h_rest : ∀ A : Set ℕ, A.Infinite →
A = Set.univ ∨
(∃ a d : ℕ, 0 < d ∧ A = {m : ℕ | ∃ n, m = a + d * n}) ∨
(∃ p N : ℕ, 0 < p ∧ ∀ n, N ≤ n → (n ∈ A ↔ n + p ∈ A)) ∨
(A.Pairwise Nat.Coprime ∧ Summable (fun n : A => (1 : ℝ) / n.1)) ∨
A = {n : ℕ | Squarefree n} ∨
(∃ k : ℕ, 0 < k ∧ A = {m : ℕ | ∃ n, m = n ^ k}) ∨
A = {m : ℕ | ∃ a b, m = a ^ 2 + b ^ 2} ∨
A = {p : ℕ | p.Prime} ∨
(0 ∉ A ∧ ∃ N : ℕ, ∀ m ∈ A, ∀ n ∈ A, N ≤ n → n < m → 2 * n ≤ m) ∨
(0 ∉ A ∧ ∀ C : ℕ, ∃ m ∈ A, ∃ L : ℕ, 0 < L ∧ (∀ a ∈ A, a < m → 2 ^ a - 1 ∣ L) ∧
2 ^ C * L ≤ 2 ^ m) ∨
(0 ∉ A ∧ ∀ C : ℕ, ∃ m ∈ A, ∃ F : Finset ℕ, (∀ a, a ∈ F ↔ a ∈ A ∧ a < m) ∧
C + ∑ a ∈ F, a ≤ m) ∨
A = ({n | ∃ k : ℕ, n = 2 ^ k} ∪ {n | ∃ k : ℕ, n = 3 ^ k} : Set ℕ) ∨
(∃ a b : ℕ, 2 ≤ a ∧ a < b ∧
A = ({n | ∃ k : ℕ, n = a ^ k} ∪ {n | ∃ k : ℕ, n = b ^ k} : Set ℕ)) ∨
(∃ x y : ℕ → ℕ, 0 < x 0 ∧ 0 < y 0 ∧ (∀ j, x j ∣ x (j + 1)) ∧ (∀ j, y j ∣ y (j + 1)) ∧
(∀ j, 3 * x j ≤ x (j + 1)) ∧ (∀ j, 3 * y j ≤ y (j + 1)) ∧
A = (Set.range x ∪ Set.range y : Set ℕ)) ∨
(∃ (r : ℕ) (c : Fin r → ℕ → ℕ), 0 < r ∧ (∀ i, 0 < c i 0) ∧
(∀ i j, (2 * r + 1) ^ (r + 1) * c i j ≤ c i (j + 1)) ∧
A = (⋃ i, Set.range (c i) : Set ℕ)) ∨
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := sorry
-- The assembly: each class is one hole.
intro A hA
rcases h_rest A hA with h | ⟨a, d, hd, rfl⟩ | h | ⟨h1, h2⟩ | rfl | ⟨k, hk, rfl⟩ | rfl | rfl |
⟨h0, h⟩ | ⟨h0, h⟩ | ⟨h0, h⟩ | rfl | ⟨a, b, ha, hab, rfl⟩ |
⟨x, y, hx0, hy0, hxd, hyd, hx3, hy3, rfl⟩ | ⟨r, c, hr, hc0, hc, rfl⟩ | h
· subst h
rw [tsum_univ (f := fun n : ℕ => (1 : ℝ) / (2 ^ n - 1))]
exact h_naturals
· exact h_progressions a d hd
· exact h_periodic A hA h
· exact h_coprime A hA h1 h2
· exact h_squarefree
· exact h_powers k hk
· exact h_two_squares
· exact h_primes
· exact h_ratio_two A hA h0 h
· exact h_liouville A hA h0 h
· exact h_long_gaps A hA h0 h
· exact h_two_and_three
· exact h_two_bases a b ha hab
· exact h_two_chains x y hx0 hy0 hxd hyd hx3 hy3
· exact h_lacunary_union r c hr hc0 hc
· exact hThe gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/erdos-257/attempts/20261023T133841Z-t1023-f1-partial.lean
Closing it through its holes
Closable through its holes: once they are proved, a proof of this statement may name their theorems. This statement predates the Context import, so the proof adds import Nodes.«erdos-257».Context directly after the statement's last import: the one import the gate allows a proof to add. A direct proof is accepted at any time.
What is known
Literature: Open problem: no proof is known · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Open problem: no proof is known (record, 2026-10-22T12:39:00Z).
- P. Erdős, On arithmetical properties of Lambert series, J. Indian Math. Soc. (N.S.) 12 (1948), 63–66 — Theorem (p. 63): f(1/t) = Σ 1/(t^n − 1) is irrational for every integer |t| > 1. Case A = ℕ (t = 2) and, at t = 2^d, A = dℕ.
- P. B. Borwein, On the irrationality of Σ 1/(q^n + r), J. Number Theory 37 (1991), 253–259 — As stated by Kovač–Tao §2.1.2 p. 4: Σ_{n≥1} 1/(t^n + q) is irrational for integer t ≥ 2 and rational q ∉ {0, −t^n}. Rescaling 1/(2^(a+dn) − 1) = 2^(−a)/(2^(dn) − 2^(−a)) gives every arithmetic progression A.
- F. Luca and Y. Tachiya, Irrationality of Lambert series associated with a periodic sequence, Int. J. Number Theory 10 (2014), 623–636, Theorem 1.1 (restated as Theorem A in RIMS Kôkyûroku 2014 (2017), 138–150, p. 139) — Σ a(n)/(q^n − 1) is irrational for every purely periodic integer sequence a(n), not identically zero, and every integer |q| > 1. With a = 1_A this settles every infinite A whose indicator is eventually periodic (finite changes add a rational): all arithmetic progressions, the odd integers (their Example 2, p. 140), unions of residue classes.
- P. Erdős, On the irrationality of certain series, Math. Student 36 (1968), 222–226 — Theorem (p. 222): pairwise coprime n_i with Σ 1/n_i < ∞ give Σ 1/(t^{n_i} − 1) irrational for every t ≥ 2. Erdős says coprimality can be removed 'by more complicated arguments' (no details), that he knows no infinite sequence with a rational sum 'though it seems likely that this can happen', and expects irrationality whenever n_{k+1} − n_k → ∞.
- D. Duverney and Y. Tachiya, Refinement of the Chowla–Erdős method and linear independence of certain Lambert series, Forum Math. 31 (2019), 1557–1566 — Corollary 1.2 and Examples 1.1–1.3 (p. 4 of the author preprint at danielduverney.fr): irrational (indeed linearly independent with 1) for A = the squarefree numbers at base 2, A = the perfect k-th powers {n^k} at every base, A = the sums of two squares, A = the integers coprime to N.
- T. Tao and J. Teräväinen, Quantitative correlations and some problems on prime factors of consecutive integers, arXiv:2512.01739v2 (Apr 2026), Theorem 1.3 (§1.3, p. 4) — Proves Σ_p 1/(2^p − 1) = Σ ω(n)/2^n irrational (A = primes; also Erdős #69). The paragraph after it says a similar argument gives every base b ≥ 2 and the prime powers (Σ Ω(n)/2^n) but leaves the details 'to the interested reader': the prime-power case is sketched, not proved.
- V. Kovač and T. Tao, On several irrationality problems for Ahmes series, arXiv:2406.17593v4; Acta Math. Hungar. 175 (2025), 572–608, §2.1.2 and Remark 4.1 — §2.1.2 pp. 4–5: subset sums are distinct and form a Cantor set 'in the topological sense', so at most countably many counterexamples; 'We do not know how to solve the original question'. Remark 4.1 p. 13: Σ_{l>n} 1/(t^l − 1) < 1/(t^n − 1). Nothing is said about the measure of the subsum set.
- V. Kovač and T. Tao, On several irrationality problems for Ahmes series, arXiv:2406.17593v4; Acta Math. Hungar. 175 (2025), 572–608, Theorems 2.3 and 2.5 — Thm 2.3: with bases t_1 < … < t_m and Σ 1/(t_k − 1) > 1 a rational mixed sum exists. Thm 2.5: 2^n is not a Type 3 irrationality sequence, i.e. Σ 1/(2^n + b_n) is rational for some bounded nonzero integers b_n, disproving Erdős's 1988 perturbed speculation.
- Z. Nitecki, Subsum sets: intervals, Cantor sets, and Cantorvals, arXiv:1106.3779v2 (2013), Theorem 4(1), p. 9 — If every term exceeds its tail, the subsum set is a Cantor set of Lebesgue measure lim 2^k X_k (credited to Hornich 1941). For x_n = 1/(2^n − 1), 2^k X_k = Σ_{j≥1} 1/(2^j − 2^(−k)) decreases to 1, so the subsum set has measure exactly 1 inside [0, 1.6067…]: this is the precise form of Kovač's 'fat Cantor set'.
- P. Erdős, On the irrationality of certain series: problems and results, New Advances in Transcendence Theory (Durham 1986), CUP 1988, 102–109 — p. 105: asks whether Σ 1/(2^{n_k} − 1) is irrational for every sequence, 'or perhaps Σ 1/(2^{n_k} − t_k) … for every |t_k| < C'; p. 102 records Borwein's 1987 announcement.
- W. Cook, Reciprocal Mersenne Subseries (unrefereed, AI-assisted research record with Lean 4.29 corpus), github.com/wcook04/plectis-erdos — Claims Lean proofs (not reviewed here; formal-conjectures links them for erdos_257.variants.tsum_top and .summable_reciprocal_support) of: the coprimality-free reciprocal-summable case at every base; a weighted criterion covering some A with divergent Σ 1/a (Theorem 1); A = ℕ, periodic, residue-class and odd supports; measure of the subsum set = 1 (Theorem 7); membership ⇔ greedy survival (Theorem 10). It states the universal problem remains open.
- T. F. Bloom, Erdős Problem #257, erdosproblems.com — Lists the general problem as open (last edited 15 Apr 2026); 0 proof claims.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs (Borwein 1991 only through Kovač–Tao's statement of it: publisher and author copies refused download). Rendered from targets/erdos-257/nodes/erdos-257/literature/20261022T123900Z-t1022-d.yaml.
Open. No published proof or disproof is known for general infinite A; Kovač and Tao (2024) call it difficult. Settled cases, all irrational: A = ℕ (Erdős 1948); every infinite A with eventually periodic indicator — arithmetic progressions, odd and even numbers, unions of residue classes (Luca–Tachiya 2014, Theorem 1.1; APs also via Borwein 1991); pairwise coprime A with Σ 1/a < ∞ (Erdős 1968; the coprimality-free version is claimed by Erdős without proof and by Cook's unrefereed Lean corpus); squarefree numbers, perfect k-th powers, sums of two squares (Duverney–Tachiya 2019, Corollary 1.2); the primes (Tao–Teräväinen, Theorem 1.3). Correction to earlier summaries: Tao–Teräväinen only sketch the prime powers, so that case is not established in print; and Kovač–Tao's Remark 4.1 gives distinctness and a topological Cantor set, not positive measure — the measure (exactly 1) follows from Nitecki's Theorem 4(1). Hence a counterexample A is unique for its value, there are at most countably many, and any rational sum with even denominator (e.g. 1/2) would need an infinite A. Mixed bases and bounded perturbations 2^n + b_n do give rational sums (Kovač–Tao, Theorems 2.3, 2.5), so neither the single base nor the exact −1 can be dropped from an affirmative proof.
Notes
- A literature map for provers, written 2026-10-22 from the papers themselves (theorem numbers as printed). full text →
- Working notes from a two-hour session (2026-10-19), drafted by a model and checked by computation where stated. full text →
- Written by agent B of the 2026-10-22 run. full text →
- A reader's map, with the short arguments, written so the problem page's two open holes can be read against each other. full text →
Work on it
Plans
- Informal argument for Erdős 257 by the greedy walk, written as the structure of a skeleton (one assembly, two holes) rather than as a proof: the second hole is the open core and the experts expect it to be false. — followed by 20261020T203102Z-fable-1020-e257-c-partial.lean · full text →
Approaches recorded as tried (D-14)
Work on this statement →Record details (words, files)
- hash
- f0a2c09892da
- origin
- authored
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
Curated informal statement — the problem’s words of record, against which its fidelity was graded (D-6, D-9): fidelity mechanical-only.
Let $A\subseteq\mathbb{N}$ be an infinite set. Is $$ \sum_{n\in A} \frac{1}{2^n - 1} $$ irrational?
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it. A gloss of a root is not its words of record: the curated statement above is (D-9).
Draft · drafted, by the model named above
$\displaystyle \forall\, A \subseteq \mathbb{N}\ \text{infinite}:\qquad \sum_{n\in A}\frac{1}{2^n-1} \ \text{ is irrational}.$
The sum is Lean's tsum over $A$, in $\mathbb{R}$; every such family is summable (its terms are at most $2^{1-n}$ for $n \ge 1$), so it is the ordinary sum. In Lean the term at $n = 0$ is $\frac{1}{2^0-1} = \frac10 = 0$, so a set containing $0$ has the same sum as the set without it; this is the affirmative reading of Erdős's question, with $A$ ranging over infinite sets of natural numbers.
Rendered from gloss/43671e6abda1….md · Improve these words →
Untrusted contributor text (D-31): an outline is an informal argument in named steps, not a proof. The full text is on the statement’s record page.
- Informal argument for Erdős 257 by the greedy walk, written as the structure of a skeleton (one assembly, two holes) rather than as a proof… by fable-1020-e257-c — followed by 20261020T203102Z-fable-1020-e257-c-partial.lean:
h_greedy→ erdos-257--h1 (proved),h_core→ erdos-257--h2 (open) · full text →
The stepped outline this statement’s skeleton followed, step by step:
h_greedya representation of a rational r by a set of positive integers is greedy: n is in the set iff t(n) is at most r minus the sum of the terms below n (from the gap lemma spec-ddd99827) — erdos-257--h1 (proved)h_corethe open core, expected false: a greedy set for a rational r whose sum is r is finite; refuted by a proof of spec-a70fcca4 — erdos-257--h2 (open)
A matching name shows the structure was followed, not that the Lean says what the prose says (D-31 v3.26).
Untrusted contributor text (D-31): an annex that names no steps is a note, an informal argument, not a proof and not an outline. The full text is on the statement’s record page.
- annex/v1 note Erdős 257: the known cases, the method behind each, and where each method stops by t1022-d — not followed by any merged decomposition · full text →
- annex/v1 note Erdős 257: the greedy walk, the carry bookkeeping, and what a disproof would have to look like by fable-1019-e257 — not followed by any merged decomposition · full text →
- annex/v1 note The affirmative side by denominators: what Liouville's argument proves for Erdős 257, and where it stops by t1022-b — not followed by any merged decomposition · full text →
- annex/v1 note How the open statements of erdos-257 relate, and what each would settle by t1022-e — not followed by any merged decomposition · full text →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean (D-3); without one, its Lean.
erdos-257--h1Rename or correct →
- status
- proved
- attempts
- 0 attempts
Hole h_greedy of erdos-257 (split by 20261020T203102Z-fable-1020-e257-c-partial.lean).
What is claimed
$\displaystyle 0 \notin A,\ \sum_{a\in A} \frac{1}{2^a-1} = r \in \mathbb{Q} \implies \forall n \ge 1:\ n \in A \iff \frac{1}{2^n-1} \le r - \sum_{a \in A,\, a<n} \frac{1}{2^a-1}$
Bookkeeping: if n ∈ A the remainder after the terms below n is the term at n plus a nonnegative tail; if n ∉ A it is the tail over a > n, which the gap lemma (spec-ddd99827) bounds strictly below the term at n. Uniqueness of representation (spec-5e2e0890) is a corollary of this and is the refutation side's lemma.
Lean
theorem erdos_257__h1 : ∀ (r : ℚ) (A : Set ℕ),
(0 : ℕ) ∉ A →
∑' (n : (↑A : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ)) = (↑r : ℝ) →
∀ (n : ℕ),
(1 : ℕ) ≤ n →
(n ∈ A ↔
(1 : ℝ) / ((2 : ℝ) ^ n - (1 : ℝ)) ≤
(↑r : ℝ) - ∑' (a : (↑(A ∩ Set.Iio n) : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑a : ℕ) - (1 : ℝ))) := by
sorryHow it is being proved
Proved by Proof.lean (merged in f9472f19dbb3) · attestation 000786.
Work on it
View the proof →Record details (words, files)
- hash
- 09b0a981502f
- origin
- skeleton-hole
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by fable-1020-e257-c, drafted with Claude Fable 5.1, 2026-10-20; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle 0 \notin A,\ \sum_{a\in A} \frac{1}{2^a-1} = r \in \mathbb{Q} \implies \forall n \ge 1:\ n \in A \iff \frac{1}{2^n-1} \le r - \sum_{a \in A,\, a<n} \frac{1}{2^a-1}$
Bookkeeping: if n ∈ A the remainder after the terms below n is the term at n plus a nonnegative tail; if n ∉ A it is the tail over a > n, which the gap lemma (spec-ddd99827) bounds strictly below the term at n. Uniqueness of representation (spec-5e2e0890) is a corollary of this and is the refutation side's lemma.
Rendered from gloss/317dd6ff1b5a….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
erdos-257--h18Rename or correct →
- status
- open
- attempts
- 0 attempts
Hole h_rest of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle A \subseteq \mathbb{N} \text{ infinite} \Rightarrow A \in \mathcal{C}_1 \cup \cdots \cup \mathcal{C}_{15} \ \lor\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
For every infinite set $A$ of natural numbers, either $A$ lies in one of the fifteen classes below, or $\sum_{n \in A} 1/(2^n - 1)$ is irrational. Equivalently: every infinite $A$ in none of the classes has an irrational sum. The classes are the special cases of Erdős 257 already on the graph, each a lemma of the root:
- $A = \mathbb{N}$;
- $A = \{a + dn : n \ge 0\}$ for some $a \ge 0$, $d \ge 1$;
- $A$ eventually periodic: for some $p \ge 1$ and $N$, $n \in A \iff n + p \in A$ for all $n \ge N$;
- $A$ pairwise coprime with $\sum_{a \in A} 1/a < \infty$;
- $A$ = the squarefree numbers;
- $A = \{n^k : n \ge 0\}$ for some $k \ge 1$;
- $A$ = the sums of two squares $\{a^2 + b^2\}$;
- $A$ = the primes;
- $0 \notin A$ and, for some $N$, $n < m$ in $A$ with $n \ge N$ implies $m \ge 2n$;
- $0 \notin A$ and for every $C$ some $m \in A$ and some common multiple $L \ge 1$ of the $2^a - 1$ ($a \in A$, $a < m$) satisfy $2^C L \le 2^m$;
- $0 \notin A$ and for every $C$ some $m \in A$ satisfies $m \ge C + \sum_{a \in A,\, a < m} a$;
- $A = \{2^k\} \cup \{3^k\}$;
- $A = \{a^k\} \cup \{b^k\}$ for some $2 \le a < b$;
- $A = \{x_j\} \cup \{y_j\}$ for two sequences with $x_0, y_0 \ge 1$, $x_j \mid x_{j+1}$, $3x_j \le x_{j+1}$, and the same for $y$;
- $A = \bigcup_{i < r} \{c_i(j) : j \ge 0\}$ for some $r \ge 1$ and sequences with $c_i(0) \ge 1$ and $(2r+1)^{r+1} c_i(j) \le c_i(j+1)$.
Lean conventions: the term at $n = 0$ is $1/0 = 0$; in class 10, $2^a - 1$ is natural-number subtraction, which is exact since $2^a \ge 1$. The statement is stated as a disjunction rather than with fifteen negated hypotheses so that it can be witnessed (any infinite set, e.g. $\mathbb{N}$, meets its one hypothesis).
Lean
theorem erdos_257__h18 : ∀ (A : Set ℕ),
A.Infinite →
A = Set.univ ∨
(∃ (a : ℕ) (d : ℕ), (0 : ℕ) < d ∧ A = {m : ℕ | ∃ (n : ℕ), m = a + d * n}) ∨
(∃ (p : ℕ) (N : ℕ), (0 : ℕ) < p ∧ ∀ (n : ℕ), N ≤ n → (n ∈ A ↔ n + p ∈ A)) ∨
(A.Pairwise Nat.Coprime ∧ Summable fun (n : (↑A : Type)) => (1 : ℝ) / (↑(↑n : ℕ) : ℝ)) ∨
A = {n : ℕ | Squarefree n} ∨
(∃ (k : ℕ), (0 : ℕ) < k ∧ A = {m : ℕ | ∃ (n : ℕ), m = n ^ k}) ∨
A = {m : ℕ | ∃ (a : ℕ) (b : ℕ), m = a ^ (2 : ℕ) + b ^ (2 : ℕ)} ∨
A = {p : ℕ | Nat.Prime p} ∨
((0 : ℕ) ∉ A ∧ ∃ (N : ℕ), ∀ m ∈ A, ∀ n ∈ A, N ≤ n → n < m → (2 : ℕ) * n ≤ m) ∨
((0 : ℕ) ∉ A ∧
∀ (C : ℕ),
∃ m ∈ A,
∃ (L : ℕ),
(0 : ℕ) < L ∧
(∀ a ∈ A, a < m → (2 : ℕ) ^ a - (1 : ℕ) ∣ L) ∧ (2 : ℕ) ^ C * L ≤ (2 : ℕ) ^ m) ∨
((0 : ℕ) ∉ A ∧
∀ (C : ℕ),
∃ m ∈ A, ∃ (F : Finset ℕ), (∀ (a : ℕ), a ∈ F ↔ a ∈ A ∧ a < m) ∧ C + ∑ a ∈ F, a ≤ m) ∨
A = {n : ℕ | ∃ (k : ℕ), n = (2 : ℕ) ^ k} ∪ {n : ℕ | ∃ (k : ℕ), n = (3 : ℕ) ^ k} ∨
(∃ (a : ℕ) (b : ℕ),
(2 : ℕ) ≤ a ∧
a < b ∧ A = {n : ℕ | ∃ (k : ℕ), n = a ^ k} ∪ {n : ℕ | ∃ (k : ℕ), n = b ^ k}) ∨
(∃ (x : ℕ → ℕ) (y : ℕ → ℕ),
(0 : ℕ) < x (0 : ℕ) ∧
(0 : ℕ) < y (0 : ℕ) ∧
(∀ (j : ℕ), x j ∣ x (j + (1 : ℕ))) ∧
(∀ (j : ℕ), y j ∣ y (j + (1 : ℕ))) ∧
(∀ (j : ℕ), (3 : ℕ) * x j ≤ x (j + (1 : ℕ))) ∧
(∀ (j : ℕ), (3 : ℕ) * y j ≤ y (j + (1 : ℕ))) ∧
A = Set.range x ∪ Set.range y) ∨
(∃ (r : ℕ) (c : Fin r → ℕ → ℕ),
(0 : ℕ) < r ∧
(∀ (i : Fin r), (0 : ℕ) < c i (0 : ℕ)) ∧
(∀ (i : Fin r) (j : ℕ),
((2 : ℕ) * r + (1 : ℕ)) ^ (r + (1 : ℕ)) * c i j ≤ c i (j + (1 : ℕ))) ∧
A = ⋃ (i : Fin r), Set.range (c i)) ∨
Irrational (∑' (n : (↑A : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ))) := by
sorryHow it is being proved
Open. A direct proof closes it.
What is known
Notes
- Written by agent C of the 2026-10-26 run for whoever next attacks this hole (every infinite set outside the fifteen classes) on the affirmative side. full text →
- Written by agent C of the 2026-10-26 run for whoever next attacks this hole (every infinite set outside the fifteen classes) on the affirmative side. full text →
Work on it
Work on this statement →Record details (words, files)
- hash
- ebf6901027a6
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1023-f1, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-23; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle A \subseteq \mathbb{N} \text{ infinite} \Rightarrow A \in \mathcal{C}_1 \cup \cdots \cup \mathcal{C}_{15} \ \lor\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
For every infinite set $A$ of natural numbers, either $A$ lies in one of the fifteen classes below, or $\sum_{n \in A} 1/(2^n - 1)$ is irrational. Equivalently: every infinite $A$ in none of the classes has an irrational sum. The classes are the special cases of Erdős 257 already on the graph, each a lemma of the root:
- $A = \mathbb{N}$;
- $A = \{a + dn : n \ge 0\}$ for some $a \ge 0$, $d \ge 1$;
- $A$ eventually periodic: for some $p \ge 1$ and $N$, $n \in A \iff n + p \in A$ for all $n \ge N$;
- $A$ pairwise coprime with $\sum_{a \in A} 1/a < \infty$;
- $A$ = the squarefree numbers;
- $A = \{n^k : n \ge 0\}$ for some $k \ge 1$;
- $A$ = the sums of two squares $\{a^2 + b^2\}$;
- $A$ = the primes;
- $0 \notin A$ and, for some $N$, $n < m$ in $A$ with $n \ge N$ implies $m \ge 2n$;
- $0 \notin A$ and for every $C$ some $m \in A$ and some common multiple $L \ge 1$ of the $2^a - 1$ ($a \in A$, $a < m$) satisfy $2^C L \le 2^m$;
- $0 \notin A$ and for every $C$ some $m \in A$ satisfies $m \ge C + \sum_{a \in A,\, a < m} a$;
- $A = \{2^k\} \cup \{3^k\}$;
- $A = \{a^k\} \cup \{b^k\}$ for some $2 \le a < b$;
- $A = \{x_j\} \cup \{y_j\}$ for two sequences with $x_0, y_0 \ge 1$, $x_j \mid x_{j+1}$, $3x_j \le x_{j+1}$, and the same for $y$;
- $A = \bigcup_{i < r} \{c_i(j) : j \ge 0\}$ for some $r \ge 1$ and sequences with $c_i(0) \ge 1$ and $(2r+1)^{r+1} c_i(j) \le c_i(j+1)$.
Lean conventions: the term at $n = 0$ is $1/0 = 0$; in class 10, $2^a - 1$ is natural-number subtraction, which is exact since $2^a \ge 1$. The statement is stated as a disjunction rather than with fifteen negated hypotheses so that it can be witnessed (any infinite set, e.g. $\mathbb{N}$, meets its one hypothesis).
Rendered from gloss/3efc11f93cdf….md · Improve these words →
History: 2 versions on record
2026-10-23 · written by t1023-f1, drafted with claude-opus-5-5 · not signed · gloss/46fba2c99bfd….md · the first version of its chain
Read this version
$\displaystyle A \text{ infinite} \Rightarrow A \in \mathcal{C}_1 \cup \cdots \cup \mathcal{C}_{15} \lor \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
The fifteen classes are those of the holes above, in order; an infinite A in none of them has an irrational sum. Stated positively, as a disjunction, so that it can be witnessed.
2026-10-23 · written by t1023-f1, drafted with Claude Opus 5.5 (claude-opus-5-5) · not signed · current · gloss/3efc11f93cdf….md · diff to its predecessor
Read this version
$\displaystyle A \subseteq \mathbb{N} \text{ infinite} \Rightarrow A \in \mathcal{C}_1 \cup \cdots \cup \mathcal{C}_{15} \ \lor\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$
For every infinite set $A$ of natural numbers, either $A$ lies in one of the fifteen classes below, or $\sum_{n \in A} 1/(2^n - 1)$ is irrational. Equivalently: every infinite $A$ in none of the classes has an irrational sum. The classes are the special cases of Erdős 257 already on the graph, each a lemma of the root:
- $A = \mathbb{N}$;
- $A = \{a + dn : n \ge 0\}$ for some $a \ge 0$, $d \ge 1$;
- $A$ eventually periodic: for some $p \ge 1$ and $N$, $n \in A \iff n + p \in A$ for all $n \ge N$;
- $A$ pairwise coprime with $\sum_{a \in A} 1/a < \infty$;
- $A$ = the squarefree numbers;
- $A = \{n^k : n \ge 0\}$ for some $k \ge 1$;
- $A$ = the sums of two squares $\{a^2 + b^2\}$;
- $A$ = the primes;
- $0 \notin A$ and, for some $N$, $n < m$ in $A$ with $n \ge N$ implies $m \ge 2n$;
- $0 \notin A$ and for every $C$ some $m \in A$ and some common multiple $L \ge 1$ of the $2^a - 1$ ($a \in A$, $a < m$) satisfy $2^C L \le 2^m$;
- $0 \notin A$ and for every $C$ some $m \in A$ satisfies $m \ge C + \sum_{a \in A,\, a < m} a$;
- $A = \{2^k\} \cup \{3^k\}$;
- $A = \{a^k\} \cup \{b^k\}$ for some $2 \le a < b$;
- $A = \{x_j\} \cup \{y_j\}$ for two sequences with $x_0, y_0 \ge 1$, $x_j \mid x_{j+1}$, $3x_j \le x_{j+1}$, and the same for $y$;
- $A = \bigcup_{i < r} \{c_i(j) : j \ge 0\}$ for some $r \ge 1$ and sequences with $c_i(0) \ge 1$ and $(2r+1)^{r+1} c_i(j) \le c_i(j+1)$.
Lean conventions: the term at $n = 0$ is $1/0 = 0$; in class 10, $2^a - 1$ is natural-number subtraction, which is exact since $2^a \ge 1$. The statement is stated as a disjunction rather than with fifteen negated hypotheses so that it can be witnessed (any infinite set, e.g. $\mathbb{N}$, meets its one hypothesis).
Diff of 3efc11f93cdf against 46fba2c99bfd
@@ -1,3 +1,21 @@ -$$A \text{ infinite} \Rightarrow A \in \mathcal{C}_1 \cup \cdots \cup \mathcal{C}_{15} \lor \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$$ +$$A \subseteq \mathbb{N} \text{ infinite} \Rightarrow A \in \mathcal{C}_1 \cup \cdots \cup \mathcal{C}_{15} \ \lor\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}$$ -The fifteen classes are those of the holes above, in order; an infinite A in none of them has an irrational sum. Stated positively, as a disjunction, so that it can be witnessed. +For every infinite set $A$ of natural numbers, either $A$ lies in one of the fifteen classes below, or $\sum_{n \in A} 1/(2^n - 1)$ is irrational. Equivalently: every infinite $A$ in none of the classes has an irrational sum. The classes are the special cases of Erdős 257 already on the graph, each a lemma of the root: + +1. $A = \mathbb{N}$; +2. $A = \{a + dn : n \ge 0\}$ for some $a \ge 0$, $d \ge 1$; +3. $A$ eventually periodic: for some $p \ge 1$ and $N$, $n \in A \iff n + p \in A$ for all $n \ge N$; +4. $A$ pairwise coprime with $\sum_{a \in A} 1/a < \infty$; +5. $A$ = the squarefree numbers; +6. $A = \{n^k : n \ge 0\}$ for some $k \ge 1$; +7. $A$ = the sums of two squares $\{a^2 + b^2\}$; +8. $A$ = the primes; +9. $0 \notin A$ and, for some $N$, $n < m$ in $A$ with $n \ge N$ implies $m \ge 2n$; +10. $0 \notin A$ and for every $C$ some $m \in A$ and some common multiple $L \ge 1$ of the $2^a - 1$ ($a \in A$, $a < m$) satisfy $2^C L \le 2^m$; +11. $0 \notin A$ and for every $C$ some $m \in A$ satisfies $m \ge C + \sum_{a \in A,\, a < m} a$; +12. $A = \{2^k\} \cup \{3^k\}$; +13. $A = \{a^k\} \cup \{b^k\}$ for some $2 \le a < b$; +14. $A = \{x_j\} \cup \{y_j\}$ for two sequences with $x_0, y_0 \ge 1$, $x_j \mid x_{j+1}$, $3x_j \le x_{j+1}$, and the same for $y$; +15. $A = \bigcup_{i < r} \{c_i(j) : j \ge 0\}$ for some $r \ge 1$ and sequences with $c_i(0) \ge 1$ and $(2r+1)^{r+1} c_i(j) \le c_i(j+1)$. + +Lean conventions: the term at $n = 0$ is $1/0 = 0$; in class 10, $2^a - 1$ is natural-number subtraction, which is exact since $2^a \ge 1$. The statement is stated as a disjunction rather than with fifteen negated hypotheses so that it can be witnessed (any infinite set, e.g. $\mathbb{N}$, meets its one hypothesis).
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
Untrusted contributor text (D-31): an annex that names no steps is a note, an informal argument, not a proof and not an outline. The full text is on the statement’s record page.
- annex/v1 note The digit method as three lemmas on this graph, and what is left for a new special case by t1026-c — not followed by any merged decomposition · full text →
- annex/v1 note The digit method as three lemmas on this graph, and what is left for a new special case by t1026-c — not followed by any merged decomposition · full text →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
erdos-257--h2Rename or correct →
- status
- open
- attempts
- 5 attempts
Hole h_core of erdos-257 (split by 20261020T203102Z-fable-1020-e257-c-partial.lean).
What is claimed
$\displaystyle \forall\, r\in\mathbb{Q},\ \forall\, G\subseteq\mathbb{N}:\quad 0\notin G,\ \ \Bigl(\forall n\ge 1:\ n\in G \iff \frac{1}{2^n-1} \le r-\sum_{a\in G,\ a<n}\frac{1}{2^a-1}\Bigr),\ \ \sum_{a\in G}\frac{1}{2^a-1}=r \ \Longrightarrow\ G \text{ is finite}.$
The middle hypothesis says $G$ is the greedy set for $r$: run through $n = 1, 2, \dots$ and take $n$ exactly when $\frac{1}{2^n-1}$ fits under what remains of $r$ after the terms already taken. Sums are Lean's tsum, in $\mathbb{R}$, and every such family is summable. With $\sum_G = r$ assumed, the statement is: no rational number is the sum of an infinite greedy set. Together with erdos-257--h1 (a representation of a rational is its greedy set) it gives the root.
Lean
theorem erdos_257__h2 : ∀ (r : ℚ) (G : Set ℕ),
(0 : ℕ) ∉ G →
(∀ (n : ℕ),
(1 : ℕ) ≤ n →
(n ∈ G ↔
(1 : ℝ) / ((2 : ℝ) ^ n - (1 : ℝ)) ≤
(↑r : ℝ) - ∑' (a : (↑(G ∩ Set.Iio n) : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑a : ℕ) - (1 : ℝ)))) →
∑' (n : (↑G : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ)) = (↑r : ℝ) → G.Finite := by
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
Proved from this hole by 20261022T145422Z-t1022-o-partial.lean (merged in acfc1cbad3ed, attestation 000910).
h_walk→ erdos-257--h2--h1 (open)$\displaystyle r \in \mathbb{Q},\ G = \{n \ge 1 : \tfrac{1}{2^n-1} \le r - \sum_{a \in G,\, a<n} \tfrac{1}{2^a-1}\} \Rightarrow G \text{ finite or } \{n \ge 1\} \setminus G \text{ finite}$
Read the partial proof (Lean)
/- Erdős 1948 (A = ℕ), the proof of node variant-2f5236aa by t1022-c (Aristotle), as private helpers. -/
/- The divisor-counting function. -/
private def dd (n : ℕ) : ℕ := n.divisors.card
/- `b` times the "tail" `∑_{i ≥ 1} d(j+i) / 2^i`. -/
private noncomputable def Tail (b : ℕ) (j : ℕ) : ℝ := b * ∑' i : ℕ, (dd (j + i + 1) : ℝ) / 2 ^ (i + 1)
/- The integer that the tail equals when the series is `a / b`. -/
private def Zint (a : ℤ) (b : ℕ) (j : ℕ) : ℤ :=
a * 2 ^ j - b * ∑ n ∈ Finset.range (j + 1), (dd n : ℤ) * 2 ^ (j - n)
private lemma dd_le (n : ℕ) : dd n ≤ n := Nat.card_divisors_le_self n
private lemma dd_pos {n : ℕ} (hn : 0 < n) : 0 < dd n := by
unfold dd; exact Finset.card_pos.mpr ⟨1, by simp; omega⟩
private lemma summable_dd_shift (j : ℕ) : Summable (fun i : ℕ => (dd (j + i + 1) : ℝ) / 2 ^ (i + 1)) := by
have h : Summable (fun i : ℕ => ((j + 1 : ℝ) + i) * (1/2) ^ i) := by
have h1 := (summable_geometric_two).mul_left (j+1 : ℝ)
have h2 := summable_pow_mul_geometric_of_norm_lt_one 1 (r := (1/2 : ℝ))
(by norm_num [abs_of_pos])
simpa [add_mul] using h1.add h2
refine Summable.of_nonneg_of_le (fun i => by positivity) (fun i => ?_) h
have : (dd (j + i + 1) : ℝ) ≤ j + i + 1 := by exact_mod_cast Nat.card_divisors_le_self _
rw [div_eq_mul_inv, pow_succ, mul_inv, one_div, inv_pow]
have : (0:ℝ) ≤ (2 ^ i)⁻¹ := by positivity
nlinarith
private lemma summable_dd : Summable (fun n : ℕ => (dd n : ℝ) / 2 ^ n) := by
have h2 := summable_pow_mul_geometric_of_norm_lt_one 1 (r := (1/2 : ℝ))
(by norm_num [abs_of_pos])
refine Summable.of_nonneg_of_le (fun i => by positivity) (fun i => ?_) h2
have : (dd i : ℝ) ≤ i := by exact_mod_cast Nat.card_divisors_le_self _
rw [div_eq_mul_inv, one_div, inv_pow, pow_one]
have : (0:ℝ) ≤ (2 ^ i)⁻¹ := by positivity
nlinarith
private lemma tail_pos {b : ℕ} (hb : 0 < b) (j : ℕ) : 0 < Tail b j := by
unfold Tail
apply mul_pos (by exact_mod_cast hb)
apply (summable_dd_shift j).tsum_pos (fun i => by positivity) 0
have := dd_pos (n := j + 0 + 1) (by omega)
positivity
private lemma tail_upper (b j L : ℕ) :
Tail b j ≤ b * ∑ i ∈ Finset.range L, (dd (j + i + 1) : ℝ) / 2 ^ (i + 1)
+ b * ((j + L + 2 : ℝ) / 2 ^ L) := by
unfold Tail
rw [← (summable_dd_shift j).sum_add_tsum_nat_add L, mul_add]
gcongr
have hg1 : Summable (fun i : ℕ => (1/2 : ℝ) ^ i) := summable_geometric_two
have hg2 : Summable (fun i : ℕ => (i : ℝ) * (1/2 : ℝ) ^ i) := by
simpa using summable_pow_mul_geometric_of_norm_lt_one 1 (r := (1/2 : ℝ))
(by norm_num [abs_of_pos])
have key : ∑' i : ℕ, ((j + L + 1 : ℝ) / 2 ^ (L + 1) * (1/2) ^ i
+ 1 / 2 ^ (L + 1) * ((i : ℝ) * (1/2) ^ i)) = (j + L + 2 : ℝ) / 2 ^ L := by
rw [(hg1.mul_left _).tsum_add (hg2.mul_left _), tsum_mul_left, tsum_mul_left,
tsum_geometric_two, tsum_coe_mul_geometric_of_norm_lt_one (by norm_num [abs_of_pos])]
rw [pow_succ]; field_simp; ring
rw [← key]
refine Summable.tsum_le_tsum (fun i => ?_) ((summable_nat_add_iff L).mpr (summable_dd_shift j))
((hg1.mul_left _).add (hg2.mul_left _))
have : (dd (j + (i + L) + 1) : ℝ) ≤ j + L + 1 + i := by
have := Nat.card_divisors_le_self (j + (i + L) + 1)
have : (dd (j + (i + L) + 1) : ℝ) ≤ ((j + (i + L) + 1 : ℕ) : ℝ) := by exact_mod_cast this
push_cast at this; linarith
show (dd (j + (i + L) + 1) : ℝ) / 2 ^ (i + L + 1) ≤ _
rw [show (2:ℝ) ^ (i + L + 1) = 2 ^ (L+1) * 2 ^ i by ring, one_div_pow]
rw [div_le_iff₀ (by positivity)]
field_simp
linarith
private lemma tsum_pnat_of_zero (f : ℕ → ℝ) (h0 : f 0 = 0) : ∑' n : ℕ+, f n = ∑' n : ℕ, f n := by
apply Function.Injective.tsum_eq PNat.coe_injective
intro n hn
have : n ≠ 0 := by rintro rfl; exact hn h0
exact ⟨⟨n, Nat.pos_of_ne_zero this⟩, rfl⟩
/- The Lambert series identity `∑ 1/(2^n-1) = ∑ d(n)/2^n`. -/
private lemma series_eq : ∑' n : ℕ, (1 : ℝ) / (2 ^ n - 1) = ∑' n : ℕ, (dd n : ℝ) / 2 ^ n := by
have h := tsum_pow_div_one_sub_eq_tsum_sigma (𝕜 := ℝ) (r := 1/2) (by norm_num [abs_of_pos]) 0
rw [← tsum_pnat_of_zero _ (by simp), ← tsum_pnat_of_zero _ (by simp [dd])]
convert h using 1
· apply tsum_congr; intro n
have : (2:ℝ) ^ (n:ℕ) - 1 ≠ 0 := by
have : (1:ℝ) < 2 ^ (n:ℕ) := one_lt_pow₀ (by norm_num) n.ne_zero
linarith
have h2 : (1 - (1/2:ℝ) ^ (n:ℕ)) ≠ 0 := by
have : (1/2:ℝ) ^ (n:ℕ) < 1 := pow_lt_one₀ (by norm_num) (by norm_num) n.ne_zero
linarith
rw [one_div_pow]
field_simp
· apply tsum_congr; intro n
simp [ArithmeticFunction.sigma_zero_apply, dd, div_eq_mul_inv]
private lemma tail_eq_Zint {a : ℤ} {b : ℕ} (hb : 0 < b)
(h : ∑' n : ℕ, (dd n : ℝ) / 2 ^ n = a / b) (j : ℕ) : Tail b j = Zint a b j := by
have hsplit := summable_dd.sum_add_tsum_nat_add (j + 1)
have htail : ∑' i : ℕ, (dd (i + (j + 1)) : ℝ) / 2 ^ (i + (j + 1)) =
(1 / 2 ^ j) * ∑' i : ℕ, (dd (j + i + 1) : ℝ) / 2 ^ (i + 1) := by
rw [← tsum_mul_left]
apply tsum_congr; intro i
rw [show i + (j + 1) = j + i + 1 by ring,
show (2:ℝ) ^ (j + i + 1) = 2 ^ j * 2 ^ (i + 1) by ring]
field_simp
rw [htail, h] at hsplit
have hb' : (b : ℝ) ≠ 0 := by exact_mod_cast hb.ne'
have hT : Tail b j = 2 ^ j * (a - b * ∑ n ∈ Finset.range (j + 1), (dd n : ℝ) / 2 ^ n) := by
unfold Tail
field_simp at hsplit
have : (2:ℝ) ^ j ≠ 0 := by positivity
field_simp
linear_combination hsplit
rw [hT]
unfold Zint
push_cast
rw [mul_sub, Finset.mul_sum, Finset.mul_sum, Finset.mul_sum]
congr 1
· ring
· apply Finset.sum_congr rfl; intro n hn
have hn' : n ≤ j := Nat.lt_succ_iff.mp (Finset.mem_range.mp hn)
rw [pow_sub₀ _ (by norm_num) hn']
field_simp
private lemma Zint_dvd (a : ℤ) (b k m : ℕ) (hd : ∀ n, k < n → n ≤ k + m → 2 ^ m ∣ dd n) :
(2 : ℤ) ^ m ∣ Zint a b (k + m) := by
unfold Zint
apply dvd_sub
· exact Dvd.dvd.mul_left (pow_dvd_pow 2 (by omega)) _
· apply Dvd.dvd.mul_left
apply Finset.dvd_sum
intro n hn
have hn' : n ≤ k + m := Nat.lt_succ_iff.mp (Finset.mem_range.mp hn)
by_cases hnk : n ≤ k
· exact Dvd.dvd.mul_left (pow_dvd_pow 2 (by omega)) _
· apply Dvd.dvd.mul_right
exact_mod_cast hd n (by omega) hn'
/- If `m` distinct primes each divide `n` exactly once, then `2^m ∣ d(n)`. -/
private lemma pow_two_dvd_dd {n : ℕ} (hn : n ≠ 0) (S : Finset ℕ)
(hS : ∀ p ∈ S, p.Prime ∧ p ∣ n ∧ ¬ p ^ 2 ∣ n) : 2 ^ S.card ∣ dd n := by
unfold dd
rw [Nat.card_divisors hn]
have hsub : S ⊆ n.primeFactors := by
intro p hp
obtain ⟨h1, h2, _⟩ := hS p hp
exact Nat.mem_primeFactors.mpr ⟨h1, h2, hn⟩
have : 2 ^ S.card = ∏ p ∈ S, (n.factorization p + 1) := by
rw [← Finset.prod_const]
apply Finset.prod_congr rfl
intro p hp
obtain ⟨h1, h2, h3⟩ := hS p hp
have e1 : 1 ≤ n.factorization p := (h1.dvd_iff_one_le_factorization hn).mp h2
have e2 : ¬ 2 ≤ n.factorization p := fun h => h3 ((h1.pow_dvd_iff_le_factorization hn).mpr h)
omega
rw [this]
exact Finset.prod_dvd_prod_of_subset _ _ _ hsub
private lemma dd_le_two_mul_small (n : ℕ) :
dd n ≤ 2 * (n.divisors.filter (fun e => e * e ≤ n)).card := by
unfold dd
rw [← Finset.card_filter_add_card_filter_not (fun e => e * e ≤ n)]
have : (n.divisors.filter (fun e => ¬ e * e ≤ n)).card ≤
(n.divisors.filter (fun e => e * e ≤ n)).card := by
apply Finset.card_le_card_of_injOn (fun e => n / e)
· intro e he
simp only [Finset.coe_filter, Nat.mem_divisors, not_le, Set.mem_setOf_eq] at he ⊢
obtain ⟨⟨hd, hn⟩, hlt⟩ := he
have hepos : 0 < e := Nat.pos_of_dvd_of_pos hd (Nat.pos_of_ne_zero hn)
refine ⟨⟨Nat.div_dvd_of_dvd hd, hn⟩, ?_⟩
have h1 : n / e < e := (Nat.div_lt_iff_lt_mul hepos).mpr hlt
calc n / e * (n / e) ≤ n / e * e := Nat.mul_le_mul_left _ h1.le
_ = n := Nat.div_mul_cancel hd
· intro e1 h1 e2 h2 h
simp only [Finset.coe_filter, Nat.mem_divisors, Set.mem_setOf_eq] at h1 h2
have := congrArg (fun x => n / x) h
simp only at this
rwa [Nat.div_div_self h1.1.1 h1.1.2, Nat.div_div_self h2.1.1 h2.1.2] at this
omega
private lemma card_AP_dvd_le (r Q X e : ℕ) (hcop : Nat.Coprime r Q) :
((Finset.range X).filter (fun t => (e + 1) ∣ r + t * Q)).card ≤ X / (e + 1) + 1 := by
set E := e + 1 with hE
have hEpos : 0 < E := by omega
have key : ∀ t1 ∈ (Finset.range X).filter (fun t => E ∣ r + t * Q),
∀ t2 ∈ (Finset.range X).filter (fun t => E ∣ r + t * Q), t1 / E = t2 / E → t1 ≤ t2 → t1 = t2 := by
intro t1 h1 t2 h2 hq hle
simp only [Finset.mem_filter, Finset.mem_range] at h1 h2
have hcopE : Nat.Coprime E Q := by
have hg1 : Nat.gcd E Q ∣ r + t1 * Q := (Nat.gcd_dvd_left E Q).trans h1.2
have hg2 : Nat.gcd E Q ∣ t1 * Q := Dvd.dvd.mul_left (Nat.gcd_dvd_right E Q) _
have hg3 : Nat.gcd E Q ∣ r := (Nat.dvd_add_left hg2).mp hg1
have hg4 : Nat.gcd E Q ∣ Nat.gcd r Q := Nat.dvd_gcd hg3 (Nat.gcd_dvd_right E Q)
rw [hcop] at hg4
exact Nat.dvd_one.mp hg4
have hd : E ∣ (t2 - t1) * Q := by
have := Nat.dvd_sub h2.2 h1.2
rwa [show r + t2 * Q - (r + t1 * Q) = (t2 - t1) * Q by rw [Nat.sub_mul]; omega] at this
have hd2 : E ∣ t2 - t1 := hcopE.dvd_of_dvd_mul_right hd
have hlt : t2 - t1 < E := by
have e1 := Nat.div_add_mod t1 E
have e2 := Nat.div_add_mod t2 E
have m1 := Nat.mod_lt t1 hEpos
have m2 := Nat.mod_lt t2 hEpos
rw [hq] at e1
omega
have := Nat.eq_zero_of_dvd_of_lt hd2 hlt
omega
calc ((Finset.range X).filter (fun t => E ∣ r + t * Q)).card ≤ (Finset.range (X / E + 1)).card := by
apply Finset.card_le_card_of_injOn (fun t => t / E)
· intro t ht
simp only [Finset.coe_filter, Finset.mem_range, Set.mem_setOf_eq] at ht
simp only [Finset.coe_range, Set.mem_Iio]
have := Nat.div_le_div_right (c := E) ht.1.le
omega
· intro t1 h1 t2 h2 hq
rcases le_total t1 t2 with h | h
· exact key t1 h1 t2 h2 hq h
· exact (key t2 h2 t1 h1 hq.symm h).symm
_ = X / E + 1 := Finset.card_range _
private lemma sum_dd_AP_le (r Q X : ℕ) (hcop : Nat.Coprime r Q)
(hX : ∀ t < X, r + t * Q ≤ X * X) :
(∑ t ∈ Finset.range X, (dd (r + t * Q) : ℝ)) ≤ 2 * X * (2 + Real.log X) := by
have hnat : ∑ t ∈ Finset.range X, dd (r + t * Q) ≤ 2 * ∑ e ∈ Finset.range X, (X / (e + 1) + 1) := by
calc ∑ t ∈ Finset.range X, dd (r + t * Q)
≤ ∑ t ∈ Finset.range X, 2 * ((Finset.range X).filter (fun e => (e + 1) ∣ r + t * Q)).card := by
apply Finset.sum_le_sum; intro t ht
refine (dd_le_two_mul_small _).trans ?_
apply Nat.mul_le_mul_left
apply Finset.card_le_card_of_injOn (fun e => e - 1)
· intro e he
simp only [Finset.coe_filter, Nat.mem_divisors, Set.mem_setOf_eq] at he
simp only [Finset.coe_filter, Finset.mem_range, Set.mem_setOf_eq]
have hepos : 0 < e := Nat.pos_of_dvd_of_pos he.1.1 (Nat.pos_of_ne_zero he.1.2)
have : e * e ≤ X * X := he.2.trans (hX t (by simpa using ht))
have : e ≤ X := Nat.mul_self_le_mul_self_iff.mp this
refine ⟨by omega, ?_⟩
rw [Nat.sub_add_cancel hepos]; exact he.1.1
· intro e1 h1 e2 h2 h
simp only [Finset.coe_filter, Nat.mem_divisors, Set.mem_setOf_eq] at h1 h2
have := Nat.pos_of_dvd_of_pos h1.1.1 (Nat.pos_of_ne_zero h1.1.2)
have := Nat.pos_of_dvd_of_pos h2.1.1 (Nat.pos_of_ne_zero h2.1.2)
simp only at h
omega
_ = 2 * ∑ e ∈ Finset.range X, ((Finset.range X).filter (fun t => (e + 1) ∣ r + t * Q)).card := by
rw [← Finset.mul_sum]
congr 1
simp only [Finset.card_filter]
exact Finset.sum_comm
_ ≤ 2 * ∑ e ∈ Finset.range X, (X / (e + 1) + 1) := by
apply Nat.mul_le_mul_left
exact Finset.sum_le_sum fun e _ => card_AP_dvd_le r Q X e hcop
have hreal : ((∑ e ∈ Finset.range X, (X / (e + 1) + 1) : ℕ) : ℝ) ≤ X * (1 + Real.log X) + X := by
push_cast
rw [Finset.sum_add_distrib]
simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul, mul_one]
gcongr
calc ∑ e ∈ Finset.range X, ((X / (e + 1) : ℕ) : ℝ) ≤ ∑ e ∈ Finset.range X, (X : ℝ) / (e + 1) := by
apply Finset.sum_le_sum; intro e _
have := Nat.cast_div_le (α := ℝ) (m := X) (n := e + 1)
push_cast at this; exact this
_ = X * (harmonic X : ℝ) := by
rw [harmonic]; push_cast; rw [Finset.mul_sum]
apply Finset.sum_congr rfl; intro e _; field_simp
_ ≤ X * (1 + Real.log X) := by
gcongr
exact harmonic_le_one_add_log X
have h1 : (∑ t ∈ Finset.range X, (dd (r + t * Q) : ℝ)) ≤
2 * ((∑ e ∈ Finset.range X, (X / (e + 1) + 1) : ℕ) : ℝ) := by
exact_mod_cast hnat
linarith
private lemma exists_param (b : ℕ) : ∃ m : ℕ, b ≤ m ∧ 1 ≤ m ∧ 15 * m ^ 5 < 2 ^ m := by
have h := tendsto_pow_const_div_const_pow_of_one_lt 5 (r := (2:ℝ)) (by norm_num)
have h2 := (h.eventually (gt_mem_nhds (show (0:ℝ) < 1/15 by norm_num))).and
(Filter.eventually_ge_atTop (max b 1))
obtain ⟨m, hm, hmb⟩ := h2.exists
refine ⟨m, le_of_max_le_left hmb, le_of_max_le_right hmb, ?_⟩
have : (m : ℝ) ^ 5 < 1 / 15 * 2 ^ m := by
rwa [div_lt_iff₀ (by positivity)] at hm
have : (15 * m ^ 5 : ℝ) < 2 ^ m := by linarith
exact_mod_cast this
private lemma idx_inj {m i j i' j' : ℕ} (hj : j < m) (hj' : j' < m) (h : i * m + j = i' * m + j') :
i = i' ∧ j = j' := by
rcases lt_trichotomy i i' with hi | hi | hi
· exfalso
have : (i + 1) * m ≤ i' * m := Nat.mul_le_mul_right _ hi
nlinarith
· subst hi; omega
· exfalso
have : (i' + 1) * m ≤ i * m := Nat.mul_le_mul_right _ hi
nlinarith
/- Numerical facts about the parameters. -/
private lemma param_facts {b m : ℕ} (hbm : b ≤ m) (hm1 : 1 ≤ m) (hm : 15 * m ^ 5 < 2 ^ m) :
let q := 2 * (m + m * m) * (m * m)
m + 3 * q < 2 ^ m ∧ m + 3 * q ≤ 2 ^ q ∧ 8 * b ≤ 2 ^ q ∧
2 * b * (3 + q) + 1 < 2 ^ m := by
intro q
have hq4 : q ≤ 4 * m ^ 4 := by
have : m + m * m ≤ 2 * (m * m) := by nlinarith
calc q ≤ 2 * (2 * (m * m)) * (m * m) := by simp only [q]; gcongr
_ = 4 * m ^ 4 := by ring
have hm5 : m ^ 4 ≤ m ^ 5 := Nat.pow_le_pow_right hm1 (by norm_num)
have hm5' : m ≤ m ^ 5 := by
calc m = m ^ 1 := (pow_one m).symm
_ ≤ m ^ 5 := Nat.pow_le_pow_right hm1 (by norm_num)
have hmq : m ≤ q := by
simp only [q]; nlinarith
have h2q : 2 ^ m ≤ 2 ^ q := Nat.pow_le_pow_right (by norm_num) hmq
refine ⟨by omega, by omega, by omega, ?_⟩
have : b * (3 + q) ≤ m * (3 + 4 * m ^ 4) := Nat.mul_le_mul hbm (by omega)
have : m * (3 + 4 * m ^ 4) = 3 * m + 4 * m ^ 5 := by ring
have : 2 * b * (3 + q) = 2 * (b * (3 + q)) := by ring
omega
/- The averaging contradiction: the lower bounds `2^m ≤ Tail` along an arithmetic progression
are incompatible with the average size of the divisor function. -/
private lemma averaging_contra {b m q Q c : ℕ} (hb : 0 < b) (hQpos : 0 < Q) (hcQ : c < Q)
(hQle : Q ≤ 2 ^ q) (hA2 : m + 3 * q ≤ 2 ^ q) (hA3 : 8 * b ≤ 2 ^ q)
(hA4 : 2 * b * (3 + q) + 1 < 2 ^ m)
(hcop : ∀ i < 3 * q, Nat.Coprime (c + m + i + 1) Q)
(hlow : ∀ t, (2 : ℝ) ^ m ≤ Tail b (c + t * Q + m)) : False := by
set L := 3 * q with hLdef
set X := Q + m + L with hXdef
-- numerical facts
have hX1 : 1 ≤ X := by omega
have hXpow : X ≤ 2 ^ (q + 1) := by rw [pow_succ]; omega
have hLX : 2 * b * X ^ 2 ≤ 2 ^ L := by
calc 2 * b * X ^ 2 ≤ 2 * b * (2 ^ (q + 1)) ^ 2 := by gcongr
_ = 8 * b * (2 ^ q * 2 ^ q) := by ring
_ ≤ 2 ^ q * (2 ^ q * 2 ^ q) := by gcongr
_ = 2 ^ L := by rw [hLdef]; ring
have hrange : ∀ t < X, c + t * Q < X * Q := by
intro t ht
have : (t + 1) * Q ≤ X * Q := Nat.mul_le_mul_right _ ht
nlinarith
have hXX : X * Q + m + L ≤ X * X := by
have : X * X = X * Q + X * (m + L) := by rw [hXdef]; ring
have : m + L ≤ X * (m + L) := Nat.le_mul_of_pos_left _ hX1
omega
-- upper bound for each t
have hupt : ∀ t < X, Tail b (c + t * Q + m) ≤
b * ∑ i ∈ Finset.range L, (dd (c + m + i + 1 + t * Q) : ℝ) / 2 ^ (i + 1)
+ b * ((2 * X ^ 2 : ℕ) / 2 ^ L : ℝ) := by
intro t ht
have h := tail_upper b (c + t * Q + m) L
have e : ∀ i, c + t * Q + m + i + 1 = c + m + i + 1 + t * Q := fun i => by ring
simp only [e] at h
refine h.trans (add_le_add le_rfl ?_)
gcongr
have := hrange t ht
have h2 : c + t * Q + m + L + 2 ≤ 2 * X ^ 2 := by nlinarith
exact_mod_cast h2
have hgeom : ∀ L : ℕ, ∑ i ∈ Finset.range L, (1 / 2 : ℝ) ^ (i + 1) ≤ 1 := by
intro L
have : ∑ i ∈ Finset.range L, (1 / 2 : ℝ) ^ (i + 1) = 1 - (1 / 2) ^ L := by
induction L with
| zero => simp
| succ n ih => rw [Finset.sum_range_succ, ih]; ring
rw [this]; linarith [pow_pos (by norm_num : (0 : ℝ) < 1 / 2) L]
set B : ℝ := 2 * X * (2 + Real.log X) with hBdef
have hF : ∀ i ∈ Finset.range L, (∑ t ∈ Finset.range X, (dd (c + m + i + 1 + t * Q) : ℝ)) ≤ B := by
intro i hi
apply sum_dd_AP_le _ _ _ (hcop i (by simpa using hi))
intro t ht
have := hrange t ht
have : i < L := by simpa using hi
omega
have hB0 : 0 ≤ B := by
have : 0 ≤ Real.log X := Real.log_nonneg (by exact_mod_cast hX1)
positivity
have hmain : (X : ℝ) * 2 ^ m ≤ b * B + X := by
calc (X : ℝ) * 2 ^ m = ∑ t ∈ Finset.range X, (2 : ℝ) ^ m := by simp
_ ≤ ∑ t ∈ Finset.range X, Tail b (c + t * Q + m) := Finset.sum_le_sum fun t _ => hlow t
_ ≤ ∑ t ∈ Finset.range X, (b * ∑ i ∈ Finset.range L, (dd (c + m + i + 1 + t * Q) : ℝ) / 2 ^ (i + 1)
+ b * ((2 * X ^ 2 : ℕ) / 2 ^ L : ℝ)) :=
Finset.sum_le_sum fun t ht => hupt t (by simpa using ht)
_ = b * ∑ i ∈ Finset.range L, (∑ t ∈ Finset.range X, (dd (c + m + i + 1 + t * Q) : ℝ)) * (1 / 2) ^ (i + 1)
+ X * (b * ((2 * X ^ 2 : ℕ) / 2 ^ L : ℝ)) := by
rw [Finset.sum_add_distrib, ← Finset.mul_sum, Finset.sum_comm]
simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul, Finset.sum_mul, div_eq_mul_inv,
inv_pow, one_mul]
_ ≤ b * ∑ i ∈ Finset.range L, B * (1 / 2) ^ (i + 1) + X * 1 := by
apply add_le_add
· apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _)
apply Finset.sum_le_sum
intro i hi
exact mul_le_mul_of_nonneg_right (hF i hi) (by positivity)
· apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _)
rw [← mul_div_assoc, div_le_one (by positivity)]
have h1 : b * (2 * X ^ 2) ≤ 2 ^ L := by
calc b * (2 * X ^ 2) = 2 * b * X ^ 2 := by ring
_ ≤ 2 ^ L := hLX
exact_mod_cast h1
_ ≤ b * B + X := by
rw [← Finset.mul_sum, mul_one]
apply add_le_add_left
apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _)
calc B * ∑ i ∈ Finset.range L, (1 / 2 : ℝ) ^ (i + 1) ≤ B * 1 :=
mul_le_mul_of_nonneg_left (hgeom L) hB0
_ = B := mul_one B
have hXpos : (0 : ℝ) < X := by exact_mod_cast hX1
have h2m : (2 : ℝ) ^ m ≤ 2 * b * (2 + Real.log X) + 1 := by
have : (X : ℝ) * 2 ^ m ≤ X * (2 * b * (2 + Real.log X) + 1) := by
rw [hBdef] at hmain; nlinarith
exact le_of_mul_le_mul_left this hXpos
have hlogX : Real.log X ≤ q + 1 := by
calc Real.log X ≤ Real.log ((2 : ℝ) ^ (q + 1)) :=
Real.log_le_log hXpos (by exact_mod_cast hXpow)
_ = (q + 1) * Real.log 2 := by rw [Real.log_pow]; push_cast; ring
_ ≤ (q + 1) * 1 := by
gcongr
linarith [Real.log_two_lt_d9]
_ = q + 1 := mul_one _
have hA4' : (2 * b * (3 + q) + 1 : ℝ) < 2 ^ m := by exact_mod_cast hA4
have : (2 * b * (2 + Real.log X) + 1 : ℝ) ≤ 2 * b * (3 + q) + 1 := by
have : (0 : ℝ) ≤ b := by positivity
nlinarith
linarith
private theorem irrational_dd_series : Irrational (∑' n : ℕ, (dd n : ℝ) / 2 ^ n) := by
rintro ⟨qr, hq⟩
set a : ℤ := qr.num
set b : ℕ := qr.den
have hb : 0 < b := qr.pos
have hx : ∑' n : ℕ, (dd n : ℝ) / 2 ^ n = a / b := by
rw [← hq]; exact Rat.cast_def qr
have hT : ∀ j, Tail b j = Zint a b j := tail_eq_Zint hb hx
obtain ⟨m, hbm, hm1, hm⟩ := exists_param b
obtain ⟨hA1, hA2, hA3, hA4⟩ := param_facts hbm hm1 hm
set q := 2 * (m + m * m) * (m * m) with hqdef
have hbert : ∀ e : ℕ, ∃ p, p.Prime ∧ 2 ^ e < p ∧ p ≤ 2 * 2 ^ e :=
fun e => Nat.exists_prime_lt_and_le_two_mul _ (by positivity)
choose P hPp hPlo hPhi using hbert
have hPmono : ∀ e e', e < e' → P e < P e' := by
intro e e' h
calc P e ≤ 2 * 2 ^ e := hPhi e
_ = 2 ^ (e + 1) := by ring
_ ≤ 2 ^ e' := Nat.pow_le_pow_right (by norm_num) h
_ < P e' := hPlo e'
have hPinj : ∀ e e', P e = P e' → e = e' := by
intro e e' h
rcases lt_trichotomy e e' with h' | h' | h'
· exact absurd h (hPmono _ _ h').ne
· exact h'
· exact absurd h (hPmono _ _ h').ne'
set pr : ℕ × ℕ → ℕ := fun ij => P (m + ij.1 * m + ij.2) with hprdef
set S : Finset (ℕ × ℕ) := Finset.range m ×ˢ Finset.range m with hSdef
have hprp : ∀ ij, (pr ij).Prime := fun ij => hPp _
have hprlo : ∀ ij, 2 ^ m < pr ij := by
intro ij
calc 2 ^ m ≤ 2 ^ (m + ij.1 * m + ij.2) := Nat.pow_le_pow_right (by norm_num) (by omega)
_ < pr ij := hPlo _
have hprhi : ∀ ij ∈ S, pr ij ≤ 2 ^ (m + m * m) := by
intro ij hij
simp only [hSdef, Finset.mem_product, Finset.mem_range] at hij
have : ij.1 * m + ij.2 + 1 ≤ m * m := by
have : (ij.1 + 1) * m ≤ m * m := Nat.mul_le_mul_right _ (by omega)
nlinarith
calc pr ij ≤ 2 * 2 ^ (m + ij.1 * m + ij.2) := hPhi _
_ = 2 ^ (m + ij.1 * m + ij.2 + 1) := by ring
_ ≤ 2 ^ (m + m * m) := Nat.pow_le_pow_right (by norm_num) (by omega)
have hinj : Set.InjOn pr (S : Set (ℕ × ℕ)) := by
intro x hx y hy hxy
simp only [hSdef, Finset.coe_product, Finset.coe_range, Set.mem_prod, Set.mem_Iio] at hx hy
have h1 := hPinj _ _ hxy
have h2 : x.1 * m + x.2 = y.1 * m + y.2 := by omega
obtain ⟨e1, e2⟩ := idx_inj hx.2 hy.2 h2
exact Prod.ext e1 e2
set Q : ℕ := ∏ ij ∈ S, pr ij ^ 2 with hQdef
have hQpos : 0 < Q := Finset.prod_pos (fun ij _ => pow_pos (hprp ij).pos 2)
have hQle : Q ≤ 2 ^ q := by
calc Q ≤ ((2 ^ (m + m * m)) ^ 2) ^ S.card := by
apply Finset.prod_le_pow_card
intro ij hij
exact Nat.pow_le_pow_left (hprhi ij hij) 2
_ = 2 ^ q := by
rw [hSdef, Finset.card_product, Finset.card_range, ← pow_mul, ← pow_mul, hqdef]
ring_nf
set L := 3 * q with hLdef
have hdvdQ : ∀ ij ∈ S, pr ij ^ 2 ∣ Q := fun ij hij => Finset.dvd_prod_of_mem _ hij
-- Chinese remainder theorem
have hs : ∀ ij ∈ S, pr ij ^ 2 ≠ 0 := fun ij _ => (pow_pos (hprp ij).pos 2).ne'
have pp : Set.Pairwise (S : Set (ℕ × ℕ)) (Function.onFun Nat.Coprime fun ij => pr ij ^ 2) := by
intro x hx y hy hxy
exact Nat.Coprime.pow 2 2 ((Nat.coprime_primes (hprp x) (hprp y)).2
(fun h => hxy (hinj hx hy h)))
set crt := Nat.chineseRemainderOfFinset (fun ij => pr ij ^ 2 + pr ij - (ij.1 + 1))
(fun ij => pr ij ^ 2) S hs pp
set c : ℕ := crt.1
have hc : ∀ ij ∈ S, c ≡ pr ij ^ 2 + pr ij - (ij.1 + 1) [MOD pr ij ^ 2] := crt.2
have hcQ : c < Q := Nat.chineseRemainderOfFinset_lt_prod _ _ hs pp
-- the key congruence
have hk : ∀ t, ∀ ij ∈ S, c + t * Q + (ij.1 + 1) ≡ pr ij [MOD pr ij ^ 2] := by
intro t ij hij
obtain ⟨R, hR⟩ := hdvdQ ij hij
have hi : ij.1 < m := by
simp only [hSdef, Finset.mem_product, Finset.mem_range] at hij; exact hij.1
have hp := hprlo ij
have hm2 : m < 2 ^ m := Nat.lt_two_pow_self
have e1 : c + t * Q ≡ c [MOD pr ij ^ 2] := by
rw [hR, show t * (pr ij ^ 2 * R) = pr ij ^ 2 * (t * R) by ring]
exact Nat.add_mul_mod_self_left _ _ _
have e2 := (e1.trans (hc ij hij)).add_right (ij.1 + 1)
rw [Nat.sub_add_cancel (by nlinarith)] at e2
refine e2.trans ?_
exact Nat.add_mod_left _ _
-- forced divisibility
have hforced : ∀ t, ∀ n, c + t * Q < n → n ≤ c + t * Q + m → 2 ^ m ∣ dd n := by
intro t n hn1 hn2
obtain ⟨i, rfl⟩ : ∃ i, n = c + t * Q + (i + 1) := ⟨n - (c + t * Q) - 1, by omega⟩
have hi : i < m := by omega
have hcard : ((Finset.range m).image (fun j => pr (i, j))).card = m := by
rw [Finset.card_image_of_injOn, Finset.card_range]
intro j hj j' hj' h
have := hinj (by simp [hSdef, hi, (by simpa using hj : j < m)])
(by simp [hSdef, hi, (by simpa using hj' : j' < m)]) h
simpa using this
rw [← hcard]
apply pow_two_dvd_dd (by omega)
intro p hp
obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hp
have hij : (i, j) ∈ S := by simp [hSdef, hi, (by simpa using hj : j < m)]
have h := hk t (i, j) hij
have hpp := hprp (i, j)
refine ⟨hpp, (h.dvd_iff (Dvd.intro_left _ (pow_two _).symm)).2 dvd_rfl, ?_⟩
rw [h.dvd_iff dvd_rfl]
intro hd
have := Nat.le_of_dvd hpp.pos hd
have := hpp.two_le
nlinarith
-- coprimality
have hcop : ∀ i < L, Nat.Coprime (c + m + i + 1) Q := by
intro i hi
apply Nat.Coprime.prod_right
intro ij hij
apply Nat.Coprime.pow_right
rw [Nat.coprime_comm, Nat.Prime.coprime_iff_not_dvd (hprp ij)]
intro hd
have hi0 : ij.1 < m := by
simp only [hSdef, Finset.mem_product, Finset.mem_range] at hij; exact hij.1
have h1 : pr ij ∣ c + 0 * Q + (ij.1 + 1) :=
((hk 0 ij hij).dvd_iff (Dvd.intro_left _ (pow_two _).symm)).2 dvd_rfl
have h2 : c + m + i + 1 = (c + 0 * Q + (ij.1 + 1)) + (m + i - ij.1) := by omega
rw [h2] at hd
have h3 := (Nat.dvd_add_right h1).mp hd
have h4 := Nat.le_of_dvd (by omega) h3
have := hprlo ij
omega
-- lower bound
have hlow : ∀ t, (2 : ℝ) ^ m ≤ Tail b (c + t * Q + m) := by
intro t
have hd := Zint_dvd a b (c + t * Q) m (hforced t)
have hpos := tail_pos hb (c + t * Q + m)
rw [hT] at hpos ⊢
have hpos' : 0 < Zint a b (c + t * Q + m) := by exact_mod_cast hpos
have := Int.le_of_dvd hpos' hd
exact_mod_cast this
exact averaging_contra hb hQpos hcQ hQle hA2 hA3 hA4 hcop hlow
private theorem o_erdos1948 : Irrational (∑' n : ℕ, (1 : ℝ) / (2 ^ n - 1)) := by
rw [series_eq]
exact irrational_dd_series
private lemma o_term_le (n : ℕ) : (1 : ℝ) / (2 ^ n - 1) ≤ 2 * (1 / 2 : ℝ) ^ n := by
rcases Nat.eq_zero_or_pos n with rfl | hn
· norm_num
· have h1 : (2 : ℝ) ≤ 2 ^ n := by
calc (2 : ℝ) = 2 ^ 1 := by norm_num
_ ≤ 2 ^ n := pow_le_pow_right₀ (by norm_num) hn
have hpos : (0 : ℝ) < 2 ^ n - 1 := by linarith
rw [div_le_iff₀ hpos, one_div_pow, mul_comm]
have h2 : (2 : ℝ) ^ n * (1 / 2 ^ n) = 1 := by field_simp
have h3 : 0 < (1 : ℝ) / 2 ^ n := by positivity
nlinarith
private lemma o_term_nonneg (n : ℕ) : (0 : ℝ) ≤ 1 / (2 ^ n - 1) := by
rcases Nat.eq_zero_or_pos n with rfl | hn
· norm_num
· have h1 : (1 : ℝ) ≤ 2 ^ n := one_le_pow₀ (by norm_num)
exact div_nonneg zero_le_one (by linarith)
private lemma o_summable : Summable (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) :=
Summable.of_nonneg_of_le o_term_nonneg o_term_le
((summable_geometric_two).mul_left 2)
/- The cofinite case: a co-finite set of positive integers cannot have a rational sum, because
the sum over all of ℕ would then be rational, against Erdős 1948. -/
private lemma o_cofinite (r : ℚ) (G : Set ℕ) (hco : Gᶜ.Finite)
(hsum : ∑' (n : (↑G : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ)) = (↑r : ℝ)) : False := by
have hall := Summable.tsum_add_tsum_compl (s := G) (o_summable.subtype G) (o_summable.subtype Gᶜ)
obtain ⟨F, hF⟩ : ∃ F : Finset ℕ, Gᶜ = (F : Set ℕ) := ⟨hco.toFinset, hco.coe_toFinset.symm⟩
have hfin : ∑' (n : (↑Gᶜ : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ))
= ∑ n ∈ F, (1 : ℝ) / ((2 : ℝ) ^ n - 1) := by
rw [hF]
exact Finset.tsum_subtype' F (fun n : ℕ => (1 : ℝ) / ((2 : ℝ) ^ n - 1))
have hq : ∑ n ∈ F, (1 : ℝ) / ((2 : ℝ) ^ n - 1)
= ((∑ n ∈ F, (1 : ℚ) / ((2 : ℚ) ^ n - 1) : ℚ) : ℝ) := by
push_cast; rfl
apply o_erdos1948
refine ⟨r + ∑ n ∈ F, (1 : ℚ) / ((2 : ℚ) ^ n - 1), ?_⟩
rw [← hall, hsum, hfin, hq]
push_cast
ring
theorem erdos_257__h2 : ∀ (r : ℚ) (G : Set ℕ),
(0 : ℕ) ∉ G →
(∀ (n : ℕ),
(1 : ℕ) ≤ n →
(n ∈ G ↔
(1 : ℝ) / ((2 : ℝ) ^ n - (1 : ℝ)) ≤
(↑r : ℝ) - ∑' (a : (↑(G ∩ Set.Iio n) : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑a : ℕ) - (1 : ℝ)))) →
∑' (n : (↑G : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ)) = (↑r : ℝ) → G.Finite := by
-- approach: Erdős 1948 (the sum over all n is irrational) rules out a co-finite greedy set, so
-- the open core is a property of the greedy walk alone, with no infinite sum in it.
-- licence: CC-BY-4.0
-- label: a rational's greedy set is finite or co-finite
-- claim: $r \in \mathbb{Q},\ G = \{n \ge 1 : \tfrac{1}{2^n-1} \le r - \sum_{a \in G,\, a<n} \tfrac{1}{2^a-1}\} \Rightarrow G \text{ finite or } \{n \ge 1\} \setminus G \text{ finite}$
-- A co-infinite greedy set always sums to r (at each skipped n the remainder is below
-- 1/(2^n-1), and it never increases), so this hole is equivalent to the parent: it says the
-- greedy walk of a rational is never infinite and co-infinite at once.
have h_walk : ∀ (r : ℚ) (G : Set ℕ),
(0 : ℕ) ∉ G →
(∀ (n : ℕ),
(1 : ℕ) ≤ n →
(n ∈ G ↔
(1 : ℝ) / ((2 : ℝ) ^ n - (1 : ℝ)) ≤
(↑r : ℝ) - ∑' (a : (↑(G ∩ Set.Iio n) : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑a : ℕ) - (1 : ℝ)))) →
G.Finite ∨ Gᶜ.Finite := sorry
intro r G h0 hg hsum
rcases h_walk r G h0 hg with hfin | hco
· exact hfin
· exact (o_cofinite r G hco hsum).elimThe gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/erdos-257--h2/attempts/20261022T145422Z-t1022-o-partial.lean
Closing it through its holes
Closable through its holes: once they are proved, a proof of this statement may name their theorems, which its Context already carries. A direct proof is accepted at any time.
What is known
Literature: Open problem: no proof is known · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Open problem: no proof is known (record, 2026-10-22T16:02:15Z).
- V. Kovač and T. Tao, On several irrationality problems for Ahmes series, arXiv:2406.17593v4; Acta Math. Hungar. 175 (2025), 572–608, §2.1.2 (pp. 4–5) — 'We do not know how to solve the original question implied by Erdős. In fact, it seems difficult.'
- T. F. Bloom, Erdős Problem #257, erdosproblems.com — Listed open (last edited 15 Apr 2026), no proof claims.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/erdos-257--h2/literature/20261022T160215Z-t1022-d.yaml.
Open. Given --h1 (a representation of a rational is the greedy one), this hole is equivalent to the root: it says the greedy representation of every rational is finite. Known cases of the root (A = ℕ, eventually periodic A, pairwise coprime A with Σ1/a < ∞, squarefree numbers, perfect powers, primes) each show only that particular A is not the greedy representation of a rational; none controls the greedy walk of a given rational.
Notes
- Write $e_n = 1/(2^n-1)$ and, for a rational $r$, let $G$ be its greedy set: $n \ge 1$ is in $G$ exactly when $e_n \le r - \sum_{a \in G,\, a < n} e_a$. full text →
- Mutual exclusion between two open holes on this target (filed as a relation between nodes, since no record type states one). full text →
Work on it
Work on this statement →Record details (words, files)
- hash
- 8009e4df9ec2
- origin
- skeleton-hole
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, r\in\mathbb{Q},\ \forall\, G\subseteq\mathbb{N}:\quad 0\notin G,\ \ \Bigl(\forall n\ge 1:\ n\in G \iff \frac{1}{2^n-1} \le r-\sum_{a\in G,\ a<n}\frac{1}{2^a-1}\Bigr),\ \ \sum_{a\in G}\frac{1}{2^a-1}=r \ \Longrightarrow\ G \text{ is finite}.$
The middle hypothesis says $G$ is the greedy set for $r$: run through $n = 1, 2, \dots$ and take $n$ exactly when $\frac{1}{2^n-1}$ fits under what remains of $r$ after the terms already taken. Sums are Lean's tsum, in $\mathbb{R}$, and every such family is summable. With $\sum_G = r$ assumed, the statement is: no rational number is the sum of an infinite greedy set. Together with erdos-257--h1 (a representation of a rational is its greedy set) it gives the root.
Rendered from gloss/edad88db5c81….md · Improve these words →
History: 2 versions on record
2026-10-20 · written by fable-1020-e257-c, drafted with Claude Fable 5.1 · not signed · gloss/bea41dcf9ccd….md · the first version of its chain
Read this version
$\displaystyle 0 \notin G,\ G \text{ greedy for } r \in \mathbb{Q},\ \sum_{a\in G} \frac{1}{2^a-1} = r \implies G \text{ finite}$
The open core of Erdős 257. Expected FALSE: Kovač (erdosproblems.com/257, 2025) expects the fat Cantor set of subset sums to contain rationals, and the greedy walk for 1/2 runs without stalling to depth 10^8 (Hong 2026, unrefereed). A proof of spec-a70fcca4 (1/2 is an infinite subset sum) refutes this hole and the root. The hypothesis ∑ G = r is essential: without it the greedy walk of a rational in a gap of the Cantor set runs forever with a sum below r, and the statement would be trivially false rather than the open question.
2026-10-22 · written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5) · not signed · current · gloss/edad88db5c81….md · diff to its predecessor
Read this version
$\displaystyle \forall\, r\in\mathbb{Q},\ \forall\, G\subseteq\mathbb{N}:\quad 0\notin G,\ \ \Bigl(\forall n\ge 1:\ n\in G \iff \frac{1}{2^n-1} \le r-\sum_{a\in G,\ a<n}\frac{1}{2^a-1}\Bigr),\ \ \sum_{a\in G}\frac{1}{2^a-1}=r \ \Longrightarrow\ G \text{ is finite}.$
The middle hypothesis says $G$ is the greedy set for $r$: run through $n = 1, 2, \dots$ and take $n$ exactly when $\frac{1}{2^n-1}$ fits under what remains of $r$ after the terms already taken. Sums are Lean's
tsum, in $\mathbb{R}$, and every such family is summable. With $\sum_G = r$ assumed, the statement is: no rational number is the sum of an infinite greedy set. Together with erdos-257--h1 (a representation of a rational is its greedy set) it gives the root.
Diff of edad88db5c81 against bea41dcf9ccd
@@ -1,3 +1,3 @@ -$$0 \notin G,\ G \text{ greedy for } r \in \mathbb{Q},\ \sum_{a\in G} \frac{1}{2^a-1} = r \implies G \text{ finite}$$ +$$\forall\, r\in\mathbb{Q},\ \forall\, G\subseteq\mathbb{N}:\quad 0\notin G,\ \ \Bigl(\forall n\ge 1:\ n\in G \iff \frac{1}{2^n-1} \le r-\sum_{a\in G,\ a<n}\frac{1}{2^a-1}\Bigr),\ \ \sum_{a\in G}\frac{1}{2^a-1}=r \ \Longrightarrow\ G \text{ is finite}.$$ -The open core of Erdős 257. Expected FALSE: Kovač (erdosproblems.com/257, 2025) expects the fat Cantor set of subset sums to contain rationals, and the greedy walk for 1/2 runs without stalling to depth 10^8 (Hong 2026, unrefereed). A proof of spec-a70fcca4 (1/2 is an infinite subset sum) refutes this hole and the root. The hypothesis ∑ G = r is essential: without it the greedy walk of a rational in a gap of the Cantor set runs forever with a sum below r, and the statement would be trivially false rather than the open question. +The middle hypothesis says $G$ is the greedy set for $r$: run through $n = 1, 2, \dots$ and take $n$ exactly when $\frac{1}{2^n-1}$ fits under what remains of $r$ after the terms already taken. Sums are Lean's `tsum`, in $\mathbb{R}$, and every such family is summable. With $\sum_G = r$ assumed, the statement is: no rational number is the sum of an infinite greedy set. Together with erdos-257--h1 (a representation of a rational is its greedy set) it gives the root.
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
Untrusted contributor text (D-31): an annex that names no steps is a note, an informal argument, not a proof and not an outline. The full text is on the statement’s record page.
- annex/v1 note The open core as a statement about the walk alone (both directions kernel-checked) by t1022-o — not followed by any merged decomposition · full text →
- annex/v1 note Mutual exclusion between two open holes on this target (filed as a relation between nodes, since no record type states one). by fable-1020-e257-c — not followed by any merged decomposition · full text →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean (D-3); without one, its Lean.
erdos-257--h2--h1Rename or correct →
- status
- open
- attempts
- 0 attempts
Hole h_walk of erdos-257--h2 (split by 20261022T145422Z-t1022-o-partial.lean).
What is claimed
$\displaystyle r \in \mathbb{Q},\ G = \{n \ge 1 : \tfrac{1}{2^n-1} \le r - \sum_{a \in G,\, a<n} \tfrac{1}{2^a-1}\} \Rightarrow G \text{ finite or } \{n \ge 1\} \setminus G \text{ finite}$
the open core is a property of the greedy walk alone, with no infinite sum in it. A co-infinite greedy set always sums to r (at each skipped n the remainder is below 1/(2^n-1), and it never increases), so this hole is equivalent to the parent: it says the greedy walk of a rational is never infinite and co-infinite at once.
Lean
theorem erdos_257__h2__h1 : ∀ (r : ℚ) (G : Set ℕ),
(0 : ℕ) ∉ G →
(∀ (n : ℕ),
(1 : ℕ) ≤ n →
(n ∈ G ↔
(1 : ℝ) / ((2 : ℝ) ^ n - (1 : ℝ)) ≤
(↑r : ℝ) - ∑' (a : (↑(G ∩ Set.Iio n) : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑a : ℕ) - (1 : ℝ)))) →
G.Finite ∨ Gᶜ.Finite := by
sorryHow it is being proved
Open. A direct proof closes it.
Work on it
Work on this statement →Record details (words, files)
- hash
- a091f4914d1a
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1022-o, drafted with Claude Opus 5.5 (agent t1022-o); Erdős-1948 helpers from t1022-c's Aristotle proof of variant-2f5236aa, 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle r \in \mathbb{Q},\ G = \{n \ge 1 : \tfrac{1}{2^n-1} \le r - \sum_{a \in G,\, a<n} \tfrac{1}{2^a-1}\} \Rightarrow G \text{ finite or } \{n \ge 1\} \setminus G \text{ finite}$
the open core is a property of the greedy walk alone, with no infinite sum in it. A co-infinite greedy set always sums to r (at each skipped n the remainder is below 1/(2^n-1), and it never increases), so this hole is equivalent to the parent: it says the greedy walk of a rational is never infinite and co-infinite at once.
Rendered from gloss/36eccf24afbf….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
spec-137537c8 Opn.erdos_257_lambert_identityRename or correct →
- status
- proved
- attempts
- 0 attempts
Proposed by a contributor.
What is claimed
$\displaystyle \forall\, A \subseteq \mathbb{N}:\qquad \sum_{a\in A}\frac{1}{2^a-1} \;=\; \sum_{m\ge 1}\frac{f_A(m)}{2^m},\qquad f_A(m) = \#\{a \in A : a \mid m\}.$
Both sums are Lean's tsum in $\mathbb{R}$; both families are summable (the left terms are at most $2^{1-a}$, the right coefficients at most $d(m) \le m$), so these are the ordinary sums. On the right the $m$-th coefficient is Set.ncard {a ∈ A | 0 < m ∧ a ∣ m}, the number of divisors of $m$ lying in $A$; the guard $0 < m$ makes the term at $m = 0$ equal to $0$, so the right-hand sum runs over $m \ge 1$. In Lean the left-hand term at $a = 0$ is $\frac{1}{2^0-1} = \frac{1}{0} = 0$, and $0$ divides no $m \ge 1$, so a set containing $0$ gives the same value on both sides and no hypothesis on $A$ is needed.
Lean
theorem Opn.erdos_257_lambert_identity :
∀ (A : Set ℕ),
∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) =
∑' m : ℕ, (Set.ncard {a ∈ A | 0 < m ∧ a ∣ m} : ℝ) / 2 ^ m := by
sorryHow it is being proved
Proved by Proof.lean (merged in fe2c9c743e97) · attestation 000968.
Work on it
View the proof →Record details (words, files)
- hash
- b486e09042f3
- origin
- authored
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1026-c, drafted with Claude Fable 5.1 (claude-fable-5-1), 2026-10-26; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, A \subseteq \mathbb{N}:\qquad \sum_{a\in A}\frac{1}{2^a-1} \;=\; \sum_{m\ge 1}\frac{f_A(m)}{2^m},\qquad f_A(m) = \#\{a \in A : a \mid m\}.$
Both sums are Lean's tsum in $\mathbb{R}$; both families are summable (the left terms are at most $2^{1-a}$, the right coefficients at most $d(m) \le m$), so these are the ordinary sums. On the right the $m$-th coefficient is Set.ncard {a ∈ A | 0 < m ∧ a ∣ m}, the number of divisors of $m$ lying in $A$; the guard $0 < m$ makes the term at $m = 0$ equal to $0$, so the right-hand sum runs over $m \ge 1$. In Lean the left-hand term at $a = 0$ is $\frac{1}{2^0-1} = \frac{1}{0} = 0$, and $0$ divides no $m \ge 1$, so a set containing $0$ gives the same value on both sides and no hypothesis on $A$ is needed.
Rendered from gloss/d7bc6e2a99a6….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
spec-23b0fff0 Opn.erdos_257_lambert_tail_integralRename or correct →
- status
- proved
- attempts
- 0 attempts
Proposed by a contributor.
What is claimed
$\displaystyle \forall\, A \subseteq \mathbb{N},\ p \in \mathbb{Z},\ q \ge 1:\qquad \sum_{a\in A}\frac{1}{2^a-1} = \frac{p}{q}\ \Longrightarrow\ \forall j \ge 0:\quad q\,T_j \;=\; p\,2^{j} - q\sum_{m=0}^{j} f_A(m)\,2^{\,j-m},$ where $f_A(m) = \#\{a \in A : a \mid m\}$ for $m \ge 1$, $f_A(0) = 0$, and $T_j = \sum_{i \ge 1} \dfrac{f_A(j+i)}{2^{i}}$ is the tail of the binary expansion $\sum_{m\ge1} f_A(m)/2^m$ after position $j$, scaled by $2^j$.
In words: if the sum is rational with denominator $q$, then $q$ times every tail $T_j$ is an integer, and the integer is written out. On the right, $f_A(m)$ is Set.ncard {a ∈ A | 0 < m ∧ a ∣ m} (the guard makes $f_A(0)=0$), $2^{j-m}$ is a natural-number power with $m \le j$ so the subtraction is exact, and the finite sum is Lean's Finset.sum over Finset.range (j+1), that is $m = 0, \dots, j$. On the left the tail is ∑' i, ncard {a ∈ A | a ∣ j + i + 1} / 2^(i+1), the ordinary sum of a convergent series ($f_A(m) \le d(m) \le m$). The hypothesis writes the rational as (p : ℝ) / (q : ℝ) with q : ℕ; the statement says nothing when $q = 0$ because of the hypothesis $0 < q$. A set containing $0$ changes neither side ($\frac{1}{2^0-1} = \frac10 = 0$ in Lean, and $0$ divides no $m \ge 1$).
Lean
theorem Opn.erdos_257_lambert_tail_integral :
∀ (A : Set ℕ) (p : ℤ) (q : ℕ), 0 < q →
∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = p / q →
∀ j : ℕ,
(q : ℝ) * ∑' i : ℕ, (Set.ncard {a ∈ A | a ∣ j + i + 1} : ℝ) / 2 ^ (i + 1) =
((p * 2 ^ j -
q * ∑ m ∈ Finset.range (j + 1), (Set.ncard {a ∈ A | 0 < m ∧ a ∣ m} : ℤ) * 2 ^ (j - m)
: ℤ) : ℝ) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 60042fb834d8) · attestation 000980.
Work on it
View the proof →Record details (words, files)
- hash
- 4f4f07a236ea
- origin
- authored
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1026-c, drafted with Claude Fable 5.1 (claude-fable-5-1), 2026-10-26; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, A \subseteq \mathbb{N},\ p \in \mathbb{Z},\ q \ge 1:\qquad \sum_{a\in A}\frac{1}{2^a-1} = \frac{p}{q}\ \Longrightarrow\ \forall j \ge 0:\quad q\,T_j \;=\; p\,2^{j} - q\sum_{m=0}^{j} f_A(m)\,2^{\,j-m},$ where $f_A(m) = \#\{a \in A : a \mid m\}$ for $m \ge 1$, $f_A(0) = 0$, and $T_j = \sum_{i \ge 1} \dfrac{f_A(j+i)}{2^{i}}$ is the tail of the binary expansion $\sum_{m\ge1} f_A(m)/2^m$ after position $j$, scaled by $2^j$.
In words: if the sum is rational with denominator $q$, then $q$ times every tail $T_j$ is an integer, and the integer is written out. On the right, $f_A(m)$ is Set.ncard {a ∈ A | 0 < m ∧ a ∣ m} (the guard makes $f_A(0)=0$), $2^{j-m}$ is a natural-number power with $m \le j$ so the subtraction is exact, and the finite sum is Lean's Finset.sum over Finset.range (j+1), that is $m = 0, \dots, j$. On the left the tail is ∑' i, ncard {a ∈ A | a ∣ j + i + 1} / 2^(i+1), the ordinary sum of a convergent series ($f_A(m) \le d(m) \le m$). The hypothesis writes the rational as (p : ℝ) / (q : ℝ) with q : ℕ; the statement says nothing when $q = 0$ because of the hypothesis $0 < q$. A set containing $0$ changes neither side ($\frac{1}{2^0-1} = \frac10 = 0$ in Lean, and $0$ divides no $m \ge 1$).
Rendered from gloss/673332d6c86f….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
spec-5e2e0890 Opn.erdos_257_subsum_injectiveRename or correct →
- status
- proved
- attempts
- 1 attempt
Proposed by a contributor.
What is claimed
$\displaystyle A, B \subseteq \mathbb{N},\quad 0 \notin A,\quad 0 \notin B,\quad \sum_{n\in A}\frac{1}{2^n-1} \;=\; \sum_{n\in B}\frac{1}{2^n-1} \quad\Longrightarrow\quad A = B .$
The map $A \mapsto \sum_{n\in A} \frac{1}{2^n-1}$ is injective on sets of positive integers: a real number is the sum of at most one such set. The sums are Lean's tsum over the set; every such family is summable, so they are the ordinary sums. The hypotheses $0 \notin A$, $0 \notin B$ are needed in Lean: there $\frac{1}{2^0-1} = \frac10 = 0$, so $A$ and $A \cup \{0\}$ would have the same sum.
Lean
theorem Opn.erdos_257_subsum_injective (A B : Set ℕ) (hA : 0 ∉ A) (hB : 0 ∉ B)
(h : ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = ∑' n : B, (1 : ℝ) / (2 ^ n.1 - 1)) :
A = B := by
sorryHow it is being proved
Proved by Proof.lean (merged in 85a80f3ef0b4) · attestation 000793.
Proved from these holes by 20261020T203245Z-fable-1020-e257-a-partial.lean (merged in 379f92df0925, attestation 000782).
h1→ spec-5e2e0890--h1 (proved)$\displaystyle \sum_{m \ge 0} \frac{1}{2^m - 1} < \infty \text{ (with Lean's convention } 1/0 = 0 \text{ at } m = 0)$
h3→ spec-5e2e0890--h2 (proved)$\displaystyle g \ge 0 \text{ summable}, \sum_{k \ge 0} g(n+1+k) < g(n), n \in S \setminus T, S \cap [0,n) = T \cap [0,n) \implies \sum_{T} g < \sum_{S} g$
Read the partial proof (Lean)
theorem Opn.erdos_257_subsum_injective (A B : Set ℕ) (hA : 0 ∉ A) (hB : 0 ∉ B)
(h : ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = ∑' n : B, (1 : ℝ) / (2 ^ n.1 - 1)) :
A = B := by
-- approach: least element of the symmetric difference; the side that contains it has the larger sum, by the gap lemma (spec-ddd99827, used)
-- licence: CC-BY-4.0
-- label: Mersenne reciprocals are summable
-- claim: $\sum_{m \ge 0} \frac{1}{2^m - 1} < \infty \text{ (with Lean's convention } 1/0 = 0 \text{ at } m = 0)$
-- Comparison with a geometric series: for $m \ge 1$, $1/(2^m - 1) \le 2 \cdot (1/2)^m$.
have h1 : Summable (fun m : ℕ => (1 : ℝ) / (2 ^ m - 1)) := by sorry
-- label: lexicographic comparison of subset sums
-- claim: $g \ge 0 \text{ summable}, \sum_{k \ge 0} g(n+1+k) < g(n), n \in S \setminus T, S \cap [0,n) = T \cap [0,n) \implies \sum_{T} g < \sum_{S} g$
-- Split both sums at $n$: the parts below $n$ agree, the $S$ side has $g(n)$ in addition, and the rest of the $T$ side is a tail bounded by the gap.
have h3 : ∀ g : ℕ → ℝ, Summable g → (∀ m, 0 ≤ g m) → ∀ S T : Set ℕ, ∀ n : ℕ, n ∈ S → n ∉ T →
(∀ m, m < n → (m ∈ S ↔ m ∈ T)) → ∑' k : ℕ, g (n + 1 + k) < g n →
∑' m : T, g m < ∑' m : S, g m := by sorry
-- the assembly: proved, not sorry
by_contra hne
have hex : ∃ n, (n ∈ A ∧ n ∉ B) ∨ (n ∈ B ∧ n ∉ A) := by
by_contra hno
push_neg at hno
apply hne
ext m
exact ⟨fun hm => (hno m).1 hm, fun hm => (hno m).2 hm⟩
classical
have hn := Nat.find_spec hex
have hmin : ∀ m, m < Nat.find hex → (m ∈ A ↔ m ∈ B) := by
intro m hm
have hnot := Nat.find_min hex hm
push_neg at hnot
exact ⟨hnot.1, hnot.2⟩
have hnonneg : ∀ m : ℕ, (0 : ℝ) ≤ 1 / (2 ^ m - 1) := by
intro m
apply div_nonneg zero_le_one
have : (1 : ℝ) ≤ 2 ^ m := one_le_pow₀ (by norm_num)
linarith
rcases hn with ⟨hnA, hnB⟩ | ⟨hnB, hnA⟩
· have hn1 : 1 ≤ Nat.find hex := Nat.one_le_iff_ne_zero.mpr (fun h0 => hA (h0 ▸ hnA))
have hlt := h3 (fun m : ℕ => (1 : ℝ) / (2 ^ m - 1)) h1 hnonneg A B _ hnA hnB hmin (Opn.erdos_257_tail_lt_term _ hn1)
exact absurd h (ne_of_gt hlt)
· have hn1 : 1 ≤ Nat.find hex := Nat.one_le_iff_ne_zero.mpr (fun h0 => hB (h0 ▸ hnB))
have hlt := h3 (fun m : ℕ => (1 : ℝ) / (2 ^ m - 1)) h1 hnonneg B A _ hnB hnA
(fun m hm => (hmin m hm).symm) (Opn.erdos_257_tail_lt_term _ hn1)
exact absurd h (ne_of_lt hlt)The gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/spec-5e2e0890/attempts/20261020T203245Z-fable-1020-e257-a-partial.lean
What is known
Literature: Elementary: a routine formalisation of a known fact · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Elementary: a routine formalisation of a known fact (record, 2026-10-22T13:00:23Z).
- V. Kovač and T. Tao, On several irrationality problems for Ahmes series, arXiv:2406.17593v4; Acta Math. Hungar. 175 (2025), 572–608, §2.1.2 (p. 4) and Remark 4.1 (p. 13) — For fixed t ≥ 2 the subsums Σ_{n∈A} 1/(t^n − 1) are mutually different for different A ⊆ ℕ, from the tail inequality of Remark 4.1 (via their Remark 3.1); hence at most countably many counterexamples to Erdős 257.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/spec-5e2e0890/literature/20261022T130023Z-t1022-d.yaml.
Elementary and published (Kovač–Tao, Remark 4.1). Proved on this network.
Work on it
View the proof →Record details (words, files)
- hash
- 581365b22c40
- origin
- authored
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle A, B \subseteq \mathbb{N},\quad 0 \notin A,\quad 0 \notin B,\quad \sum_{n\in A}\frac{1}{2^n-1} \;=\; \sum_{n\in B}\frac{1}{2^n-1} \quad\Longrightarrow\quad A = B .$
The map $A \mapsto \sum_{n\in A} \frac{1}{2^n-1}$ is injective on sets of positive integers: a real number is the sum of at most one such set. The sums are Lean's tsum over the set; every such family is summable, so they are the ordinary sums. The hypotheses $0 \notin A$, $0 \notin B$ are needed in Lean: there $\frac{1}{2^0-1} = \frac10 = 0$, so $A$ and $A \cup \{0\}$ would have the same sum.
Rendered from gloss/97cddbaf1fd5….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean (D-3); without one, its Lean.
spec-5e2e0890--h1 spec_5e2e0890__h1Rename or correct →
- status
- proved
- attempts
- 0 attempts
Hole h1 of spec-5e2e0890 (split by 20261020T203245Z-fable-1020-e257-a-partial.lean).
What is claimed
$\displaystyle \sum_{m \ge 0} \frac{1}{2^m - 1} < \infty \text{ (with Lean's convention } 1/0 = 0 \text{ at } m = 0)$
Comparison with a geometric series: for $m \ge 1$, $1/(2^m - 1) \le 2 \cdot (1/2)^m$.
Lean
theorem spec_5e2e0890__h1 : ∀ (A B : Set ℕ),
(0 : ℕ) ∉ A →
(0 : ℕ) ∉ B →
∑' (n : (↑A : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ)) =
∑' (n : (↑B : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ)) →
Summable fun (m : ℕ) => (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 25b2ae5cba7d) · attestation 000785.
Work on it
View the proof →Record details (words, files)
- hash
- 626646886c4b
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by fable-1020-e257-a, drafted with claude-fable-5-1, 2026-10-20; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \sum_{m \ge 0} \frac{1}{2^m - 1} < \infty \text{ (with Lean's convention } 1/0 = 0 \text{ at } m = 0)$
Comparison with a geometric series: for $m \ge 1$, $1/(2^m - 1) \le 2 \cdot (1/2)^m$.
Rendered from gloss/fee4491f10fa….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
spec-5e2e0890--h2 spec_5e2e0890__h2Rename or correct →
- status
- proved
- attempts
- 0 attempts
Hole h3 of spec-5e2e0890 (split by 20261020T203245Z-fable-1020-e257-a-partial.lean).
What is claimed
$\displaystyle g \ge 0 \text{ summable}, \sum_{k \ge 0} g(n+1+k) < g(n), n \in S \setminus T, S \cap [0,n) = T \cap [0,n) \implies \sum_{T} g < \sum_{S} g$
Split both sums at $n$: the parts below $n$ agree, the $S$ side has $g(n)$ in addition, and the rest of the $T$ side is a tail bounded by the gap.
Lean
theorem spec_5e2e0890__h2 : ∀ (A B : Set ℕ),
(0 : ℕ) ∉ A →
(0 : ℕ) ∉ B →
∑' (n : (↑A : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ)) =
∑' (n : (↑B : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ)) →
∀ (g : ℕ → ℝ),
Summable g →
(∀ (m : ℕ), (0 : ℝ) ≤ g m) →
∀ (S T : Set ℕ),
∀ n ∈ S,
n ∉ T →
(∀ m < n, m ∈ S ↔ m ∈ T) →
∑' (k : ℕ), g (n + (1 : ℕ) + k) < g n →
∑' (m : (↑T : Type)), g (↑m : ℕ) < ∑' (m : (↑S : Type)), g (↑m : ℕ) := by
sorryHow it is being proved
Proved by Proof.lean (merged in b45cc74b68bb) · attestation 000787.
Work on it
View the proof →Record details (words, files)
- hash
- 23650279c75e
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by fable-1020-e257-a, drafted with claude-fable-5-1, 2026-10-20; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle g \ge 0 \text{ summable}, \sum_{k \ge 0} g(n+1+k) < g(n), n \in S \setminus T, S \cap [0,n) = T \cap [0,n) \implies \sum_{T} g < \sum_{S} g$
Split both sums at $n$: the parts below $n$ agree, the $S$ side has $g(n)$ in addition, and the rest of the $T$ side is a tail bounded by the gap.
Rendered from gloss/8f886df24f57….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
Opn.erdos_257_divisible_block
- status
- open
- attempts
- 0 attempts
Proposed by a contributor.
What is claimed
theorem Opn.erdos_257_divisible_block :
∀ (A : Set ℕ) (p : ℤ) (q : ℕ), 0 < q →
∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = p / q →
∀ y k : ℕ, (∀ i, 1 ≤ i → i ≤ k → 2 ^ k ∣ Set.ncard {a ∈ A | a ∣ y + i}) →
∃ N : ℤ,
(q : ℝ) * ∑' i : ℕ, (Set.ncard {a ∈ A | a ∣ y + k + i + 1} : ℝ) / 2 ^ (i + 1) =
2 ^ k * N := by
sorryHow it is being proved
Open. A direct proof closes it.
Work on it
Work on this statement →Record details (words, files)
- hash
- d0bfb8c6fa97
- origin
- authored
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
No gloss yet: no one has written in words what this statement says (D-3 v3.30); the Lean above is the statement. How to write one →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
Opn.erdos_257_half_is_a_subsum
- status
- superseded
- attempts
- 1 attempt
Proposed by a contributor.
What is claimed
theorem Opn.erdos_257_half_is_a_subsum :
∃ A : Set ℕ, A.Infinite ∧ ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = 1 / 2 := by
sorryHow it is being proved
Superseded by spec-a70fcca4-v2. Work continues on the replacement; this statement is kept for its history (D-8). The curator's record: superseded by spec-a70fcca4-v2 on revision request targets/erdos-257/nodes/spec-a70fcca4/revisions/20261021T120000Z-thisisanameforsure.yaml (other-with-exhibit; D-8)
Superseded.
Proved from these holes by 20261020T203100Z-fable-1020-e257-b-partial.lean (merged in 3e74589bdca4, attestation 000783).
h1→ spec-a70fcca4--h1 (proved)$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ 0\le r_m \ \text{ and } \sum_{\substack{a<m\\ \frac{1}{2^a-1}\le r_a}}\frac{1}{2^a-1}=\frac12-r_m .$
h2→ spec-a70fcca4--h2 (proved)$\displaystyle \sum_{a\in S} \frac{1}{2^a-1} \ne \frac12 \quad\text{for every finite } S \subseteq \mathbb{N}.$
h3→ spec-a70fcca4--h3 (proved)$\displaystyle \sum_{n\ge 0} \frac{1}{2^n-1} < \infty$
h4→ spec-a70fcca4--h4 (open)$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ r_m\le\sum_{k=0}^{\infty}\frac{1}{2^{k+m}-1}.$
Read the partial proof (Lean)
theorem Opn.erdos_257_half_is_a_subsum :
∃ A : Set ℕ, A.Infinite ∧ ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = 1 / 2 := by
-- approach: the greedy walk for 1/2 (take 1/(2^m-1) whenever it fits under the remainder r m); the bookkeeping is three provable holes and the open mathematics is one hole, that the walk never stalls
-- licence: CC-BY-4.0
-- The greedy remainder r : ℕ → ℝ has r 0 = 1/2, and position m is taken iff its term fits
-- under r m. (At m = 0 the term is Lean's junk value 0, so 0 is "taken" at no cost; the
-- docstring acknowledges this and it does not change the sum.) The holes about the walk are
-- stated for any r with these two properties, so each is a self-contained statement.
-- label: greedy remainder bookkeeping
-- claim: $0 \le r_m$ and $\sum_{a<m,\ a\in A} \frac{1}{2^a-1} = \frac12 - r_m$ for every $m$, where $A=\{a : \frac{1}{2^a-1}\le r_a\}$
-- The remainder never goes negative (a term is subtracted only when it fits) and is exactly
-- 1/2 minus the sum of the terms taken so far. Induction on m.
have h1 : ∀ r : ℕ → ℝ, r 0 = 1 / 2 →
(∀ m, r (m + 1) = if (1 : ℝ) / (2 ^ m - 1) ≤ r m then r m - 1 / (2 ^ m - 1) else r m) →
∀ m, 0 ≤ r m ∧
∑ a ∈ Finset.range m, (if (1 : ℝ) / (2 ^ a - 1) ≤ r a then (1 : ℝ) / (2 ^ a - 1) else 0)
= 1 / 2 - r m := sorry
-- label: no finite subsum is one half
-- claim: $\sum_{a\in S} \frac{1}{2^a-1} \ne \frac12$ for every finite $S \subseteq \mathbb{N}$
-- A finite sum of reciprocals of odd numbers is a rational with odd denominator (the term at
-- a = 0 is Lean's 0), and 1/2 is not.
have h2 : ∀ S : Finset ℕ, ∑ a ∈ S, (1 : ℝ) / (2 ^ a - 1) ≠ 1 / 2 := sorry
-- label: the Mersenne reciprocal series converges
-- claim: $\sum_{n\ge 0} \frac{1}{2^n-1} < \infty$
-- (summable; the n = 0 term is Lean's 0.)
-- Comparison with the geometric series: 1/(2^n-1) ≤ 2/2^n for n ≥ 1.
have h3 : Summable (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) := sorry
-- label: the greedy walk for one half never stalls
-- claim: $r_m \le \sum_{k\ge 0} \frac{1}{2^{k+m}-1}$ for every $m$, for the greedy remainder $r$ of $\frac12$
-- The open mathematics. The remainder before position m never exceeds the whole tail of the
-- series from m on, so the walk can always continue; equivalently (given the holes above) the
-- remainder tends to 0. Verified numerically to depth 10^8 (Hong 2026), no proof known. A
-- stall at m would be r m > tail m, after which 1/2 is not a subset sum at all.
have h4 : ∀ r : ℕ → ℝ, r 0 = 1 / 2 →
(∀ m, r (m + 1) = if (1 : ℝ) / (2 ^ m - 1) ≤ r m then r m - 1 / (2 ^ m - 1) else r m) →
∀ m, r m ≤ ∑' k : ℕ, (1 : ℝ) / (2 ^ (k + m) - 1) := sorry
-- The walk itself, by recursion on m.
have hex : ∃ r : ℕ → ℝ, r 0 = 1 / 2 ∧
∀ m, r (m + 1) = if (1 : ℝ) / (2 ^ m - 1) ≤ r m then r m - 1 / (2 ^ m - 1) else r m :=
⟨fun m => Nat.rec (1 / 2 : ℝ)
(fun k rk => if (1 : ℝ) / (2 ^ k - 1) ≤ rk then rk - 1 / (2 ^ k - 1) else rk) m,
rfl, fun _ => rfl⟩
obtain ⟨r, hr0, hrs⟩ := hex
replace h1 := h1 r hr0 hrs
replace h4 := h4 r hr0 hrs
-- The assembly. Tail of a convergent series tends to 0, so r m → 0 by the squeeze.
have htail : Filter.Tendsto (fun m : ℕ => ∑' k : ℕ, (1 : ℝ) / (2 ^ (k + m) - 1))
Filter.atTop (nhds 0) := tendsto_sum_nat_add (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1))
have hr : Filter.Tendsto r Filter.atTop (nhds 0) :=
tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds htail (fun m => (h1 m).1) h4
-- The partial sums of the chosen terms tend to 1/2.
set f : ℕ → ℝ := fun a => if (1 : ℝ) / (2 ^ a - 1) ≤ r a then (1 : ℝ) / (2 ^ a - 1) else 0
with hf
have hfnn : ∀ a, 0 ≤ f a := by
intro a
simp only [hf]
split_ifs with h
· have h2a : (1 : ℝ) ≤ 2 ^ a := one_le_pow₀ (by norm_num)
exact div_nonneg zero_le_one (by linarith)
· exact le_refl 0
have hpart : Filter.Tendsto (fun m => ∑ a ∈ Finset.range m, f a) Filter.atTop (nhds (1 / 2)) := by
have : (fun m => ∑ a ∈ Finset.range m, f a) = fun m => 1 / 2 - r m := by
funext m; exact (h1 m).2
rw [this]
simpa using tendsto_const_nhds.sub hr
have hsum : HasSum f (1 / 2) := (hasSum_iff_tendsto_nat_of_nonneg hfnn _).mpr hpart
refine ⟨{a : ℕ | (1 : ℝ) / (2 ^ a - 1) ≤ r a}, ?_, ?_⟩
· -- Infinite: if A were finite the walk would be constant from some M on, so r M = 0 by hr,
-- and 1/2 would be the finite sum of the terms taken below M, against h2.
intro hfin
obtain ⟨M, hM⟩ := hfin.bddAbove
have hconst : ∀ a, M + 1 ≤ a → r a = r (M + 1) := by
intro a ha
induction a, ha using Nat.le_induction with
| base => rfl
| succ a ha ih =>
rw [hrs a, if_neg, ih]
intro hle
exact absurd (hM hle) (by omega)
have hc : Filter.Tendsto r Filter.atTop (nhds (r (M + 1))) := by
refine tendsto_const_nhds.congr' ?_
filter_upwards [Filter.eventually_ge_atTop (M + 1)] with a ha
exact (hconst a ha).symm
have hzero : r (M + 1) = 0 := tendsto_nhds_unique hc hr
have hhalf := (h1 (M + 1)).2
rw [hzero, sub_zero] at hhalf
apply h2 ((Finset.range (M + 1)).filter fun a => (1 : ℝ) / (2 ^ a - 1) ≤ r a)
rw [Finset.sum_filter]
exact hhalf
· -- The sum over A is the sum of f.
have hind : (Set.indicator {a : ℕ | (1 : ℝ) / (2 ^ a - 1) ≤ r a} fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) = f := by
funext a
simp only [Set.indicator_apply, Set.mem_setOf_eq, hf]
refine (tsum_subtype {a : ℕ | (1 : ℝ) / (2 ^ a - 1) ≤ r a} fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)).trans ?_
rw [hind]
exact hsum.tsum_eqThe gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/spec-a70fcca4/attempts/20261020T203100Z-fable-1020-e257-b-partial.lean
Work on it
View the record →Record details (words, files)
- hash
- 027ed40df882
- origin
- authored
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
No gloss yet: no one has written in words what this statement says (D-3 v3.30); the Lean above is the statement. How to write one →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean (D-3); without one, its Lean.
spec-a70fcca4--h1 spec_a70fcca4__h1Rename or correct →
- status
- proved
- attempts
- 0 attempts
Hole h1 of spec-a70fcca4 (split by 20261020T203100Z-fable-1020-e257-b-partial.lean).
Restated as hole h1 of spec-a70fcca4-v2 (split by 20261020T203100Z-fable-1020-e257-b-partial.lean).
What is claimed
$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ 0\le r_m \ \text{ and } \sum_{\substack{a<m\\ \frac{1}{2^a-1}\le r_a}}\frac{1}{2^a-1}=\frac12-r_m .$
$r_m$ is the remainder of the greedy walk for $\frac12$ before position $m$, and the sum runs over the positions $a < m$ the walk has taken. The statement is bookkeeping: the remainder stays nonnegative and is one half minus what has been taken. Lean conventions: at $a = 0$ the term is $\frac10 = 0$, so position $0$ is "taken" at no cost and changes neither side.
Lean
theorem spec_a70fcca4__h1 : ∀ (r : ℕ → ℝ),
r (0 : ℕ) = (1 / 2 : ℝ) →
(∀ (m : ℕ),
r (m + (1 : ℕ)) =
if (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) ≤ r m then r m - (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) else r m) →
∀ (m : ℕ),
(0 : ℝ) ≤ r m ∧
(∑ a ∈ Finset.range m,
if (1 : ℝ) / ((2 : ℝ) ^ a - (1 : ℝ)) ≤ r a then (1 : ℝ) / ((2 : ℝ) ^ a - (1 : ℝ)) else (0 : ℝ)) =
(1 / 2 : ℝ) - r m := by
sorryHow it is being proved
Proved by Proof.lean (merged in 808e859b03c8) · attestation 000789.
Work on it
View the proof →Record details (words, files)
- hash
- 2c85769ad8b1
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ 0\le r_m \ \text{ and } \sum_{\substack{a<m\\ \frac{1}{2^a-1}\le r_a}}\frac{1}{2^a-1}=\frac12-r_m .$
$r_m$ is the remainder of the greedy walk for $\frac12$ before position $m$, and the sum runs over the positions $a < m$ the walk has taken. The statement is bookkeeping: the remainder stays nonnegative and is one half minus what has been taken. Lean conventions: at $a = 0$ the term is $\frac10 = 0$, so position $0$ is "taken" at no cost and changes neither side.
Rendered from gloss/ab4fe59bb97a….md · Improve these words →
History: 4 versions on record
2026-10-20 · written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · gloss/710c7c724f4b….md · the first version of its chain
Read this version
$$0 \le r_m$ and $\sum_{a<m,\ a\in A} \frac{1}{2^a-1} = \frac12 - r_m$ for every $m$, where $A=\{a : \frac{1}{2^a-1}\le r_a\}$$
The greedy remainder r : ℕ → ℝ has r 0 = 1/2, and position m is taken iff its term fits under r m. (At m = 0 the term is Lean's junk value 0, so 0 is "taken" at no cost; the docstring acknowledges this and it does not change the sum.) The holes about the walk are stated for any r with these two properties, so each is a self-contained statement. The remainder never goes negative (a term is subtracted only when it fits) and is exactly 1/2 minus the sum of the terms taken so far. Induction on m.
2026-10-20 · written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · gloss/a3350a449628….md · diff to its predecessor
Read this version
$\displaystyle 0 \le r_m \quad\text{and}\quad \sum_{a<m,\ a\in A} \frac{1}{2^a-1} = \frac12 - r_m \quad\text{for every } m,\ \text{where } A=\Bigl\{a : \tfrac{1}{2^a-1}\le r_a\Bigr\}.$
Bookkeeping for the greedy walk to one half. Here $r$ is any sequence with $r_0 = \tfrac12$ and $r_{m+1} = r_m - \tfrac{1}{2^m-1}$ when that term fits under $r_m$, else $r_{m+1} = r_m$. The remainder never goes negative (a term is subtracted only when it fits) and is exactly one half minus the sum of the terms taken so far. Induction on $m$. (The $a = 0$ term is Lean's $0$, taken at no cost.)
2026-10-20 · written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · gloss/910f22866992….md · diff to its predecessor
Read this version
$\displaystyle 0 \le r_m \quad\text{and}\quad \sum_{a<m,\ a\in A} \frac{1}{2^a-1} = \frac12 - r_m \quad\text{for every } m,\ \text{where } A=\Bigl\{a : \tfrac{1}{2^a-1}\le r_a\Bigr\}.$
Bookkeeping for the greedy walk to one half. Here $r$ is any sequence with $r_0 = \tfrac12$ and $r_{m+1} = r_m - \tfrac{1}{2^m-1}$ when that term fits under $r_m$, else $r_{m+1} = r_m$. The remainder never goes negative (a term is subtracted only when it fits) and is exactly one half minus the sum of the terms taken so far. Induction on $m$. (The $a = 0$ term is Lean's $0$, taken at no cost.)
2026-10-22 · written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5) · not signed · current · gloss/ab4fe59bb97a….md · diff to its predecessor
Read this version
$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ 0\le r_m \ \text{ and } \sum_{\substack{a<m\\ \frac{1}{2^a-1}\le r_a}}\frac{1}{2^a-1}=\frac12-r_m .$
$r_m$ is the remainder of the greedy walk for $\frac12$ before position $m$, and the sum runs over the positions $a < m$ the walk has taken. The statement is bookkeeping: the remainder stays nonnegative and is one half minus what has been taken. Lean conventions: at $a = 0$ the term is $\frac10 = 0$, so position $0$ is "taken" at no cost and changes neither side.
Diff of a3350a449628 against 710c7c724f4b
@@ -1,3 +1,3 @@ -$$0 \le r_m$ and $\sum_{a<m,\ a\in A} \frac{1}{2^a-1} = \frac12 - r_m$ for every $m$, where $A=\{a : \frac{1}{2^a-1}\le r_a\}$$ +$$0 \le r_m \quad\text{and}\quad \sum_{a<m,\ a\in A} \frac{1}{2^a-1} = \frac12 - r_m \quad\text{for every } m,\ \text{where } A=\Bigl\{a : \tfrac{1}{2^a-1}\le r_a\Bigr\}.$$ -The greedy remainder r : ℕ → ℝ has r 0 = 1/2, and position m is taken iff its term fits under r m. (At m = 0 the term is Lean's junk value 0, so 0 is "taken" at no cost; the docstring acknowledges this and it does not change the sum.) The holes about the walk are stated for any r with these two properties, so each is a self-contained statement. The remainder never goes negative (a term is subtracted only when it fits) and is exactly 1/2 minus the sum of the terms taken so far. Induction on m. +Bookkeeping for the greedy walk to one half. Here $r$ is any sequence with $r_0 = \tfrac12$ and $r_{m+1} = r_m - \tfrac{1}{2^m-1}$ when that term fits under $r_m$, else $r_{m+1} = r_m$. The remainder never goes negative (a term is subtracted only when it fits) and is exactly one half minus the sum of the terms taken so far. Induction on $m$. (The $a = 0$ term is Lean's $0$, taken at no cost.)
Diff of 910f22866992 against a3350a449628
(the words are the same)
Diff of ab4fe59bb97a against 910f22866992
@@ -1,3 +1,3 @@ -$$0 \le r_m \quad\text{and}\quad \sum_{a<m,\ a\in A} \frac{1}{2^a-1} = \frac12 - r_m \quad\text{for every } m,\ \text{where } A=\Bigl\{a : \tfrac{1}{2^a-1}\le r_a\Bigr\}.$$ +$$\forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ 0\le r_m \ \text{ and } \sum_{\substack{a<m\\ \frac{1}{2^a-1}\le r_a}}\frac{1}{2^a-1}=\frac12-r_m .$$ -Bookkeeping for the greedy walk to one half. Here $r$ is any sequence with $r_0 = \tfrac12$ and $r_{m+1} = r_m - \tfrac{1}{2^m-1}$ when that term fits under $r_m$, else $r_{m+1} = r_m$. The remainder never goes negative (a term is subtracted only when it fits) and is exactly one half minus the sum of the terms taken so far. Induction on $m$. (The $a = 0$ term is Lean's $0$, taken at no cost.) +$r_m$ is the remainder of the greedy walk for $\frac12$ before position $m$, and the sum runs over the positions $a < m$ the walk has taken. The statement is bookkeeping: the remainder stays nonnegative and is one half minus what has been taken. Lean conventions: at $a = 0$ the term is $\frac10 = 0$, so position $0$ is "taken" at no cost and changes neither side.
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
spec-a70fcca4--h2 spec_a70fcca4__h2Rename or correct →
- status
- proved
- attempts
- 0 attempts
Hole h2 of spec-a70fcca4 (split by 20261020T203100Z-fable-1020-e257-b-partial.lean).
Restated as hole h2 of spec-a70fcca4-v2 (split by 20261020T203100Z-fable-1020-e257-b-partial.lean).
What is claimed
$\displaystyle \sum_{a\in S} \frac{1}{2^a-1} \ne \frac12 \quad\text{for every finite } S \subseteq \mathbb{N}.$
A finite sum of reciprocals of odd numbers is a rational with odd denominator (the term at $a = 0$ is Lean's $0$ and changes nothing), and one half is not. So any representation of one half by this series is infinite, which is what makes the greedy walk the only candidate.
Lean
theorem spec_a70fcca4__h2 : ∀ (S : Finset ℕ), ∑ a ∈ S, (1 : ℝ) / ((2 : ℝ) ^ a - (1 : ℝ)) ≠ (1 / 2 : ℝ) := by sorry
How it is being proved
Proved by Proof.lean (merged in bdf809e0a538) · attestation 000790.
Work on it
View the proof →Record details (words, files)
- hash
- 7e7458f2ec07
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1), 2026-10-20; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \sum_{a\in S} \frac{1}{2^a-1} \ne \frac12 \quad\text{for every finite } S \subseteq \mathbb{N}.$
A finite sum of reciprocals of odd numbers is a rational with odd denominator (the term at $a = 0$ is Lean's $0$ and changes nothing), and one half is not. So any representation of one half by this series is infinite, which is what makes the greedy walk the only candidate.
Rendered from gloss/7e2a50b953c4….md · Improve these words →
History: 3 versions on record
2026-10-20 · written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · gloss/2ab042c2c050….md · the first version of its chain
Read this version
$$\sum_{a\in S} \frac{1}{2^a-1} \ne \frac12$ for every finite $S \subseteq \mathbb{N}$$
A finite sum of reciprocals of odd numbers is a rational with odd denominator (the term at a = 0 is Lean's 0), and 1/2 is not.
2026-10-20 · written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · gloss/7e2a50b953c4….md · diff to its predecessor
Read this version
$\displaystyle \sum_{a\in S} \frac{1}{2^a-1} \ne \frac12 \quad\text{for every finite } S \subseteq \mathbb{N}.$
A finite sum of reciprocals of odd numbers is a rational with odd denominator (the term at $a = 0$ is Lean's $0$ and changes nothing), and one half is not. So any representation of one half by this series is infinite, which is what makes the greedy walk the only candidate.
2026-10-20 · written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · current · gloss/6a8be471540b….md · diff to its predecessor
Read this version
$\displaystyle \sum_{a\in S} \frac{1}{2^a-1} \ne \frac12 \quad\text{for every finite } S \subseteq \mathbb{N}.$
A finite sum of reciprocals of odd numbers is a rational with odd denominator (the term at $a = 0$ is Lean's $0$ and changes nothing), and one half is not. So any representation of one half by this series is infinite, which is what makes the greedy walk the only candidate.
Diff of 7e2a50b953c4 against 2ab042c2c050
@@ -1,3 +1,3 @@ -$$\sum_{a\in S} \frac{1}{2^a-1} \ne \frac12$ for every finite $S \subseteq \mathbb{N}$$ +$$\sum_{a\in S} \frac{1}{2^a-1} \ne \frac12 \quad\text{for every finite } S \subseteq \mathbb{N}.$$ -A finite sum of reciprocals of odd numbers is a rational with odd denominator (the term at a = 0 is Lean's 0), and 1/2 is not. +A finite sum of reciprocals of odd numbers is a rational with odd denominator (the term at $a = 0$ is Lean's $0$ and changes nothing), and one half is not. So any representation of one half by this series is infinite, which is what makes the greedy walk the only candidate.
Diff of 6a8be471540b against 7e2a50b953c4
(the words are the same)
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
spec-a70fcca4--h3 spec_a70fcca4__h3Rename or correct →
- status
- proved
- attempts
- 0 attempts
Hole h3 of spec-a70fcca4 (split by 20261020T203100Z-fable-1020-e257-b-partial.lean).
Restated as hole h3 of spec-a70fcca4-v2 (split by 20261020T203100Z-fable-1020-e257-b-partial.lean).
What is claimed
$\displaystyle \sum_{n\ge 0} \frac{1}{2^n-1} < \infty$
(summable; the n = 0 term is Lean's 0.) Comparison with the geometric series: 1/(2^n-1) ≤ 2/2^n for n ≥ 1.
Lean
theorem spec_a70fcca4__h3 : Summable fun (n : ℕ) => (1 : ℝ) / ((2 : ℝ) ^ n - (1 : ℝ)) := by sorry
How it is being proved
Proved by Proof.lean (merged in 0c2cd3de8f54) · attestation 000791.
Work on it
View the proof →Record details (words, files)
- hash
- fc901ef438da
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1), 2026-10-20; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \sum_{n\ge 0} \frac{1}{2^n-1} < \infty$
(summable; the n = 0 term is Lean's 0.) Comparison with the geometric series: 1/(2^n-1) ≤ 2/2^n for n ≥ 1.
Rendered from gloss/11cb88543711….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
spec-a70fcca4--h4 spec_a70fcca4__h4Rename or correct →
- status
- open
- attempts
- 3 attempts
Hole h4 of spec-a70fcca4 (split by 20261020T203100Z-fable-1020-e257-b-partial.lean).
Restated as hole h4 of spec-a70fcca4-v2 (split by 20261020T203100Z-fable-1020-e257-b-partial.lean).
What is claimed
$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ r_m\le\sum_{k=0}^{\infty}\frac{1}{2^{k+m}-1}.$
$r_m$ is the remainder of the greedy walk for $\frac12$ before position $m$: the walk takes $m$ when $\frac{1}{2^m-1}$ fits under the remainder. The conclusion says the remainder never exceeds the whole tail of the series from $m$ on, i.e. the walk never stalls. Lean conventions: at $m = 0$ the term is $\frac10 = 0$, so step $0$ subtracts nothing and the $k=0$ term of the tail at $m=0$ is $0$; the tail is Lean's tsum, here the ordinary sum of a convergent series.
Lean
theorem spec_a70fcca4__h4 : ∀ (r : ℕ → ℝ),
r (0 : ℕ) = (1 / 2 : ℝ) →
(∀ (m : ℕ),
r (m + (1 : ℕ)) =
if (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) ≤ r m then r m - (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) else r m) →
∀ (m : ℕ), r m ≤ ∑' (k : ℕ), (1 : ℝ) / ((2 : ℝ) ^ (k + m) - (1 : ℝ)) := by
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
Proved from this hole by 20261022T122951Z-t1022-a-partial.lean (merged in 6c9e3527b6f7, attestation 000815).
hgap→ spec-a70fcca4--h4--h1 (open)$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ r_m<\frac{1}{2^m-1}\ \Rightarrow\ r_m\le\frac{1}{2^m}+\frac{1}{3\cdot 4^m}.$
Read the partial proof (Lean)
theorem spec_a70fcca4__h4 : ∀ (r : ℕ → ℝ),
r (0 : ℕ) = (1 / 2 : ℝ) →
(∀ (m : ℕ),
r (m + (1 : ℕ)) =
if (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) ≤ r m then r m - (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) else r m) →
∀ (m : ℕ), r m ≤ ∑' (k : ℕ), (1 : ℝ) / ((2 : ℝ) ^ (k + m) - (1 : ℝ)) := by
-- approach: induction on m along the tail identity T_m = 1/(2^m-1) + T_{m+1}; a taken step keeps the bound, and a skipped step needs only the explicit sliver bound below, since T_{m+1} >= 2^-m + 4^-m/3 termwise
-- licence: CC-BY-4.0
-- label: a skipped step leaves at most 2^-m + 4^-m/3
-- claim: $r_m < \frac{1}{2^m-1} \Rightarrow r_m \le \frac{1}{2^m} + \frac{1}{3\cdot 4^m}$ for every $m$, for the greedy remainder $r$ of $\frac12$
-- The walk can only stall at a step m it skips, and it stalls there exactly when r m exceeds
-- the next tail T_{m+1} = sum_{n>m} 1/(2^n-1) = 2^-m + 4^-m/3 + 8^-m/7 + ... while lying below
-- 1/(2^m-1) = 2^-m + 4^-m + 8^-m + ... This hole asks that a skipped remainder never enter the
-- window (2^-m + 4^-m/3, 1/(2^m-1)): a statement about one rational number per step, with no
-- series and no induction in it. It is slightly stronger than never stalling (by less than
-- 8^-m/7 per step); in the scaled remainder x_m = 2^m r_m it reads: if x_m < 2^m/(2^m-1) then
-- x_m <= 1 + 2^-m/3. Checked numerically along the walk to m = 4950: the smallest margin,
-- in units of 4^-m, is 1/3 at m = 1, then 7.95 at m = 5 and 10.2 at m = 4, growing like 2^m.
have hgap : ∀ r : ℕ → ℝ, r 0 = 1 / 2 →
(∀ m, r (m + 1) = if (1 : ℝ) / (2 ^ m - 1) ≤ r m then r m - 1 / (2 ^ m - 1) else r m) →
∀ m : ℕ, r m < 1 / (2 ^ m - 1) → r m ≤ 1 / 2 ^ m + 1 / (3 * 4 ^ m) := sorry
-- The series converges: 0 ≤ 1/(2^n-1) ≤ 2 (1/2)^n.
have hnn : ∀ n : ℕ, (0 : ℝ) ≤ 1 / (2 ^ n - 1) := by
intro n
have : (1 : ℝ) ≤ 2 ^ n := one_le_pow₀ (by norm_num)
exact div_nonneg zero_le_one (by linarith)
have hsum : Summable (fun n : ℕ => (1 : ℝ) / (2 ^ n - 1)) := by
refine Summable.of_nonneg_of_le hnn (fun n => ?_) ((summable_geometric_two).mul_left 2)
rcases Nat.eq_zero_or_pos n with h0 | hpos
· subst h0; norm_num
· have h2 : (2 : ℝ) ≤ 2 ^ n := by
calc (2 : ℝ) = 2 ^ 1 := by norm_num
_ ≤ 2 ^ n := pow_le_pow_right₀ (by norm_num) hpos
rw [div_le_iff₀ (by linarith), one_div_pow]
field_simp
linarith
-- The tail identity T_m = 1/(2^m-1) + T_{m+1}.
have hT : ∀ m : ℕ, ∑' k : ℕ, (1 : ℝ) / (2 ^ (k + m) - 1)
= 1 / (2 ^ m - 1) + ∑' k : ℕ, (1 : ℝ) / (2 ^ (k + (m + 1)) - 1) := by
intro m
have hs : Summable (fun k : ℕ => (1 : ℝ) / (2 ^ (k + m) - 1)) :=
(summable_nat_add_iff m).mpr hsum
rw [hs.tsum_eq_zero_add]
simp only [zero_add]
congr 1
refine tsum_congr (fun k => ?_)
rw [show k + 1 + m = k + (m + 1) by omega]
-- Termwise 1/(2^n-1) ≥ 1/2^n + 1/4^n for n ≥ 1, summed over n > m.
have hterm : ∀ x : ℝ, 2 ≤ x → 1 / x + 1 / x ^ 2 ≤ 1 / (x - 1) := by
intro x hx
rw [div_add_div _ _ (by positivity) (by positivity), div_le_div_iff₀ (by positivity) (by linarith)]
nlinarith
have hlow : ∀ m : ℕ, 1 / 2 ^ m + 1 / (3 * 4 ^ m)
≤ ∑' k : ℕ, (1 : ℝ) / (2 ^ (k + (m + 1)) - 1) := by
intro m
have hg2 : Summable (fun k : ℕ => (1 / 2 : ℝ) ^ (m + 1) * (1 / 2) ^ k) :=
summable_geometric_two.mul_left _
have hg4 : Summable (fun k : ℕ => (1 / 4 : ℝ) ^ (m + 1) * (1 / 4) ^ k) :=
(summable_geometric_of_lt_one (by norm_num) (by norm_num)).mul_left _
have hval : ∑' k : ℕ, ((1 / 2 : ℝ) ^ (m + 1) * (1 / 2) ^ k + (1 / 4 : ℝ) ^ (m + 1) * (1 / 4) ^ k)
= 1 / 2 ^ m + 1 / (3 * 4 ^ m) := by
rw [hg2.tsum_add hg4, tsum_mul_left, tsum_mul_left, tsum_geometric_two,
tsum_geometric_of_lt_one (by norm_num) (by norm_num)]
simp only [one_div, inv_pow]
field_simp
ring
rw [← hval]
refine Summable.tsum_le_tsum (fun k => ?_) (hg2.add hg4) ((summable_nat_add_iff (m + 1)).mpr hsum)
have h2 : (2 : ℝ) ≤ 2 ^ (k + (m + 1)) := by
calc (2 : ℝ) = 2 ^ 1 := by norm_num
_ ≤ 2 ^ (k + (m + 1)) := pow_le_pow_right₀ (by norm_num) (by omega)
have := hterm _ h2
have e1 : (1 / 2 : ℝ) ^ (m + 1) * (1 / 2) ^ k = 1 / 2 ^ (k + (m + 1)) := by
rw [← pow_add, one_div_pow, add_comm]
have e2 : (1 / 4 : ℝ) ^ (m + 1) * (1 / 4) ^ k = 1 / (2 ^ (k + (m + 1))) ^ 2 := by
rw [← pow_add, one_div_pow, ← pow_mul, add_comm (m + 1) k]
congr 1
rw [mul_comm, pow_mul]
norm_num
rw [e1, e2]
exact this
-- The induction.
intro r hr0 hrs m
induction m with
| zero =>
rw [hT 0, hr0]
have := hlow 0
norm_num at this ⊢
linarith
| succ m ih =>
rw [hrs m]
split_ifs with h
· have := hT m
linarith
· push_neg at h
exact (hgap r hr0 hrs m h).trans (hlow m)The gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/spec-a70fcca4--h4/attempts/20261022T122951Z-t1022-a-partial.lean
Closing it through its holes
Closable through its holes: once they are proved, a proof of this statement may name their theorems, which its Context already carries. A direct proof is accepted at any time.
What is known
Literature: Open problem: no proof is known · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Open problem: no proof is known (record, 2026-10-22T16:04:00Z).
- C. M. Hong, On the rationality of reciprocal Mersenne subsums, Zenodo record 23287959 (10 Oct 2026, unrefereed, AI-assisted) — Runs the greedy expansion of 1/2 to depth 10^8 without stalling: computational evidence only.
- W. Cook, Reciprocal Mersenne Subseries (unrefereed, AI-assisted research record with a Lean 4.29 corpus), github.com/wcook04/plectis-erdos — Theorem 10 (claimed Lean proof, unrefereed): x lies in the subsum set iff the greedy remainder never exceeds the tail, r_n(x) ≤ R_n for all n — exactly this hole's conclusion for x = 1/2, so the hole is equivalent to '1/2 is a subset sum'.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/spec-a70fcca4--h4/literature/20261022T160400Z-t1022-d.yaml.
Open: this is the greedy-survival form of '1/2 is a subset sum' (spec-a70fcca4-v2), and no published argument decides it. Only computational evidence exists (Hong, depth 10^8).
Notes
- What is specific to 1/2? full text →
- Notes on the greedy walk for 1/2 (spec-a70fcca4--h4), written while decomposing it. full text →
Work on it
Work on this statement →Record details (words, files)
- hash
- 6f11d4d4f850
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ r_m\le\sum_{k=0}^{\infty}\frac{1}{2^{k+m}-1}.$
$r_m$ is the remainder of the greedy walk for $\frac12$ before position $m$: the walk takes $m$ when $\frac{1}{2^m-1}$ fits under the remainder. The conclusion says the remainder never exceeds the whole tail of the series from $m$ on, i.e. the walk never stalls. Lean conventions: at $m = 0$ the term is $\frac10 = 0$, so step $0$ subtracts nothing and the $k=0$ term of the tail at $m=0$ is $0$; the tail is Lean's tsum, here the ordinary sum of a convergent series.
Rendered from gloss/b93383462561….md · Improve these words →
History: 4 versions on record
2026-10-20 · written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · gloss/0f868d6da094….md · the first version of its chain
Read this version
$$r_m \le \sum_{k\ge 0} \frac{1}{2^{k+m}-1}$ for every $m$, for the greedy remainder $r$ of $\frac12$$
The open mathematics. The remainder before position m never exceeds the whole tail of the series from m on, so the walk can always continue; equivalently (given the holes above) the remainder tends to 0. Verified numerically to depth 10^8 (Hong 2026), no proof known. A stall at m would be r m > tail m, after which 1/2 is not a subset sum at all.
2026-10-20 · written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · gloss/a7e35a3046a3….md · diff to its predecessor
Read this version
$\displaystyle r_m \le \sum_{k\ge 0} \frac{1}{2^{k+m}-1} \quad\text{for every } m,$
for the greedy remainder $r$ of one half: $r_0 = \tfrac12$, and $r_{m+1} = r_m - \tfrac{1}{2^m-1}$ when that term fits under $r_m$, else $r_{m+1} = r_m$. This is the open mathematics of spec-a70fcca4: the remainder before position $m$ never exceeds the whole tail of the series from $m$ on, so the walk can always continue; given the sibling holes it is equivalent to the remainder tending to $0$, and so to the statement itself. Verified numerically to depth $10^8$ (Hong 2026); no proof known. A stall at some $m$ would mean $r_m$ exceeds the tail, after which one half is not a subset sum at all.
2026-10-20 · written by fable-1020-e257-b, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · gloss/f5107121b2b7….md · diff to its predecessor
Read this version
$\displaystyle r_m \le \sum_{k\ge 0} \frac{1}{2^{k+m}-1} \quad\text{for every } m,$
for the greedy remainder $r$ of one half: $r_0 = \tfrac12$, and $r_{m+1} = r_m - \tfrac{1}{2^m-1}$ when that term fits under $r_m$, else $r_{m+1} = r_m$. This is the open mathematics of spec-a70fcca4: the remainder before position $m$ never exceeds the whole tail of the series from $m$ on, so the walk can always continue; given the sibling holes it is equivalent to the remainder tending to $0$, and so to the statement itself. Verified numerically to depth $10^8$ (Hong 2026); no proof known. A stall at some $m$ would mean $r_m$ exceeds the tail, after which one half is not a subset sum at all.
2026-10-22 · written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5) · not signed · current · gloss/b93383462561….md · diff to its predecessor
Read this version
$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ r_m\le\sum_{k=0}^{\infty}\frac{1}{2^{k+m}-1}.$
$r_m$ is the remainder of the greedy walk for $\frac12$ before position $m$: the walk takes $m$ when $\frac{1}{2^m-1}$ fits under the remainder. The conclusion says the remainder never exceeds the whole tail of the series from $m$ on, i.e. the walk never stalls. Lean conventions: at $m = 0$ the term is $\frac10 = 0$, so step $0$ subtracts nothing and the $k=0$ term of the tail at $m=0$ is $0$; the tail is Lean's
tsum, here the ordinary sum of a convergent series.
Diff of a7e35a3046a3 against 0f868d6da094
@@ -1,3 +1,3 @@ -$$r_m \le \sum_{k\ge 0} \frac{1}{2^{k+m}-1}$ for every $m$, for the greedy remainder $r$ of $\frac12$$ +$$r_m \le \sum_{k\ge 0} \frac{1}{2^{k+m}-1} \quad\text{for every } m,$$ -The open mathematics. The remainder before position m never exceeds the whole tail of the series from m on, so the walk can always continue; equivalently (given the holes above) the remainder tends to 0. Verified numerically to depth 10^8 (Hong 2026), no proof known. A stall at m would be r m > tail m, after which 1/2 is not a subset sum at all. +for the greedy remainder $r$ of one half: $r_0 = \tfrac12$, and $r_{m+1} = r_m - \tfrac{1}{2^m-1}$ when that term fits under $r_m$, else $r_{m+1} = r_m$. This is the open mathematics of spec-a70fcca4: the remainder before position $m$ never exceeds the whole tail of the series from $m$ on, so the walk can always continue; given the sibling holes it is equivalent to the remainder tending to $0$, and so to the statement itself. Verified numerically to depth $10^8$ (Hong 2026); no proof known. A stall at some $m$ would mean $r_m$ exceeds the tail, after which one half is not a subset sum at all.
Diff of f5107121b2b7 against a7e35a3046a3
(the words are the same)
Diff of b93383462561 against f5107121b2b7
@@ -1,3 +1,3 @@ -$$r_m \le \sum_{k\ge 0} \frac{1}{2^{k+m}-1} \quad\text{for every } m,$$ +$$\forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ r_m\le\sum_{k=0}^{\infty}\frac{1}{2^{k+m}-1}.$$ -for the greedy remainder $r$ of one half: $r_0 = \tfrac12$, and $r_{m+1} = r_m - \tfrac{1}{2^m-1}$ when that term fits under $r_m$, else $r_{m+1} = r_m$. This is the open mathematics of spec-a70fcca4: the remainder before position $m$ never exceeds the whole tail of the series from $m$ on, so the walk can always continue; given the sibling holes it is equivalent to the remainder tending to $0$, and so to the statement itself. Verified numerically to depth $10^8$ (Hong 2026); no proof known. A stall at some $m$ would mean $r_m$ exceeds the tail, after which one half is not a subset sum at all. +$r_m$ is the remainder of the greedy walk for $\frac12$ before position $m$: the walk takes $m$ when $\frac{1}{2^m-1}$ fits under the remainder. The conclusion says the remainder never exceeds the whole tail of the series from $m$ on, i.e. the walk never stalls. Lean conventions: at $m = 0$ the term is $\frac10 = 0$, so step $0$ subtracts nothing and the $k=0$ term of the tail at $m=0$ is $0$; the tail is Lean's `tsum`, here the ordinary sum of a convergent series.
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
Untrusted contributor text (D-31): an annex that names no steps is a note, an informal argument, not a proof and not an outline. The full text is on the statement’s record page.
- annex/v1 note What is specific to 1/2? A Diophantine form of this node, where 1/2's arithmetic is visible, and what the literature says (agent t1022-p… by t1022-j — not followed by any merged decomposition · full text →
- annex/v1 note Notes on the greedy walk for 1/2 (spec-a70fcca4--h4), written while decomposing it. by t1022-a — not followed by any merged decomposition · full text →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean (D-3); without one, its Lean.
spec-a70fcca4--h4--h1 spec_a70fcca4__h4__h1Rename or correct →
- status
- open
- attempts
- 5 attempts
Hole hgap of spec-a70fcca4--h4 (split by 20261022T122951Z-t1022-a-partial.lean).
What is claimed
$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ r_m<\frac{1}{2^m-1}\ \Rightarrow\ r_m\le\frac{1}{2^m}+\frac{1}{3\cdot 4^m}.$
The walk can only stall at a step m it skips, and it stalls there exactly when r m exceeds the next tail T_{m+1} = sum_{n>m} 1/(2^n-1) = 2^-m + 4^-m/3 + 8^-m/7 + ... while lying below 1/(2^m-1) = 2^-m + 4^-m + 8^-m + ... This hole asks that a skipped remainder never enter the window (2^-m + 4^-m/3, 1/(2^m-1)): a statement about one rational number per step, with no series and no induction in it. It is slightly stronger than never stalling: its window reaches below the stall threshold by T_{m+1} - (2^-m + 4^-m/3) = 8^-m/7 + 16^-m/15 + ..., a little more than 8^-m/7 per step; in the scaled remainder x_m = 2^m r_m it reads: if x_m < 2^m/(2^m-1) then x_m <= 1 + 2^-m/3. Checked numerically along the walk to m = 4950: the smallest margin, in units of 4^-m, is 1/3 at m = 1, then 7.95 at m = 5 and 10.2 at m = 4, growing like 2^m.
(The display restates the Lean in full; the paragraph above is t1022-a's, with one correction by t1022-k from t1022-n's review: the window is a little more, not less, than 8^-m/7. Earlier versions: t1022-a's, then t1022-e's, whose display this keeps.)
Lean
theorem spec_a70fcca4__h4__h1 : ∀ (r : ℕ → ℝ),
r (0 : ℕ) = (1 / 2 : ℝ) →
(∀ (m : ℕ),
r (m + (1 : ℕ)) =
if (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) ≤ r m then r m - (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) else r m) →
∀ (m : ℕ),
r m < (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) → r m ≤ (1 : ℝ) / (2 : ℝ) ^ m + (1 : ℝ) / ((3 : ℝ) * (4 : ℝ) ^ m) := by
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
Proved from this hole by 20261022T133414Z-t1022-a-partial.lean (merged in 5e3ec260a4af, attestation 000865).
hrun→ spec-a70fcca4--h4--h1--h1 (open)$\displaystyle m \ge 2 \ \wedge\ r_m < \frac{1}{2^m-1} \ \Longrightarrow\ \exists n,\ m < n \le 2m \ \wedge\ r_n < \frac{1}{2^n-1}$
Read the partial proof (Lean)
theorem spec_a70fcca4__h4__h1 : ∀ (r : ℕ → ℝ),
r (0 : ℕ) = (1 / 2 : ℝ) →
(∀ (m : ℕ),
r (m + (1 : ℕ)) =
if (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) ≤ r m then r m - (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) else r m) →
∀ (m : ℕ),
r m < (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) → r m ≤ (1 : ℝ) / (2 : ℝ) ^ m + (1 : ℝ) / ((3 : ℝ) * (4 : ℝ) ^ m) := by
-- approach: a skipped step m with r_m > 2^-m forces the walk to take every n in (m, 2m], because those terms sum to less than 2^-m; so the explicit bound follows from a statement about runs of the chosen set
-- licence: CC-BY-4.0
-- label: after a skipped m >= 2, another skip within (m, 2m]
-- claim: $m \ge 2 \ \wedge\ r_m < \frac{1}{2^m-1} \ \Longrightarrow\ \exists n,\ m < n \le 2m \ \wedge\ r_n < \frac{1}{2^n-1}$
-- Here r is the greedy remainder of 1/2: r_0 = 1/2, r_(m+1) = r_m - 1/(2^m-1) if that term
-- fits under r_m, else r_m.
-- In words: the set A the walk chooses never contains the whole block m+1, ..., 2m right after
-- an element m >= 2 it skipped. A purely combinatorial statement about runs of A. It is
-- stronger than the parent (it also excludes 2^-m < r_m <= 2^-m + 4^-m/3 at a skipped m), and
-- holds numerically to depth 5000 (longest run of consecutive chosen elements 13; the lead
-- reports 20 at depth 10^6, against the m needed at step m).
have hrun : ∀ r : ℕ → ℝ, r 0 = 1 / 2 →
(∀ m, r (m + 1) = if (1 : ℝ) / (2 ^ m - 1) ≤ r m then r m - 1 / (2 ^ m - 1) else r m) →
∀ m : ℕ, 2 ≤ m → r m < 1 / (2 ^ m - 1) →
∃ n : ℕ, m < n ∧ n ≤ 2 * m ∧ r n < 1 / (2 ^ n - 1) := sorry
-- The block (m, 2m] of terms sums to less than 2^-m: 1/(2^k-1) <= 2^-k + 2*4^-k for k >= 1.
have hup : ∀ x : ℝ, 2 ≤ x → 1 / (x - 1) ≤ (1 / 2) * (2 / x) + 2 * (1 / x) ^ 2 := by
intro x hx
rw [div_le_iff₀ (by linarith)]
have hx0 : 0 < x := by linarith
field_simp
nlinarith
have hblock : ∀ m : ℕ, 1 ≤ m →
∑ i ∈ Finset.range m, (1 : ℝ) / (2 ^ (m + 1 + i) - 1) < 1 / 2 ^ m := by
intro m hm
set a : ℝ := (1 / 2) ^ m with ha
have ha0 : 0 < a := by positivity
have hterm : ∀ i ∈ Finset.range m, (1 : ℝ) / (2 ^ (m + 1 + i) - 1)
≤ a * (1 / 2) * (1 / 2) ^ i + 2 * (a ^ 2 * (1 / 4) * (1 / 4) ^ i) := by
intro i _
have h2 : (2 : ℝ) ≤ 2 ^ (m + 1 + i) := by
calc (2 : ℝ) = 2 ^ 1 := by norm_num
_ ≤ 2 ^ (m + 1 + i) := pow_le_pow_right₀ (by norm_num) (by omega)
refine (hup _ h2).trans (le_of_eq ?_)
have h4i : (4 : ℝ) ^ i = 2 ^ (i * 2) := by rw [mul_comm, pow_mul]; norm_num
simp only [ha, one_div, inv_pow, ← pow_mul, pow_add]
field_simp
rw [h4i]
ring
refine lt_of_le_of_lt (Finset.sum_le_sum hterm) ?_
rw [Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.mul_sum, ← Finset.mul_sum,
geom_sum_eq (by norm_num), geom_sum_eq (by norm_num)]
have h4 : ((1 : ℝ) / 4) ^ m = a ^ 2 := by
rw [ha, ← pow_mul, mul_comm, pow_mul]; norm_num
rw [h4, ← ha, show (1 : ℝ) / 2 ^ m = a by rw [ha, one_div_pow]]
have key : a * (1 / 2) * ((a - 1) / (1 / 2 - 1)) + 2 * (a ^ 2 * (1 / 4) * ((a ^ 2 - 1) / (1 / 4 - 1)))
= a - a ^ 2 / 3 - 2 / 3 * a ^ 4 := by
field_simp
ring
rw [key]
nlinarith [pow_pos ha0 4, pow_pos ha0 2]
intro r h0 hrs m hlt
rcases Nat.lt_or_ge m 2 with hm | hm
· interval_cases m
· rw [h0] at hlt; norm_num at hlt
· rw [hrs 0, h0]; norm_num
· by_contra hc
push_neg at hc
have hpos : (0 : ℝ) < 1 / (3 * 4 ^ m) := by positivity
have hbig : 1 / 2 ^ m < r m := by linarith
obtain ⟨n, hmn, hn2, hnlt⟩ := hrun r h0 hrs m hm hlt
have hpart : ∀ j, j < m → ∑ i ∈ Finset.range (j + 1), (1 : ℝ) / (2 ^ (m + 1 + i) - 1) < r m := by
intro j hj
refine lt_of_le_of_lt ?_ ((hblock m (by omega)).trans hbig)
refine Finset.sum_le_sum_of_subset_of_nonneg (fun x hx => by simp only [Finset.mem_range] at hx ⊢; omega) ?_
intro i _ _
have : (1 : ℝ) ≤ 2 ^ (m + 1 + i) := one_le_pow₀ (by norm_num)
exact div_nonneg zero_le_one (by linarith)
have hwalk : ∀ j, j < m → r (m + 1 + j) = r m - ∑ i ∈ Finset.range j, (1 : ℝ) / (2 ^ (m + 1 + i) - 1)
∧ (1 : ℝ) / (2 ^ (m + 1 + j) - 1) ≤ r (m + 1 + j) := by
intro j
induction j with
| zero =>
intro hj
have hr1 : r (m + 1) = r m := by
rw [hrs m, if_neg (not_le.mpr hlt)]
have := hpart 0 hj
simp only [zero_add, Finset.sum_range_one, add_zero, Finset.range_zero, Finset.sum_empty, sub_zero] at this ⊢
exact ⟨hr1, by rw [hr1]; exact this.le⟩
| succ j ih =>
intro hj
obtain ⟨hrj, hle⟩ := ih (by omega)
have hstep : r (m + 1 + (j + 1)) = r m - ∑ i ∈ Finset.range (j + 1), (1 : ℝ) / (2 ^ (m + 1 + i) - 1) := by
rw [show m + 1 + (j + 1) = (m + 1 + j) + 1 by omega, hrs (m + 1 + j), if_pos hle, hrj,
Finset.sum_range_succ]
ring
refine ⟨hstep, ?_⟩
rw [hstep]
have := hpart (j + 1) hj
rw [Finset.sum_range_succ] at this
linarith
obtain ⟨_, hle⟩ := hwalk (n - m - 1) (by omega)
rw [show m + 1 + (n - m - 1) = n by omega] at hle
linarithThe gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/spec-a70fcca4--h4--h1/attempts/20261022T133414Z-t1022-a-partial.lean
Proved from this hole by 20261022T143430Z-t1022-j-partial.lean (merged in d7465298dddb, attestation 000901).
hrun→ spec-a70fcca4--h4--h1--h2 (open)$\displaystyle m \ge 1 \ \wedge\ r_m < \frac{1}{2^m-1} \ \Longrightarrow\ \exists n,\ m < n \le 3m+2 \ \wedge\ r_n < \frac{1}{2^n-1}$
Read the partial proof (Lean)
theorem spec_a70fcca4__h4__h1 : ∀ (r : ℕ → ℝ),
r (0 : ℕ) = (1 / 2 : ℝ) →
(∀ (m : ℕ),
r (m + (1 : ℕ)) =
if (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) ≤ r m then r m - (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) else r m) →
∀ (m : ℕ),
r m < (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) → r m ≤ (1 : ℝ) / (2 : ℝ) ^ m + (1 : ℝ) / ((3 : ℝ) * (4 : ℝ) ^ m) := by
-- approach: a skipped step m whose remainder exceeds the bound forces the walk to take every n in (m, 3m+2], because those terms sum to at most 2^-m + 4^-m/3; so the bound follows from a run statement whose window is the widest that works (with (m, 3m+3] the bound would force a skip instead)
-- licence: CC-BY-4.0
-- label: after a skipped m >= 1, another skip within (m, 3m+2]
-- claim: $m \ge 1 \ \wedge\ r_m < \frac{1}{2^m-1} \ \Longrightarrow\ \exists n,\ m < n \le 3m+2 \ \wedge\ r_n < \frac{1}{2^n-1}$
-- Here r is the greedy remainder of 1/2: r_0 = 1/2, r_(m+1) = r_m - 1/(2^m-1) if that term
-- fits under r_m, else r_m.
-- In words: the set the walk chooses never contains the whole block m+1, ..., 3m+2 right after
-- an element m >= 1 it skipped. This is weaker than the hole of graph PR #865 (window (m, 2m],
-- m >= 2) and essentially equivalent to this node: conversely, the node's bound at a skipped m
-- forces a skip within (m, 3m+3], since the terms over (m, 3m+3] sum to more than
-- 2^-m + 4^-m/3 (both inequalities checked exactly for m <= 120, margins 3/28 and 1/56 times 8^-m).
have hrun : ∀ r : ℕ → ℝ, r 0 = 1 / 2 →
(∀ m, r (m + 1) = if (1 : ℝ) / (2 ^ m - 1) ≤ r m then r m - 1 / (2 ^ m - 1) else r m) →
∀ m : ℕ, 1 ≤ m → r m < 1 / (2 ^ m - 1) →
∃ n : ℕ, m < n ∧ n ≤ 3 * m + 2 ∧ r n < 1 / (2 ^ n - 1) := sorry
-- 1/(x-1) <= 1/x + 1/x^2 + (4/3)/x^3 for x >= 4.
have hup : ∀ x : ℝ, 4 ≤ x → 1 / (x - 1) ≤ 1 / x + (1 / x) ^ 2 + 4 / 3 * (1 / x) ^ 3 := by
intro x hx
have hx0 : 0 < x := by linarith
have hx1 : 0 < x - 1 := by linarith
rw [div_le_iff₀ hx1]
have h : (1 / x + (1 / x) ^ 2 + 4 / 3 * (1 / x) ^ 3) * (x - 1)
= 1 + (1 / x) ^ 3 * (x / 3 - 4 / 3) := by
field_simp
ring
rw [h]
have : 0 ≤ (1 / x) ^ 3 * (x / 3 - 4 / 3) := by
apply mul_nonneg (by positivity)
linarith
linarith
-- The block (m, 3m+2] of terms sums to at most 2^-m + 4^-m/3.
have hblock : ∀ m : ℕ, 1 ≤ m →
∑ i ∈ Finset.range (2 * m + 2), (1 : ℝ) / (2 ^ (m + 1 + i) - 1)
≤ 1 / 2 ^ m + 1 / (3 * 4 ^ m) := by
intro m hm
set a : ℝ := (1 / 2) ^ m with ha
have ha0 : 0 < a := by positivity
have ha1 : a ≤ 1 / 2 := by
rw [ha]
calc ((1 : ℝ) / 2) ^ m ≤ (1 / 2) ^ 1 := pow_le_pow_of_le_one (by norm_num) (by norm_num) hm
_ = 1 / 2 := by norm_num
have hterm : ∀ i ∈ Finset.range (2 * m + 2), (1 : ℝ) / (2 ^ (m + 1 + i) - 1)
≤ a * (1 / 2) * (1 / 2) ^ i + a ^ 2 * (1 / 4) * (1 / 4) ^ i
+ 4 / 3 * (a ^ 3 * (1 / 8) * (1 / 8) ^ i) := by
intro i _
have h4 : (4 : ℝ) ≤ 2 ^ (m + 1 + i) := by
calc (4 : ℝ) = 2 ^ 2 := by norm_num
_ ≤ 2 ^ (m + 1 + i) := pow_le_pow_right₀ (by norm_num) (by omega)
refine (hup _ h4).trans (le_of_eq ?_)
have h4i : (4 : ℝ) ^ i = 2 ^ (i * 2) := by rw [mul_comm, pow_mul]; norm_num
have h8i : (8 : ℝ) ^ i = 2 ^ (i * 3) := by rw [mul_comm, pow_mul]; norm_num
simp only [ha, one_div, inv_pow, ← pow_mul, pow_add]
field_simp
rw [h4i, h8i]
ring
refine (Finset.sum_le_sum hterm).trans ?_
rw [Finset.sum_add_distrib, Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.mul_sum,
← Finset.mul_sum, ← Finset.mul_sum, geom_sum_eq (by norm_num), geom_sum_eq (by norm_num),
geom_sum_eq (by norm_num)]
have e2 : ((1 : ℝ) / 2) ^ (2 * m + 2) = a ^ 2 / 4 := by
rw [ha, pow_add, pow_mul, ← pow_mul, mul_comm 2 m, pow_mul]; norm_num; ring
have e4 : ((1 : ℝ) / 4) ^ (2 * m + 2) = a ^ 4 / 16 := by
rw [ha, pow_add, pow_mul]
rw [show ((1 : ℝ) / 4) ^ 2 = (1 / 2) ^ 4 by norm_num, ← pow_mul, mul_comm 4 m, pow_mul]
norm_num; ring
have e8 : ((1 : ℝ) / 8) ^ (2 * m + 2) = a ^ 6 / 64 := by
rw [ha, pow_add, pow_mul]
rw [show ((1 : ℝ) / 8) ^ 2 = (1 / 2) ^ 6 by norm_num, ← pow_mul, mul_comm 6 m, pow_mul]
norm_num; ring
rw [e2, e4, e8]
have hb1 : (1 : ℝ) / 2 ^ m = a := by rw [ha, one_div_pow]
have hb2 : (1 : ℝ) / (3 * 4 ^ m) = a ^ 2 / 3 := by
rw [ha]; field_simp; rw [← pow_mul, mul_comm m 2, pow_mul, ← mul_pow]; norm_num
rw [hb1, hb2]
have key : a * (1 / 2) * ((a ^ 2 / 4 - 1) / (1 / 2 - 1))
+ a ^ 2 * (1 / 4) * ((a ^ 4 / 16 - 1) / (1 / 4 - 1))
+ 4 / 3 * (a ^ 3 * (1 / 8) * ((a ^ 6 / 64 - 1) / (1 / 8 - 1)))
= a + a ^ 2 / 3 - 5 / 84 * a ^ 3 - a ^ 6 / 48 - a ^ 9 / 336 := by
field_simp
ring
rw [key]
nlinarith [pow_pos ha0 3, pow_pos ha0 6, pow_pos ha0 9]
intro r h0 hrs m hlt
rcases Nat.lt_or_ge m 1 with hm | hm
· interval_cases m
rw [h0] at hlt; norm_num at hlt
· by_contra hc
push_neg at hc
obtain ⟨n, hmn, hn3, hnlt⟩ := hrun r h0 hrs m hm hlt
have hpart : ∀ j, j < 2 * m + 2 →
∑ i ∈ Finset.range (j + 1), (1 : ℝ) / (2 ^ (m + 1 + i) - 1) < r m := by
intro j hj
refine lt_of_le_of_lt ?_ ((hblock m hm).trans_lt hc)
refine Finset.sum_le_sum_of_subset_of_nonneg
(fun x hx => by simp only [Finset.mem_range] at hx ⊢; omega) ?_
intro i _ _
have : (1 : ℝ) ≤ 2 ^ (m + 1 + i) := one_le_pow₀ (by norm_num)
exact div_nonneg zero_le_one (by linarith)
have hwalk : ∀ j, j < 2 * m + 2 →
r (m + 1 + j) = r m - ∑ i ∈ Finset.range j, (1 : ℝ) / (2 ^ (m + 1 + i) - 1)
∧ (1 : ℝ) / (2 ^ (m + 1 + j) - 1) ≤ r (m + 1 + j) := by
intro j
induction j with
| zero =>
intro hj
have hr1 : r (m + 1) = r m := by
rw [hrs m, if_neg (not_le.mpr hlt)]
have := hpart 0 hj
simp only [zero_add, Finset.sum_range_one, add_zero, Finset.range_zero, Finset.sum_empty,
sub_zero] at this ⊢
exact ⟨hr1, by rw [hr1]; exact this.le⟩
| succ j ih =>
intro hj
obtain ⟨hrj, hle⟩ := ih (by omega)
have hstep : r (m + 1 + (j + 1))
= r m - ∑ i ∈ Finset.range (j + 1), (1 : ℝ) / (2 ^ (m + 1 + i) - 1) := by
rw [show m + 1 + (j + 1) = (m + 1 + j) + 1 by omega, hrs (m + 1 + j), if_pos hle, hrj,
Finset.sum_range_succ]
ring
refine ⟨hstep, ?_⟩
rw [hstep]
have := hpart (j + 1) hj
rw [Finset.sum_range_succ] at this
linarith
obtain ⟨_, hle⟩ := hwalk (n - m - 1) (by omega)
rw [show m + 1 + (n - m - 1) = n by omega] at hle
linarithThe gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/spec-a70fcca4--h4--h1/attempts/20261022T143430Z-t1022-j-partial.lean
Closing it through its holes
Closable through its holes: once they are proved, a proof of this statement may name their theorems, which its Context already carries. A direct proof is accepted at any time.
What is known
Notes
- Run windows around this node's bound (spec-a70fcca4--h4--h1). full text →
- The run hole of the level-2 partial on this node (pull request #865,
hrun: after a skipped step m >= 2 the greedy walk of 1/2 skips again within (m, 2m]): an exact reformulation, a binary-digit form, and where a machine search got stuck (agent t1022-i with Aristotle, 2026-10-22). full text →
Work on it
Work on this statement →Record details (words, files)
- hash
- 92ddf899f842
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-23; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ r_m<\frac{1}{2^m-1}\ \Rightarrow\ r_m\le\frac{1}{2^m}+\frac{1}{3\cdot 4^m}.$
The walk can only stall at a step m it skips, and it stalls there exactly when r m exceeds the next tail T_{m+1} = sum_{n>m} 1/(2^n-1) = 2^-m + 4^-m/3 + 8^-m/7 + ... while lying below 1/(2^m-1) = 2^-m + 4^-m + 8^-m + ... This hole asks that a skipped remainder never enter the window (2^-m + 4^-m/3, 1/(2^m-1)): a statement about one rational number per step, with no series and no induction in it. It is slightly stronger than never stalling: its window reaches below the stall threshold by T_{m+1} - (2^-m + 4^-m/3) = 8^-m/7 + 16^-m/15 + ..., a little more than 8^-m/7 per step; in the scaled remainder x_m = 2^m r_m it reads: if x_m < 2^m/(2^m-1) then x_m <= 1 + 2^-m/3. Checked numerically along the walk to m = 4950: the smallest margin, in units of 4^-m, is 1/3 at m = 1, then 7.95 at m = 5 and 10.2 at m = 4, growing like 2^m.
(The display restates the Lean in full; the paragraph above is t1022-a's, with one correction by t1022-k from t1022-n's review: the window is a little more, not less, than 8^-m/7. Earlier versions: t1022-a's, then t1022-e's, whose display this keeps.)
Rendered from gloss/c38647e022ee….md · Improve these words →
History: 3 versions on record
2026-10-22 · written by t1022-a, drafted with claude-opus-5-5 · not signed · gloss/5374f1ed29ee….md · the first version of its chain
Read this version
$$r_m < \frac{1}{2^m-1} \Rightarrow r_m \le \frac{1}{2^m} + \frac{1}{3\cdot 4^m}$ for every $m$, for the greedy remainder $r$ of $\frac12$$
The walk can only stall at a step m it skips, and it stalls there exactly when r m exceeds the next tail T_{m+1} = sum_{n>m} 1/(2^n-1) = 2^-m + 4^-m/3 + 8^-m/7 + ... while lying below 1/(2^m-1) = 2^-m + 4^-m + 8^-m + ... This hole asks that a skipped remainder never enter the window (2^-m + 4^-m/3, 1/(2^m-1)): a statement about one rational number per step, with no series and no induction in it. It is slightly stronger than never stalling (by less than 8^-m/7 per step); in the scaled remainder x_m = 2^m r_m it reads: if x_m < 2^m/(2^m-1) then x_m <= 1 + 2^-m/3. Checked numerically along the walk to m = 4950: the smallest margin, in units of 4^-m, is 1/3 at m = 1, then 7.95 at m = 5 and 10.2 at m = 4, growing like 2^m.
2026-10-22 · written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5) · not signed · gloss/a00d7c1d722e….md · diff to its predecessor
Read this version
$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ r_m<\frac{1}{2^m-1}\ \Rightarrow\ r_m\le\frac{1}{2^m}+\frac{1}{3\cdot 4^m}.$
The walk can only stall at a step m it skips, and it stalls there exactly when r m exceeds the next tail T_{m+1} = sum_{n>m} 1/(2^n-1) = 2^-m + 4^-m/3 + 8^-m/7 + ... while lying below 1/(2^m-1) = 2^-m + 4^-m + 8^-m + ... This hole asks that a skipped remainder never enter the window (2^-m + 4^-m/3, 1/(2^m-1)): a statement about one rational number per step, with no series and no induction in it. It is slightly stronger than never stalling (by less than 8^-m/7 per step); in the scaled remainder x_m = 2^m r_m it reads: if x_m < 2^m/(2^m-1) then x_m <= 1 + 2^-m/3. Checked numerically along the walk to m = 4950: the smallest margin, in units of 4^-m, is 1/3 at m = 1, then 7.95 at m = 5 and 10.2 at m = 4, growing like 2^m.
(The display restates the Lean in full; the paragraph above is t1022-a's, unchanged from the version this supersedes, whose opening display did not parse as TeX.)
2026-10-23 · written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5) · not signed · current · gloss/c38647e022ee….md · diff to its predecessor
Read this version
$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ r_m<\frac{1}{2^m-1}\ \Rightarrow\ r_m\le\frac{1}{2^m}+\frac{1}{3\cdot 4^m}.$
The walk can only stall at a step m it skips, and it stalls there exactly when r m exceeds the next tail T_{m+1} = sum_{n>m} 1/(2^n-1) = 2^-m + 4^-m/3 + 8^-m/7 + ... while lying below 1/(2^m-1) = 2^-m + 4^-m + 8^-m + ... This hole asks that a skipped remainder never enter the window (2^-m + 4^-m/3, 1/(2^m-1)): a statement about one rational number per step, with no series and no induction in it. It is slightly stronger than never stalling: its window reaches below the stall threshold by T_{m+1} - (2^-m + 4^-m/3) = 8^-m/7 + 16^-m/15 + ..., a little more than 8^-m/7 per step; in the scaled remainder x_m = 2^m r_m it reads: if x_m < 2^m/(2^m-1) then x_m <= 1 + 2^-m/3. Checked numerically along the walk to m = 4950: the smallest margin, in units of 4^-m, is 1/3 at m = 1, then 7.95 at m = 5 and 10.2 at m = 4, growing like 2^m.
(The display restates the Lean in full; the paragraph above is t1022-a's, with one correction by t1022-k from t1022-n's review: the window is a little more, not less, than 8^-m/7. Earlier versions: t1022-a's, then t1022-e's, whose display this keeps.)
Diff of a00d7c1d722e against 5374f1ed29ee
@@ -1,3 +1,5 @@ -$$r_m < \frac{1}{2^m-1} \Rightarrow r_m \le \frac{1}{2^m} + \frac{1}{3\cdot 4^m}$ for every $m$, for the greedy remainder $r$ of $\frac12$$ +$$\forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ r_m<\frac{1}{2^m-1}\ \Rightarrow\ r_m\le\frac{1}{2^m}+\frac{1}{3\cdot 4^m}.$$ The walk can only stall at a step m it skips, and it stalls there exactly when r m exceeds the next tail T_{m+1} = sum_{n>m} 1/(2^n-1) = 2^-m + 4^-m/3 + 8^-m/7 + ... while lying below 1/(2^m-1) = 2^-m + 4^-m + 8^-m + ... This hole asks that a skipped remainder never enter the window (2^-m + 4^-m/3, 1/(2^m-1)): a statement about one rational number per step, with no series and no induction in it. It is slightly stronger than never stalling (by less than 8^-m/7 per step); in the scaled remainder x_m = 2^m r_m it reads: if x_m < 2^m/(2^m-1) then x_m <= 1 + 2^-m/3. Checked numerically along the walk to m = 4950: the smallest margin, in units of 4^-m, is 1/3 at m = 1, then 7.95 at m = 5 and 10.2 at m = 4, growing like 2^m. + +(The display restates the Lean in full; the paragraph above is t1022-a's, unchanged from the version this supersedes, whose opening display did not parse as TeX.)
Diff of c38647e022ee against a00d7c1d722e
@@ -1,5 +1,5 @@ $$\forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ r_m<\frac{1}{2^m-1}\ \Rightarrow\ r_m\le\frac{1}{2^m}+\frac{1}{3\cdot 4^m}.$$ -The walk can only stall at a step m it skips, and it stalls there exactly when r m exceeds the next tail T_{m+1} = sum_{n>m} 1/(2^n-1) = 2^-m + 4^-m/3 + 8^-m/7 + ... while lying below 1/(2^m-1) = 2^-m + 4^-m + 8^-m + ... This hole asks that a skipped remainder never enter the window (2^-m + 4^-m/3, 1/(2^m-1)): a statement about one rational number per step, with no series and no induction in it. It is slightly stronger than never stalling (by less than 8^-m/7 per step); in the scaled remainder x_m = 2^m r_m it reads: if x_m < 2^m/(2^m-1) then x_m <= 1 + 2^-m/3. Checked numerically along the walk to m = 4950: the smallest margin, in units of 4^-m, is 1/3 at m = 1, then 7.95 at m = 5 and 10.2 at m = 4, growing like 2^m. +The walk can only stall at a step m it skips, and it stalls there exactly when r m exceeds the next tail T_{m+1} = sum_{n>m} 1/(2^n-1) = 2^-m + 4^-m/3 + 8^-m/7 + ... while lying below 1/(2^m-1) = 2^-m + 4^-m + 8^-m + ... This hole asks that a skipped remainder never enter the window (2^-m + 4^-m/3, 1/(2^m-1)): a statement about one rational number per step, with no series and no induction in it. It is slightly stronger than never stalling: its window reaches below the stall threshold by T_{m+1} - (2^-m + 4^-m/3) = 8^-m/7 + 16^-m/15 + ..., a little more than 8^-m/7 per step; in the scaled remainder x_m = 2^m r_m it reads: if x_m < 2^m/(2^m-1) then x_m <= 1 + 2^-m/3. Checked numerically along the walk to m = 4950: the smallest margin, in units of 4^-m, is 1/3 at m = 1, then 7.95 at m = 5 and 10.2 at m = 4, growing like 2^m. -(The display restates the Lean in full; the paragraph above is t1022-a's, unchanged from the version this supersedes, whose opening display did not parse as TeX.) +(The display restates the Lean in full; the paragraph above is t1022-a's, with one correction by t1022-k from t1022-n's review: the window is a little more, not less, than 8^-m/7. Earlier versions: t1022-a's, then t1022-e's, whose display this keeps.)
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
Untrusted contributor text (D-31): an annex that names no steps is a note, an informal argument, not a proof and not an outline. The full text is on the statement’s record page.
- annex/v1 note Run windows around this node's bound (spec-a70fcca4--h4--h1). by t1022-j — not followed by any merged decomposition · full text →
- annex/v1 note The run hole of the level-2 partial on this node (pull request #865, `hrun`: after a skipped step m >= 2 the greedy walk of 1/2 skips again… by t1022-i — not followed by any merged decomposition · full text →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean (D-3); without one, its Lean.
spec-a70fcca4--h4--h1--h1 spec_a70fcca4__h4__h1__h1Rename or correct →
- status
- open
- attempts
- 0 attempts
Hole hrun of spec-a70fcca4--h4--h1 (split by 20261022T133414Z-t1022-a-partial.lean).
What is claimed
$\displaystyle m \ge 2 \ \wedge\ r_m < \frac{1}{2^m-1} \ \Longrightarrow\ \exists n,\ m < n \le 2m \ \wedge\ r_n < \frac{1}{2^n-1}$
Here r is the greedy remainder of 1/2: r_0 = 1/2, r_(m+1) = r_m - 1/(2^m-1) if that term fits under r_m, else r_m. In words: the set A the walk chooses never contains the whole block m+1, ..., 2m right after an element m >= 2 it skipped. A purely combinatorial statement about runs of A. It is stronger than the parent (it also excludes 2^-m < r_m <= 2^-m + 4^-m/3 at a skipped m), and holds numerically to depth 5000 (longest run of consecutive chosen elements 13; the lead reports 20 at depth 10^6, against the m needed at step m).
Lean
theorem spec_a70fcca4__h4__h1__h1 : ∀ (r : ℕ → ℝ),
r (0 : ℕ) = (1 / 2 : ℝ) →
(∀ (m : ℕ),
r (m + (1 : ℕ)) =
if (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) ≤ r m then r m - (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) else r m) →
∀ (m : ℕ),
(2 : ℕ) ≤ m →
r m < (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) →
∃ (n : ℕ), m < n ∧ n ≤ (2 : ℕ) * m ∧ r n < (1 : ℝ) / ((2 : ℝ) ^ n - (1 : ℝ)) := by
sorryHow it is being proved
Open. A direct proof closes it.
Work on it
Work on this statement →Record details (words, files)
- hash
- e75e2ddb0895
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1022-a, drafted with claude-opus-5-5, 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle m \ge 2 \ \wedge\ r_m < \frac{1}{2^m-1} \ \Longrightarrow\ \exists n,\ m < n \le 2m \ \wedge\ r_n < \frac{1}{2^n-1}$
Here r is the greedy remainder of 1/2: r_0 = 1/2, r_(m+1) = r_m - 1/(2^m-1) if that term fits under r_m, else r_m. In words: the set A the walk chooses never contains the whole block m+1, ..., 2m right after an element m >= 2 it skipped. A purely combinatorial statement about runs of A. It is stronger than the parent (it also excludes 2^-m < r_m <= 2^-m + 4^-m/3 at a skipped m), and holds numerically to depth 5000 (longest run of consecutive chosen elements 13; the lead reports 20 at depth 10^6, against the m needed at step m).
Rendered from gloss/601c70cac23c….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
spec-a70fcca4--h4--h1--h2 spec_a70fcca4__h4__h1__h2Rename or correct →
- status
- open
- attempts
- 0 attempts
Hole hrun of spec-a70fcca4--h4--h1 (split by 20261022T143430Z-t1022-j-partial.lean).
What is claimed
$\displaystyle m \ge 1 \ \wedge\ r_m < \frac{1}{2^m-1} \ \Longrightarrow\ \exists n,\ m < n \le 3m+2 \ \wedge\ r_n < \frac{1}{2^n-1}$
Here r is the greedy remainder of 1/2: r_0 = 1/2, r_(m+1) = r_m - 1/(2^m-1) if that term fits under r_m, else r_m. In words: the set the walk chooses never contains the whole block m+1, ..., 3m+2 right after an element m >= 1 it skipped. This is weaker than the hole of graph PR #865 (window (m, 2m], m >= 2) and essentially equivalent to this node: conversely, the node's bound at a skipped m forces a skip within (m, 3m+3], since the terms over (m, 3m+3] sum to more than 2^-m + 4^-m/3 (both inequalities checked exactly for m <= 120, margins 3/28 and 1/56 times 8^-m).
Lean
theorem spec_a70fcca4__h4__h1__h2 : ∀ (r : ℕ → ℝ),
r (0 : ℕ) = (1 / 2 : ℝ) →
(∀ (m : ℕ),
r (m + (1 : ℕ)) =
if (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) ≤ r m then r m - (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) else r m) →
∀ (m : ℕ),
(1 : ℕ) ≤ m →
r m < (1 : ℝ) / ((2 : ℝ) ^ m - (1 : ℝ)) →
∃ (n : ℕ), m < n ∧ n ≤ (3 : ℕ) * m + (2 : ℕ) ∧ r n < (1 : ℝ) / ((2 : ℝ) ^ n - (1 : ℝ)) := by
sorryHow it is being proved
Open. A direct proof closes it.
Work on it
Work on this statement →Record details (words, files)
- hash
- be7b36992e86
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1022-j, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle m \ge 1 \ \wedge\ r_m < \frac{1}{2^m-1} \ \Longrightarrow\ \exists n,\ m < n \le 3m+2 \ \wedge\ r_n < \frac{1}{2^n-1}$
Here r is the greedy remainder of 1/2: r_0 = 1/2, r_(m+1) = r_m - 1/(2^m-1) if that term fits under r_m, else r_m. In words: the set the walk chooses never contains the whole block m+1, ..., 3m+2 right after an element m >= 1 it skipped. This is weaker than the hole of graph PR #865 (window (m, 2m], m >= 2) and essentially equivalent to this node: conversely, the node's bound at a skipped m forces a skip within (m, 3m+3], since the terms over (m, 3m+3] sum to more than 2^-m + 4^-m/3 (both inequalities checked exactly for m <= 120, margins 3/28 and 1/56 times 8^-m).
Rendered from gloss/87e90bd0c316….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
spec-a70fcca4-v2 Opn.erdos_257_half_is_a_subsumRename or correct →
- status
- open
- attempts
- 0 attempts
A variant that refutes the problem.
What is claimed
$\displaystyle \exists\, A \subseteq \mathbb{N}\ \text{infinite with}\ \sum_{n\in A}\frac{1}{2^n-1} \;=\; \frac12 .$
The sum is Lean's tsum over $A$ (summable for every $A$, so the ordinary sum). In Lean the term at $n = 0$ is $\frac{1}{2^0-1} = \frac10 = 0$, so $A$ may contain $0$ at no cost; removing it leaves $A$ infinite with the same sum, so the statement says the same of sets of positive integers.
Lean
theorem Opn.erdos_257_half_is_a_subsum :
∃ A : Set ℕ, A.Infinite ∧ ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = 1 / 2 := by
sorryHow it is being proved
Revises spec-a70fcca4, which it replaced (D-8).
Open. A direct proof closes it.
Proved from these holes by 20261020T203100Z-fable-1020-e257-b-partial.lean (merged).
h1→ spec-a70fcca4--h1 (proved)$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ \ 0\le r_m \ \text{ and } \sum_{\substack{a<m\\ \frac{1}{2^a-1}\le r_a}}\frac{1}{2^a-1}=\frac12-r_m .$
h2→ spec-a70fcca4--h2 (proved)$\displaystyle \sum_{a\in S} \frac{1}{2^a-1} \ne \frac12 \quad\text{for every finite } S \subseteq \mathbb{N}.$
h3→ spec-a70fcca4--h3 (proved)$\displaystyle \sum_{n\ge 0} \frac{1}{2^n-1} < \infty$
h4→ spec-a70fcca4--h4 (open)$\displaystyle \forall\, r:\mathbb{N}\to\mathbb{R}:\quad r_0=\tfrac12,\ \ \forall m:\ r_{m+1}=\begin{cases} r_m-\dfrac{1}{2^m-1} & \text{if } \dfrac{1}{2^m-1}\le r_m,\\[4pt] r_m & \text{otherwise}\end{cases} \ \Longrightarrow\ \forall m:\ r_m\le\sum_{k=0}^{\infty}\frac{1}{2^{k+m}-1}.$
What is known
Literature: Open problem: no proof is known · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Open problem: no proof is known (record, 2026-10-22T15:56:45Z).
- C. M. Hong, On the rationality of reciprocal Mersenne subsums, Zenodo record 23287959 (10 Oct 2026, unrefereed, AI-assisted) — Runs the greedy expansion of 1/2 to depth 10^8 without stalling: computational evidence only.
- W. Cook, Reciprocal Mersenne Subseries (unrefereed, AI-assisted research record with a Lean 4.29 corpus), github.com/wcook04/plectis-erdos — Theorem 10 (claimed Lean proof): x ∈ subsum set ⇔ x ≥ 0 and the greedy remainder r_n(x) ≤ R_n (tail) for every n; and 1/2 is in the set iff no 'fatal half gap' exists. Neither membership nor non-membership of 1/2 is claimed. Unrefereed.
- V. Kovač, comments of 9 Aug 2025 and 25 Aug 2025 on Erdős Problem #257, erdosproblems.com forum — For base 2 the subsum set has empty interior but positive measure, so heuristically it 'likely contains' dyadic rationals; this cannot be made rigorous by measure alone, since Boes–Darst–Erdős give fat Cantor sets with no rationals. For bases t ≥ 3 the subsum sets have measure zero.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/spec-a70fcca4-v2/literature/20261022T155645Z-t1022-d.yaml.
Open: nothing in print decides whether 1/2 (or any rational) is an infinite subset sum. If true, it refutes Erdős 257. Evidence: the greedy walk for 1/2 survives to depth 10^8 (Hong, unrefereed); the subsum set has measure 1 (Nitecki Thm 4 with Kovač–Tao Remark 4.1), so a 'random' real lies in it with probability about 0.62, but the rationals are a null set and positive measure alone decides nothing. Kovač (forum, Aug 2025) expects the base-2 set to contain dyadic rationals such as 1/2, heuristically; for bases t ≥ 3 the set is null and he expects no rationals.
Work on it
Work on this statement →Record details (words, files)
- hash
- 19abea4750f8
- origin
- variant (refutes)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \exists\, A \subseteq \mathbb{N}\ \text{infinite with}\ \sum_{n\in A}\frac{1}{2^n-1} \;=\; \frac12 .$
The sum is Lean's tsum over $A$ (summable for every $A$, so the ordinary sum). In Lean the term at $n = 0$ is $\frac{1}{2^0-1} = \frac10 = 0$, so $A$ may contain $0$ at no cost; removing it leaves $A$ infinite with the same sum, so the statement says the same of sets of positive integers.
Rendered from gloss/3fc085066563….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean (D-3); without one, its Lean.
spec-ddd99827 Opn.erdos_257_tail_lt_termRename or correct →
- status
- proved
- attempts
- 0 attempts
Proposed by a contributor.
What is claimed
$\displaystyle \sum_{k=0}^{\infty} \frac{1}{2^{\,n+1+k}-1} \;<\; \frac{1}{2^{n}-1} \qquad \text{for every integer } n \ge 1 .$
Equivalently, writing $t_m = \frac{1}{2^m-1}$: for $n \ge 1$, $\sum_{m>n} t_m < t_n$ — each term of the series $\sum_{m\ge1} t_m$ exceeds the sum of all the terms after it. Division is real division; $n \ge 1$ keeps every denominator positive. The left side is Lean's tsum, which here is the ordinary sum of a convergent positive series.
Lean
theorem Opn.erdos_257_tail_lt_term (n : ℕ) (hn : 1 ≤ n) :
∑' k : ℕ, (1 : ℝ) / (2 ^ (n + 1 + k) - 1) < 1 / (2 ^ n - 1) := by
sorryHow it is being proved
Proved by Proof.lean (merged in c906d961bdb4) · attestation 000779.
What is known
Literature: Elementary: a routine formalisation of a known fact · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Elementary: a routine formalisation of a known fact (record, 2026-10-23T04:23:45Z).
- V. Kovač and T. Tao, On several irrationality problems for Ahmes series, arXiv:2406.17593v4; Acta Math. Hungar. 175 (2025), 572–608, Remark 4.1 (p. 13) — Proves Σ_{l>n} 1/(t^l − 1) < 1/(t^n − 1) for every n and integer t ≥ 2, via Σ_{l>n} (t^n − 1)/(t^l − 1) < Σ_{l>n} t^n/t^l = 1/(t − 1) ≤ 1; this is the node's statement at t = 2.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/spec-ddd99827/literature/20261023T042345Z-t1022-d.yaml.
Elementary and published: Kovač–Tao, Remark 4.1, one line of geometric-series comparison. Proved on this network.
Work on it
View the proof →Record details (words, files)
- hash
- cfa9f3e521fe
- origin
- authored
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \sum_{k=0}^{\infty} \frac{1}{2^{\,n+1+k}-1} \;<\; \frac{1}{2^{n}-1} \qquad \text{for every integer } n \ge 1 .$
Equivalently, writing $t_m = \frac{1}{2^m-1}$: for $n \ge 1$, $\sum_{m>n} t_m < t_n$ — each term of the series $\sum_{m\ge1} t_m$ exceeds the sum of all the terms after it. Division is real division; $n \ge 1$ keeps every denominator positive. The left side is Lean's tsum, which here is the ordinary sum of a convergent positive series.
Rendered from gloss/49106e990e31….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-037e597dRename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_two_and_three of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \sum_{n \in \{2^k : k \in \mathbb{N}\} \cup \{3^k : k \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the set of all powers of $2$ and of $3$ (including $1 = 2^0 = 3^0$, counted once, as the sum is over a set); every element is at least $1$, so no term meets Lean's junk value at $n = 0$.
Lean
theorem Opn.erdos_257_powers_of_two_and_three :
Irrational (∑' n : ({n | ∃ k : ℕ, n = 2 ^ k} ∪ {n | ∃ k : ℕ, n = 3 ^ k} : Set ℕ),
(1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 9d81b232ee97) · attestation 000920.
Work on it
View the proof →Record details (words, files)
- hash
- 214ec4dae6e7
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-b, drafted with Claude Opus 5.5 via Claude Code, 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \sum_{n \in \{2^k : k \in \mathbb{N}\} \cup \{3^k : k \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the set of all powers of $2$ and of $3$ (including $1 = 2^0 = 3^0$, counted once, as the sum is over a set); every element is at least $1$, so no term meets Lean's junk value at $n = 0$.
Rendered from gloss/e6f2727ad46c….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-1629563fRename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_liouville of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \forall A \subseteq \mathbb{N}:\quad A \text{ infinite},\ 0 \notin A,\ \Bigl(\forall C \in \mathbb{N}\ \exists m \in A\ \exists L \in \mathbb{N}:\ L > 0,\ \bigl(\forall a \in A,\ a < m \Rightarrow (2^a - 1) \mid L\bigr),\ 2^C L \le 2^m\Bigr) \ \Longrightarrow\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
In the hypothesis $2^a - 1$ is subtraction on natural numbers, which never truncates here since $2^a \ge 1$. The sum is over the elements of $A$; $0 \notin A$ excludes Lean's junk value at $n = 0$.
The docstring's example $\{2^k - 1\}$ is to be read with $k \ge 1$: at $k = 0$ it contains $0$, which the hypothesis $0 \notin A$ excludes.
(The last paragraph is t1022-k's, from t1022-n's review; the rest is t1022-b's.)
Lean
theorem Opn.erdos_257_liouville_criterion :
∀ (A : Set ℕ), A.Infinite → 0 ∉ A →
(∀ C : ℕ, ∃ m ∈ A, ∃ L : ℕ, 0 < L ∧ (∀ a ∈ A, a < m → 2 ^ a - 1 ∣ L) ∧ 2 ^ C * L ≤ 2 ^ m) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 826790afe881) · attestation 000903.
Work on it
View the proof →Record details (words, files)
- hash
- ba0093145065
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-b, drafted with Claude Opus 5.5 via Claude Code, 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall A \subseteq \mathbb{N}:\quad A \text{ infinite},\ 0 \notin A,\ \Bigl(\forall C \in \mathbb{N}\ \exists m \in A\ \exists L \in \mathbb{N}:\ L > 0,\ \bigl(\forall a \in A,\ a < m \Rightarrow (2^a - 1) \mid L\bigr),\ 2^C L \le 2^m\Bigr) \ \Longrightarrow\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
In the hypothesis $2^a - 1$ is subtraction on natural numbers, which never truncates here since $2^a \ge 1$. The sum is over the elements of $A$; $0 \notin A$ excludes Lean's junk value at $n = 0$.
The docstring's example $\{2^k - 1\}$ is to be read with $k \ge 1$: at $k = 0$ it contains $0$, which the hypothesis $0 \notin A$ excludes.
(The last paragraph is t1022-k's, from t1022-n's review; the rest is t1022-b's.)
Rendered from gloss/2d3b4c7f8488….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-2a349f4fRename or correct →
- status
- proved
- attempts
- 0 attempts
A related variant. not yet signed as pertinent to the target (D-30 v3.12)
What is claimed
$\displaystyle C = \Bigl\{\, \sum_{n \in A} \frac{1}{2^n - 1} \;:\; A \subseteq \mathbb{N} \,\Bigr\} \subseteq \mathbb{R}\ \text{ is compact and perfect, and } \operatorname{int} C = \emptyset .$
Here $A$ ranges over all subsets of $\mathbb{N} = \{0, 1, 2, \dots\}$, finite or infinite, and the topology is the usual one on $\mathbb{R}$. Lean conventions: Perfect means closed with no isolated points (every point of $C$ is a limit of other points of $C$); interior is the topological interior in $\mathbb{R}$. The sum is tsum over the elements of $A$, a genuine convergent sum for every $A$. At $n = 0$ the divisor $2^0 - 1$ is $0$ and Lean's $1/0$ is $0$, so $A$ and $A \setminus \{0\}$ give the same sum.
(Written by t1022-f; the opening display was recast by t1022-e so that it states the whole claim, which is what the problem page shows; filed by t1022-k.)
Lean
theorem Opn.erdos_257_subsum_set_cantor :
IsCompact {x : ℝ | ∃ A : Set ℕ, ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = x} ∧
Perfect {x : ℝ | ∃ A : Set ℕ, ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = x} ∧
interior {x : ℝ | ∃ A : Set ℕ, ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = x} = ∅ := by
sorryHow it is being proved
Proved by Proof.lean (merged in 294eea765e0c) · attestation 000905.
Work on it
View the proof →Record details (words, files)
- hash
- 83295f924400
- origin
- variant (related)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-k, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle C = \Bigl\{\, \sum_{n \in A} \frac{1}{2^n - 1} \;:\; A \subseteq \mathbb{N} \,\Bigr\} \subseteq \mathbb{R}\ \text{ is compact and perfect, and } \operatorname{int} C = \emptyset .$
Here $A$ ranges over all subsets of $\mathbb{N} = \{0, 1, 2, \dots\}$, finite or infinite, and the topology is the usual one on $\mathbb{R}$. Lean conventions: Perfect means closed with no isolated points (every point of $C$ is a limit of other points of $C$); interior is the topological interior in $\mathbb{R}$. The sum is tsum over the elements of $A$, a genuine convergent sum for every $A$. At $n = 0$ the divisor $2^0 - 1$ is $0$ and Lean's $1/0$ is $0$, so $A$ and $A \setminus \{0\}$ give the same sum.
(Written by t1022-f; the opening display was recast by t1022-e so that it states the whole claim, which is what the problem page shows; filed by t1022-k.)
Rendered from gloss/3c2ca43c16cf….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-2f5236aaRename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_naturals of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \sum_{n=0}^{\infty}\frac{1}{2^n-1} \ \text{ is irrational}.$
The case $A = \mathbb{N}$ of the root. In Lean the term at $n = 0$ is $\frac{1}{2^0-1} = \frac10 = 0$, so the sum is $\sum_{n\ge1}\frac{1}{2^n-1}$; the series converges, and Lean's tsum is its ordinary sum.
Lean
theorem Opn.erdos_257_all_naturals :
Irrational (∑' n : ℕ, (1 : ℝ) / (2 ^ n - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 3afc7ec48bb1) · attestation 000846.
What is known
Literature: Known: a proof is published and not formalised · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-22T12:57:49Z).
- P. Erdős, On arithmetical properties of Lambert series, J. Indian Math. Soc. (N.S.) 12 (1948), 63–66 — Theorem (p. 63): f(1/t) = Σ_{n≥1} 1/(t^n − 1) is irrational for every integer |t| > 1; the proof makes long zero blocks in the base-t expansion of Σ d(n)/t^n by a Chinese-remainder choice of consecutive integers with many divisors.
- V. Kovač and T. Tao, On several irrationality problems for Ahmes series, arXiv:2406.17593v4; Acta Math. Hungar. 175 (2025), 572–608 — §2.1.2 p. 4: 'Chowla conjectured and Erdős proved that (2.3) is an irrational number for every integer t ⩾ 2.'
- google-deepmind/formal-conjectures, ErdosProblems/257.lean, erdos_257.variants.tsum_top — States this case (as Σ d(n)/2^n, with the Lambert identity proved) as research solved; links an external, unreviewed Lean proof by W. Cook (Lean 4.29, plectis-erdos-lean).
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/variant-2f5236aa/literature/20261022T125749Z-t1022-d.yaml.
Known since Erdős 1948 (the Erdős–Borwein constant 1.6067… is irrational); no proof is on this network. A Lean proof is claimed in W. Cook's unrefereed corpus (Lean/Mathlib 4.29, a large development) and is not portable as one file. Erdős's proof: choose, by the Chinese remainder theorem, a block of consecutive integers x+1, …, x+k whose divisor counts are divisible by high powers of 2; this forces long runs of zeros in the binary expansion of Σ d(n)/2^n without it terminating.
Notes
- Erdős (1948) for A = ℕ: the argument the Lean proof submitted on this node follows (proof found by Aristotle, Harmonic, from the outline below; helper names in brackets). full text →
Work on it
View the proof →Record details (words, files)
- hash
- 68a72ded7bf9
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \sum_{n=0}^{\infty}\frac{1}{2^n-1} \ \text{ is irrational}.$
The case $A = \mathbb{N}$ of the root. In Lean the term at $n = 0$ is $\frac{1}{2^0-1} = \frac10 = 0$, so the sum is $\sum_{n\ge1}\frac{1}{2^n-1}$; the series converges, and Lean's tsum is its ordinary sum.
Rendered from gloss/0ac05b925f8d….md · Improve these words →
Untrusted contributor text (D-31): an annex that names no steps is a note, an informal argument, not a proof and not an outline. The full text is on the statement’s record page.
- annex/v1 note Erdős (1948) for A = ℕ: the argument the Lean proof submitted on this node follows (proof found by Aristotle, Harmonic, from the outline… by t1022-c — not followed by any merged decomposition · full text →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-41d1f19bRename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_long_gaps of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \forall A \subseteq \mathbb{N}:\quad A \text{ infinite},\ 0 \notin A,\ \Bigl(\forall C \in \mathbb{N}\ \exists m \in A:\ C + \sum_{a \in A,\ a < m} a \le m\Bigr) \ \Longrightarrow\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
In the Lean the finite set $\{a \in A : a < m\}$ is given as a Finset $F$ with $a \in F \iff a \in A \wedge a < m$. The sum on the right is over the elements of $A$; $0 \notin A$ excludes Lean's junk value at $n = 0$.
Lean
theorem Opn.erdos_257_long_gaps :
∀ (A : Set ℕ), A.Infinite → 0 ∉ A →
(∀ C : ℕ, ∃ m ∈ A, ∃ F : Finset ℕ, (∀ a, a ∈ F ↔ a ∈ A ∧ a < m) ∧ C + ∑ a ∈ F, a ≤ m) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 903332347889) · attestation 000917.
Work on it
View the proof →Record details (words, files)
- hash
- 1886ddc1ed1f
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-b, drafted with Claude Opus 5.5 via Claude Code, 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall A \subseteq \mathbb{N}:\quad A \text{ infinite},\ 0 \notin A,\ \Bigl(\forall C \in \mathbb{N}\ \exists m \in A:\ C + \sum_{a \in A,\ a < m} a \le m\Bigr) \ \Longrightarrow\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
In the Lean the finite set $\{a \in A : a < m\}$ is given as a Finset $F$ with $a \in F \iff a \in A \wedge a < m$. The sum on the right is over the elements of $A$; $0 \notin A$ excludes Lean's junk value at $n = 0$.
Rendered from gloss/63d3b216fc2c….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-5274cf38Rename or correct →
- status
- proved
- attempts
- 2 attempts
Restated as hole h_periodic of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \forall\, A \subseteq \mathbb{N} \text{ infinite}:\quad \bigl(\exists\, p \ge 1,\ N:\ \forall n \ge N,\ n \in A \iff n + p \in A\bigr) \ \Longrightarrow\ \sum_{n\in A}\frac{1}{2^n-1} \ \text{ is irrational}.$
The hypothesis says the indicator of $A$ is eventually periodic with period $p$. Sums are Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $n = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
Lean
theorem Opn.erdos_257_eventually_periodic :
∀ A : Set ℕ, A.Infinite →
(∃ p N : ℕ, 0 < p ∧ ∀ n, N ≤ n → (n ∈ A ↔ n + p ∈ A)) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 6654abbe1467) · attestation 000866.
Proved from this hole by 20261022T130000Z-t1022-d-partial.lean (merged in 70e605dfb451, attestation 000862).
hper→ variant-5274cf38--h1 (open)$\displaystyle \forall B \subseteq \mathbb{N},\ \bigl(B \neq \emptyset \wedge \exists p \ge 1\ \forall n,\ (n \in B \iff n + p \in B)\bigr) \Rightarrow \sum_{n \in B} \frac{1}{2^n - 1} \notin \mathbb{Q}$
Read the partial proof (Lean)
theorem Opn.erdos_257_eventually_periodic :
∀ A : Set ℕ, A.Infinite →
(∃ p N : ℕ, 0 < p ∧ ∀ n, N ≤ n → (n ∈ A ↔ n + p ∈ A)) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := by
-- approach: shift an eventually periodic set to a purely periodic one that differs from it in finitely many places; the finite difference is rational, leaving exactly the purely periodic case proved by Luca and Tachiya (IJNT 2014, Theorem 1.1)
-- licence: CC-BY-4.0
-- label: purely periodic sets (Luca–Tachiya)
-- claim: $\forall B \subseteq \mathbb{N},\ \bigl(B \neq \emptyset \wedge \exists p \ge 1\ \forall n,\ (n \in B \iff n + p \in B)\bigr) \Rightarrow \sum_{n \in B} \frac{1}{2^n - 1} \notin \mathbb{Q}$
-- This is Luca–Tachiya's Theorem 1.1 for the 0/1 sequence a(n) = 1_B(n) at q = 2 (an element 0 of B contributes 1/0 = 0 in Lean).
have hper : ∀ B : Set ℕ, B.Nonempty → (∃ p : ℕ, 0 < p ∧ ∀ n, n ∈ B ↔ n + p ∈ B) →
Irrational (∑' n : B, (1 : ℝ) / (2 ^ n.1 - 1)) := by
sorry
intro A hA ⟨p, N, hp, hAper⟩
classical
set f : ℕ → ℝ := fun n => (1 : ℝ) / (2 ^ n - 1) with hf
have hfs : Summable f := by
refine Summable.of_nonneg_of_le (f := fun n : ℕ => 2 * (1 / 2 : ℝ) ^ n) (fun n => ?_) (fun n => ?_)
((summable_geometric_two).mul_left 2)
· have : (1 : ℝ) ≤ 2 ^ n := one_le_pow₀ (by norm_num)
exact div_nonneg zero_le_one (by linarith)
· rcases Nat.eq_zero_or_pos n with h | h
· subst h; simp [hf]
· have h2 : (2 : ℝ) ≤ 2 ^ n := by
simpa using pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 2) h
have hpos : (0 : ℝ) < 2 ^ n - 1 := by linarith
simp only [hf]
rw [div_le_iff₀ hpos, one_div_pow, mul_assoc, mul_comm ((1:ℝ) / 2 ^ n), mul_one_div,
mul_div_assoc', le_div_iff₀ (by positivity)]
nlinarith
have hiter : ∀ k n, N ≤ n → (n ∈ A ↔ n + p * k ∈ A) := by
intro k
induction k with
| zero => intro n _; simp
| succ k ih =>
intro n hn
rw [ih n hn, hAper (n + p * k) (by omega)]
rw [show n + p * k + p = n + p * (k + 1) by ring]
let B : Set ℕ := {n | n + p * N ∈ A}
have hpN : N ≤ p * N := Nat.le_mul_of_pos_left N hp
have hBper : ∀ n, n ∈ B ↔ n + p ∈ B := by
intro n
show n + p * N ∈ A ↔ n + p + p * N ∈ A
rw [hAper (n + p * N) (by omega), show n + p * N + p = n + p + p * N by ring]
have hAB : ∀ n, N ≤ n → (n ∈ A ↔ n ∈ B) := fun n hn => hiter N n hn
have hBne : B.Nonempty := by
obtain ⟨m, hm, hmN⟩ := hA.exists_gt N
exact ⟨m, (hAB m hmN.le).1 hm⟩
have hB := hper B hBne ⟨p, hp, hBper⟩
have h1 := hfs.indicator A
have h2 := hfs.indicator B
have hsub := h1.tsum_sub h2
have hfin : ∑' n, (A.indicator f n - B.indicator f n) =
∑ n ∈ Finset.range N, (A.indicator f n - B.indicator f n) := by
apply tsum_eq_sum
intro n hn
simp only [Finset.mem_range, not_lt] at hn
simp only [Set.indicator_apply]
by_cases hnA : n ∈ A
· simp [hnA, (hAB n hn).1 hnA]
· have : n ∉ B := fun h => hnA ((hAB n hn).2 h)
simp [hnA, this]
have hrat : ∑ n ∈ Finset.range N, (A.indicator f n - B.indicator f n) =
((∑ n ∈ Finset.range N, ((if n ∈ A then (1 : ℚ) / (2 ^ n - 1) else 0) -
(if n ∈ B then (1 : ℚ) / (2 ^ n - 1) else 0)) : ℚ) : ℝ) := by
push_cast
refine Finset.sum_congr rfl (fun n _ => ?_)
simp only [Set.indicator_apply, hf]
split_ifs <;> push_cast <;> ring
have key : ∑' n : A, f n = ∑' n : B, f n + ((∑ n ∈ Finset.range N,
((if n ∈ A then (1 : ℚ) / (2 ^ n - 1) else 0) -
(if n ∈ B then (1 : ℚ) / (2 ^ n - 1) else 0)) : ℚ) : ℝ) := by
rw [tsum_subtype A f, tsum_subtype B f, ← hrat, ← hfin, hsub]
ring
obtain ⟨q, hq⟩ : ∃ q : ℚ, ∑' n : A, f n = ∑' n : B, f n + (q : ℝ) := ⟨_, key⟩
show Irrational (∑' n : A, f n)
rw [hq]
rintro ⟨r, hr⟩
exact hB ⟨r - q, by push_cast; linarith⟩The gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/variant-5274cf38/attempts/20261022T130000Z-t1022-d-partial.lean
What is known
Literature: Known: a proof is published and not formalised · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-22T13:56:24Z).
- F. Luca and Y. Tachiya, Irrationality of Lambert series associated with a periodic sequence, Int. J. Number Theory 10 (2014), 623–636, Theorem 1.1 — Σ_{n≥1} a(n)/(q^n − 1) is irrational for every purely periodic integer sequence a, not identically zero, and every integer |q| > 1. Read in the authors' restatement as Theorem A, RIMS Kôkyûroku 2014 (2017), p. 139 (kurims.kyoto-u.ac.jp/~kyodo/kokyuroku/contents/pdf/2014-14.pdf).
- F. Luca and Y. Tachiya, Linear independence results for the values of divisor functions series, RIMS Kôkyûroku 2014 (2017), 138–150, Example 2 (p. 140) — The odd integers: 1 and Σ 1/(q^(2n−1) − 1) (with further divisor sums) are linearly independent over ℚ.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/variant-5274cf38/literature/20261022T135624Z-t1022-d.yaml.
Known: Luca–Tachiya 2014, Theorem 1.1, applied to the indicator of a purely periodic set; an eventually periodic infinite set differs from a nonempty purely periodic set in finitely many places, which adds a rational number. The reduction from eventually periodic to purely periodic is elementary (D is filing it as a partial with Luca–Tachiya's case as the hole). On 2026-10-22 Aristotle (via agent C) produced a Lean proof of the purely periodic case.
Work on it
View the proof →Record details (words, files)
- hash
- 7baead79315c
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, A \subseteq \mathbb{N} \text{ infinite}:\quad \bigl(\exists\, p \ge 1,\ N:\ \forall n \ge N,\ n \in A \iff n + p \in A\bigr) \ \Longrightarrow\ \sum_{n\in A}\frac{1}{2^n-1} \ \text{ is irrational}.$
The hypothesis says the indicator of $A$ is eventually periodic with period $p$. Sums are Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $n = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
Rendered from gloss/df5a59d6fda2….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean (D-3); without one, its Lean.
variant-5274cf38--h1Rename or correct →
- status
- open
- attempts
- 2 attempts
Hole hper of variant-5274cf38 (split by 20261022T130000Z-t1022-d-partial.lean).
What is claimed
$\displaystyle \forall B \subseteq \mathbb{N},\ \bigl(B \neq \emptyset \wedge \exists p \ge 1\ \forall n,\ (n \in B \iff n + p \in B)\bigr) \Rightarrow \sum_{n \in B} \frac{1}{2^n - 1} \notin \mathbb{Q}$
This is Luca–Tachiya's Theorem 1.1 for the 0/1 sequence a(n) = 1_B(n) at q = 2 (an element 0 of B contributes 1/0 = 0 in Lean).
Lean
theorem variant_5274cf38__h1 : ∀ (B : Set ℕ),
B.Nonempty →
(∃ (p : ℕ), (0 : ℕ) < p ∧ ∀ (n : ℕ), n ∈ B ↔ n + p ∈ B) →
Irrational (∑' (n : (↑B : Type)), (1 : ℝ) / ((2 : ℝ) ^ (↑n : ℕ) - (1 : ℝ))) := by
sorryHow it is being proved
Open. A direct proof closes it.
What is known
Literature: Known: a proof is published and not formalised · proposed by t1026-b, awaiting a steward or curator
References and summary
Proposed by t1026-b, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-26T21:04:07Z).
- F. Luca and Y. Tachiya, Irrationality of Lambert series associated with a periodic sequence, Int. J. Number Theory 10 (2014), 623–636, Theorem 1.1 — ∑ a(n)/(q^n − 1) is irrational for every purely periodic integer sequence a not identically zero and every integer |q| > 1; this node is the case a = 1_B, q = 2
- P. Erdős, On arithmetical properties of Lambert series, J. Indian Math. Soc. (N.S.) 12 (1948), 63–66 — the method: f_B(m) = #{d | m : d ∈ B} in place of d(m), primes ≡ 1 (mod the period) chosen by the Chinese remainder theorem; the partial filed on this node (graph PR #981) carries that argument in Lean with the supply of primes as its one hole
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1026-b, drafted with Claude Fable 5.1 through Claude Code (tester run 2026-10-26, agent B). Rendered from targets/erdos-257/nodes/variant-5274cf38--h1/literature/20261026T210407Z-t1026-b.yaml.
Known: Luca–Tachiya 2014, Theorem 1.1, for the 0/1 sequence 1_B at q = 2. Not formalised. The Erdős-style proof is in Lean on this node up to one input, a quantitative form of Dirichlet's theorem (m² primes ≡ 1 mod P in (2^m, 2^(m+m²)] for large m), which the pinned Mathlib does not have.
Work on it
Work on this statement →Record details (words, files)
- hash
- 19463bafb629
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1022-d, drafted with Claude Opus 5.5, 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall B \subseteq \mathbb{N},\ \bigl(B \neq \emptyset \wedge \exists p \ge 1\ \forall n,\ (n \in B \iff n + p \in B)\bigr) \Rightarrow \sum_{n \in B} \frac{1}{2^n - 1} \notin \mathbb{Q}$
This is Luca–Tachiya's Theorem 1.1 for the 0/1 sequence a(n) = 1_B(n) at q = 2 (an element 0 of B contributes 1/0 = 0 in Lean).
Rendered from gloss/6a1b9259eddd….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-5c939e77Rename or correct →
- status
- proved
- attempts
- 0 attempts
A related variant. not yet signed as pertinent to the target (D-30 v3.12)
What is claimed
$\displaystyle \Bigl\{\, A \subseteq \mathbb{N} \ :\ 0 \notin A,\ \ \sum_{n\in A}\frac{1}{2^n-1} \in \mathbb{Q} \,\Bigr\} \ \text{ is countable}.$
Finite and infinite $A$ alike: the family of sets of positive integers whose sum is rational is countable. Sums are Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $n = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
Lean
theorem Opn.erdos_257_rational_subsums_countable :
{A : Set ℕ | 0 ∉ A ∧ ∃ q : ℚ, ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = q}.Countable := by
sorryHow it is being proved
Proved by Proof.lean (merged in d8cea3cddcb4) · attestation 000853.
What is known
Literature: Elementary: a routine formalisation of a known fact · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Elementary: a routine formalisation of a known fact (record, 2026-10-22T15:22:15Z).
- V. Kovač and T. Tao, On several irrationality problems for Ahmes series, arXiv:2406.17593v4; Acta Math. Hungar. 175 (2025), 572–608 — §2.1.2 p. 4: the subsums for distinct A are distinct and form a Cantor set; 'Its immediate consequence is that there can be only at most countably many counterexamples'. Remark 4.1 p. 13 proves the distinctness.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/variant-5c939e77/literature/20261022T152215Z-t1022-d.yaml.
Elementary: distinct sets have distinct sums (spec-5e2e0890 on this graph), and there are countably many rationals.
Work on it
View the proof →Record details (words, files)
- hash
- be43330863a6
- origin
- variant (related)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \Bigl\{\, A \subseteq \mathbb{N} \ :\ 0 \notin A,\ \ \sum_{n\in A}\frac{1}{2^n-1} \in \mathbb{Q} \,\Bigr\} \ \text{ is countable}.$
Finite and infinite $A$ alike: the family of sets of positive integers whose sum is rational is countable. Sums are Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $n = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
Rendered from gloss/0ecf7cd1affd….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-6b364d2bRename or correct →
- status
- open
- attempts
- 3 attempts
Restated as hole h_primes of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \sum_{p \text{ prime}}\frac{1}{2^p-1} \ \text{ is irrational}.$
The case $A = \{\text{primes}\}$ of the root. The sum is Lean's tsum over the subtype $\{p : p \text{ prime}\}$, the ordinary sum of a convergent positive series; $0$ and $1$ are not prime, so no junk value $\frac10$ occurs.
Lean
theorem Opn.erdos_257_primes :
Irrational (∑' p : {p : ℕ | p.Prime}, (1 : ℝ) / (2 ^ p.1 - 1)) := by
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
Proved from this hole by 20261022T160309Z-t1022-l-partial.lean (merged in f0822873b58e, attestation 000948).
h1→ variant-6b364d2b--h1 (open)$\displaystyle \forall q \ge 1\ \exists c_0 > 0\ \forall \delta > 0:\ \text{a prime cube } p_\varepsilon = p_0 + \textstyle\sum_k \varepsilon_k v_k, \text{ a finite set of } n \text{ obeying (5.5)--(5.6), a split } S_0 \sqcup S_1 \sqcup S_2 \text{ of the primes} \le B \text{ with } X_p \text{ constant on } S_0,\ |X_p| \le \delta \text{ on } S_1,\ M \text{ even},\ \kappa_1, \dots, \kappa_5 \le \delta,\ \sum_{p \in S_1} \operatorname{Var} X_p \ge c_0$
Read the partial proof (Lean)
private noncomputable def lamG (A : Set ℕ) [DecidablePred (· ∈ A)] (p : ℕ × ℕ) : ℝ :=
if p.2 ∈ A ∧ p.2 ∣ p.1 ∧ p.1 ≠ 0 then (1 / 2 : ℝ) ^ p.1 else 0
private lemma lamG_nonneg (A : Set ℕ) [DecidablePred (· ∈ A)] (p : ℕ × ℕ) : 0 ≤ lamG A p := by
unfold lamG; split_ifs <;> positivity
private lemma lamG_row (A : Set ℕ) [DecidablePred (· ∈ A)] (m : ℕ) :
∑' a, lamG A (m, a) = (((Nat.divisors m).filter (· ∈ A)).card : ℝ) * (1 / 2 : ℝ) ^ m := by
rw [tsum_eq_sum (s := (Nat.divisors m).filter (· ∈ A))]
· rw [Finset.card_eq_sum_ones, Nat.cast_sum, Finset.sum_mul]
refine Finset.sum_congr rfl fun a ha => ?_
simp only [Finset.mem_filter, Nat.mem_divisors] at ha
simp [lamG, ha.1.1, ha.1.2, ha.2]
· intro a ha
simp only [Finset.mem_filter, Nat.mem_divisors, not_and] at ha
unfold lamG
rw [if_neg]
rintro ⟨h1, h2, h3⟩
exact ha ⟨h2, h3⟩ h1
private lemma lamG_row_summable (A : Set ℕ) [DecidablePred (· ∈ A)] (m : ℕ) : Summable fun a => lamG A (m, a) := by
apply summable_of_ne_finset_zero (s := (Nat.divisors m).filter (· ∈ A))
intro a ha
simp only [Finset.mem_filter, Nat.mem_divisors, not_and] at ha
unfold lamG
rw [if_neg]
rintro ⟨h1, h2, h3⟩
exact ha ⟨h2, h3⟩ h1
private lemma lamG_summable (A : Set ℕ) [DecidablePred (· ∈ A)] : Summable (lamG A) := by
rw [summable_prod_of_nonneg (lamG_nonneg A)]
refine ⟨lamG_row_summable A, ?_⟩
simp_rw [lamG_row]
have hg : 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 => by positivity) (fun m => ?_) hg
gcongr
rw [pow_one]
exact_mod_cast (Finset.card_filter_le _ _).trans (Nat.card_divisors_le_self m)
private lemma lamG_col (A : Set ℕ) [DecidablePred (· ∈ A)] (a : ℕ) :
∑' m, lamG A (m, a) = if a ∈ A then (1 : ℝ) / (2 ^ a - 1) else 0 := by
by_cases ha : a ∈ A
swap
· simp [lamG, ha]
rw [if_pos ha]
rcases Nat.eq_zero_or_pos a with h0 | hpos
· subst h0; simp [lamG]
have hinj : Function.Injective fun k : ℕ => a * (k + 1) := by
intro x y h; simp only at h
have := Nat.eq_of_mul_eq_mul_left hpos h; omega
have hsupp : Function.support (fun m => lamG A (m, a)) ⊆ Set.range fun k : ℕ => a * (k + 1) := by
intro m hm
simp only [Function.mem_support, lamG, ne_eq, ite_eq_right_iff, Classical.not_imp] at hm
obtain ⟨⟨_, ⟨c, hc⟩, hm0⟩, _⟩ := hm
refine ⟨c - 1, ?_⟩
have : c ≠ 0 := by rintro rfl; simp at hc; exact hm0 hc
simp only; rw [hc]; congr 1; omega
rw [← hinj.tsum_eq hsupp]
have hterm : ∀ k : ℕ, lamG A (a * (k + 1), a) = (1 / 2 : ℝ) ^ a * ((1 / 2 : ℝ) ^ a) ^ k := by
intro k
have : a * (k + 1) ≠ 0 := by positivity
simp only [lamG, ha, dvd_mul_right, ne_eq, this, not_false_eq_true, and_self, if_true]
rw [← pow_mul, ← pow_add]; congr 1; ring
simp_rw [hterm]
rw [tsum_mul_left, tsum_geometric_of_lt_one (by positivity)
(pow_lt_one₀ (by norm_num) (by norm_num) hpos.ne')]
have h2 : (1 : ℝ) < 2 ^ a := one_lt_pow₀ (by norm_num) hpos.ne'
have h2' : (2 : ℝ) ^ a - 1 ≠ 0 := by linarith
rw [one_div_pow]
field_simp
/-- **Lambert identity.** `∑_{a ∈ A} 1/(2^a - 1) = ∑_m #{d ∣ m : d ∈ A} / 2^m`. (In Lean
`1/(2^0 - 1) = 0` and `Nat.divisors 0 = ∅`, so `0 ∈ A` changes neither side.) -/
private theorem lambert_identity (A : Set ℕ) [DecidablePred (· ∈ A)] :
∑' a : A, (1 : ℝ) / (2 ^ a.1 - 1) =
∑' m : ℕ, ((((Nat.divisors m).filter (· ∈ A)).card : ℕ) : ℝ) / 2 ^ m := by
have hs := lamG_summable A
have hrows : ∑' m : ℕ, ((((Nat.divisors m).filter (· ∈ A)).card : ℕ) : ℝ) / 2 ^ m
= ∑' m, ∑' a, lamG A (m, a) := by
refine tsum_congr fun m => ?_
rw [lamG_row, one_div, inv_pow, div_eq_mul_inv]
have hcols : ∑' a : A, (1 : ℝ) / (2 ^ a.1 - 1) = ∑' a, ∑' m, lamG A (m, a) := by
rw [tsum_subtype A (fun a => (1 : ℝ) / (2 ^ a - 1))]
refine tsum_congr fun a => ?_
rw [lamG_col]; simp [Set.indicator]
rw [hrows, hcols]
have hu : Summable (Function.uncurry fun m a => lamG A (m, a)) := hs
exact hu.tsum_comm
private lemma omega_eq_card_filter (n : ℕ) :
ArithmeticFunction.cardDistinctFactors n = ((Nat.divisors n).filter (· ∈ {p : ℕ | p.Prime})).card := by
rw [ArithmeticFunction.cardDistinctFactors_apply, ← List.card_toFinset]
congr 1
ext p
simp only [Finset.mem_filter, Nat.mem_divisors, Set.mem_setOf_eq, List.mem_toFinset,
Nat.mem_primeFactorsList']
tauto
/-- Equation (1.7) of Tao–Teräväinen: `∑_p 1/(2^p - 1) = ∑_n ω(n)/2^n`. -/
private theorem lambert_primes :
∑' p : {p : ℕ | p.Prime}, (1 : ℝ) / (2 ^ p.1 - 1) =
∑' n : ℕ, (ArithmeticFunction.cardDistinctFactors n : ℝ) / 2 ^ n := by
rw [lambert_identity]
refine tsum_congr fun n => ?_
rw [omega_eq_card_filter]
private lemma omega_div_summable :
Summable fun n : ℕ => (ArithmeticFunction.cardDistinctFactors n : ℝ) / 2 ^ n := by
have hg : 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 => by positivity) (fun m => ?_) hg
rw [pow_one, one_div_pow, div_eq_mul_one_div]
gcongr
rw [omega_eq_card_filter]
exact_mod_cast (Finset.card_filter_le _ _).trans (Nat.card_divisors_le_self m)
/-- Elementary step (2) of the primes route (see postmortem #894): if `∑ f(n)/2^n = a/b`, then
for every `N` the binary tail `∑_{k ≥ 0} f(N+1+k)/2^(k+1)` times `b` is an integer. With
`f = ω` this is the reduction Tao–Teräväinen's argument starts from. -/
private theorem tail_mul_den_int (f : ℕ → ℕ) (hs : Summable (fun n => (f n : ℝ) / 2 ^ n))
(a : ℤ) (b : ℕ) (hb : 0 < b) (h : ∑' n, (f n : ℝ) / 2 ^ n = a / b) (N : ℕ) :
∃ z : ℤ, (b : ℝ) * ∑' k, (f (k + (N + 1)) : ℝ) / 2 ^ (k + 1) = z := by
have hsplit := hs.sum_add_tsum_nat_add (N + 1)
have hfin : ∀ n ∈ Finset.range (N + 1), (2 : ℝ) ^ N * ((f n : ℝ) / 2 ^ n) = ((f n * 2 ^ (N - n) : ℕ) : ℝ) := by
intro n hn
have hn' : n ≤ N := Nat.lt_succ_iff.mp (Finset.mem_range.mp hn)
push_cast
have : (2 : ℝ) ^ N = 2 ^ (N - n) * 2 ^ n := by rw [← pow_add, Nat.sub_add_cancel hn']
rw [this]; field_simp
have htail : ∀ k, (2 : ℝ) ^ N * ((f (k + (N + 1)) : ℝ) / 2 ^ (k + (N + 1))) = (f (k + (N + 1)) : ℝ) / 2 ^ (k + 1) := by
intro k
have : (2 : ℝ) ^ (k + (N + 1)) = 2 ^ (k + 1) * 2 ^ N := by rw [← pow_add]; ring_nf
rw [this]; field_simp
have hI : (2 : ℝ) ^ N * ∑ n ∈ Finset.range (N + 1), (f n : ℝ) / 2 ^ n
= ((∑ n ∈ Finset.range (N + 1), f n * 2 ^ (N - n) : ℕ) : ℝ) := by
rw [Finset.mul_sum, Nat.cast_sum]; exact Finset.sum_congr rfl hfin
have hT : (2 : ℝ) ^ N * ∑' k, (f (k + (N + 1)) : ℝ) / 2 ^ (k + (N + 1))
= ∑' k, (f (k + (N + 1)) : ℝ) / 2 ^ (k + 1) := by
rw [← tsum_mul_left]; exact tsum_congr htail
refine ⟨2 ^ N * a - b * ((∑ n ∈ Finset.range (N + 1), f n * 2 ^ (N - n) : ℕ) : ℤ), ?_⟩
have hb' : (b : ℝ) ≠ 0 := by exact_mod_cast hb.ne'
rw [← hT]
have key : (2 : ℝ) ^ N * (a / b) = ((∑ n ∈ Finset.range (N + 1), f n * 2 ^ (N - n) : ℕ) : ℝ)
+ 2 ^ N * ∑' k, (f (k + (N + 1)) : ℝ) / 2 ^ (k + (N + 1)) := by
rw [← h, ← hsplit, mul_add, hI]
push_cast at key ⊢
have : (b : ℝ) * (2 ^ N * (a / b)) = 2 ^ N * a := by field_simp
linear_combination this - (b : ℝ) * key
/-- Equation (5.1) of Tao–Teräväinen from rationality: if `∑_p 1/(2^p-1) = a/q`, then for every
`N`, `q · ∑_{h ≥ 1} ω(N+h)/2^h` is an integer. -/
private theorem eq_5_1 (a : ℤ) (q : ℕ) (hq : 0 < q)
(h : ∑' p : {p : ℕ | p.Prime}, (1 : ℝ) / (2 ^ p.1 - 1) = a / q) (N : ℕ) :
∃ z : ℤ, (q : ℝ) * ∑' k, (ArithmeticFunction.cardDistinctFactors (k + (N + 1)) : ℝ) / 2 ^ (k + 1) = z :=
tail_mul_den_int (fun n => ArithmeticFunction.cardDistinctFactors n) omega_div_summable a q hq
(by rw [← lambert_primes]; exact h) N
private lemma omega_eq_card_pf (n : ℕ) : ArithmeticFunction.cardDistinctFactors n = n.primeFactors.card := by
rw [ArithmeticFunction.cardDistinctFactors_apply, ← List.card_toFinset]; rfl
/-- additivity used in (5.2): `ω(p k) + 1_{p ∣ k} = ω(k) + 1` for a prime `p` and `k ≠ 0`. -/
private lemma omega_mul_prime {p k : ℕ} (hp : p.Prime) (hk : k ≠ 0) :
ArithmeticFunction.cardDistinctFactors (p * k) + (if p ∣ k then 1 else 0)
= ArithmeticFunction.cardDistinctFactors k + 1 := by
rw [omega_eq_card_pf, omega_eq_card_pf, Nat.primeFactors_mul hp.ne_zero hk, hp.primeFactors]
by_cases h : p ∣ k
· have hm : p ∈ k.primeFactors := Nat.mem_primeFactors.mpr ⟨hp, h, hk⟩
rw [if_pos h, Finset.singleton_union, Finset.insert_eq_of_mem hm]
· have hm : p ∉ k.primeFactors := fun hm => h (Nat.mem_primeFactors.mp hm).2.1
rw [if_neg h, Finset.singleton_union, Finset.card_insert_of_notMem hm]
private lemma omega_shift_summable (c : ℕ) :
Summable fun k : ℕ => (ArithmeticFunction.cardDistinctFactors (k + c) : ℝ) / 2 ^ (k + 1) := by
have h1 : Summable fun k : ℕ => ((k : ℝ) ^ 1) * (1 / 2 : ℝ) ^ k :=
summable_pow_mul_geometric_of_norm_lt_one 1 (by norm_num)
have h2 : Summable fun k : ℕ => (c : ℝ) * (1 / 2 : ℝ) ^ k := summable_geometric_two.mul_left _
refine Summable.of_nonneg_of_le (fun k => by positivity) (fun k => ?_) (h1.add h2)
have hw : (ArithmeticFunction.cardDistinctFactors (k + c) : ℝ) ≤ k + c := by
rw [omega_eq_card_filter]
exact_mod_cast (Finset.card_filter_le _ _).trans (Nat.card_divisors_le_self _)
have hpos : (0 : ℝ) < 2 ^ k := by positivity
rw [div_le_iff₀ (by positivity), pow_one, one_div_pow]
have : ((k : ℝ) * (1 / 2 ^ k) + c * (1 / 2 ^ k)) * 2 ^ (k + 1) = 2 * (k + c) := by
rw [pow_succ]; field_simp
rw [this]
have : (0 : ℝ) ≤ k + c := by positivity
linarith
private lemma ind_summable (f : ℕ → Prop) [DecidablePred f] :
Summable fun k : ℕ => (if f k then (1 : ℝ) else 0) / 2 ^ (k + 1) := by
refine Summable.of_nonneg_of_le (fun k => by split_ifs <;> positivity) (fun k => ?_) summable_geometric_two
rw [one_div_pow]
have : (0 : ℝ) < 2 ^ k := by positivity
split_ifs
· rw [div_le_div_iff_of_pos_left one_pos (by positivity) this]; rw [pow_succ]; linarith
· simp
/-- Equation (5.2)–(5.3) of Tao–Teräväinen: from the tail congruences (5.1) at `m`, for a prime `p`
and `n = p m`: `q ∑_{h ≥ 1} ω(n + p h)/2^h + q δ_p(n)` is an integer, where
`δ_p(n) = ∑_{h ≥ 1} 1_{p² ∣ n + p h}/2^h`. -/
private theorem eq_5_2 (q : ℕ)
(hint : ∀ N : ℕ, ∃ z : ℤ,
(q : ℝ) * ∑' k, (ArithmeticFunction.cardDistinctFactors (k + (N + 1)) : ℝ) / 2 ^ (k + 1) = z)
{p : ℕ} (hp : p.Prime) (m : ℕ) :
∃ z : ℤ, (q : ℝ) * ∑' k, (ArithmeticFunction.cardDistinctFactors (p * m + p * (k + 1)) : ℝ) / 2 ^ (k + 1)
+ (q : ℝ) * ∑' k, (if p ^ 2 ∣ p * m + p * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1) = z := by
obtain ⟨z, hz⟩ := hint m
refine ⟨z + q, ?_⟩
have hterm : ∀ k : ℕ,
(ArithmeticFunction.cardDistinctFactors (p * m + p * (k + 1)) : ℝ) / 2 ^ (k + 1)
+ (if p ^ 2 ∣ p * m + p * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1)
= (ArithmeticFunction.cardDistinctFactors (k + (m + 1)) : ℝ) / 2 ^ (k + 1) + (1 / 2 : ℝ) ^ (k + 1) := by
intro k
have he : p * m + p * (k + 1) = p * (k + (m + 1)) := by ring
have hd : p ^ 2 ∣ p * (k + (m + 1)) ↔ p ∣ k + (m + 1) := by
rw [pow_two]; exact Nat.mul_dvd_mul_iff_left hp.pos
have key := omega_mul_prime hp (show k + (m + 1) ≠ 0 by omega)
rw [he]
have key' : (ArithmeticFunction.cardDistinctFactors (p * (k + (m + 1))) : ℝ)
+ (if p ^ 2 ∣ p * (k + (m + 1)) then (1 : ℝ) else 0)
= (ArithmeticFunction.cardDistinctFactors (k + (m + 1)) : ℝ) + 1 := by
rw [if_congr hd rfl rfl]
have := congrArg (fun t : ℕ => (t : ℝ)) key
simp only [Nat.cast_add, Nat.cast_ite, Nat.cast_one, Nat.cast_zero] at this
exact this
rw [one_div_pow, ← add_div, key', add_div]
have hG : Summable fun k : ℕ => (1 / 2 : ℝ) ^ (k + 1) :=
(summable_nat_add_iff 1).mpr summable_geometric_two
have hsA : Summable fun k : ℕ =>
(ArithmeticFunction.cardDistinctFactors (p * m + p * (k + 1)) : ℝ) / 2 ^ (k + 1) := by
refine Summable.of_nonneg_of_le (fun k => by positivity) (fun k => ?_)
((omega_shift_summable (m + 1)).add hG)
have := hterm k
have h0 : (0 : ℝ) ≤ (if p ^ 2 ∣ p * m + p * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1) := by
split_ifs <;> positivity
linarith
have hsB := ind_summable (fun k => p ^ 2 ∣ p * m + p * (k + 1))
rw [← mul_add, ← hsA.tsum_add hsB, tsum_congr hterm,
(omega_shift_summable (m + 1)).tsum_add hG]
have hg : ∑' k : ℕ, (1 / 2 : ℝ) ^ (k + 1) = 1 := by
simp_rw [pow_succ]; rw [tsum_mul_right, tsum_geometric_two]; norm_num
rw [hg, mul_add, hz]; push_cast; ring
/-- `(-1)^{|ε|}` for `ε ∈ {0,1}^K`, as a product of signs. -/
private noncomputable def cubeSgn {K : ℕ} (ε : Fin K → Bool) : ℝ := ∏ i, if ε i then (-1 : ℝ) else 1
private lemma cubeSgn_eq {K : ℕ} (ε : Fin K → Bool) :
cubeSgn ε = (-1 : ℝ) ^ (Finset.univ.filter fun i => ε i = true).card := by
unfold cubeSgn
rw [Finset.prod_ite]; simp
/-- The shifts (5.7): `r_{ε,h} = p₀ h + ∑_k (h - k) ε_k v_k` (coordinates `k = 1, …, K` are
`Fin K` indices `k - 1`). -/
private def cubeShift {K : ℕ} (p0 : ℤ) (v : Fin K → ℤ) (ε : Fin K → Bool) (h : ℕ) : ℤ :=
p0 * h + ∑ k : Fin K, ((h : ℤ) - (k.1 + 1)) * (if ε k then v k else 0)
/-- (5.7): `r_{ε,h} = p_ε h - ∑_k k ε_k v_k` with `p_ε = p₀ + ∑_k ε_k v_k`. -/
private lemma cubeShift_eq {K : ℕ} (p0 : ℤ) (v : Fin K → ℤ) (ε : Fin K → Bool) (h : ℕ) :
cubeShift p0 v ε h = (p0 + ∑ k : Fin K, (if ε k then v k else 0)) * h
- ∑ k : Fin K, ((k.1 : ℤ) + 1) * (if ε k then v k else 0) := by
unfold cubeShift
rw [add_mul, Finset.sum_mul, add_sub_assoc, ← Finset.sum_sub_distrib]
congr 1
refine Finset.sum_congr rfl fun k _ => ?_
ring
/-- The cancellation behind (5.8): for `1 ≤ h ≤ K` the alternating sum over the cube of any
function of `r_{ε,h}` vanishes, because `r_{ε,h}` does not depend on `ε_h`. -/
private theorem cube_cancel {K : ℕ} (p0 : ℤ) (v : Fin K → ℤ) (g : ℤ → ℝ) {h : ℕ} (h1 : 1 ≤ h) (hK : h ≤ K) :
∑ ε : Fin K → Bool, cubeSgn ε * g (cubeShift p0 v ε h) = 0 := by
let j : Fin K := ⟨h - 1, by omega⟩
let fl : (Fin K → Bool) → (Fin K → Bool) := fun ε => Function.update ε j (!ε j)
have hinv : Function.Involutive fl := by
intro ε; funext i
by_cases hi : i = j
· subst hi; simp [fl]
· simp [fl, Function.update_of_ne hi]
have hshift : ∀ ε, cubeShift p0 v (fl ε) h = cubeShift p0 v ε h := by
intro ε; unfold cubeShift; congr 1
refine Finset.sum_congr rfl fun k _ => ?_
by_cases hk : k = j
· have : ((h : ℤ) - (k.1 + 1)) = 0 := by rw [hk]; simp only [j]; omega
rw [this, zero_mul, zero_mul]
· simp [fl, Function.update_of_ne hk]
have hsgn : ∀ ε, cubeSgn (fl ε) = - cubeSgn ε := by
intro ε; unfold cubeSgn
rw [Fintype.prod_eq_mul_prod_compl j, Fintype.prod_eq_mul_prod_compl j (fun i => if ε i then (-1 : ℝ) else 1)]
have hrest : ∏ i ∈ ({j}ᶜ : Finset (Fin K)), (if fl ε i then (-1 : ℝ) else 1)
= ∏ i ∈ ({j}ᶜ : Finset (Fin K)), (if ε i then (-1 : ℝ) else 1) := by
refine Finset.prod_congr rfl fun i hi => ?_
have : i ≠ j := by simpa using hi
simp [fl, Function.update_of_ne this]
rw [hrest]
cases hε : ε j <;> simp [fl, hε]
set S := ∑ ε : Fin K → Bool, cubeSgn ε * g (cubeShift p0 v ε h) with hS
have : S = -S := by
let σ : (Fin K → Bool) ≃ (Fin K → Bool) := hinv.toPerm _
calc S = ∑ ε, cubeSgn (σ ε) * g (cubeShift p0 v (σ ε) h) := (Equiv.sum_comp σ _).symm
_ = ∑ ε, -(cubeSgn ε * g (cubeShift p0 v ε h)) := by
refine Finset.sum_congr rfl fun ε _ => ?_
show cubeSgn (fl ε) * g (cubeShift p0 v (fl ε) h) = _
rw [hsgn, hshift]; ring
_ = -S := by rw [Finset.sum_neg_distrib]
linarith
private lemma omega_bound_summable (f : ℕ → ℕ) (a b : ℕ) (hf : ∀ k, f k ≤ a + b * k) :
Summable fun k : ℕ => (ArithmeticFunction.cardDistinctFactors (f k) : ℝ) / 2 ^ (k + 1) := by
have h0 : Summable fun k : ℕ => ((k : ℝ) ^ 1) * (1 / 2 : ℝ) ^ k :=
summable_pow_mul_geometric_of_norm_lt_one 1 (by norm_num)
have h1 : Summable fun k : ℕ => (b : ℝ) * (((k : ℝ) ^ 1) * (1 / 2 : ℝ) ^ k) := h0.mul_left _
have h2 : Summable fun k : ℕ => (a : ℝ) * (1 / 2 : ℝ) ^ k := summable_geometric_two.mul_left _
refine Summable.of_nonneg_of_le (fun k => by positivity) (fun k => ?_) (h2.add h1)
have hw : (ArithmeticFunction.cardDistinctFactors (f k) : ℝ) ≤ a + b * k := by
rw [omega_eq_card_filter]
exact_mod_cast (Finset.card_filter_le _ _).trans ((Nat.card_divisors_le_self (f k)).trans (hf k))
rw [div_le_iff₀ (by positivity), pow_one, one_div_pow]
have : ((a : ℝ) * (1 / 2 ^ k) + b * (k * (1 / 2 ^ k))) * 2 ^ (k + 1) = 2 * (a + b * k) := by
rw [pow_succ]; field_simp
rw [this]
have : (0 : ℝ) ≤ a + b * k := by positivity
linarith
/-- Equation (5.8) of Tao–Teräväinen, from (5.1) for all `N`. Hypotheses: `P ε = p_ε` are primes
(5.4), and `n - ∑_k k ε_k v_k = p_ε m_ε` with `m_ε ∈ ℕ` (this is (5.5) together with (5.6)).
Conclusion: `q ∑_{h ≥ 1} ∑_ε (-1)^{|ε|} ω(n + r_{ε,h+K}) / 2^{h+K}
+ q ∑_ε (-1)^{|ε|} δ_{p_ε}(n - ∑_k k ε_k v_k)` is an integer (indices `h = k + 1`). -/
private theorem eq_5_8 (q : ℕ)
(hint : ∀ N : ℕ, ∃ z : ℤ,
(q : ℝ) * ∑' k, (ArithmeticFunction.cardDistinctFactors (k + (N + 1)) : ℝ) / 2 ^ (k + 1) = z)
{K : ℕ} (p0 : ℤ) (v : Fin K → ℤ) (P : (Fin K → Bool) → ℕ)
(hP : ∀ ε, (P ε : ℤ) = p0 + ∑ k : Fin K, (if ε k then v k else 0))
(hprime : ∀ ε, (P ε).Prime) (n : ℤ) (m : (Fin K → Bool) → ℕ)
(hm : ∀ ε, n - ∑ k : Fin K, ((k.1 : ℤ) + 1) * (if ε k then v k else 0) = P ε * m ε) :
∃ z : ℤ,
(q : ℝ) * ∑' k, (∑ ε : Fin K → Bool, cubeSgn ε *
(ArithmeticFunction.cardDistinctFactors (n + cubeShift p0 v ε (k + K + 1)).toNat : ℝ))
/ 2 ^ (k + K + 1)
+ (q : ℝ) * ∑ ε : Fin K → Bool, cubeSgn ε *
∑' k, (if P ε ^ 2 ∣ P ε * m ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1) = z := by
-- the per-vertex congruences (5.2)
have hz : ∀ ε, ∃ z : ℤ,
(q : ℝ) * ∑' k, (ArithmeticFunction.cardDistinctFactors (P ε * m ε + P ε * (k + 1)) : ℝ) / 2 ^ (k + 1)
+ (q : ℝ) * ∑' k, (if P ε ^ 2 ∣ P ε * m ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1) = z :=
fun ε => eq_5_2 q hint (hprime ε) (m ε)
choose z hz using hz
-- the shift identity n + r_{ε,h} = p_ε m_ε + p_ε h
have hsh : ∀ ε (h : ℕ), (n + cubeShift p0 v ε h).toNat = P ε * m ε + P ε * h := by
intro ε h
have : n + cubeShift p0 v ε h = ((P ε * m ε + P ε * h : ℕ) : ℤ) := by
rw [cubeShift_eq, ← hP ε]; push_cast; linear_combination hm ε
rw [this, Int.toNat_natCast]
let a : (Fin K → Bool) → ℕ → ℝ := fun ε k =>
(ArithmeticFunction.cardDistinctFactors (P ε * m ε + P ε * (k + 1)) : ℝ) / 2 ^ (k + 1)
have ha : ∀ ε, Summable (a ε) := fun ε =>
omega_bound_summable (fun k => P ε * m ε + P ε * (k + 1)) (P ε * m ε + P ε) (P ε)
(fun k => by ring_nf; omega)
let F : ℕ → ℝ := fun k => ∑ ε : Fin K → Bool, cubeSgn ε * a ε k
have hF : Summable F := summable_sum fun ε _ => (ha ε).mul_left _
-- the first K terms cancel (5.8)
have hfirst : ∑ i ∈ Finset.range K, F i = 0 := by
refine Finset.sum_eq_zero fun i hi => ?_
have hiK : i + 1 ≤ K := Finset.mem_range.mp hi
have := cube_cancel p0 v (fun t => (ArithmeticFunction.cardDistinctFactors (n + t).toNat : ℝ) / 2 ^ (i + 1))
(h := i + 1) (by omega) hiK
simp only [F, a]
rw [← this]
refine Finset.sum_congr rfl fun ε _ => ?_
rw [hsh]
have htail : ∀ k, F (k + K) = (∑ ε : Fin K → Bool, cubeSgn ε *
(ArithmeticFunction.cardDistinctFactors (n + cubeShift p0 v ε (k + K + 1)).toNat : ℝ))
/ 2 ^ (k + K + 1) := by
intro k
simp only [F, a]
rw [Finset.sum_div]
refine Finset.sum_congr rfl fun ε _ => ?_
rw [hsh, mul_div_assoc]
have hsum := hF.sum_add_tsum_nat_add K
rw [hfirst, zero_add] at hsum
simp_rw [htail] at hsum
rw [hsum]
have hswap : ∑' k, F k = ∑ ε : Fin K → Bool, cubeSgn ε * ∑' k, a ε k := by
simp only [F]
rw [Summable.tsum_finsetSum fun ε _ => (ha ε).mul_left _]
refine Finset.sum_congr rfl fun ε _ => ?_
rw [tsum_mul_left]
rw [hswap]
refine ⟨∑ ε : Fin K → Bool, (-1 : ℤ) ^ (Finset.univ.filter fun i => ε i = true).card * z ε, ?_⟩
push_cast
rw [Finset.mul_sum, Finset.mul_sum, ← Finset.sum_add_distrib]
refine Finset.sum_congr rfl fun ε _ => ?_
rw [← hz ε, cubeSgn_eq]
simp only [a]
ring
/-- Rationality of `∑_p 1/(2^p - 1)` implies (5.8) for every prime cube and every admissible `n`:
S1–S4 of the route map (annex on `variant-6b364d2b`) chained together. -/
private theorem rational_imp_5_8 (a : ℤ) (q : ℕ) (hq : 0 < q)
(h : ∑' p : {p : ℕ | p.Prime}, (1 : ℝ) / (2 ^ p.1 - 1) = a / q)
{K : ℕ} (p0 : ℤ) (v : Fin K → ℤ) (P : (Fin K → Bool) → ℕ)
(hP : ∀ ε, (P ε : ℤ) = p0 + ∑ k : Fin K, (if ε k then v k else 0))
(hprime : ∀ ε, (P ε).Prime) (n : ℤ) (m : (Fin K → Bool) → ℕ)
(hm : ∀ ε, n - ∑ k : Fin K, ((k.1 : ℤ) + 1) * (if ε k then v k else 0) = P ε * m ε) :
∃ z : ℤ,
(q : ℝ) * ∑' k, (∑ ε : Fin K → Bool, cubeSgn ε *
(ArithmeticFunction.cardDistinctFactors (n + cubeShift p0 v ε (k + K + 1)).toNat : ℝ))
/ 2 ^ (k + K + 1)
+ (q : ℝ) * ∑ ε : Fin K → Bool, cubeSgn ε *
∑' k, (if P ε ^ 2 ∣ P ε * m ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1) = z :=
eq_5_8 q (fun N => eq_5_1 a q hq h N) p0 v P hP hprime n m hm
/-- `2^{ω(n)} ≤ n` for `n ≠ 0`, i.e. `ω(n) ≤ log₂ n`: the crude bound `ω(n) ≪ log n` of §5.8. -/
private theorem two_pow_omega_le {n : ℕ} (hn : n ≠ 0) : 2 ^ ArithmeticFunction.cardDistinctFactors n ≤ n := by
rw [omega_eq_card_pf]
calc 2 ^ n.primeFactors.card = ∏ p ∈ n.primeFactors, 2 := by rw [Finset.prod_const]
_ ≤ ∏ p ∈ n.primeFactors, p :=
Finset.prod_le_prod' fun p hp => (Nat.prime_of_mem_primeFactors hp).two_le
_ ≤ n := Nat.le_of_dvd (Nat.pos_of_ne_zero hn) (Nat.prod_primeFactors_dvd n)
/-- `e(t) = exp(2πit)`. -/
private noncomputable def ee (t : ℝ) : ℂ := Complex.exp (((2 * Real.pi * t : ℝ) : ℂ) * Complex.I)
private lemma ee_norm (t : ℝ) : ‖ee t‖ = 1 := Complex.norm_exp_ofReal_mul_I _
private lemma ee_add (a b : ℝ) : ee (a + b) = ee a * ee b := by
unfold ee; rw [← Complex.exp_add]; congr 1; push_cast; ring
private lemma ee_int (z : ℤ) : ee z = 1 := by
unfold ee
rw [← Complex.exp_int_mul_two_pi_mul_I z]; congr 1; push_cast; ring
private lemma ee_re (t : ℝ) : (ee t).re = Real.cos (2 * Real.pi * t) :=
Complex.exp_ofReal_mul_I_re _
private lemma ee_conj (t : ℝ) : (starRingEnd ℂ) (ee t) = ee (-t) := by
unfold ee; rw [← Complex.exp_conj]; congr 1
simp only [map_mul, Complex.conj_ofReal, Complex.conj_I]; push_cast; ring
/-- `‖e(t) - 1‖ ≤ 2π|t|`. -/
private lemma ee_sub_one (t : ℝ) : ‖ee t - 1‖ ≤ 2 * Real.pi * |t| := by
set x : ℝ := 2 * Real.pi * t with hx
have hre : (ee t - 1).re = Real.cos x - 1 := by
rw [Complex.sub_re, ee_re, Complex.one_re]
have him : (ee t - 1).im = Real.sin x := by
simp only [Complex.sub_im, Complex.one_im, sub_zero, ee]
exact Complex.exp_ofReal_mul_I_im _
have hsq : ‖ee t - 1‖ ^ 2 ≤ x ^ 2 := by
rw [← Complex.normSq_eq_norm_sq, Complex.normSq_apply, hre, him]
have h1 := Real.one_sub_sq_div_two_le_cos (x := x)
have h2 := Real.sin_sq_add_cos_sq x
nlinarith
have := (sq_le_sq.mp hsq)
rw [abs_of_nonneg (norm_nonneg _)] at this
calc ‖ee t - 1‖ ≤ |x| := this
_ = 2 * Real.pi * |t| := by
rw [hx, abs_mul, abs_of_pos (by positivity : (0 : ℝ) < 2 * Real.pi)]
/-- `∑∑ (a_i - a_j)^2 = 2N ∑ a^2 - 2 (∑ a)^2`. -/
private lemma sum_sum_sub_sq {ι : Type*} (s : Finset ι) (a : ι → ℝ) :
∑ i ∈ s, ∑ j ∈ s, (a i - a j) ^ 2
= 2 * (s.card : ℝ) * ∑ i ∈ s, a i ^ 2 - 2 * (∑ i ∈ s, a i) ^ 2 := by
have e1 : ∀ i j, (a i - a j) ^ 2 = a i ^ 2 + a j ^ 2 - 2 * (a i * a j) := fun i j => by ring
simp only [e1, Finset.sum_sub_distrib, Finset.sum_add_distrib, Finset.sum_const, nsmul_eq_mul,
← Finset.mul_sum]
rw [← Finset.sum_mul]; ring
/-- The variance step of (5.20): for `|X| ≤ 1/4` on a finite nonempty set, with `n` uniform,
`|E e(X)|^2 ≤ 1 - 16 Var X`. -/
private lemma norm_avg_ee_sq_le {ι : Type*} (s : Finset ι) (hs : s.Nonempty) (X : ι → ℝ)
(hX : ∀ i ∈ s, |X i| ≤ 1 / 4) :
‖((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, ee (X i)‖ ^ 2
≤ 1 - 16 * ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X i ^ 2 - ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X i) ^ 2) := by
have hN : (0 : ℝ) < s.card := by exact_mod_cast hs.card_pos
set S : ℂ := ∑ i ∈ s, ee (X i) with hS
have hnorm : ‖S‖ ^ 2 = ∑ i ∈ s, ∑ j ∈ s, Real.cos (2 * Real.pi * (X i - X j)) := by
have h1 : ((‖S‖ ^ 2 : ℝ) : ℂ) = S * (starRingEnd ℂ) S := by
rw [Complex.mul_conj, Complex.normSq_eq_norm_sq]
have h2 : S * (starRingEnd ℂ) S = ∑ i ∈ s, ∑ j ∈ s, ee (X i - X j) := by
rw [hS, map_sum, Finset.sum_mul_sum]
refine Finset.sum_congr rfl fun i _ => Finset.sum_congr rfl fun j _ => ?_
rw [ee_conj, sub_eq_add_neg, ee_add]
have h3 := congrArg Complex.re (h1.trans h2)
rw [Complex.ofReal_re] at h3
rw [h3, Complex.re_sum]
refine Finset.sum_congr rfl fun i _ => ?_
rw [Complex.re_sum]
exact Finset.sum_congr rfl fun j _ => ee_re _
have hcos : ∀ i ∈ s, ∀ j ∈ s,
Real.cos (2 * Real.pi * (X i - X j)) ≤ 1 - 8 * (X i - X j) ^ 2 := by
intro i hi j hj
have hij : |X i - X j| ≤ 1 / 2 := by
have := abs_sub (X i) (X j); linarith [hX i hi, hX j hj]
have hpi : |2 * Real.pi * (X i - X j)| ≤ Real.pi := by
rw [abs_mul, abs_of_pos (by positivity : (0 : ℝ) < 2 * Real.pi)]
nlinarith [Real.pi_pos]
have := Real.cos_le_one_sub_mul_cos_sq hpi
have hp : Real.pi ≠ 0 := Real.pi_ne_zero
calc Real.cos (2 * Real.pi * (X i - X j)) ≤ 1 - 2 / Real.pi ^ 2 * (2 * Real.pi * (X i - X j)) ^ 2 :=
this
_ = 1 - 8 * (X i - X j) ^ 2 := by field_simp; ring
have hsum : ‖S‖ ^ 2 ≤ (s.card : ℝ) ^ 2 - 8 * (2 * (s.card : ℝ) * ∑ i ∈ s, X i ^ 2
- 2 * (∑ i ∈ s, X i) ^ 2) := by
rw [hnorm, ← sum_sum_sub_sq]
calc ∑ i ∈ s, ∑ j ∈ s, Real.cos (2 * Real.pi * (X i - X j))
≤ ∑ i ∈ s, ∑ j ∈ s, (1 - 8 * (X i - X j) ^ 2) :=
Finset.sum_le_sum fun i hi => Finset.sum_le_sum fun j hj => hcos i hi j hj
_ = (s.card : ℝ) ^ 2 - 8 * ∑ i ∈ s, ∑ j ∈ s, (X i - X j) ^ 2 := by
simp only [Finset.sum_sub_distrib, Finset.sum_const, nsmul_eq_mul, mul_one,
← Finset.mul_sum]
ring
rw [norm_mul, mul_pow, norm_inv, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hN]
have hN2 : (0 : ℝ) < (s.card : ℝ) ^ 2 := by positivity
rw [inv_pow, inv_mul_le_iff₀ hN2]
have : (s.card : ℝ) ^ 2 * (1 - 16 * ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X i ^ 2
- ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X i) ^ 2))
= (s.card : ℝ) ^ 2 - 8 * (2 * (s.card : ℝ) * ∑ i ∈ s, X i ^ 2
- 2 * (∑ i ∈ s, X i) ^ 2) := by
field_simp; ring
rw [this]; exact hsum
/-- The product step of (5.20): `|∏_p E e(X_p)| ≤ exp(-8 ∑_p Var X_p)`. -/
private lemma norm_prod_avg_le {ι : Type*} (s : Finset ι) (hs : s.Nonempty) (S1 : Finset ℕ)
(X : ℕ → ι → ℝ) (hX : ∀ p ∈ S1, ∀ i ∈ s, |X p i| ≤ 1 / 4) :
‖∏ p ∈ S1, ((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, ee (X p i)‖
≤ Real.exp (-8 * ∑ p ∈ S1, ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i ^ 2
- ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i) ^ 2)) := by
have hsq : ‖∏ p ∈ S1, ((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, ee (X p i)‖ ^ 2
≤ Real.exp (-8 * ∑ p ∈ S1, ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i ^ 2
- ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i) ^ 2)) ^ 2 := by
rw [norm_prod, ← Finset.prod_pow, sq, ← Real.exp_add, Finset.mul_sum, ← Finset.sum_add_distrib,
Real.exp_sum]
refine Finset.prod_le_prod (fun p _ => by positivity) fun p hp => ?_
refine (norm_avg_ee_sq_le s hs (X p) (hX p hp)).trans ?_
have := Real.add_one_le_exp (-8 * ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i ^ 2
- ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i) ^ 2) + -8 * ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i ^ 2
- ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i) ^ 2))
linarith
have := sq_le_sq.mp hsq
rwa [abs_of_nonneg (norm_nonneg _), abs_of_pos (Real.exp_pos _)] at this
/-- S5–S7 assembled: if every `Y + C₀ + W` is an integer, `E|W| ≤ δ`, the decorrelation defect is
at most `δ`, `|X_p| ≤ 1/4` and `∑ Var X_p ≥ c₀`, then `1 - 8δ ≤ exp(-8c₀)`. -/
private lemma assembly_core {ι : Type*} (s : Finset ι) (hs : s.Nonempty) (S1 : Finset ℕ)
(X : ℕ → ι → ℝ) (W : ι → ℝ) (C0 δ c0 : ℝ)
(hint : ∀ i ∈ s, ∃ z : ℤ, (∑ p ∈ S1, X p i) + C0 + W i = z)
(hX : ∀ p ∈ S1, ∀ i ∈ s, |X p i| ≤ 1 / 4)
(hW : (s.card : ℝ)⁻¹ * ∑ i ∈ s, |W i| ≤ δ)
(hdec : ‖((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, ee (∑ p ∈ S1, X p i)
- ∏ p ∈ S1, ((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, ee (X p i)‖ ≤ δ)
(hvar : c0 ≤ ∑ p ∈ S1, ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i ^ 2
- ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i) ^ 2)) :
1 - 8 * δ ≤ Real.exp (-8 * c0) := by
have hN : (0 : ℝ) < s.card := by exact_mod_cast hs.card_pos
have hδ : 0 ≤ δ := le_trans (by positivity) hW
-- each phase is `e(-C₀) e(-W)`
have hpt : ∀ i ∈ s, ‖ee (∑ p ∈ S1, X p i) - ee (-C0)‖ ≤ 2 * Real.pi * |W i| := by
intro i hi
obtain ⟨z, hz⟩ := hint i hi
have : ee (∑ p ∈ S1, X p i) = ee (-C0) * ee (-W i) := by
have e1 : (∑ p ∈ S1, X p i) = (z : ℝ) + -C0 + -W i := by linarith
rw [e1, ee_add, ee_add, ee_int, one_mul]
rw [this, ← mul_sub_one, norm_mul, ee_norm, one_mul]
have := ee_sub_one (-W i); rwa [abs_neg] at this
set A : ℂ := ((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, ee (∑ p ∈ S1, X p i) with hA
have hA1 : ‖A - ee (-C0)‖ ≤ 2 * Real.pi * δ := by
have hc : ee (-C0) = ((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, ee (-C0) := by
have : (s.card : ℂ) ≠ 0 := by exact_mod_cast hN.ne'
rw [Finset.sum_const, nsmul_eq_mul, ← mul_assoc, Complex.ofReal_natCast,
inv_mul_cancel₀ this, one_mul]
rw [hA, hc, ← mul_sub, ← Finset.sum_sub_distrib, norm_mul, norm_inv, Complex.norm_real,
Real.norm_eq_abs, abs_of_pos hN]
calc (s.card : ℝ)⁻¹ * ‖∑ i ∈ s, (ee (∑ p ∈ S1, X p i) - ee (-C0))‖
≤ (s.card : ℝ)⁻¹ * ∑ i ∈ s, 2 * Real.pi * |W i| := by
exact mul_le_mul_of_nonneg_left
((norm_sum_le _ _).trans (Finset.sum_le_sum hpt)) (inv_nonneg.mpr hN.le)
_ = 2 * Real.pi * ((s.card : ℝ)⁻¹ * ∑ i ∈ s, |W i|) := by rw [← Finset.mul_sum]; ring
_ ≤ 2 * Real.pi * δ := mul_le_mul_of_nonneg_left hW (by linarith [Real.pi_pos])
have hA2 : 1 - 2 * Real.pi * δ ≤ ‖A‖ := by
have := norm_sub_norm_le (ee (-C0)) (ee (-C0) - A)
rw [sub_sub_cancel, ee_norm, norm_sub_rev] at this
linarith
have hP := norm_prod_avg_le s hs S1 X hX
have hP2 : ‖A‖ - δ ≤ ‖∏ p ∈ S1, ((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, ee (X p i)‖ := by
have := norm_sub_norm_le A (A - ∏ p ∈ S1, ((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, ee (X p i))
rw [sub_sub_cancel] at this
linarith
have hexp : Real.exp (-8 * ∑ p ∈ S1, ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i ^ 2
- ((s.card : ℝ)⁻¹ * ∑ i ∈ s, X p i) ^ 2)) ≤ Real.exp (-8 * c0) :=
Real.exp_le_exp.mpr (by linarith)
have hpi : Real.pi < 3.15 := Real.pi_lt_d2
nlinarith
/-- Independence: the average over `Ns^{S₁}` of a product is the product of averages. -/
private lemma sum_pi_prod {R : Type*} [CommSemiring R] (S1 : Finset ℕ) (Ns : Finset ℤ)
(f : ℕ → ℤ → R) :
∑ ω ∈ Fintype.piFinset (fun _ : S1 => Ns), ∏ p : S1, f p (ω p) = ∏ p ∈ S1, ∑ n ∈ Ns, f p n := by
rw [← Finset.prod_univ_sum (fun _ : S1 => Ns) (fun p n => f p n)]
exact Finset.prod_coe_sort S1 (fun p => ∑ n ∈ Ns, f p n)
private lemma card_pi (S1 : Finset ℕ) (Ns : Finset ℤ) :
((Fintype.piFinset (fun _ : S1 => Ns)).card : ℝ) = (Ns.card : ℝ) ^ S1.card := by
rw [Fintype.card_piFinset, Finset.prod_const, Finset.card_univ, Fintype.card_coe]; push_cast; rfl
/-- `E' e(∑ X'_p) = ∏ E e(X_p)` for independent copies. -/
private lemma avg_pi_ee (S1 : Finset ℕ) (Ns : Finset ℤ) (X : ℕ → ℤ → ℝ) :
(((Fintype.piFinset (fun _ : S1 => Ns)).card : ℝ) : ℂ)⁻¹
* ∑ ω ∈ Fintype.piFinset (fun _ : S1 => Ns), ee (∑ p : S1, X p (ω p))
= ∏ p ∈ S1, ((Ns.card : ℝ) : ℂ)⁻¹ * ∑ n ∈ Ns, ee (X p n) := by
have hprod : ∀ ω : S1 → ℤ, ee (∑ p : S1, X p (ω p)) = ∏ p : S1, ee (X p (ω p)) := by
intro ω
unfold ee
rw [← Complex.exp_sum]; congr 1; push_cast; rw [Finset.mul_sum, Finset.sum_mul]
simp_rw [hprod]
rw [sum_pi_prod S1 Ns (fun p n => ee (X p n)), card_pi, Finset.prod_mul_distrib, Finset.prod_const]
push_cast
rw [inv_pow]
/-- `E' exp(c ∑ X'_p) = ∏ E exp(c X_p)`. -/
private lemma avg_pi_exp (S1 : Finset ℕ) (Ns : Finset ℤ) (X : ℕ → ℤ → ℝ) (c : ℝ) :
((Fintype.piFinset (fun _ : S1 => Ns)).card : ℝ)⁻¹
* ∑ ω ∈ Fintype.piFinset (fun _ : S1 => Ns), Real.exp (c * ∑ p : S1, X p (ω p))
= ∏ p ∈ S1, (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, Real.exp (c * X p n) := by
have hprod : ∀ ω : S1 → ℤ, Real.exp (c * ∑ p : S1, X p (ω p)) = ∏ p : S1, Real.exp (c * X p (ω p)) := by
intro ω; rw [← Real.exp_sum, Finset.mul_sum]
simp_rw [hprod]
rw [sum_pi_prod S1 Ns (fun p n => Real.exp (c * X p n)), card_pi, Finset.prod_mul_distrib,
Finset.prod_const, inv_pow]
/-- `t^M/M! ≤ e^t + e^{-t}` for even `M`. -/
private lemma pow_div_fact_le_exp_add {M : ℕ} (hM : Even M) (t : ℝ) :
t ^ M / M.factorial ≤ Real.exp t + Real.exp (-t) := by
have h1 := Real.pow_div_factorial_le_exp |t| (abs_nonneg t) M
have h2 : t ^ M = |t| ^ M := (hM.pow_abs t).symm
rw [h2]
rcases le_total 0 t with ht | ht
· rw [abs_of_nonneg ht] at h1 ⊢; linarith [Real.exp_pos (-t)]
· rw [abs_of_nonpos ht] at h1 ⊢; linarith [Real.exp_pos t]
/-- The sharp Taylor bound for `e(y)`, from the one for `exp(ix)`. -/
private lemma ee_taylor (htay : ∀ (x : ℝ) (M : ℕ), ‖Complex.exp ((x : ℂ) * Complex.I)
- ∑ m ∈ Finset.range M, ((x : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)‖
≤ |x| ^ M / M.factorial) (M : ℕ) (y : ℝ) :
‖ee y - ∑ m ∈ Finset.range M, (2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ) * (y : ℂ) ^ m‖
≤ (2 * Real.pi) ^ M / M.factorial * |y| ^ M := by
have h := htay (2 * Real.pi * y) M
have e1 : ∑ m ∈ Finset.range M, (((2 * Real.pi * y : ℝ) : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)
= ∑ m ∈ Finset.range M, (2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ) * (y : ℂ) ^ m :=
Finset.sum_congr rfl fun m _ => by push_cast; ring
rw [e1, abs_mul, abs_of_pos (by positivity : (0 : ℝ) < 2 * Real.pi), mul_pow] at h
unfold ee
calc _ ≤ (2 * Real.pi) ^ M * |y| ^ M / M.factorial := h
_ = _ := by ring
/-- An average of `e(Z)` is the Taylor part plus the average remainder. -/
private lemma avg_ee_split {γ : Type*} (u : Finset γ) (Z : γ → ℝ) (M : ℕ) :
((u.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ u, ee (Z i)
= ∑ m ∈ Finset.range M, (2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ)
* (((u.card : ℝ)⁻¹ * ∑ i ∈ u, Z i ^ m : ℝ) : ℂ)
+ ((u.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ u, (ee (Z i) - ∑ m ∈ Finset.range M,
(2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ) * (Z i : ℂ) ^ m) := by
have hC : ((u.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ u, ∑ m ∈ Finset.range M,
(2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ) * (Z i : ℂ) ^ m
= ∑ m ∈ Finset.range M, (2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ)
* (((u.card : ℝ)⁻¹ * ∑ i ∈ u, Z i ^ m : ℝ) : ℂ) := by
rw [Finset.sum_comm, Finset.mul_sum]
refine Finset.sum_congr rfl fun m _ => ?_
rw [← Finset.mul_sum]; push_cast; ring
rw [Finset.sum_sub_distrib, mul_sub, hC]; ring
private lemma norm_avg_rem_le {γ : Type*} (u : Finset γ) (Z : γ → ℝ) (M : ℕ)
(htay : ∀ (x : ℝ) (M : ℕ), ‖Complex.exp ((x : ℂ) * Complex.I)
- ∑ m ∈ Finset.range M, ((x : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)‖
≤ |x| ^ M / M.factorial) :
‖((u.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ u, (ee (Z i) - ∑ m ∈ Finset.range M,
(2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ) * (Z i : ℂ) ^ m)‖
≤ (2 * Real.pi) ^ M / M.factorial * ((u.card : ℝ)⁻¹ * ∑ i ∈ u, |Z i| ^ M) := by
rw [norm_mul, norm_inv, Complex.norm_real, Real.norm_eq_abs,
abs_of_nonneg (Nat.cast_nonneg _)]
calc (u.card : ℝ)⁻¹ * ‖∑ i ∈ u, (ee (Z i) - ∑ m ∈ Finset.range M,
(2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ) * (Z i : ℂ) ^ m)‖
≤ (u.card : ℝ)⁻¹ * ∑ i ∈ u, (2 * Real.pi) ^ M / M.factorial * |Z i| ^ M :=
mul_le_mul_of_nonneg_left ((norm_sum_le _ _).trans
(Finset.sum_le_sum fun i _ => ee_taylor htay M (Z i))) (inv_nonneg.mpr (Nat.cast_nonneg _))
_ = _ := by rw [← Finset.mul_sum]; ring
private lemma norm_coef (m : ℕ) :
‖(2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ)‖ = (2 * Real.pi) ^ m / m.factorial := by
rw [norm_div, norm_pow, Complex.norm_natCast, norm_mul, Complex.norm_I, mul_one, norm_mul,
Complex.norm_ofNat, Complex.norm_real, Real.norm_eq_abs, abs_of_pos Real.pi_pos]
/-- The comparison at the start of §5.4: `|E e(Y) - E e(Y')| ≤ ∑_{m<M} (2π)^m/m! |E Y^m - E Y'^m|
+ (2π)^M/M! (E|Y|^M + E|Y'|^M)`. -/
private lemma avg_ee_compare {α β : Type*} (s : Finset α) (t : Finset β) (Y : α → ℝ) (Y' : β → ℝ)
(M : ℕ) (htay : ∀ (x : ℝ) (M : ℕ), ‖Complex.exp ((x : ℂ) * Complex.I)
- ∑ m ∈ Finset.range M, ((x : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)‖
≤ |x| ^ M / M.factorial) :
‖((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, ee (Y i) - ((t.card : ℝ) : ℂ)⁻¹ * ∑ j ∈ t, ee (Y' j)‖
≤ ∑ m ∈ Finset.range M, (2 * Real.pi) ^ m / m.factorial
* |(s.card : ℝ)⁻¹ * ∑ i ∈ s, Y i ^ m - (t.card : ℝ)⁻¹ * ∑ j ∈ t, Y' j ^ m|
+ (2 * Real.pi) ^ M / M.factorial * ((s.card : ℝ)⁻¹ * ∑ i ∈ s, |Y i| ^ M
+ (t.card : ℝ)⁻¹ * ∑ j ∈ t, |Y' j| ^ M) := by
rw [avg_ee_split s Y M, avg_ee_split t Y' M]
set Rs := ((s.card : ℝ) : ℂ)⁻¹ * ∑ i ∈ s, (ee (Y i) - ∑ m ∈ Finset.range M,
(2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ) * (Y i : ℂ) ^ m)
set Rt := ((t.card : ℝ) : ℂ)⁻¹ * ∑ j ∈ t, (ee (Y' j) - ∑ m ∈ Finset.range M,
(2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ) * (Y' j : ℂ) ^ m)
have hRs := norm_avg_rem_le s Y M htay
have hRt := norm_avg_rem_le t Y' M htay
have hmain : ‖∑ m ∈ Finset.range M, (2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ)
* (((s.card : ℝ)⁻¹ * ∑ i ∈ s, Y i ^ m : ℝ) : ℂ)
- ∑ m ∈ Finset.range M, (2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ)
* (((t.card : ℝ)⁻¹ * ∑ j ∈ t, Y' j ^ m : ℝ) : ℂ)‖
≤ ∑ m ∈ Finset.range M, (2 * Real.pi) ^ m / m.factorial
* |(s.card : ℝ)⁻¹ * ∑ i ∈ s, Y i ^ m - (t.card : ℝ)⁻¹ * ∑ j ∈ t, Y' j ^ m| := by
rw [← Finset.sum_sub_distrib]
refine (norm_sum_le _ _).trans (Finset.sum_le_sum fun m _ => ?_)
rw [← mul_sub, norm_mul, norm_coef, ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs]
set A := ∑ m ∈ Finset.range M, (2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ)
* (((s.card : ℝ)⁻¹ * ∑ i ∈ s, Y i ^ m : ℝ) : ℂ)
- ∑ m ∈ Finset.range M, (2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ)
* (((t.card : ℝ)⁻¹ * ∑ j ∈ t, Y' j ^ m : ℝ) : ℂ) with hA
have h3 : ‖A + Rs + -Rt‖ ≤ ‖A‖ + ‖Rs‖ + ‖-Rt‖ := norm_add₃_le
rw [norm_neg] at h3
have heq : ‖(∑ m ∈ Finset.range M, (2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ)
* (((s.card : ℝ)⁻¹ * ∑ i ∈ s, Y i ^ m : ℝ) : ℂ) + Rs)
- (∑ m ∈ Finset.range M, (2 * Real.pi * Complex.I) ^ m / (m.factorial : ℂ)
* (((t.card : ℝ)⁻¹ * ∑ j ∈ t, Y' j ^ m : ℝ) : ℂ) + Rt)‖ = ‖A + Rs + -Rt‖ := by
congr 1; rw [hA]; ring
rw [heq]
linarith
/-- (5.16)–(5.17) give the decorrelation: `|E e(∑ X_p) - ∏ E e(X_p)| ≤ 2κ₄ + 2κ₅`, with `X'_p`
independent copies (uniform on `Ns^{S₁}`) and `e = exp 1` in `κ₅`. -/
private lemma decor_bound (Ns : Finset ℤ) (S1 : Finset ℕ) (X : ℕ → ℤ → ℝ) (M : ℕ) (hM : Even M)
(htay : ∀ (x : ℝ) (M : ℕ), ‖Complex.exp ((x : ℂ) * Complex.I)
- ∑ m ∈ Finset.range M, ((x : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)‖
≤ |x| ^ M / M.factorial) :
‖((Ns.card : ℝ) : ℂ)⁻¹ * ∑ n ∈ Ns, ee (∑ p ∈ S1, X p n)
- ∏ p ∈ S1, ((Ns.card : ℝ) : ℂ)⁻¹ * ∑ n ∈ Ns, ee (X p n)‖
≤ 2 * (∑ m ∈ Finset.range (M + 1), (2 * Real.pi) ^ m / m.factorial
* |(Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ m
- ((Fintype.piFinset (fun _ : S1 => Ns)).card : ℝ)⁻¹
* ∑ ω ∈ Fintype.piFinset (fun _ : S1 => Ns), (∑ p : S1, X p (ω p)) ^ m|)
+ 2 * ((∏ p ∈ S1, (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns,
Real.exp (2 * Real.pi * Real.exp 1 * X p n)
+ ∏ p ∈ S1, (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns,
Real.exp (-(2 * Real.pi * Real.exp 1) * X p n)) / Real.exp 1 ^ M) := by
set Ω := Fintype.piFinset (fun _ : S1 => Ns) with hΩ
rw [← avg_pi_ee S1 Ns X]
have hc := avg_ee_compare Ns Ω (fun n => ∑ p ∈ S1, X p n) (fun ω => ∑ p : S1, X p (ω p)) M htay
beta_reduce at hc
-- |Y|^M = Y^M
have habs : ∀ y : ℝ, |y| ^ M = y ^ M := fun y => hM.pow_abs y
simp only [habs] at hc
-- the kappa_5 bound on the independent M-th moment
have hk5 : (2 * Real.pi) ^ M / M.factorial
* ((Ω.card : ℝ)⁻¹ * ∑ ω ∈ Ω, (∑ p : S1, X p (ω p)) ^ M)
≤ (∏ p ∈ S1, (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, Real.exp (2 * Real.pi * Real.exp 1 * X p n)
+ ∏ p ∈ S1, (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns,
Real.exp (-(2 * Real.pi * Real.exp 1) * X p n)) / Real.exp 1 ^ M := by
rw [← avg_pi_exp S1 Ns X, ← avg_pi_exp S1 Ns X, ← mul_add, ← Finset.sum_add_distrib]
have hE : (0 : ℝ) < Real.exp 1 ^ M := by positivity
rw [mul_div_assoc, Finset.sum_div, mul_left_comm]
refine mul_le_mul_of_nonneg_left ?_ (inv_nonneg.mpr (Nat.cast_nonneg _))
rw [Finset.mul_sum]
refine Finset.sum_le_sum fun ω _ => ?_
have := pow_div_fact_le_exp_add hM (2 * Real.pi * Real.exp 1 * ∑ p : S1, X p (ω p))
rw [le_div_iff₀ hE]
calc (2 * Real.pi) ^ M / M.factorial * (∑ p : S1, X p (ω p)) ^ M * Real.exp 1 ^ M
= (2 * Real.pi * Real.exp 1 * ∑ p : S1, X p (ω p)) ^ M / M.factorial := by ring
_ ≤ _ := by rw [neg_mul]; exact this
have hsplit : (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ M
≤ |(Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ M
- (Ω.card : ℝ)⁻¹ * ∑ ω ∈ Ω, (∑ p : S1, X p (ω p)) ^ M|
+ (Ω.card : ℝ)⁻¹ * ∑ ω ∈ Ω, (∑ p : S1, X p (ω p)) ^ M := by
have := le_abs_self ((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ M
- (Ω.card : ℝ)⁻¹ * ∑ ω ∈ Ω, (∑ p : S1, X p (ω p)) ^ M)
linarith
rw [Finset.sum_range_succ]
have hcoef : (0 : ℝ) ≤ (2 * Real.pi) ^ M / M.factorial := by positivity
have hterms : 0 ≤ ∑ m ∈ Finset.range M, (2 * Real.pi) ^ m / m.factorial
* |(Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ m
- (Ω.card : ℝ)⁻¹ * ∑ ω ∈ Ω, (∑ p : S1, X p (ω p)) ^ m| :=
Finset.sum_nonneg fun m _ => mul_nonneg (by positivity) (abs_nonneg _)
have hlast : 0 ≤ (2 * Real.pi) ^ M / M.factorial
* |(Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ M
- (Ω.card : ℝ)⁻¹ * ∑ ω ∈ Ω, (∑ p : S1, X p (ω p)) ^ M| :=
mul_nonneg hcoef (abs_nonneg _)
have := mul_le_mul_of_nonneg_left hsplit hcoef
nlinarith
private lemma taylor_term_deriv (m : ℕ) (t : ℝ) :
HasDerivAt (fun s : ℝ => ((s : ℂ) * Complex.I) ^ (m + 1) / ((m + 1).factorial : ℂ))
(Complex.I * (((t : ℂ) * Complex.I) ^ m / (m.factorial : ℂ))) t := by
have h0 : HasDerivAt (fun s : ℝ => (s : ℂ) * Complex.I) (1 * Complex.I) t :=
((hasDerivAt_id t).ofReal_comp).mul_const Complex.I
have h1 := (h0.pow (m + 1)).div_const ((m + 1).factorial : ℂ)
refine h1.congr_deriv ?_
rw [Nat.factorial_succ]
push_cast
have hf : (m.factorial : ℂ) ≠ 0 := by exact_mod_cast (Nat.factorial_pos m).ne'
have hm : ((m : ℂ) + 1) ≠ 0 := by exact_mod_cast Nat.succ_ne_zero m
field_simp
private lemma taylor_deriv (M : ℕ) (t : ℝ) :
HasDerivAt (fun s : ℝ => Complex.exp ((s : ℂ) * Complex.I)
- ∑ m ∈ Finset.range (M + 1), ((s : ℂ) * Complex.I) ^ m / (m.factorial : ℂ))
(Complex.I * (Complex.exp ((t : ℂ) * Complex.I)
- ∑ m ∈ Finset.range M, ((t : ℂ) * Complex.I) ^ m / (m.factorial : ℂ))) t := by
have he : HasDerivAt (fun s : ℝ => Complex.exp ((s : ℂ) * Complex.I))
(Complex.exp ((t : ℂ) * Complex.I) * (1 * Complex.I)) t :=
(((hasDerivAt_id t).ofReal_comp).mul_const Complex.I).cexp
have hs : HasDerivAt (fun s : ℝ => ∑ m ∈ Finset.range M,
((s : ℂ) * Complex.I) ^ (m + 1) / ((m + 1).factorial : ℂ))
(∑ m ∈ Finset.range M, Complex.I * (((t : ℂ) * Complex.I) ^ m / (m.factorial : ℂ))) t :=
HasDerivAt.fun_sum fun m _ => taylor_term_deriv m t
have hfun : (fun s : ℝ => Complex.exp ((s : ℂ) * Complex.I)
- ∑ m ∈ Finset.range (M + 1), ((s : ℂ) * Complex.I) ^ m / (m.factorial : ℂ))
= fun s : ℝ => Complex.exp ((s : ℂ) * Complex.I) - (∑ m ∈ Finset.range M,
((s : ℂ) * Complex.I) ^ (m + 1) / ((m + 1).factorial : ℂ) + 1) := by
funext s; rw [Finset.sum_range_succ']; simp
rw [hfun]
refine (he.sub (hs.add_const 1)).congr_deriv ?_
rw [← Finset.mul_sum]; ring
private lemma taylor_nonneg (M : ℕ) : ∀ x : ℝ, 0 ≤ x →
‖Complex.exp ((x : ℂ) * Complex.I)
- ∑ m ∈ Finset.range M, ((x : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)‖
≤ x ^ M / M.factorial := by
induction M with
| zero =>
intro x _
simp [Complex.norm_exp_ofReal_mul_I]
| succ M ih =>
intro x hx
have hB : ∀ t : ℝ, HasDerivAt (fun s : ℝ => s ^ (M + 1) / ((M + 1).factorial : ℝ))
(t ^ M / (M.factorial : ℝ)) t := by
intro t
refine ((hasDerivAt_pow (M + 1) t).div_const ((M + 1).factorial : ℝ)).congr_deriv ?_
rw [Nat.factorial_succ]; push_cast
have hf : (M.factorial : ℝ) ≠ 0 := by exact_mod_cast (Nat.factorial_pos M).ne'
field_simp
have := image_norm_le_of_norm_deriv_right_le_deriv_boundary
(f := fun s : ℝ => Complex.exp ((s : ℂ) * Complex.I)
- ∑ m ∈ Finset.range (M + 1), ((s : ℂ) * Complex.I) ^ m / (m.factorial : ℂ))
(a := 0) (b := x)
(f' := fun t => Complex.I * (Complex.exp ((t : ℂ) * Complex.I)
- ∑ m ∈ Finset.range M, ((t : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)))
(fun t _ => (taylor_deriv M t).continuousAt.continuousWithinAt)
(fun t _ => (taylor_deriv M t).hasDerivWithinAt)
(B := fun s => s ^ (M + 1) / ((M + 1).factorial : ℝ)) (B' := fun t => t ^ M / (M.factorial : ℝ))
(by simp [Finset.sum_range_succ']) hB
(fun t ht => by
rw [norm_mul, Complex.norm_I, one_mul]
exact ih t ht.1)
(Set.right_mem_Icc.mpr hx)
simpa using this
/-- The sharp Taylor bound for `exp(ix)`, every real `x`: `|e^{ix} - ∑_{m<M} (ix)^m/m!| ≤ |x|^M/M!`. -/
private lemma taylor_all (x : ℝ) (M : ℕ) :
‖Complex.exp ((x : ℂ) * Complex.I)
- ∑ m ∈ Finset.range M, ((x : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)‖
≤ |x| ^ M / M.factorial := by
rcases le_total 0 x with hx | hx
· rw [abs_of_nonneg hx]; exact taylor_nonneg M x hx
· have h := taylor_nonneg M (-x) (by linarith)
rw [abs_of_nonpos hx]
have hc : Complex.exp ((x : ℂ) * Complex.I)
- ∑ m ∈ Finset.range M, ((x : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)
= (starRingEnd ℂ) (Complex.exp (((-x : ℝ) : ℂ) * Complex.I)
- ∑ m ∈ Finset.range M, (((-x : ℝ) : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)) := by
have hz : (starRingEnd ℂ) (((-x : ℝ) : ℂ) * Complex.I) = (x : ℂ) * Complex.I := by
simp only [map_mul, Complex.conj_ofReal, Complex.conj_I]; push_cast; ring
rw [map_sub, map_sum, ← Complex.exp_conj, hz]
congr 1
refine Finset.sum_congr rfl fun m _ => ?_
rw [map_div₀, map_pow, hz, map_natCast]
rw [hc, Complex.norm_conj]
exact h
/-- `ω(u) = #{p ≤ B prime : p ∣ u}` for `0 < u ≤ B`. -/
private lemma omega_eq_sum_primes_le {u B : ℕ} (hu : 0 < u) (huB : u ≤ B) :
(ArithmeticFunction.cardDistinctFactors u : ℝ)
= ∑ p ∈ (Finset.range (B + 1)).filter Nat.Prime, (if p ∣ u then (1 : ℝ) else 0) := by
rw [Finset.sum_boole, omega_eq_card_pf]
congr 2
ext p
simp only [Nat.mem_primeFactors, Finset.mem_filter, Finset.mem_range]
constructor
· rintro ⟨hp, hd, -⟩
have := Nat.le_of_dvd hu hd
exact ⟨⟨by omega, hp⟩, hd⟩
· rintro ⟨⟨-, hp⟩, hd⟩
exact ⟨hp, hd, hu.ne'⟩
/-- (5.12)–(5.13): the truncated phase is `∑_p X_p`, the sum over the primes up to `B`. -/
private lemma phase_split {β : Type*} [Fintype β] (q : ℝ) (H B : ℕ) (c : β → ℝ) (d : ℕ → ℝ)
(u : ℕ → β → ℕ) (hu : ∀ k < H, ∀ b, 0 < u k b ∧ u k b ≤ B) :
q * ∑ k ∈ Finset.range H, (∑ b, c b * (ArithmeticFunction.cardDistinctFactors (u k b) : ℝ)) / d k
= ∑ p ∈ (Finset.range (B + 1)).filter Nat.Prime,
q * ∑ k ∈ Finset.range H, (∑ b, c b * (if p ∣ u k b then (1 : ℝ) else 0)) / d k := by
rw [← Finset.mul_sum, Finset.sum_comm]
congr 1
refine Finset.sum_congr rfl fun k hk => ?_
rw [← Finset.sum_div, Finset.sum_comm]
congr 1
refine Finset.sum_congr rfl fun b _ => ?_
have h := hu k (Finset.mem_range.mp hk) b
rw [← Finset.mul_sum, ← omega_eq_sum_primes_le h.1 h.2]
private lemma avg_abs_add3 {ι : Type*} (s : Finset ι) (a b c : ι → ℝ) :
(s.card : ℝ)⁻¹ * ∑ i ∈ s, |a i + b i + c i|
≤ (s.card : ℝ)⁻¹ * ∑ i ∈ s, |a i| + (s.card : ℝ)⁻¹ * ∑ i ∈ s, |b i|
+ (s.card : ℝ)⁻¹ * ∑ i ∈ s, |c i| := by
rw [← mul_add, ← mul_add, ← Finset.sum_add_distrib, ← Finset.sum_add_distrib]
exact mul_le_mul_of_nonneg_left (Finset.sum_le_sum fun i _ => abs_add_three _ _ _)
(inv_nonneg.mpr (Nat.cast_nonneg _))
/-- `E|f| ≤ (E f²)^{1/2}` (Cauchy–Schwarz), used for `κ₃` as defined in (5.14). -/
private lemma avg_abs_le_sqrt {ι : Type*} (s : Finset ι) (f : ι → ℝ) :
(s.card : ℝ)⁻¹ * ∑ i ∈ s, |f i| ≤ Real.sqrt ((s.card : ℝ)⁻¹ * ∑ i ∈ s, f i ^ 2) := by
have h0 : 0 ≤ (s.card : ℝ)⁻¹ * ∑ i ∈ s, |f i| :=
mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg _)) (Finset.sum_nonneg fun i _ => abs_nonneg _)
rw [← Real.sqrt_sq h0]
apply Real.sqrt_le_sqrt
have hcs := sq_sum_le_card_mul_sum_sq (s := s) (f := fun i => |f i|)
simp only [sq_abs] at hcs
rcases Nat.eq_zero_or_pos s.card with h | h
· simp [h]
· have hN : (0 : ℝ) < s.card := by exact_mod_cast h
rw [mul_pow, inv_pow]
calc ((s.card : ℝ) ^ 2)⁻¹ * (∑ i ∈ s, |f i|) ^ 2
≤ ((s.card : ℝ) ^ 2)⁻¹ * ((s.card : ℝ) * ∑ i ∈ s, f i ^ 2) :=
mul_le_mul_of_nonneg_left (by exact_mod_cast hcs) (by positivity)
_ = (s.card : ℝ)⁻¹ * ∑ i ∈ s, f i ^ 2 := by field_simp
/-- `|(-1)^{|ε|}| = 1`. -/
private lemma abs_sgn_le_one {K : ℕ} (ε : Fin K → Bool) :
|∏ i, (if ε i then (-1 : ℝ) else 1)| ≤ 1 := by
rw [Finset.abs_prod]
refine le_of_eq (Finset.prod_eq_one fun i _ => ?_)
split_ifs <;> simp
/-- `|q ∑_ε (-1)^{|ε|} ∑_k g| ≤ q ∑_ε ∑_k g` for `g ≥ 0`: the `δ_p` terms of (5.8) against `κ₁`. -/
private lemma abs_sgn_tsum_le {K : ℕ} (q : ℝ) (hq : 0 ≤ q) (sgn : (Fin K → Bool) → ℝ)
(hsgn : ∀ ε, |sgn ε| ≤ 1) (g : (Fin K → Bool) → ℕ → ℝ) (hg : ∀ ε k, 0 ≤ g ε k) :
|q * ∑ ε, sgn ε * ∑' k, g ε k| ≤ q * ∑ ε, ∑' k, g ε k := by
rw [abs_mul, abs_of_nonneg hq]
refine mul_le_mul_of_nonneg_left ((Finset.abs_sum_le_sum_abs _ _).trans
(Finset.sum_le_sum fun ε _ => ?_)) hq
rw [abs_mul, abs_of_nonneg (tsum_nonneg (hg ε))]
exact mul_le_of_le_one_left (tsum_nonneg (hg ε)) (hsgn ε)
/-- Truncation (5.11): `|∑ T - ∑_{k<H} T| ≤ ∑_{k} G(k+H)` when `|T| ≤ G` and `G` is summable. -/
private lemma tail_abs_le (T G : ℕ → ℝ) (hT : ∀ k, |T k| ≤ G k) (hG : Summable G) (H : ℕ) :
|∑' k, T k - ∑ k ∈ Finset.range H, T k| ≤ ∑' k, G (k + H) := by
have hTs : Summable T :=
Summable.of_norm_bounded hG (fun k => by rw [Real.norm_eq_abs]; exact hT k)
rw [← hTs.sum_add_tsum_nat_add H, add_sub_cancel_left]
have hTH : Summable fun k => T (k + H) := (summable_nat_add_iff H).mpr hTs
have hGH : Summable fun k => G (k + H) := (summable_nat_add_iff H).mpr hG
rw [abs_le]
constructor
· rw [← tsum_neg]
exact Summable.tsum_le_tsum (fun k => neg_le_of_abs_le (hT (k + H))) hGH.neg hTH
· exact Summable.tsum_le_tsum (fun k => le_of_abs_le (hT (k + H))) hTH hGH
private lemma abs_sgn_sum_div_le {β : Type*} [Fintype β] (sgn : β → ℝ) (hs : ∀ b, |sgn b| ≤ 1)
(w : β → ℝ) (hw : ∀ b, 0 ≤ w b) (d : ℝ) (hd : 0 < d) :
|(∑ b, sgn b * w b) / d| ≤ (∑ b, w b) / d := by
rw [abs_div, abs_of_pos hd]
exact div_le_div_of_nonneg_right ((Finset.abs_sum_le_sum_abs _ _).trans
(Finset.sum_le_sum fun b _ => by
rw [abs_mul, abs_of_nonneg (hw b)]; exact mul_le_of_le_one_left (hw b) (hs b))) hd.le
/-- Erdős 257 for `A` the set of primes: `∑_p 1/(2^p - 1) = ∑_{n ≥ 1} ω(n)/2^n` is irrational
(this is also Erdős problem 69). Known: T. Tao and J. Teräväinen, *Quantitative correlations and
some problems on prime factors of consecutive integers*, arXiv:2512.01739 (v2, 2026), Theorem 1.3
(§1.3); earlier conditional on a uniform prime tuples conjecture (Pratt 2024). The paper only
sketches the analogous case of the prime powers ("we leave the details … to the interested
reader"), so that case is not stated here. -/
theorem Opn.erdos_257_primes :
Irrational (∑' p : {p : ℕ | p.Prime}, (1 : ℝ) / (2 ^ p.1 - 1)) := by
-- approach: Tao–Teräväinen §5: rationality forces (5.8) on every prime cube; averaging e(phase) over n and the variance bound (5.20) contradict Theorem 5.1
-- licence: CC-BY-4.0
-- label: Tao–Teräväinen Theorem 5.1 (technical reduction)
-- claim: $\forall q \ge 1\ \exists c_0 > 0\ \forall \delta > 0:\ \text{a prime cube } p_\varepsilon = p_0 + \textstyle\sum_k \varepsilon_k v_k,
-- \text{ a finite set of } n \text{ obeying (5.5)--(5.6), a split } S_0 \sqcup S_1 \sqcup S_2 \text{ of the primes} \le B
-- \text{ with } X_p \text{ constant on } S_0,\ |X_p| \le \delta \text{ on } S_1,\ M \text{ even},\ \kappa_1, \dots, \kappa_5 \le \delta,\ \sum_{p \in S_1} \operatorname{Var} X_p \ge c_0$
-- Theorem 5.1 of arXiv:2512.01739v2 (p. 49) for n uniform on the finite set Ns, where
-- X_p(n) = q sum_{1<=h<=H} sum_eps (-1)^|eps| 1[p | n + r_{eps,h+K}] / 2^(h+K) is (5.13), and
-- kappa_1, kappa_2, kappa_3 are (5.10), (5.11), (5.14) as printed (expectation and sums swapped).
-- kappa_4, kappa_5 are (5.16), (5.17) as printed, with X'_p independent copies (n uniform on
-- Ns^{S_1}) and e = exp 1 in (5.17). One part is taken from the paper's proof rather than its
-- statement: (5.19), |X_p| small on S_1 (shown in section 5.6 from (5.36)). It does not mention the sum or
-- rationality: it is about prime factors of shifted integers, and in the paper its proof rests on
-- the paper's Theorem 3.1 and on Lemma 5.2.
have h1 : ∀ q : ℕ, 0 < q → ∃ c0 : ℝ, 0 < c0 ∧ ∀ δ : ℝ, 0 < δ →
∃ (K : ℕ) (p0 : ℤ) (v : Fin K → ℤ) (P : (Fin K → Bool) → ℕ) (H B : ℕ) (Ns : Finset ℤ)
(m : ℤ → (Fin K → Bool) → ℕ) (S1 S2 : Finset ℕ) (sgn : (Fin K → Bool) → ℝ)
(r : (Fin K → Bool) → ℕ → ℤ) (X : ℕ → ℤ → ℝ) (M : ℕ),
(∀ ε, sgn ε = ∏ i, if ε i then (-1 : ℝ) else 1) ∧
(∀ ε (h : ℕ), r ε h = p0 * h + ∑ k : Fin K, ((h : ℤ) - (k.1 + 1)) * (if ε k then v k else 0)) ∧
(∀ p n, X p n = (q : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1)) ∧
Even M ∧
(∀ ε, (P ε : ℤ) = p0 + ∑ k : Fin K, (if ε k then v k else 0)) ∧ (∀ ε, (P ε).Prime) ∧
Ns.Nonempty ∧
(∀ n ∈ Ns, ∀ ε, n - ∑ k : Fin K, ((k.1 : ℤ) + 1) * (if ε k then v k else 0) = P ε * m n ε) ∧
(∀ n ∈ Ns, ∀ ε, ∀ k < H, 0 < n + r ε (k + K + 1) ∧ n + r ε (k + K + 1) ≤ B) ∧
S1 ⊆ (Finset.range (B + 1)).filter Nat.Prime ∧ S2 ⊆ (Finset.range (B + 1)).filter Nat.Prime ∧
Disjoint S1 S2 ∧
(∀ p ∈ (Finset.range (B + 1)).filter Nat.Prime, p ∉ S1 → p ∉ S2 →
∀ n ∈ Ns, ∀ n' ∈ Ns, X p n = X p n') ∧
(∀ p ∈ S1, ∀ n ∈ Ns, |X p n| ≤ δ) ∧
(Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, ∑ ε : Fin K → Bool, ∑' k : ℕ,
(if P ε ^ 2 ∣ P ε * m n ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1) ≤ δ ∧
(Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, ∑' k : ℕ, (∑ ε : Fin K → Bool,
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + H + K + 1)).toNat : ℝ))
/ 2 ^ (k + H + K + 1) ≤ δ ∧
Real.sqrt ((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S2, X p n) ^ 2) ≤ δ ∧
∑ j ∈ Finset.range (M + 1), (2 * Real.pi) ^ j / j.factorial
* |(Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ j
- ((Fintype.piFinset (fun _ : S1 => Ns)).card : ℝ)⁻¹
* ∑ ω ∈ Fintype.piFinset (fun _ : S1 => Ns), (∑ p : S1, X p (ω p)) ^ j| ≤ δ ∧
(∏ p ∈ S1, (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, Real.exp (2 * Real.pi * Real.exp 1 * X p n)
+ ∏ p ∈ S1, (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns,
Real.exp (-(2 * Real.pi * Real.exp 1) * X p n)) / Real.exp 1 ^ M ≤ δ ∧
c0 ≤ ∑ p ∈ S1, ((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, X p n ^ 2
- ((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, X p n) ^ 2) := sorry
have htay := taylor_all
rintro ⟨r0, hr0⟩
have hq : 0 < r0.den := r0.den_pos
have hsum : ∑' p : {p : ℕ | p.Prime}, (1 : ℝ) / (2 ^ p.1 - 1) = (r0.num : ℝ) / (r0.den : ℕ) := by
rw [← hr0, Rat.cast_def]
obtain ⟨c0, hc0, hall⟩ := h1 r0.den hq
have hex : Real.exp (-8 * c0) < 1 := by
have := Real.exp_lt_exp.mpr (show -8 * c0 < 0 by linarith)
rwa [Real.exp_zero] at this
have hδ : 0 < min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) := lt_min (by norm_num) (by linarith)
have hδ1 : min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) ≤ 1 / 4 := min_le_left _ _
have hδ2 : min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) ≤ (1 - Real.exp (-8 * c0)) / 64 :=
min_le_right _ _
obtain ⟨K, p0, v, P, H, B, Ns, m, S1, S2, sgn, r, X, M, hsgn, hr, hX, hMeven, hP, hpr, hNs, hm, hrange,
hS1, hS2, hdisj, hS0, hXs, hk1, hk2, hk3, hk4, hk5, hvar⟩ :=
hall (min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) / r0.den) (div_pos hδ (by positivity))
have hq1 : (1 : ℝ) ≤ r0.den := by exact_mod_cast hq
have hd1 : min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) / r0.den
≤ min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) := div_le_self hδ.le hq1
have hd2 : (r0.den : ℝ) * (min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) / r0.den)
= min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) :=
mul_div_cancel₀ _ (by positivity)
have hsgn' : cubeSgn = sgn := funext fun ε => by rw [hsgn ε]; rfl
have hr' : cubeShift p0 v = r := funext fun ε => funext fun h => by rw [hr ε h]; rfl
obtain ⟨n0, hn0⟩ := hNs
have key := assembly_core Ns ⟨n0, hn0⟩ S1 X
(fun n => (r0.den : ℝ) * ∑ ε : Fin K → Bool, sgn ε * ∑' k : ℕ,
(if P ε ^ 2 ∣ P ε * m n ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1)
+ ((r0.den : ℝ) * ∑' k : ℕ, (∑ ε : Fin K → Bool, sgn ε *
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + K + 1)).toNat : ℝ)) / 2 ^ (k + K + 1)
- (r0.den : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + K + 1)).toNat : ℝ)) / 2 ^ (k + K + 1))
+ ∑ p ∈ S2, X p n)
(∑ p ∈ (Finset.range (B + 1)).filter Nat.Prime \ (S1 ∪ S2), X p n0)
(4 * min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64)) c0 ?_
(fun p hp n hn => ((hXs p hp n hn).trans hd1).trans hδ1) ?_ ((decor_bound Ns S1 X M hMeven htay).trans (by linarith)) hvar
· linarith
· intro n hn
obtain ⟨z, hz⟩ := rational_imp_5_8 r0.num r0.den hq hsum p0 v P hP hpr n (m n) (hm n hn)
rw [hsgn', hr'] at hz
refine ⟨z, ?_⟩
have hu : ∀ k < H, ∀ ε : Fin K → Bool,
0 < (n + r ε (k + K + 1)).toNat ∧ (n + r ε (k + K + 1)).toNat ≤ B := by
intro k hk ε
have h := hrange n hn ε k hk
constructor <;> omega
have hsplit := phase_split (r0.den : ℝ) H B sgn (fun k => (2 : ℝ) ^ (k + K + 1))
(fun k ε => (n + r ε (k + K + 1)).toNat) hu
beta_reduce at hsplit
have hPB : ∑ p ∈ (Finset.range (B + 1)).filter Nat.Prime, X p n
= ∑ p ∈ S1, X p n + ∑ p ∈ S2, X p n
+ ∑ p ∈ (Finset.range (B + 1)).filter Nat.Prime \ (S1 ∪ S2), X p n := by
rw [← Finset.sum_union hdisj]
exact (Finset.sum_sdiff (Finset.union_subset hS1 hS2)).symm.trans (add_comm _ _)
have hC : ∑ p ∈ (Finset.range (B + 1)).filter Nat.Prime \ (S1 ∪ S2), X p n
= ∑ p ∈ (Finset.range (B + 1)).filter Nat.Prime \ (S1 ∪ S2), X p n0 := by
refine Finset.sum_congr rfl fun p hp => ?_
have hp' := Finset.mem_sdiff.mp hp
exact hS0 p hp'.1 (fun h => hp'.2 (Finset.mem_union_left _ h))
(fun h => hp'.2 (Finset.mem_union_right _ h)) n hn n0 hn0
have hXsum : ∑ p ∈ (Finset.range (B + 1)).filter Nat.Prime,
(r0.den : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1)
= ∑ p ∈ (Finset.range (B + 1)).filter Nat.Prime, X p n :=
Finset.sum_congr rfl fun p _ => (hX p n).symm
linarith
· refine (avg_abs_add3 Ns _ _ _).trans ?_
have e1 : (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, |(r0.den : ℝ) * ∑ ε : Fin K → Bool, sgn ε * ∑' k : ℕ,
(if P ε ^ 2 ∣ P ε * m n ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1)|
≤ min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) := by
have hs1 : ∀ ε, |sgn ε| ≤ 1 := fun ε => by rw [hsgn ε]; exact abs_sgn_le_one ε
calc (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, |(r0.den : ℝ) * ∑ ε : Fin K → Bool, sgn ε * ∑' k : ℕ,
(if P ε ^ 2 ∣ P ε * m n ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1)|
≤ (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (r0.den : ℝ) * ∑ ε : Fin K → Bool, ∑' k : ℕ,
(if P ε ^ 2 ∣ P ε * m n ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1) :=
mul_le_mul_of_nonneg_left (Finset.sum_le_sum fun n _ =>
abs_sgn_tsum_le _ (Nat.cast_nonneg _) sgn hs1 _ fun ε k =>
div_nonneg (by split_ifs <;> norm_num) (by positivity))
(inv_nonneg.mpr (Nat.cast_nonneg _))
_ = (r0.den : ℝ) * ((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, ∑ ε : Fin K → Bool, ∑' k : ℕ,
(if P ε ^ 2 ∣ P ε * m n ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1)) := by
rw [← Finset.mul_sum]; ring
_ ≤ (r0.den : ℝ) * (min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) / r0.den) :=
mul_le_mul_of_nonneg_left hk1 (Nat.cast_nonneg _)
_ = min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) := hd2
have hs1 : ∀ ε, |sgn ε| ≤ 1 := fun ε => by rw [hsgn ε]; exact abs_sgn_le_one ε
have e2 : (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, |(r0.den : ℝ) * ∑' k : ℕ, (∑ ε : Fin K → Bool, sgn ε *
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + K + 1)).toNat : ℝ)) / 2 ^ (k + K + 1)
- (r0.den : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + K + 1)).toNat : ℝ)) / 2 ^ (k + K + 1)|
≤ min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) := by
have hper : ∀ n ∈ Ns, |(r0.den : ℝ) * ∑' k : ℕ, (∑ ε : Fin K → Bool, sgn ε *
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + K + 1)).toNat : ℝ)) / 2 ^ (k + K + 1)
- (r0.den : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + K + 1)).toNat : ℝ)) / 2 ^ (k + K + 1)|
≤ (r0.den : ℝ) * ∑' k : ℕ, (∑ ε : Fin K → Bool,
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + H + K + 1)).toNat : ℝ))
/ 2 ^ (k + H + K + 1) := by
intro n hn
have hsh : ∀ ε (h : ℕ), (n + r ε h).toNat = P ε * m n ε + P ε * h := by
intro ε h
have : n + r ε h = ((P ε * m n ε + P ε * h : ℕ) : ℤ) := by
rw [← hr', cubeShift_eq, ← hP ε]; push_cast; linear_combination hm n hn ε
rw [this, Int.toNat_natCast]
have hG : Summable fun k : ℕ => (∑ ε : Fin K → Bool,
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + K + 1)).toNat : ℝ))
/ 2 ^ (k + K + 1) := by
simp_rw [Finset.sum_div]
refine summable_sum fun ε _ => ?_
have hb := omega_bound_summable (fun k => P ε * m n ε + P ε * (k + K + 1))
(P ε * m n ε + P ε * (K + 1)) (P ε) (fun k => le_of_eq (by ring))
refine Summable.of_nonneg_of_le (fun k => by positivity) (fun k => ?_) hb
rw [hsh ε]
exact div_le_div_of_nonneg_left (by positivity) (by positivity)
(pow_le_pow_right₀ (by norm_num) (by omega))
rw [← mul_sub, abs_mul, abs_of_nonneg (Nat.cast_nonneg _)]
exact mul_le_mul_of_nonneg_left (tail_abs_le _ _ (fun k => abs_sgn_sum_div_le sgn hs1 _
(fun ε => Nat.cast_nonneg _) _ (by positivity)) hG H) (Nat.cast_nonneg _)
calc _ ≤ (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (r0.den : ℝ) * ∑' k : ℕ, (∑ ε : Fin K → Bool,
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + H + K + 1)).toNat : ℝ))
/ 2 ^ (k + H + K + 1) :=
mul_le_mul_of_nonneg_left (Finset.sum_le_sum hper) (inv_nonneg.mpr (Nat.cast_nonneg _))
_ = (r0.den : ℝ) * ((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, ∑' k : ℕ, (∑ ε : Fin K → Bool,
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + H + K + 1)).toNat : ℝ))
/ 2 ^ (k + H + K + 1)) := by rw [← Finset.mul_sum]; ring
_ ≤ (r0.den : ℝ) * (min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) / r0.den) :=
mul_le_mul_of_nonneg_left hk2 (Nat.cast_nonneg _)
_ = min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) := hd2
have e3 : (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, |∑ p ∈ S2, X p n|
≤ min (1 / 4 : ℝ) ((1 - Real.exp (-8 * c0)) / 64) :=
((avg_abs_le_sqrt Ns fun n => ∑ p ∈ S2, X p n).trans hk3).trans hd1
linarithThe gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/variant-6b364d2b/attempts/20261022T160309Z-t1022-l-partial.lean
Closing it through its holes
Closable through its holes: once they are proved, a proof of this statement may name their theorems, which its Context already carries. A direct proof is accepted at any time.
What is known
Literature: Known: a proof is published and not formalised · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-22T13:47:27Z).
- T. Tao and J. Teräväinen, Quantitative correlations and some problems on prime factors of consecutive integers, arXiv:2512.01739v2 (Apr 2026), Theorem 1.3 (§1.3, p. 4; proof in §5) — Σ_p 1/(2^p − 1) = Σ ω(n)/2^n = 0.5169… is irrational (Erdős #69; the prime case of #257). Unconditional; Pratt 2024 had it under a uniform prime-tuples conjecture. Prime powers and other bases are only sketched in the following paragraph.
- V. Kovač and T. Tao, On several irrationality problems for Ahmes series, arXiv:2406.17593v4; Acta Math. Hungar. 175 (2025), 572–608 — §2.1.2 p. 5 (2024, before Tao–Teräväinen): identifies the prime case with Σ ω(n)/2^n and calls it open.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/variant-6b364d2b/literature/20261022T134727Z-t1022-d.yaml.
Known (Tao–Teräväinen 2025/26, Theorem 1.3), by quantitative correlation estimates for ω on consecutive integers; a deep analytic result, not formalised anywhere I could find. The analogous statement for the prime powers is only sketched in that paper.
Work on it
Plans
- Source: T. — not followed by any merged decomposition · full text →
Record details (words, files)
- hash
- ce18cd51948c
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \sum_{p \text{ prime}}\frac{1}{2^p-1} \ \text{ is irrational}.$
The case $A = \{\text{primes}\}$ of the root. The sum is Lean's tsum over the subtype $\{p : p \text{ prime}\}$, the ordinary sum of a convergent positive series; $0$ and $1$ are not prime, so no junk value $\frac10$ occurs.
Rendered from gloss/21af85c140e6….md · Improve these words →
Untrusted contributor text (D-31): an outline is an informal argument in named steps, not a proof. The full text is on the statement’s record page.
- Primes case (Erdős 69 = Erdős 257 for A = primes): a route map of Tao–Teräväinen's proof for a Lean partial by t1022-l — not followed by any merged decomposition · full text →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean (D-3); without one, its Lean.
variant-6b364d2b--h1Rename or correct →
- status
- open
- attempts
- 2 attempts
Hole h1 of variant-6b364d2b (split by 20261022T160309Z-t1022-l-partial.lean).
What is claimed
$\displaystyle \forall q \ge 1\ \exists c_0 > 0\ \forall \delta > 0:\ \text{a prime cube } p_\varepsilon = p_0 + \textstyle\sum_k \varepsilon_k v_k, \text{ a finite set of } n \text{ obeying (5.5)--(5.6), a split } S_0 \sqcup S_1 \sqcup S_2 \text{ of the primes} \le B \text{ with } X_p \text{ constant on } S_0,\ |X_p| \le \delta \text{ on } S_1,\ M \text{ even},\ \kappa_1, \dots, \kappa_5 \le \delta,\ \sum_{p \in S_1} \operatorname{Var} X_p \ge c_0$
Theorem 5.1 of arXiv:2512.01739v2 (p. 49) for n uniform on the finite set Ns, where X_p(n) = q sum_{1<=h<=H} sum_eps (-1)^|eps| 1[p | n + r_{eps,h+K}] / 2^(h+K) is (5.13), and kappa_1, kappa_2, kappa_3 are (5.10), (5.11), (5.14) as printed (expectation and sums swapped). kappa_4, kappa_5 are (5.16), (5.17) as printed, with X'_p independent copies (n uniform on Ns^{S_1}) and e = exp 1 in (5.17). One part is taken from the paper's proof rather than its statement: (5.19), |X_p| small on S_1 (shown in section 5.6 from (5.36)). It does not mention the sum or rationality: it is about prime factors of shifted integers, and in the paper its proof rests on the paper's Theorem 3.1 and on Lemma 5.2.
Lean
theorem variant_6b364d2b__h1 : ∀ (q : ℕ),
(0 : ℕ) < q →
∃ (c0 : ℝ),
(0 : ℝ) < c0 ∧
∀ (δ : ℝ),
(0 : ℝ) < δ →
∃ (K : ℕ) (p0 : ℤ) (v : Fin K → ℤ) (P : (Fin K → Bool) → ℕ) (H : ℕ) (B : ℕ) (Ns : Finset ℤ) (m :
ℤ → (Fin K → Bool) → ℕ) (S1 : Finset ℕ) (S2 : Finset ℕ) (sgn : (Fin K → Bool) → ℝ) (r :
(Fin K → Bool) → ℕ → ℤ) (X : ℕ → ℤ → ℝ) (M : ℕ),
(∀ (ε : Fin K → Bool), sgn ε = ∏ i : Fin K, if ε i = true then (-1 : ℝ) else (1 : ℝ)) ∧
(∀ (ε : Fin K → Bool) (h : ℕ),
r ε h =
p0 * (↑h : ℤ) +
∑ k : Fin K, ((↑h : ℤ) - ((↑(↑k : ℕ) : ℤ) + (1 : ℤ))) * if ε k = true then v k else (0 : ℤ)) ∧
(∀ (p : ℕ) (n : ℤ),
X p n =
(↑q : ℝ) *
∑ k ∈ Finset.range H,
(∑ ε : Fin K → Bool,
sgn ε * if p ∣ (n + r ε (k + K + (1 : ℕ))).toNat then (1 : ℝ) else (0 : ℝ)) /
(2 : ℝ) ^ (k + K + (1 : ℕ))) ∧
Even M ∧
(∀ (ε : Fin K → Bool), (↑(P ε) : ℤ) = p0 + ∑ k : Fin K, if ε k = true then v k else (0 : ℤ)) ∧
(∀ (ε : Fin K → Bool), Nat.Prime (P ε)) ∧
Ns.Nonempty ∧
(∀ n ∈ Ns,
∀ (ε : Fin K → Bool),
(n - ∑ k : Fin K, ((↑(↑k : ℕ) : ℤ) + (1 : ℤ)) * if ε k = true then v k else (0 : ℤ)) =
(↑(P ε) : ℤ) * (↑(m n ε) : ℤ)) ∧
(∀ n ∈ Ns,
∀ (ε : Fin K → Bool),
∀ k < H,
(0 : ℤ) < n + r ε (k + K + (1 : ℕ)) ∧ n + r ε (k + K + (1 : ℕ)) ≤ (↑B : ℤ)) ∧
S1 ⊆ Finset.filter Nat.Prime (Finset.range (B + (1 : ℕ))) ∧
S2 ⊆ Finset.filter Nat.Prime (Finset.range (B + (1 : ℕ))) ∧
Disjoint S1 S2 ∧
(∀ p ∈ Finset.filter Nat.Prime (Finset.range (B + (1 : ℕ))),
p ∉ S1 → p ∉ S2 → ∀ n ∈ Ns, ∀ n' ∈ Ns, X p n = X p n') ∧
(∀ p ∈ S1, ∀ n ∈ Ns, |X p n| ≤ δ) ∧
(↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
∑ ε : Fin K → Bool,
∑' (k : ℕ),
(if P ε ^ (2 : ℕ) ∣ P ε * m n ε + P ε * (k + (1 : ℕ)) then (1 : ℝ)
else (0 : ℝ)) /
(2 : ℝ) ^ (k + (1 : ℕ)) ≤
δ ∧
(↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
∑' (k : ℕ),
(∑ ε : Fin K → Bool,
(↑((ArithmeticFunction.cardDistinctFactors : ℕ → ℕ)
(n + r ε (k + H + K + (1 : ℕ))).toNat) :
ℝ)) /
(2 : ℝ) ^ (k + H + K + (1 : ℕ)) ≤
δ ∧
√((↑Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S2, X p n) ^ (2 : ℕ)) ≤ δ ∧
∑ j ∈ Finset.range (M + (1 : ℕ)),
((2 : ℝ) * Real.pi) ^ j / (↑j.factorial : ℝ) *
|(↑Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ j -
(↑(Fintype.piFinset fun (x : ↥S1) => Ns).card : ℝ)⁻¹ *
∑ ω ∈ Fintype.piFinset fun (x : ↥S1) => Ns,
(∑ p : ↥S1, X (↑p : ℕ) (ω p)) ^ j| ≤
δ ∧
(∏ p ∈ S1,
(↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
Real.exp
((2 : ℝ) * Real.pi * Real.exp (1 : ℝ) * X p n) +
∏ p ∈ S1,
(↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
Real.exp
(-((2 : ℝ) * Real.pi * Real.exp (1 : ℝ)) * X p n)) /
Real.exp (1 : ℝ) ^ M ≤
δ ∧
c0 ≤
∑ p ∈ S1,
((↑Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, X p n ^ (2 : ℕ) -
((↑Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, X p n) ^ (2 : ℕ)) := by
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
Proved from this hole by 20261023T140825Z-t1023-f2-partial.lean (merged in 17322888f918, attestation 000957).
tt_sec5_setup→ variant-6b364d2b--h1--h1 (open)$\displaystyle \forall q \ge 1,\ T,\ \delta > 0,\ P_0\ \ \exists P \ge P_0,\ 2^K \le (\log P)^{2/3},\ H \le (\log P)^{2/3}\ \ \forall (p_0, v)\ \ \exists (N_s, S_1, S_2, M, \eta, w, R):\ \kappa_2, \kappa_3, \kappa_4, \kappa_5 \le \delta,\ \sum_{\varepsilon} \frac{1+\eta}{p_\varepsilon} \le \delta,\ \frac{q}{2^{K+1}} \le \delta,\ 2^K T \le \log\log R - \log\log w$
Read the partial proof (Lean)
private lemma a52_cb_small_part (n : ℕ) (n_pos : 0 < n) :
∏ x ∈ Finset.range (2 * n / 3 + 1), x ^ (Nat.centralBinom n).factorization x ≤
(2 * n) ^ Nat.sqrt (2 * n) * 4 ^ (2 * n / 3) := by
have n2_pos : 1 ≤ 2 * n := by omega
let S := {p ∈ Finset.range (2 * n / 3 + 1) | Nat.Prime p}
let f x := x ^ n.centralBinom.factorization x
have : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x := by
refine Finset.prod_filter_of_ne fun p _ h => ?_
contrapose! h; dsimp only [f]
rw [Nat.factorization_eq_zero_of_not_prime n.centralBinom h, _root_.pow_zero]
change ∏ x ∈ Finset.range (2 * n / 3 + 1), f x ≤ _
rw [← this, ← Finset.prod_filter_mul_prod_filter_not S (· ≤ Nat.sqrt (2 * n))]
apply mul_le_mul'
· refine (Finset.prod_le_prod' fun p _ => (?_ : f p ≤ 2 * n)).trans ?_
· exact Nat.pow_factorization_choose_le (mul_pos two_pos n_pos)
have : (Finset.Icc 1 (Nat.sqrt (2 * n))).card = Nat.sqrt (2 * n) := by
rw [Nat.card_Icc, Nat.add_sub_cancel]
rw [Finset.prod_const]
refine pow_right_mono₀ n2_pos ((Finset.card_le_card fun x hx => ?_).trans this.le)
obtain ⟨h1, h2⟩ := Finset.mem_filter.1 hx
exact Finset.mem_Icc.mpr ⟨(Finset.mem_filter.1 h1).2.one_lt.le, h2⟩
· refine le_trans ?_ (primorial_le_4_pow (2 * n / 3))
refine (Finset.prod_le_prod' fun p hp => (?_ : f p ≤ p)).trans ?_
· obtain ⟨h1, h2⟩ := Finset.mem_filter.1 hp
refine (pow_right_mono₀ (Finset.mem_filter.1 h1).2.one_lt.le ?_).trans (pow_one p).le
exact Nat.factorization_choose_le_one (Nat.sqrt_lt'.mp <| not_le.1 h2)
refine Finset.prod_le_prod_of_subset_of_one_le' (Finset.filter_subset _ _) ?_
exact fun p hp _ => (Finset.mem_filter.1 hp).2.one_lt.le
private lemma a52_cb_large_part (n : ℕ) (n_large : 2 < n) :
∏ x ∈ Finset.Ico (2 * n / 3 + 1) (2 * n + 1), x ^ (Nat.centralBinom n).factorization x ≤
(2 * n) ^ ((Finset.Ioc n (2 * n)).filter Nat.Prime).card := by
calc ∏ x ∈ Finset.Ico (2 * n / 3 + 1) (2 * n + 1), x ^ (Nat.centralBinom n).factorization x
≤ ∏ x ∈ Finset.Ico (2 * n / 3 + 1) (2 * n + 1),
(if x.Prime ∧ n < x then 2 * n else 1) := by
apply Finset.prod_le_prod'
intro x hx
rw [Finset.mem_Ico] at hx
split_ifs with h
· exact Nat.pow_factorization_choose_le (by omega)
· by_cases hp : x.Prime
· have hxn : x ≤ n := by
by_contra hc; exact h ⟨hp, by omega⟩
rw [Nat.factorization_centralBinom_of_two_mul_self_lt_three_mul n_large hxn (by omega)]
simp
· rw [Nat.factorization_eq_zero_of_not_prime _ hp]; simp
_ = ∏ x ∈ (Finset.Ico (2 * n / 3 + 1) (2 * n + 1)).filter (fun x => x.Prime ∧ n < x),
2 * n := (Finset.prod_filter _ _).symm
_ = (2 * n) ^ ((Finset.Ico (2 * n / 3 + 1) (2 * n + 1)).filter
(fun x => x.Prime ∧ n < x)).card := Finset.prod_const _
_ ≤ (2 * n) ^ ((Finset.Ioc n (2 * n)).filter Nat.Prime).card := by
apply pow_le_pow_right₀ (by omega)
apply Finset.card_le_card
intro x hx
simp only [Finset.mem_filter, Finset.mem_Ico, Finset.mem_Ioc] at hx ⊢
exact ⟨⟨hx.2.2, by omega⟩, hx.2.1⟩
private lemma a52_cb_bound (n : ℕ) (n_large : 2 < n) :
Nat.centralBinom n ≤ (2 * n) ^ Nat.sqrt (2 * n) * 4 ^ (2 * n / 3) *
(2 * n) ^ ((Finset.Ioc n (2 * n)).filter Nat.Prime).card := by
rw [← Nat.prod_pow_factorization_centralBinom,
← Finset.prod_range_mul_prod_Ico _ (show 2 * n / 3 + 1 ≤ 2 * n + 1 by omega)]
exact mul_le_mul' (a52_cb_small_part n (by omega)) (a52_cb_large_part n n_large)
private lemma a52_cb_log_ineq (n : ℕ) (hn : 4 ≤ n) :
(n : ℝ) * Real.log 4 < Real.log n + Real.sqrt (2 * n) * Real.log (2 * n) +
(2 * n / 3) * Real.log 4 +
(((Finset.Ioc n (2 * n)).filter Nat.Prime).card : ℝ) * Real.log (2 * n) := by
set k := ((Finset.Ioc n (2 * n)).filter Nat.Prime).card
have h1 : 4 ^ n < n * ((2 * n) ^ Nat.sqrt (2 * n) * 4 ^ (2 * n / 3) * (2 * n) ^ k) :=
lt_of_lt_of_le (Nat.four_pow_lt_mul_centralBinom n hn)
(Nat.mul_le_mul_left _ (a52_cb_bound n (by omega)))
have h2 : ((4 : ℝ) ^ n) < (n : ℝ) * ((2 * n) ^ Nat.sqrt (2 * n) * 4 ^ (2 * n / 3) *
(2 * n) ^ k) := by exact_mod_cast h1
have hnpos : (0 : ℝ) < n := by positivity
have h3 := Real.log_lt_log (by positivity) h2
rw [Real.log_pow, Real.log_mul (by positivity) (by positivity),
Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity),
Real.log_pow, Real.log_pow, Real.log_pow] at h3
have hs : (Nat.sqrt (2 * n) : ℝ) ≤ Real.sqrt (2 * n) := by
have := @Real.nat_sqrt_le_real_sqrt (2 * n); push_cast at this; exact this
have hd : ((2 * n / 3 : ℕ) : ℝ) ≤ 2 * n / 3 := by
have := @Nat.cast_div_le ℝ _ _ _ (2 * n) 3; push_cast at this; exact this
have hL : 0 ≤ Real.log (2 * n) := Real.log_nonneg (by
have : (4 : ℝ) ≤ n := by exact_mod_cast hn
linarith)
have hl4 : 0 ≤ Real.log 4 := Real.log_nonneg (by norm_num)
nlinarith [mul_le_mul_of_nonneg_right hs hL, mul_le_mul_of_nonneg_right hd hl4]
private theorem a52_primes_in_dyadic_lower :
∃ c : ℝ, 0 < c ∧ ∃ N : ℕ, ∀ n : ℕ, N ≤ n →
c * (n : ℝ) / Real.log n ≤ (((Finset.Ioc n (2 * n)).filter Nat.Prime).card : ℝ) := by
refine ⟨1 / 10, by norm_num, 10 ^ 8, fun n hn => ?_⟩
have key := a52_cb_log_ineq n (le_trans (by norm_num) hn)
set k : ℝ := (((Finset.Ioc n (2 * n)).filter Nat.Prime).card : ℝ)
have hk0 : 0 ≤ k := by positivity
have hnR : (10 : ℝ) ^ 8 ≤ n := by exact_mod_cast hn
have hn0 : (0 : ℝ) < n := by linarith
set t := Real.sqrt (Real.sqrt n) with ht
have hsq : Real.sqrt n = t ^ 2 := (Real.sq_sqrt (Real.sqrt_nonneg _)).symm
have hn4 : (n : ℝ) = t ^ 4 := by
rw [show t ^ 4 = (t ^ 2) ^ 2 by ring, ← hsq, Real.sq_sqrt hn0.le]
have ht100 : 100 ≤ t := by
rw [ht, Real.le_sqrt (by norm_num) (Real.sqrt_nonneg _), Real.le_sqrt (by norm_num) hn0.le]
linarith
have hlogn : Real.log n = 4 * Real.log t := by
rw [hn4, Real.log_pow]; norm_num
have hlogt : Real.log t ≤ t := by
have := Real.log_le_sub_one_of_pos (show 0 < t by linarith); linarith
have hlogt0 : 0 < Real.log t := Real.log_pos (by linarith)
have hs2 : Real.sqrt (2 * n) ≤ 3 / 2 * t ^ 2 := by
rw [Real.sqrt_mul (by norm_num), hsq]
have : Real.sqrt 2 ≤ 3 / 2 := by
rw [Real.sqrt_le_left (by norm_num)]; norm_num
nlinarith
have hL : Real.log (2 * n) = Real.log 2 + Real.log n :=
Real.log_mul (by norm_num) hn0.ne'
have hl2 : Real.log 2 ≤ Real.log n := Real.log_le_log (by norm_num) (by linarith)
have hl20 : 0 < Real.log 2 := Real.log_pos (by norm_num)
have hl4 : Real.log 4 = 2 * Real.log 2 := by
rw [show (4 : ℝ) = 2 ^ 2 by norm_num, Real.log_pow]; norm_num
have hl2v := Real.log_two_gt_d9
rw [div_le_iff₀ (by rw [hlogn]; positivity)]
rw [hL, hl4, hlogn] at key
rw [hlogn]
have h1 : Real.sqrt (2 * n) * (Real.log 2 + 4 * Real.log t) ≤
3 / 2 * t ^ 2 * (8 * t) := by
apply mul_le_mul hs2 (by linarith) (by positivity) (by positivity)
have h2 : k * (Real.log 2 + 4 * Real.log t) ≤ k * (8 * Real.log t) := by
apply mul_le_mul_of_nonneg_left _ hk0; linarith
have h3 : (n : ℝ) * Real.log 2 * (2 / 3) < 4 * Real.log t + 12 * t ^ 3 + k * (8 * Real.log t) := by
linarith
have h4 : (n : ℝ) * 0.6931471803 ≤ (n : ℝ) * Real.log 2 :=
mul_le_mul_of_nonneg_left hl2v.le hn0.le
have h5 : t ^ 4 ≥ 100 * t ^ 3 := by nlinarith [pow_pos (show (0:ℝ) < t by linarith) 3]
have h6 : t ^ 3 ≥ 10000 * t := by nlinarith [mul_pos (show (0:ℝ) < t by linarith) (show (0:ℝ) < t by linarith)]
rw [hn4] at h3 h4 ⊢
nlinarith
-- The vertex offset of the cube with generators `v` selected by `ε`.
private def a52_cubeSum {K : ℕ} (v : Fin K → ℕ) (ε : Fin K → Bool) : ℕ :=
∑ k, if ε k then v k else 0
-- Splitting off the first generator.
private lemma a52_cubeSum_cons {K : ℕ} (d : ℕ) (v : Fin K → ℕ) (ε : Fin (K + 1) → Bool) :
a52_cubeSum (Fin.cons d v : Fin (K + 1) → ℕ) ε = (if ε 0 then d else 0) + a52_cubeSum v (Fin.tail ε) := by
simp [a52_cubeSum, Fin.sum_univ_succ, Fin.tail]
rfl
-- Counting ordered pairs `x < y` in `A`.
private lemma a52_pair_count (A : Finset ℕ) :
2 * ∑ x ∈ A, (A.filter (fun y => x < y)).card + A.card = A.card ^ 2 := by
induction A using Finset.induction_on_max with
| empty => simp
| insert m A hm ih =>
have hmA : m ∉ A := fun h => lt_irrefl _ (hm m h)
rw [Finset.sum_insert hmA, Finset.card_insert_of_notMem hmA]
have h1 : ((insert m A).filter (fun y => m < y)).card = 0 := by
rw [Finset.card_eq_zero, Finset.filter_eq_empty_iff]
intro y hy
rcases Finset.mem_insert.1 hy with rfl | hy
· exact lt_irrefl _
· exact fun h => lt_asymm h (hm y hy)
have h2 : ∀ x ∈ A, ((insert m A).filter (fun y => x < y)).card
= (A.filter (fun y => x < y)).card + 1 := by
intro x hx
rw [Finset.filter_insert, if_pos (hm x hx), Finset.card_insert_of_notMem (by simp [hmA])]
rw [h1, Finset.sum_congr rfl h2, Finset.sum_add_distrib]
simp only [Finset.sum_const, smul_eq_mul, mul_one]
nlinarith [ih]
-- The representation-count sum equals the number of pairs `x < y`.
private lemma a52_sum_r_eq (N : ℕ) (A : Finset ℕ) (hA : A ⊆ Finset.Icc 1 N) :
∑ d ∈ Finset.Icc 1 N, (A.filter (fun x => x + d ∈ A)).card
= ∑ x ∈ A, (A.filter (fun y => x < y)).card := by
simp only [Finset.card_filter]
rw [Finset.sum_comm]
refine Finset.sum_congr rfl fun x hx => ?_
rw [← Finset.card_filter, ← Finset.card_filter]
refine Finset.card_nbij' (fun d => x + d) (fun y => y - x) ?_ ?_ ?_ ?_
· intro d hd
simp only [Finset.coe_filter, Finset.mem_Icc, Set.mem_setOf_eq] at hd ⊢
exact ⟨hd.2, by omega⟩
· intro y hy
simp only [Finset.coe_filter, Finset.mem_Icc, Set.mem_setOf_eq] at hy ⊢
have := Finset.mem_Icc.1 (hA hy.1)
refine ⟨⟨by omega, by omega⟩, ?_⟩
rw [Nat.add_sub_cancel' hy.2.le]; exact hy.1
· intro d _; simp
· intro y hy
simp only [Finset.coe_filter, Set.mem_setOf_eq] at hy
simp only
omega
-- Pigeonhole: a popular difference avoiding the forbidden set exists.
private lemma a52_good_d_exists (N : ℕ) (A : Finset ℕ) (F : Finset ℤ) (hA : A ⊆ Finset.Icc 1 N)
(hn : 16 * (F.card + 1) ≤ A.card) :
∃ d ∈ Finset.Icc 1 N, A.card ^ 2 ≤ 4 * N * (A.filter (fun x => x + d ∈ A)).card ∧
(d : ℤ) ∉ F ∧ -(d : ℤ) ∉ F := by
set n := A.card with hn_def
set r : ℕ → ℕ := fun d => (A.filter (fun x => x + d ∈ A)).card with hr_def
set G := (Finset.Icc 1 N).filter (fun d => n ^ 2 ≤ 4 * N * r d) with hG_def
set G' := (Finset.Icc 1 N).filter (fun d => ¬ n ^ 2 ≤ 4 * N * r d) with hG'_def
set B := (Finset.Icc 1 N).filter (fun d : ℕ => (d : ℤ) ∈ F ∨ -(d : ℤ) ∈ F) with hB_def
have hB : B.card ≤ 2 * F.card := by
have hsub : B ⊆ F.image (fun f => f.toNat) ∪ F.image (fun f => (-f).toNat) := by
intro d hd
simp only [hB_def, Finset.mem_filter] at hd
rcases hd.2 with h | h
· exact Finset.mem_union_left _ (Finset.mem_image.2 ⟨_, h, by simp⟩)
· exact Finset.mem_union_right _ (Finset.mem_image.2 ⟨_, h, by simp⟩)
calc B.card ≤ _ := Finset.card_le_card hsub
_ ≤ _ := Finset.card_union_le _ _
_ ≤ F.card + F.card := add_le_add Finset.card_image_le Finset.card_image_le
_ = _ := by ring
have hnpos : 0 < n := by omega
have hN : 0 < N := by
obtain ⟨a, ha⟩ := Finset.card_pos.1 hnpos
have := Finset.mem_Icc.1 (hA ha)
omega
have hsum := a52_sum_r_eq N A hA
have hpc := a52_pair_count A
have hsplit : ∑ d ∈ Finset.Icc 1 N, r d = ∑ d ∈ G, r d + ∑ d ∈ G', r d :=
(Finset.sum_filter_add_sum_filter_not _ _ _).symm
have hGs : ∑ d ∈ G, r d ≤ G.card * n := by
have := Finset.sum_le_card_nsmul G r n (fun d _ => Finset.card_filter_le _ _)
simpa using this
have hG's : 4 * N * ∑ d ∈ G', r d ≤ N * n ^ 2 := by
rw [Finset.mul_sum]
calc ∑ d ∈ G', 4 * N * r d ≤ ∑ d ∈ G', n ^ 2 := by
refine Finset.sum_le_sum fun d hd => ?_
simp only [hG'_def, Finset.mem_filter] at hd
omega
_ = G'.card * n ^ 2 := by simp
_ ≤ N * n ^ 2 := by
refine Nat.mul_le_mul_right _ ?_
calc G'.card ≤ (Finset.Icc 1 N).card := Finset.card_filter_le _ _
_ = N := by simp
have hS : ∑ d ∈ Finset.Icc 1 N, r d = ∑ x ∈ A, (A.filter (fun y => x < y)).card := hsum
have key : N * n * n ≤ N * n * (4 * G.card + 2) := by
nlinarith
have key2 : n ≤ 4 * G.card + 2 := Nat.le_of_mul_le_mul_left key (by positivity)
have hlt : B.card < G.card := by omega
obtain ⟨d, hdG, hdB⟩ := Finset.exists_mem_notMem_of_card_lt_card hlt
simp only [hG_def, Finset.mem_filter] at hdG
simp only [hB_def, Finset.mem_filter, not_and, not_or] at hdB
exact ⟨d, hdG.1, hdG.2, (hdB hdG.1).1, (hdB hdG.1).2⟩
-- Density increment for the next level.
private lemma a52_density_step (N n n' c c' : ℝ) (K : ℕ) (hn : 0 < n) (hn' : 0 < n') (hN : 0 ≤ N)
(hc : 0 ≤ c) (hc' : c' ≤ 3 * c) (hr : n ^ 2 ≤ 4 * N * n')
(h : c * (16 * N / n) ^ (2 ^ (K + 2)) ≤ N) :
c' * (16 * N / n') ^ (2 ^ (K + 1)) ≤ N := by
set x := 16 * N / n with hx
have hx0 : 0 ≤ x := by positivity
have h1 : 16 * N / n' ≤ x ^ 2 / 4 := by
rw [hx, div_pow, div_div, div_le_div_iff₀ hn' (by positivity)]
nlinarith [mul_le_mul_of_nonneg_left hr (by positivity : (0:ℝ) ≤ 16 * N)]
set m := 2 ^ (K + 1) with hm
have hm1 : 1 ≤ m := Nat.one_le_two_pow
have h2 : (16 * N / n') ^ m ≤ x ^ (2 ^ (K + 2)) / 4 := by
calc (16 * N / n') ^ m ≤ (x ^ 2 / 4) ^ m := pow_le_pow_left₀ (by positivity) h1 m
_ = x ^ (2 ^ (K + 2)) / 4 ^ m := by
rw [div_pow, ← pow_mul]; congr 2; rw [hm, pow_succ 2 (K + 1)]; ring
_ ≤ x ^ (2 ^ (K + 2)) / 4 := by
apply div_le_div_of_nonneg_left (by positivity) (by norm_num)
calc (4:ℝ) = 4 ^ 1 := by norm_num
_ ≤ 4 ^ m := pow_le_pow_right₀ (by norm_num) hm1
calc c' * (16 * N / n') ^ m ≤ (3 * c) * (x ^ (2 ^ (K + 2)) / 4) :=
mul_le_mul hc' h2 (by positivity) (by positivity)
_ ≤ c * x ^ (2 ^ (K + 2)) := by nlinarith [pow_nonneg hx0 (2 ^ (K + 2))]
_ ≤ N := h
-- The density hypothesis forces `A` to be large compared with the forbidden set.
private lemma a52_size_bound (N n c : ℝ) (M : ℕ) (hM : 2 ≤ M) (hn : 0 < n) (hnN : n ≤ N)
(hc : 0 ≤ c) (h : c * (16 * N / n) ^ M ≤ N) : 256 * c ≤ n := by
set x := 16 * N / n with hx
have hN : 0 < N := lt_of_lt_of_le hn hnN
have hx16 : 16 ≤ x := by rw [hx, le_div_iff₀ hn]; linarith
have h1 : x ^ 2 ≤ x ^ M := pow_le_pow_right₀ (by linarith) hM
have h2 : c * (16 * x) ≤ N := by nlinarith
have h3 : 256 * c * N ≤ n * N := by
have : c * (16 * x) * n = 256 * c * N := by rw [hx]; field_simp; ring
nlinarith
exact le_of_mul_le_mul_right h3 hN
-- Cube lemma with finitely many nontrivial linear constraints `α * a + ∑ c_k v_k + f ≠ 0`
-- on the base point `a` and the generators `v`.
private lemma a52_cube_lin_aux (K : ℕ) : ∀ (N : ℕ) (A : Finset ℕ)
(C : Finset ((Fin K → ℤ) × ℤ × ℤ)), A ⊆ Finset.Icc 1 N → A.Nonempty →
(∀ q ∈ C, q.2.1 ≠ 0 ∨ q.1 ≠ 0) →
((C.card : ℝ) + 1) * (16 * (N : ℝ) / A.card) ^ (2 ^ (K + 1)) ≤ N →
∃ (a : ℕ) (v : Fin K → ℕ), (∀ k, 0 < v k) ∧
(∀ q ∈ C, q.2.1 * (a : ℤ) + ∑ k, q.1 k * (v k : ℤ) + q.2.2 ≠ 0) ∧
∀ ε, a + a52_cubeSum v ε ∈ A := by
induction K with
| zero =>
intro N A C hA hne hC h
have hn0 : 0 < A.card := hne.card_pos
have hnN : A.card ≤ N := by simpa using Finset.card_le_card hA
have hbig : 256 * ((C.card : ℝ) + 1) ≤ A.card :=
a52_size_bound N A.card _ (2 ^ (0 + 1)) (by norm_num)
(by exact_mod_cast hn0) (by exact_mod_cast hnN) (by positivity) h
have hlt : (C.image (fun q => (-q.2.2 / q.2.1).toNat)).card < A.card := by
have h1 : (C.image (fun q => (-q.2.2 / q.2.1).toNat)).card ≤ C.card :=
Finset.card_image_le
have : (C.card : ℝ) < A.card := by linarith
have : C.card < A.card := by exact_mod_cast this
omega
obtain ⟨a, haA, haB⟩ := Finset.exists_mem_notMem_of_card_lt_card hlt
refine ⟨a, Fin.elim0, fun k => k.elim0, ?_, fun ε => by simpa [a52_cubeSum] using haA⟩
intro q hq heq
have hα : q.2.1 ≠ 0 := by
rcases hC q hq with h | h
· exact h
· exact absurd (funext fun k => k.elim0) h
simp only [Finset.univ_eq_empty, Finset.sum_empty, add_zero] at heq
apply haB
refine Finset.mem_image.2 ⟨q, hq, ?_⟩
have : -q.2.2 / q.2.1 = a := by
rw [show -q.2.2 = q.2.1 * a by linarith]; exact Int.mul_ediv_cancel_left _ hα
rw [this]; simp
| succ K ih =>
intro N A C hA hne hC h
have hn0 : 0 < A.card := hne.card_pos
have hnN : A.card ≤ N := by simpa using Finset.card_le_card hA
have hbig : 256 * ((C.card : ℝ) + 1) ≤ A.card :=
a52_size_bound N A.card _ (2 ^ (K + 1 + 1))
(by calc 2 = 2 ^ 1 := by norm_num
_ ≤ 2 ^ (K + 1 + 1) := Nat.pow_le_pow_right (by norm_num) (by omega))
(by exact_mod_cast hn0) (by exact_mod_cast hnN) (by positivity) h
set F : Finset ℤ := C.image (fun q => -q.2.2 / q.1 0) with hF_def
have hFc : F.card ≤ C.card := Finset.card_image_le
have hbig' : 16 * (F.card + 1) ≤ A.card := by
have : (16 : ℝ) * (C.card + 1) ≤ A.card := by linarith
have : 16 * (C.card + 1) ≤ A.card := by exact_mod_cast this
omega
obtain ⟨d, hdI, hdr, hdF, -⟩ := a52_good_d_exists N A F hA hbig'
have hd0 : 0 < d := (Finset.mem_Icc.1 hdI).1
set A' := A.filter (fun x => x + d ∈ A) with hA'_def
set C' : Finset ((Fin K → ℤ) × ℤ × ℤ) :=
(C.filter (fun q => q.2.1 ≠ 0 ∨ Fin.tail q.1 ≠ 0)).image
(fun q => (Fin.tail q.1, q.2.1, q.2.2 + q.1 0 * d)) with hC'_def
have hC'card : C'.card ≤ C.card :=
Finset.card_image_le.trans (Finset.card_filter_le _ _)
have hA'sub : A' ⊆ Finset.Icc 1 N := (Finset.filter_subset _ _).trans hA
have hA'pos : 0 < A'.card := by
rcases Nat.eq_zero_or_pos A'.card with hc | hc
· rw [hc, mul_zero, Nat.le_zero, pow_eq_zero_iff two_ne_zero] at hdr
omega
· exact hc
have hC' : ∀ q ∈ C', q.2.1 ≠ 0 ∨ q.1 ≠ 0 := by
intro q hq
obtain ⟨q0, hq0, rfl⟩ := Finset.mem_image.1 hq
exact (Finset.mem_filter.1 hq0).2
have hstep : ((C'.card : ℝ) + 1) * (16 * (N : ℝ) / A'.card) ^ (2 ^ (K + 1)) ≤ N := by
have hcc : (C'.card : ℝ) ≤ C.card := by exact_mod_cast hC'card
refine a52_density_step N A.card A'.card (C.card + 1) (C'.card + 1) K
(by exact_mod_cast hn0) (by exact_mod_cast hA'pos) (by positivity) (by positivity)
(by linarith) (by exact_mod_cast hdr) h
obtain ⟨a, v, hv, hlin, hmem⟩ := ih N A' C' hA'sub (Finset.card_pos.1 hA'pos) hC' hstep
refine ⟨a, Fin.cons d v, ?_, ?_, ?_⟩
· intro k
refine Fin.cases hd0 (fun i => ?_) k
simpa using hv i
· intro q hq
rw [Fin.sum_univ_succ]
simp only [Fin.cons_zero, Fin.cons_succ]
by_cases hgood : q.2.1 ≠ 0 ∨ Fin.tail q.1 ≠ 0
· have := hlin _ (Finset.mem_image.2 ⟨q, Finset.mem_filter.2 ⟨hq, hgood⟩, rfl⟩)
simp only [Fin.tail] at this
intro h; apply this; linarith
· push_neg at hgood
obtain ⟨hα, htail⟩ := hgood
have hts : ∀ i : Fin K, q.1 i.succ = 0 := fun i => congrFun htail i
have hc0 : q.1 0 ≠ 0 := by
rcases hC q hq with h | h
· exact absurd hα h
· intro h0; apply h; funext k
exact Fin.cases h0 (fun i => hts i) k
simp only [hα, hts, zero_mul, Finset.sum_const_zero, add_zero, zero_add]
intro heq
apply hdF
refine Finset.mem_image.2 ⟨q, hq, ?_⟩
rw [show -q.2.2 = q.1 0 * d by linarith]; exact Int.mul_ediv_cancel_left _ hc0
· intro ε
rw [a52_cubeSum_cons]
have hm := hmem (Fin.tail ε)
rw [hA'_def, Finset.mem_filter] at hm
cases ε 0
· simpa using hm.1
· simpa [add_comm, add_left_comm, add_assoc] using hm.2
-- Constraints encoding distinctness of the cube vertices.
private def a52_vertexConstraints (K : ℕ) : Finset ((Fin K → ℤ) × ℤ × ℤ) :=
((Finset.univ : Finset ((Fin K → Bool) × (Fin K → Bool))).filter (fun p => p.1 ≠ p.2)).image
(fun p => (fun k => (if p.1 k then 1 else 0) - (if p.2 k then 1 else 0), 0, 0))
-- Coefficient of `v k` in the shift `r(ε, h)`.
private def a52_shiftCoeff {K : ℕ} (ε : Fin K → Bool) (h : ℕ) (k : Fin K) : ℤ :=
if ε k then ((h + 1 + K : ℕ) : ℤ) - ((k.1 : ℤ) + 1) else 0
-- Constraints encoding distinctness of the shifts.
private def a52_shiftConstraints (K H : ℕ) : Finset ((Fin K → ℤ) × ℤ × ℤ) :=
((Finset.univ : Finset (((Fin K → Bool) × Fin H) × ((Fin K → Bool) × Fin H))).filter
(fun p => p.1 ≠ p.2)).image
(fun p => (fun k => a52_shiftCoeff p.1.1 p.1.2.1 k - a52_shiftCoeff p.2.1 p.2.2.1 k,
((p.1.2.1 + 1 + K : ℕ) : ℤ) - ((p.2.2.1 + 1 + K : ℕ) : ℤ), 0))
private lemma a52_constraints_nontrivial (K H : ℕ) :
∀ q ∈ a52_vertexConstraints K ∪ a52_shiftConstraints K H, q.2.1 ≠ 0 ∨ q.1 ≠ 0 := by
intro q hq
rcases Finset.mem_union.1 hq with hq | hq
· obtain ⟨⟨ε, ε'⟩, hp, rfl⟩ := Finset.mem_image.1 hq
simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hp
right
obtain ⟨k, hk⟩ := Function.ne_iff.1 hp
intro h0
have := congrFun h0 k
simp only [Pi.zero_apply] at this
cases h1 : ε k <;> cases h2 : ε' k <;> simp_all
· obtain ⟨⟨⟨ε, h⟩, ⟨ε', h'⟩⟩, hp, rfl⟩ := Finset.mem_image.1 hq
simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hp
by_cases hh : h = h'
· subst hh
right
have hne : ε ≠ ε' := fun he => hp (by rw [he])
obtain ⟨k, hk⟩ := Function.ne_iff.1 hne
intro h0
have := congrFun h0 k
simp only [Pi.zero_apply, a52_shiftCoeff] at this
have hk2 := k.2
cases h1 : ε k <;> cases h2 : ε' k <;> simp_all <;> omega
· left
intro h0
apply hh
apply Fin.ext
push_cast at h0
omega
private lemma a52_vertex_diff {K : ℕ} (a : ℤ) (v : Fin K → ℤ) (ε ε' : Fin K → Bool) :
(a + ∑ k, if ε k then v k else 0) - (a + ∑ k, if ε' k then v k else 0) =
∑ k, ((if ε k then 1 else 0) - (if ε' k then 1 else 0)) * v k := by
rw [add_sub_add_left_eq_sub, ← Finset.sum_sub_distrib]
refine Finset.sum_congr rfl fun k _ => ?_
split_ifs <;> ring
private lemma a52_shift_diff {K : ℕ} (a : ℤ) (v : Fin K → ℤ) (ε ε' : Fin K → Bool) (h h' : ℕ) :
((a + ∑ k, if ε k then v k else 0) * ((h + 1 + K : ℕ) : ℤ)
- ∑ k : Fin K, ((k.1 : ℤ) + 1) * (if ε k then v k else 0)) -
((a + ∑ k, if ε' k then v k else 0) * ((h' + 1 + K : ℕ) : ℤ)
- ∑ k : Fin K, ((k.1 : ℤ) + 1) * (if ε' k then v k else 0)) =
(((h + 1 + K : ℕ) : ℤ) - ((h' + 1 + K : ℕ) : ℤ)) * a +
∑ k, (a52_shiftCoeff ε h k - a52_shiftCoeff ε' h' k) * v k := by
have : ∀ k, (a52_shiftCoeff ε h k - a52_shiftCoeff ε' h' k) * v k =
(if ε k then v k else 0) * ((h + 1 + K : ℕ) : ℤ) - ((k.1 : ℤ) + 1) * (if ε k then v k else 0)
- ((if ε' k then v k else 0) * ((h' + 1 + K : ℕ) : ℤ)
- ((k.1 : ℤ) + 1) * (if ε' k then v k else 0)) := by
intro k; simp only [a52_shiftCoeff]; split_ifs <;> ring
simp only [this, Finset.sum_sub_distrib, add_mul, Finset.sum_mul]
ring
/-- Qualitative Lemma 5.2 of TT (arXiv:2512.01739v2, p. 50), without the window `[P/2, P]`:
for all `K, H` there are `p₀, v` with the `2^K` numbers `p_ε = p₀ + ∑ ε_k v_k` distinct primes and
the shifts `r_{ε,h+K} = p_ε (h+K) - ∑_k k ε_k v_k` (`ε ∈ {0,1}^K`, `1 ≤ h ≤ H`) pairwise distinct.
(The paper needs the quantitative form with the primes in `[P/2, P]`.) -/
-- Asymptotic inequality behind the quantitative cube lemma (θ < 1).
private lemma a52_quant_asymp_real (θ D : ℝ) (hθ : θ < 1) :
∀ᶠ y : ℝ in Filter.atTop, 4 * Real.log y + 2 * y ^ θ * (Real.log D + Real.log y) + Real.log 6 ≤ y := by
have h1 : (fun y : ℝ => Real.log y) =o[Filter.atTop] (fun y => y) := Real.isLittleO_log_id_atTop
have hr : 0 < 1 - θ := by linarith
have h3 : (fun y : ℝ => y ^ θ * (Real.log D + Real.log y)) =o[Filter.atTop] (fun y => y) := by
have hc : (fun _ : ℝ => Real.log D) =o[Filter.atTop] (fun y : ℝ => y ^ (1 - θ)) :=
Asymptotics.isLittleO_const_left.2
(Or.inr (tendsto_norm_atTop_atTop.comp (tendsto_rpow_atTop hr)))
have hl : (fun y : ℝ => Real.log D + Real.log y) =o[Filter.atTop] (fun y => y ^ (1 - θ)) :=
hc.add (isLittleO_log_rpow_atTop hr)
have := (Asymptotics.isBigO_refl (fun y : ℝ => y ^ θ) Filter.atTop).mul_isLittleO hl
refine this.congr' Filter.EventuallyEq.rfl ?_
filter_upwards [Filter.eventually_gt_atTop 0] with y hy
rw [← Real.rpow_add hy]; simp
have h4 : (fun _ : ℝ => (1:ℝ)) =o[Filter.atTop] (fun y => y) := Asymptotics.isLittleO_const_id_atTop 1
have hsum : (fun y : ℝ => 4 * Real.log y + 2 * y ^ θ * (Real.log D + Real.log y) + Real.log 6)
=o[Filter.atTop] (fun y => y) := by
have := ((h1.const_mul_left 4).add (h3.const_mul_left 2)).add (h4.const_mul_left (Real.log 6))
refine this.congr_left (fun y => by ring)
filter_upwards [hsum.bound one_pos, Filter.eventually_ge_atTop 0] with y hy hy0
rw [Real.norm_eq_abs, Real.norm_eq_abs, abs_of_nonneg hy0, one_mul] at hy
exact (le_abs_self _).trans hy
-- The same inequality along naturals `P`, in the shape needed for `a52_cube_lin_aux`.
private lemma a52_quant_asymp_nat (θ D : ℝ) (hθ : θ < 1) (hD : 1 ≤ D) :
∃ P1 : ℕ, ∀ P : ℕ, P1 ≤ P → 1 ≤ Real.log P ∧
3 * Real.log P ^ 4 * (D * Real.log P) ^ (2 * Real.log P ^ θ) ≤ (P : ℝ) / 2 := by
have ht : Filter.Tendsto (fun P : ℕ => Real.log P) Filter.atTop Filter.atTop :=
Real.tendsto_log_atTop.comp tendsto_natCast_atTop_atTop
obtain ⟨P1, hP1⟩ := Filter.eventually_atTop.1
(ht.eventually ((a52_quant_asymp_real θ D hθ).and (Filter.eventually_ge_atTop 1)))
refine ⟨P1, fun P hP => ?_⟩
obtain ⟨h, hy1⟩ := hP1 P hP
refine ⟨hy1, ?_⟩
set y := Real.log P with hy
have hP0 : (0 : ℝ) < P := by
by_contra hc
have : (P : ℝ) = 0 := le_antisymm (not_lt.1 hc) (Nat.cast_nonneg _)
rw [hy, this, Real.log_zero] at hy1; linarith
have hy0 : 0 < y := by linarith
have hDy : 0 < D * y := by positivity
have hD0 : 0 < D := by linarith
rw [← Real.log_le_log_iff (by positivity) (by positivity), Real.log_mul (by positivity)
(by positivity), Real.log_mul (by positivity) (by positivity), Real.log_pow,
Real.log_rpow hDy, Real.log_mul hD0.ne' hy0.ne', Real.log_div hP0.ne' (by norm_num),
← hy]
have h6 : Real.log 6 = Real.log 3 + Real.log 2 := by
rw [← Real.log_mul (by norm_num) (by norm_num)]; norm_num
push_cast
linarith
-- Counting bound on the constraint set.
private lemma a52_quant_constraints_card (K H : ℕ) :
((a52_vertexConstraints K ∪ a52_shiftConstraints K H).card : ℝ) ≤
((2 : ℝ) ^ K) ^ 2 + ((2 : ℝ) ^ K * H) ^ 2 := by
have h1 : (a52_vertexConstraints K).card ≤ (2 ^ K) ^ 2 := by
unfold a52_vertexConstraints
refine (Finset.card_image_le).trans ((Finset.card_filter_le _ _).trans ?_)
rw [Finset.card_univ, Fintype.card_prod, Fintype.card_fun, Fintype.card_bool, Fintype.card_fin,
sq]
have h2 : (a52_shiftConstraints K H).card ≤ (2 ^ K * H) ^ 2 := by
unfold a52_shiftConstraints
refine (Finset.card_image_le).trans ((Finset.card_filter_le _ _).trans ?_)
rw [Finset.card_univ, Fintype.card_prod, Fintype.card_prod, Fintype.card_fun, Fintype.card_bool,
Fintype.card_fin, Fintype.card_fin, sq]
have h3 := (Finset.card_union_le (a52_vertexConstraints K) (a52_shiftConstraints K H)).trans
(Nat.add_le_add h1 h2)
exact_mod_cast h3
/- Quantitative Lemma 5.2 of Tao–Teräväinen (arXiv:2512.01739v2, p. 50): K and H may grow with P.
For every θ < 1 and all large P: whenever 2^K ≤ (log P)^θ and H ≤ (log P)^θ, there are p₀, v with
the 2^K numbers p_ε = p₀ + Σ ε_k v_k distinct primes in the window (P/2, P], and the shifts
r_{ε,h+K} = p_ε (h+K) − Σ_k k ε_k v_k (ε ∈ {0,1}^K, 1 ≤ h ≤ H) pairwise distinct.
(The paper takes 2^K ≈ H ≈ (log P)^{2/3}; see `a52_hilbert_cube_primes_quant_two_thirds`.) -/
private theorem a52_hilbert_cube_primes_quant (θ : ℝ) (hθ : θ < 1) :
∃ P0 : ℕ, ∀ P : ℕ, P0 ≤ P → ∀ K H : ℕ,
(2 : ℝ) ^ K ≤ Real.log P ^ θ → (H : ℝ) ≤ Real.log P ^ θ →
∃ (p0 : ℤ) (v : Fin K → ℤ),
(∀ ε : Fin K → Bool, ∃ p : ℕ, p.Prime ∧ P < 2 * p ∧ p ≤ P ∧
(p : ℤ) = p0 + ∑ k, if ε k then v k else 0) ∧
Function.Injective (fun ε : Fin K → Bool => p0 + ∑ k, if ε k then v k else 0) ∧
Function.Injective (fun x : (Fin K → Bool) × Fin H =>
(p0 + ∑ k, if x.1 k then v k else 0) * ((x.2.1 + 1 + K : ℕ) : ℤ)
- ∑ k : Fin K, ((k.1 : ℤ) + 1) * (if x.1 k then v k else 0)) := by
obtain ⟨c, hc, N0, hN0⟩ := a52_primes_in_dyadic_lower
set D : ℝ := 32 / c + 1 with hD
have hD1 : 1 ≤ D := by rw [hD]; linarith [div_pos (by norm_num : (0:ℝ) < 32) hc]
obtain ⟨P1, hP1⟩ := a52_quant_asymp_nat θ D hθ hD1
refine ⟨max P1 (2 * N0 + 6), fun P hP K H hK hH => ?_⟩
have hPP1 : P1 ≤ P := le_trans (le_max_left _ _) hP
have hPN : 2 * N0 + 6 ≤ P := le_trans (le_max_right _ _) hP
obtain ⟨hy1, hasym⟩ := hP1 P hPP1
set C := a52_vertexConstraints K ∪ a52_shiftConstraints K H with hCdef
set n := P / 2 with hndef
have hnN0 : N0 ≤ n := by omega
have hn3 : 3 ≤ n := by omega
set A := (Finset.Ioc n (2 * n)).filter Nat.Prime with hAdef
set y := Real.log P with hy
set L := y ^ θ with hL
have hnr : (3 : ℝ) ≤ n := by exact_mod_cast hn3
have hlogn : 0 < Real.log n := Real.log_pos (by linarith)
have hlognP : Real.log n ≤ y :=
Real.log_le_log (by linarith) (by exact_mod_cast Nat.div_le_self P 2)
have hcard : c * (n : ℝ) / Real.log n ≤ (A.card : ℝ) := hN0 n hnN0
have hApos : (0 : ℝ) < A.card := lt_of_lt_of_le (by positivity) hcard
have hne : A.Nonempty := Finset.card_pos.mp (by exact_mod_cast hApos)
have hsub : A ⊆ Finset.Icc 1 (2 * n) := by
intro x hx
simp only [hAdef, Finset.mem_filter, Finset.mem_Ioc] at hx
exact Finset.mem_Icc.mpr ⟨by omega, hx.1.2⟩
have hbound : 16 * ((2 * n : ℕ) : ℝ) / A.card ≤ D * y := by
rw [div_le_iff₀ hApos]
calc 16 * ((2 * n : ℕ) : ℝ) = (32 / c * Real.log n) * (c * n / Real.log n) := by
push_cast; field_simp; ring
_ ≤ (32 / c * Real.log n) * A.card :=
mul_le_mul_of_nonneg_left hcard (by positivity)
_ ≤ (D * y) * A.card := by
apply mul_le_mul_of_nonneg_right _ hApos.le
have h32 : 0 ≤ 32 / c := by positivity
calc 32 / c * Real.log n ≤ 32 / c * y := mul_le_mul_of_nonneg_left hlognP h32
_ ≤ D * y := mul_le_mul_of_nonneg_right (by rw [hD]; linarith) (by linarith)
have hL1 : 1 ≤ L := le_trans (one_le_pow₀ (by norm_num)) hK
have hLy : L ≤ y := by
have := Real.rpow_le_rpow_of_exponent_le hy1 hθ.le
rwa [Real.rpow_one] at this
have hH0 : (0 : ℝ) ≤ H := Nat.cast_nonneg H
have h2K0 : (0 : ℝ) ≤ 2 ^ K := by positivity
have hCcard : (C.card : ℝ) + 1 ≤ 3 * y ^ 4 := by
have h1 := a52_quant_constraints_card K H
have hKH : (2 : ℝ) ^ K * H ≤ L * L := mul_le_mul hK hH hH0 (by linarith)
have hsq1 : ((2 : ℝ) ^ K) ^ 2 ≤ L ^ 2 := pow_le_pow_left₀ h2K0 hK 2
have hsq2 : ((2 : ℝ) ^ K * H) ^ 2 ≤ (L * L) ^ 2 := pow_le_pow_left₀ (by positivity) hKH 2
have hL4 : L ^ 2 ≤ L ^ 4 := pow_le_pow_right₀ hL1 (by norm_num)
have hL4' : (1 : ℝ) ≤ L ^ 4 := one_le_pow₀ hL1
have hLy4 : L ^ 4 ≤ y ^ 4 := pow_le_pow_left₀ (by linarith) hLy 4
have hC : (C.card : ℝ) ≤ ((2 : ℝ) ^ K) ^ 2 + ((2 : ℝ) ^ K * H) ^ 2 := h1
nlinarith
have hDy1 : 1 ≤ D * y := by nlinarith
have hX0 : 0 ≤ 16 * ((2 * n : ℕ) : ℝ) / A.card := by positivity
have hexp : (((2 ^ (K + 1) : ℕ) : ℝ)) ≤ 2 * L := by
push_cast; rw [pow_succ]; linarith
have hXpow : (16 * ((2 * n : ℕ) : ℝ) / A.card) ^ (2 ^ (K + 1)) ≤ (D * y) ^ (2 * L) := by
calc (16 * ((2 * n : ℕ) : ℝ) / A.card) ^ (2 ^ (K + 1)) ≤ (D * y) ^ (2 ^ (K + 1)) :=
pow_le_pow_left₀ hX0 hbound _
_ = (D * y) ^ (((2 ^ (K + 1) : ℕ) : ℝ)) := (Real.rpow_natCast _ _).symm
_ ≤ (D * y) ^ (2 * L) := Real.rpow_le_rpow_of_exponent_le hDy1 hexp
have hNP : (P : ℝ) / 2 ≤ ((2 * n : ℕ) : ℝ) := by
have h1 : P ≤ 2 * n + 1 := by omega
have h2 : (P : ℝ) ≤ ((2 * n : ℕ) : ℝ) + 1 := by exact_mod_cast h1
have h3 : (6 : ℝ) ≤ P := by exact_mod_cast (le_trans (by omega) hPN)
linarith
have hpow : ((C.card : ℝ) + 1) * (16 * ((2 * n : ℕ) : ℝ) / A.card) ^ (2 ^ (K + 1)) ≤
((2 * n : ℕ) : ℝ) := by
calc ((C.card : ℝ) + 1) * (16 * ((2 * n : ℕ) : ℝ) / A.card) ^ (2 ^ (K + 1))
≤ (3 * y ^ 4) * (D * y) ^ (2 * L) :=
mul_le_mul hCcard hXpow (by positivity) (by positivity)
_ ≤ (P : ℝ) / 2 := hasym
_ ≤ _ := hNP
obtain ⟨a, v, -, hlin, hmem⟩ :=
a52_cube_lin_aux K (2 * n) A C hsub hne (a52_constraints_nontrivial K H) hpow
have hcast : ∀ ε : Fin K → Bool,
((a + a52_cubeSum v ε : ℕ) : ℤ) = (a : ℤ) + ∑ k, if ε k then (v k : ℤ) else 0 := by
intro ε; simp [a52_cubeSum, Nat.cast_sum, Nat.cast_ite]
refine ⟨a, fun k => v k, fun ε => ?_, ?_, ?_⟩
· have h := hmem ε
simp only [hAdef, Finset.mem_filter, Finset.mem_Ioc] at h
exact ⟨_, h.2, by omega, by omega, hcast ε⟩
· intro ε ε' heq
by_contra hne'
have hq : ((fun k => (if ε k then (1 : ℤ) else 0) - (if ε' k then 1 else 0)), (0 : ℤ),
(0 : ℤ)) ∈ C :=
Finset.mem_union_left _ (Finset.mem_image.2 ⟨(ε, ε'), Finset.mem_filter.2 ⟨Finset.mem_univ _, hne'⟩, rfl⟩)
apply hlin _ hq
have hd := a52_vertex_diff (a : ℤ) (fun k => (v k : ℤ)) ε ε'
simp only at heq hd ⊢
rw [heq, sub_self] at hd
simp only [zero_mul, zero_add, add_zero]
exact hd.symm
· rintro ⟨ε, h⟩ ⟨ε', h'⟩ heq
by_contra hne'
have hq : ((fun k => a52_shiftCoeff ε h.1 k - a52_shiftCoeff ε' h'.1 k),
((h.1 + 1 + K : ℕ) : ℤ) - ((h'.1 + 1 + K : ℕ) : ℤ), (0 : ℤ)) ∈ C :=
Finset.mem_union_right _
(Finset.mem_image.2 ⟨((ε, h), (ε', h')), Finset.mem_filter.2 ⟨Finset.mem_univ _, hne'⟩, rfl⟩)
apply hlin _ hq
have hd := a52_shift_diff (a : ℤ) (fun k => (v k : ℤ)) ε ε' h.1 h'.1
simp only at heq hd ⊢
rw [heq, sub_self] at hd
rw [add_zero]
exact hd.symm
private theorem a52_hilbert_cube_primes_quant_two_thirds :
∃ P0 : ℕ, ∀ P : ℕ, P0 ≤ P → ∀ K H : ℕ,
(2 : ℝ) ^ K ≤ Real.log P ^ ((2 : ℝ) / 3) → (H : ℝ) ≤ Real.log P ^ ((2 : ℝ) / 3) →
∃ (p0 : ℤ) (v : Fin K → ℤ),
(∀ ε : Fin K → Bool, ∃ p : ℕ, p.Prime ∧ P < 2 * p ∧ p ≤ P ∧
(p : ℤ) = p0 + ∑ k, if ε k then v k else 0) ∧
Function.Injective (fun ε : Fin K → Bool => p0 + ∑ k, if ε k then v k else 0) ∧
Function.Injective (fun x : (Fin K → Bool) × Fin H =>
(p0 + ∑ k, if x.1 k then v k else 0) * ((x.2.1 + 1 + K : ℕ) : ℤ)
- ∑ k : Fin K, ((k.1 : ℤ) + 1) * (if x.1 k then v k else 0)) :=
a52_hilbert_cube_primes_quant (2 / 3) (by norm_num)
private theorem mf_log_factorial (n : ℕ) :
Real.log (n.factorial : ℝ) =
∑ p ∈ (Finset.Iic n).filter Nat.Prime, (padicValNat p n.factorial : ℝ) * Real.log p := by
have hsub : (n.factorial).factorization.support ⊆ (Finset.Iic n).filter Nat.Prime := by
intro p hp
rw [Nat.support_factorization] at hp
have hpp := Nat.prime_of_mem_primeFactors hp
have hdvd := Nat.dvd_of_mem_primeFactors hp
simp only [Finset.mem_filter, Finset.mem_Iic]
exact ⟨(hpp.dvd_factorial).1 hdvd, hpp⟩
rw [Real.log_nat_eq_sum_factorization, Finsupp.sum_of_support_subset _ hsub _ (by intros; simp)]
apply Finset.sum_congr rfl
intro p hp
rw [Nat.factorization_def _ (Finset.mem_filter.1 hp).2]
/-- `v_p(n!) ≥ ⌊n/p⌋ > n/p - 1`. -/
private theorem mf_padic_lower (n p : ℕ) (hp : p.Prime) :
(n : ℝ) / p - 1 ≤ (padicValNat p n.factorial : ℝ) := by
haveI := Fact.mk hp
have hp0 : (0:ℝ) < p := by exact_mod_cast hp.pos
have h1 : n / p ≤ padicValNat p n.factorial := by
rw [padicValNat_factorial (b := Nat.log p n + 1) (Nat.lt_succ_self _)]
rcases Nat.lt_or_ge n p with h | h
· rw [Nat.div_eq_of_lt h]; exact Nat.zero_le _
· have hlog : 0 < Nat.log p n := Nat.log_pos hp.one_lt h
have hmem : 1 ∈ Finset.Ico 1 (Nat.log p n + 1) := by
simp only [Finset.mem_Ico]; omega
calc n / p = n / p ^ 1 := by rw [pow_one]
_ ≤ _ := Finset.single_le_sum (f := fun i => n / p ^ i) (fun i _ => Nat.zero_le _) hmem
have h2 : (n : ℝ) < ((n / p : ℕ) : ℝ) * p + p := by
exact_mod_cast Nat.lt_div_mul_add hp.pos
have h3 : (n : ℝ) / p - 1 < ((n / p : ℕ) : ℝ) := by
rw [div_sub_one hp0.ne', div_lt_iff₀ hp0]; linarith
have h4 : ((n / p : ℕ) : ℝ) ≤ (padicValNat p n.factorial : ℝ) := by exact_mod_cast h1
linarith
/-- `(p - 1) v_p(n!) ≤ n`. -/
private theorem mf_padic_upper (n p : ℕ) (hp : p.Prime) :
((p : ℝ) - 1) * (padicValNat p n.factorial : ℝ) ≤ n := by
haveI := Fact.mk hp
rcases Nat.eq_zero_or_pos n with rfl | hn
· simp
have h := sub_one_mul_padicValNat_factorial_lt_of_ne_zero p hn.ne'
have h' : ((p - 1 : ℕ) : ℝ) * (padicValNat p n.factorial : ℝ) ≤ n := by exact_mod_cast h.le
rwa [Nat.cast_sub hp.one_le, Nat.cast_one] at h'
/-- Chebyshev: `θ(n) ≤ n log 4`. -/
private theorem mf_theta (n : ℕ) :
∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p ≤ Real.log 4 * n := by
have h := Chebyshev.theta_le_log4_mul_x (x := (n : ℝ)) (Nat.cast_nonneg n)
rw [Chebyshev.theta_eq_sum_Icc, Nat.floor_natCast] at h
have : Finset.Icc 0 n = Finset.Iic n := by ext; simp
rwa [this] at h
private theorem mf_log_fact_le (n : ℕ) : Real.log (n.factorial : ℝ) ≤ n * Real.log n := by
have h0 : (0:ℝ) < n.factorial := by exact_mod_cast Nat.factorial_pos n
have h : (n.factorial : ℝ) ≤ (n:ℝ) ^ n := by exact_mod_cast Nat.factorial_le_pow n
calc Real.log (n.factorial : ℝ) ≤ Real.log ((n:ℝ)^n) := Real.log_le_log h0 h
_ = n * Real.log n := by rw [Real.log_pow]
private theorem mf_log_fact_ge (n : ℕ) : n * Real.log n - n ≤ Real.log (n.factorial : ℝ) := by
have h0 : (0:ℝ) < n.factorial := by exact_mod_cast Nat.factorial_pos n
rcases Nat.eq_zero_or_pos n with rfl | hn
· simp
have h := Real.pow_div_factorial_le_exp (n : ℝ) (Nat.cast_nonneg n) n
have hn' : (0:ℝ) < n := by exact_mod_cast hn
have hpos : (0:ℝ) < (n:ℝ)^n / n.factorial := by positivity
have := Real.log_le_log hpos h
rw [Real.log_exp, Real.log_div (by positivity) h0.ne', Real.log_pow] at this
linarith
private theorem mf_term_le (p : ℕ) (hp : 2 ≤ p) :
Real.log p / (p * (p - 1)) ≤ 4 * (1 / (p : ℝ) ^ (3/2 : ℝ)) := by
have hp' : (2:ℝ) ≤ p := by exact_mod_cast hp
have hp0 : (0:ℝ) < p := by linarith
have hs0 : 0 < (p:ℝ) ^ (1/2 : ℝ) := Real.rpow_pos_of_pos hp0 _
have hss : (p:ℝ) ^ (1/2 : ℝ) * (p:ℝ) ^ (1/2 : ℝ) = p := by
rw [← Real.rpow_add hp0]; norm_num
have h32 : (p:ℝ) ^ (3/2 : ℝ) = p * (p:ℝ) ^ (1/2 : ℝ) := by
rw [show (3/2:ℝ) = 1 + 1/2 by norm_num, Real.rpow_add hp0, Real.rpow_one]
have hlog : Real.log p ≤ 2 * (p:ℝ) ^ (1/2 : ℝ) := by
have := Real.log_le_rpow_div (x := (p:ℝ)) (ε := 1/2) hp0.le (by norm_num)
have e : (p:ℝ) ^ (1/2 : ℝ) / (1/2) = 2 * (p:ℝ) ^ (1/2 : ℝ) := by ring
linarith
have hlog0 : 0 ≤ Real.log p := Real.log_nonneg (by linarith)
rw [h32, mul_one_div, div_le_div_iff₀ (by nlinarith) (by positivity)]
have h1 : Real.log p * (p:ℝ) ^ (1/2 : ℝ) ≤ 2 * p := by nlinarith
nlinarith
/-- `∑_{p ≤ n} log p / (p (p - 1))` is bounded. -/
private theorem mf_tail_bound : ∃ C0 : ℝ, ∀ n : ℕ,
∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p / (p * (p - 1)) ≤ C0 := by
have hsum : Summable (fun m : ℕ => 4 * (1 / (m : ℝ) ^ (3/2 : ℝ))) :=
(Real.summable_one_div_nat_rpow.2 (by norm_num)).mul_left 4
refine ⟨∑' m : ℕ, 4 * (1 / (m : ℝ) ^ (3/2 : ℝ)), fun n => ?_⟩
calc _ ≤ ∑ p ∈ (Finset.Iic n).filter Nat.Prime, 4 * (1 / (p : ℝ) ^ (3/2 : ℝ)) :=
Finset.sum_le_sum fun p hp => mf_term_le p (Finset.mem_filter.1 hp).2.two_le
_ ≤ _ := hsum.sum_le_tsum _ (fun i _ => by positivity)
/-- Mertens' first theorem: `∑_{p ≤ n} log p / p = log n + O(1)`. -/
private theorem u_mertens_first :
∃ C : ℝ, ∀ n : ℕ, 2 ≤ n →
|(∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p / p) - Real.log n| ≤ C := by
obtain ⟨C0, hC0⟩ := mf_tail_bound
refine ⟨Real.log 4 + 1 + |C0|, fun n hn => ?_⟩
have hn0 : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega)
have hL := mf_log_factorial n
have hup : (n:ℝ) * (∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p / p)
≤ Real.log (n.factorial : ℝ) + Real.log 4 * n := by
have : (n:ℝ) * (∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p / p) ≤
∑ p ∈ (Finset.Iic n).filter Nat.Prime,
((padicValNat p n.factorial : ℝ) * Real.log p + Real.log p) := by
rw [Finset.mul_sum]
apply Finset.sum_le_sum
intro p hp
have hpp := (Finset.mem_filter.1 hp).2
have hlog0 : 0 ≤ Real.log p := Real.log_nonneg (by exact_mod_cast hpp.one_lt.le)
have hv := mf_padic_lower n p hpp
have e : (n:ℝ) * (Real.log p / p) = ((n:ℝ) / p) * Real.log p := by ring
rw [e]; nlinarith
rw [Finset.sum_add_distrib, ← hL] at this
linarith [mf_theta n]
have hlo : Real.log (n.factorial : ℝ) ≤
(n:ℝ) * (∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p / p) + n * C0 := by
rw [hL]
have : ∑ p ∈ (Finset.Iic n).filter Nat.Prime, (padicValNat p n.factorial : ℝ) * Real.log p ≤
∑ p ∈ (Finset.Iic n).filter Nat.Prime,
((n:ℝ) * (Real.log p / p) + n * (Real.log p / (p * (p - 1)))) := by
apply Finset.sum_le_sum
intro p hp
have hpp := (Finset.mem_filter.1 hp).2
have hp2 : (2:ℝ) ≤ p := by exact_mod_cast hpp.two_le
have hpne : (p:ℝ) ≠ 0 := by linarith
have hp1 : (p:ℝ) - 1 ≠ 0 := by linarith
have hlog0 : 0 ≤ Real.log p := Real.log_nonneg (by linarith)
have hv := mf_padic_upper n p hpp
have key : (n:ℝ) * (Real.log p / p) + n * (Real.log p / (p * (p - 1)))
= (n:ℝ) / (p - 1) * Real.log p := by
field_simp; ring
rw [key]
have : (padicValNat p n.factorial : ℝ) ≤ n / (p - 1) := by
rw [le_div_iff₀ (by linarith)]; linarith
exact mul_le_mul_of_nonneg_right this hlog0
rw [Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.mul_sum] at this
have := hC0 n
nlinarith
have h1 := mf_log_fact_le n
have h2 := mf_log_fact_ge n
have hSup : (∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p / p) ≤ Real.log n + Real.log 4 := by
by_contra h; push_neg at h; nlinarith
have hSlo : Real.log n - 1 - C0 ≤ (∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p / p) := by
by_contra h; push_neg at h; nlinarith
have hl4 : 0 ≤ Real.log 4 := Real.log_nonneg (by norm_num)
rw [abs_le]; constructor
· linarith [le_abs_self C0]
· linarith [abs_nonneg C0]
private theorem ms_Iic_succ (g : ℕ → ℝ) (n : ℕ) :
∑ p ∈ (Finset.Iic (n+1)).filter Nat.Prime, g p =
∑ p ∈ (Finset.Iic n).filter Nat.Prime, g p + if (n+1).Prime then g (n+1) else 0 := by
have h : ∀ m : ℕ, Finset.Iic m = Finset.range (m+1) := by
intro m; ext x; simp [Nat.lt_succ_iff]
rw [h, h, Finset.sum_filter, Finset.sum_filter, Finset.sum_range_succ]
private theorem ms_Iic_two : (Finset.Iic 2).filter Nat.Prime = {2} := by
ext x
simp only [Finset.mem_filter, Finset.mem_Iic, Finset.mem_singleton]
constructor
· rintro ⟨h1, h2⟩
interval_cases x
· exact absurd h2 Nat.not_prime_zero
· exact absurd h2 Nat.not_prime_one
· rfl
· rintro rfl; exact ⟨le_rfl, Nat.prime_two⟩
/-- Discrete Abel summation of `1/p = (log p / p) / log p`. -/
private theorem ms_abel (n : ℕ) (hn : 2 ≤ n) :
∑ p ∈ (Finset.Iic n).filter Nat.Prime, (1:ℝ) / p =
(∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p / p) / Real.log n +
∑ k ∈ Finset.Ico 2 n, (∑ p ∈ (Finset.Iic k).filter Nat.Prime, Real.log p / p) *
(1 / Real.log k - 1 / Real.log ((k:ℝ) + 1)) := by
induction n, hn using Nat.le_induction with
| base =>
rw [ms_Iic_two]
have hl2 : Real.log 2 ≠ 0 := (Real.log_pos (by norm_num)).ne'
simp only [Finset.sum_singleton, Finset.Ico_self, Finset.sum_empty, Nat.cast_ofNat, add_zero]
field_simp
| succ n hn ih =>
have hB := ms_Iic_succ (fun p : ℕ => (1:ℝ) / p) n
have hA := ms_Iic_succ (fun p : ℕ => Real.log p / p) n
rw [Finset.sum_Ico_succ_top hn, hB, hA, ih]
have hm : ((n:ℝ) + 1) ≠ 0 := by positivity
have hL : Real.log ((n:ℝ) + 1) ≠ 0 := (Real.log_pos (by
have : (2:ℝ) ≤ n := by exact_mod_cast hn
linarith)).ne'
push_cast
split_ifs with hp
· field_simp
ring
· ring
private theorem ms_tele (F : ℕ → ℝ) (n : ℕ) (hn : 2 ≤ n) :
∑ k ∈ Finset.Ico 2 n, (F (k+1) - F k) = F n - F 2 := by
induction n, hn using Nat.le_induction with
| base => simp
| succ n hn ih => rw [Finset.sum_Ico_succ_top hn, ih]; ring
/-- For `k ≥ 2`, with `u = log k`, `v = log (k+1)`, `d = 1/u - 1/v`:
`loglog(k+1) - loglog k - d ≤ u d ≤ loglog(k+1) - loglog k` and `0 ≤ d`. -/
private theorem ms_point (k : ℕ) (hk : 2 ≤ k) :
Real.log (Real.log ((k:ℝ)+1)) - Real.log (Real.log k)
- (1 / Real.log k - 1 / Real.log ((k:ℝ)+1))
≤ Real.log k * (1 / Real.log k - 1 / Real.log ((k:ℝ)+1)) ∧
Real.log k * (1 / Real.log k - 1 / Real.log ((k:ℝ)+1))
≤ Real.log (Real.log ((k:ℝ)+1)) - Real.log (Real.log k) ∧
0 ≤ 1 / Real.log k - 1 / Real.log ((k:ℝ)+1) := by
have hk' : (2:ℝ) ≤ k := by exact_mod_cast hk
have hu : 0 < Real.log k := Real.log_pos (by linarith)
have huv : Real.log k < Real.log ((k:ℝ)+1) := Real.log_lt_log (by linarith) (by linarith)
have hv : 0 < Real.log ((k:ℝ)+1) := by linarith
have hvu1 : Real.log ((k:ℝ)+1) - Real.log k ≤ 1 := by
have h := Real.log_le_sub_one_of_pos (x := ((k:ℝ)+1)/k) (by positivity)
rw [Real.log_div (by positivity) (by positivity)] at h
have e : ((k:ℝ)+1)/k - 1 = 1/k := by field_simp; ring
have : 1/(k:ℝ) ≤ 1 := by rw [div_le_one (by positivity)]; linarith
linarith
set u := Real.log k
set v := Real.log ((k:ℝ)+1)
have hll : Real.log v - Real.log u = Real.log (v/u) := (Real.log_div hv.ne' hu.ne').symm
have hvu0 : 0 < v / u := by positivity
have hup := Real.log_le_sub_one_of_pos hvu0
have hlo := Real.one_sub_inv_le_log_of_pos hvu0
have e1 : u * (1/u - 1/v) = 1 - (v/u)⁻¹ := by field_simp
have e2 : v/u - 1 - (1/u - 1/v) - u * (1/u - 1/v) = (v - u - 1) * (v - u) / (u * v) := by
field_simp; ring
have hneg : (v - u - 1) * (v - u) / (u * v) ≤ 0 :=
div_nonpos_of_nonpos_of_nonneg (mul_nonpos_of_nonpos_of_nonneg (by linarith) (by linarith))
(by positivity)
have hd : 0 ≤ 1/u - 1/v := by
rw [sub_nonneg]; exact one_div_le_one_div_of_le hu huv.le
refine ⟨by linarith, by linarith, hd⟩
/-- Mertens' second theorem: `∑_{p ≤ n} 1/p = log log n + O(1)`. -/
private theorem u_mertens_second :
∃ C : ℝ, ∀ n : ℕ, 3 ≤ n →
|(∑ p ∈ (Finset.Iic n).filter Nat.Prime, (1 : ℝ) / p) - Real.log (Real.log n)| ≤ C := by
obtain ⟨C, hC⟩ := u_mertens_first
have hl2 : 0 < Real.log 2 := Real.log_pos (by norm_num)
have hC0 : 0 ≤ C := le_trans (abs_nonneg _) (hC 2 le_rfl)
refine ⟨2 + |Real.log (Real.log 2)| + (1 + 2 * C) / Real.log 2, fun n hn => ?_⟩
have hn2 : 2 ≤ n := by omega
have hn' : (2:ℝ) ≤ n := by exact_mod_cast hn2
have hln : Real.log 2 ≤ Real.log n := Real.log_le_log (by norm_num) hn'
have hab := ms_abel n hn2
have hD : ∑ k ∈ Finset.Ico 2 n, (1 / Real.log k - 1 / Real.log ((k:ℝ) + 1))
= 1 / Real.log 2 - 1 / Real.log n := by
calc _ = ∑ k ∈ Finset.Ico 2 n,
((fun k : ℕ => -(1 / Real.log k)) (k+1) - (fun k : ℕ => -(1 / Real.log k)) k) :=
Finset.sum_congr rfl (fun k _ => by push_cast; ring)
_ = _ := ms_tele (fun k : ℕ => -(1 / Real.log k)) n hn2
_ = _ := by push_cast; ring
have hLL : ∑ k ∈ Finset.Ico 2 n,
(Real.log (Real.log ((k:ℝ)+1)) - Real.log (Real.log k))
= Real.log (Real.log n) - Real.log (Real.log 2) := by
calc _ = ∑ k ∈ Finset.Ico 2 n,
((fun k : ℕ => Real.log (Real.log k)) (k+1) - (fun k : ℕ => Real.log (Real.log k)) k) :=
Finset.sum_congr rfl (fun k _ => by push_cast; ring)
_ = _ := ms_tele (fun k : ℕ => Real.log (Real.log k)) n hn2
_ = _ := by push_cast; ring
-- per-term bounds on the Abel sum
have hS_up : ∑ k ∈ Finset.Ico 2 n, (∑ p ∈ (Finset.Iic k).filter Nat.Prime, Real.log p / p) *
(1 / Real.log k - 1 / Real.log ((k:ℝ) + 1)) ≤
∑ k ∈ Finset.Ico 2 n, ((Real.log (Real.log ((k:ℝ)+1)) - Real.log (Real.log k))
+ C * (1 / Real.log k - 1 / Real.log ((k:ℝ) + 1))) := by
apply Finset.sum_le_sum
intro k hk
have hk2 : 2 ≤ k := (Finset.mem_Ico.1 hk).1
obtain ⟨_, h2, h3⟩ := ms_point k hk2
have hA := abs_le.1 (hC k hk2)
nlinarith
have hS_lo : ∑ k ∈ Finset.Ico 2 n, ((Real.log (Real.log ((k:ℝ)+1)) - Real.log (Real.log k))
- (1 + C) * (1 / Real.log k - 1 / Real.log ((k:ℝ) + 1))) ≤
∑ k ∈ Finset.Ico 2 n, (∑ p ∈ (Finset.Iic k).filter Nat.Prime, Real.log p / p) *
(1 / Real.log k - 1 / Real.log ((k:ℝ) + 1)) := by
apply Finset.sum_le_sum
intro k hk
have hk2 : 2 ≤ k := (Finset.mem_Ico.1 hk).1
obtain ⟨h1, _, h3⟩ := ms_point k hk2
have hA := abs_le.1 (hC k hk2)
nlinarith
rw [Finset.sum_add_distrib, ← Finset.mul_sum, hLL, hD] at hS_up
rw [Finset.sum_sub_distrib, ← Finset.mul_sum, hLL, hD] at hS_lo
-- the boundary term
have hAn := abs_le.1 (hC n hn2)
have hlnpos : 0 < Real.log n := by linarith
have hB1 : (∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p / p) / Real.log n ≤ 1 + C / Real.log 2 := by
rw [div_le_iff₀ hlnpos]
have : C / Real.log 2 * Real.log n ≥ C := by
rw [ge_iff_le, div_mul_eq_mul_div, le_div_iff₀ hl2]; nlinarith
nlinarith
have hB2 : 1 - C / Real.log 2 ≤ (∑ p ∈ (Finset.Iic n).filter Nat.Prime, Real.log p / p) / Real.log n := by
rw [le_div_iff₀ hlnpos]
have : C / Real.log 2 * Real.log n ≥ C := by
rw [ge_iff_le, div_mul_eq_mul_div, le_div_iff₀ hl2]; nlinarith
nlinarith
have hDle : 1 / Real.log 2 - 1 / Real.log n ≤ 1 / Real.log 2 := by
have : 0 < 1 / Real.log n := by positivity
linarith
have hD0 : 0 ≤ 1 / Real.log 2 - 1 / Real.log n := by
rw [sub_nonneg]; exact one_div_le_one_div_of_le hl2 hln
have hCD : C * (1 / Real.log 2 - 1 / Real.log n) ≤ C / Real.log 2 := by
have := mul_le_mul_of_nonneg_left hDle hC0; rw [mul_one_div] at this; exact this
have hCD' : (1 + C) * (1 / Real.log 2 - 1 / Real.log n) ≤ (1 + C) / Real.log 2 := by
have := mul_le_mul_of_nonneg_left hDle (by linarith : (0:ℝ) ≤ 1 + C)
rw [mul_one_div] at this; exact this
have e : (1 + 2 * C) / Real.log 2 = 1 / Real.log 2 + C / Real.log 2 + C / Real.log 2 := by ring
have e' : (1 + C) / Real.log 2 = 1 / Real.log 2 + C / Real.log 2 := by ring
have hll2 := abs_le.1 (le_refl |Real.log (Real.log 2)|)
have h12 : 0 ≤ 1 / Real.log 2 := by positivity
rw [hab, abs_le]; constructor
· nlinarith
· nlinarith
private theorem ms_tele' (F : ℕ → ℝ) (m n : ℕ) (hmn : m ≤ n) :
∑ k ∈ Finset.Ico m n, (F (k+1) - F k) = F n - F m := by
induction n, hmn using Nat.le_induction with
| base => simp
| succ n hn ih => rw [Finset.sum_Ico_succ_top hn, ih]; ring
/-- Mertens' second theorem with the error `O(1 / log m)` on a range `(m, n]`:
`∑_{m < p ≤ n} 1/p = log log n - log log m + O(1 / log m)`. Equivalent to the classical
form `∑_{p ≤ n} 1/p = log log n + M + O(1 / log n)` (it says the left side minus `log log n`
is Cauchy at rate `1 / log m`), and directly gives the dyadic sums `∑_{P/2 < p ≤ P} 1/p`. -/
private theorem u_mertens_second_interval : ∃ C : ℝ, ∀ m n : ℕ, 2 ≤ m → m ≤ n →
|((∑ p ∈ (Finset.Iic n).filter Nat.Prime, (1 : ℝ) / p)
- ∑ p ∈ (Finset.Iic m).filter Nat.Prime, (1 : ℝ) / p)
- (Real.log (Real.log n) - Real.log (Real.log m))| ≤ C / Real.log m := by
obtain ⟨C, hC⟩ := u_mertens_first
have hC0 : 0 ≤ C := le_trans (abs_nonneg _) (hC 2 le_rfl)
refine ⟨3 * C + 1, fun m n hm hmn => ?_⟩
have hn2 : 2 ≤ n := le_trans hm hmn
have hm' : (2:ℝ) ≤ m := by exact_mod_cast hm
have hmn' : (m:ℝ) ≤ n := by exact_mod_cast hmn
have hlm : 0 < Real.log m := Real.log_pos (by linarith)
have hlmn : Real.log m ≤ Real.log n := Real.log_le_log (by linarith) hmn'
have hln : 0 < Real.log n := by linarith
have habn := ms_abel n hn2
have habm := ms_abel m hm
have hsplit := Finset.sum_Ico_consecutive
(fun k : ℕ => (∑ p ∈ (Finset.Iic k).filter Nat.Prime, Real.log p / p) *
(1 / Real.log k - 1 / Real.log ((k:ℝ) + 1))) hm hmn
have hD : ∑ k ∈ Finset.Ico m n, (1 / Real.log k - 1 / Real.log ((k:ℝ) + 1))
= 1 / Real.log m - 1 / Real.log n := by
calc _ = ∑ k ∈ Finset.Ico m n,
((fun k : ℕ => -(1 / Real.log k)) (k+1) - (fun k : ℕ => -(1 / Real.log k)) k) :=
Finset.sum_congr rfl (fun k _ => by push_cast; ring)
_ = _ := ms_tele' (fun k : ℕ => -(1 / Real.log k)) m n hmn
_ = _ := by ring
have hLL : ∑ k ∈ Finset.Ico m n,
(Real.log (Real.log ((k:ℝ)+1)) - Real.log (Real.log k))
= Real.log (Real.log n) - Real.log (Real.log m) := by
calc _ = ∑ k ∈ Finset.Ico m n,
((fun k : ℕ => Real.log (Real.log k)) (k+1) - (fun k : ℕ => Real.log (Real.log k)) k) :=
Finset.sum_congr rfl (fun k _ => by push_cast; ring)
_ = _ := ms_tele' (fun k : ℕ => Real.log (Real.log k)) m n hmn
have hS_up : ∑ k ∈ Finset.Ico m n, (∑ p ∈ (Finset.Iic k).filter Nat.Prime, Real.log p / p) *
(1 / Real.log k - 1 / Real.log ((k:ℝ) + 1)) ≤
∑ k ∈ Finset.Ico m n, ((Real.log (Real.log ((k:ℝ)+1)) - Real.log (Real.log k))
+ C * (1 / Real.log k - 1 / Real.log ((k:ℝ) + 1))) := by
apply Finset.sum_le_sum
intro k hk
have hk2 : 2 ≤ k := le_trans hm (Finset.mem_Ico.1 hk).1
obtain ⟨_, h2, h3⟩ := ms_point k hk2
have hA := abs_le.1 (hC k hk2)
nlinarith
have hS_lo : ∑ k ∈ Finset.Ico m n, ((Real.log (Real.log ((k:ℝ)+1)) - Real.log (Real.log k))
- (1 + C) * (1 / Real.log k - 1 / Real.log ((k:ℝ) + 1))) ≤
∑ k ∈ Finset.Ico m n, (∑ p ∈ (Finset.Iic k).filter Nat.Prime, Real.log p / p) *
(1 / Real.log k - 1 / Real.log ((k:ℝ) + 1)) := by
apply Finset.sum_le_sum
intro k hk
have hk2 : 2 ≤ k := le_trans hm (Finset.mem_Ico.1 hk).1
obtain ⟨h1, _, h3⟩ := ms_point k hk2
have hA := abs_le.1 (hC k hk2)
nlinarith
rw [Finset.sum_add_distrib, ← Finset.mul_sum, hLL, hD] at hS_up
rw [Finset.sum_sub_distrib, ← Finset.mul_sum, hLL, hD] at hS_lo
-- boundary terms: A(j)/log j = 1 + R(j)/log j with |R(j)/log j| ≤ C / log m
have hb : ∀ j : ℕ, m ≤ j →
|(∑ p ∈ (Finset.Iic j).filter Nat.Prime, Real.log p / p) / Real.log j - 1|
≤ C / Real.log m := by
intro j hj
have hj2 : 2 ≤ j := le_trans hm hj
have hlj : Real.log m ≤ Real.log j :=
Real.log_le_log (by linarith) (by exact_mod_cast hj)
have hljpos : 0 < Real.log j := by linarith
have e : (∑ p ∈ (Finset.Iic j).filter Nat.Prime, Real.log p / p) / Real.log j - 1
= ((∑ p ∈ (Finset.Iic j).filter Nat.Prime, Real.log p / p) - Real.log j) / Real.log j := by
field_simp
rw [e, abs_div, abs_of_pos hljpos]
calc _ ≤ C / Real.log j := div_le_div_of_nonneg_right (hC j hj2) hljpos.le
_ ≤ C / Real.log m := div_le_div_of_nonneg_left hC0 hlm hlj
have hbn := abs_le.1 (hb n hmn)
have hbm := abs_le.1 (hb m le_rfl)
have hDle : 1 / Real.log m - 1 / Real.log n ≤ 1 / Real.log m := by
have : 0 < 1 / Real.log n := by positivity
linarith
have hD0 : 0 ≤ 1 / Real.log m - 1 / Real.log n := by
rw [sub_nonneg]; exact one_div_le_one_div_of_le hlm hlmn
have hCD : C * (1 / Real.log m - 1 / Real.log n) ≤ C / Real.log m := by
have := mul_le_mul_of_nonneg_left hDle hC0; rw [mul_one_div] at this; exact this
have hCD' : (1 + C) * (1 / Real.log m - 1 / Real.log n) ≤ (1 + C) / Real.log m := by
have := mul_le_mul_of_nonneg_left hDle (by linarith : (0:ℝ) ≤ 1 + C)
rw [mul_one_div] at this; exact this
have e1 : (3 * C + 1) / Real.log m = C / Real.log m + C / Real.log m + (1 + C) / Real.log m := by
ring
have h1m : 0 ≤ C / Real.log m := by positivity
rw [habn, habm, ← hsplit, abs_le]; constructor
· nlinarith
· nlinarith
/-- If at most one cell `(k, ε)` has `p ∣ n + r_{ε,k+K+1}`, the phase `X_p(n)` of (5.13)
is at most `q / 2^(K+1)` in size: the bound (5.36) behind (5.19). -/
private theorem w_X_le {K : ℕ} (q : ℝ) (hq : 0 ≤ q) (H : ℕ) (sgn : (Fin K → Bool) → ℝ)
(hs : ∀ ε, |sgn ε| ≤ 1) (r : (Fin K → Bool) → ℕ → ℤ) (p : ℕ) (n : ℤ)
(huniq : ∀ k1 < H, ∀ k2 < H, ∀ ε1 ε2 : Fin K → Bool,
p ∣ (n + r ε1 (k1 + K + 1)).toNat → p ∣ (n + r ε2 (k2 + K + 1)).toNat → k1 = k2 ∧ ε1 = ε2) :
|q * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1)|
≤ q / 2 ^ (K + 1) := by
rw [abs_mul, abs_of_nonneg hq, div_eq_mul_inv q]
refine mul_le_mul_of_nonneg_left ?_ hq
by_cases hex : ∃ k < H, ∃ ε : Fin K → Bool, p ∣ (n + r ε (k + K + 1)).toNat
· obtain ⟨k0, hk0, ε0, hd0⟩ := hex
have hinner : ∀ k ∈ Finset.range H, k ≠ k0 →
(∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1) = 0 := by
intro k hk hne
rw [div_eq_zero_iff]; left
refine Finset.sum_eq_zero fun ε _ => ?_
rw [if_neg, mul_zero]
intro hd
exact hne (huniq k (Finset.mem_range.mp hk) k0 hk0 ε ε0 hd hd0).1
rw [Finset.sum_eq_single k0 hinner (fun h => absurd (Finset.mem_range.mpr hk0) h)]
have hsingle : ∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k0 + K + 1)).toNat then (1 : ℝ) else 0) = sgn ε0 := by
rw [Finset.sum_eq_single ε0]
· rw [if_pos hd0, mul_one]
· intro ε _ hne
rw [if_neg, mul_zero]
intro hd
exact hne (huniq k0 hk0 k0 hk0 ε ε0 hd hd0).2
· intro h; exact absurd (Finset.mem_univ ε0) h
rw [hsingle, abs_div, abs_of_pos (by positivity : (0 : ℝ) < 2 ^ (k0 + K + 1))]
calc |sgn ε0| / 2 ^ (k0 + K + 1) ≤ 1 / 2 ^ (k0 + K + 1) :=
div_le_div_of_nonneg_right (hs ε0) (by positivity)
_ ≤ 1 / 2 ^ (K + 1) :=
div_le_div_of_nonneg_left zero_le_one (by positivity)
(pow_le_pow_right₀ (by norm_num) (by omega))
_ = (2 ^ (K + 1) : ℝ)⁻¹ := one_div _
· push Not at hex
have hz : ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1) = 0 := by
refine Finset.sum_eq_zero fun k hk => ?_
rw [div_eq_zero_iff]; left
refine Finset.sum_eq_zero fun ε _ => ?_
rw [if_neg (hex k (Finset.mem_range.mp hk) ε), mul_zero]
rw [hz, abs_zero]; positivity
/-- No collisions: if `p` divides none of the differences of two distinct shifts, and the
shifted numbers are positive, at most one cell is divisible by `p`. -/
private theorem w_uniq_of_no_collision {K : ℕ} (H : ℕ) (r : (Fin K → Bool) → ℕ → ℤ) (p : ℕ)
(n : ℤ) (hpos : ∀ ε, ∀ k < H, 0 < n + r ε (k + K + 1))
(hcoll : ∀ k1 < H, ∀ k2 < H, ∀ ε1 ε2 : Fin K → Bool, (k1 ≠ k2 ∨ ε1 ≠ ε2) →
¬ (p : ℤ) ∣ r ε1 (k1 + K + 1) - r ε2 (k2 + K + 1)) :
∀ k1 < H, ∀ k2 < H, ∀ ε1 ε2 : Fin K → Bool,
p ∣ (n + r ε1 (k1 + K + 1)).toNat → p ∣ (n + r ε2 (k2 + K + 1)).toNat → k1 = k2 ∧ ε1 = ε2 := by
intro k1 hk1 k2 hk2 ε1 ε2 hd1 hd2
by_contra hne
rw [not_and_or] at hne
apply hcoll k1 hk1 k2 hk2 ε1 ε2 hne
have e1 : (p : ℤ) ∣ n + r ε1 (k1 + K + 1) := by
have := Int.natCast_dvd_natCast.mpr hd1
rwa [Int.toNat_of_nonneg (hpos ε1 k1 hk1).le] at this
have e2 : (p : ℤ) ∣ n + r ε2 (k2 + K + 1) := by
have := Int.natCast_dvd_natCast.mpr hd2
rwa [Int.toNat_of_nonneg (hpos ε2 k2 hk2).le] at this
have := dvd_sub e1 e2
rwa [add_sub_add_left_eq_sub] at this
/-- (5.19) from the set-up, in the exact shapes of T's hole: if no prime of `S1` divides a
difference of two distinct shifts (S1 avoids the discriminant), and `q / 2^(K+1) ≤ δ`, then
`|X_p(n)| ≤ δ` on `S1 × Ns`. -/
private theorem w_5_19 (q : ℕ) (δ : ℝ) (K H : ℕ) (Ns : Finset ℤ) (S1 : Finset ℕ)
(sgn : (Fin K → Bool) → ℝ) (r : (Fin K → Bool) → ℕ → ℤ) (X : ℕ → ℤ → ℝ)
(hsgn : ∀ ε, sgn ε = ∏ i, if ε i then (-1 : ℝ) else 1)
(hX : ∀ p n, X p n = (q : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1))
(hpos : ∀ n ∈ Ns, ∀ ε, ∀ k < H, 0 < n + r ε (k + K + 1))
(hcoll : ∀ p ∈ S1, ∀ k1 < H, ∀ k2 < H, ∀ ε1 ε2 : Fin K → Bool, (k1 ≠ k2 ∨ ε1 ≠ ε2) →
¬ (p : ℤ) ∣ r ε1 (k1 + K + 1) - r ε2 (k2 + K + 1))
(hK : (q : ℝ) / 2 ^ (K + 1) ≤ δ) :
∀ p ∈ S1, ∀ n ∈ Ns, |X p n| ≤ δ := by
intro p hp n hn
have hs : ∀ ε, |sgn ε| ≤ 1 := by
intro ε
rw [hsgn ε, Finset.abs_prod]
refine le_of_eq (Finset.prod_eq_one fun i _ => ?_)
split_ifs <;> norm_num
rw [hX p n]
exact (w_X_le (q : ℝ) (Nat.cast_nonneg q) H sgn hs r p n
(w_uniq_of_no_collision H r p n (fun ε k hk => hpos n hn ε k hk) (hcoll p hp))).trans hK
/-- A sum with at most one nonzero term squares termwise. -/
private theorem w_sq_sum_of_single {ι : Type*} (s : Finset ι) (f : ι → ℝ)
(h : ∀ i ∈ s, ∀ j ∈ s, f i ≠ 0 → f j ≠ 0 → i = j) :
(∑ i ∈ s, f i) ^ 2 = ∑ i ∈ s, f i ^ 2 := by
by_cases hex : ∃ i ∈ s, f i ≠ 0
· obtain ⟨i0, hi0, hf0⟩ := hex
have hz : ∀ j ∈ s, j ≠ i0 → f j = 0 := fun j hj hne => by
by_contra hfj; exact hne (h j hj i0 hi0 hfj hf0)
rw [Finset.sum_eq_single i0 hz (fun h' => absurd hi0 h'),
Finset.sum_eq_single i0 (fun j hj hne => by rw [hz j hj hne]; ring) (fun h' => absurd hi0 h')]
· push Not at hex
rw [Finset.sum_eq_zero hex, Finset.sum_eq_zero fun i hi => by rw [hex i hi]; ring]
ring
/-- `Σ_ε (-1)^{|ε|} = 0` for `K ≥ 1`. -/
private theorem w_sum_sgn_eq_zero {K : ℕ} (hK : 1 ≤ K) (sgn : (Fin K → Bool) → ℝ)
(hsgn : ∀ ε, sgn ε = ∏ i, if ε i then (-1 : ℝ) else 1) :
∑ ε : Fin K → Bool, sgn ε = 0 := by
simp_rw [hsgn]
rw [← Fintype.piFinset_univ, ← Finset.prod_univ_sum (fun _ : Fin K => (Finset.univ : Finset Bool))
(fun _ b => if b then (-1 : ℝ) else 1)]
exact Finset.prod_eq_zero (Finset.mem_univ ⟨0, hK⟩) (by simp)
/-- S8h with the paper's approximate equidistribution (5.35): if every residue class mod `p`
holds `#Ns/p` points of `Ns` up to a relative error `η ≤ 1`, then
`Var X_p ≥ (1 − η) q²/(2^(K+2) p) − (η q / p)²`. -/
private theorem w_var_lower_approx (q : ℕ) (K H : ℕ) (hK : 1 ≤ K) (hH : 1 ≤ H) (Ns : Finset ℤ)
(hNs : Ns.Nonempty) (p : ℕ) (hp : 0 < p) (η : ℝ) (hη : 0 ≤ η) (hη1 : η ≤ 1)
(sgn : (Fin K → Bool) → ℝ) (r : (Fin K → Bool) → ℕ → ℤ) (X : ℕ → ℤ → ℝ)
(hsgn : ∀ ε, sgn ε = ∏ i, if ε i then (-1 : ℝ) else 1)
(hX : ∀ p n, X p n = (q : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1))
(hpos : ∀ n ∈ Ns, ∀ ε, ∀ k < H, 0 < n + r ε (k + K + 1))
(hcoll : ∀ k1 < H, ∀ k2 < H, ∀ ε1 ε2 : Fin K → Bool, (k1 ≠ k2 ∨ ε1 ≠ ε2) →
¬ (p : ℤ) ∣ r ε1 (k1 + K + 1) - r ε2 (k2 + K + 1))
(hequi : ∀ a : ℤ, |((Ns.filter fun n => (p : ℤ) ∣ n + a).card : ℝ) * p - Ns.card|
≤ η * Ns.card) :
(1 - η) * ((q : ℝ) ^ 2 / (2 ^ (K + 2) * p)) - (η * q / p) ^ 2 ≤
(Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, X p n ^ 2 - ((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, X p n) ^ 2 := by
set C := Finset.range H ×ˢ (Finset.univ : Finset (Fin K → Bool)) with hC
set a : ℕ × (Fin K → Bool) → ℝ := fun c => (q : ℝ) * sgn c.2 / 2 ^ (c.1 + K + 1) with ha
set ind : ℤ → ℕ × (Fin K → Bool) → ℝ :=
fun n c => if (p : ℤ) ∣ n + r c.2 (c.1 + K + 1) then 1 else 0 with hind
set N : ℝ := (Ns.card : ℝ) with hN
have hNpos : 0 < N := by rw [hN]; exact_mod_cast hNs.card_pos
have hpR : (0 : ℝ) < p := by exact_mod_cast hp
have hdv : ∀ z : ℤ, 0 ≤ z → (p ∣ z.toNat ↔ (p : ℤ) ∣ z) := fun z hz => by
rw [← Int.natCast_dvd_natCast, Int.toNat_of_nonneg hz]
have hXc : ∀ n ∈ Ns, X p n = ∑ c ∈ C, a c * ind n c := by
intro n hn
rw [hX, hC, Finset.sum_product, Finset.mul_sum]
refine Finset.sum_congr rfl fun k hk => ?_
rw [Finset.sum_div, Finset.mul_sum]
refine Finset.sum_congr rfl fun ε _ => ?_
have hz := (hpos n hn ε k (Finset.mem_range.mp hk)).le
simp only [ha, hind]
by_cases h : (p : ℤ) ∣ n + r ε (k + K + 1)
· rw [if_pos h, if_pos ((hdv _ hz).mpr h)]; ring
· rw [if_neg h, if_neg (fun h' => h ((hdv _ hz).mp h'))]; ring
have hcnt : ∀ c : ℕ × (Fin K → Bool), |(∑ n ∈ Ns, ind n c) - N / p| ≤ η * N / p := by
intro c
have h := hequi (r c.2 (c.1 + K + 1))
have hs : ∑ n ∈ Ns, ind n c = ((Ns.filter fun n => (p : ℤ) ∣ n + r c.2 (c.1 + K + 1)).card : ℝ) := by
simp only [hind]; rw [Finset.sum_boole]
rw [hs]
have e : ((Ns.filter fun n => (p : ℤ) ∣ n + r c.2 (c.1 + K + 1)).card : ℝ) - N / p
= (((Ns.filter fun n => (p : ℤ) ∣ n + r c.2 (c.1 + K + 1)).card : ℝ) * p - N) / p := by
field_simp
rw [e, abs_div, abs_of_pos hpR]
exact div_le_div_of_nonneg_right h hpR.le
have hsq : ∀ n ∈ Ns, X p n ^ 2 = ∑ c ∈ C, a c ^ 2 * ind n c := by
intro n hn
rw [hXc n hn, w_sq_sum_of_single]
· refine Finset.sum_congr rfl fun c _ => ?_
simp only [hind]; split_ifs <;> ring
· intro c hc c' hc' h1 h2
have d1 : (p : ℤ) ∣ n + r c.2 (c.1 + K + 1) := by
by_contra h; apply h1; simp only [hind, if_neg h, mul_zero]
have d2 : (p : ℤ) ∣ n + r c'.2 (c'.1 + K + 1) := by
by_contra h; apply h2; simp only [hind, if_neg h, mul_zero]
by_contra hne
have hor : c.1 ≠ c'.1 ∨ c.2 ≠ c'.2 := by
by_contra h; push Not at h; exact hne (Prod.ext h.1 h.2)
rw [hC, Finset.mem_product] at hc hc'
apply hcoll c.1 (Finset.mem_range.mp hc.1) c'.1 (Finset.mem_range.mp hc'.1) c.2 c'.2 hor
have := dvd_sub d1 d2
rwa [add_sub_add_left_eq_sub] at this
-- Σ_c a c = 0 and Σ_c |a c| ≤ q
have hsuma : ∑ c ∈ C, a c = 0 := by
rw [hC, Finset.sum_product]
refine Finset.sum_eq_zero fun k _ => ?_
simp only [ha]
rw [← Finset.sum_div, ← Finset.mul_sum, w_sum_sgn_eq_zero hK sgn hsgn]; ring
have habs : ∑ c ∈ C, |a c| ≤ q := by
have hs1 : ∀ ε : Fin K → Bool, |sgn ε| = 1 := by
intro ε; rw [hsgn ε, Finset.abs_prod]
exact Finset.prod_eq_one fun i _ => by split_ifs <;> norm_num
rw [hC, Finset.sum_product]
simp only [ha, abs_div, abs_mul, hs1, Nat.abs_cast, mul_one, abs_pow, abs_two]
simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, Fintype.card_fun,
Fintype.card_bool, Fintype.card_fin]
have hk : ∀ k ∈ Finset.range H, ((2 ^ K : ℕ) : ℝ) * ((q : ℝ) / 2 ^ (k + K + 1))
= (q : ℝ) * ((1 / 2) * (1 / 2) ^ k) := by
intro k _; push_cast; rw [pow_add, pow_add]; field_simp
rw [mul_assoc, ← mul_pow]; norm_num
rw [Finset.sum_congr rfl hk, ← Finset.mul_sum, ← Finset.mul_sum]
have hg := sum_geometric_two_le H
have hq0 : (0 : ℝ) ≤ q := Nat.cast_nonneg q
nlinarith
have hmean : |(N)⁻¹ * ∑ n ∈ Ns, X p n| ≤ η * q / p := by
rw [Finset.sum_congr rfl hXc, Finset.sum_comm]
simp_rw [← Finset.mul_sum]
have e : ∑ c ∈ C, a c * ∑ n ∈ Ns, ind n c = ∑ c ∈ C, a c * ((∑ n ∈ Ns, ind n c) - N / p) := by
simp_rw [mul_sub]; rw [Finset.sum_sub_distrib, ← Finset.sum_mul, hsuma]; ring
rw [e, abs_mul, abs_inv, abs_of_pos hNpos]
have hb : |∑ c ∈ C, a c * ((∑ n ∈ Ns, ind n c) - N / p)| ≤ q * (η * N / p) := by
refine (Finset.abs_sum_le_sum_abs _ _).trans ?_
calc ∑ c ∈ C, |a c * ((∑ n ∈ Ns, ind n c) - N / p)|
≤ ∑ c ∈ C, |a c| * (η * N / p) := Finset.sum_le_sum fun c _ => by
rw [abs_mul]; exact mul_le_mul_of_nonneg_left (hcnt c) (abs_nonneg _)
_ = (∑ c ∈ C, |a c|) * (η * N / p) := by rw [Finset.sum_mul]
_ ≤ q * (η * N / p) := mul_le_mul_of_nonneg_right habs (by positivity)
calc N⁻¹ * |∑ c ∈ C, a c * ((∑ n ∈ Ns, ind n c) - N / p)| ≤ N⁻¹ * (q * (η * N / p)) :=
mul_le_mul_of_nonneg_left hb (by positivity)
_ = η * q / p := by field_simp
have hsecond : (1 - η) * (N / p) * ∑ c ∈ C, a c ^ 2 ≤ ∑ n ∈ Ns, X p n ^ 2 := by
rw [Finset.sum_congr rfl hsq, Finset.sum_comm]
simp_rw [← Finset.mul_sum]
rw [Finset.mul_sum]
refine Finset.sum_le_sum fun c _ => ?_
have h := hcnt c
rw [abs_le] at h
have : (1 - η) * (N / p) ≤ ∑ n ∈ Ns, ind n c := by
have : (1 - η) * (N / p) = N / p - η * N / p := by ring
linarith [h.1]
nlinarith [sq_nonneg (a c)]
have hlow : (q : ℝ) ^ 2 / 2 ^ (K + 2) ≤ ∑ c ∈ C, a c ^ 2 := by
have hsub : ({0} : Finset ℕ) ×ˢ (Finset.univ : Finset (Fin K → Bool)) ⊆ C := by
rw [hC]; exact Finset.product_subset_product_left
(Finset.singleton_subset_iff.mpr (Finset.mem_range.mpr hH))
refine le_trans (le_of_eq ?_) (Finset.sum_le_sum_of_subset_of_nonneg hsub
fun c _ _ => sq_nonneg _)
rw [Finset.sum_product, Finset.sum_singleton]
have hs2 : ∀ ε : Fin K → Bool, sgn ε ^ 2 = 1 := by
intro ε
rw [hsgn ε, ← Finset.prod_pow]
exact Finset.prod_eq_one fun i _ => by split_ifs <;> norm_num
simp only [ha, div_pow, mul_pow, hs2, mul_one]
rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul]
simp only [Fintype.card_fun, Fintype.card_bool, Fintype.card_fin, zero_add]
push_cast
rw [pow_succ 2 (K + 1), pow_succ 2 K]
field_simp
have hEX2 : (1 - η) * ((q : ℝ) ^ 2 / (2 ^ (K + 2) * p)) ≤ N⁻¹ * ∑ n ∈ Ns, X p n ^ 2 := by
have h1 : (1 - η) * ((q : ℝ) ^ 2 / (2 ^ (K + 2) * p))
= N⁻¹ * ((1 - η) * (N / p) * ((q : ℝ) ^ 2 / 2 ^ (K + 2))) := by
field_simp
rw [h1]
refine mul_le_mul_of_nonneg_left (le_trans ?_ hsecond) (by positivity)
exact mul_le_mul_of_nonneg_left hlow (mul_nonneg (by linarith) (by positivity))
have hEX : (N⁻¹ * ∑ n ∈ Ns, X p n) ^ 2 ≤ (η * q / p) ^ 2 := by
rw [← sq_abs]
exact pow_le_pow_left₀ (abs_nonneg _) hmean 2
linarith
/-- (5.21) from the set-up: summing `w_var_lower_approx` over `S1`. If every `p ∈ S1` avoids the
shifts' discriminant and `n` is equidistributed mod `p` up to relative error `η ≤ 1`, then
`Σ_{S1} Var X_p ≥ (1-η) q²/2^(K+2) Σ_{S1} 1/p − η² q² Σ_{S1} 1/p²`; the hole's `c0 ≤ Σ Var`
follows as soon as the right side is `≥ c0` (by Mertens, `Σ_{S1} 1/p ≍ log₂ R − log₂ W`). -/
private theorem w_5_21 (q : ℕ) (K H : ℕ) (hK : 1 ≤ K) (hH : 1 ≤ H) (Ns : Finset ℤ)
(hNs : Ns.Nonempty) (S1 : Finset ℕ) (hS1 : ∀ p ∈ S1, 0 < p) (η : ℝ) (hη : 0 ≤ η)
(hη1 : η ≤ 1) (sgn : (Fin K → Bool) → ℝ) (r : (Fin K → Bool) → ℕ → ℤ) (X : ℕ → ℤ → ℝ)
(hsgn : ∀ ε, sgn ε = ∏ i, if ε i then (-1 : ℝ) else 1)
(hX : ∀ p n, X p n = (q : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1))
(hpos : ∀ n ∈ Ns, ∀ ε, ∀ k < H, 0 < n + r ε (k + K + 1))
(hcoll : ∀ p ∈ S1, ∀ k1 < H, ∀ k2 < H, ∀ ε1 ε2 : Fin K → Bool, (k1 ≠ k2 ∨ ε1 ≠ ε2) →
¬ (p : ℤ) ∣ r ε1 (k1 + K + 1) - r ε2 (k2 + K + 1))
(hequi : ∀ p ∈ S1, ∀ a : ℤ, |((Ns.filter fun n => (p : ℤ) ∣ n + a).card : ℝ) * p - Ns.card|
≤ η * Ns.card) (c0 : ℝ)
(hc0 : c0 ≤ (1 - η) * ((q : ℝ) ^ 2 / 2 ^ (K + 2)) * ∑ p ∈ S1, (1 : ℝ) / p
- η ^ 2 * (q : ℝ) ^ 2 * ∑ p ∈ S1, (1 : ℝ) / p ^ 2) :
c0 ≤ ∑ p ∈ S1, ((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, X p n ^ 2
- ((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, X p n) ^ 2) := by
refine hc0.trans ?_
rw [Finset.mul_sum, Finset.mul_sum, ← Finset.sum_sub_distrib]
refine Finset.sum_le_sum fun p hp => le_trans (le_of_eq ?_)
(w_var_lower_approx q K H hK hH Ns hNs p (hS1 p hp) η hη hη1 sgn r X hsgn hX hpos
(hcoll p hp) (hequi p hp))
have : (0 : ℝ) < p := by exact_mod_cast hS1 p hp
field_simp
/-- One vertex of κ₁ (§5.7): if `m n ε` is equidistributed mod `P ε` on `Ns` up to a factor
`1 + η`, the average of `Σ_k 1[P² ∣ P m + P (k+1)] / 2^(k+1)` is at most `(1 + η)/P`. -/
private theorem w_kappa1_eps (Ns : Finset ℤ) (P : ℕ) (hP : 0 < P) (m : ℤ → ℕ) (η : ℝ)
(hequi : ∀ a : ℕ, ((Ns.filter fun n => P ∣ m n + a).card : ℝ) * P ≤ (1 + η) * Ns.card) :
∑ n ∈ Ns, ∑' k : ℕ, (if P ^ 2 ∣ P * m n + P * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1)
≤ (1 + η) * Ns.card / P := by
have hdv : ∀ n (k : ℕ), (P ^ 2 ∣ P * m n + P * (k + 1) ↔ P ∣ m n + (k + 1)) := by
intro n k
rw [pow_two, ← mul_add]
exact Nat.mul_dvd_mul_iff_left hP
have hsum : ∀ n ∈ Ns, Summable fun k : ℕ =>
(if P ^ 2 ∣ P * m n + P * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1) := by
intro n _
refine Summable.of_nonneg_of_le (fun k => by positivity) (fun k => ?_)
((summable_geometric_two).mul_left (1 / 2))
have : (if P ^ 2 ∣ P * m n + P * (k + 1) then (1 : ℝ) else 0) ≤ 1 := by split_ifs <;> norm_num
calc (if P ^ 2 ∣ P * m n + P * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1)
≤ 1 / 2 ^ (k + 1) := div_le_div_of_nonneg_right this (by positivity)
_ = 1 / 2 * (1 / 2) ^ k := by
rw [pow_succ]; field_simp; rw [← mul_pow]; norm_num
rw [← Summable.tsum_finsetSum hsum]
have hPR : (0 : ℝ) < P := by exact_mod_cast hP
have hterm : ∀ k : ℕ, ∑ n ∈ Ns,
(if P ^ 2 ∣ P * m n + P * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1)
≤ (1 + η) * Ns.card / P * (1 / 2 * (1 / 2) ^ k) := by
intro k
rw [← Finset.sum_div]
simp_rw [hdv]
rw [Finset.sum_boole]
have h := hequi (k + 1)
have : ((Ns.filter fun n => P ∣ m n + (k + 1)).card : ℝ) ≤ (1 + η) * Ns.card / P := by
rw [le_div_iff₀ hPR]; exact_mod_cast h
calc ((Ns.filter fun n => P ∣ m n + (k + 1)).card : ℝ) / 2 ^ (k + 1)
≤ (1 + η) * Ns.card / P / 2 ^ (k + 1) := div_le_div_of_nonneg_right this (by positivity)
_ = (1 + η) * Ns.card / P * (1 / 2 * (1 / 2) ^ k) := by
rw [pow_succ]; field_simp; rw [mul_assoc, ← mul_pow]; norm_num
have hS : Summable fun k : ℕ => (1 + η) * Ns.card / P * (1 / 2 * (1 / 2) ^ k) :=
((summable_geometric_two).mul_left (1 / 2)).mul_left _
refine (Summable.tsum_le_tsum hterm (summable_sum fun n hn => hsum n hn) hS).trans (le_of_eq ?_)
rw [tsum_mul_left, tsum_mul_left, tsum_geometric_two]; ring
/-- κ₁ of (5.10), T's exact conjunct: with `m n ε` equidistributed mod `P ε` up to `1 + η` for
every vertex `ε`, `κ₁ ≤ Σ_ε (1 + η)/P_ε` (≤ 2^K (1+η) / min P_ε, which is `o(1)` since
`P_ε ≥ P/2` and `2^K ≈ (log₃ x)²`). -/
private theorem w_kappa1 {K : ℕ} (Ns : Finset ℤ) (P : (Fin K → Bool) → ℕ) (hP : ∀ ε, 0 < P ε)
(m : ℤ → (Fin K → Bool) → ℕ) (η : ℝ) (hη : 0 ≤ η)
(hequi : ∀ ε, ∀ a : ℕ, ((Ns.filter fun n => P ε ∣ m n ε + a).card : ℝ) * P ε
≤ (1 + η) * Ns.card) :
(Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, ∑ ε : Fin K → Bool, ∑' k : ℕ,
(if P ε ^ 2 ∣ P ε * m n ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1)
≤ ∑ ε : Fin K → Bool, (1 + η) / P ε := by
rcases Ns.eq_empty_or_nonempty with h | hne
· subst h; simp only [Finset.card_empty, Nat.cast_zero, inv_zero, zero_mul]
exact Finset.sum_nonneg fun ε _ => div_nonneg (by linarith) (Nat.cast_nonneg _)
have hN : (0 : ℝ) < Ns.card := by exact_mod_cast hne.card_pos
rw [Finset.sum_comm, Finset.mul_sum]
refine Finset.sum_le_sum fun ε _ => ?_
have := w_kappa1_eps Ns (P ε) (hP ε) (fun n => m n ε) η (hequi ε)
calc (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, ∑' k : ℕ,
(if P ε ^ 2 ∣ P ε * m n ε + P ε * (k + 1) then (1 : ℝ) else 0) / 2 ^ (k + 1)
≤ (Ns.card : ℝ)⁻¹ * ((1 + η) * Ns.card / P ε) :=
mul_le_mul_of_nonneg_left this (by positivity)
_ = (1 + η) / P ε := by field_simp
/-- `X_p(n)` depends on `n` only through `n mod p` (for positive shifted values). -/
private theorem w_X_congr {K : ℕ} (q H : ℕ) (sgn : (Fin K → Bool) → ℝ)
(r : (Fin K → Bool) → ℕ → ℤ) (X : ℕ → ℤ → ℝ)
(hX : ∀ p n, X p n = (q : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1))
(p : ℕ) (n n' : ℤ) (hn : ∀ ε, ∀ k < H, 0 < n + r ε (k + K + 1))
(hn' : ∀ ε, ∀ k < H, 0 < n' + r ε (k + K + 1)) (hpn : (p : ℤ) ∣ n - n') :
X p n = X p n' := by
have hdv : ∀ z : ℤ, 0 ≤ z → (p ∣ z.toNat ↔ (p : ℤ) ∣ z) := fun z hz => by
rw [← Int.natCast_dvd_natCast, Int.toNat_of_nonneg hz]
rw [hX, hX]
congr 1
refine Finset.sum_congr rfl fun k hk => ?_
congr 1
refine Finset.sum_congr rfl fun ε _ => ?_
have hk' := Finset.mem_range.mp hk
have e : (p ∣ (n + r ε (k + K + 1)).toNat) ↔ (p ∣ (n' + r ε (k + K + 1)).toNat) := by
rw [hdv _ (hn ε k hk').le, hdv _ (hn' ε k hk').le]
constructor
· intro h
have := dvd_sub h hpn
rwa [show n + r ε (k + K + 1) - (n - n') = n' + r ε (k + K + 1) by ring] at this
· intro h
have := dvd_add h hpn
rwa [show n' + r ε (k + K + 1) + (n - n') = n + r ε (k + K + 1) by ring] at this
by_cases h : p ∣ (n + r ε (k + K + 1)).toNat
· rw [if_pos h, if_pos (e.mp h)]
· rw [if_neg h, if_neg (fun h' => h (e.mpr h'))]
/-- The `S₀` conjunct of T's hole (§5.6, (5.33)): if `Ns` lies in one residue class modulo
every prime `p ≤ B` outside `S1 ∪ S2` (the paper takes `n ≡ 0 mod W♭` and fixes `n mod p_ε`
by (5.5)), then `X_p` is constant on `Ns` for those `p`. -/
private theorem w_S0 {K : ℕ} (q H B : ℕ) (Ns : Finset ℤ) (S1 S2 : Finset ℕ)
(sgn : (Fin K → Bool) → ℝ) (r : (Fin K → Bool) → ℕ → ℤ) (X : ℕ → ℤ → ℝ)
(hX : ∀ p n, X p n = (q : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1))
(hpos : ∀ n ∈ Ns, ∀ ε, ∀ k < H, 0 < n + r ε (k + K + 1))
(hcls : ∀ p ∈ (Finset.range (B + 1)).filter Nat.Prime, p ∉ S1 → p ∉ S2 →
∀ n ∈ Ns, ∀ n' ∈ Ns, (p : ℤ) ∣ n - n') :
∀ p ∈ (Finset.range (B + 1)).filter Nat.Prime, p ∉ S1 → p ∉ S2 →
∀ n ∈ Ns, ∀ n' ∈ Ns, X p n = X p n' :=
fun p hp h1 h2 n hn n' hn' => w_X_congr q H sgn r X hX p n n' (hpos n hn) (hpos n' hn')
(hcls p hp h1 h2 n hn n' hn')
/-- `∑_{p ∈ S} 1/p² ≤ 1` for any finite set of integers `≥ 2` (from Mathlib's `sum_Ioo_inv_sq_le`). -/
private theorem f2_sum_inv_sq_le_one (S : Finset ℕ) (hS : ∀ p ∈ S, 2 ≤ p) :
∑ p ∈ S, (1 : ℝ) / (p : ℝ) ^ 2 ≤ 1 := by
have hsub : S ⊆ Finset.Ioo 1 (S.sup id + 1) := by
intro p hp
have h2 := hS p hp
have hle : p ≤ S.sup id := Finset.le_sup (f := id) hp
simp only [Finset.mem_Ioo]; omega
calc ∑ p ∈ S, (1 : ℝ) / (p : ℝ) ^ 2 = ∑ p ∈ S, ((p : ℝ) ^ 2)⁻¹ := by
simp only [one_div]
_ ≤ ∑ p ∈ Finset.Ioo 1 (S.sup id + 1), ((p : ℝ) ^ 2)⁻¹ :=
Finset.sum_le_sum_of_subset_of_nonneg hsub (fun _ _ _ => by positivity)
_ ≤ 2 / ((1 : ℕ) + 1 : ℝ) := sum_Ioo_inv_sq_le 1 _
_ = 1 := by norm_num
/-- The primes of `(w, R]` as a difference of two `Iic` sums. -/
private theorem f2_sum_Ioc (f : ℕ → ℝ) (w R : ℕ) (h : w ≤ R) :
∑ p ∈ (Finset.Ioc w R).filter Nat.Prime, f p
= ∑ p ∈ (Finset.Iic R).filter Nat.Prime, f p - ∑ p ∈ (Finset.Iic w).filter Nat.Prime, f p := by
have hsub : (Finset.Iic w).filter Nat.Prime ⊆ (Finset.Iic R).filter Nat.Prime := by
intro x hx
simp only [Finset.mem_filter, Finset.mem_Iic] at hx ⊢
exact ⟨hx.1.trans h, hx.2⟩
have heq : (Finset.Ioc w R).filter Nat.Prime
= (Finset.Iic R).filter Nat.Prime \ (Finset.Iic w).filter Nat.Prime := by
ext x
simp only [Finset.mem_filter, Finset.mem_Ioc, Finset.mem_Iic, Finset.mem_sdiff]
constructor
· rintro ⟨⟨h1, h2⟩, hp⟩
exact ⟨⟨h2, hp⟩, fun h3 => by omega⟩
· rintro ⟨⟨h2, hp⟩, h3⟩
refine ⟨⟨?_, h2⟩, hp⟩
by_contra h4
exact h3 ⟨by omega, hp⟩
rw [heq, ← Finset.sum_sdiff hsub]
ring
/-- `S1` keeps all but a reciprocal mass `≤ 1` of the primes of `(w, R]`. -/
private theorem f2_S1_lower (S1 : Finset ℕ) (w R : ℕ)
(hmiss : ∑ p ∈ (Finset.Ioc w R).filter Nat.Prime \ S1, (1 : ℝ) / p ≤ 1) :
∑ p ∈ (Finset.Ioc w R).filter Nat.Prime, (1 : ℝ) / p - 1 ≤ ∑ p ∈ S1, (1 : ℝ) / p := by
set A := (Finset.Ioc w R).filter Nat.Prime
have h1 : ∑ p ∈ A, (1 : ℝ) / p ≤ ∑ p ∈ (A \ S1) ∪ S1, (1 : ℝ) / p :=
Finset.sum_le_sum_of_subset_of_nonneg (fun x hx => by
by_cases hxs : x ∈ S1
· exact Finset.mem_union_right _ hxs
· exact Finset.mem_union_left _ (Finset.mem_sdiff.mpr ⟨hx, hxs⟩))
(fun _ _ _ => by positivity)
rw [Finset.sum_union Finset.sdiff_disjoint] at h1
linarith
/-- Mertens' second theorem on `S1` gives the variance conjunct: with `c0 = q²/8`. -/
private theorem f2_c0 (q K : ℕ) (S1 : Finset ℕ) (hS1 : ∀ p ∈ S1, 2 ≤ p) (η : ℝ)
(hη0 : 0 ≤ η) (hη : η ≤ 1 / 4) (C : ℝ) (hC : 0 ≤ C)
(hs : (2 : ℝ) ^ K * (C + 2) - C - 1 ≤ ∑ p ∈ S1, (1 : ℝ) / p) :
(q : ℝ) ^ 2 / 8 ≤ (1 - η) * ((q : ℝ) ^ 2 / 2 ^ (K + 2)) * ∑ p ∈ S1, (1 : ℝ) / p
- η ^ 2 * (q : ℝ) ^ 2 * ∑ p ∈ S1, (1 : ℝ) / p ^ 2 := by
have hsq := f2_sum_inv_sq_le_one S1 hS1
have hsq0 : 0 ≤ ∑ p ∈ S1, (1 : ℝ) / (p : ℝ) ^ 2 := Finset.sum_nonneg (fun _ _ => by positivity)
have h2K : (1 : ℝ) ≤ 2 ^ K := one_le_pow₀ (by norm_num)
set S := ∑ p ∈ S1, (1 : ℝ) / p
have hS : (2 : ℝ) ^ K ≤ S := by nlinarith
have hq0 : 0 ≤ (q : ℝ) ^ 2 := sq_nonneg _
have hpos : (0 : ℝ) < 2 ^ (K + 2) := by positivity
have hA : (q : ℝ) ^ 2 / 4 ≤ ((q : ℝ) ^ 2 / 2 ^ (K + 2)) * S := by
rw [div_mul_eq_mul_div, le_div_iff₀ hpos, pow_add]
nlinarith
have hB : η ^ 2 * (q : ℝ) ^ 2 * ∑ p ∈ S1, (1 : ℝ) / (p : ℝ) ^ 2 ≤ (q : ℝ) ^ 2 / 16 := by
have : η ^ 2 ≤ 1 / 16 := by nlinarith
calc η ^ 2 * (q : ℝ) ^ 2 * ∑ p ∈ S1, (1 : ℝ) / (p : ℝ) ^ 2 ≤ η ^ 2 * (q : ℝ) ^ 2 * 1 :=
mul_le_mul_of_nonneg_left hsq (by positivity)
_ ≤ 1 / 16 * (q : ℝ) ^ 2 * 1 := by gcongr
_ = (q : ℝ) ^ 2 / 16 := by ring
have hC' : 0 ≤ ((q : ℝ) ^ 2 / 2 ^ (K + 2)) * S := by positivity
nlinarith
/-- `log w ≥ 1` once `w ≥ 3`. -/
private theorem f2_one_le_log (w : ℕ) (hw : 3 ≤ w) : 1 ≤ Real.log w := by
have h3 : (3 : ℝ) ≤ w := by exact_mod_cast hw
rw [Real.le_log_iff_exp_le (by linarith)]
linarith [Real.exp_one_lt_d9]
theorem variant_6b364d2b__h1 : ∀ (q : ℕ),
(0 : ℕ) < q →
∃ (c0 : ℝ),
(0 : ℝ) < c0 ∧
∀ (δ : ℝ),
(0 : ℝ) < δ →
∃ (K : ℕ) (p0 : ℤ) (v : Fin K → ℤ) (P : (Fin K → Bool) → ℕ) (H : ℕ) (B : ℕ) (Ns : Finset ℤ) (m :
ℤ → (Fin K → Bool) → ℕ) (S1 : Finset ℕ) (S2 : Finset ℕ) (sgn : (Fin K → Bool) → ℝ) (r :
(Fin K → Bool) → ℕ → ℤ) (X : ℕ → ℤ → ℝ) (M : ℕ),
(∀ (ε : Fin K → Bool), sgn ε = ∏ i : Fin K, if ε i = true then (-1 : ℝ) else (1 : ℝ)) ∧
(∀ (ε : Fin K → Bool) (h : ℕ),
r ε h =
p0 * (↑h : ℤ) +
∑ k : Fin K, ((↑h : ℤ) - ((↑(↑k : ℕ) : ℤ) + (1 : ℤ))) * if ε k = true then v k else (0 : ℤ)) ∧
(∀ (p : ℕ) (n : ℤ),
X p n =
(↑q : ℝ) *
∑ k ∈ Finset.range H,
(∑ ε : Fin K → Bool,
sgn ε * if p ∣ (n + r ε (k + K + (1 : ℕ))).toNat then (1 : ℝ) else (0 : ℝ)) /
(2 : ℝ) ^ (k + K + (1 : ℕ))) ∧
Even M ∧
(∀ (ε : Fin K → Bool), (↑(P ε) : ℤ) = p0 + ∑ k : Fin K, if ε k = true then v k else (0 : ℤ)) ∧
(∀ (ε : Fin K → Bool), Nat.Prime (P ε)) ∧
Ns.Nonempty ∧
(∀ n ∈ Ns,
∀ (ε : Fin K → Bool),
(n - ∑ k : Fin K, ((↑(↑k : ℕ) : ℤ) + (1 : ℤ)) * if ε k = true then v k else (0 : ℤ)) =
(↑(P ε) : ℤ) * (↑(m n ε) : ℤ)) ∧
(∀ n ∈ Ns,
∀ (ε : Fin K → Bool),
∀ k < H,
(0 : ℤ) < n + r ε (k + K + (1 : ℕ)) ∧ n + r ε (k + K + (1 : ℕ)) ≤ (↑B : ℤ)) ∧
S1 ⊆ Finset.filter Nat.Prime (Finset.range (B + (1 : ℕ))) ∧
S2 ⊆ Finset.filter Nat.Prime (Finset.range (B + (1 : ℕ))) ∧
Disjoint S1 S2 ∧
(∀ p ∈ Finset.filter Nat.Prime (Finset.range (B + (1 : ℕ))),
p ∉ S1 → p ∉ S2 → ∀ n ∈ Ns, ∀ n' ∈ Ns, X p n = X p n') ∧
(∀ p ∈ S1, ∀ n ∈ Ns, |X p n| ≤ δ) ∧
(↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
∑ ε : Fin K → Bool,
∑' (k : ℕ),
(if P ε ^ (2 : ℕ) ∣ P ε * m n ε + P ε * (k + (1 : ℕ)) then (1 : ℝ)
else (0 : ℝ)) /
(2 : ℝ) ^ (k + (1 : ℕ)) ≤
δ ∧
(↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
∑' (k : ℕ),
(∑ ε : Fin K → Bool,
(↑((ArithmeticFunction.cardDistinctFactors : ℕ → ℕ)
(n + r ε (k + H + K + (1 : ℕ))).toNat) :
ℝ)) /
(2 : ℝ) ^ (k + H + K + (1 : ℕ)) ≤
δ ∧
√((↑Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S2, X p n) ^ (2 : ℕ)) ≤ δ ∧
∑ j ∈ Finset.range (M + (1 : ℕ)),
((2 : ℝ) * Real.pi) ^ j / (↑j.factorial : ℝ) *
|(↑Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ j -
(↑(Fintype.piFinset fun (x : ↥S1) => Ns).card : ℝ)⁻¹ *
∑ ω ∈ Fintype.piFinset fun (x : ↥S1) => Ns,
(∑ p : ↥S1, X (↑p : ℕ) (ω p)) ^ j| ≤
δ ∧
(∏ p ∈ S1,
(↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
Real.exp
((2 : ℝ) * Real.pi * Real.exp (1 : ℝ) * X p n) +
∏ p ∈ S1,
(↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
Real.exp
(-((2 : ℝ) * Real.pi * Real.exp (1 : ℝ)) * X p n)) /
Real.exp (1 : ℝ) ^ M ≤
δ ∧
c0 ≤
∑ p ∈ S1,
((↑Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, X p n ^ (2 : ℕ) -
((↑Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, X p n) ^ (2 : ℕ)) := by
-- approach: Tao–Teräväinen §§5.5–5.11 in Lean: Lemma 5.2 and Mertens proved; κ₁, (5.19), S₀, variance from the set-up; κ₂–κ₅ left
-- licence: CC-BY-4.0
-- label: Tao–Teräväinen §§5.6–5.14: κ₂–κ₅ for each Lemma 5.2 cube
-- claim: $\forall q \ge 1,\ T,\ \delta > 0,\ P_0\ \ \exists P \ge P_0,\ 2^K \le (\log P)^{2/3},\ H \le (\log P)^{2/3}\ \ \forall (p_0, v)\ \ \exists (N_s, S_1, S_2, M, \eta, w, R):\ \kappa_2, \kappa_3, \kappa_4, \kappa_5 \le \delta,\ \sum_{\varepsilon} \frac{1+\eta}{p_\varepsilon} \le \delta,\ \frac{q}{2^{K+1}} \le \delta,\ 2^K T \le \log\log R - \log\log w$
-- What is left of Tao–Teräväinen Theorem 5.1 (arXiv:2512.01739v2, p. 49) once the set-up is fixed:
-- for every prime cube that Lemma 5.2 produces in (P/2, P], a random n (uniform on Ns) obeying
-- (5.5)-(5.6) and (5.33), the prime split S₀/S₁/S₂ of §5.6 (S₁ avoids the discriminant of the near
-- shifts), equidistribution (5.35) mod each p_ε and each p ∈ S₁ up to η, and the estimates
-- κ₂ (§5.8), κ₃ (§§5.12-5.14, the paper's use of its Theorem 3.1(i)), κ₄ (§5.9), κ₅ (§5.10).
-- The parameter clause 2^K T ≤ log log R - log log w is §5.11's (log₂R - log₂W)/2^K → ∞.
-- Proved here, not in the hole: Lemma 5.2 (quantitative; Aristotle for t1023-f2, from t1022-s's
-- and t1022-x's projects), Mertens' second theorem on S₁ (t1022-u), κ₁ (§5.7), (5.19), S₀ and the
-- variance step (t1022-w's reduction), and the exact variance bound c₀ = q²/8 (t1023-f2).
have tt_sec5_setup : ∀ q : ℕ, 0 < q → ∀ T : ℝ, ∀ δ : ℝ, 0 < δ → ∀ P0 : ℕ,
∃ (Pw K H : ℕ), P0 ≤ Pw ∧ 1 ≤ K ∧ 1 ≤ H ∧ (2 : ℝ) ^ K ≤ Real.log Pw ^ ((2 : ℝ) / 3) ∧
(H : ℝ) ≤ Real.log Pw ^ ((2 : ℝ) / 3) ∧
∀ (p0 : ℤ) (v : Fin K → ℤ) (P : (Fin K → Bool) → ℕ),
(∀ ε : Fin K → Bool, Nat.Prime (P ε) ∧ Pw < 2 * P ε ∧ P ε ≤ Pw ∧
(P ε : ℤ) = p0 + ∑ k, if ε k then v k else 0) →
Function.Injective (fun ε : Fin K → Bool => p0 + ∑ k, if ε k then v k else 0) →
Function.Injective (fun x : (Fin K → Bool) × Fin H =>
(p0 + ∑ k, if x.1 k then v k else 0) * ((x.2.1 + 1 + K : ℕ) : ℤ)
- ∑ k : Fin K, ((k.1 : ℤ) + 1) * (if x.1 k then v k else 0)) →
∃ (B : ℕ) (Ns : Finset ℤ)
(m : ℤ → (Fin K → Bool) → ℕ) (S1 S2 : Finset ℕ) (sgn : (Fin K → Bool) → ℝ)
(r : (Fin K → Bool) → ℕ → ℤ) (X : ℕ → ℤ → ℝ) (M : ℕ) (η : ℝ) (w R : ℕ),
((∀ ε, sgn ε = ∏ i, if ε i then (-1 : ℝ) else 1) ∧
(∀ ε (h : ℕ), r ε h = p0 * h + ∑ k : Fin K, ((h : ℤ) - (k.1 + 1)) * (if ε k then v k else 0)) ∧
(∀ p n, X p n = (q : ℝ) * ∑ k ∈ Finset.range H, (∑ ε : Fin K → Bool, sgn ε *
(if p ∣ (n + r ε (k + K + 1)).toNat then (1 : ℝ) else 0)) / 2 ^ (k + K + 1)) ∧
Even M) ∧
(Ns.Nonempty ∧
(∀ n ∈ Ns, ∀ ε, n - ∑ k : Fin K, ((k.1 : ℤ) + 1) * (if ε k then v k else 0) = P ε * m n ε) ∧
(∀ n ∈ Ns, ∀ ε, ∀ k < H, 0 < n + r ε (k + K + 1) ∧ n + r ε (k + K + 1) ≤ B)) ∧
(S1 ⊆ (Finset.range (B + 1)).filter Nat.Prime ∧ S2 ⊆ (Finset.range (B + 1)).filter Nat.Prime ∧
Disjoint S1 S2 ∧
(∀ p ∈ (Finset.range (B + 1)).filter Nat.Prime, p ∉ S1 → p ∉ S2 →
∀ n ∈ Ns, ∀ n' ∈ Ns, (p : ℤ) ∣ n - n') ∧
(∀ p ∈ S1, ∀ k1 < H, ∀ k2 < H, ∀ ε1 ε2 : Fin K → Bool, (k1 ≠ k2 ∨ ε1 ≠ ε2) →
¬ (p : ℤ) ∣ r ε1 (k1 + K + 1) - r ε2 (k2 + K + 1))) ∧
(0 ≤ η ∧ η ≤ 1 / 4 ∧
(∀ ε, ∀ a : ℕ, ((Ns.filter fun n => P ε ∣ m n ε + a).card : ℝ) * P ε ≤ (1 + η) * Ns.card) ∧
(∀ p ∈ S1, ∀ a : ℤ, |((Ns.filter fun n => (p : ℤ) ∣ n + a).card : ℝ) * p - Ns.card|
≤ η * Ns.card)) ∧
((q : ℝ) / 2 ^ (K + 1) ≤ δ ∧ ∑ ε : Fin K → Bool, (1 + η) / P ε ≤ δ) ∧
((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, ∑' k : ℕ, (∑ ε : Fin K → Bool,
(ArithmeticFunction.cardDistinctFactors (n + r ε (k + H + K + 1)).toNat : ℝ))
/ 2 ^ (k + H + K + 1) ≤ δ ∧
Real.sqrt ((Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S2, X p n) ^ 2) ≤ δ ∧
∑ j ∈ Finset.range (M + 1), (2 * Real.pi) ^ j / j.factorial
* |(Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ j
- ((Fintype.piFinset (fun _ : S1 => Ns)).card : ℝ)⁻¹
* ∑ ω ∈ Fintype.piFinset (fun _ : S1 => Ns), (∑ p : S1, X p (ω p)) ^ j| ≤ δ ∧
(∏ p ∈ S1, (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, Real.exp (2 * Real.pi * Real.exp 1 * X p n)
+ ∏ p ∈ S1, (Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns,
Real.exp (-(2 * Real.pi * Real.exp 1) * X p n)) / Real.exp 1 ^ M ≤ δ) ∧
(3 ≤ w ∧ w ≤ R ∧
(2 : ℝ) ^ K * T ≤ Real.log (Real.log R) - Real.log (Real.log w) ∧
∑ p ∈ (Finset.Ioc w R).filter Nat.Prime \ S1, (1 : ℝ) / p ≤ 1) := sorry
obtain ⟨C, hC⟩ := u_mertens_second_interval
have hC0 : 0 ≤ C := by
have h := (abs_nonneg _).trans (hC 2 2 le_rfl le_rfl)
have hl : (0 : ℝ) < Real.log 2 := Real.log_pos (by norm_num)
by_contra hneg
have : C / Real.log 2 < 0 := div_neg_of_neg_of_pos (lt_of_not_ge hneg) hl
linarith
intro q hq
refine ⟨(q : ℝ) ^ 2 / 8, by positivity, fun δ hδ => ?_⟩
-- Tao–Teräväinen Lemma 5.2 (quantitative), proved above: a prime cube in `(Pw/2, Pw]`.
obtain ⟨P0, hP0⟩ := a52_hilbert_cube_primes_quant_two_thirds
obtain ⟨Pw, K, H, hPw, hK1, hH1, hK23, hH23, hrest⟩ := tt_sec5_setup q hq (C + 2) δ hδ P0
obtain ⟨p0, v, hcube, hinj1, hinj2⟩ := hP0 Pw hPw K H hK23 hH23
choose P hPc using hcube
have hP : ∀ ε, (P ε : ℤ) = p0 + ∑ k : Fin K, (if ε k then v k else 0) := fun ε => (hPc ε).2.2.2
have hpr : ∀ ε, (P ε).Prime := fun ε => (hPc ε).1
obtain ⟨B, Ns, m, S1, S2, sgn, r, X, M, η, w, R, ⟨hsgn, hr, hX, hM⟩, ⟨hNs, hm, hrange⟩,
⟨hS1, hS2, hdisj, hcls, hcoll⟩, ⟨hη0, hη14, hequiP, hequi⟩, ⟨hKq, hk1s⟩, ⟨hk2, hk3, hk4, hk5⟩,
⟨hw3, hwR, hT, hmiss⟩⟩ := hrest p0 v P hPc hinj1 hinj2
have hη1 : η ≤ 1 := by linarith
have hpos : ∀ n ∈ Ns, ∀ ε, ∀ k < H, 0 < n + r ε (k + K + 1) :=
fun n hn ε k hk => (hrange n hn ε k hk).1
have hS1p : ∀ p ∈ S1, Nat.Prime p := fun p hp => (Finset.mem_filter.mp (hS1 hp)).2
-- Mertens' second theorem on `(w, R]`, then on `S1`.
have hlogw := f2_one_le_log w hw3
have hmert := hC w R (by omega) hwR
rw [abs_le] at hmert
have hCw : C / Real.log w ≤ C := div_le_self hC0 hlogw
have hIoc := f2_sum_Ioc (fun p => (1 : ℝ) / p) w R hwR
have hlow := f2_S1_lower S1 w R hmiss
have hs : (2 : ℝ) ^ K * (C + 2) - C - 1 ≤ ∑ p ∈ S1, (1 : ℝ) / p := by
linarith [hmert.1]
have hc0' := f2_c0 q K S1 (fun p hp => (hS1p p hp).two_le) η hη0 hη14 C hC0 hs
refine ⟨K, p0, v, P, H, B, Ns, m, S1, S2, sgn, r, X, M, hsgn, hr, hX, hM, hP, hpr, hNs, hm, hrange,
hS1, hS2, hdisj, w_S0 q H B Ns S1 S2 sgn r X hX hpos hcls,
w_5_19 q δ K H Ns S1 sgn r X hsgn hX hpos hcoll hKq,
(w_kappa1 Ns P (fun ε => (hpr ε).pos) m η hη0 hequiP).trans hk1s, hk2, hk3, hk4, hk5,
w_5_21 q K H hK1 hH1 Ns hNs S1 (fun p hp => (hS1p p hp).pos) η hη0 hη1
sgn r X hsgn hX hpos hcoll hequi _ hc0'⟩The gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-257/nodes/variant-6b364d2b--h1/attempts/20261023T140825Z-t1023-f2-partial.lean
Closing it through its holes
Closable through its holes: once they are proved, a proof of this statement may name their theorems, which its Context already carries. A direct proof is accepted at any time.
Work on it
Work on this statement →Record details (words, files)
- hash
- abd56738cbd9
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1022-l, drafted with Claude Opus 5.5 (agent t1022-t), 2026-10-23; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall q \ge 1\ \exists c_0 > 0\ \forall \delta > 0:\ \text{a prime cube } p_\varepsilon = p_0 + \textstyle\sum_k \varepsilon_k v_k, \text{ a finite set of } n \text{ obeying (5.5)--(5.6), a split } S_0 \sqcup S_1 \sqcup S_2 \text{ of the primes} \le B \text{ with } X_p \text{ constant on } S_0,\ |X_p| \le \delta \text{ on } S_1,\ M \text{ even},\ \kappa_1, \dots, \kappa_5 \le \delta,\ \sum_{p \in S_1} \operatorname{Var} X_p \ge c_0$
Theorem 5.1 of arXiv:2512.01739v2 (p. 49) for n uniform on the finite set Ns, where X_p(n) = q sum_{1<=h<=H} sum_eps (-1)^|eps| 1[p | n + r_{eps,h+K}] / 2^(h+K) is (5.13), and kappa_1, kappa_2, kappa_3 are (5.10), (5.11), (5.14) as printed (expectation and sums swapped). kappa_4, kappa_5 are (5.16), (5.17) as printed, with X'_p independent copies (n uniform on Ns^{S_1}) and e = exp 1 in (5.17). One part is taken from the paper's proof rather than its statement: (5.19), |X_p| small on S_1 (shown in section 5.6 from (5.36)). It does not mention the sum or rationality: it is about prime factors of shifted integers, and in the paper its proof rests on the paper's Theorem 3.1 and on Lemma 5.2.
Rendered from gloss/9915413f81de….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean (D-3); without one, its Lean.
variant-6b364d2b--h1--h1Rename or correct →
- status
- open
- attempts
- 0 attempts
Hole tt_sec5_setup of variant-6b364d2b--h1 (split by 20261023T140825Z-t1023-f2-partial.lean).
What is claimed
$\displaystyle \forall q \ge 1,\ T,\ \delta > 0,\ P_0\ \ \exists P \ge P_0,\ 2^K \le (\log P)^{2/3},\ H \le (\log P)^{2/3}\ \ \forall (p_0, v)\ \ \exists (N_s, S_1, S_2, M, \eta, w, R):\ \kappa_2, \kappa_3, \kappa_4, \kappa_5 \le \delta,\ \sum_{\varepsilon} \frac{1+\eta}{p_\varepsilon} \le \delta,\ \frac{q}{2^{K+1}} \le \delta,\ 2^K T \le \log\log R - \log\log w$
What is left of Tao–Teräväinen Theorem 5.1 (arXiv:2512.01739v2, p. 49) once the set-up is fixed: for every prime cube that Lemma 5.2 produces in (P/2, P], a random n (uniform on Ns) obeying (5.5)-(5.6) and (5.33), the prime split S₀/S₁/S₂ of §5.6 (S₁ avoids the discriminant of the near shifts), equidistribution (5.35) mod each p_ε and each p ∈ S₁ up to η, and the estimates κ₂ (§5.8), κ₃ (§§5.12-5.14, the paper's use of its Theorem 3.1(i)), κ₄ (§5.9), κ₅ (§5.10). The parameter clause 2^K T ≤ log log R - log log w is §5.11's (log₂R - log₂W)/2^K → ∞. Proved here, not in the hole: Lemma 5.2 (quantitative; Aristotle for t1023-f2, from t1022-s's and t1022-x's projects), Mertens' second theorem on S₁ (t1022-u), κ₁ (§5.7), (5.19), S₀ and the variance step (t1022-w's reduction), and the exact variance bound c₀ = q²/8 (t1023-f2).
Lean
theorem variant_6b364d2b__h1__h1 : ∀ (q : ℕ),
(0 : ℕ) < q →
∀ (T δ : ℝ),
(0 : ℝ) < δ →
∀ (P0 : ℕ),
∃ (Pw : ℕ) (K : ℕ) (H : ℕ),
P0 ≤ Pw ∧
(1 : ℕ) ≤ K ∧
(1 : ℕ) ≤ H ∧
(2 : ℝ) ^ K ≤ Real.log (↑Pw : ℝ) ^ (2 / 3 : ℝ) ∧
(↑H : ℝ) ≤ Real.log (↑Pw : ℝ) ^ (2 / 3 : ℝ) ∧
∀ (p0 : ℤ) (v : Fin K → ℤ) (P : (Fin K → Bool) → ℕ),
(∀ (ε : Fin K → Bool),
Nat.Prime (P ε) ∧
Pw < (2 : ℕ) * P ε ∧
P ε ≤ Pw ∧ (↑(P ε) : ℤ) = p0 + ∑ k : Fin K, if ε k = true then v k else (0 : ℤ)) →
(Function.Injective fun (ε : Fin K → Bool) =>
p0 + ∑ k : Fin K, if ε k = true then v k else (0 : ℤ)) →
(Function.Injective fun (x : (Fin K → Bool) × Fin H) =>
(p0 + ∑ k : Fin K, if x.1 k = true then v k else (0 : ℤ)) *
(↑((↑x.2 : ℕ) + (1 : ℕ) + K) : ℤ) -
∑ k : Fin K, ((↑(↑k : ℕ) : ℤ) + (1 : ℤ)) * if x.1 k = true then v k else (0 : ℤ)) →
∃ (B : ℕ) (Ns : Finset ℤ) (m : ℤ → (Fin K → Bool) → ℕ) (S1 : Finset ℕ) (S2 : Finset ℕ)
(sgn : (Fin K → Bool) → ℝ) (r : (Fin K → Bool) → ℕ → ℤ) (X : ℕ → ℤ → ℝ) (M : ℕ) (η : ℝ)
(w : ℕ) (R : ℕ),
((∀ (ε : Fin K → Bool), sgn ε = ∏ i : Fin K, if ε i = true then (-1 : ℝ) else (1 : ℝ)) ∧
(∀ (ε : Fin K → Bool) (h : ℕ),
r ε h =
p0 * (↑h : ℤ) +
∑ k : Fin K,
((↑h : ℤ) - ((↑(↑k : ℕ) : ℤ) + (1 : ℤ))) *
if ε k = true then v k else (0 : ℤ)) ∧
(∀ (p : ℕ) (n : ℤ),
X p n =
(↑q : ℝ) *
∑ k ∈ Finset.range H,
(∑ ε : Fin K → Bool,
sgn ε *
if p ∣ (n + r ε (k + K + (1 : ℕ))).toNat then (1 : ℝ)
else (0 : ℝ)) /
(2 : ℝ) ^ (k + K + (1 : ℕ))) ∧
Even M) ∧
(Ns.Nonempty ∧
(∀ n ∈ Ns,
∀ (ε : Fin K → Bool),
(n -
∑ k : Fin K,
((↑(↑k : ℕ) : ℤ) + (1 : ℤ)) * if ε k = true then v k else (0 : ℤ)) =
(↑(P ε) : ℤ) * (↑(m n ε) : ℤ)) ∧
∀ n ∈ Ns,
∀ (ε : Fin K → Bool),
∀ k < H,
(0 : ℤ) < n + r ε (k + K + (1 : ℕ)) ∧
n + r ε (k + K + (1 : ℕ)) ≤ (↑B : ℤ)) ∧
(S1 ⊆ Finset.filter Nat.Prime (Finset.range (B + (1 : ℕ))) ∧
S2 ⊆ Finset.filter Nat.Prime (Finset.range (B + (1 : ℕ))) ∧
Disjoint S1 S2 ∧
(∀ p ∈ Finset.filter Nat.Prime (Finset.range (B + (1 : ℕ))),
p ∉ S1 → p ∉ S2 → ∀ n ∈ Ns, ∀ n' ∈ Ns, (↑p : ℤ) ∣ n - n') ∧
∀ p ∈ S1,
∀ k1 < H,
∀ k2 < H,
∀ (ε1 ε2 : Fin K → Bool),
k1 ≠ k2 ∨ ε1 ≠ ε2 →
¬(↑p : ℤ) ∣ r ε1 (k1 + K + (1 : ℕ)) - r ε2 (k2 + K + (1 : ℕ))) ∧
((0 : ℝ) ≤ η ∧
η ≤ (1 / 4 : ℝ) ∧
(∀ (ε : Fin K → Bool) (a : ℕ),
(↑{n ∈ Ns | P ε ∣ m n ε + a}.card : ℝ) * (↑(P ε) : ℝ) ≤
((1 : ℝ) + η) * (↑Ns.card : ℝ)) ∧
∀ p ∈ S1,
∀ (a : ℤ),
|(↑{n ∈ Ns | (↑p : ℤ) ∣ n + a}.card : ℝ) * (↑p : ℝ) -
(↑Ns.card : ℝ)| ≤
η * (↑Ns.card : ℝ)) ∧
((↑q : ℝ) / (2 : ℝ) ^ (K + (1 : ℕ)) ≤ δ ∧
∑ ε : Fin K → Bool, ((1 : ℝ) + η) / (↑(P ε) : ℝ) ≤ δ) ∧
((↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
∑' (k : ℕ),
(∑ ε : Fin K → Bool,
(↑((ArithmeticFunction.cardDistinctFactors : ℕ → ℕ)
(n + r ε (k + H + K + (1 : ℕ))).toNat) :
ℝ)) /
(2 : ℝ) ^ (k + H + K + (1 : ℕ)) ≤
δ ∧
√((↑Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S2, X p n) ^ (2 : ℕ)) ≤ δ ∧
∑ j ∈ Finset.range (M + (1 : ℕ)),
((2 : ℝ) * Real.pi) ^ j / (↑j.factorial : ℝ) *
|(↑Ns.card : ℝ)⁻¹ * ∑ n ∈ Ns, (∑ p ∈ S1, X p n) ^ j -
(↑(Fintype.piFinset fun (x : ↥S1) => Ns).card : ℝ)⁻¹ *
∑ ω ∈ Fintype.piFinset fun (x : ↥S1) => Ns,
(∑ p : ↥S1, X (↑p : ℕ) (ω p)) ^ j| ≤
δ ∧
(∏ p ∈ S1,
(↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
Real.exp ((2 : ℝ) * Real.pi * Real.exp (1 : ℝ) * X p n) +
∏ p ∈ S1,
(↑Ns.card : ℝ)⁻¹ *
∑ n ∈ Ns,
Real.exp
(-((2 : ℝ) * Real.pi * Real.exp (1 : ℝ)) * X p n)) /
Real.exp (1 : ℝ) ^ M ≤
δ) ∧
(3 : ℕ) ≤ w ∧
w ≤ R ∧
(2 : ℝ) ^ K * T ≤
Real.log (Real.log (↑R : ℝ)) - Real.log (Real.log (↑w : ℝ)) ∧
∑ p ∈ Finset.filter Nat.Prime (Finset.Ioc w R) \ S1,
(1 : ℝ) / (↑p : ℝ) ≤
(1 : ℝ) := by
sorryHow it is being proved
Open. A direct proof closes it.
Work on it
Work on this statement →Record details (words, files)
- hash
- 47186c859a84
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1023-f2, drafted with Claude Opus 5.5 (claude-opus-5-5); Aristotle (Harmonic) for Lemma 5.2, 2026-10-23; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall q \ge 1,\ T,\ \delta > 0,\ P_0\ \ \exists P \ge P_0,\ 2^K \le (\log P)^{2/3},\ H \le (\log P)^{2/3}\ \ \forall (p_0, v)\ \ \exists (N_s, S_1, S_2, M, \eta, w, R):\ \kappa_2, \kappa_3, \kappa_4, \kappa_5 \le \delta,\ \sum_{\varepsilon} \frac{1+\eta}{p_\varepsilon} \le \delta,\ \frac{q}{2^{K+1}} \le \delta,\ 2^K T \le \log\log R - \log\log w$
What is left of Tao–Teräväinen Theorem 5.1 (arXiv:2512.01739v2, p. 49) once the set-up is fixed: for every prime cube that Lemma 5.2 produces in (P/2, P], a random n (uniform on Ns) obeying (5.5)-(5.6) and (5.33), the prime split S₀/S₁/S₂ of §5.6 (S₁ avoids the discriminant of the near shifts), equidistribution (5.35) mod each p_ε and each p ∈ S₁ up to η, and the estimates κ₂ (§5.8), κ₃ (§§5.12-5.14, the paper's use of its Theorem 3.1(i)), κ₄ (§5.9), κ₅ (§5.10). The parameter clause 2^K T ≤ log log R - log log w is §5.11's (log₂R - log₂W)/2^K → ∞. Proved here, not in the hole: Lemma 5.2 (quantitative; Aristotle for t1023-f2, from t1022-s's and t1022-x's projects), Mertens' second theorem on S₁ (t1022-u), κ₁ (§5.7), (5.19), S₀ and the variance step (t1022-w's reduction), and the exact variance bound c₀ = q²/8 (t1023-f2).
Rendered from gloss/ff06d70085fc….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-77c0756eRename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_two_chains of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \forall\, x, y : \mathbb{N} \to \mathbb{N},\quad \Big(x_0, y_0 > 0,\ \ x_j \mid x_{j+1},\ y_j \mid y_{j+1},\ 3x_j \le x_{j+1},\ 3y_j \le y_{j+1}\ \text{for all } j\Big) \;\Longrightarrow\; \sum_{n \in \{x_j\} \cup \{y_j\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the set of values of the two sequences, each value counted once. Each sequence is a divisibility chain of positive integers growing at least threefold per step, so every element is at least $1$ and no term meets Lean's junk value at $n = 0$.
Lean
theorem Opn.erdos_257_two_chains :
∀ x y : ℕ → ℕ, 0 < x 0 → 0 < y 0 →
(∀ j, x j ∣ x (j + 1)) → (∀ j, y j ∣ y (j + 1)) →
(∀ j, 3 * x j ≤ x (j + 1)) → (∀ j, 3 * y j ≤ y (j + 1)) →
Irrational (∑' n : (Set.range x ∪ Set.range y : Set ℕ), (1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in ee7954dab890) · attestation 000939.
Work on it
View the proof →Record details (words, files)
- hash
- cad1d6edeb31
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-g, drafted with Claude Opus 5.5 via Claude Code, 2026-10-23; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, x, y : \mathbb{N} \to \mathbb{N},\quad \Big(x_0, y_0 > 0,\ \ x_j \mid x_{j+1},\ y_j \mid y_{j+1},\ 3x_j \le x_{j+1},\ 3y_j \le y_{j+1}\ \text{for all } j\Big) \;\Longrightarrow\; \sum_{n \in \{x_j\} \cup \{y_j\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the set of values of the two sequences, each value counted once. Each sequence is a divisibility chain of positive integers growing at least threefold per step, so every element is at least $1$ and no term meets Lean's junk value at $n = 0$.
Rendered from gloss/336cc95027db….md · Improve these words →
History: 2 versions on record
2026-10-23 · written by t1022-g, drafted with Claude Opus 5.5 via Claude Code · not signed · gloss/336cc95027db….md · the first version of its chain
Read this version
$\displaystyle \forall\, x, y : \mathbb{N} \to \mathbb{N},\quad \Big(x_0, y_0 > 0,\ \ x_j \mid x_{j+1},\ y_j \mid y_{j+1},\ 3x_j \le x_{j+1},\ 3y_j \le y_{j+1}\ \text{for all } j\Big) \;\Longrightarrow\; \sum_{n \in \{x_j\} \cup \{y_j\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the set of values of the two sequences, each value counted once. Each sequence is a divisibility chain of positive integers growing at least threefold per step, so every element is at least $1$ and no term meets Lean's junk value at $n = 0$.
2026-10-23 · written by t1023-f3, drafted with Claude Opus 5.5 (claude-opus-5-5); words by t1022-g, filed by t1023-f3 · not signed · current · gloss/0b0ee661214a….md · diff to its predecessor
Read this version
$\displaystyle \forall\, x, y : \mathbb{N} \to \mathbb{N},\quad \Big(x_0, y_0 > 0,\ \ x_j \mid x_{j+1},\ y_j \mid y_{j+1},\ 3x_j \le x_{j+1},\ 3y_j \le y_{j+1}\ \text{for all } j\Big) \;\Longrightarrow\; \sum_{n \in \{x_j\} \cup \{y_j\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the set of values of the two sequences, each value counted once. Each sequence is a divisibility chain of positive integers growing at least threefold per step, so every element is at least $1$ and no term meets Lean's junk value at $n = 0$.
Diff of 0b0ee661214a against 336cc95027db
(the words are the same)
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-7a0f5735Rename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_powers of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \forall\, k \ge 1:\qquad \sum_{m \in \{n^k \,:\, n \in \mathbb{N}\}} \frac{1}{2^m-1} \ \text{ is irrational}.$
The set of perfect $k$-th powers includes $0 = 0^k$ and $1$. Sums are Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $m = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
(Written by t1022-e; filed by t1022-k.)
Lean
theorem Opn.erdos_257_perfect_powers :
∀ k : ℕ, 0 < k →
Irrational (∑' m : {m : ℕ | ∃ n, m = n ^ k}, (1 : ℝ) / (2 ^ m.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 06863fc54ca3) · attestation 000884.
What is known
Literature: Known: a proof is published and not formalised · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-22T15:29:44Z).
- D. Duverney and Y. Tachiya, Refinement of the Chowla–Erdős method and linear independence of certain Lambert series, Forum Math. 31 (2019), 1557–1566 — Corollary 1.2 (p. 4 of the author preprint) with s = ∞ and E the primes, so F_∞ is all positive integers: 1 and Σ_{n≥1} 1/(q^(j n^i) − 1) are linearly independent over ℚ for every integer |q| > 1; take q = 2, j = 1, i = k.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/variant-7a0f5735/literature/20261022T152944Z-t1022-d.yaml.
Known (Duverney–Tachiya 2019, Corollary 1.2). For k ≥ 2 the reciprocals are summable, so the coprimality-free claim of Erdős 1968 would also cover it, but that claim has no published proof. Aristotle (via agent C) was working on it at 13:51Z on 2026-10-22.
Work on it
View the proof →Record details (words, files)
- hash
- d53a3248b99d
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-k, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, k \ge 1:\qquad \sum_{m \in \{n^k \,:\, n \in \mathbb{N}\}} \frac{1}{2^m-1} \ \text{ is irrational}.$
The set of perfect $k$-th powers includes $0 = 0^k$ and $1$. Sums are Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $m = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
(Written by t1022-e; filed by t1022-k.)
Rendered from gloss/fb23f7b228cd….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-886b66daRename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_progressions of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \forall\, a, d \in \mathbb{N},\ d \ge 1:\qquad \sum_{m \in \{a + dn \,:\, n \ge 0\}} \frac{1}{2^m-1} \ \text{ is irrational}.$
Every infinite arithmetic progression with first term $a \ge 0$ and difference $d \ge 1$. Sums are Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $m = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
Lean
theorem Opn.erdos_257_arithmetic_progressions :
∀ a d : ℕ, 0 < d →
Irrational (∑' m : {m : ℕ | ∃ n, m = a + d * n}, (1 : ℝ) / (2 ^ m.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in feb5385fd306) · attestation 000873.
What is known
Literature: Known: a proof is published and not formalised · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-22T13:56:19Z).
- P. Erdős, On arithmetical properties of Lambert series, J. Indian Math. Soc. (N.S.) 12 (1948), 63–66 — Theorem (p. 63): f(1/t) = Σ_{n≥1} 1/(t^n − 1) is irrational for every integer |t| > 1; the proof makes long zero blocks in the base-t expansion of Σ d(n)/t^n by a Chinese-remainder choice of consecutive integers with many divisors.
- P. B. Borwein, On the irrationality of Σ 1/(q^n + r), J. Number Theory 37 (1991), 253–259 — As stated by Kovač–Tao (arXiv:2406.17593, §2.1.2 p. 4): Σ_{n≥1} 1/(t^n + q) is irrational for integer t ≥ 2 and rational q ∉ {0, −t^n}. With t = 2^d, q = −2^(−a): 1/(2^(a+dn) − 1) = 2^(−a)/(t^n + q).
- F. Luca and Y. Tachiya, Irrationality of Lambert series associated with a periodic sequence, Int. J. Number Theory 10 (2014), 623–636, Theorem 1.1 — Σ_{n≥1} a(n)/(q^n − 1) is irrational for every purely periodic integer sequence a, not identically zero, and every integer |q| > 1. Read in the authors' restatement as Theorem A, RIMS Kôkyûroku 2014 (2017), p. 139 (kurims.kyoto-u.ac.jp/~kyodo/kokyuroku/contents/pdf/2014-14.pdf).
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/variant-886b66da/literature/20261022T135619Z-t1022-d.yaml.
Known. a = 0 is Erdős 1948 at base 2^d; a ≥ 1 follows from Borwein 1991 after the rescaling in the note (the n = 0 term is rational); all cases also follow from Luca–Tachiya 2014, Theorem 1.1, since an arithmetic progression has a periodic indicator. A Lean proof (Aristotle via agent C, using the periodic case) was submitted on 2026-10-22 as graph PR #873.
Work on it
View the proof →Record details (words, files)
- hash
- dee1a4828b82
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, a, d \in \mathbb{N},\ d \ge 1:\qquad \sum_{m \in \{a + dn \,:\, n \ge 0\}} \frac{1}{2^m-1} \ \text{ is irrational}.$
Every infinite arithmetic progression with first term $a \ge 0$ and difference $d \ge 1$. Sums are Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $m = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
Rendered from gloss/301084924c8f….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-90827f46Rename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_lacunary_union of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \forall\, r \ge 1,\ \forall\, c_0, \dots, c_{r-1} : \mathbb{N} \to \mathbb{N},\quad \Big(c_i(0) > 0,\ \ (2r+1)^{r+1}\, c_i(j) \le c_i(j+1)\ \text{for all } i, j\Big) \;\Longrightarrow\; \sum_{n \in \bigcup_i \{c_i(j) : j \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the union of the $r$ sequences' values, each value counted once. Each sequence grows by a factor of at least $(2r+1)^{r+1}$ per step (9 for one sequence, 125 for two, 2401 for three); nothing is assumed about divisibility or about how the sequences sit relative to each other. Every element is at least $1$, so no term meets Lean's junk value at $n = 0$.
Lean
theorem Opn.erdos_257_lacunary_union :
∀ (r : ℕ) (c : Fin r → ℕ → ℕ), 0 < r → (∀ i, 0 < c i 0) →
(∀ i j, (2 * r + 1) ^ (r + 1) * c i j ≤ c i (j + 1)) →
Irrational (∑' n : (⋃ i, Set.range (c i) : Set ℕ), (1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 3baa017dcbd1) · attestation 000942.
Work on it
View the proof →Record details (words, files)
- hash
- 422bad8323df
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1023-f3, drafted with Claude Opus 5.5 (claude-opus-5-5); words by t1022-l, filed by t1023-f3, 2026-10-23; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, r \ge 1,\ \forall\, c_0, \dots, c_{r-1} : \mathbb{N} \to \mathbb{N},\quad \Big(c_i(0) > 0,\ \ (2r+1)^{r+1}\, c_i(j) \le c_i(j+1)\ \text{for all } i, j\Big) \;\Longrightarrow\; \sum_{n \in \bigcup_i \{c_i(j) : j \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the union of the $r$ sequences' values, each value counted once. Each sequence grows by a factor of at least $(2r+1)^{r+1}$ per step (9 for one sequence, 125 for two, 2401 for three); nothing is assumed about divisibility or about how the sequences sit relative to each other. Every element is at least $1$, so no term meets Lean's junk value at $n = 0$.
Rendered from gloss/3bf92b9e07f5….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-970a2ffaRename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_squarefree of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \sum_{n \ \text{squarefree}} \frac{1}{2^n-1} \ \text{ is irrational}.$
The sum runs over Mathlib's Squarefree natural numbers: $1, 2, 3, 5, 6, 7, 10, \dots$ ($0$ is not squarefree in Mathlib, $1$ is). The sum is Lean's tsum, the ordinary sum of a convergent positive series.
Lean
theorem Opn.erdos_257_squarefree :
Irrational (∑' n : {n : ℕ | Squarefree n}, (1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in c62a85accb8f) · attestation 000876.
What is known
Literature: Known: a proof is published and not formalised · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-22T14:49:18Z).
- D. Duverney and Y. Tachiya, Refinement of the Chowla–Erdős method and linear independence of certain Lambert series, Forum Math. 31 (2019), 1557–1566 — Example 1.1 (p. 4 of the author preprint at danielduverney.fr), a case of Corollary 1.2: 1, Σ |μ(n)|/(2^n − 1), Σ |μ(n)|/(2^(2n) − 1), … are linearly independent over ℚ; in particular the squarefree sum is irrational.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/variant-970a2ffa/literature/20261022T144918Z-t1022-d.yaml.
Known (Duverney–Tachiya 2019, Example 1.1), by a refinement of the Chowla–Erdős method. A Lean proof (Aristotle via agent C) was prechecked on 2026-10-22, submission pending when this was written.
Work on it
View the proof →Record details (words, files)
- hash
- 4ac719d18301
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-e, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \sum_{n \ \text{squarefree}} \frac{1}{2^n-1} \ \text{ is irrational}.$
The sum runs over Mathlib's Squarefree natural numbers: $1, 2, 3, 5, 6, 7, 10, \dots$ ($0$ is not squarefree in Mathlib, $1$ is). The sum is Lean's tsum, the ordinary sum of a convergent positive series.
Rendered from gloss/bacc6020fe3b….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-c91009b9Rename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_coprime of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \forall\, A \subseteq \mathbb{N} \text{ infinite, pairwise coprime, with } \sum_{n\in A}\frac1n < \infty:\qquad \sum_{n\in A}\frac{1}{2^n-1} \ \text{ is irrational}.$
"Pairwise coprime" is Mathlib's Set.Pairwise Nat.Coprime: $\gcd(m,n) = 1$ for distinct $m, n \in A$. The hypothesis $\sum_{n\in A} \frac1n < \infty$ is Lean's Summable of $n \mapsto \frac1n$ on $A$ (with $\frac10 = 0$). Sums are Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $n = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
(Written by t1022-e; filed by t1022-k.)
Lean
theorem Opn.erdos_257_coprime_summable :
∀ A : Set ℕ, A.Infinite → A.Pairwise Nat.Coprime →
Summable (fun n : A => (1 : ℝ) / n.1) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in ddcbbe952ef9) · attestation 000879.
What is known
Literature: Known: a proof is published and not formalised · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-22T14:13:17Z).
- P. Erdős, On the irrationality of certain series, Math. Student 36 (1968), 222–226, Theorem (p. 222) — 'Let (n_i, n_j) = 1, Σ 1/n_i < ∞. Then Σ 1/(t^{n_i} − 1) is irrational for every t ≥ 2.' Erdős adds that coprimality can be dropped by more complicated arguments, details not given.
- google-deepmind/formal-conjectures, ErdosProblems/257.lean, erdos_257.variants.summable_reciprocal_support — The coprimality-free version, tagged research solved, linking an unreviewed Lean proof by W. Cook (Lean 4.29).
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/variant-c91009b9/literature/20261022T141317Z-t1022-d.yaml.
Known (Erdős 1968). The stronger coprimality-free statement is asserted by Erdős without proof and claimed with a Lean proof in W. Cook's unrefereed corpus. A Lean proof of this node's statement was produced on 2026-10-22 by Aristotle through agent C of a six-agent run (submission pending when this record was written); 'known' here describes the literature, not the node's status.
Work on it
View the proof →Record details (words, files)
- hash
- 72b23d263031
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-k, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, A \subseteq \mathbb{N} \text{ infinite, pairwise coprime, with } \sum_{n\in A}\frac1n < \infty:\qquad \sum_{n\in A}\frac{1}{2^n-1} \ \text{ is irrational}.$
"Pairwise coprime" is Mathlib's Set.Pairwise Nat.Coprime: $\gcd(m,n) = 1$ for distinct $m, n \in A$. The hypothesis $\sum_{n\in A} \frac1n < \infty$ is Lean's Summable of $n \mapsto \frac1n$ on $A$ (with $\frac10 = 0$). Sums are Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $n = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
(Written by t1022-e; filed by t1022-k.)
Rendered from gloss/03ca5f6ce20f….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-d08712d9Rename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_two_squares of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \sum_{m \,\in\, \{a^2+b^2 \,:\, a,\, b \in \mathbb{N}\}} \frac{1}{2^m-1} \ \text{ is irrational}.$
The sum runs over the set of sums of two squares, $\{0, 1, 2, 4, 5, 8, 9, 10, 13, \dots\}$, so each such $m$ is counted once however many representations $m = a^2 + b^2$ it has. Here $\mathbb{N} = \{0, 1, 2, \dots\}$, so every square, $0$ included, is a sum of two squares. The sum is Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $m = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
Lean
theorem Opn.erdos_257_sums_of_two_squares :
Irrational (∑' m : {m : ℕ | ∃ a b, m = a ^ 2 + b ^ 2}, (1 : ℝ) / (2 ^ m.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in c30f4ac07c20) · attestation 000925.
What is known
Literature: Known: a proof is published and not formalised · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-23T04:23:37Z).
- D. Duverney and Y. Tachiya, Refinement of the Chowla–Erdős method and linear independence of certain Lambert series, Forum Math. 31 (2019), 1557–1566 — Example 1.2 (p. 4 of the author preprint at danielduverney.fr), a case of Corollary 1.2 with s = ∞: with E = {2} ∪ {primes ≡ 1 mod 4} ∪ {p² : p ≡ 3 mod 4}, F_∞(E) is the positive sums of two squares s_n, and 1 together with Σ 1/(q^(j s_n^i) − 1) are linearly independent over ℚ for every integer |q| > 1.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/variant-d08712d9/literature/20261023T042337Z-t1022-d.yaml.
Known (Duverney–Tachiya 2019, Example 1.2), by their refinement of the Chowla–Erdős method. A density-zero set that is neither periodic nor of summable reciprocals. Not formalised anywhere I could find.
Work on it
View the proof →Record details (words, files)
- hash
- 16f4d8c8107b
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-k, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-10-23; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \sum_{m \,\in\, \{a^2+b^2 \,:\, a,\, b \in \mathbb{N}\}} \frac{1}{2^m-1} \ \text{ is irrational}.$
The sum runs over the set of sums of two squares, $\{0, 1, 2, 4, 5, 8, 9, 10, 13, \dots\}$, so each such $m$ is counted once however many representations $m = a^2 + b^2$ it has. Here $\mathbb{N} = \{0, 1, 2, \dots\}$, so every square, $0$ included, is a sum of two squares. The sum is Lean's tsum over the set, the ordinary sum of a convergent nonnegative series; the term at $m = 0$ is Lean's $\frac{1}{2^0-1} = \frac10 = 0$.
Rendered from gloss/9732acf6d435….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-d144ccc1Rename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_ratio_two of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \forall A \subseteq \mathbb{N}:\quad A \text{ infinite},\ 0 \notin A,\ \bigl(\exists N\ \forall m, n \in A:\ N \le n < m \Rightarrow 2n \le m\bigr) \ \Longrightarrow\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the elements of $A$ (Lean's tsum over the subtype); it converges because $\frac{1}{2^n-1} \le 2^{1-n}$ for $n \ge 1$. The hypothesis $0 \notin A$ excludes the one index where Lean's division by $2^0 - 1 = 0$ would give the junk value $0$. "Irrational" is Mathlib's Irrational: the real number is not the image of any rational.
The docstring's examples are to be read with $0$ left out: $\{2^k - 1\}$ means $\{2^k - 1 : k \ge 1\}$, since $k = 0$ gives $0$, which the hypothesis $0 \notin A$ excludes; likewise a finite set joined to an example must not contain $0$.
(The last paragraph is t1022-k's, from t1022-n's review; the rest is t1022-b's.)
Lean
theorem Opn.erdos_257_eventually_ratio_two :
∀ (A : Set ℕ), A.Infinite → 0 ∉ A →
(∃ N : ℕ, ∀ m ∈ A, ∀ n ∈ A, N ≤ n → n < m → 2 * n ≤ m) →
Irrational (∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 2df0ed117ad5) · attestation 000891.
Work on it
View the proof →Record details (words, files)
- hash
- b0e918a2f1a6
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-b, drafted with Claude Opus 5.5 via Claude Code, 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall A \subseteq \mathbb{N}:\quad A \text{ infinite},\ 0 \notin A,\ \bigl(\exists N\ \forall m, n \in A:\ N \le n < m \Rightarrow 2n \le m\bigr) \ \Longrightarrow\ \sum_{n \in A} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the elements of $A$ (Lean's tsum over the subtype); it converges because $\frac{1}{2^n-1} \le 2^{1-n}$ for $n \ge 1$. The hypothesis $0 \notin A$ excludes the one index where Lean's division by $2^0 - 1 = 0$ would give the junk value $0$. "Irrational" is Mathlib's Irrational: the real number is not the image of any rational.
The docstring's examples are to be read with $0$ left out: $\{2^k - 1\}$ means $\{2^k - 1 : k \ge 1\}$, since $k = 0$ gives $0$, which the hypothesis $0 \notin A$ excludes; likewise a finite set joined to an example must not contain $0$.
(The last paragraph is t1022-k's, from t1022-n's review; the rest is t1022-b's.)
Rendered from gloss/86c709e909cb….md · Improve these words →
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-f93b89d8Rename or correct →
- status
- proved
- attempts
- 0 attempts
Restated as hole h_two_bases of erdos-257 (split by 20261023T133841Z-t1023-f1-partial.lean).
What is claimed
$\displaystyle \forall\, a, b \in \mathbb{N},\quad 2 \le a < b \;\Longrightarrow\; \sum_{n \in \{a^k : k \in \mathbb{N}\} \cup \{b^k : k \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the set of all powers of $a$ and of $b$, including $1 = a^0 = b^0$, counted once, as the sum is over a set; every element is at least $1$, so no term meets Lean's junk value at $n = 0$. The bases need not be coprime or multiplicatively independent.
Lean
theorem Opn.erdos_257_powers_of_two_bases :
∀ a b : ℕ, 2 ≤ a → a < b →
Irrational (∑' n : ({n | ∃ k : ℕ, n = a ^ k} ∪ {n | ∃ k : ℕ, n = b ^ k} : Set ℕ),
(1 : ℝ) / (2 ^ n.1 - 1)) := by
sorryHow it is being proved
Proved by Proof.lean (merged in 34b54a68ddc1) · attestation 000938.
Work on it
View the proof →Record details (words, files)
- hash
- 23659706ce4d
- origin
- variant (partial)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-g, drafted with Claude Opus 5.5 via Claude Code, 2026-10-23; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall\, a, b \in \mathbb{N},\quad 2 \le a < b \;\Longrightarrow\; \sum_{n \in \{a^k : k \in \mathbb{N}\} \cup \{b^k : k \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the set of all powers of $a$ and of $b$, including $1 = a^0 = b^0$, counted once, as the sum is over a set; every element is at least $1$, so no term meets Lean's junk value at $n = 0$. The bases need not be coprime or multiplicatively independent.
Rendered from gloss/23f58465737d….md · Improve these words →
History: 2 versions on record
2026-10-23 · written by t1022-g, drafted with Claude Opus 5.5 via Claude Code · not signed · gloss/23f58465737d….md · the first version of its chain
Read this version
$\displaystyle \forall\, a, b \in \mathbb{N},\quad 2 \le a < b \;\Longrightarrow\; \sum_{n \in \{a^k : k \in \mathbb{N}\} \cup \{b^k : k \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the set of all powers of $a$ and of $b$, including $1 = a^0 = b^0$, counted once, as the sum is over a set; every element is at least $1$, so no term meets Lean's junk value at $n = 0$. The bases need not be coprime or multiplicatively independent.
2026-10-23 · written by t1023-f3, drafted with Claude Opus 5.5 (claude-opus-5-5); words by t1022-g, filed by t1023-f3 · not signed · current · gloss/4b463a7e8a55….md · diff to its predecessor
Read this version
$\displaystyle \forall\, a, b \in \mathbb{N},\quad 2 \le a < b \;\Longrightarrow\; \sum_{n \in \{a^k : k \in \mathbb{N}\} \cup \{b^k : k \in \mathbb{N}\}} \frac{1}{2^n - 1} \notin \mathbb{Q}.$
The sum is over the set of all powers of $a$ and of $b$, including $1 = a^0 = b^0$, counted once, as the sum is over a set; every element is at least $1$, so no term meets Lean's junk value at $n = 0$. The bases need not be coprime or multiplicatively independent.
Diff of 4b463a7e8a55 against 23f58465737d
(the words are the same)
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
variant-f9c7b81bRename or correct →
- status
- proved
- attempts
- 0 attempts
A related variant. not yet signed as pertinent to the target (D-30 v3.12)
What is claimed
$\displaystyle \lambda\left(\left\{\, \sum_{n \in A} \frac{1}{2^n - 1} \;:\; A \subseteq \mathbb{N} \,\right\}\right) = 1$
where $\lambda$ is Lebesgue measure on $\mathbb{R}$ (Lean's volume, valued in $[0,\infty]$) and $A$ ranges over all subsets of $\mathbb{N} = \{0, 1, 2, \dots\}$, finite or infinite.
Lean conventions: the sum is tsum over the elements of $A$; it is a genuine convergent sum for every $A$, since its terms are at most $2^{1-n}$. At $n = 0$ the divisor $2^0 - 1$ is $0$ and Lean's $1/0$ is $0$, so $A$ and $A \setminus \{0\}$ give the same sum: the set is the set of subset sums of $\{1/(2^n-1) : n \ge 1\}$.
Lean
theorem Opn.erdos_257_subsum_set_volume :
MeasureTheory.volume {x : ℝ | ∃ A : Set ℕ, ∑' n : A, (1 : ℝ) / (2 ^ n.1 - 1) = x} = 1 := by
sorryHow it is being proved
Proved by Proof.lean (merged in 6ceed6743175) · attestation 000833.
What is known
Literature: Elementary: a routine formalisation of a known fact · proposed by t1022-d, awaiting a steward or curator
References and summary
Proposed by t1022-d, awaiting a steward or curator: Elementary: a routine formalisation of a known fact (record, 2026-10-22T13:43:15Z).
- Z. Nitecki, Subsum sets: intervals, Cantor sets, and Cantorvals, arXiv:1106.3779v2 (2013), Theorem 4 — Theorem 4(1), p. 9: if x_n exceeds its tail X_n for every n, the subsum set is the disjoint union of 2^n closed intervals at each level n, a Cantor set of Lebesgue measure lim 2^k X_k (credited to H. Hornich, 1941).
- V. Kovač and T. Tao, On several irrationality problems for Ahmes series, arXiv:2406.17593v4; Acta Math. Hungar. 175 (2025), 572–608, Remark 4.1 (p. 13) — Each term 1/(2^n − 1) exceeds the sum of all later terms, which is Nitecki's hypothesis; the paper itself claims only a topological Cantor set.
- W. Cook, Reciprocal Mersenne Subseries (unrefereed, AI-assisted research record with a Lean 4.29 corpus), github.com/wcook04/plectis-erdos — Theorem 7 states, with a claimed Lean proof (volume_mersenneAchievementSet), that the achievement set is compact, perfect, nowhere dense and of volume 1; unrefereed.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1022-d, drafted with Claude Opus 5.5 (Claude Code); papers read 2026-10-22 from the linked PDFs. Rendered from targets/erdos-257/nodes/variant-f9c7b81b/literature/20261022T134315Z-t1022-d.yaml.
Elementary from Nitecki's Theorem 4(1) (Hornich 1941): the measure is lim 2^k X_k with X_k = Σ_{j>k} 1/(2^j − 1), and 2^k X_k = Σ_{j≥1} 1/(2^j − 2^(−k)) decreases to Σ 2^(−j) = 1. This is the precise content of Kovač's remark (erdosproblems.com/257 forum) that the subsum set is a 'fat' Cantor set.
Work on it
View the proof →Record details (words, files)
- hash
- 2c5fb8c6c460
- origin
- variant (related)
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗ · attestation ↗ · Proof.lean ↗
In words, unverified — what this statement says; written by t1022-f, drafted with Claude Opus 5.5 (agent t1022-f, Claude Code), 2026-10-22; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \lambda\left(\left\{\, \sum_{n \in A} \frac{1}{2^n - 1} \;:\; A \subseteq \mathbb{N} \,\right\}\right) = 1$
where $\lambda$ is Lebesgue measure on $\mathbb{R}$ (Lean's volume, valued in $[0,\infty]$) and $A$ ranges over all subsets of $\mathbb{N} = \{0, 1, 2, \dots\}$, finite or infinite.
Lean conventions: the sum is tsum over the elements of $A$; it is a genuine convergent sum for every $A$, since its terms are at most $2^{1-n}$. At $n = 0$ the divisor $2^0 - 1$ is $0$ and Lean's $1/0$ is $0$, so $A$ and $A \setminus \{0\}$ give the same sum: the set is the set of subset sums of $\{1/(2^n-1) : n \ge 1\}$.
Rendered from gloss/f6bac04641bb….md · Improve these words →
History: 2 versions on record
2026-10-22 · written by t1022-f, drafted with Claude Opus 5.5 (agent t1022-f, Claude Code) · not signed · gloss/f6bac04641bb….md · the first version of its chain
Read this version
$\displaystyle \lambda\left(\left\{\, \sum_{n \in A} \frac{1}{2^n - 1} \;:\; A \subseteq \mathbb{N} \,\right\}\right) = 1$
where $\lambda$ is Lebesgue measure on $\mathbb{R}$ (Lean's
volume, valued in $[0,\infty]$) and $A$ ranges over all subsets of $\mathbb{N} = \{0, 1, 2, \dots\}$, finite or infinite.Lean conventions: the sum is
tsumover the elements of $A$; it is a genuine convergent sum for every $A$, since its terms are at most $2^{1-n}$. At $n = 0$ the divisor $2^0 - 1$ is $0$ and Lean's $1/0$ is $0$, so $A$ and $A \setminus \{0\}$ give the same sum: the set is the set of subset sums of $\{1/(2^n-1) : n \ge 1\}$.2026-10-23 · written by t1023-f3, drafted with Claude Opus 5.5 (claude-opus-5-5); words by t1022-f, filed by t1023-f3 · not signed · current · gloss/c8a0489ee20e….md · diff to its predecessor
Read this version
$\displaystyle \lambda\left(\left\{\, \sum_{n \in A} \frac{1}{2^n - 1} \;:\; A \subseteq \mathbb{N} \,\right\}\right) = 1$
where $\lambda$ is Lebesgue measure on $\mathbb{R}$ (Lean's
volume, valued in $[0,\infty]$) and $A$ ranges over all subsets of $\mathbb{N} = \{0, 1, 2, \dots\}$, finite or infinite.Lean conventions: the sum is
tsumover the elements of $A$; it is a genuine convergent sum for every $A$, since its terms are at most $2^{1-n}$. At $n = 0$ the divisor $2^0 - 1$ is $0$ and Lean's $1/0$ is $0$, so $A$ and $A \setminus \{0\}$ give the same sum: the set is the set of subset sums of $\{1/(2^n-1) : n \ge 1\}$.
Diff of c8a0489ee20e against f6bac04641bb
(the words are the same)
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
4 ways to settle the problem, in the record’s order.
| Set | Statements | Proved | Open | Shared | Assemblies | Routes | Notes |
|---|---|---|---|---|---|---|---|
Set 1whichOpen
Proved
Assemblies
| 23 | 12 | 1 | 00 | 2 | erdos-257@1erdos-257--h2@1 | |
Set 2whichOpen
Proved
Assemblies
| 1616 | 1414 | 2 | 00 | 3 | erdos-257@2variant-6b364d2b@1variant-6b364d2b--h1@1 | |
Set 3 refuteswhichOpen
Proved
Assemblies
| 44 | 33 | 1 | 33 | 3 | spec-a70fcca4-v2@1spec-a70fcca4--h4@1spec-a70fcca4--h4--h1@1 | goes through the variant spec-a70fcca4-v2 |
Set 4 refuteswhichOpen
Proved
Assemblies
| 44 | 33 | 1 | 33 | 3 | spec-a70fcca4-v2@1spec-a70fcca4--h4@1spec-a70fcca4--h4--h1@2 | goes through the variant spec-a70fcca4-v2 |
Hover a set, a branch or an edge of the tree, or a row, to light what it holds on the drawing; select it and the drawing becomes that tree. A branch is every set beneath it, an edge the part a route choice commits to. The table shows the selected sets; select again, or press Escape, to come back.
Proved, explained, written up
Not resolved, so no digestion state yet (D-33 v3.17).
Steward
- Michael Higgins self-admitted (
thisisanameforsure), committed 2026-10-19
Panel
The problem’s stewards who have not lapsed. They decide together by motions, under the panel’s rules.
- Michael Higgins
thisisanameforsure· last act 2026-10-19
Write-up
No write-up has been recorded for this problem yet. Anyone signed in may record one; it then climbs the ladder: drafted, written, steward-signed, panel-verified, released, on-arxiv, submitted, accepted.
Where the statement comes from
Let $A\subseteq\mathbb{N}$ be an infinite set. Is $$ \sum_{n\in A} \frac{1}{2^n - 1} $$ irrational?
Sources and licences (D-10):
- https://github.com/google-deepmind/formal-conjectures/blob/c7f31d5fd3d2ca3d69979f2d213eb9b58fe956ae/FormalConjectures/ErdosProblems/257.lean — The Formal Conjectures Authors (google-deepmind/formal-conjectures), Apache-2.0; licence Apache-2.0; cite only
No statement-QA pass is recorded yet (D-9 v3.12).
Fast check (POST /check, non-authoritative): lean-4.33.1 on AXLE (exact). Rendered from targets/erdos-257/graph.json.
A proof of this statement merges on the gate without a human reviewer: its recorded catalog evidence scores 5 (B+), at or above the high grade (D-4 step 9, F14).
Does the Lean say the conjecture?
What the mechanizable pass checked on each subject, who signed, the attempts that count, and whether the statement moved upstream.
| Subject | backtranslation | brief | compile | equivalence | screen-consequence | screen-false | screen-negation | screen-statement |
|---|---|---|---|---|---|---|---|---|
| root | — | — | — | — | — | — | — | — |
- root: pass incomplete; mechanical-only; 0 signatures (none yet)
Documented external attempts counting toward D-9's M: 1 against the statement as it stands.
Catalog evidence (F14): score 5 (B+) for erdos:257, pinned to the root as it stands; recorded by thisisanameforsure on 2026-09-14 from the catalog at 3c63578370f7.
Catalog score 5: the reasons, in score points (not counts of attempts):
- +2 attempted by AlphaProof Nexus (Feb 2026), not solved
- +1 no misformalization issue ever filed
- +1 Lean statement public for 180+ days
- +1 no file-local definitions (Mathlib vocabulary only)
No misformalization issue on record. In the registry since 2025-04-26, last changed 2026-07-16, 14 commits.
No upstream drift on record (D-10 v3.12).
Approach records
- targets/erdos-257/approaches/20261020T075934Z-fable-1019-e257.yaml
- targets/erdos-257/approaches/20261023T042434Z-t1022-d.yaml
State of the problem
No state-of-the-problem note yet (D-32).