Skip to content

Exact DFT on the scalar/index RAM with saving 1/2 − 1/(2(10^40 − 1)) - #223

Merged
github-actions[bot] merged 1 commit into
bigospeedrun:mainfrom
AnanasClassic:dft-uniform-binary-kernel
Nov 25, 2026
Merged

github-actions[bot] merged 1 commit into
bigospeedrun:mainfrom
AnanasClassic:dft-uniform-binary-kernel

Conversation

@AnanasClassic

Copy link
Copy Markdown
Contributor

This submission proves an exact discrete Fourier transform for every positive length in the challenge’s scalar/index RAM, with saving

$$ \delta = \frac{4999999999999999999999999999999999999999}{9999999999999999999999999999999999999999} = \frac12 - \frac{1}{2(10^{40}-1)}. $$

This is the largest rational strictly below one half permitted by the challenge’s 40-digit limit. The running time is $O(n(\log n)^{1-\delta})$ for one fixed program. The proof uses a strict gap above exponent $1/2$, including room to absorb the all-length compiler’s overhead.

Construction and credit. OpenAI proved the existence and correctness of the binary Walsh template and its strict call-rate bound. This submission ports that template to the challenge RAM. The RAM program constructs the index permutations and phase coefficients, evaluates the six template instructions, and charges the recursive calls for every fiber and every group of rows, including a partially filled group. It removes the even-width and normalization restrictions and supplies the two-point kernel required by the existing all-length DFT compiler. OpenAI binary template, pinned source

OpenAI wrote the exact computational model and the original all-length reduction. The generic compiler is taken from PR 222 and uses the rate-to-DFT wrapper contributed by Gigabyte0x1337 in PR 220. Earlier author notices and license text are preserved in the Lean sources. The RAM port was developed with OpenAI Codex.

Local verification. The staged package was rebuilt with the profile’s Lean 4.34.1, pinned Mathlib and autoImplicit=false. The exact theorem Race.bound depends only on propext, Quot.sound, and Classical.choice.

@github-actions

Copy link
Copy Markdown
Contributor

Received. This proof PR waits for the verifier queue: one proof run runs at a time, and the queue is checked every 30 minutes. The result is posted here.

@github-actions

Copy link
Copy Markdown
Contributor

Derivation report for this version. It compares Git file hashes with the verified submissions of other authors. It does not judge the proof.

Closest verified submission of another author: direct-pr-221. 13 of 196 source files of this version are identical to its files (6%).
Against it: 2 changed, 181 added, 70 removed.
Only numeric constants changed in the code: no.
Credit lines (author, copyright, @handle) in the changed files: 45 in the earlier submission, 1 kept, 44 missing, 0 new.

@AnanasClassic

Copy link
Copy Markdown
Contributor Author

I'd like to ask the maintainers to credit OpenAI and me as co-authors of this submission, with OpenAI listed first. I consider OpenAI's contribution larger than mine. OpenAI developed the binary Walsh construction and proved the bound on its recursive calls. OpenAI also wrote the original exact DFT model and the reduction to transforms of arbitrary length. My contribution, developed with OpenAI Codex, was to implement the binary construction in the challenge's scalar/index RAM and verify its full cost in Lean using the existing community compiler.

If the leaderboard supports shared credit, my preferred author line for this entry is OpenAI and Vladislav Kuznetsov (AnanasClassic). The acknowledgments to the earlier compiler contributors in the PR still apply.

@nmamano

nmamano commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

This is an agent for Nil (BOS Reviewer), writing for Big O Speedrun.

Thank you. We give this entry joint credit, OpenAI first, then Vladislav Kuznetsov:

  • OpenAI: the binary Walsh template and the proof of its call-rate bound (its Lean files are kept unchanged except for import paths).
  • Vladislav Kuznetsov: the RAM program and the proof of its cost on this board.

The note on the row also says that the all-length compiler is yours from PR 222, with Gigabyte0x1337's rate-to-DFT wrapper from PR 220, and that OpenAI Codex assisted.

The row shows on the board after the verifier passes and our review.

@github-actions

Copy link
Copy Markdown
Contributor

PR proof result: merge. lean_and_axiom_passed_nanoda_pending.

Receipt and logs

Exact discrete Fourier transform board: https://bigospeedrun.com/exact-dft

@github-actions
github-actions Bot merged commit 8d41428 into bigospeedrun:main Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Final verification result.

PR proof result: merge. lean_and_axiom_passed.

Receipt and logs

Exact discrete Fourier transform board: https://bigospeedrun.com/exact-dft
lean: passed.
nanoda: passed.
Axiom audit: passed.

@AnanasClassic

Copy link
Copy Markdown
Contributor Author

Hi Nil and the Big O Speedrun team,

Could you review the ordering of the Exact DFT leaderboard and list OpenAI and Vladislav Kuznetsov (#223) ahead of Halit Ziya KARTAL (#228)? I think shared first place, with #223 displayed first by its November 25 submission date, would fairly recognize both proofs.

When I submitted #223, the verifier required a single rational saving with at most 40 digits in each integer. I submitted exactly the largest saving below $1/2$ that this format could express, $\tfrac12-\tfrac1{2(10^{40}-1)}$. The board confirmed that interpretation on November 25. Three days later, #228 submitted the same fraction. The verifier recorded a tie, and the team separately checked the theorem for every real $s<1/2$. Submission rules at the #223 commit · November 25 board clarification · Maintainer’s explanation on #228

That same theorem follows from the code we published on November 25. The Frontier223.lean file below imports only modules from the original #223 commit. It selects the Walsh template for an arbitrary exponent above $1/2$ and applies the RAM implementation and all-length DFT reduction already in that commit. I checked the file locally with Lean 4.34.1. It proves the exact RouteB.routeB_all statement checked for #228, using only the three standard axioms.

Would you run the same Lean and nanoda check on this file and, if it passes, use November 25 as the submission date for ordering the two entries? Halit deserves full credit for his own implementation. My request is that our earlier construction receive the same bound on the board, with the submission date and the new verification date recorded separately.

Thanks,
Vladislav Kuznetsov (AnanasClassic)

Frontier223.lean (complete source)
import Submission.BinaryKernel.Batch
import Submission.BinaryKernel.Endpoint
import Submission.BinaryKernel.PlanLeaves
import Submission.BinaryKernel.Dispatch
import Submission.AdaptiveRate.RateToDFT

/-!
# Exact DFT at each fixed logarithmic exponent above one half

Derived from the OpenAI binary Walsh template and the uniform fixed-template
RAM compiler of Big O Speedrun PR 223. Here the exponent is arbitrary. The
same root order is used at each positive transform length by every member.
-/

namespace DFTSpeedrun.FixedEpsilon
open OAI.Computability.NearSquareRoot.KernelPass
open OAI.PowerSaving OAI.PowerSaving.RAM HalfKernel Filter Asymptotics
open Real

private theorem batchLaw {A W : ℕ} (p : Plan A W W) : BatchLaw p := by
  intro ι s cl m b k h Z ha hw eqdim v sh sn kn ok exec
  exact Batch.fixed_s (p:=p) ha hw eqdim v sh sn kn ok exec

private theorem large_of_body {cl : Paint} {m : Bool} {A W σ r : ℕ}
    (h : Body cl m A W σ r) : LargeBody cl m A W σ r := by
  refine (h.reindex (fun g : BigCtx cl A r => g.1)).mono (fun _ => le_rfl) ?_
  intro g
  simp [charge,g.2]

/-- Each positive fixed slack produces an exact RAM algorithm. All of these
algorithms request the same root order as a function of the transform length. -/
theorem dft_family_littleO (ε : ℝ) (hε : 0 < ε) :
    ∃ order solve W, DFTProgram order solve W ∧
      (fun n : ℕ => (W n : ℝ)) =o[atTop]
        (fun n : ℕ => (n : ℝ) * (log (n : ℝ)) ^ (1/2 + ε)) ∧
      ∀ n : ℕ, 0 < n → (run order n).val = Modulus.workModulus n := by
  let β := 1/2 + min ε (1/2) / 2
  have hpos : 0 < min ε (1/2) := lt_min hε (by norm_num)
  have habove : 1/2 < β := by dsimp [β]; linarith
  have hnonneg : 0 ≤ β := by linarith
  have hmax : β ≤ 1 := by dsimp [β]; linarith [min_le_right ε (1/2)]
  have hslack : β < 1/2+ε := by dsimp [β]; linarith [min_le_left ε (1/2)]
  obtain ⟨t,ha,hw,hcorrect,hrate⟩ := exists_normalized_template habove
  obtain ⟨r,hr,hcost⟩ := HalfCost.exists_padding (ℓ:=4) (by decide) hrate
  have hk : WalshBridge.EvenKernel.{0} β := even_of_large (by omega) (by omega) hr hnonneg hcost
    (fun cl m => large_of_body (assemble_body (cl:=cl) (m:=m) (r:=r)
      (by omega) (by omega) hcorrect (batchLaw t.program)
      (fun hA sh sv => ⟨PlanCompiler.xor_exec hA sh sv, PlanCompiler.scale_exec hA sh sv⟩)))
  have hk' := WalshBridge.of_even_kernel hnonneg hmax hk
  have hE : RippleEngine.{0} β := ⟨hnonneg, fun _ _ _ k v => WalshBridge.ripple_program_of_walsh k v hk'⟩
  obtain ⟨order,solve,W,hprogram,htime,hroot⟩ := dft_program_of_engine hE hmax
  refine ⟨order,solve,W,hprogram,htime.trans_isLittleO (isLittleO_iff.mpr ?_),hroot⟩
  intro c hc
  filter_upwards [targetTime_le_eventually hslack hc] with n hn
  rwa [Real.norm_of_nonneg (targetTime_nonneg _ n),
    Real.norm_of_nonneg (mul_nonneg (Nat.cast_nonneg n) (rpow_nonneg (log_natCast_nonneg n) _))]

theorem dft_family (ε : ℝ) (hε : 0 < ε) :
    ∃ order solve W, DFTProgram order solve W ∧
      (fun n : ℕ => (W n : ℝ)) =O[atTop]
        (fun n : ℕ => (n : ℝ) * (log (n : ℝ)) ^ (1/2 + ε)) ∧
      ∀ n : ℕ, 0 < n → (run order n).val = Modulus.workModulus n := by
  obtain ⟨order,solve,W,hprogram,hcost,horder⟩ := dft_family_littleO ε hε
  exact ⟨order,solve,W,hprogram,hcost.isBigO,horder⟩

#print axioms dft_family_littleO
#print axioms dft_family
end DFTSpeedrun.FixedEpsilon

namespace OAI.PowerSaving.RouteB
open Filter Asymptotics

theorem routeB_all (s : ℝ) (hs : s < 1/2) :
    ∃ order solve W, DFTProgram order solve W ∧
      (fun n : ℕ => (W n : ℝ)) =O[atTop]
        (fun n : ℕ => (n : ℝ) * (Real.log (n : ℝ)) ^ (1 - s)) := by
  obtain ⟨o, p, W, hp, hW, _⟩ :=
    DFTSpeedrun.FixedEpsilon.dft_family (1/2 - s) (by linarith)
  have he : (1/2 : ℝ) + (1/2 - s) = 1 - s := by ring
  exact ⟨o, p, W, hp, by simpa only [he] using hW⟩

#print axioms routeB_all
end OAI.PowerSaving.RouteB

@nmamano

nmamano commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

This is an agent for Nil (BOS Reviewer), writing for Big O Speedrun.

Thank you for the careful case and for the file. Our answers:

  1. Order of the bounds. A proof for every saving $s &lt; 1/2$ ranks above the fixed saving $\tfrac12-\tfrac1{2(10^{40}-1)}$, because it contains that saving as one case. The tie rules (evidence level, then date) apply only to equal bounds. You are right that our November 25 note said only an exact $1/2$ could beat your entry. That was true for the 40-digit format, but we did not say that a rebuilt theorem for every $s&lt;1/2$ could also rank above it. We are sorry for that gap. The note now says it.
  2. Frontier223.lean. We will rebuild it on GitHub Actions on the same route as optimized code, DFT is also at O(n·log^(1/2+ε)n) now #228: Lean and nanoda against our strict target, with the Exact DFT on the scalar/index RAM with saving 1/2 − 1/(2(10^40 − 1)) #223 tree at 6141fafb. If it passes, your entry gets a Lean Verified row for every $s&lt;1/2$, with the same credit as Exact DFT on the scalar/index RAM with saving 1/2 − 1/(2(10^40 − 1)) #223 (OpenAI, then Vladislav Kuznetsov).
  3. Date. A row takes the date when its bound was first public. For the bound for every $s&lt;1/2$, that date is today, from your comment, and optimized code, DFT is also at O(n·log^(1/2+ε)n) now #228 stated it on November 28. So, under our rules, your row would be second at an equal bound. We passed your request for November 25 to Nil, who decides it.
  4. Credit on optimized code, DFT is also at O(n·log^(1/2+ε)n) now #228. Halit's credits file names Exact DFT on the scalar/index RAM with saving 1/2 − 1/(2(10^40 − 1)) #223 as the first place where OpenAI's binary Walsh template runs on this board (idea credit, with no Exact DFT on the scalar/index RAM with saving 1/2 − 1/(2(10^40 − 1)) #223 code in his tree). We will add this to the note on his row.

@AnanasClassic

Copy link
Copy Markdown
Contributor Author

Thank you for agreeing to rebuild Frontier223.lean and for passing the date question to Nil. Nil, one detail matters for that decision: before opening #223, I understood that the construction gives an exact DFT program for every fixed $\varepsilon&gt;0$ with work $O(n(\log n)^{1/2+\varepsilon})$. I deliberately chose a single fraction because the verifier required one.

Here is the sequence on November 25, in UTC. The discussion and build times come from my local records. The PR and source links are public.

If the rebuild passes, would you give OpenAI and Vladislav Kuznetsov shared first place and display #223 first using its November 25 submission date? I understand why you distinguish the date of an explicit public theorem from the date of its underlying construction. I’m asking you to weigh the original commit’s evidence that we selected the numerical instance specifically to comply with the published format.

Vladislav Kuznetsov (AnanasClassic)

@nmamano

nmamano commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

This is an agent for Nil (BOS Reviewer), writing for Big O Speedrun.

Result. Frontier223.lean passed our rebuild on GitHub Actions (run 46246592387). We placed it unchanged in the #223 tree and checked OAI.PowerSaving.RouteB.routeB_all against the same strict target file as #228. Lean's kernel and nanoda accept it, with only propext, Classical.choice and Quot.sound. Your entry gets a Lean Verified row for every saving $s&lt;1/2$, credited to OpenAI, then Vladislav Kuznetsov. It shows on the board after our review.

Date. Nil decided to keep the rule: a row takes the date when its bound was first public. The public #223 record (the PR description and the submitted tree) states the fixed saving only. Your local records show what you knew, but they were not public. So the row is dated November 29 (your comment with the file), and it ranks after #228 at the equal bound. Your fixed-saving row from November 25 stays on the board as it is.

Thank you for the work and for the careful case.

@AnanasClassic

Copy link
Copy Markdown
Contributor Author

Thanks for checking the proof. I have a question about how the board would score a possible next result.

Suppose one fixed program computes the exact DFT for all input lengths in the board’s RAM model, with total work $O(n\sqrt{\log n},\log\log n)$. If that theorem passed Lean and nanoda, would it rank above the current first-place bound of $O(n(\log n)^{1/2+\varepsilon})$ for every fixed $\varepsilon&gt;0$? The distinction is that $\log\log n=o((\log n)^\varepsilon)$ for every such $\varepsilon$, while the proposed bound still allows an unbounded factor above $\sqrt{\log n}$ per input element.

I’m asking to choose a research target. If the board would recognize this improvement, how should we submit it, given that the rational bound field cannot encode the extra logarithm? Would you check a separate theorem, as you did for #228 and #223?

@nmamano

nmamano commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

This is an agent for Nil (BOS Reviewer), writing for Big O Speedrun.

Good question. Here is how the board works today:

  • The score is the saving κ, and whether κ is attained. On this board a row is either "work $O(n(\log n)^{1-\kappa})$" (κ attained) or "every saving below κ" (κ open). An attained κ ranks above an open κ at the same value. The board does not score lower-order factors such as $\log\log n$.
  • So $O(n\sqrt{\log n},\log\log n)$ would not rank above the current rows. It gives every saving below $1/2$ but not $1/2$ itself, so it scores as "every saving below $1/2$", equal to optimized code, DFT is also at O(n·log^(1/2+ε)n) now #228 and your Frontier223 row. Equal bounds share the rank, and the order is evidence level, then date. One fixed program for all $s$, compared with a program for each $s$, does not change the score today either.
  • Exact $1/2$ would rank above them. A proof of $O(n\sqrt{\log n})$ for one fixed program fits the normal route: bound = 1/2 in manifest.json generates the usual Race.bound target with exponent $1/2$. An attained $1/2$ beats the open $1/2$ of the current rows.
  • A finer key is not in our rules. The only second key we use is the constant $c$ on the randomized factoring board. If you get the $\log\log n$ result, please open an issue with the exact theorem. Nil decides whether the board adds a key for it, and only then would we check a separate theorem. We cannot promise that now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants