Circuits · Swapnil Jain’s repository · Aska contributed
Beating a 1937 recipe, eventually
An AI-assisted proof claims that a basic operation on bits, the one that turns a logic function’s table of answers into its formula, can be done with fewer XOR gates than Frank Yates’ 89-year-old method. The catch: the win appears only at sizes no computer will ever see.
Swapnil Jain’s repository and claim. Aska Digital contributed one piece: our agentic team, run by founding member Ahraz Arifuddin (GitHub ahrazzle), wrote and ran the full-network check of the “E1” gadget that Theorem 2 depends on. It ran every invocation at sizes h = 8, 9 and 10 and a symmetry-reduced run at h = 11, found zero failures, and showed that two deliberately broken versions fail as they should. Swapnil Jain merged it as pull request #1 on 11 October 2026.
Pascal’s triangle, odd entries lit
How to read: row n lists the number of ways to choose r things from n. A lit cell is odd. Point at a cell, or focus the figure and use the arrow keys.
Show rows 0–15 as digits
row 0: 1 row 1: 1 1 row 2: 1 0 1 row 3: 1 1 1 1 row 4: 1 0 0 0 1 row 5: 1 1 0 0 1 1 row 6: 1 0 1 0 1 0 1 row 7: 1 1 1 1 1 1 1 1 row 8: 1 0 0 0 0 0 0 0 1 row 9: 1 1 0 0 0 0 0 0 1 1 row 10: 1 0 1 0 0 0 0 0 1 0 1 row 11: 1 1 1 1 0 0 0 0 1 1 1 1 row 12: 1 0 0 0 1 0 0 0 1 0 0 0 1 row 13: 1 1 0 0 1 1 0 0 1 1 0 0 1 1 row 14: 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 row 15: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 = odd, 0 = even. Row 15 is all odd because 15 is 1111 in binary: every r below 16 fits inside it.
- 4.37 × 10−11how far below 1 the claimed exponent drops: N·(log N)θ′ with θ′ = 1 − 4.3713·10−11 (Theorem 2)README.md · Lean bound in Prepass.lean
- 0 / 3,456,000failed checks in Aska’s full-network run at h = 10 (all 43,200 invocations)run_e1_rep_h10_bad0.txt
- 92supporting theorems checked by Lean and axiom-audited; the main theorem is not one of themlean/axioms.out
- ~4.4 × 1010digits the number k needs before the new circuit beats Yates (Theorem 2, constant ratio 84)README.md crossover table
- 0human referees so far; AI referees read it (2 for Theorem 1, 1 each for Theorems 1′ and 2)docs/RESULT.md
00//The problem
First principlesOne bit for every combination.
Take k pizza toppings. There are 2k ways to choose some of them. Give each choice one bit, 0 or 1. Now ask, for every choice: do the bits on it and on all of its smaller choices add up to an odd number or an even one?
With three toppings a, b and c there are N = 8 choices: none, a, b, ab, c, ac, bc, abc. The answer for “ab” looks at the bits of ab, a, b and none, adds them, and keeps only odd or even. The list of all N answers is called the Möbius transform over GF(2), also the zeta, subset-parity or Sierpinski transform.
Why care? This transform turns a logic function’s table of answers into its formula (its “algebraic normal form”), which is how cryptanalysts read a cipher’s building blocks. It sits inside Reed–Muller error-correcting codes and inside fast algorithms that sum over subsets. And it is one of the simplest places to ask a deep question: can letting things cancel ever save work?
Draw a grid with one row per output and one column per input, and put a dot where the column’s toppings are all inside the row’s. You get Pascal’s triangle with its odd entries lit: the picture at the top of this page. That is Lucas’s theorem of 1878 in action.
The obvious method adds up every sub-choice separately. That costs 3k − 2k XORs. In 1937 the statistician Frank Yates found the recipe everyone still uses: handle one topping at a time. For each choice that has topping t, add in the value of its twin without t. That is k passes of N/2 XORs each, ½ N log2 N in all, drawn below as a “butterfly”.
Below: pick k, change the input bits, and step through Yates’ passes. The outputs always match the grid.
Pascal’s triangle mod 2 is the transform; Yates’ butterfly computes it
How to read: left, the top strip is the input bits and the right strip the outputs; each grid row adds up (XOR) the inputs in its lit cells, and bright cells are the ones that count. Right, the same outputs built one topping per pass; every is one XOR gate. Filled dot = 1, hollow = 0.
Show the numbers
| k | N inputs | Yates’ butterfly k·2k−1 | Every sub-choice separately 3k − 2k | Lit cells in the grid 3k |
|---|---|---|---|---|
| 1 | 2 | 1 | 1 | 3 |
| 2 | 4 | 4 | 5 | 9 |
| 3 | 8 | 12 | 19 | 27 |
| 4 | 16 | 32 | 65 | 81 |
| 5 | 32 | 80 | 211 | 243 |
| 6 | 64 | 192 | 665 | 729 |
| 7 | 128 | 448 | 2,059 | 2,187 |
| 8 | 256 | 1,024 | 6,305 | 6,561 |
| 9 | 512 | 2,304 | 19,171 | 19,683 |
| 10 | 1,024 | 5,120 | 58,025 | 59,049 |
| 11 | 2,048 | 11,264 | 175,099 | 177,147 |
| 12 | 4,096 | 24,576 | 527,345 | 531,441 |
The separate method needs one XOR fewer than the number of lit cells in each row, so its total is 3k − 2k. Yates’ total grows like ½ N log2 N; the separate method like N1.585.
01//The open question
89 years of YatesWithout cancellation, nobody can do better. With it, nobody knew.
A circuit “cancels” when the same input reaches a gate along two paths, so it adds in twice and disappears, because x x = 0. Yates’ butterfly never does this. Is that a weakness, or the best there is?
In 2012 and 2013 Joan Boyar and Magnus Gausdal Find proved that if a circuit is not allowed to cancel, ½ N log2 N gates is exactly the minimum for this transform: Yates cannot be beaten on those terms. They then asked to what extent cancellation can help. For the smallest sizes they checked by computer that it does not help at all.
In 2024 Igor Sergeev still listed “can it be done in fewer than n·2n−1 gates?” as an open problem. The best proven lower bound is only about 3N, so the true answer could sit anywhere between 3N and Yates’ ½ N log2 N.
- 1878
Édouard Lucas: a binomial coefficient is odd exactly when its binary digits nest. Both of the claim’s parity tricks use it.
- 1937
Frank Yates’ recipe: k passes of N/2 XORs.
- 2012–13
Boyar and Find: optimal without cancellation; does cancellation help? (arXiv 1207.5321, 1305.3041)
- 2024
Sergeev lists the question as open; lower bound (3 − o(1))·N (slides).
- 6 Oct 2026
OpenAI publishes a manuscript (dated 25 Sep), produced by an internal OpenAI model, that beats n log n for the exact complex Fourier transform (openai/math problem 130).
- 11 Oct 2026
Swapnil Jain publishes mobius-x1, a claimed yes for bits. Aska’s full-network check is merged the same day.
Where the true answer could sit
How to read: gates per input for a transform of N = 2k inputs. Yates’ recipe costs ½ k per input; the best proven lower bound is about 3. The true minimum is somewhere in the shaded gap, which widens as k grows.
- Inputs N = 2k
- 1,048,576
- Yates, ½ N log2 N
- 10,485,760 gates
- Proven lower bound, about 3N
- 3,145,728 gates
02//Garbage that erases itself
The clever partAdd it twice and it is gone.
The new circuit borrows helper wires that already hold leftover values, lets that junk flow into the answer, then sends the same junk in a second time so that it cancels. What remains is exactly the signal, and every helper wire ends where it started.
The figure runs the claim’s eight-row “gadget” on single bits. Four wires: x is the value to deliver, y the place to deliver it, and A and c are helpers holding unknown junk a0 and c0. Each row adds one wire into another, if its switch is on.
Rows 0 and 1 pour junk into y. Rows 2 and 3 load x into the helpers. Rows 4 and 5 pour the helpers into y again: the junk arrives a second time and vanishes, and x arrives along each route that is switched on. Rows 6 and 7 take x back out of the helpers.
So the whole trick rests on one count. If x reaches y along an odd number of routes, y gains x. If the count is even, x cancels too and nothing is delivered. Switch both routes on to watch the gadget fail.
The eight-row gadget, on bits
How to read: time runs left to right; each column is one row of the schedule, adding the dotted wire into the wire. Below, the terms each wire holds now. A struck-out term arrived twice and cancelled.
RG + JV = 1 (odd). y ends as y0 + x; both helpers are restored.
Show the eight rows as text
- Row 0: y += J·A
- Row 1: y += R·c
- Row 2: A += V·x
- Row 3: c += G·x
- Row 4: y += R·c
- Row 5: y += J·A
- Row 6: c += G·x
- Row 7: A += V·x
Choosing the centre: Lucas again
In the strongest version (Theorem 2, the “E1” gadget) every label is a set of 7 points out of h, and the shared centre wires are all the 3-point sets. Two labels S and T that overlap in n points share every 3-point set inside the overlap: C(n, 3) wires. The gadget needs that count to be odd when S = T, so a label’s own data survives, and even for unrelated labels, so their data cancels.
C(n, 3) is odd only at n = 3 and n = 7. That is Lucas’s rule from the triangle above: 3 is 011 in binary, and only 3 (011) and 7 (111) contain it. Overlaps that are a multiple of 3 are what the proof calls neighbours; there an odd count is allowed but must be patched by a side wire (the J route). With this centre only overlaps of exactly 3 need one, and fewer side wires mean a better exponent.
Swap in 2-point sets as the centre and an overlap of 2 gives C(2, 2) = 1, odd, between unrelated labels: junk leaks into the answer. Aska’s check ran that broken version on purpose, and it failed in 277,200 places.
Two labels on a ring of 12 points
How to read: outlined points are label S (fixed); filled points are label T. Turn T, or press points to move them. The panel counts the centre wires S and T share, and whether that count is allowed.
- S · fixed label, 7 points
- T · movable label, 7 points
Show every overlap
| n | Kind of pair | 3-point centre C(n,3) | Verdict | 2-point centre C(n,2) | Verdict |
|---|---|---|---|---|---|
| 0 | neighbour | 0 even | fine | 0 even | fine |
| 1 | unrelated | 0 even | cancels | 0 even | cancels |
| 2 | unrelated | 0 even | cancels | 1 odd | leaks: fails |
| 3 | neighbour | 1 odd | side wire | 3 odd | side wire |
| 4 | unrelated | 4 even | cancels | 6 even | cancels |
| 5 | unrelated | 10 even | cancels | 10 even | cancels |
| 6 | neighbour | 20 even | fine | 15 odd | side wire |
| 7 | same label | 35 odd | signal survives | 21 odd | signal survives |
03//The claim
A machine built for complex numbers, rebuilt for bits.
The claim is that the transform needs only about N·(log N)θ′ XOR gates with θ′ a hair below 1, which is eventually smaller than Yates’ ½ N log2 N. Here is how it is built, in five steps.
- 1
Borrow an AI-found machine
A preprint dated 25 September 2026 and made public on 6 October in OpenAI’s openai/math collection (problem 130), “produced by an internal OpenAI model”, beats n log n for the exact complex Fourier transform. Its recursive network saves a tiny fraction of steps at every level; recursion compounds that, and the exponent drops below 1.
- 2
Flip the arithmetic
Complex numbers do not exist among bits, so Jain swaps the roles: labels are counted mod 3, and data live in F4, a four-element number system with a cube root of one, ω. The 3×3 building block becomes C′ = ωI + ω2J3.
- 3
Make the junk cancel by parity
The centre is chosen with Lucas’s theorem so that every unwanted contribution arrives an even number of times: the gadget in section 02.
- 4
Remove a correction step
A cheap relabelling applied on both the input side and the output side replaces one correction step per bank entry, doubling the saving. A one-sided version fails: it works for 0 of the 42 test lines checked.
- 5
Come back to bits
An explicit 12-slot “word” writes two levels of the transform as a product of copies of the building block over F16, and every F16 gate costs at most 28 XORs. So a fast C′ gives a fast Möbius transform. Lean checks that the word’s 27 factors, 12 of them copies of the building block, multiply out to exactly two levels of the transform.
F4: four numbers, two bits each
How to read: the four numbers of step 2 are 0, 1, ω and ω2. Adding two of them is XOR on their 2-bit codes; multiplying by ω turns 1 into ω, ω into ω2, and ω2 back into 1. Press “× ω” to go round; “Show bits” writes every number as its code.
Current number
1
code 01
Start at 1. Three presses of × ω bring it back: ω3 = 1.
| + | 000 | 101 | ω10 | ω211 |
|---|---|---|---|---|
| 000 | 000 | 101 | ω10 | ω211 |
| 101 | 101 | 000 | ω211 | ω10 |
| ω10 | ω10 | ω211 | 000 | 101 |
| ω211 | ω211 | ω10 | 101 | 000 |
| × | 000 | 101 | ω10 | ω211 |
|---|---|---|---|---|
| 000 | 000 | 000 | 000 | 000 |
| 101 | 000 | 101 | ω10 | ω211 |
| ω10 | 000 | ω10 | ω211 | 101 |
| ω211 | 000 | ω211 | 101 | ω10 |
| Version | Gadget | 1 − θ′ | Best label size h | Who refereed it |
|---|---|---|---|---|
| Theorem 1 | 4-point labels, centre of all sets of size ≤ 2, one correction step per bank entry | 1.8309·10−15 | 92 | 2 AI referees: “confirmed with fixes” |
| Theorem 1′ | the same, with the two-sided relabelling instead of the correction | 4.2213·10−13 | 51 | relabelling: 1 AI referee |
| Theorem 2 (E1) | 7-point labels, centre of 3-point sets, side wires only where needed, with the relabelling | 4.3713·10−11 | 23 | 1 AI referee; Aska’s full-network check |
Source: README.md headline table. The Lean package proves each exponent’s numeric bounds, for example 1 − θ′ ∈ [4.37127524, 4.37127525]·10−11, but not the network argument that makes them meaningful. A faster recurrence that would give about 3.98·10−9 is a conjecture, unproved, and nothing depends on it.
Who did what
People
- Swapnil Jain · author of the repository, the claim and its three versions; chose to publish it as “checked by AI agents only, not human-refereed; asymptotic only”.
- Ahraz Arifuddin · oversaw Aska’s agentic team that wrote the full-network check (section 05).
- No human referee yet. The repository asks for one, for this work and for the OpenAI preprint it rests on.
Machines
- An internal OpenAI model produced the Fourier-transform preprint whose architecture the claim transplants.
- Claude (Anthropic) assisted the research, implementation and drafting, per the README: “AI assistance is not independent review.”
- Unnamed AI agents wrote and refereed the proofs: 2 referees for Theorem 1, 1 each for Theorems 1′ and 2.
- Lean 4 checked 92 supporting theorems: the numbers, both parity centres, the 12-slot word and 26 deliberately false variants, each refuted.
- Aska’s agents wrote and posted PR #1, “automated posting by agentic team with human oversight”. Which model ran it is not stated.
04//How far away is “eventually”?
The honest scaleRight, perhaps, and still slower on every computer that will ever exist.
“Asymptotically fewer” means fewer once the input is large enough. The new circuit carries a bigger constant cost, and its advantage over Yates grows like k1−θ′, which with 1 − θ′ = 0.0000000000437 barely grows at all.
Write the new circuit’s cost as c0 times Yates’, divided by k1−θ′. Here k is the number of toppings and c0 the ratio of the two methods’ constant factors; the repository works out c0 = 84 for its explicit word and also reports 2 and 106 as brackets. The new circuit wins once k1−θ′ passes c0. Slide to find where.
The new circuit’s cost as a multiple of Yates’, as the problem grows
How to read: left to right, k gets more digits (each grid step is a hundred times more digits). Above the “break-even” line Yates is cheaper; below it the new circuit wins. Both scales are logarithmic.
Show the crossovers
| c0 | Theorem 1 | Theorem 1′ | Theorem 2 |
|---|---|---|---|
| 2 | 1.6·1014 | 7.1·1011 | 6.9·109 |
| 84 | 1.05·1015 | 4.6·1012 | 4.4·1010 |
| 106 | 3.3·1015 | 1.4·1013 | 1.4·1011 |
From the README’s crossover table. These are numbers of digits of k, not values of k. The input size N is 2k, a number whose own digit count has billions of digits.
Where 4.37 × 10−11 comes from: the best gadget size
How to read: each column is one label size h. Its height is the saving in the exponent, 1 − θ′; a × on the floor means the gadget costs more than it saves at that size. The highlighted column is the best. Point at or focus a column for its numbers.
Show the numbers
The table appears when JavaScript runs.
05//Aska’s part
We ran the whole network, and it held.
Before our check the README said plainly: “No full 7-set network has been run.” Our agentic team wrote x1_e1_rep.c, which runs the entire E1 network as plain bit arithmetic with random values on every wire, and checks that every value lands where the proof says it should.
| Label size h | What was run | Swap checks | Failures |
|---|---|---|---|
| 8 | all 192 invocations | 1,024 | 0 |
| 9 | all 3,888 invocations | 93,312 | 0 |
| 10 | all 43,200 invocations | 3,456,000 | 0 |
| 11 | one representative invocation per stage, by symmetry* | 1,980 | 0 |
* At h = 11 one invocation per stage stands for all of them, by the symmetry argument of PROOF.md Remark 5.2; its 2,980 labels and 3,000 edges were also solved by brute-force linear algebra, with 0 failures. Source: certificates/run_e1_rep_h{8,9,10,11}_bad0.txt. Foundation0 rebuilt the checker on 14 Oct 2026 and reproduced all four logs byte for byte (h = 10 took 33 s, h = 11 took 526 s). That is the same code run again, not an independent check.
- Two deliberately broken versions fail, as they should. A wrong label in row 5 gives 22,146 nesting failures at h = 11; the 2-point centre from section 02 gives 277,200 wrong entries at h = 12.
- The step count is exact. Counting every step and weighting by symmetry gives the proof’s closed formula at every size: 5,190,901,996,500 steps at h = 11, on both sides.
- Merged and credited. Swapnil Jain merged it the same day: “Thank you, this closes the full-network gap for Theorem 2 nicely, with both controls refuted.” The README now credits ahrazzle. 1 of the repository’s 6 commits, +500 lines (8% of its current lines).
At h = 11, about one pair of labels in nine needs a side wire
How to read: each bar counts ordered pairs of different labels by how many points they share. Only an overlap of exactly 3 needs a side wire (section 02). Point at or focus a bar.
Show the numbers
| Points shared | Ordered pairs | Share | Side wire? |
|---|---|---|---|
| 3 | 11,550 | 10.6% | yes |
| 4 | 46,200 | 42.6% | no |
| 5 | 41,580 | 38.3% | no |
| 6 | 9,240 | 8.5% | no |
06//Status and sources
As of 14 Oct 2026What is proved, what is checked, and what is only claimed.
| Layer | Status | How |
|---|---|---|
| Main theorem: network lemmas, recursion, transfer to bits | Claimed | Written proof with every step tagged; refereed only by AI agents; not in Lean; no human referee |
| Numeric core of all three versions | Lean-checked | Exact values, padding, sign ranges, exponent bounds |
| The two parity centres (Lemmas 1.2 and 10.1) | Lean-checked | Proved for every finite set |
| The 12-slot F16 word | Lean-checked | Plus two independent Python checks |
| The network at small sizes | Computer-checked | Exact runs to h = 10 (Theorem 1) and h = 11 (E1, Aska’s check) |
| Counts at the real sizes (h = 23, 51, 92) | Re-derived | From a formula; the README says this is not independent evidence |
| Novelty | About 90% confident | The author’s literature search found no earlier claim below ½ N log2 N for circuits that cancel |
Source: README.md §2, lean/axioms.out (92 theorems, standard axioms only, no sorry), docs/NOVELTY.md. Foundation0 re-ran the Python certificates and Aska’s checker on 14 Oct 2026; we did not re-run the Lean build, so its status rests on the committed audit.
The repository
Aska’s contribution
Numbers, formulas and the gadget schedule on this page come from Swapnil Jain’s mobius-x1 (Apache-2.0, © 2026 Swapnil Jain), with the E1 check by ahrazzle. The figures are new code written for this page; they re-compute the repository’s formulas and do not copy its source. The repository has no project website, PDF or DOI; the figures here are new code written for this page.