diff --git a/research/direct-flow-log-gap/README.md b/research/direct-flow-log-gap/README.md new file mode 100644 index 0000000000..3b71834adb --- /dev/null +++ b/research/direct-flow-log-gap/README.md @@ -0,0 +1,113 @@ +# The refined-induction ceiling on #4436's direct flow grows with the lockstep depth + +**Claim type:** a first-order argument plus finite floating-point evidence. **No new κ.** It follows +my correction of [#4459](https://github.com/CrocSwap/integer-mult-bounds/pull/4459). There, leaf exits +turned out to dominate, so the question becomes what the total exit coefficient of zxv's +[#4436](https://github.com/CrocSwap/integer-mult-bounds/pull/4436) direct flow can certify under +#4405's refined induction (`κ(N, z0) ≤ η = z0·m^{z0−1}`). + +## First-order picture + +- **Balance at the root.** At the unit root `t*`, where `Σ_k W_k k^t = Σ_r P_r r^t` (raw p7 gives + `t* = 0.9973135`, `s* = 0.0026865`), exits and sources carry equal `t*`-potential. The verifier + checks this to `10⁻⁹` at every rank. +- **The log-gap.** Define `g(N) = E_S[ln s] − E_X[ln e]`, with `t*`-potential weights. To first order: + + κ(N, z0) ≈ exp(−(z0 − t*)·g), η(z0) ≈ exp(−(1 − z0)(1 + ln m)). + +- **The ceiling.** The test therefore certifies savings up to about + + cap(N) = s*·g / (g + 1 + ln m), with 1 + ln 121 = 5.796. + + The first-order formula matches the exact κ to `3·10⁻⁵` across the grid. + +## Measurements (raw p7) + +`g` is a sawtooth in `N`: it drops each time the lockstep depth `G` increases. Its per-level minima +nevertheless rise steadily, by about 0.23 per level, which is a factor of about 5 in `N`. + +| G | rank of minimum | min g | cap at minimum | +| --- | --- | --- | --- | +| 1 | 1,000 | 1.977 | 0.000683 | +| 2 | 3,071 | 2.204 | 0.000740 | +| 3 | 16,135 | 2.538 | 0.000818 | +| 4 | 76,886 | 2.751 | 0.000865 | +| 5 | 384,675 | 2.954 | 0.000907 | +| 6 | 1,924,603 | 3.207 | 0.000958 (local run) | +| 7 | 9,629,156 | 3.373 | 0.000990 (local run) | + +Rows 1–5 rerun in the verifier, in about 7 seconds. Rows 6–7 come from +`evidence/gap_large.py 2e7`, whose output is `evidence/LOGGAP-LARGE.txt`, through `N = 1.73·10⁷`. + +Consistency checks: + +- In the verifier, saving 0.0008 passes at every grid rank `N ≥ 3·10⁵`, and saving 0.001 still + fails at some. +- #4456's effective savings (0.000634 at 10³, 0.000835 at 3·10⁴) sit just under these caps. + +## What drives the growth + +Decompose the log-depth `E ln(N/·)` at the per-level minima. Columns 2–5 are checked in the verifier; +columns 6–7 are local. + +| G | 2 | 3 | 4 | 5 | 6 | 7 | +| --- | --- | --- | --- | --- | --- | --- | +| leaf exits | 5.020 | 5.129 | 5.509 | 5.701 | 6.026 | 6.209 | +| boundary exits | 1.859 | 1.842 | 1.814 | 1.832 | 1.848 | 1.841 | +| sources | 2.453 | 2.362 | 2.454 | 2.440 | 2.458 | 2.462 | + +Only the leaf exits sink, and they carry about 91% of the exit potential. A leaf exit is `rρ`, with +`ρ` a product of `G` letters of `P` under the barrier `mρr ≤ N`, weighted by `cnt(ρ)ρ^t`. In log +scale this is a random walk with tilted step mean `1.6259`, killed above the barrier +`ln(N/m) ≈ G ln 5`. The relative drift is small and positive: `1.6259 − ln 5 = +0.0165`. A walk with +positive drift, conditioned to stay below a line of matching slope, behaves like a meander. Its end +gap grows like `√G`, not linearly. The data cannot separate `a + b√G` (with `b ≈ 0.97`) from linear +growth of about 0.24 per level. + +## Reading + +- **The ceiling is not bounded away from `s*`.** If `g → ∞`, the cap tends to `s*`, so #4436's + direct exponent gate plausibly closes in the limit. +- **But extremely slowly.** A saving `s` needs `g ≥ s(1 + ln m)/(s* − s)`. Saving 0.001 needs + `g ≈ 3.44`, about level 8 (`N ~ 5·10⁷`). The selected 0.0023 needs `g ≈ 34.5`. + - Under linear growth that is roughly 135 more levels, `N ~ 10^{100}`. + - Under the meander-motivated `√G` law it is `G ≈ 1,300`, `N ~ 10^{900}`. + + Both are heuristic extrapolations, not bounds. +- **The tensor/padding route is not superseded.** The direct flow is not a practical substitute for + it at κ near 0.0023, unless the induction itself is improved, for example by using several steps + of exits. + +## Not covered + +- A proof that `g → ∞`, or a rate for it. +- Second-order terms beyond the measured `3·10⁻⁵`. +- Native premises. + +## Reproduce + +```sh +python3.12 -B scripts/research_package.py --package research/direct-flow-log-gap --check-only +python3.12 -B scripts/research_package.py --package research/direct-flow-log-gap +cd research/direct-flow-log-gap && python3.12 -B evidence/gap_large.py 2e7 # ~2 min, rows 6-7 +``` + +The verifier prints `PASS_DIRECT_FLOW_LOG_GAP`, using only the standard library. + +## Open next questions + +1. **Prove the leaf meander law: is `E ln(N/e)` for leaves of order `√G`?** + - *Why it matters:* it gives the rate at which #4436's direct saving approaches the root. + - *First step:* a ballot or meander estimate for the tilted P-walk below `G ln 5`, with drift + `+0.0165`. +2. **Can a multi-step exit test beat the single-step ceiling?** + - *First step:* substitute the exits' own flows once, giving a two-step coefficient, and remeasure. + +## Credit + +- The direct flow and the gate are zxv's (#4436). +- The refined induction is 1337isnot1337's (#4405). +- The lockstep construction is Jacob Alan Sussman's Theorem 1G. + +Prepared by Ryanson Jonathan with substantial Claude Code (Claude Opus 5.5) assistance. +Apache-2.0. diff --git a/research/direct-flow-log-gap/SOURCES.json b/research/direct-flow-log-gap/SOURCES.json new file mode 100644 index 0000000000..9124bb10fe --- /dev/null +++ b/research/direct-flow-log-gap/SOURCES.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "base_commit": "2a13eb1827784206202db90e5dc8327cf8a250db", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ed33caef5c5827693e9572d252a66f99cbb73d40", + "sha256": "5732707cc1e460b090b53f2463162749ad860de878a18f7408938671d295a9d9" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "64bfc5af6709ed9811171e0a2108f05e1219cb65", + "sha256": "352a6184713b8843d96fd2c2071eb7aeaa655906b7c51d45ad444912666c8a96" + } + ] +} diff --git a/research/direct-flow-log-gap/TASK.json b/research/direct-flow-log-gap/TASK.json new file mode 100644 index 0000000000..51276fd201 --- /dev/null +++ b/research/direct-flow-log-gap/TASK.json @@ -0,0 +1,100 @@ +{ + "schema_version": 1, + "task_id": "independent-moment", + "priority_revision": 7, + "base_commit": "2a13eb1827784206202db90e5dc8327cf8a250db", + "original_card": { + "id": "independent-moment", + "question": "Does a new paid-profile or mixture-ceiling claim have independent source-bound coverage of its actual changed ledger?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/staged544-mixed-fourth-entry/README.md", + "research/staged-fourth-mixture-ceiling/README.md", + "research/r437-two-window-carrier/README.md" + ], + "methods": [ + "Independently reconstruct one changed paid ledger or pooled dual with exact source and model binding.", + "Check a genuinely uncovered moment implication with a different enclosure method and semantic controls." + ], + "acceptance_gate": "Demonstrate independence, source binding, positive cases and semantic failure controls. Name the existing checks and the missing coverage. More digits or another equivalent evaluation of an unchanged root is not by itself new verification coverage.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Choose one uncovered implication in #4088 literal mixed fill, #4091 pooled dual/model binding or #4067 changed frame/host bill. #4091 pins an earlier #4088 head: validate word, capacity and stock equivalence before applying that ceiling to the later fill.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "Independently reconstruct one changed ledger or pooled certificate with a positive case and a semantic failure control. Compare exact sources and name what existing checks miss. Keep this separate from supplier-boundary-audit (ordinary/outer dispatch) and uniform-transfer-audit (all-size proof). Stop after the chosen implication; more digits of an unchanged root are not additional mechanism coverage.", + "bottleneck_link": "Independent pricing prevents unsupported frontier claims and can reveal genuine accounting slack.", + "allowed_variations": [ + "Reconstruct either a source ledger or a numeric enclosure with a different method." + ], + "scope_change_triggers": [ + "Importing the primary function and calling its output independent verification.", + "Calling an aggregate histogram or source archive an independently accepted physical supplier." + ], + "overlap_terms": [ + "independent moment", + "rank histogram", + "exact enclosure", + "2979", + "rank7 joint endframes", + "paired extraction", + "joint lowering", + "4088", + "4091", + "4067", + "staged544-mixed-fourth-entry", + "staged-fourth-mixture-ceiling", + "r437-two-window-carrier" + ], + "existing_checks": [ + { + "scope": "PR #4088: mixed local/owner/phase ledger and moment reported.", + "evidence": "research/staged544-mixed-fourth-entry/README.md", + "remaining": "Independent binding of changed construction to paid histogram, distinct from full admission.", + "status": "author-checked", + "source_commit": "72d7efc181edb21806a878f174847c96dd410ab0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4091: sharp pooled ceiling proposed for fixed THREE/FOUR words and inventory.", + "evidence": "research/staged-fourth-mixture-ceiling/README.md", + "remaining": "Validate dual, exhaustive pattern scope and exact source equivalence before applying to newer fills.", + "status": "author-checked", + "source_commit": "a29bdd8f56cd18b805917775cdec09ff935eddc4", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4067: paid (2,2) to (1,3) exchange and fixed OQ4 host reported.", + "evidence": "research/r437-two-window-carrier/README.md", + "remaining": "Independent full cost delta; remaining caller/precision/stock obligations are separate.", + "status": "author-checked", + "source_commit": "a95f11c52e3ca1e4c5171b3c20d8f4b0815aee2e", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "refined", + "actual_scope": "Ceiling of #4405's refined-induction test on #4436's direct flow via the t*-weighted log-gap g(N).", + "scope_change_reason": "Follow-up to the #4459 correction (leaf exits dominate).", + "bottleneck_link": "Quantifies how far a direct-flow exponent (no tensor/padding) is from the selected saving.", + "budget_minutes": 45, + "stop_rule": "Stop at measurements to N ~ 1.7e7 and the first-order cap.", + "outcome": "completed", + "evidence": "Balance at t*; kappa ~ exp(-(z0-t*)g) within 3e-5; per-level minima of g: 1.98, 2.20, 2.54, 2.75, 2.95 (verifier), 3.21, 3.37 (local to 1.7e7); first-order cap 0.00068 -> 0.00099. Saving 0.0023 would need g ~ 34.5 (heuristic N ~ 1e100). Growth comes from leaf exits alone (leaf log-depth 5.02->6.21; boundary ~1.84 and sources ~2.45 fixed); tilted P-step mean exceeds ln 5 by 0.0165, suggesting a sqrt(G) meander law.", + "author": "Ryanson Jonathan, with Claude Code (Claude Opus 5.5) assistance", + "ai_assistance": "Substantial Claude Code (Claude Opus 5.5) assistance; no independent human review.", + "open_questions": [ + { + "question": "Is the leaf log-depth of order sqrt(G) (meander law)?", + "why_it_matters": "Gives the rate at which the direct saving approaches the root.", + "first_step": "Ballot/meander estimate for the tilted P-walk below G ln 5 with drift +0.0165.", + "blocked_by": "None." + } + ] +} diff --git a/research/direct-flow-log-gap/VERIFY.json b/research/direct-flow-log-gap/VERIFY.json new file mode 100644 index 0000000000..45b34b1178 --- /dev/null +++ b/research/direct-flow-log-gap/VERIFY.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "#4436 direct p7 flow, 5% grid 1000..5e5: t*-potential balance (1e-9), first-order kappa ~ exp(-(z0-t*)g) within 3e-5, per-level minima of the log-gap g increase with G (levels 2..5), saving 0.0008 passes and 0.001 fails at N>=3e5. Leaf-only growth: boundary/source log-depths stable within 0.1, leaf log-depth increasing; tilted P-step mean > ln 5." + } + ] +} diff --git a/research/direct-flow-log-gap/evidence/LOGGAP-LARGE.txt b/research/direct-flow-log-gap/evidence/LOGGAP-LARGE.txt new file mode 100644 index 0000000000..28ec5db893 --- /dev/null +++ b/research/direct-flow-log-gap/evidence/LOGGAP-LARGE.txt @@ -0,0 +1,204 @@ +root t* = 0.9973135109511491 s* = 0.0026864890488509374 f(1-0.0026865)= -0.002463961747707799 +1000 1 xt/st=1.000000000 g=1.9768 cap=0.000683 kappa(0.001)=0.996674 eta=0.994220 0s +1050 1 xt/st=1.000000000 g=1.9768 cap=0.000683 kappa(0.001)=0.996674 eta=0.994220 0s +1102 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1157 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1215 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1276 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1340 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1407 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1477 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1551 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1628 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1710 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1795 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1885 1 xt/st=1.000000000 g=2.2732 cap=0.000757 kappa(0.001)=0.996177 eta=0.994220 0s +1979 1 xt/st=1.000000000 g=2.2934 cap=0.000762 kappa(0.001)=0.996143 eta=0.994220 0s +2078 1 xt/st=1.000000000 g=2.2934 cap=0.000762 kappa(0.001)=0.996143 eta=0.994220 0s +2182 1 xt/st=1.000000000 g=2.2934 cap=0.000762 kappa(0.001)=0.996143 eta=0.994220 0s +2292 1 xt/st=1.000000000 g=2.2934 cap=0.000762 kappa(0.001)=0.996143 eta=0.994220 0s +2406 1 xt/st=1.000000000 g=2.2934 cap=0.000762 kappa(0.001)=0.996143 eta=0.994220 0s +2526 1 xt/st=1.000000000 g=2.2934 cap=0.000762 kappa(0.001)=0.996143 eta=0.994220 0s +2653 1 xt/st=1.000000000 g=2.2934 cap=0.000762 kappa(0.001)=0.996143 eta=0.994220 0s +2785 1 xt/st=1.000000000 g=2.2934 cap=0.000762 kappa(0.001)=0.996143 eta=0.994220 0s +2925 1 xt/st=1.000000000 g=2.2934 cap=0.000762 kappa(0.001)=0.996143 eta=0.994220 0s +3071 2 xt/st=1.000000000 g=2.2039 cap=0.000740 kappa(0.001)=0.996294 eta=0.994220 0s +3225 2 xt/st=1.000000000 g=2.2039 cap=0.000740 kappa(0.001)=0.996294 eta=0.994220 0s +3386 2 xt/st=1.000000000 g=2.2356 cap=0.000748 kappa(0.001)=0.996240 eta=0.994220 0s +3555 2 xt/st=1.000000000 g=2.2388 cap=0.000749 kappa(0.001)=0.996235 eta=0.994220 0s +3733 2 xt/st=1.000000000 g=2.2396 cap=0.000749 kappa(0.001)=0.996234 eta=0.994220 0s +3920 2 xt/st=1.000000000 g=2.2375 cap=0.000748 kappa(0.001)=0.996237 eta=0.994220 0s +4116 2 xt/st=1.000000000 g=2.2375 cap=0.000748 kappa(0.001)=0.996237 eta=0.994220 0s +4321 2 xt/st=1.000000000 g=2.2400 cap=0.000749 kappa(0.001)=0.996233 eta=0.994220 0s +4538 2 xt/st=1.000000000 g=2.2569 cap=0.000753 kappa(0.001)=0.996205 eta=0.994220 0s +4764 2 xt/st=1.000000000 g=2.2569 cap=0.000753 kappa(0.001)=0.996205 eta=0.994220 0s +5003 2 xt/st=1.000000000 g=2.3501 cap=0.000775 kappa(0.001)=0.996048 eta=0.994220 0s +5253 2 xt/st=1.000000000 g=2.3514 cap=0.000775 kappa(0.001)=0.996046 eta=0.994220 0s +5516 2 xt/st=1.000000000 g=2.3648 cap=0.000779 kappa(0.001)=0.996024 eta=0.994220 0s +5791 2 xt/st=1.000000000 g=2.3648 cap=0.000779 kappa(0.001)=0.996024 eta=0.994220 0s +6081 2 xt/st=1.000000000 g=2.3993 cap=0.000787 kappa(0.001)=0.995966 eta=0.994220 0s +6385 2 xt/st=1.000000000 g=2.3993 cap=0.000787 kappa(0.001)=0.995966 eta=0.994220 0s +6704 2 xt/st=1.000000000 g=2.4057 cap=0.000788 kappa(0.001)=0.995955 eta=0.994220 0s +7039 2 xt/st=1.000000000 g=2.5544 cap=0.000822 kappa(0.001)=0.995705 eta=0.994220 0s +7391 2 xt/st=1.000000000 g=2.5544 cap=0.000822 kappa(0.001)=0.995705 eta=0.994220 0s +7761 2 xt/st=1.000000000 g=2.5733 cap=0.000826 kappa(0.001)=0.995674 eta=0.994220 0s +8149 2 xt/st=1.000000000 g=2.5733 cap=0.000826 kappa(0.001)=0.995674 eta=0.994220 0s +8557 2 xt/st=1.000000000 g=2.5733 cap=0.000826 kappa(0.001)=0.995674 eta=0.994220 0s +8985 2 xt/st=1.000000000 g=2.6428 cap=0.000841 kappa(0.001)=0.995558 eta=0.994220 0s +9434 2 xt/st=1.000000000 g=2.6512 cap=0.000843 kappa(0.001)=0.995543 eta=0.994220 0s +9905 2 xt/st=1.000000000 g=2.7042 cap=0.000855 kappa(0.001)=0.995455 eta=0.994220 0s +10401 2 xt/st=1.000000000 g=2.7408 cap=0.000863 kappa(0.001)=0.995394 eta=0.994220 0s +10921 2 xt/st=1.000000000 g=2.7408 cap=0.000863 kappa(0.001)=0.995394 eta=0.994220 0s +11467 2 xt/st=1.000000000 g=2.7408 cap=0.000863 kappa(0.001)=0.995394 eta=0.994220 0s +12040 2 xt/st=1.000000000 g=2.7224 cap=0.000859 kappa(0.001)=0.995424 eta=0.994220 0s +12642 2 xt/st=1.000000000 g=2.7270 cap=0.000860 kappa(0.001)=0.995417 eta=0.994220 0s +13274 2 xt/st=1.000000000 g=2.7270 cap=0.000860 kappa(0.001)=0.995417 eta=0.994220 0s +13938 2 xt/st=1.000000000 g=2.7959 cap=0.000874 kappa(0.001)=0.995301 eta=0.994220 0s +14635 2 xt/st=1.000000000 g=2.7959 cap=0.000874 kappa(0.001)=0.995301 eta=0.994220 0s +15367 3 xt/st=1.000000000 g=2.5528 cap=0.000821 kappa(0.001)=0.995708 eta=0.994220 0s +16135 3 xt/st=1.000000000 g=2.5381 cap=0.000818 kappa(0.001)=0.995733 eta=0.994220 0s +16942 3 xt/st=1.000000000 g=2.5396 cap=0.000819 kappa(0.001)=0.995731 eta=0.994220 0s +17789 3 xt/st=1.000000000 g=2.5643 cap=0.000824 kappa(0.001)=0.995689 eta=0.994220 0s +18679 3 xt/st=1.000000000 g=2.5688 cap=0.000825 kappa(0.001)=0.995682 eta=0.994220 0s +19613 3 xt/st=1.000000000 g=2.5813 cap=0.000828 kappa(0.001)=0.995661 eta=0.994220 0s +20593 3 xt/st=1.000000000 g=2.5988 cap=0.000832 kappa(0.001)=0.995632 eta=0.994220 0s +21623 3 xt/st=1.000000000 g=2.6259 cap=0.000838 kappa(0.001)=0.995586 eta=0.994220 0s +22704 3 xt/st=1.000000000 g=2.6267 cap=0.000838 kappa(0.001)=0.995585 eta=0.994220 0s +23839 3 xt/st=1.000000000 g=2.6081 cap=0.000834 kappa(0.001)=0.995616 eta=0.994220 0s +25031 3 xt/st=1.000000000 g=2.6276 cap=0.000838 kappa(0.001)=0.995583 eta=0.994220 0s +26283 3 xt/st=1.000000000 g=2.6363 cap=0.000840 kappa(0.001)=0.995569 eta=0.994220 0s +27597 3 xt/st=1.000000000 g=2.6875 cap=0.000851 kappa(0.001)=0.995483 eta=0.994220 0s +28977 3 xt/st=1.000000000 g=2.6875 cap=0.000851 kappa(0.001)=0.995483 eta=0.994220 0s +30426 3 xt/st=1.000000000 g=2.7533 cap=0.000865 kappa(0.001)=0.995373 eta=0.994220 1s +31947 3 xt/st=1.000000000 g=2.7450 cap=0.000863 kappa(0.001)=0.995387 eta=0.994220 1s +33545 3 xt/st=1.000000000 g=2.7453 cap=0.000864 kappa(0.001)=0.995386 eta=0.994220 1s +35222 3 xt/st=1.000000000 g=2.7898 cap=0.000873 kappa(0.001)=0.995312 eta=0.994220 1s +36983 3 xt/st=1.000000000 g=2.7911 cap=0.000873 kappa(0.001)=0.995309 eta=0.994220 1s +38832 3 xt/st=1.000000000 g=2.7927 cap=0.000874 kappa(0.001)=0.995307 eta=0.994220 1s +40774 3 xt/st=1.000000000 g=2.8322 cap=0.000882 kappa(0.001)=0.995240 eta=0.994220 1s +42813 3 xt/st=1.000000000 g=2.8477 cap=0.000885 kappa(0.001)=0.995215 eta=0.994220 1s +44953 3 xt/st=1.000000000 g=2.8996 cap=0.000896 kappa(0.001)=0.995127 eta=0.994220 1s +47201 3 xt/st=1.000000000 g=2.8927 cap=0.000894 kappa(0.001)=0.995139 eta=0.994220 1s +49561 3 xt/st=1.000000000 g=2.9152 cap=0.000899 kappa(0.001)=0.995102 eta=0.994220 1s +52039 3 xt/st=1.000000000 g=2.9169 cap=0.000899 kappa(0.001)=0.995099 eta=0.994220 1s +54641 3 xt/st=1.000000000 g=2.9771 cap=0.000912 kappa(0.001)=0.994998 eta=0.994220 1s +57373 3 xt/st=1.000000000 g=3.0232 cap=0.000921 kappa(0.001)=0.994921 eta=0.994220 1s +60242 3 xt/st=1.000000000 g=3.0516 cap=0.000927 kappa(0.001)=0.994873 eta=0.994220 1s +63254 3 xt/st=1.000000000 g=3.0865 cap=0.000934 kappa(0.001)=0.994815 eta=0.994220 1s +66417 3 xt/st=1.000000000 g=3.0870 cap=0.000934 kappa(0.001)=0.994814 eta=0.994220 1s +69737 3 xt/st=1.000000000 g=3.1217 cap=0.000940 kappa(0.001)=0.994756 eta=0.994220 1s +73224 3 xt/st=1.000000000 g=3.1297 cap=0.000942 kappa(0.001)=0.994742 eta=0.994220 1s +76886 4 xt/st=1.000000000 g=2.7506 cap=0.000865 kappa(0.001)=0.995378 eta=0.994220 1s +80730 4 xt/st=1.000000000 g=2.7813 cap=0.000871 kappa(0.001)=0.995326 eta=0.994220 1s +84766 4 xt/st=1.000000000 g=2.7988 cap=0.000875 kappa(0.001)=0.995297 eta=0.994220 1s +89005 4 xt/st=1.000000000 g=2.8198 cap=0.000879 kappa(0.001)=0.995262 eta=0.994220 1s +93455 4 xt/st=1.000000000 g=2.8060 cap=0.000876 kappa(0.001)=0.995285 eta=0.994220 1s +98128 4 xt/st=1.000000000 g=2.8217 cap=0.000880 kappa(0.001)=0.995259 eta=0.994220 2s +103034 4 xt/st=1.000000000 g=2.8255 cap=0.000880 kappa(0.001)=0.995252 eta=0.994220 2s +108186 4 xt/st=1.000000000 g=2.8590 cap=0.000887 kappa(0.001)=0.995196 eta=0.994220 2s +113595 4 xt/st=1.000000000 g=2.8982 cap=0.000896 kappa(0.001)=0.995130 eta=0.994220 2s +119275 4 xt/st=1.000000000 g=2.9341 cap=0.000903 kappa(0.001)=0.995070 eta=0.994220 2s +125239 4 xt/st=1.000000000 g=2.9415 cap=0.000904 kappa(0.001)=0.995058 eta=0.994220 2s +131501 4 xt/st=1.000000000 g=2.9423 cap=0.000905 kappa(0.001)=0.995057 eta=0.994220 2s +138076 4 xt/st=1.000000000 g=2.9681 cap=0.000910 kappa(0.001)=0.995013 eta=0.994220 2s +144980 4 xt/st=1.000000000 g=2.9802 cap=0.000912 kappa(0.001)=0.994993 eta=0.994220 2s +152229 4 xt/st=1.000000000 g=2.9959 cap=0.000915 kappa(0.001)=0.994967 eta=0.994220 2s +159840 4 xt/st=1.000000000 g=3.0342 cap=0.000923 kappa(0.001)=0.994903 eta=0.994220 3s +167832 4 xt/st=1.000000000 g=3.0502 cap=0.000926 kappa(0.001)=0.994876 eta=0.994220 3s +176224 4 xt/st=1.000000000 g=3.0669 cap=0.000930 kappa(0.001)=0.994848 eta=0.994220 3s +185035 4 xt/st=1.000000000 g=3.0749 cap=0.000931 kappa(0.001)=0.994835 eta=0.994220 3s +194287 4 xt/st=1.000000000 g=3.0583 cap=0.000928 kappa(0.001)=0.994862 eta=0.994220 3s +204001 4 xt/st=1.000000000 g=3.0634 cap=0.000929 kappa(0.001)=0.994854 eta=0.994220 3s +214201 4 xt/st=1.000000000 g=3.0845 cap=0.000933 kappa(0.001)=0.994819 eta=0.994220 3s +224911 4 xt/st=1.000000000 g=3.1330 cap=0.000943 kappa(0.001)=0.994737 eta=0.994220 3s +236157 4 xt/st=1.000000000 g=3.1652 cap=0.000949 kappa(0.001)=0.994683 eta=0.994220 4s +247965 4 xt/st=1.000000000 g=3.1799 cap=0.000952 kappa(0.001)=0.994659 eta=0.994220 4s +260363 4 xt/st=1.000000000 g=3.1914 cap=0.000954 kappa(0.001)=0.994640 eta=0.994220 4s +273381 4 xt/st=1.000000000 g=3.2143 cap=0.000958 kappa(0.001)=0.994601 eta=0.994220 4s +287050 4 xt/st=1.000000000 g=3.2276 cap=0.000961 kappa(0.001)=0.994579 eta=0.994220 4s +301403 4 xt/st=1.000000000 g=3.2413 cap=0.000964 kappa(0.001)=0.994556 eta=0.994220 4s +316473 4 xt/st=1.000000000 g=3.2625 cap=0.000968 kappa(0.001)=0.994521 eta=0.994220 4s +332297 4 xt/st=1.000000000 g=3.3194 cap=0.000978 kappa(0.001)=0.994425 eta=0.994220 5s +348911 4 xt/st=1.000000000 g=3.3279 cap=0.000980 kappa(0.001)=0.994411 eta=0.994220 5s +366357 4 xt/st=1.000000000 g=3.3589 cap=0.000986 kappa(0.001)=0.994359 eta=0.994220 5s +384675 5 xt/st=1.000000000 g=2.9544 cap=0.000907 kappa(0.001)=0.995037 eta=0.994220 5s +403909 5 xt/st=1.000000000 g=2.9754 cap=0.000911 kappa(0.001)=0.995002 eta=0.994220 5s +424104 5 xt/st=1.000000000 g=2.9994 cap=0.000916 kappa(0.001)=0.994961 eta=0.994220 6s +445309 5 xt/st=1.000000000 g=3.0399 cap=0.000924 kappa(0.001)=0.994893 eta=0.994220 6s +467575 5 xt/st=1.000000000 g=3.0396 cap=0.000924 kappa(0.001)=0.994894 eta=0.994220 6s +490954 5 xt/st=1.000000000 g=3.0973 cap=0.000936 kappa(0.001)=0.994797 eta=0.994220 7s +515501 5 xt/st=1.000000000 g=3.0948 cap=0.000935 kappa(0.001)=0.994802 eta=0.994220 7s +541277 5 xt/st=1.000000000 g=3.1083 cap=0.000938 kappa(0.001)=0.994779 eta=0.994220 7s +568340 5 xt/st=1.000000000 g=3.1083 cap=0.000938 kappa(0.001)=0.994779 eta=0.994220 8s +596757 5 xt/st=1.000000000 g=3.1190 cap=0.000940 kappa(0.001)=0.994761 eta=0.994220 8s +626595 5 xt/st=1.000000000 g=3.1268 cap=0.000941 kappa(0.001)=0.994748 eta=0.994220 8s +657925 5 xt/st=1.000000000 g=3.1551 cap=0.000947 kappa(0.001)=0.994701 eta=0.994220 9s +690821 5 xt/st=1.000000000 g=3.1910 cap=0.000954 kappa(0.001)=0.994641 eta=0.994220 9s +725362 5 xt/st=1.000000000 g=3.2279 cap=0.000961 kappa(0.001)=0.994579 eta=0.994220 9s +761631 5 xt/st=1.000000000 g=3.2024 cap=0.000956 kappa(0.001)=0.994622 eta=0.994220 10s +799712 5 xt/st=1.000000000 g=3.2223 cap=0.000960 kappa(0.001)=0.994588 eta=0.994220 10s +839698 5 xt/st=1.000000000 g=3.2474 cap=0.000965 kappa(0.001)=0.994546 eta=0.994220 11s +881683 5 xt/st=1.000000000 g=3.2621 cap=0.000968 kappa(0.001)=0.994522 eta=0.994220 11s +925767 5 xt/st=1.000000000 g=3.2858 cap=0.000972 kappa(0.001)=0.994482 eta=0.994220 12s +972055 5 xt/st=1.000000000 g=3.3317 cap=0.000981 kappa(0.001)=0.994405 eta=0.994220 12s +1020658 5 xt/st=1.000000000 g=3.3443 cap=0.000983 kappa(0.001)=0.994384 eta=0.994220 12s +1071691 5 xt/st=1.000000000 g=3.3605 cap=0.000986 kappa(0.001)=0.994357 eta=0.994220 13s +1125276 5 xt/st=1.000000000 g=3.3574 cap=0.000985 kappa(0.001)=0.994362 eta=0.994220 13s +1181539 5 xt/st=1.000000000 g=3.3734 cap=0.000988 kappa(0.001)=0.994335 eta=0.994220 14s +1240616 5 xt/st=1.000000000 g=3.3874 cap=0.000991 kappa(0.001)=0.994312 eta=0.994220 14s +1302647 5 xt/st=1.000000000 g=3.4127 cap=0.000996 kappa(0.001)=0.994270 eta=0.994220 15s +1367780 5 xt/st=1.000000000 g=3.4450 cap=0.001002 kappa(0.001)=0.994216 eta=0.994220 15s +1436169 5 xt/st=1.000000000 g=3.4950 cap=0.001011 kappa(0.001)=0.994132 eta=0.994220 16s +1507977 5 xt/st=1.000000000 g=3.4723 cap=0.001007 kappa(0.001)=0.994170 eta=0.994220 16s +1583376 5 xt/st=1.000000000 g=3.4898 cap=0.001010 kappa(0.001)=0.994141 eta=0.994220 17s +1662545 5 xt/st=1.000000000 g=3.4991 cap=0.001011 kappa(0.001)=0.994125 eta=0.994220 17s +1745672 5 xt/st=1.000000000 g=3.5314 cap=0.001017 kappa(0.001)=0.994071 eta=0.994220 18s +1832956 5 xt/st=1.000000000 g=3.5594 cap=0.001022 kappa(0.001)=0.994024 eta=0.994220 18s +1924603 6 xt/st=1.000000000 g=3.2073 cap=0.000957 kappa(0.001)=0.994614 eta=0.994220 19s +2020834 6 xt/st=1.000000000 g=3.2196 cap=0.000959 kappa(0.001)=0.994593 eta=0.994220 20s +2121875 6 xt/st=1.000000000 g=3.2374 cap=0.000963 kappa(0.001)=0.994563 eta=0.994220 21s +2227969 6 xt/st=1.000000000 g=3.2504 cap=0.000965 kappa(0.001)=0.994542 eta=0.994220 22s +2339368 6 xt/st=1.000000000 g=3.2460 cap=0.000964 kappa(0.001)=0.994549 eta=0.994220 23s +2456336 6 xt/st=1.000000000 g=3.2594 cap=0.000967 kappa(0.001)=0.994526 eta=0.994220 24s +2579153 6 xt/st=1.000000000 g=3.2867 cap=0.000972 kappa(0.001)=0.994481 eta=0.994220 25s +2708110 6 xt/st=1.000000000 g=3.3184 cap=0.000978 kappa(0.001)=0.994428 eta=0.994220 26s +2843516 6 xt/st=1.000000000 g=3.3473 cap=0.000984 kappa(0.001)=0.994379 eta=0.994220 27s +2985692 6 xt/st=1.000000000 g=3.3352 cap=0.000981 kappa(0.001)=0.994400 eta=0.994220 28s +3134976 6 xt/st=1.000000000 g=3.3446 cap=0.000983 kappa(0.001)=0.994384 eta=0.994220 29s +3291725 6 xt/st=1.000000000 g=3.3580 cap=0.000986 kappa(0.001)=0.994362 eta=0.994220 31s +3456312 6 xt/st=1.000000000 g=3.3795 cap=0.000990 kappa(0.001)=0.994326 eta=0.994220 32s +3629127 6 xt/st=1.000000000 g=3.4136 cap=0.000996 kappa(0.001)=0.994269 eta=0.994220 33s +3810584 6 xt/st=1.000000000 g=3.4501 cap=0.001002 kappa(0.001)=0.994207 eta=0.994220 34s +4001113 6 xt/st=1.000000000 g=3.4641 cap=0.001005 kappa(0.001)=0.994184 eta=0.994220 35s +4201168 6 xt/st=1.000000000 g=3.4680 cap=0.001006 kappa(0.001)=0.994178 eta=0.994220 37s +4411227 6 xt/st=1.000000000 g=3.4979 cap=0.001011 kappa(0.001)=0.994127 eta=0.994220 38s +4631788 6 xt/st=1.000000000 g=3.4857 cap=0.001009 kappa(0.001)=0.994148 eta=0.994220 39s +4863378 6 xt/st=1.000000000 g=3.5068 cap=0.001013 kappa(0.001)=0.994113 eta=0.994220 40s +5106547 6 xt/st=1.000000000 g=3.5392 cap=0.001019 kappa(0.001)=0.994059 eta=0.994220 42s +5361874 6 xt/st=1.000000000 g=3.5714 cap=0.001024 kappa(0.001)=0.994005 eta=0.994220 43s +5629968 6 xt/st=1.000000000 g=3.5997 cap=0.001029 kappa(0.001)=0.993957 eta=0.994220 45s +5911466 6 xt/st=1.000000000 g=3.6180 cap=0.001032 kappa(0.001)=0.993927 eta=0.994220 46s +6207039 6 xt/st=1.000000000 g=3.6024 cap=0.001030 kappa(0.001)=0.993953 eta=0.994220 47s +6517391 6 xt/st=1.000000000 g=3.6229 cap=0.001033 kappa(0.001)=0.993919 eta=0.994220 49s +6843261 6 xt/st=1.000000000 g=3.6435 cap=0.001037 kappa(0.001)=0.993884 eta=0.994220 50s +7185424 6 xt/st=1.000000000 g=3.6769 cap=0.001043 kappa(0.001)=0.993828 eta=0.994220 52s +7544695 6 xt/st=1.000000000 g=3.7058 cap=0.001048 kappa(0.001)=0.993780 eta=0.994220 53s +7921930 6 xt/st=1.000000000 g=3.7291 cap=0.001052 kappa(0.001)=0.993741 eta=0.994220 55s +8318027 6 xt/st=1.000000000 g=3.7404 cap=0.001054 kappa(0.001)=0.993722 eta=0.994220 57s +8733928 6 xt/st=1.000000000 g=3.7666 cap=0.001058 kappa(0.001)=0.993678 eta=0.994220 58s +9170624 6 xt/st=1.000000000 g=3.7554 cap=0.001056 kappa(0.001)=0.993697 eta=0.994220 60s +9629156 7 xt/st=1.000000000 g=3.3728 cap=0.000988 kappa(0.001)=0.994337 eta=0.994220 63s +10110613 7 xt/st=1.000000000 g=3.3933 cap=0.000992 kappa(0.001)=0.994303 eta=0.994220 65s +10616144 7 xt/st=1.000000000 g=3.4335 cap=0.000999 kappa(0.001)=0.994236 eta=0.994220 68s +11146951 7 xt/st=1.000000000 g=3.4417 cap=0.001001 kappa(0.001)=0.994222 eta=0.994220 71s +11704299 7 xt/st=1.000000000 g=3.4753 cap=0.001007 kappa(0.001)=0.994166 eta=0.994220 74s +12289514 7 xt/st=1.000000000 g=3.4554 cap=0.001003 kappa(0.001)=0.994199 eta=0.994220 77s +12903990 7 xt/st=1.000000000 g=3.4789 cap=0.001008 kappa(0.001)=0.994160 eta=0.994220 80s +13549189 7 xt/st=1.000000000 g=3.4904 cap=0.001010 kappa(0.001)=0.994141 eta=0.994220 83s +14226649 7 xt/st=1.000000000 g=3.5208 cap=0.001015 kappa(0.001)=0.994090 eta=0.994220 86s +14937981 7 xt/st=1.000000000 g=3.5247 cap=0.001016 kappa(0.001)=0.994083 eta=0.994220 89s +15684880 7 xt/st=1.000000000 g=3.5691 cap=0.001024 kappa(0.001)=0.994009 eta=0.994220 92s +16469124 7 xt/st=1.000000000 g=3.5811 cap=0.001026 kappa(0.001)=0.993989 eta=0.994220 95s +17292580 7 xt/st=1.000000000 g=3.6075 cap=0.001031 kappa(0.001)=0.993945 eta=0.994220 99s +18157209 7 xt/st=1.000000000 g=3.5898 cap=0.001028 kappa(0.001)=0.993974 eta=0.994220 102s +19065070 7 xt/st=1.000000000 g=3.6081 cap=0.001031 kappa(0.001)=0.993944 eta=0.994220 105s diff --git a/research/direct-flow-log-gap/evidence/gap_large.py b/research/direct-flow-log-gap/evidence/gap_large.py new file mode 100644 index 0000000000..0dd296ecc7 --- /dev/null +++ b/research/direct-flow-log-gap/evidence/gap_large.py @@ -0,0 +1,23 @@ +import math, sys, time +from verify import flow, multis # same flow as the registered verifier +W={5:420,6:270,7:840,8:1395,9:3195,25:448,41:448,57:448,121:224} +P={1:37305,2:10695,3:3360,4:1530,5:300,8:1464,16:448,32:448,48:448} +m=121 +f=lambda t: sum(W[k]*k**t for k in W)-sum(P[r]*r**t for r in P) +lo,hi=0.99,1.0 +for _ in range(80): + mid=(lo+hi)/2 + if f(mid)>0: hi=mid + else: lo=mid +ts=(lo+hi)/2; print("root t* =",repr(ts),"s* =",1-ts, "f(1-0.0026865)=",f(1-0.0026865)) +Ns=[int(1000*1.05**i) for i in range(0,400) if 1000*1.05**i 0 and present(rho * r, tuple(x - (i == j) for j, x in enumerate(b)))) + matched += cnt * pr * D + if issued - cnt * pr * D: + add(X, rank, issued - cnt * pr * D); add(BX, rank, issued - cnt * pr * D) + for a in multis(len(ks), G): + if present(1, a): + for k in ks: add(S, k * c(a), W[k] * u(a)) + for d in range(1, G + 1): + for rho, cnt in F[d - 1].items(): + for r, pr in P.items(): + for a in multis(len(ks), G - d): + if not present(rho * r, a): continue + for i, k in enumerate(ks): + b = list(a); b[i] += 1 + if not present(rho, tuple(b)): + add(S, rho * r * c(tuple(b)), cnt * pr * u(a) * W[k]) + return dict(G=G, S=S, X=X, BX=BX, col=col, units=units, matched=matched) + + +W = {5: 420, 6: 270, 7: 840, 8: 1395, 9: 3195, 25: 448, 41: 448, 57: 448, 121: 224} +P = {1: 37305, 2: 10695, 3: 3360, 4: 1530, 5: 300, 8: 1464, 16: 448, 32: 448, 48: 448} +M = 121 + + +def need(condition, message): + if not condition: + raise AssertionError(message) + + +def root(): + f = lambda t: sum(W[k] * k ** t for k in W) - sum(P[r] * r ** t for r in P) + lo, hi = 0.99, 1.0 + need(f(lo) < 0 < f(hi), "root bracket") + for _ in range(80): + mid = (lo + hi) / 2 + lo, hi = (lo, mid) if f(mid) > 0 else (mid, hi) + return (lo + hi) / 2 + + +def main(): + ts = root() + sstar = 1 - ts + need(abs(sstar - 0.0026865) < 1e-6, "t* matches the p7 root") + rows = [] + for N in [int(1000 * 1.05 ** i) for i in range(0, 130) if 1000 * 1.05 ** i <= 5e5]: + R = flow(N, W, P) + S, X = R["S"], R["X"] + st = sum(v * s ** ts for s, v in S.items()) + xt = sum(v * e ** ts for e, v in X.items()) + need(abs(xt / st - 1) < 1e-9, f"N={N}: exit and source t*-potentials balance") + g = (sum(v * s ** ts * math.log(s) for s, v in S.items()) / st + - sum(v * e ** ts * math.log(e) for e, v in X.items()) / xt) + kap = {sv: sum(v * e ** (1 - sv) for e, v in X.items()) / sum(v * s ** (1 - sv) for s, v in S.items()) + for sv in (0.0008, 0.001)} + need(abs(kap[0.001] - math.exp(-(sstar - 0.001) * g)) < 3e-5, f"N={N}: first-order kappa") + BX = R["BX"] + leaf = {e: v - BX.get(e, 0) for e, v in X.items() if v != BX.get(e, 0)} + bd = {e: v for e, v in BX.items() if v} + depth = lambda D: sum(v * e ** ts * math.log(N / e) for e, v in D.items()) / sum(v * e ** ts for e, v in D.items()) + comp = (depth(leaf), depth(bd) if bd else None, depth(S)) + rows.append((N, R["G"], g, kap, comp)) + mins = {} + for N, G, g, _, _ in rows: + if G not in mins or g < mins[G][1]: + mins[G] = (N, g) + levels = [mins[G][1] for G in range(2, 6)] + need(all(a < b for a, b in zip(levels, levels[1:])), "per-level minima of g increase with G") + need((levels[-1] - levels[0]) / 3 > 0.15, "average growth per level above 0.15") + eta = lambda sv: (1 - sv) * M ** (-sv) + need(all(k[0.0008] < eta(0.0008) for N, G, g, k, _ in rows if N >= 3e5), "saving 0.0008 passes for N >= 3e5") + need(any(k[0.001] > eta(0.001) for N, G, g, k, _ in rows if N >= 3e5), "saving 0.001 still fails somewhere N >= 3e5") + # decomposition at the per-level minima: only the leaf exits sink; boundary exits and sources stay put + at = {N: c for N, G, g, k, c in rows} + comps = {G: at[mins[G][0]] for G in range(2, 6)} + need(all(abs(comps[G][1] - comps[2][1]) < 0.1 and abs(comps[G][2] - comps[2][2]) < 0.1 for G in comps), + "boundary-exit and source log-depths are stable across levels") + need(all(comps[a][0] < comps[b][0] for a, b in zip(range(2, 5), range(3, 6))), "leaf log-depth increases with G") + tilt = lambda D: sum(D[x] * x ** ts * math.log(x) for x in D) / sum(D[x] * x ** ts for x in D) + need(tilt(P) - math.log(5) > 0, "tilted P-step mean exceeds the barrier slope ln 5 (positive relative drift)") + cap = lambda g: sstar * g / (g + 1 + math.log(M)) + print(json.dumps({"status": "PASS_DIRECT_FLOW_LOG_GAP", "t_star": f"{ts:.12f}", "ranks": len(rows), + "per_level_min_g": {G: [mins[G][0], round(mins[G][1], 4)] for G in sorted(mins)}, + "log_depth_at_level_minima_leaf_bd_src": {G: [round(x, 4) for x in comps[G]] for G in comps}, + "tilted_P_step_mean_minus_ln5": round(tilt(P) - math.log(5), 6), + "first_order_cap_at_level_minima": {G: round(cap(mins[G][1]), 6) for G in sorted(mins)}, + "new_kappa_claimed": False}, indent=1)) + + +if __name__ == "__main__": + sys.exit(main())