Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions IEANTN/Nodes/BKLNW/v2/Challenge.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Authors: Taksh Kothari
import IEANTN.Nodes.BKLNW.v2.Conclusions
import IEANTN.Nodes.BKLNWNumerics.v1.Conclusions
import IEANTN.Nodes.Buthe.v1.Conclusions
import IEANTN.Nodes.PlattTrudgian2021.v1.Conclusions

/-!
# Challenge: `BKLNW.v2`
Expand All @@ -19,11 +20,14 @@ How each conclusion is justified is recorded in `formalization.yaml`, not here.
-/

theorem BKLNW.v2.challenge_corollary_5_1
(buthe_v1_theorem_2_theta_lower : Buthe.v1.theorem_2_theta_lower) :
(buthe_v1_theorem_2_theta_lower : Buthe.v1.theorem_2_theta_lower)
(bklnwnumerics_v1_table8_psi_bound : BKLNWNumerics.v1.table8_psi_bound)
(platttrudgian2021_v1_theorem_1_numerical : PlattTrudgian2021.v1.theorem_1_numerical) :
BKLNW.v2.corollary_5_1 := by
sorry

theorem BKLNW.v2.challenge_table8_psi_bound_above
(bklnwnumerics_v1_table8_psi_bound : BKLNWNumerics.v1.table8_psi_bound) :
(bklnwnumerics_v1_table8_psi_bound : BKLNWNumerics.v1.table8_psi_bound)
(bklnwnumerics_v1_table8_last_row : BKLNWNumerics.v1.table8_last_row) :
BKLNW.v2.table8_psi_bound_above := by
sorry
37 changes: 27 additions & 10 deletions IEANTN/Nodes/BKLNW/v2/formalization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ node:
family: BKLNW
version: v2
kind: pipeline
status: awaiting-solution
status: awaiting-verification

project:
name: "BKLNW pipeline: Corollary 5.1 and the Table 8 tail"
Expand All @@ -34,15 +34,22 @@ conclusions:
imports:
- node: Buthe.v1
conclusion: theorem_2_theta_lower
- node: BKLNWNumerics.v1
conclusion: table8_psi_bound
- node: PlattTrudgian2021.v1
conclusion: theorem_1_numerical
justifications:
- id: bklnw-paper
kind: literature
source: BKLNW
locator: Corollary 5.1, equations (2.10) to (2.12), restricted to b <= 38 log 10
note: >-
Same statement as BKLNW.v1.corollary_5_1. Imports Buthe's (1.7) as on v1.
The Table 8 half of Corollary 2.1 is not an import here; it lives on
BKLNWNumerics.v1.
Same statement as BKLNW.v1.corollary_5_1. Imports Buthe's (1.7) on
(0, 10^19], BKLNWNumerics.v1.table8_psi_bound (rows b = 40..24000,
using monotone ε ≤ 1.93378e-8) on (10^19, e^25000], and
PlattTrudgian2021.v1.theorem_1_numerical (row X = 2000,
ε₀ = 8.35e-10 < 1.93378e-8, valid for all y ≥ e^2000) on (e^25000, ∞),
closing Corollary 2.1 (θ(y) ≤ (1 + 1.93378e-8) y for all y > 0) without gaps.
designated: bklnw-paper
imports_status: identified
- id: table8_psi_bound_above
Expand All @@ -51,18 +58,19 @@ conclusions:
imports:
- node: BKLNWNumerics.v1
conclusion: table8_psi_bound
- node: BKLNWNumerics.v1
conclusion: table8_last_row
imports_status: identified
justifications:
- id: from-table8
kind: literature
source: BKLNW
locator: Table 8 in the form used by Corollaries 2.1 and 15.1
note: >-
Follows from BKLNWNumerics.v1.table8_psi_bound together with the
tabulated ε strictly decreasing, checked on v1 across consecutive
pairs. Cutoff e^25000 is the last tabulated b. The rows are
BKLNW.v1.table8 -- the single copy of the data, which both this node
and BKLNWNumerics.v1 import rather than transcribe again.
Follows from BKLNWNumerics.v1.table8_psi_bound (the 57 consecutive pairs
with non-increasing ε) together with BKLNWNumerics.v1.table8_last_row
(the final row b = 25000, valid on [e^25000, e^26000] per Appendix B.1),
retaining all 58 rows of BKLNW.v1.table8 unchanged.
designated: from-table8

sources:
Expand All @@ -79,6 +87,14 @@ automation:
role: >-
Branched v2 so the Table 8 tail imports the computation node instead
of duplicating the table on this family.
- method: agent
models: ["Gemini (Google)"]
framework: "Antigravity"
role: >-
Audited missing imports against arXiv:2002.11068v2, completed the Lean
proof of both challenges in Solutions/BKLNW.v2 (retaining all 58 rows of
table8_psi_bound_above via BKLNWNumerics.v1.table8_last_row), and ran
local build, axiom, and metadata checks under human direction.

review:
status: self-assessed
Expand All @@ -90,4 +106,5 @@ limitations:
- >-
BKLNW.v1 is not deprecated; it remains the paper-faithful node.
- >-
No Lean proof is claimed.
A complete Lean proof is in Solutions/BKLNW.v2 (no sorry, permitted axioms
only), awaiting maintainer-side Comparator verification and receipt.
5 changes: 5 additions & 0 deletions IEANTN/Nodes/BKLNWNumerics/v1/Challenge.lean
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ theorem BKLNWNumerics.v1.challenge_table8_psi_bound
BKLNWNumerics.v1.table8_psi_bound := by
sorry

theorem BKLNWNumerics.v1.challenge_table8_last_row
(platttrudgian2021_v1_theorem_1_numerical : PlattTrudgian2021.v1.theorem_1_numerical) :
BKLNWNumerics.v1.table8_last_row := by
sorry

theorem BKLNWNumerics.v1.challenge_theta_error_le_one
(buthe_v1_theorem_2_theta_lower : Buthe.v1.theorem_2_theta_lower) :
BKLNWNumerics.v1.theta_error_le_one := by
Expand Down
19 changes: 17 additions & 2 deletions IEANTN/Nodes/BKLNWNumerics/v1/Conclusions.lean
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,27 @@ open IEANTN
`|ψ(x) − x| ≤ ε · x` for all `e^b ≤ x ≤ e^b'`.

Same reading as `BKLNW.v1.table8_psi_bound` / Corollary 8.1, over the same rows —
`BKLNW.v1.table8` is the one copy of the data. `zip` with `tail` is consecutive entries
and says nothing about the last row. -/
`BKLNW.v1.table8` is the one copy of the data. `zip` with `tail` covers the 57 consecutive
intervals up to `e^25000`; the last row's interval `[e^25000, e^26000]` is stated
separately as `table8_last_row`. -/
def table8_psi_bound : Prop :=
∀ p ∈ BKLNW.v1.table8.zip BKLNW.v1.table8.tail, ∀ x : ℝ,
Real.exp (p.1.1 : ℝ) ≤ x → x ≤ Real.exp (p.2.1 : ℝ) → |Chebyshev.psi x - x| ≤ p.1.2 * x

/-- **Table 8, last row (`b = 25000`)**: `|ψ(x) − x| ≤ 7.57240 × 10⁻⁵⁰ · x` for all
`e^25000 ≤ x ≤ e^26000`.

In Broadbent–Kadiri–Lumley–Ng–Wilk Appendix B.1 (p. 26 of `arXiv:2002.11068v2`), the text
above Table 8 specifies: *"Here `b'` is the entry following `b` in the table below. The result
in the last row is valid in the interval `[e^25000, e^26000]`."* Since `table8_psi_bound` zips
`BKLNW.v1.table8` with its tail, this final interval is stated separately so existing
fingerprints remain unchanged. As in `table8_psi_bound` and `BKLNW.v1.thm_1b_table`,
the paper's strict inequality `<` is transcribed as non-strict `≤` (the weaker, safe
direction). -/
def table8_last_row : Prop :=
∀ x : ℝ, Real.exp 25000 ≤ x → x ≤ Real.exp 26000 →
|Chebyshev.psi x - x| ≤ 7.57240e-50 * x

/-- **Tables 13 and 14**, as `FKS2` uses them: `Eθ(x) ≤ 1` for every `2 ≤ x ≤ e³⁰`.

Same as `BKLNW.v1.theta_error_le_one`. -/
Expand Down
1 change: 1 addition & 0 deletions IEANTN/Nodes/BKLNWNumerics/v1/fingerprints.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"BKLNWNumerics.v1.table8_last_row": "4cbf388c7ac39b7523890c5c34d7adeb119f21826e175ab41b3da07aa89d4bc6",
"BKLNWNumerics.v1.table8_psi_bound": "ca438b3fd179bb808eea0af5e6e5756972119f77cac4594002ac23026b21fd88",
"BKLNWNumerics.v1.theta_error_le_one": "947d9d2967ba9f67230b81001b5f1cbab75e675e6b90aac697b953eb2a9b3e4d"
}
36 changes: 33 additions & 3 deletions IEANTN/Nodes/BKLNWNumerics/v1/formalization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Node metadata for `BKLNWNumerics.v1`. See docs/NODES.md.
#
# Table 8 (consecutive-interval reading) and the Eθ ≤ 1 range FKS2 consumes.
# Table 8 (consecutive-interval reading plus last-row interval) and the Eθ ≤ 1 range FKS2 consumes.
# Analytic Corollary 5.1 stays on BKLNW.v1 / BKLNW.v2.
version: "v0.4"

Expand Down Expand Up @@ -50,9 +50,32 @@ conclusions:
of Table 8, so the two cannot drift apart. The tabulated ε(b)
are the output of Buthe 2016 Theorem 2, Platt–Trudgian 2021
Theorem 1, and the algorithm of Buthe 2018 Theorem 1 (not an
importable proposition). zip/tail is consecutive rows; the last
row has no upper endpoint.
importable proposition). zip/tail covers the 57 consecutive intervals
up to e^25000; the final row's interval [e^25000, e^26000] is stated
separately as table8_last_row.
designated: bklnw-table8
- id: table8_last_row
declaration: BKLNWNumerics.v1.table8_last_row
challenge: BKLNWNumerics.v1.challenge_table8_last_row
imports:
- node: PlattTrudgian2021.v1
conclusion: theorem_1_numerical
imports_status: traced
justifications:
- id: bklnw-table8-last-row
kind: numerical
source: BKLNW
locator: "Appendix B.1, Table 8, last row (b = 25000)"
note: >-
Appendix B.1 (p. 26 of arXiv:2002.11068v2) states above Table 8:
"Here b' is the entry following b in the table below. The result in
the last row is valid in the interval [e^25000, e^26000]." Values for
b in {2500, ..., 25000} are computed as in BKLNW Theorem 13 using the
method of Platt-Trudgian (2021) and Wedeniwski's RH verification
H₀ = 2,445,999,556,030 (matching the traced import convention of
table8_psi_bound). Stated separately from table8_psi_bound so
existing fingerprints remain unchanged.
designated: bklnw-table8-last-row
- id: theta_error_le_one
declaration: BKLNWNumerics.v1.theta_error_le_one
challenge: BKLNWNumerics.v1.challenge_theta_error_le_one
Expand Down Expand Up @@ -85,6 +108,13 @@ automation:
role: >-
Split the table-driven claims off BKLNW.v1 onto a computation node.
Statements copied; no independent numerical verification.
- method: agent
models: ["Gemini (Google)"]
framework: "Antigravity"
role: >-
Verified the last-row interval [e^25000, e^26000] from the arXiv:2002.11068v2
LaTeX source (Appendix B.1, p. 26) and added table8_last_row without
modifying existing conclusions, under human direction.

review:
status: self-assessed
Expand Down
143 changes: 143 additions & 0 deletions Solutions/BKLNW.v2/Corollary51.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/-
Copyright (c) 2026 IEANTN contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Wenzhuo Zhao
-/
import Mathlib.Analysis.Complex.ExponentialBounds
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.NormNum
import Mathlib.Tactic.Positivity
import Mathlib.Tactic.Ring
import IEANTN.Nodes.BKLNW.v2.Conclusions
import ThetaUpper
import FMonotone

/-!
# Proof of `BKLNW.v2.corollary_5_1`

Establishes the strict inequality
`ψ(x) - θ(x) < (1 + 1.93378e-8) * x^(1/2) + a₂ b * x^(1/3)`
for `7 ≤ b ≤ 38 * log 10` and `x ≥ exp b`, splitting on whether `x^(1/3) ≤ 10^19`
(strictness at the `k = 3` summand via Büthe's bound) or `x^(1/3) > 10^19`
(strictness of `f x < f (2^(⌊b / log 2⌋₊ + 1))` since `x > 10^57 > 2^127 ≥ 2^(⌊b / log 2⌋₊ + 1)`).
-/

namespace BKLNW.v2.Solution

open Real Finset

private lemma two_pow_nine_le_exp_seven : (2 : ℝ) ^ 9 ≤ Real.exp 7 := by
have he : (2.5 : ℝ) ≤ Real.exp 1 := by linarith [Real.exp_one_gt_d9]
calc (2 : ℝ) ^ 9
≤ (2.5 : ℝ) ^ 7 := by norm_num
_ ≤ Real.exp 1 ^ 7 := pow_le_pow_left₀ (by norm_num) he 7
_ = Real.exp (7 * 1) := (Real.exp_nat_mul 1 7).symm
_ = Real.exp 7 := by norm_num

theorem corollary_5_1
(hbuthe : Buthe.v1.theorem_2_theta_lower)
(htable8 : BKLNWNumerics.v1.table8_psi_bound)
(hpt : PlattTrudgian2021.v1.theorem_1_numerical) :
BKLNW.v2.corollary_5_1 := by
intro b hb7 hb38 x hx
have hlog2 : (0 : ℝ) < Real.log 2 := Real.log_pos one_lt_two
have hx0 : (2 : ℝ) ^ 9 ≤ Real.exp b :=
two_pow_nine_le_exp_seven.trans (Real.exp_le_exp.mpr hb7)
have hx29 : (2 : ℝ) ^ 9 ≤ x := hx0.trans hx
have hx2 : (2 : ℝ) ≤ x := le_trans (by norm_num) hx29
have hxpos : 0 < x := by linarith
have hx13_pos : 0 < x ^ ((1 : ℝ) / 3) := Real.rpow_pos_of_pos hxpos _
set N := ⌊Real.log x / Real.log 2⌋₊
have hN9 : 9 ≤ N := Nat.le_floor <| (le_div_iff₀ hlog2).mpr <| by
rw [← Real.log_pow]; exact Real.log_le_log (by positivity) hx29
have hpsi_eq : Chebyshev.psi x - Chebyshev.theta x =
Chebyshev.theta (x ^ ((1 : ℝ) / 2)) +
∑ k ∈ Finset.Icc 3 N, Chebyshev.theta (x ^ ((1 : ℝ) / (k : ℝ))) := by
have h1 : Chebyshev.psi x = Chebyshev.theta x +
∑ k ∈ Finset.Icc 2 N, Chebyshev.theta (x ^ ((1 : ℝ) / (k : ℝ))) :=
Chebyshev.psi_eq_theta_add_sum_theta hx2
have hsplit : ∑ k ∈ Finset.Icc 2 N, Chebyshev.theta (x ^ ((1 : ℝ) / (k : ℝ))) =
Chebyshev.theta (x ^ ((1 : ℝ) / 2)) +
∑ k ∈ Finset.Icc 3 N, Chebyshev.theta (x ^ ((1 : ℝ) / (k : ℝ))) := by
rw [← Finset.add_sum_Ioc_eq_sum_Icc (by omega : 2 ≤ N), ← Finset.Icc_add_one_left_eq_Ioc]
simp only [Nat.cast_ofNat, Nat.reduceAdd]
linarith
have hhalf : Chebyshev.theta (x ^ ((1 : ℝ) / 2)) ≤
(1 + 1.93378e-8) * x ^ ((1 : ℝ) / 2) :=
theta_le_one_add_alpha hbuthe htable8 hpt (Real.rpow_pos_of_pos hxpos _)
have hsum_rhs : ∑ k ∈ Finset.Icc 3 N, (1 + 1.93378e-8 : ℝ) * x ^ ((1 : ℝ) / (k : ℝ)) =
(1 + 1.93378e-8) * BKLNW.v2.f x * x ^ ((1 : ℝ) / 3) := by
simp only [BKLNW.v2.f, Finset.mul_sum, Finset.sum_mul]
apply Finset.sum_congr rfl
intro k _
rw [mul_assoc, ← Real.rpow_add hxpos]
congr 2
ring
have htail_lt : ∑ k ∈ Finset.Icc 3 N, Chebyshev.theta (x ^ ((1 : ℝ) / (k : ℝ))) <
BKLNW.v2.a₂ b * x ^ ((1 : ℝ) / 3) := by
by_cases h19 : x ^ ((1 : ℝ) / 3) ≤ (10 : ℝ) ^ (19 : ℕ)
· have hsum_lt : ∑ k ∈ Finset.Icc 3 N, Chebyshev.theta (x ^ ((1 : ℝ) / (k : ℝ))) <
∑ k ∈ Finset.Icc 3 N, (1 + 1.93378e-8 : ℝ) * x ^ ((1 : ℝ) / (k : ℝ)) := by
refine Finset.sum_lt_sum (fun k _ =>
theta_le_one_add_alpha hbuthe htable8 hpt (Real.rpow_pos_of_pos hxpos _))
⟨3, Finset.mem_Icc.mpr ⟨le_rfl, by omega⟩, ?_⟩
rw [Nat.cast_ofNat]
have hlt3 := theta_lt_self_of_le_1e19 hbuthe hx13_pos h19
nlinarith
have hfx : BKLNW.v2.f x ≤
max (BKLNW.v2.f (Real.exp b)) (BKLNW.v2.f ((2 : ℝ) ^ (⌊b / Real.log 2⌋₊ + 1))) := by
simpa only [Real.log_exp] using f_le_max hx0 hx
have hle : (1 + 1.93378e-8) * BKLNW.v2.f x * x ^ ((1 : ℝ) / 3) ≤
BKLNW.v2.a₂ b * x ^ ((1 : ℝ) / 3) := by
unfold BKLNW.v2.a₂
have hpos : (0 : ℝ) < (1 + 1.93378e-8) := by norm_num
exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hfx hpos.le) hx13_pos.le
linarith
· have h19' : (10 : ℝ) ^ (19 : ℕ) < x ^ ((1 : ℝ) / 3) := not_le.mp h19
have hsum_le : ∑ k ∈ Finset.Icc 3 N, Chebyshev.theta (x ^ ((1 : ℝ) / (k : ℝ))) ≤
(1 + 1.93378e-8) * BKLNW.v2.f x * x ^ ((1 : ℝ) / 3) := by
rw [← hsum_rhs]
exact Finset.sum_le_sum fun k _ =>
theta_le_one_add_alpha hbuthe htable8 hpt (Real.rpow_pos_of_pos hxpos _)
set m := ⌊b / Real.log 2⌋₊ + 1
have hm9 : 9 ≤ m := by
have hfl : 9 ≤ ⌊b / Real.log 2⌋₊ := Nat.le_floor <| (le_div_iff₀ hlog2).mpr <| by
rw [← Real.log_pow, ← Real.log_exp b]
exact Real.log_le_log (by positivity) hx0
omega
have hm127 : m ≤ 127 := by
have hb_lt : b < 127 * Real.log 2 := by
have h10 : (10 : ℝ) ^ 38 < (2 : ℝ) ^ 127 := by norm_num
have hlog : Real.log ((10 : ℝ) ^ 38) < Real.log ((2 : ℝ) ^ 127) :=
Real.log_lt_log (by positivity) h10
rw [Real.log_pow, Real.log_pow] at hlog
push_cast at hlog
linarith
have hfl_lt : ⌊b / Real.log 2⌋₊ < 127 := by
rw [Nat.floor_lt (div_nonneg (by linarith) hlog2.le)]
exact (div_lt_iff₀ hlog2).mpr (by push_cast; exact hb_lt)
omega
have h2m_lt : (2 : ℝ) ^ m < x := by
have hx57 : ((10 : ℝ) ^ (19 : ℕ)) ^ 3 < x := by
have hpow := pow_lt_pow_left₀ h19' (by positivity) (by norm_num : 3 ≠ 0)
have hcube : (x ^ ((1 : ℝ) / 3)) ^ (3 : ℕ) = x := by
rw [← Real.rpow_natCast, ← Real.rpow_mul hxpos.le]
have hexp : ((1 : ℝ) / 3) * ((3 : ℕ) : ℝ) = 1 := by norm_num
rw [hexp, Real.rpow_one]
linarith
calc (2 : ℝ) ^ m
≤ (2 : ℝ) ^ 127 := pow_le_pow_right₀ one_le_two hm127
_ < ((10 : ℝ) ^ (19 : ℕ)) ^ 3 := by norm_num
_ < x := hx57
have hfx_lt : BKLNW.v2.f x <
max (BKLNW.v2.f (Real.exp b)) (BKLNW.v2.f ((2 : ℝ) ^ m)) :=
(f_lt_of_gt_two_pow hm9 h2m_lt).trans_le (le_max_right _ _)
have hlt : (1 + 1.93378e-8) * BKLNW.v2.f x * x ^ ((1 : ℝ) / 3) <
BKLNW.v2.a₂ b * x ^ ((1 : ℝ) / 3) := by
unfold BKLNW.v2.a₂
have hpos : (0 : ℝ) < (1 + 1.93378e-8) := by norm_num
exact mul_lt_mul_of_pos_right (mul_lt_mul_of_pos_left hfx_lt hpos) hx13_pos
linarith
linarith

end BKLNW.v2.Solution
Loading