Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
6094ec9
feat(exactTriangle): relate lopsided queries and matrix products
edemaine Oct 28, 2026
dec963a
feat(exactTriangle): prove modular counts and the selected-prime bound
edemaine Oct 28, 2026
0d8da3e
doc(threeSum): cite the lopsided triangle paper and clarify adaptatio…
edemaine Oct 28, 2026
8d80ecc
doc(bibliography): sort the new paper entry
edemaine Oct 28, 2026
fd69be7
fix(exactTriangle): repair the prime-window header and hashing docume…
edemaine Oct 28, 2026
ce646c7
feat(exactTriangle): split modular queries and recover witnesses
edemaine Oct 28, 2026
2cae26c
doc(threeSum): record finite splitting and recovery milestone
edemaine Oct 28, 2026
dc4206a
refactor(exactTriangle): reuse the natural residue bound and clarify …
edemaine Oct 28, 2026
2434f47
feat(matrix): prove the tensor recursion and pruned evaluation core
edemaine Oct 28, 2026
62dc601
doc(matrix): clarify the overlapping contributing leaf
edemaine Oct 28, 2026
4f3226c
doc(matrix): make tensor and pruning explanations standalone
edemaine Oct 28, 2026
19ee942
feat(wordram): count Chan–He collisions with native histograms
edemaine Oct 28, 2026
a712205
fix(wordram): preserve collision-counting parameters explicitly
edemaine Oct 28, 2026
844522a
feat(matrix): prove finite thin-product correctness and sparse bounds
edemaine Oct 28, 2026
5cbb93d
feat(wordram): compute Chan–He parameters from native input
edemaine Oct 28, 2026
b4936ce
doc(matrix): explain finite thin-product guarantees in the Lean API
edemaine Oct 28, 2026
0505439
fix(wordram): repair parameter proof hygiene and ceiling-log docs
edemaine Oct 28, 2026
ad3e097
feat(wordram): implement shared tensor encodings
edemaine Oct 28, 2026
3b9234d
test(wordram): connect encoder witnesses to charged runs
edemaine Oct 28, 2026
46e9e72
feat(wordram): checkpoint native pruned-query controller proofs
edemaine Oct 28, 2026
68bbe40
refactor(schonhage): reuse binomial bounds and sharpen signed tests
edemaine Oct 28, 2026
cb261f6
feat(WordRAM): prepare and encode every shared matrix band
edemaine Oct 28, 2026
87ff44c
feat(wordram): checkpoint native pruned accumulation and frame transi…
edemaine Oct 28, 2026
b3b8047
feat(wordram): checkpoint actual pruned-query root-frame stores
edemaine Oct 28, 2026
6603615
fix(nat): reuse existing tuple digit identity in band preparation
edemaine Oct 28, 2026
79c9407
feat(wordram): checkpoint complete native pruned-controller phases
edemaine Oct 28, 2026
99b8a1b
doc(matrix): replace copied source prose with API descriptions
edemaine Oct 28, 2026
12abeee
refactor(finset): use order-embedding names in OrderGlue
edemaine Oct 28, 2026
829613f
feat(WordRAM): prove all-depth pruned controller execution
edemaine Oct 28, 2026
a93c021
style(WordRAM): normalize native proof file modes
edemaine Oct 28, 2026
0c2e0eb
feat(wordram): complete initialized sparse pruned-query execution
edemaine Oct 28, 2026
60bec64
chore(wordram): combine band and query evaluator prerequisites
edemaine Oct 29, 2026
06b3563
feat(wordram): checkpoint computed wanted-query routing
edemaine Oct 29, 2026
7772a34
feat(wordram): checkpoint wanted count-pass proofs
edemaine Oct 29, 2026
702c14b
doc(finset): restore ordered-gluing source credit
SamuelSchlesinger Oct 29, 2026
ce77926
fix(wordram): address pruned-query review findings
edemaine Oct 29, 2026
48a0fa3
chore(exactTriangle): merge current main for sibling integration
codex Oct 29, 2026
3fb98bd
chore(exactTriangle): join reviewed query splitting and counting layers
codex Oct 29, 2026
0b5cfe4
chore(wordram): retain reviewed pruned-query parent repair
edemaine Oct 29, 2026
d1bc583
chore(exactTriangle): reconcile modular-hashing integration documenta…
SamuelSchlesinger Oct 29, 2026
c0b0511
chore(exactTriangle): carry hashing integration through query splitting
SamuelSchlesinger Oct 29, 2026
a76a7d3
chore(exactTriangle): carry documentation integration through native …
SamuelSchlesinger Oct 29, 2026
4f6de79
fix(imports): deduplicate aggregate after counting integration
SamuelSchlesinger Oct 29, 2026
02f1b49
fix(imports): deduplicate aggregate after query-splitting integration
SamuelSchlesinger Oct 29, 2026
60dfe9a
Merge commit '02f1b495322d8cfee81969186795670e3574defa' into coordina…
SamuelSchlesinger Oct 29, 2026
6f48d5c
Merge remote-tracking branch 'origin/main' into coordinator/integrate…
SamuelSchlesinger Oct 29, 2026
b17ece3
Merge commit '4f6de797203eb5dac02b2cadd9e8fa33e7427d57' into coordina…
SamuelSchlesinger Oct 29, 2026
e031b72
Merge remote-tracking branch 'origin/main' into coordinator/integrate…
SamuelSchlesinger Oct 29, 2026
b79ae8e
fix(imports): regenerate aggregate after Chan-He parameter integration
SamuelSchlesinger Oct 29, 2026
3187bca
chore(wordram): retain reviewed sibling source-credit fix
edemaine Oct 29, 2026
a6e4005
feat(wordram): route and group wanted thin-product queries
edemaine Oct 29, 2026
249f960
Merge commit '6f48d5c0efdfea1984c4accf368de9eaa9716b95' into coordina…
SamuelSchlesinger Oct 29, 2026
08a0415
Merge remote-tracking branch 'origin/main' into coordinator/integrate…
SamuelSchlesinger Oct 29, 2026
b0fa45b
Merge commit '08a0415413677534785113b7cf643b1ba9a6ee78' into coordina…
SamuelSchlesinger Oct 29, 2026
bd9bd2b
fix(imports): regenerate aggregate after shared-encoder integration
SamuelSchlesinger Oct 29, 2026
ab3e96c
chore(integration): reconcile splitting layer with landed hashing parent
SamuelSchlesinger Oct 29, 2026
9c8b9fc
perf(wordram): reduce native parameter proof heartbeat budget
SamuelSchlesinger Oct 29, 2026
0c9b346
Merge remote-tracking branch 'github/main' into coordinator-heartbeat…
SamuelSchlesinger Oct 29, 2026
da6a301
chore(integration): adopt splitting layer after its parent landed
SamuelSchlesinger Oct 29, 2026
452924e
chore(wordram): scope measured parameter proof budget to reduction task
SamuelSchlesinger Oct 29, 2026
6aaf569
Merge commit 'da6a301aca1e0c03e6953b3329474b2236f0fac8' into coordina…
SamuelSchlesinger Oct 29, 2026
5f6aad5
chore(integration): refresh tensor recursion supplier after hashing l…
SamuelSchlesinger Oct 29, 2026
d91296f
perf(schonhage): focus cell arithmetic and use the default heartbeat …
SamuelSchlesinger Oct 29, 2026
d8f4162
fix(doc): restore unrelated upstream coordination records
SamuelSchlesinger Oct 29, 2026
a63864f
chore(three-sum): merge corrected supplier preserving scope and sourc…
SamuelSchlesinger Oct 29, 2026
781297c
chore(three-sum): merge refreshed thin-product supplier preserving en…
SamuelSchlesinger Oct 29, 2026
1f2cfc4
Merge commit '781297cef838ef99c33e4036195e58b06ca46779' into coordina…
SamuelSchlesinger Oct 29, 2026
b4aa7b5
Merge remote-tracking branch 'origin/main' into coordinator/integrate…
SamuelSchlesinger Oct 29, 2026
780531b
fix(imports): regenerate band-preparation aggregate from merged inven…
SamuelSchlesinger Oct 29, 2026
04349d4
Merge commit '780531b426051080bb274a0511f49142af03557c' into coordina…
SamuelSchlesinger Oct 29, 2026
5bf1f0e
doc(order-glue): preserve reviewed source credit through supplier merge
SamuelSchlesinger Oct 29, 2026
ec46a4f
chore(schonhage): integrate reviewed query and band suppliers
SamuelSchlesinger Oct 29, 2026
a9d3fb9
chore(schonhage): integrate wanted routing with refreshed query supplier
SamuelSchlesinger Oct 29, 2026
91f485e
chore(schonhage): adopt actual reviewed naming-refactor supplier
SamuelSchlesinger Oct 29, 2026
a677276
Merge remote-tracking branch 'origin/main' into coordinator/refresh-1…
SamuelSchlesinger Oct 29, 2026
8a81617
Merge remote-tracking branch 'github/main' into coordinator-refresh-1…
SamuelSchlesinger Oct 29, 2026
9e9cb10
Merge commit 'a67727699b41ff9fa7d7227964d67c26699ab7f6' into coordina…
SamuelSchlesinger Oct 29, 2026
c3e1bcd
doc(order-glue): restore paper citation and finite scope
SamuelSchlesinger Oct 29, 2026
606fd61
Merge commit 'c3e1bcd3c8d9bb1dc4819d1b0a994bf52119731b' into coordina…
SamuelSchlesinger Oct 29, 2026
59c6f80
feat(wordram): checkpoint native queried-product construction (#1581)
edemaine Oct 29, 2026
9d33c95
Merge commit '606fd614454016f738d69d2cd768cb4d9a9ad795' into coordina…
SamuelSchlesinger Oct 29, 2026
936457e
Merge commit '9d33c950c695a353b20fe43fd7524f25663a4bce' into coordina…
SamuelSchlesinger Oct 29, 2026
4b2d75c
Merge remote-tracking branch 'github/main' into coordinator-queue-146…
SamuelSchlesinger Oct 29, 2026
ea38fc5
Merge remote-tracking branch 'origin/main' into coordinator/refresh-1…
SamuelSchlesinger Oct 29, 2026
6a86e25
fix(imports): regenerate thin-product aggregate after main integration
SamuelSchlesinger Oct 29, 2026
6dbd0cc
Merge commit '6a86e258db83b7724f5bd93c43c0cbc4221a992f' into coordina…
SamuelSchlesinger Oct 29, 2026
c94a52f
Merge commit '4b2d75ce50dbca1101868ed3726170770d0a3e77' into coordina…
SamuelSchlesinger Oct 29, 2026
d072322
Merge remote-tracking branch 'origin/main' into coordinator/repair-15…
SamuelSchlesinger Oct 29, 2026
61e7fe7
doc(wordram): separate shared-encoder integration records
SamuelSchlesinger Oct 29, 2026
e21cbd0
chore(integration): preserve local band-refresh preparation
SamuelSchlesinger Oct 29, 2026
d2e8386
Merge commit '38f32f97e76ad36666b99d1f0d39a64fc0ef3306' into coordina…
SamuelSchlesinger Oct 29, 2026
f55b418
Merge commit 'd2e8386e3352241f97fc1c3faa3da53c1fbb1f68' into coordina…
SamuelSchlesinger Oct 29, 2026
8f25b31
Merge commit 'f04ad02616791b3fa37ff236ac27b0a8690ca985' into coordina…
SamuelSchlesinger Oct 29, 2026
debd649
doc(matrix): keep progress links out of shared reference append block
SamuelSchlesinger Oct 29, 2026
af20863
feat(wordram): checkpoint complete queried-product source before supp…
edemaine Oct 29, 2026
cf25502
chore(wordram): merge actual reviewed queried-product supplier
edemaine Oct 29, 2026
ff31104
feat(wordram): execute queried thin-matrix products (#1581)
edemaine Oct 29, 2026
9a57e13
style(Schonhage): remove trailing space in queried products
edemaine Oct 29, 2026
37306ef
doc(Schonhage): retain band catalogue encoding contract
edemaine Oct 29, 2026
b71ae0e
Merge commit 'cf63e382d02ba396b4f8d460958d70b15735f23e' into coordina…
SamuelSchlesinger Oct 29, 2026
8527c1f
Merge commit 'cf63e382d02ba396b4f8d460958d70b15735f23e' into coordina…
SamuelSchlesinger Oct 29, 2026
82f86fe
Merge commit '8527c1f4d25246fee901303e7c0f1310d30306c0' into coordina…
SamuelSchlesinger Oct 29, 2026
d429833
Merge commit '82f86fec9b93d546f96542987255aa9f16377b3b' into coordina…
SamuelSchlesinger Oct 29, 2026
f43c26e
Merge commit '82f86fec9b93d546f96542987255aa9f16377b3b' into coordina…
SamuelSchlesinger Oct 29, 2026
168a8be
Merge commit 'f43c26edef5bc586602e0678be9f8a59759bd5f2' into coordina…
SamuelSchlesinger Oct 29, 2026
7d82da6
Merge commit 'd429833391f88fe96223bef8124be7e6b21a117f' into coordina…
SamuelSchlesinger Oct 29, 2026
70898da
fix(imports): regenerate wanted-routing aggregate from actual inventory
SamuelSchlesinger Oct 29, 2026
a8cb7c9
chore(schonhage): refresh queried products onto actual wanted parent
SamuelSchlesinger Oct 29, 2026
7cb7ade
wip(wordram): checkpoint callable thin-product source
edemaine Oct 29, 2026
904c620
chore(wordram): merge reviewed queried-product parent into callable c…
edemaine Oct 29, 2026
f5e6949
feat(WordRAM): run queried thin products in caller-owned memory
edemaine Oct 29, 2026
fd1f2fc
chore(WordRAM): merge pinned landed main into callable product child
edemaine Oct 29, 2026
ce10624
refactor(WordRAM): align ArrayNormalize module name and admission prose
edemaine Oct 29, 2026
8f46341
feat(ExactTriangle): checkpoint actual record product composition
edemaine Oct 29, 2026
8612aff
chore(ExactTriangle): merge pinned main into record product child
edemaine Oct 29, 2026
96842bb
feat(ExactTriangle): validate initialized record product adapter
edemaine Oct 29, 2026
0e10700
feat(ExactTriangle): checkpoint native candidate-verification source
edemaine Oct 29, 2026
b461744
feat(ExactTriangle): compose initialized per-record native witness re…
edemaine Oct 29, 2026
c02ed27
chore(ExactTriangle): merge pinned main for witness validation
edemaine Oct 29, 2026
888918d
chore(deps): track CSLib main and Lean rc2
SamuelSchlesinger Oct 29, 2026
9a1b754
refactor(probability): use generic infinite-sum lemmas
SamuelSchlesinger Oct 29, 2026
d7dcd79
fix(build): adapt proofs to the rc2 Mathlib API
SamuelSchlesinger Oct 29, 2026
7925011
Merge remote-tracking branch 'origin/main' into work/cslib-rc2-sync-1…
SamuelSchlesinger Oct 29, 2026
f5a70cb
test(quantum): qualify the protected matrix lemma
SamuelSchlesinger Oct 29, 2026
bb3e910
fix(build): normalize goals before proof automation
SamuelSchlesinger Oct 29, 2026
d4b0493
chore(WordRAM): finalize native record witness validation
edemaine Oct 29, 2026
0d38523
Merge commit '96fd02a85579bbbce97c02110ed80da02684cb2e' into work/csl…
SamuelSchlesinger Oct 29, 2026
2e388dc
doc(ExactTriangle): state native code bound inclusively
edemaine Oct 29, 2026
9ed4900
feat(ExactTriangle): execute the native fixed-prime catalogue
edemaine Oct 29, 2026
0749a5b
chore(ExactTriangle): merge pinned rc2 prerequisites for validation
edemaine Oct 29, 2026
b6519e9
doc(ExactTriangle): merge the exact reviewed supplier bound wording
edemaine Oct 29, 2026
0edd088
Merge commit '0d38523e96f8b431aeadc86c548c9994714f9b00' into coordina…
edemaine Oct 29, 2026
52b94d0
chore(ExactTriangle): validate fixed-prime native solver on supported…
edemaine Oct 30, 2026
741051c
Merge commit '0ba8b2e59d4d7009c814096d8bbb4a9823d06963' into coordina…
edemaine Oct 30, 2026
3cda568
chore(ExactTriangle): align fixed-prime stack with supported rc2 parent
edemaine Oct 30, 2026
14e4ba5
feat(WordRAM): implement native cyclic coefficient multiplication
edemaine Oct 30, 2026
ffa8337
feat(ExactTriangle): implement concrete cyclic Strassen counter code
edemaine Oct 30, 2026
77b8c71
chore(ExactTriangle): normalize own counter source file modes
edemaine Oct 30, 2026
c0cf4a4
feat(WordRAM): prove native Strassen forms and counter preparation st…
edemaine Oct 30, 2026
0aa2272
feat(WordRAM): prove Strassen phase bounds and native traversal base …
edemaine Oct 30, 2026
19859fe
feat(WordRAM): bound the Strassen proof recurrence by seven to the depth
edemaine Oct 30, 2026
100826d
feat(WordRAM): prove native Strassen child preparation and return stages
edemaine Oct 30, 2026
30f3af5
feat(WordRAM): prove complete native cyclic-coefficient Strassen exec…
edemaine Oct 30, 2026
bfa3de1
feat(WordRAM): prove concrete CountPrime multiplication and metadata …
edemaine Oct 30, 2026
18ea336
feat(WordRAM): prove the complete native CountPrime matrix-building loop
edemaine Oct 30, 2026
4419dca
feat(WordRAM): identify computed CountPrime matrices with existing co…
edemaine Oct 30, 2026
e1ba17a
chore(ExactTriangle): align resumed counter with pinned landed kernel
edemaine Oct 31, 2026
35a8294
fix(ExactTriangle): finish coefficient merge after UTF-8 read failure
edemaine Oct 31, 2026
f9bee16
feat(WordRAM): checkpoint native prime-selection controller code
edemaine Oct 31, 2026
165ec7e
feat(WordRAM): prove native prime-selector update and register contracts
edemaine Oct 31, 2026
3c119cc
feat(ExactTriangle): prove actual selected-coefficient counter scan
edemaine Oct 31, 2026
2c3657a
feat(ExactTriangle): compose complete native modular counter caller
edemaine Oct 31, 2026
6b4068c
feat(WordRAM): compose the complete native prime-selector loop
edemaine Oct 31, 2026
61c82f6
feat(ExactTriangle): finish initialized subcubic native modular counter
edemaine Oct 31, 2026
016471a
Merge source-complete native counter prerequisite for prime selection
edemaine Oct 31, 2026
21f64f1
feat(WordRAM): checkpoint concrete counter integration for prime sele…
edemaine Oct 31, 2026
7bc9b1c
chore(ExactTriangle): register complete native modular counter
edemaine Oct 31, 2026
02a7822
doc(Strassen): correct pinned recurrence and identity locators
edemaine Oct 31, 2026
4027bd9
Merge main into native modular counter PR #2109
edemaine Oct 31, 2026
12e121e
Merge reviewed counter PR prerequisite for native prime selection
edemaine Nov 1, 2026
1c290ca
feat(ExactTriangle): finish concrete initialized minimum-count prime …
edemaine Nov 1, 2026
f92e5c6
feat(ExactTriangle): compute compatible native dyadic parameters
edemaine Nov 1, 2026
37de625
feat(ExactTriangle): implement dirty-memory fixed-prime caller
edemaine Nov 1, 2026
69495f2
feat(ExactTriangle): complete callable fixed-prime execution and bounds
edemaine Nov 1, 2026
61fec43
chore(ExactTriangle): normalize initialized caller file mode
edemaine Nov 1, 2026
8362058
Merge commit 'b4678e2063c4de73cd39b02d1af26045e5ac6289' into work/thr…
edemaine Nov 1, 2026
dc92727
feat(ExactTriangle): finalize callable fixed-prime imports and valida…
edemaine Nov 1, 2026
b42dfbd
Merge commit 'f92e5c67141039cec07377782b35f6ac2b337a0d' into work/thr…
edemaine Nov 1, 2026
4e48de9
feat(ExactTriangle): bound computed native component costs
edemaine Nov 1, 2026
42638e9
feat(ExactTriangle): assemble parameter-selecting native solver stages
edemaine Nov 1, 2026
97fbc0f
feat(ExactTriangle): derive uniform subcubic component budgets
edemaine Nov 1, 2026
22f07e4
Merge reviewed callable fixed-prime prerequisite for cost composition
edemaine Nov 1, 2026
daef2a8
feat(ExactTriangle): prove assembled caller and initialized execution
edemaine Nov 1, 2026
57ae81b
chore(ExactTriangle): normalize assembled solver source modes
edemaine Nov 1, 2026
d8f759b
feat(ExactTriangle): expose the checked natural fast-ledger bound
edemaine Nov 1, 2026
0de6fce
feat(ExactTriangle): expose exact assembled branch charge identities
edemaine Nov 1, 2026
59c644b
Merge commit 'd8f759babd84a4a206200aafd1031aef61ab2a4f' into work/thr…
edemaine Nov 1, 2026
4205f98
feat(ExactTriangle): close concrete parameter-selecting host callee
edemaine Nov 1, 2026
c7b9fcf
feat(ExactTriangle): bound actual dyadic execution by uniform natural…
edemaine Nov 1, 2026
d75a674
feat(ExactTriangle): finalize complete parameter-selecting solver
edemaine Nov 1, 2026
3bf87f6
feat(ThreeSum): checkpoint actual packed-side magnitude transfer
edemaine Nov 1, 2026
233b273
Merge reviewed natural runtime parent for parameter-selecting ET stack
edemaine Nov 1, 2026
5aac6c0
Merge reviewed concrete ET callee for ordinary-host cost composition
edemaine Nov 1, 2026
2f6fb39
feat(ThreeSum): prove conservative native subquadratic execution
edemaine Nov 1, 2026
5a8ad9b
feat(Schonhage): add finite Section 4 box decomposition
edemaine Nov 1, 2026
80584f0
feat(Schonhage): compute native shared box tables
edemaine Nov 1, 2026
7b88ef0
test(Schonhage): cover box thresholds and deeper lookups
edemaine Nov 1, 2026
8abc2a4
Merge remote-tracking branch 'origin/main' into jc-2185
SamuelSchlesinger Nov 3, 2026
c35dc26
Merge remote-tracking branch 'origin/main' into jc-2185
SamuelSchlesinger Nov 4, 2026
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
26 changes: 26 additions & 0 deletions Complexity.lean
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,30 @@ public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BandR
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BandSplit
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BandTables
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BandThin
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Bounds
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.CatalogueLoop
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.CatalogueState
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.CatalogueWrite
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Children
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Constructor
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.DigitScan
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Digits
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Flat
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Geometry
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Index
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Initialize
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Input
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.InputLayout
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Lookup
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.LookupDigits
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.LookupLoop
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.LookupStep
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Program
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Tile
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.TileChildren
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.TileKernels
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Values
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.Callable
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.Callable.Bounds
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.Callable.Core
Expand Down Expand Up @@ -3489,6 +3513,7 @@ public import Complexity.Foundations.Data.Finset.Finpartition
public import Complexity.Foundations.Data.Finset.KthLargest
public import Complexity.Foundations.Data.Finset.KthLargest.Truncation
public import Complexity.Foundations.Data.Finset.Lowest
public import Complexity.Foundations.Data.Finset.LowestMax
public import Complexity.Foundations.Data.Finset.Markov
public import Complexity.Foundations.Data.Finset.OrderGlue
public import Complexity.Foundations.Data.Finset.OrderedFilter
Expand Down Expand Up @@ -3582,6 +3607,7 @@ public import Complexity.Foundations.Data.Nat.Prime
public import Complexity.Foundations.Data.Nat.Primrec
public import Complexity.Foundations.Data.Nat.Radix
public import Complexity.Foundations.Data.Nat.Radix.Measurement
public import Complexity.Foundations.Data.Nat.RadixUpdate
public import Complexity.Foundations.Data.Nat.RecursionTree
public import Complexity.Foundations.Data.Nat.ResidueSum
public import Complexity.Foundations.Data.Nat.SqrtLog
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/-
Copyright (c) 2026 Erik Demaine. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Erik Demaine
-/

module
-- upstream: candidate

public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Constructor
public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Flat

/-!
# Native shared geometry and compact signed box tables

The existing finite boxes are now computed as a shared native directory and compact
catalogue. Each tile fills one value per actual box from the two canonical signed
leaf arrays, and lookup reads the actual stored signed word for a valid raw cube.
The caller routines permit dirty scratch and preserve the original arrays and outside memory.

## Main definitions

* `BoxTable.geometry`: compute the shared directory and descriptor catalogue once.
* `BoxTable.tile`: reuse that geometry to fill one compact value table.
* `BoxTable.lookup`: read a valid raw cube's actual stored value.
* `BoxTable.program`: complete initialized-input constructor with a fixed 64-register bank.

## Main results

* `BoxTable.runs_wide`: original-input admission, actual initialized prefix and charged halt,
with the same final witness for the computed ranks, values and frame.
* `BoxTable.exec_lookup`: actual valid-box lookup, within `18*L+32` native instructions.
* `BoxTable.geometryTime_le`: shared geometry within `64*(L+1)^2*10^L` when `m ≤ L`.
* `BoxTable.tileTime_le`: per-tile work bounded using the existing finite box-count law.

## References

The finite boxes and recurrence are adapted from [AlmanWilliams2026, Section 4.2].
The shared directory and compact native representation are original alternatives to the
per-tile trie in the primary formal source at
[anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5](https://github.com/anthropics/formal-math/tree/16a5ce41304fcdaea4e0be7c132e1c361dc26da5/3sum-apsp/ThreeSumApsp/Programs/Sec4/Theorem30).
Both use the existing tensor terms and signed leaf-product sum, but the memory layout,
digit order and charged costs differ. Shared setup and retained tile storage remain explicit;
no global all-tile amortization, wanted-query program, Corollary 26 or tuned 1.9992 bound
is claimed.
-/
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/-
Copyright (c) 2026 Erik Demaine. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Erik Demaine
-/

module
-- upstream: candidate

public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.InputLayout
import Mathlib.Data.Nat.Log

/-!
# Original-input bounds for native compact box tables

The actual shared geometry and one tile have separate charged terms. A positive
logarithmic width threshold follows from the original depth, scalar headers, and
leaf magnitude envelopes. Neither the program nor its input reads a width certificate.
-/

public section

namespace Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable

open Cslib.WordRAM Cslib.Algorithms.MatrixMultiplication.Schonhage

/-- Shared scalar/directory/descriptor setup; this cost is paid once across tiles. -/
@[expose] def geometryTime (L m t : ℕ) : ℕ :=
4 * L + 20 + (11 * L + 28) * ((m - t + 1) * 10 ^ L)

/-- One compact value-table construction, with dirty-memory-safe scalar setup. -/
@[expose] def tileTime (L m t : ℕ) : ℕ := 328 * (boxes L m t).card + 8

/-- Original input adaptation, shared setup, one tile, and the final halt are charged. -/
@[expose] def timeBound (L m t : ℕ) : ℕ := 4 * L + 19 + geometryTime L m t + tileTime L m t + 1

/-- The physical width threshold uses only original scalar and magnitude parameters. -/
@[expose] def admissionWidth (L m t A B : ℕ) : ℕ :=
Nat.clog 2 (magnitudeBound L A B + addressBound L m t + 1) + 3

/-- Width admission remains positive at zero depth and zero operands. -/
theorem admissionWidth_pos (L m t A B : ℕ) : 0 < admissionWidth L m t A B := by
unfold admissionWidth
omega

/-- The same original-input threshold derives unsigned addresses and signed operand bounds. -/
theorem admission_bounds {W L m t A B : ℕ} (hW : admissionWidth L m t A B ≤ W) :
0 < W - 2 ∧ Fits W (addressBound L m t) ∧
GenericRAM.Signed.Fits (W - 2) (magnitudeBound L A B : ℕ) := by
have hlog := Nat.le_pow_clog (by decide : 1 < (2 : ℕ))
(magnitudeBound L A B + addressBound L m t + 1)
have hs : Nat.clog 2 (magnitudeBound L A B + addressBound L m t + 1) ≤ (W - 2) - 1 := by
unfold admissionWidth at hW
omega
have hp := Nat.pow_le_pow_right (by decide : 1 ≤ (2 : ℕ)) hs
have hmag : magnitudeBound L A B < 2 ^ ((W - 2) - 1) := by omega
have hw : 0 < W - 2 := by unfold admissionWidth at hW; omega
refine ⟨hw, ?_, hw, ?_, ?_⟩
· change addressBound L m t < 2 ^ W
have hp' := Nat.pow_le_pow_right (by decide : 1 ≤ (2 : ℕ)) (by omega :
Nat.clog 2 (magnitudeBound L A B + addressBound L m t + 1) ≤ W)
omega
· have hnonneg : 0 ≤ (magnitudeBound L A B : ℤ) := Int.natCast_nonneg _
have hpow : 0 ≤ (2 : ℤ) ^ ((W - 2) - 1) := by positivity
omega
· exact_mod_cast hmag

/-- The existing finite cardinality law controls the per-tile memoization cost. -/
theorem tileTime_le (L m t : ℕ) (hm : m ≤ L) (ht : t ≤ m) :
tileTime L m t ≤ 328 * (m + 1) * ∑ d ∈ Finset.Icc t m, beta L m d + 8 := by
have hb := card_boxes_le L m t hm ht
unfold tileTime
nlinarith only [hb]

/-- Under the usual depth bound, shared geometry is polynomial-depth times the existing
encoding-array length. This setup is independent of the number of tiles. -/
theorem geometryTime_le (L m t : ℕ) (hm : m ≤ L) :
geometryTime L m t ≤ 64 * (L + 1) ^ 2 * 10 ^ L := by
have hp : 1 ≤ 10 ^ L := Nat.one_le_pow L _ (by decide)
have hh : m - t + 1 ≤ L + 1 := by omega
have hs := Nat.mul_le_mul_right (10 ^ L) hh
have hc := Nat.mul_le_mul_left (11 * L + 28) hs
have hsmall : 4 * L + 20 ≤ (4 * L + 20) * 10 ^ L := by
simpa only [Nat.mul_one] using Nat.mul_le_mul_left (4 * L + 20) hp
calc
geometryTime L m t ≤ (4 * L + 20) * 10 ^ L +
(11 * L + 28) * ((L + 1) * 10 ^ L) := Nat.add_le_add hsmall hc
_ = (4 * L + 20 + (11 * L + 28) * (L + 1)) * 10 ^ L := by ring
_ ≤ 64 * (L + 1) ^ 2 * 10 ^ L := Nat.mul_le_mul_right _ (by nlinarith)

/-- The directory and descriptors are shared; a retained tile adds exactly one word per box. -/
theorem allocation_le (L m t : ℕ) :
memoryEnd L m t - directoryBase L ≤ 5 * ((m - t + 1) * 10 ^ L) := by
have hk := Nat.count_le (Eligible L (m - t)) (n := (m - t + 1) * 10 ^ L)
rw [count_eligible_eq_card_boxes] at hk
unfold memoryEnd valueBase recordBase
omega

/-- A fixed constructor bank and constant flat code bound, including its final halt. -/
theorem program_size_le : program.size + 1 ≤ 1024 := by decide

/-- Lookup uses the same fixed bank and bounded code, independently of the depth. -/
theorem lookup_size_le : lookup.size + 1 ≤ 256 := by decide

/-- Construction never inspects the physical width. -/
theorem not_readsWidth : ¬program.ReadsWidth := by decide

/-- Lookup never inspects the physical width. -/
theorem lookup_not_readsWidth : ¬lookup.ReadsWidth := by decide

end Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/-
Copyright (c) 2026 Erik Demaine. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Erik Demaine
-/

module
-- upstream: candidate

public import Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.CatalogueWrite

/-!
# Complete native shared-catalogue scan

The actual outer loop visits every directory slot once. Its digit scans and all
directory/record stores are charged; the compact count is Mathlib's count of the
computed eligibility predicate. Dirty memory outside the written prefixes survives.
-/

public section

namespace Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable

open Cslib.WordRAM

/-- Persistent scalar contents used by the native catalogue loop, with no run or cost fields. -/
structure CatalogueParameters (L H D R : ℕ) (x : Data registers) : Prop where
/-- Original depth. -/
levels : x.regs Reg.levels = L
/-- Computed P0/star limit. -/
height : x.regs Reg.height = H
/-- Computed decimal capacity. -/
span : x.regs Reg.span = 10 ^ L
/-- Caller directory base. -/
directory : x.regs Reg.directory = D
/-- Computed compact-record base. -/
records : x.regs Reg.records = R
/-- Computed complete slot count. -/
slots : x.regs Reg.slots = (H + 1) * 10 ^ L
/-- Scalar one. -/
one : x.regs Reg.one = 1
/-- Scalar radix. -/
ten : x.regs Reg.ten = 10
/-- Scalar P0 digit. -/
nine : x.regs Reg.nine = 9
/-- Scalar record width. -/
three : x.regs Reg.three = 3
/-- Scalar zero outside signed arithmetic. -/
nil : x.regs Reg.nil = 0

private def parameterRegisters : Finset (Fin registers) :=
{Reg.levels, Reg.height, Reg.span, Reg.directory, Reg.records, Reg.slots,
Reg.one, Reg.ten, Reg.nine, Reg.three, Reg.nil}

private theorem CatalogueParameters.of_eq {L H D R : ℕ} {x y : Data registers}
(hx : CatalogueParameters L H D R x)
(h : ∀ i ∈ parameterRegisters, y.regs i = x.regs i) :
CatalogueParameters L H D R y :=
⟨(h _ (by decide)).trans hx.levels, (h _ (by decide)).trans hx.height,
(h _ (by decide)).trans hx.span, (h _ (by decide)).trans hx.directory,
(h _ (by decide)).trans hx.records, (h _ (by decide)).trans hx.slots,
(h _ (by decide)).trans hx.one, (h _ (by decide)).trans hx.ten,
(h _ (by decide)).trans hx.nine, (h _ (by decide)).trans hx.three,
(h _ (by decide)).trans hx.nil⟩

/-- Scalar registers changed by a complete catalogue iteration. -/
@[expose] def CatalogueLocal (i : Fin registers) : Prop := InspectLocal i ∨ WriteLocal i

instance (i : Fin registers) : Decidable (CatalogueLocal i) :=
inferInstanceAs (Decidable (InspectLocal i ∨ WriteLocal i))

private theorem catalogueStep_preserves (i : Fin registers) :
¬CatalogueLocal i → catalogueStep.Preserves i := by decide +revert

private theorem parameter_not_local :
∀ i ∈ parameterRegisters, ¬CatalogueLocal i := by decide

/-- Compose the complete native digit scan with the real compact stores. -/
theorem exec_catalogueStep {w L H D R s : ℕ} (x : Data registers)
(hx : CatalogueParameters L H D R x) (hs : x.regs Reg.slot = s)
(hc : x.regs Reg.count = Nat.count (Eligible L H) s)
(hslt : s < (H + 1) * 10 ^ L)
(hfit : Fits w (D + R + 6 * ((H + 1) * 10 ^ L) + 10 ^ L + L + 12)) :
∃ y, ExecWithin w catalogueStep x y (11 * L + 26) ∧
y.mem = catalogueWrite L H D R s x.mem ∧ y.regs Reg.slot = s + 1 ∧
y.regs Reg.count = Nat.count (Eligible L H) (s + 1) ∧
CatalogueParameters L H D R y ∧
(∀ i, ¬CatalogueLocal i → y.regs i = x.regs i) := by
have hscan : Fits w (s + 10 ^ L + L + 12) := hfit.of_le (by omega)
have hwrite : Fits w (D + R + 6 * (s + 1) + 12) := hfit.of_le
(Nat.add_le_add_right ((Nat.add_le_add_left
(Nat.mul_le_mul_left 6 (Nat.succ_le_of_lt hslt)) (D + R)).trans
((Nat.le_add_right _ (10 ^ L)).trans (Nat.le_add_right _ L))) 12)
obtain ⟨u, hu, he, hcode, hpop, hstride, hmem, hframe⟩ :=
exec_inspect x hx.levels hx.span hs hx.one hx.ten hx.nine hscan
have hf (i : Fin registers) (hi : ¬InspectLocal i) : u.regs i = x.regs i := hframe i hi
obtain ⟨y, hy, hym, hys, hyc, _⟩ := exec_writeSlot u
((hf _ (by decide)).trans hx.directory) ((hf _ (by decide)).trans hx.records)
((hf _ (by decide)).trans hs) ((hf _ (by decide)).trans hx.height)
((hf _ (by decide)).trans hc) hcode he hpop hstride
((hf _ (by decide)).trans hx.one) ((hf _ (by decide)).trans hx.three)
((hf _ (by decide)).trans hx.nil) hwrite
have hwhole : ExecWithin w catalogueStep x y (11 * L + 26) :=
(hu.seq hy).mono (by omega)
have hregs (i : Fin registers) (hi : ¬CatalogueLocal i) : y.regs i = x.regs i :=
hwhole.regs_eq (catalogueStep_preserves i hi)
refine ⟨y, hwhole, ?_, hys, hyc, hx.of_eq (fun i hi =>
hregs i (parameter_not_local i hi)), hregs⟩
simpa only [hmem] using hym

/-- The actual scan fills every directory word and emits every eligible compact record once. -/
theorem exec_catalogueLoop {w L H D R : ℕ} (x : Data registers)
(hx : CatalogueParameters L H D R x)
(hslot : x.regs Reg.slot = 0) (hcount : x.regs Reg.count = 0)
(hsep : D + (H + 1) * 10 ^ L ≤ R)
(hfit : Fits w (D + R + 6 * ((H + 1) * 10 ^ L) + 10 ^ L + L + 12)) :
∃ y, ExecWithin w (.loop (.lt Reg.slot Reg.slots) catalogueStep) x y
((11 * L + 28) * ((H + 1) * 10 ^ L) + 2) ∧
CatalogueParameters L H D R y ∧ y.regs Reg.slot = (H + 1) * 10 ^ L ∧
y.regs Reg.count = Nat.count (Eligible L H) ((H + 1) * 10 ^ L) ∧
CataloguePrefix L H D R ((H + 1) * 10 ^ L) x.mem y.mem := by
let S := (H + 1) * 10 ^ L
let I (y : Data registers) : Prop :=
CatalogueParameters L H D R y ∧ y.regs Reg.slot ≤ S ∧
y.regs Reg.count = Nat.count (Eligible L H) (y.regs Reg.slot) ∧
CataloguePrefix L H D R (y.regs Reg.slot) x.mem y.mem
have hi : I x := by
refine ⟨hx, by simp [hslot, S], by simp [hslot, hcount], ?_⟩
simpa only [hslot] using CataloguePrefix.zero L H D R x.mem
have hb (y : Data registers) (hy : I y) (hg : (Cond.lt Reg.slot Reg.slots).Holds y) :
∃ z, ExecWithin w catalogueStep y z (11 * L + 26) ∧ I z ∧
S - z.regs Reg.slot < S - y.regs Reg.slot := by
obtain ⟨hp, hle, hc, hprefix⟩ := hy
have hlt : y.regs Reg.slot < S := by
simpa only [Cond.holds_lt, hp.slots, S] using hg
obtain ⟨z, hz, hzm, hzs, hzc, hzp, _⟩ :=
exec_catalogueStep y hp rfl hc hlt hfit
refine ⟨z, hz, ⟨hzp, by omega, ?_, ?_⟩, by omega⟩
· simpa only [hzs] using hzc
· rw [hzs, hzm]
exact hprefix.step hlt hsep
obtain ⟨y, hy, hIy, hstop⟩ := ExecWithin.loop_invariant I
(fun y => S - y.regs Reg.slot) hb hi
obtain ⟨hp, hle, hc, hprefix⟩ := hIy
have hdone : y.regs Reg.slot = S := by
simp only [Cond.holds_lt, hp.slots, not_lt] at hstop
exact Nat.le_antisymm hle hstop
refine ⟨y, ?_, hp, hdone, ?_, ?_⟩
· simpa only [hslot, Nat.sub_zero, S, Nat.mul_comm, Nat.add_assoc] using hy
· simpa only [hdone] using hc
· simpa only [hdone] using hprefix

end Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable
Loading
Loading