diff --git a/research/p104-tree-ceiling/CHECK.txt b/research/p104-tree-ceiling/CHECK.txt new file mode 100644 index 0000000000..fccb98cb4e --- /dev/null +++ b/research/p104-tree-ceiling/CHECK.txt @@ -0,0 +1,168 @@ +CHECK.txt: fresh build of the 148 new modules of the import closure of Nov15/CongestionTree.lean (194 modules in the closure; 46 are the unchanged modules of #7668) +Toolchain leanprover/lean4:v4.33.0-rc1; Mathlib 55b7917b472489c7c56a0fa6393af05cfd536599 (an existing build of that commit, no download). + +METHOD + * Every new module compiled ALONE in dependency order, one lean process at a time: lean -j1 -o out/Nov15/X.olean Nov15/X.lean from lean/, under a 3.5 GB (3,500,000 KB) RSS watcher. + * An output directory holding only the 46 inherited oleans (copied from the build of #7668, sources byte-identical to this package) was FIRST on the module search path, then the pinned Mathlib packages. Each new module imports only modules built in this run or those 46. + * Axioms: the #print axioms lines inside the files (below). No Lean.ofReduceBool, no sorryAx, no 'declaration uses sorry' in any of the 148 logs; no sorry or native_decide appears in a command of any new source (only in comments saying so). + * lake build was not run (it would download Mathlib). + * The 46 inherited modules were NOT rebuilt for this package (their oleans are those of #7668's build of the same sources; #7668's CHECK.txt records that its CongestionI3Cfg olean came from an earlier build because the 3.5 GB guard stopped a rerun). + * Largest peak RSS of the 148 builds: 3171 MB. No module hit the guard. All 148: rc=0, errors=0, sorry warnings=0. + +AXIOMS (from the logs) +'CongestionNative.hFbT_of' depends on axioms: [propext, Classical.choice, Quot.sound] +'CongestionNative.ceiling_tree_CG' depends on axioms: [propext, Classical.choice, Quot.sound] +'CongestionNative.ceiling_tree_GD' depends on axioms: [propext, Classical.choice, Quot.sound] +'CTree.W_lower' depends on axioms: [propext, Classical.choice, Quot.sound] +'CTree.tree_regs_lower' depends on axioms: [propext, Classical.choice, Quot.sound] +'CTree.tree_piece' depends on axioms: [propext, Classical.choice, Quot.sound] + +COMPILE TABLE (module, rc, wall, peak RSS, errors, sorry warnings), build order +CTreeCore rc=0 time=5s peak=133MB errors=0 sorry=0 +CongestionTreeCore rc=0 time=17s peak=2409MB errors=0 sorry=0 +CongestionTreeW rc=0 time=10s peak=2946MB errors=0 sorry=0 +CongestionTreePiece rc=0 time=8s peak=2926MB errors=0 sorry=0 +CTreecgDefs rc=0 time=4s peak=482MB errors=0 sorry=0 +CTreecgP0 rc=0 time=5s peak=613MB errors=0 sorry=0 +CTreecgP1 rc=0 time=3s peak=590MB errors=0 sorry=0 +CTreecgP2 rc=0 time=4s peak=557MB errors=0 sorry=0 +CTreecgP3 rc=0 time=3s peak=557MB errors=0 sorry=0 +CTreecgP4 rc=0 time=4s peak=544MB errors=0 sorry=0 +CTreecgP5 rc=0 time=3s peak=556MB errors=0 sorry=0 +CTreecgP6 rc=0 time=3s peak=501MB errors=0 sorry=0 +CTreecgP7 rc=0 time=4s peak=498MB errors=0 sorry=0 +CTreecgP8 rc=0 time=3s peak=502MB errors=0 sorry=0 +CTreecgP9 rc=0 time=3s peak=505MB errors=0 sorry=0 +CTreecgP10 rc=0 time=3s peak=494MB errors=0 sorry=0 +CTreecgP11 rc=0 time=3s peak=438MB errors=0 sorry=0 +CTreecgP12 rc=0 time=3s peak=472MB errors=0 sorry=0 +CTreecgP13 rc=0 time=3s peak=480MB errors=0 sorry=0 +CTreecgP14 rc=0 time=3s peak=467MB errors=0 sorry=0 +CTreecgP15 rc=0 time=3s peak=416MB errors=0 sorry=0 +CTreecgP16 rc=0 time=3s peak=454MB errors=0 sorry=0 +CTreecgP17 rc=0 time=3s peak=416MB errors=0 sorry=0 +CTreecgP18 rc=0 time=3s peak=458MB errors=0 sorry=0 +CTreecgP19 rc=0 time=3s peak=404MB errors=0 sorry=0 +CTreecgP20 rc=0 time=3s peak=434MB errors=0 sorry=0 +CTreecgP21 rc=0 time=3s peak=403MB errors=0 sorry=0 +CTreecgP22 rc=0 time=3s peak=398MB errors=0 sorry=0 +CTreecgP23 rc=0 time=3s peak=396MB errors=0 sorry=0 +CTreecgP24 rc=0 time=3s peak=386MB errors=0 sorry=0 +CTreecgP25 rc=0 time=3s peak=400MB errors=0 sorry=0 +CTreecgP26 rc=0 time=3s peak=427MB errors=0 sorry=0 +CTreecgP27 rc=0 time=3s peak=428MB errors=0 sorry=0 +CTreecgP28 rc=0 time=3s peak=413MB errors=0 sorry=0 +CTreeDataCG rc=0 time=2s peak=107MB errors=0 sorry=0 +CTreegaDefs rc=0 time=4s peak=445MB errors=0 sorry=0 +CTreegaP0 rc=0 time=4s peak=613MB errors=0 sorry=0 +CTreegaP1 rc=0 time=4s peak=621MB errors=0 sorry=0 +CTreegaP2 rc=0 time=4s peak=586MB errors=0 sorry=0 +CTreegaP3 rc=0 time=3s peak=565MB errors=0 sorry=0 +CTreegaP4 rc=0 time=4s peak=495MB errors=0 sorry=0 +CTreegaP5 rc=0 time=3s peak=522MB errors=0 sorry=0 +CTreegaP6 rc=0 time=4s peak=538MB errors=0 sorry=0 +CTreegaP7 rc=0 time=3s peak=487MB errors=0 sorry=0 +CTreegaP8 rc=0 time=3s peak=445MB errors=0 sorry=0 +CTreegaP9 rc=0 time=2s peak=452MB errors=0 sorry=0 +CTreegaP10 rc=0 time=3s peak=449MB errors=0 sorry=0 +CTreegaP11 rc=0 time=3s peak=446MB errors=0 sorry=0 +CTreegaP12 rc=0 time=2s peak=457MB errors=0 sorry=0 +CTreegaP13 rc=0 time=3s peak=481MB errors=0 sorry=0 +CTreegaP14 rc=0 time=2s peak=409MB errors=0 sorry=0 +CTreegaP15 rc=0 time=3s peak=401MB errors=0 sorry=0 +CTreegaP16 rc=0 time=2s peak=406MB errors=0 sorry=0 +CTreegaP17 rc=0 time=2s peak=463MB errors=0 sorry=0 +CTreegaP18 rc=0 time=2s peak=411MB errors=0 sorry=0 +CTreegaP19 rc=0 time=2s peak=408MB errors=0 sorry=0 +CTreegaP20 rc=0 time=3s peak=412MB errors=0 sorry=0 +CTreegaP21 rc=0 time=2s peak=406MB errors=0 sorry=0 +CTreegaP22 rc=0 time=2s peak=405MB errors=0 sorry=0 +CTreegaP23 rc=0 time=3s peak=404MB errors=0 sorry=0 +CTreegaP24 rc=0 time=2s peak=416MB errors=0 sorry=0 +CTreegaP25 rc=0 time=2s peak=402MB errors=0 sorry=0 +CTreegaP26 rc=0 time=3s peak=414MB errors=0 sorry=0 +CTreegaP27 rc=0 time=2s peak=417MB errors=0 sorry=0 +CTreegaP28 rc=0 time=2s peak=413MB errors=0 sorry=0 +CTreeDataGA rc=0 time=3s peak=403MB errors=0 sorry=0 +CTreegbDefs rc=0 time=3s peak=447MB errors=0 sorry=0 +CTreegbP0 rc=0 time=3s peak=603MB errors=0 sorry=0 +CTreegbP1 rc=0 time=3s peak=510MB errors=0 sorry=0 +CTreegbP2 rc=0 time=3s peak=538MB errors=0 sorry=0 +CTreegbP3 rc=0 time=3s peak=554MB errors=0 sorry=0 +CTreegbP4 rc=0 time=2s peak=460MB errors=0 sorry=0 +CTreegbP5 rc=0 time=3s peak=480MB errors=0 sorry=0 +CTreegbP6 rc=0 time=3s peak=467MB errors=0 sorry=0 +CTreegbP7 rc=0 time=3s peak=459MB errors=0 sorry=0 +CTreegbP8 rc=0 time=3s peak=469MB errors=0 sorry=0 +CTreegbP9 rc=0 time=2s peak=460MB errors=0 sorry=0 +CTreegbP10 rc=0 time=3s peak=407MB errors=0 sorry=0 +CTreegbP11 rc=0 time=2s peak=480MB errors=0 sorry=0 +CTreegbP12 rc=0 time=3s peak=406MB errors=0 sorry=0 +CTreegbP13 rc=0 time=2s peak=392MB errors=0 sorry=0 +CTreegbP14 rc=0 time=3s peak=399MB errors=0 sorry=0 +CTreegbP15 rc=0 time=2s peak=416MB errors=0 sorry=0 +CTreegbP16 rc=0 time=2s peak=405MB errors=0 sorry=0 +CTreegbP17 rc=0 time=2s peak=403MB errors=0 sorry=0 +CTreegbP18 rc=0 time=2s peak=402MB errors=0 sorry=0 +CTreegbP19 rc=0 time=3s peak=403MB errors=0 sorry=0 +CTreegbP20 rc=0 time=2s peak=400MB errors=0 sorry=0 +CTreegbP21 rc=0 time=2s peak=404MB errors=0 sorry=0 +CTreegbP22 rc=0 time=3s peak=414MB errors=0 sorry=0 +CTreegbP23 rc=0 time=2s peak=416MB errors=0 sorry=0 +CTreegbP24 rc=0 time=2s peak=407MB errors=0 sorry=0 +CTreegbP25 rc=0 time=3s peak=408MB errors=0 sorry=0 +CTreegbP26 rc=0 time=2s peak=428MB errors=0 sorry=0 +CTreegbP27 rc=0 time=2s peak=419MB errors=0 sorry=0 +CTreegbP28 rc=0 time=3s peak=411MB errors=0 sorry=0 +CTreeDataGB rc=0 time=2s peak=93MB errors=0 sorry=0 +CongestionTreeCertCGDefs rc=0 time=11s peak=2296MB errors=0 sorry=0 +CongestionTreeCertCGWt0 rc=0 time=9s peak=2963MB errors=0 sorry=0 +CongestionTreeCertCGWt1 rc=0 time=6s peak=2921MB errors=0 sorry=0 +CongestionTreeCertCGWt2 rc=0 time=6s peak=2922MB errors=0 sorry=0 +CongestionTreeCertCGWt3 rc=0 time=6s peak=2994MB errors=0 sorry=0 +CongestionTreeCertCGWt4 rc=0 time=6s peak=2919MB errors=0 sorry=0 +CongestionTreeCertCGWt5 rc=0 time=6s peak=2924MB errors=0 sorry=0 +CongestionTreeCertCGWt6 rc=0 time=6s peak=2921MB errors=0 sorry=0 +CongestionTreeCertCGWt7 rc=0 time=5s peak=2914MB errors=0 sorry=0 +CongestionTreeCertCGWt8 rc=0 time=5s peak=2919MB errors=0 sorry=0 +CongestionTreeCertCGWt9 rc=0 time=6s peak=2927MB errors=0 sorry=0 +CongestionTreeCertCGWt10 rc=0 time=6s peak=2918MB errors=0 sorry=0 +CongestionTreeCertCGWt11 rc=0 time=6s peak=2915MB errors=0 sorry=0 +CongestionTreeCertCGWt12 rc=0 time=6s peak=2921MB errors=0 sorry=0 +CongestionTreeCertCGWt13 rc=0 time=6s peak=2921MB errors=0 sorry=0 +CongestionTreeCertCGWt rc=0 time=6s peak=2862MB errors=0 sorry=0 +CongestionTreeCertCGD rc=0 time=7s peak=2854MB errors=0 sorry=0 +CongestionTreeCertCGS0 rc=0 time=7s peak=3171MB errors=0 sorry=0 +CongestionTreeCertCGT0 rc=0 time=7s peak=2868MB errors=0 sorry=0 +CongestionTreeCertCGU0 rc=0 time=5s peak=2324MB errors=0 sorry=0 +CongestionTreeCertCGL0 rc=0 time=4s peak=2336MB errors=0 sorry=0 +CongestionTreeCertCGS1 rc=0 time=7s peak=3156MB errors=0 sorry=0 +CongestionTreeCertCGT1 rc=0 time=7s peak=2888MB errors=0 sorry=0 +CongestionTreeCertCGU1 rc=0 time=5s peak=2324MB errors=0 sorry=0 +CongestionTreeCertCGL1 rc=0 time=5s peak=2335MB errors=0 sorry=0 +CongestionTreeCertGDDefs rc=0 time=4s peak=2266MB errors=0 sorry=0 +CongestionTreeCertGDWt0 rc=0 time=6s peak=2923MB errors=0 sorry=0 +CongestionTreeCertGDWt1 rc=0 time=6s peak=2927MB errors=0 sorry=0 +CongestionTreeCertGDWt2 rc=0 time=6s peak=2923MB errors=0 sorry=0 +CongestionTreeCertGDWt3 rc=0 time=6s peak=2922MB errors=0 sorry=0 +CongestionTreeCertGDWt4 rc=0 time=6s peak=2920MB errors=0 sorry=0 +CongestionTreeCertGDWt5 rc=0 time=6s peak=2924MB errors=0 sorry=0 +CongestionTreeCertGDWt6 rc=0 time=5s peak=2925MB errors=0 sorry=0 +CongestionTreeCertGDWt7 rc=0 time=6s peak=2924MB errors=0 sorry=0 +CongestionTreeCertGDWt8 rc=0 time=6s peak=2919MB errors=0 sorry=0 +CongestionTreeCertGDWt9 rc=0 time=6s peak=2984MB errors=0 sorry=0 +CongestionTreeCertGDWt10 rc=0 time=6s peak=2931MB errors=0 sorry=0 +CongestionTreeCertGDWt11 rc=0 time=6s peak=2916MB errors=0 sorry=0 +CongestionTreeCertGDWt12 rc=0 time=6s peak=2923MB errors=0 sorry=0 +CongestionTreeCertGDWt13 rc=0 time=6s peak=2923MB errors=0 sorry=0 +CongestionTreeCertGDWt rc=0 time=5s peak=2864MB errors=0 sorry=0 +CongestionTreeCertGDD rc=0 time=7s peak=2854MB errors=0 sorry=0 +CongestionTreeCertGDS0 rc=0 time=7s peak=3155MB errors=0 sorry=0 +CongestionTreeCertGDT0 rc=0 time=7s peak=2868MB errors=0 sorry=0 +CongestionTreeCertGDU0 rc=0 time=5s peak=2327MB errors=0 sorry=0 +CongestionTreeCertGDL0 rc=0 time=5s peak=2357MB errors=0 sorry=0 +CongestionTreeCertGDS1 rc=0 time=7s peak=3156MB errors=0 sorry=0 +CongestionTreeCertGDT1 rc=0 time=7s peak=2868MB errors=0 sorry=0 +CongestionTreeCertGDU1 rc=0 time=5s peak=2326MB errors=0 sorry=0 +CongestionTreeCertGDL1 rc=0 time=4s peak=2385MB errors=0 sorry=0 +CongestionTree rc=0 time=6s peak=2899MB errors=0 sorry=0 diff --git a/research/p104-tree-ceiling/LICENSE b/research/p104-tree-ceiling/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-tree-ceiling/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/p104-tree-ceiling/NATIVES.md b/research/p104-tree-ceiling/NATIVES.md new file mode 100644 index 0000000000..04edef1f73 --- /dev/null +++ b/research/p104-tree-ceiling/NATIVES.md @@ -0,0 +1,62 @@ +# NATIVES: which word-level premises of the tree ceilings were computed on each word, and the script that computed it + +The tree premises themselves (`Tr` out-trees `htreeA`, `htreeB`, `hcap`, `hnd`, `hP1`, `hP2`, `hcell`) were NOT checked on any word; see the end of the table section. + +Five word files were checked against the word-level premises of `ceiling_tree_CG` and `ceiling_tree_GD` (the old ones are those of `ceiling_native_J`, #7668; the new ones are the junk count, the per-source partner bound and, for GD, the realised-edge set E48): + +| name | word | file | +|---|---|---| +| st1 | the word of #7641 | `st1.json.gz` | +| w7637 | the #7637 word | `w7637.json.gz` | +| x1t2a | the x1t2a word | `x1t2a.json.gz` | +| e1 | the #7660 word | `e1.json.gz` | +| t7669 | our reproduction of the #7669 word (not the #7669 file itself) | `t7669.json.gz` | + +All five share one port set of 104 odd-weight vectors (identical lists, same order; checked with `cmp`/`md5` on the `ports_*.txt` files extracted from the word files; no script beyond that command). The owned layers agree in mass 56 / 56 but not in shape: `t7669` has 23 rises / 23 descents and `len ks` = 36, the other four 23 / 24 and 37. Because of the shared port set the five words are close to one data point for the port-set-dependent facts (E48, the 230 shapes, the 48-cells law). **Lean treats every object in the two theorems as abstract and nothing in Lean ties a word to these hypotheses (in particular nothing ties `T`, `T.J` or `J` to a word).** The results below come from Python and C programs run on the five word files, one core each: exact integer / rational arithmetic, except that `aud.py` replays the arrival contents modulo two primes (2^61 - 1 and 2^64 - 59; both agree), so its outputs are modular, not exact-integer, computations. The programs and word files are not part of this package. "Result" means the premise as computed, not a Lean fact. + +Programs. `aud.py`, `aud2.py`, `j13.py` and `e48.c` were re-run on all five words for this package; `aud2a.py` was re-run on e1 and t7669 only (the st1, w7637, x1t2a entries are reused from #7668); `hc12.py` was re-run on t7669 only (the st1, w7637, x1t2a, e1 entries are reused from #7668); `aud2d.py` (48-cells law) was NOT re-run for this package (reused from #7668; it depends on the port set only, and t7669 shares it). Two small scripts written for this package: `cmp.py` (E48 and Lean-mask comparison, below) and `cgcmp.py` (parses the Lean `Row` definitions of `cgR`, `gaR`, `gbR`). Outputs are identical across words where stated: +- `aud.py WORD PRIME` (p = 2^61 - 1 and p = 2^64 - 59, both agree): per-arrival content replay, `J^arr`, rank M, arrival vectors, even partners per row, non-nested owned moves, chart mismatches. +- `aud2.py WORD`: public register dimension sequences (hmono, hd9, hmix) and the owned rise/descent split. +- `aud2a.py WORD`: FIX-1 split (ks, mr), hmass, hmd, hmr, hY, owned moves, Cap class. +- `j13.py`: hF and hEex as exact identities of exponential polynomials, hst ingredients, Cap margin on s in [.9, 1 - tJ0]. +- `hc12.py WORD`: `J^arr` and legal-path reachability for every junk cell. +- `aud2d.py`: the 48-cells law (max n*m over port-spanned subspaces of dimension <= 4). Reused from #7668, not re-run. +- `cmp.py`: loads the `e48.c` outputs and the `(i, dim, n, m, mask)` rows of the Lean `gaR` and `gbR` tables, decodes each row's `mask` bit by bit into the edge set `{(shape r, shape r') : mask(r) bit i(r') set}`, and compares: the 230 realised shapes equal the 230 Lean `(dim, n, m)` rows; the 48-port class equals the `gbR` edge set; each port's realised set is inside the `gaR` edge set. (Its Lean rows were read from a pickle extracted from the Lean text by an ad hoc step that was not kept as a script.) +- `cgcmp.py`: parses the rows straight from `CTree{cg,ga,gb}Defs.lean`; confirms 230 rows each with the same `(i, dim, n, m)`, `cgR` masks equal `gaR` masks (16,871 edges each), `gbR` has 11,043 edges and each `gbR` mask is a subset of the `gaR` mask. This is the only check of `cgR` (used by `ceiling_tree_CG`): it shows `cgR` has the same shapes and masks as `gaR`; no word or port set was run against `cgR` separately (the mask equality makes the `gaR` comparison apply). +- `e48.c` (new, independent of the earlier realised-edge program): for each port s and each of its 48 even partners t, all 29,212 subspaces of the 7-dimensional quotient u_t^perp / , all 2,350,136 proper nested pairs X < Y, the shape (dim + 1, n, m) of each, and the union of the (shape X, shape Y) pairs over the 48 cells of s. Run on the `ports` list of each word file. + +## Premise x word + +| premise (Lean name) | st1 | w7637 | x1t2a | e1 (#7660) | t7669 (repro of #7669) | script | +|---|---|---|---|---|---|---| +| `T.hJcard`: \|J^arr\| >= 4962 | 4962 | 4962 | 4962 | 4962 | 4962 | `aud.py` (both primes), `hc12.py` | +| `T.hfib`: each source has <= 48 partners | 48 even partners per port (4992 even cells) | 48 | 48 | 48 | 48 | `aud.py` | +| `T.hScard`: <= 104 sources | 104 ports | 104 | 104 | 104 | 104 | `aud.py` | +| hmono, hd9 | 0 violations | 0 | 0 | 0 | 0 | `aud2.py` | +| hmix (<= 5) | 5 (tight) | 5 | 5 | 5 | 5 | `aud2.py` | +| hk, hmass, hmd, hmr | true; 102; 37; 10 | same | same | same | true; 102; 36; 10 | `aud2a.py` | +| hY (104 <= st + len ks + mr) | st = 1266: 1313 | 1313 | st = 1265: 1312 | 1312 | st = 1264: 1310 | `aud2a.py`, `j13.py` | +| hF, hEex (exact identities) | coefficient difference {} | {} | {} | {} | {} | `j13.py` | +| hst | gaps >= 1, every main moves | same | same | same | same | `j13.py` | +| owned layer (rises / descents, mass) | 23 / 24, 56 / 56 | 23 / 24 | 23 / 24 | 23 / 24 | 23 / 23, 56 / 56 | `aud.py`, `aud2a.py` | +| non-nested owned moves; chart mismatches | 0; 0 | 0; 0 | 0; 0 | 0; 0 | 0; 0 | `aud.py` | +| every J^arr cell has a legal owned-descent-free path | 0 cells without | 0 | 0 | 0 | 0 | `hc12.py` | +| Cap margin on s in [.9, 1 - tJ0] | 19.349538 | 19.349538 | 19.349538 | 19.349538 | 19.017022 | `j13.py` | +| 48-cells law (max n*m over port-spanned subspaces, dim <= 4) | 48 | 48 | 48 | 48 | 48 (same port set) | `aud2d.py` (depends on the port set only) | +| **E48** (GD): port classes by realised edge set | 24 / 32 / 48 ports with 10,729 / 10,619 / 11,043 edges | identical | identical | identical | identical | `e48.c`, `cmp.py` | +| **E48** = edge set of `gbR` (the mask of each `gbr_i`, decoded) | the 48-port class equals it exactly (11,043 edges) | same | same | same | same | `e48.c` + `cmp.py` (mask decoding) | +| every port's realised set is contained in the edge set of `gaR` (16,871 edges) | yes, all 104 | yes | yes | yes | yes | `e48.c` + `cmp.py` | + +Reading the table against the Lean statements: +- E48 depends only on the port set. The five `ports` lists are identical (same order), so the five `e48.c` outputs are byte-identical (same md5). The shape list produced (230 shapes) has exactly the (dim, n, m) triples of the Lean rows. In Lean, `ceiling_tree_GD` assumes `|S| <= 104`, `Bset ⊆ S` with `48 <= |Bset|` (trees from `gbR`, `gbr0`) and trees from `gaR`, `gar0` for `S \ Bset` (`ceiling_tree_CG` uses `cgR`, `cgr0` for all sources). The check shows that the 48 ports of one class have a realised edge set equal to the `gbR` mask, and the other 56 ports have realised sets inside the `gaR` mask. Which sources go in `Bset` is part of the hypothesis `T`. +- The count behind E48 (a (3,4,12) chart and a (5,8,6) chart cover only 1,344 of the 4,992 even cells) was not recomputed here, no script of this package checks it, and it is not in Lean; `e48.c` recomputes the edge sets themselves, which is what `gbR` encodes. +- The edge sets were computed over all 4,992 even cells, a superset of J^arr (4,962 cells), so they are an upper set of the realised edges of the junk cells; that direction is the sound one for a relaxation. +- `hcong`, `hdist`, `hspMono`, `hcstMono`, `hcstMonoT`, the spF / cst brackets (`hcst0`, `hcst1`, `hspTab*`, `hcstTab*`) are word-independent or paper statements, as in #7668. **The tree premises `Tr` out-trees (`htreeA`, `htreeB`), `hcap`, `hnd`, `hP1`, `hP2`, `hcell` are open hypotheses: no script was run to check them on any of the five words, and none is verified.** The same holds for the remaining `TreeData` fields that concern trees and charges (`hMv`, `hMsub`, `hdim`, `hxk`, `x`, `R`, `ms`); `hJS`, `hB`, `hBcard` and `T.J`, `T.S` are likewise not tied to a word in Lean (only the counts 4962, 48, 104 were computed, in the table). `e48.c` checks all nested quotient pairs on 4,992 even cells, not the arrival trees of any word. The premises are the paper premises (nested moves, the I2 capacity n(A) per move, the I2 charge aggregated by moves) in the form of `PROVED.md`. This table therefore does not show that any word satisfies all hypotheses of the tree theorems. +- On t7669, `aud2d.py` was not run (port set only), and `hc8.py`, `hc11.py`, `aud2c.py` (forced cells, decoder-route ranks, informational route checks) were not run; none is a premise of the two theorems except through the table rows above. + +## What is not covered + +- Words with |J^arr| < 4962 and decoders that are not rank 8 with C = 56: outside `hJcard` as stated (the class-wide bound is a conjecture, as in #7668). +- Decoders with 9 or more rows: `ceiling_native_J` hard-codes `corrC <= 8 * cH` and `capC >= unLo / 48`, and the tree theorems inherit this. +- That the tree premises hold for any word, these five included, is not checked. +- Port sets other than the one 104-port set: the 230 shapes, `E48` and the 48-port class were computed for this port set only. `hmix` is 5 (tight) on all five words, so a word with `hmix > 5` is outside the hypotheses. diff --git a/research/p104-tree-ceiling/PROVED.md b/research/p104-tree-ceiling/PROVED.md new file mode 100644 index 0000000000..abf1619d77 --- /dev/null +++ b/research/p104-tree-ceiling/PROVED.md @@ -0,0 +1,327 @@ +# PROVED: statements of the new theorems, copied from the Lean sources + +Generated by a script (`gendocs.py`) that copies each statement (everything before `:=`) verbatim from `lean/Nov15/*.lean`. The Lean text is authoritative; every hypothesis in a statement is a hypothesis. `ceiling_tree_CG` and `ceiling_tree_GD` print axioms [propext, Classical.choice, Quot.sound] (CHECK.txt). Nothing here is a statement about a particular word: `R, nR, dR, n, ks, mr, st, E, J, distF, spF, cstF` and the tree data `T` are abstract, and Lean does not tie `T`, `T.J` or `J` to any word or to each other. + +Both theorems conclude for `t` in `[t0, 1]` (that is, `t0 ≤ t ≤ 1`), `Finv (1 - t) (invoice (caller 6 7) n 17) < 0`, with `t0 = a0CG` (CG) and `a0GD` (GD): the caller is `caller 6 7` and the number of calls is `L = 17`. + +The two statements share 32 explicit binders with `ceiling_native_J` (#7668), preceded by the implicit `{ι : Type*} [DecidableEq ι]`: `R nR dR hmono hd9 hmix n ks mr st E J distF spF cstF hk hmass hmd hmr hF hY hst hEex hcong hdist hJ hspMono hcstMono hspTab hcstTab hspTabJ hcstTabJ`. Their text is identical to that theorem's (compared by `hyps.py`, which extracts the binders from both Lean files). The new binders are `{σ ρ μ : Type}` with `DecidableEq`, `T`, `hcstMonoT`, `hcst0`, `hcst1`, `hP1`, `hP2`. All of them are hypotheses, and so are all fields of `T : TreeData`: `J S Bset Mv Mreg Mun dA dB nm ms R x` and the propositions `hJS hScard hfib hJcard hB hBcard hcell hxk htreeA htreeB hnd hMv hcap hMsub hdim`. The Tr out-tree hypotheses (`htreeA`, `htreeB`) and `hcap`, `hnd`, `hP1`, `hP2`, `hcell` are open hypotheses; no script has checked them on any word (see `NATIVES.md`). Definitions of `cgR cgr0 gaR gar0 gbR gbr0 cfC dLo Fup Fc` are copied in Appendix B at the end. + +## CongestionTree.ceiling_tree_CG +```lean +theorem ceiling_tree_CG + {ι : Type*} [DecidableEq ι] + (R : Finset ι) (nR : ι → ℕ) (dR : ι → ℕ → ℕ) + (hmono : ∀ r ∈ R, ∀ i < nR r, dR r i ≤ dR r (i + 1)) (hd9 : ∀ r ∈ R, dR r (nR r) ≤ 9) + (hmix : (R.filter fun r => Mixed dR nR r).card ≤ 5) + (n : Inv) (ks : List ℕ) (mr st : ℕ) (E : ℝ → ℝ) (J : Finset (ℕ × ℕ)) (distF : ℝ → ℕ × ℕ → ℝ) (spF cstF : ℝ → ℝ) + (hk : ∀ k ∈ ks, 1 ≤ k ∧ k ≤ 9) (hmass : 56 ≤ ks.sum) (hmd : 8 ≤ ks.length) (hmr : 8 ≤ mr) + (hF : ∀ s, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - dprice ks s - mr - E s) + (hY : 104 ≤ st + (ks.length + mr)) + (hst : ∀ s, 0 ≤ s → s ≤ 1 → (2 - (2 : ℝ) ^ s) * st ≤ E s) + (hEex : ∀ s, 0 ≤ s → s ≤ 1 → ∑ r ∈ R, ex (gs s) (lev dR r) (nR r) ≤ E s) + (hcong : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tJ0 : ℚ) : ℝ) → + ∑ p ∈ J, min (distF s p) (capC s) - corrC cstF s ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hdist : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tJ0 : ℚ) : ℝ) → ∀ p ∈ J, spF (1 - s) ≤ distF s p) + (hJ : 4962 ≤ J.card) + (hspMono : MonotoneOn spF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hcstMono : MonotoneOn cstF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hspTab : ((spFloC0 : ℚ) : ℝ) ≤ spF ((tC0 : ℚ) : ℝ) ∧ ((spFloC1 : ℚ) : ℝ) ≤ spF ((tC1 : ℚ) : ℝ) ∧ + ((spFloC2 : ℚ) : ℝ) ≤ spF ((tC2 : ℚ) : ℝ) ∧ ((spFloC3 : ℚ) : ℝ) ≤ spF ((tC3 : ℚ) : ℝ)) + (hcstTab : cstF ((tC1 : ℚ) : ℝ) ≤ ((cHC0 : ℚ) : ℝ) ∧ cstF ((tC2 : ℚ) : ℝ) ≤ ((cHC1 : ℚ) : ℝ) ∧ + cstF ((tC3 : ℚ) : ℝ) ≤ ((cHC2 : ℚ) : ℝ) ∧ cstF (1 / 10) ≤ ((cHC3 : ℚ) : ℝ)) + (hspTabJ : ((spFloJ0 : ℚ) : ℝ) ≤ spF ((tJ0 : ℚ) : ℝ) ∧ ((spFloJ1 : ℚ) : ℝ) ≤ spF ((tJ1 : ℚ) : ℝ) ∧ + ((spFloJ2 : ℚ) : ℝ) ≤ spF ((tJ2 : ℚ) : ℝ)) + (hcstTabJ : cstF ((tJ1 : ℚ) : ℝ) ≤ ((cHJ0 : ℚ) : ℝ) ∧ cstF ((tJ2 : ℚ) : ℝ) ≤ ((cHJ1 : ℚ) : ℝ) ∧ + cstF ((tC0 : ℚ) : ℝ) ≤ ((cHJ2 : ℚ) : ℝ)) + {σ ρ μ : Type} [DecidableEq σ] [DecidableEq ρ] [DecidableEq μ] + (T : CTree.TreeData σ ρ μ CTree.cgR CTree.cgR CTree.cgr0 CTree.cgr0 0) + (hcstMonoT : MonotoneOn cstF (Set.Icc ((a0CG : ℚ) : ℝ) (1 / 10))) + (hcst0 : cstF ((tCG1 : ℚ) : ℝ) ≤ ((cHCG0 : ℚ) : ℝ)) + (hcst1 : cstF ((tCG2 : ℚ) : ℝ) ≤ ((cHCG1 : ℚ) : ℝ)) + (hP1 : ∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0CG : ℚ) : ℝ) → + ∑ e ∈ T.Mreg, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) + capC s * ∑ x ∈ T.S, (T.x x : ℝ) ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hP2 : ∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0CG : ℚ) : ℝ) → + ∑ e ∈ T.Mun, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) ≤ corrC cstF s) : + ∀ t : ℝ, ((a0CG : ℚ) : ℝ) ≤ t → t ≤ 1 → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 +``` + +## CongestionTree.ceiling_tree_GD +```lean +theorem ceiling_tree_GD + {ι : Type*} [DecidableEq ι] + (R : Finset ι) (nR : ι → ℕ) (dR : ι → ℕ → ℕ) + (hmono : ∀ r ∈ R, ∀ i < nR r, dR r i ≤ dR r (i + 1)) (hd9 : ∀ r ∈ R, dR r (nR r) ≤ 9) + (hmix : (R.filter fun r => Mixed dR nR r).card ≤ 5) + (n : Inv) (ks : List ℕ) (mr st : ℕ) (E : ℝ → ℝ) (J : Finset (ℕ × ℕ)) (distF : ℝ → ℕ × ℕ → ℝ) (spF cstF : ℝ → ℝ) + (hk : ∀ k ∈ ks, 1 ≤ k ∧ k ≤ 9) (hmass : 56 ≤ ks.sum) (hmd : 8 ≤ ks.length) (hmr : 8 ≤ mr) + (hF : ∀ s, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - dprice ks s - mr - E s) + (hY : 104 ≤ st + (ks.length + mr)) + (hst : ∀ s, 0 ≤ s → s ≤ 1 → (2 - (2 : ℝ) ^ s) * st ≤ E s) + (hEex : ∀ s, 0 ≤ s → s ≤ 1 → ∑ r ∈ R, ex (gs s) (lev dR r) (nR r) ≤ E s) + (hcong : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tJ0 : ℚ) : ℝ) → + ∑ p ∈ J, min (distF s p) (capC s) - corrC cstF s ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hdist : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tJ0 : ℚ) : ℝ) → ∀ p ∈ J, spF (1 - s) ≤ distF s p) + (hJ : 4962 ≤ J.card) + (hspMono : MonotoneOn spF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hcstMono : MonotoneOn cstF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hspTab : ((spFloC0 : ℚ) : ℝ) ≤ spF ((tC0 : ℚ) : ℝ) ∧ ((spFloC1 : ℚ) : ℝ) ≤ spF ((tC1 : ℚ) : ℝ) ∧ + ((spFloC2 : ℚ) : ℝ) ≤ spF ((tC2 : ℚ) : ℝ) ∧ ((spFloC3 : ℚ) : ℝ) ≤ spF ((tC3 : ℚ) : ℝ)) + (hcstTab : cstF ((tC1 : ℚ) : ℝ) ≤ ((cHC0 : ℚ) : ℝ) ∧ cstF ((tC2 : ℚ) : ℝ) ≤ ((cHC1 : ℚ) : ℝ) ∧ + cstF ((tC3 : ℚ) : ℝ) ≤ ((cHC2 : ℚ) : ℝ) ∧ cstF (1 / 10) ≤ ((cHC3 : ℚ) : ℝ)) + (hspTabJ : ((spFloJ0 : ℚ) : ℝ) ≤ spF ((tJ0 : ℚ) : ℝ) ∧ ((spFloJ1 : ℚ) : ℝ) ≤ spF ((tJ1 : ℚ) : ℝ) ∧ + ((spFloJ2 : ℚ) : ℝ) ≤ spF ((tJ2 : ℚ) : ℝ)) + (hcstTabJ : cstF ((tJ1 : ℚ) : ℝ) ≤ ((cHJ0 : ℚ) : ℝ) ∧ cstF ((tJ2 : ℚ) : ℝ) ≤ ((cHJ1 : ℚ) : ℝ) ∧ + cstF ((tC0 : ℚ) : ℝ) ≤ ((cHJ2 : ℚ) : ℝ)) + {σ ρ μ : Type} [DecidableEq σ] [DecidableEq ρ] [DecidableEq μ] + (T : CTree.TreeData σ ρ μ CTree.gaR CTree.gbR CTree.gar0 CTree.gbr0 48) + (hcstMonoT : MonotoneOn cstF (Set.Icc ((a0GD : ℚ) : ℝ) (1 / 10))) + (hcst0 : cstF ((tGD1 : ℚ) : ℝ) ≤ ((cHGD0 : ℚ) : ℝ)) + (hcst1 : cstF ((tGD2 : ℚ) : ℝ) ≤ ((cHGD1 : ℚ) : ℝ)) + (hP1 : ∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0GD : ℚ) : ℝ) → + ∑ e ∈ T.Mreg, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) + capC s * ∑ x ∈ T.S, (T.x x : ℝ) ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hP2 : ∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0GD : ℚ) : ℝ) → + ∑ e ∈ T.Mun, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) ≤ corrC cstF s) : + ∀ t : ℝ, ((a0GD : ℚ) : ℝ) ≤ t → t ≤ 1 → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 +``` + +## CongestionTree.hFbT_of (monotonicity of the base F on the window; no hypothesis beyond its numeric inputs) +```lean +theorem hFbT_of (a0 a b L : ℚ) (hd : 0 < dLo cfC (93 / 100) (1 - a0)) (ha00 : 0 ≤ a0) (hb93 : 93 / 100 ≤ 1 - b) (hab : a ≤ b) + (haJ : a0 ≤ a) (hpt : Fup cfC (1 - a) (1 - a) < 17 * L) : + ∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → Fc cfC s < 17 * (L : ℝ) +``` + +## CongestionTreeCore.TreeData (the tree data `T`; every field is a hypothesis of the theorems) +```lean +structure TreeData (σ ρ μ : Type) [DecidableEq σ] [DecidableEq ρ] [DecidableEq μ] + (rsA rsB : List Row) (rootA rootB : Row) (nB : ℕ) where + J : Finset (σ × ρ) + S : Finset σ + Bset : Finset σ + Mv : Finset μ + Mreg : Finset μ + Mun : Finset μ + dA : μ → ℕ + dB : μ → ℕ + nm : μ → ℕ + ms : σ → List μ + R : σ → Finset ρ + x : σ → ℕ + hJS : ∀ p ∈ J, p.1 ∈ S + hScard : S.card ≤ 104 + hfib : ∀ s ∈ S, (J.filter fun p => p.1 = s).card ≤ 48 + hJcard : 4962 ≤ J.card + hB : Bset ⊆ S + hBcard : nB ≤ Bset.card + hcell : ∀ s ∈ S, (J.filter fun p => p.1 = s).card ≤ x s + (R s).card + hxk : ∀ s ∈ S, x s ≤ (J.filter fun p => p.1 = s).card + htreeA : ∀ s ∈ S, s ∉ Bset → Tr rsA nm dA dB rootA (R s) (ms s) + htreeB : ∀ s ∈ Bset, Tr rsB nm dA dB rootB (R s) (ms s) + hnd : ∀ s ∈ S, (ms s).Nodup + hMv : ∀ s ∈ S, ∀ e ∈ ms s, e ∈ Mv + hcap : ∀ e ∈ Mv, (S.filter fun s => e ∈ ms s).card ≤ nm e + hMsub : Mv ⊆ Mreg ∪ Mun + hdim : ∀ e ∈ Mreg ∪ Mun, 1 ≤ dA e ∧ dA e < dB e ∧ dB e ≤ 8 +``` + +## CongestionTreeCore.Tr (out-trees of charts; its constructor premises are hypotheses on each tree) +```lean +inductive Tr (rs : List Row) (nm dA dB : μ → ℕ) : Row → Finset ρ → List μ → Prop + | node (r : Row) (R : Finset ρ) (ch : List (Row × Finset ρ × μ × List μ)) + (hr : r ∈ rs) + (hsub : ∀ c ∈ ch, Tr rs nm dA dB c.1 c.2.1 c.2.2.2) + (hside : ∀ c ∈ ch, c.1 ∈ rs ∧ r.ok c.1 = true ∧ nm c.2.2.1 = r.n ∧ dA c.2.2.1 = r.dim ∧ + dB c.2.2.1 = c.1.dim ∧ c.2.1.card ≤ c.1.m) + (hm : R.card ≤ r.m) + (hcov : r.dim ≠ 8 → R ⊆ (ch.map fun c => c.2.1).foldr (· ∪ ·) ∅) : + Tr rs nm dA dB r R (ch.flatMap fun c => c.2.2.1 :: c.2.2.2) +``` + +## CTreeCore.Row and CongestionTreeCore.lineOK +```lean +structure Row where + i : Nat + dim : Nat + n : Nat + m : Nat + mask : Nat + g : List Nat + ge : List Nat + +def Row.ok (r r' : Row) : Bool := + decide (r.dim < r'.dim) && decide (r.n ≤ r'.n) && decide (r'.m ≤ r.m) && ((r.mask >>> r'.i) % 2 == 1) + +def lineOK (rA rB : Row) (capI lam gA gB : ℕ) : Bool := + (List.range 49).all (fun x => (List.range 49).all (fun r => + decide (lam * min 48 (x + r) ≤ gv rA r + x * capI + gA) && decide (lam * min 48 (x + r) ≤ gv rB r + x * capI + gB))) + && decide (gB ≤ gA) +``` + +## Appendix: definitions and values (copied from the Lean sources) + +### Breakpoints and brackets of the new pieces (`CongestionTreeCertCGDefs.lean`, `CongestionTreeCertGDDefs.lean`); the t0 of the theorems are `a0CG` and `a0GD` +```lean +def tTJ0 : ℚ := 118103 / 10 ^ 7 +def a0CG : ℚ := (58847 : ℚ) / 5000000 +def tCG0 : ℚ := (58847 : ℚ) / 5000000 +def tCG1 : ℚ := (7359 : ℚ) / 625000 +def sgCG0 : ℚ := (48493 : ℚ) / 1000000 +def cHCG0 : ℚ := (9093 : ℚ) / 312500 +def lcpCG0 : ℚ := (28276807 : ℚ) / 1000000 +def unLoCG0 : ℚ := (96364203646413 : ℚ) / 100000000000000 +def capICG0 : ℕ := 2007587575966 +def lamCG0 : ℕ := 574558412032 +def gACG0 : ℕ := 36 +def gBCG0 : ℕ := 36 +def tCG2 : ℚ := (118103 : ℚ) / 10000000 +def sgCG1 : ℚ := (12231 : ℚ) / 250000 +def cHCG1 : ℚ := (72963 : ℚ) / 2500000 +def lcpCG1 : ℚ := (14138053 : ℚ) / 500000 +def unLoCG1 : ℚ := (12044162755641 : ℚ) / 12500000000000 +def capICG1 : ℕ := 2007360459273 +def lamCG1 : ℕ := 574558412032 +def gACG1 : ℕ := 36 +def gBCG1 : ℕ := 36 + +def tTJ0GD : ℚ := 118103 / 10 ^ 7 +def a0GD : ℚ := (467 : ℚ) / 40000 +def tGD0 : ℚ := (467 : ℚ) / 40000 +def tGD1 : ℚ := (73 : ℚ) / 6250 +def sgGD0 : ℚ := (48111 : ℚ) / 1000000 +def cHGD0 : ℚ := (9021 : ℚ) / 312500 +def lcpGD0 : ℚ := (29075199 : ℚ) / 1000000 +def unLoGD0 : ℚ := (19278574995077 : ℚ) / 20000000000000 +def capIGD0 : ℕ := 2008184895320 +def lamGD0 : ℕ := 648426768687 +def gAGD0 : ℕ := 3764747108290 +def gBGD0 : ℕ := 1584459010234 +def tGD2 : ℚ := (118103 : ℚ) / 10000000 +def sgGD1 : ℚ := (249 : ℚ) / 5000 +def cHGD1 : ℚ := (72963 : ℚ) / 2500000 +def lcpGD1 : ℚ := (5814531 : ℚ) / 200000 +def unLoGD1 : ℚ := (12044162755641 : ℚ) / 12500000000000 +def capIGD1 : ℕ := 2007360459273 +def lamGD1 : ℕ := 648426768687 +def gAGD1 : ℕ := 3764747108290 +def gBGD1 : ℕ := 1584459010234 +``` + +### T1 breakpoints, cst brackets and spF lower bounds (`CongestionNativeJDefs.lean`) +```lean +def tJ0 : ℚ := 118103 / 10 ^ 7 +def tJ1 : ℚ := 118123 / 10 ^ 7 +def tJ2 : ℚ := 120123 / 10 ^ 7 +def cHJ0 : ℚ := 291901 / 10 ^ 7 +def cHJ1 : ℚ := 296781 / 10 ^ 7 +def cHJ2 : ℚ := 336819 / 10 ^ 7 +def spFloJ0 : ℚ := 113518785551 / 20000000000000 +def spFloJ1 : ℚ := 17740285593 / 3125000000000 +def spFloJ2 : ℚ := 577208719357 / 100000000000000 +``` + +### C-class breakpoints (`CongestionI3DualConst.lean`) +```lean +def tC0 : ℚ := 136564 / 10 ^ 7 +def tC1 : ℚ := 136584 / 10 ^ 7 +def tC2 : ℚ := 137584 / 10 ^ 7 +def tC3 : ℚ := 237584 / 10 ^ 7 +``` + +### C-class brackets (T1 `hspTab`, `hcstTab`) (`CongestionNativeTab.lean`) +```lean +def spFloC0 : ℚ := 131069767447 / 20000000000000 +def spFloC1 : ℚ := 655443767027 / 100000000000000 +def spFloC2 : ℚ := 26407594739 / 4000000000000 +def spFloC3 : ℚ := 141372084217 / 12500000000000 +def cHC0 : ℚ := 84217 / 2500000 +def cHC1 : ℚ := 339299 / 10 ^ 7 +def cHC2 : ℚ := 579807 / 10 ^ 7 +def cHC3 : ℚ := 2255027 / 10 ^ 7 +``` + +### Invoice, caller and Finv +Namespaces: `CallerCost` (`Hist`, `Inv`, `scale`, `invoice`, `armT`, `armP`, `callerT`, `callerP`, `caller`), `JointCeiling` (`Fh`, `Finv`). + +```lean +abbrev Hist := List (ℕ × ℕ) +structure Inv where + T : Hist + P : Hist +def scale (L : ℕ) (l : Hist) : Hist := l.map fun p => (p.1, L * p.2) +def invoice (c n : Inv) (L : ℕ) : Inv := ⟨c.T ++ scale L n.T, c.P ++ scale L n.P⟩ +def armT (n c : ℕ) : Hist := (List.range n).map fun i => (8 * i + 9, c) +def armP (m c : ℕ) : Hist := (List.range m).map fun i => (8 * i + 16, c) +def callerT (a b : ℕ) : Hist := armT (a + 2) 208 ++ armT (b + 2) 208 ++ [(8 * (a + b + 4) + 1, 208)] +def callerP (a b : ℕ) : Hist := + armP a 208 ++ armP b 208 ++ [(8, 384), (1, 384), (8, 16 * (a + b + 4)), (9, 32)] +def caller (a b : ℕ) : Inv := ⟨callerT a b, callerP a b⟩ +noncomputable def Fh (s : ℝ) (l : Hist) : ℝ := (l.map fun p => (p.2 : ℝ) * (p.1 : ℝ) ^ s).sum +noncomputable def Finv (s : ℝ) (i : Inv) : ℝ := Fh s i.T - Fh s i.P +``` + +### Owned-surplus and cap definitions (`CongestionNative.lean`), price and register definitions +```lean +noncomputable def Omega (ks : List ℕ) (mr : ℕ) (s : ℝ) : ℝ := dprice ks s + mr - (6 * (9 : ℝ) ^ s + 10) +noncomputable def capC (s : ℝ) : ℝ := ((9 : ℝ) ^ s - (8 : ℝ) ^ s) / 48 +noncomputable def corrC (cstF : ℝ → ℝ) (s : ℝ) : ℝ := 8 * cstF (1 - s) +noncomputable def dprice (ks : List ℕ) (s : ℝ) : ℝ := (ks.map fun k : ℕ => ((k : ℕ) : ℝ) ^ s).sum +def h9 (g : ℝ → ℝ) (a b : ℝ) : ℝ := g (b - a) + g (9 - b) - g (9 - a) +def k0 (g : ℝ → ℝ) (a b : ℝ) : ℝ := g (b - a) + g a - g b +def c2 (g : ℝ → ℝ) (a b : ℝ) : ℝ := min (h9 g a b) (k0 g a b) +noncomputable def gs (s : ℝ) (x : ℝ) : ℝ := if 0 < x then x ^ s else 0 +def gsum (g : ℝ → ℝ) (d : ℕ → ℝ) (n : ℕ) : ℝ := ∑ i ∈ range n, g (d (i + 1) - d i) +def ex (g : ℝ → ℝ) (d : ℕ → ℝ) (n : ℕ) : ℝ := gsum g d n - g (d n - d 0) +def Mixed (d : ι → ℕ → ℕ) (n : ι → ℕ) (r : ι) : Prop := 1 ≤ d r 0 ∧ d r (n r) ≤ 8 +def lev (d : ι → ℕ → ℕ) (r : ι) : ℕ → ℝ := fun i => (d r i : ℝ) +``` + + +## Appendix B: definitions used by the tree theorems (copied verbatim from the Lean sources) + +Rows `cg_i`, `ga_i`, `gb_i` (i = 0..229) are `Row` values in `CTree{cg,ga,gb}Defs.lean`; only row 0 of each is copied here (about 1.8 KB each), together with the full row lists. Rows 1..229 are in the Lean files. + +### `CTree.cgr0` and `CTree.cgR` (`CTreecgDefs.lean`) +```lean +def cgr0 : Row := ⟨0,1,1,48,1725436586697640946858688965569256363112777243042596638790631055949822,[0,2982922637934,3242635951600,3539847157492,3749562306434,4205711586879,4416640918667,4995298701325,5205013850267,6254171192017,6472670497688,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,10955823525974,11166752857762,11693649535342,11904578867130,12846804199121,13090604852046,13578472556962,13789401888750,15409592561186,15693717065301,16133690945144,16993896367310,17433870247153,17873844126996,18783486407229,18994415739017,20043573080767,20262072386438,20775241438608,20986170770396,22027526915544,22286350072405,22726323952248,23809157734260,24630639128799,24956154746512,25483051424092,25693980755880,26636206087871,26880006740796,27367874445712,27578803777500],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4205711586879,4416640918667,4995298701325,5205013850267,6254171192017,6472670497688,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,10955823525974,11166752857762,11693649535342,11904578867130,12846804199121,13090604852046,13578472556962,13789401888750,17059842078088,17318665234949,17758639114792,18618844536958,19058818416801,19498792296644,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgR : List Row := [cgr0, cgr1, cgr2, cgr3, cgr4, cgr5, cgr6, cgr7, cgr8, cgr9, cgr10, cgr11, cgr12, cgr13, cgr14, cgr15, cgr16, cgr17, cgr18, cgr19, cgr20, cgr21, cgr22, cgr23, cgr24, cgr25, cgr26, cgr27, cgr28, cgr29, cgr30, cgr31, cgr32, cgr33, cgr34, cgr35, cgr36, cgr37, cgr38, cgr39, cgr40, cgr41, cgr42, cgr43, cgr44, cgr45, cgr46, cgr47, cgr48, cgr49, cgr50, cgr51, cgr52, cgr53, cgr54, cgr55, cgr56, cgr57, cgr58, cgr59, cgr60, cgr61, cgr62, cgr63, cgr64, cgr65, cgr66, cgr67, cgr68, cgr69, cgr70, cgr71, cgr72, cgr73, cgr74, cgr75, cgr76, cgr77, cgr78, cgr79, cgr80, cgr81, cgr82, cgr83, cgr84, cgr85, cgr86, cgr87, cgr88, cgr89, cgr90, cgr91, cgr92, cgr93, cgr94, cgr95, cgr96, cgr97, cgr98, cgr99, cgr100, cgr101, cgr102, cgr103, cgr104, cgr105, cgr106, cgr107, cgr108, cgr109, cgr110, cgr111, cgr112, cgr113, cgr114, cgr115, cgr116, cgr117, cgr118, cgr119, cgr120, cgr121, cgr122, cgr123, cgr124, cgr125, cgr126, cgr127, cgr128, cgr129, cgr130, cgr131, cgr132, cgr133, cgr134, cgr135, cgr136, cgr137, cgr138, cgr139, cgr140, cgr141, cgr142, cgr143, cgr144, cgr145, cgr146, cgr147, cgr148, cgr149, cgr150, cgr151, cgr152, cgr153, cgr154, cgr155, cgr156, cgr157, cgr158, cgr159, cgr160, cgr161, cgr162, cgr163, cgr164, cgr165, cgr166, cgr167, cgr168, cgr169, cgr170, cgr171, cgr172, cgr173, cgr174, cgr175, cgr176, cgr177, cgr178, cgr179, cgr180, cgr181, cgr182, cgr183, cgr184, cgr185, cgr186, cgr187, cgr188, cgr189, cgr190, cgr191, cgr192, cgr193, cgr194, cgr195, cgr196, cgr197, cgr198, cgr199, cgr200, cgr201, cgr202, cgr203, cgr204, cgr205, cgr206, cgr207, cgr208, cgr209, cgr210, cgr211, cgr212, cgr213, cgr214, cgr215, cgr216, cgr217, cgr218, cgr219, cgr220, cgr221, cgr222, cgr223, cgr224, cgr225, cgr226, cgr227, cgr228, cgr229] +``` + +### `CTree.gar0` and `CTree.gaR` (`CTreegaDefs.lean`) +```lean +def gar0 : Row := ⟨0,1,1,48,1725436586697640946858688965569256363112777243042596638790631055949822,[0,2959254156595,3216909820699,3511756509685,3719798802895,4172352431466,4381605891907,4955661784562,5163704077772,6204511063227,6421297938485,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526241,10868825337424,11078078797865,11600776249851,11810029710292,12744754152489,12986604030871,13470615433902,13679868894343,15287256905950,15569113606646,16005584772546,16858975603130,17295446769030,17731917934930,18634319511674,18843572972115,19884379957570,20101166832828,20610241238983,20819494699424,21852562998336,22109356695908,22545827861808,23620059420584,24435072574111,24757947692208,25280645144194,25489898604635,26424623046832,26666472925214,27150484328245,27359737788686],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4172352431466,4381605891907,4955661784562,5163704077772,6204511063227,6421297938485,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526241,10868825337424,11078078797865,11600776249851,11810029710292,12744754152489,12986604030871,13470615433902,13679868894343,16924287360659,17181081058231,17617552224131,18470943054715,18907414220615,19343885386515,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gaR : List Row := [gar0, gar1, gar2, gar3, gar4, gar5, gar6, gar7, gar8, gar9, gar10, gar11, gar12, gar13, gar14, gar15, gar16, gar17, gar18, gar19, gar20, gar21, gar22, gar23, gar24, gar25, gar26, gar27, gar28, gar29, gar30, gar31, gar32, gar33, gar34, gar35, gar36, gar37, gar38, gar39, gar40, gar41, gar42, gar43, gar44, gar45, gar46, gar47, gar48, gar49, gar50, gar51, gar52, gar53, gar54, gar55, gar56, gar57, gar58, gar59, gar60, gar61, gar62, gar63, gar64, gar65, gar66, gar67, gar68, gar69, gar70, gar71, gar72, gar73, gar74, gar75, gar76, gar77, gar78, gar79, gar80, gar81, gar82, gar83, gar84, gar85, gar86, gar87, gar88, gar89, gar90, gar91, gar92, gar93, gar94, gar95, gar96, gar97, gar98, gar99, gar100, gar101, gar102, gar103, gar104, gar105, gar106, gar107, gar108, gar109, gar110, gar111, gar112, gar113, gar114, gar115, gar116, gar117, gar118, gar119, gar120, gar121, gar122, gar123, gar124, gar125, gar126, gar127, gar128, gar129, gar130, gar131, gar132, gar133, gar134, gar135, gar136, gar137, gar138, gar139, gar140, gar141, gar142, gar143, gar144, gar145, gar146, gar147, gar148, gar149, gar150, gar151, gar152, gar153, gar154, gar155, gar156, gar157, gar158, gar159, gar160, gar161, gar162, gar163, gar164, gar165, gar166, gar167, gar168, gar169, gar170, gar171, gar172, gar173, gar174, gar175, gar176, gar177, gar178, gar179, gar180, gar181, gar182, gar183, gar184, gar185, gar186, gar187, gar188, gar189, gar190, gar191, gar192, gar193, gar194, gar195, gar196, gar197, gar198, gar199, gar200, gar201, gar202, gar203, gar204, gar205, gar206, gar207, gar208, gar209, gar210, gar211, gar212, gar213, gar214, gar215, gar216, gar217, gar218, gar219, gar220, gar221, gar222, gar223, gar224, gar225, gar226, gar227, gar228, gar229] +``` + +### `CTree.gbr0` and `CTree.gbR` (`CTreegbDefs.lean`) +```lean +def gbr0 : Row := ⟨0,1,1,48,1725436573842136496999949450566182365151713209810570198837308615032830,[0,2959254156595,3229121695333,3542707972272,3784255571050,4173563598697,4486293440944,4989167090130,5488854103858,6237637300267,6550367142514,7036271060908,7994349440529,8359638362960,8724927285391,9224614299119,10590490578413,11079411602729,11532137978477,12031824992205,12689554031779,13081356718888,13473159405997,14220168230416,14770012943371,15761198346299,16260885360027,17084565648351,17449854570782,17949541584510,18449228598238,19631723861402,20023526548511,20509430466905,21256439291324,21806284004279,22198086691388,22697773705116,23444782529535,23994627242490,24985812645418,25485499659146,26162713437776,26554516124885,26946318811994,27673842897357,28243172349368,28990181173787,29540025886742],[1000000000000000000000000000000,2959254156595,3229121695333,3542707972272,3784255571050,4173563598697,4486293440944,4989167090130,5488854103858,6237637300267,6550367142514,7036271060908,7994349440529,8359638362960,8724927285391,9224614299119,10590490578413,11079411602729,11532137978477,12031824992205,12689554031779,13081356718888,13473159405997,14220168230416,14770012943371,17865920529485,18331244177505,18696533099936,19061822022367,19561509036095,20061196049823,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbR : List Row := [gbr0, gbr1, gbr2, gbr3, gbr4, gbr5, gbr6, gbr7, gbr8, gbr9, gbr10, gbr11, gbr12, gbr13, gbr14, gbr15, gbr16, gbr17, gbr18, gbr19, gbr20, gbr21, gbr22, gbr23, gbr24, gbr25, gbr26, gbr27, gbr28, gbr29, gbr30, gbr31, gbr32, gbr33, gbr34, gbr35, gbr36, gbr37, gbr38, gbr39, gbr40, gbr41, gbr42, gbr43, gbr44, gbr45, gbr46, gbr47, gbr48, gbr49, gbr50, gbr51, gbr52, gbr53, gbr54, gbr55, gbr56, gbr57, gbr58, gbr59, gbr60, gbr61, gbr62, gbr63, gbr64, gbr65, gbr66, gbr67, gbr68, gbr69, gbr70, gbr71, gbr72, gbr73, gbr74, gbr75, gbr76, gbr77, gbr78, gbr79, gbr80, gbr81, gbr82, gbr83, gbr84, gbr85, gbr86, gbr87, gbr88, gbr89, gbr90, gbr91, gbr92, gbr93, gbr94, gbr95, gbr96, gbr97, gbr98, gbr99, gbr100, gbr101, gbr102, gbr103, gbr104, gbr105, gbr106, gbr107, gbr108, gbr109, gbr110, gbr111, gbr112, gbr113, gbr114, gbr115, gbr116, gbr117, gbr118, gbr119, gbr120, gbr121, gbr122, gbr123, gbr124, gbr125, gbr126, gbr127, gbr128, gbr129, gbr130, gbr131, gbr132, gbr133, gbr134, gbr135, gbr136, gbr137, gbr138, gbr139, gbr140, gbr141, gbr142, gbr143, gbr144, gbr145, gbr146, gbr147, gbr148, gbr149, gbr150, gbr151, gbr152, gbr153, gbr154, gbr155, gbr156, gbr157, gbr158, gbr159, gbr160, gbr161, gbr162, gbr163, gbr164, gbr165, gbr166, gbr167, gbr168, gbr169, gbr170, gbr171, gbr172, gbr173, gbr174, gbr175, gbr176, gbr177, gbr178, gbr179, gbr180, gbr181, gbr182, gbr183, gbr184, gbr185, gbr186, gbr187, gbr188, gbr189, gbr190, gbr191, gbr192, gbr193, gbr194, gbr195, gbr196, gbr197, gbr198, gbr199, gbr200, gbr201, gbr202, gbr203, gbr204, gbr205, gbr206, gbr207, gbr208, gbr209, gbr210, gbr211, gbr212, gbr213, gbr214, gbr215, gbr216, gbr217, gbr218, gbr219, gbr220, gbr221, gbr222, gbr223, gbr224, gbr225, gbr226, gbr227, gbr228, gbr229] +``` + +The `R` in `cgR`, `gaR`, `gbR` is part of the name (a list of 230 `Row`s), not the Finset `R` of the theorems. + +### `cfC` (`CongestionI3NumC1.lean`) +```lean +def cfC : CF := [(1, -554), (8, -7456), (9, 282), (16, -416), (17, 416), (24, -416), (25, 416), (32, -416), (33, 416), + (40, -416), (41, 416), (48, -416), (49, 416), (56, -416), (57, 416), (64, -208), (65, 416), (73, 208), (137, 208)] +``` + +### `CF`, `Fc`, `Fup`, `dLo` (`NumCertK.lean`) +```lean +abbrev CF := List (ℕ × ℤ) +noncomputable def Fc (cf : CF) (s : ℝ) : ℝ := (cf.map fun p => (p.2 : ℝ) * (p.1 : ℝ) ^ s).sum +/-- upper bound of F on s in [a,b] -/ +def Fup (cf : CF) (a b : ℚ) : ℚ := + (cf.map fun p => if 0 ≤ p.2 then (p.2 : ℚ) * pHi p.1 b else (p.2 : ℚ) * pLo p.1 a).sum +/-- lower bound of F' on s in [a,b] -/ +def dLo (cf : CF) (a b : ℚ) : ℚ := + (cf.map fun p => if 0 ≤ p.2 then (p.2 : ℚ) * (lnLo p.1 * pLo p.1 a) + else (p.2 : ℚ) * (lnHi p.1 * pHi p.1 b)).sum + +``` + +`Fup`/`dLo` use `pHi`, `pLo`, `lnHi`, `lnLo`, also in `NumCertK.lean`. diff --git a/research/p104-tree-ceiling/PR_BODY.md b/research/p104-tree-ceiling/PR_BODY.md new file mode 100644 index 0000000000..93882ab53d --- /dev/null +++ b/research/p104-tree-ceiling/PR_BODY.md @@ -0,0 +1,28 @@ +P104: node-partition refinement of the frontier-word ceiling, κ ≤ .0116750 (Lean, conditional, no κ claim) + +Lean-only package, builds on #7668 (its 46 import-closure modules are included unchanged; 148 new modules). No κ claim and no word claim in Lean: all objects in the two theorems are abstract, and nothing in Lean ties a word to the hypotheses. + +**Results.** Two theorems in `Nov15/CongestionTree.lean`, each proving, for `t ∈ [t0, 1]` (that is, `t0 ≤ t ≤ 1`), `Finv (1 − t) (invoice (caller 6 7) n 17) < 0` (caller `caller 6 7`, L = 17) under the hypotheses listed in `PROVED.md` (copied from the Lean text): +- `ceiling_tree_CG`: t0 = .0117694 (`a0CG` = 58847/5000000). Node-partition tree bound: the I2 paths of each source contain an out-tree of charts over the 230-shape DAG (`cgR`, root `cgr0`), each nested move is charged c2/n(A) per source tree, with the minimum over source counts (|J| ≥ 4962, ≤ 48 partners per source, ≤ 104 sources). +- `ceiling_tree_GD`: t0 = .0116750 (`a0GD` = 467/40000). The same with `|S| ≤ 104`, `Bset ⊆ S`, `48 ≤ |Bset|`: sources in `Bset` use `gbR`/`gbr0` (the shape edges `E48` realised by concrete nested charts), sources in `S \ Bset` use `gaR`/`gar0`. + +Both sit on top of `ceiling_native_J` (t0 = .0118103, #7668): on [.0118103, 1] they apply it with its own hypotheses, and on [t0, .0118103] they use two kernel-certified tree pieces. Kernel-checked here: row soundness of three 230-row DP tables (one `decide +kernel` per row, no float, no shrinking), the tree cost bound for any out-tree, the double-counting reduction, the Lagrange line bound, a certificate that the integer move weights lower-bound c2 on the window, and the per-piece numeric certificates. All theorems print only propext, Classical.choice, Quot.sound; no `sorry`, no `native_decide`; every new module was compiled fresh (`CHECK.txt`). + +**Scope.** One 104-port set. The 230 shapes, `E48` and the 48-port class were computed for that port set only. Five word files share it (st1, #7637, x1t2a, #7660, and `t7669`, our reproduction of the word of #7669, not that file); the word-level numbers in `NATIVES.md` are for these five. + +**Hypotheses.** All new hypotheses are in `PROVED.md`. In short: +- Binders: the 32 explicit binders shared with `ceiling_native_J` (after the implicit `{ι : Type*} [DecidableEq ι]`) are textually identical to that theorem; new are `σ ρ μ`, `T : TreeData`, and `hcstMonoT`, `hcst0`, `hcst1`, `hP1`, `hP2`. +- `cstF` premises: `hcstMonoT` (monotone on [a0, 1/10]), `hcst0`, `hcst1` (two brackets at the new breakpoints). +- `TreeData` fields: `hJS`, `hScard`, `hfib`, `hJcard`, `hB`, `hBcard` (`48 ≤ |Bset|` in GD), `hcell`, `hxk`, `htreeA`, `htreeB`, `hnd`, `hMv`, `hcap`, `hMsub` (`Mv ⊆ Mreg ∪ Mun`), `hdim` (`1 ≤ dA < dB ≤ 8`). +- **Tree premises** `Tr` out-trees (`htreeA`, `htreeB`), `hcap`, `hnd`, `hP1`, `hP2`, `hcell`: open hypotheses, **not verified on any word** (no script was run for them). They are new statements, not consequences of `hcong`, although they rest on the same families (nested moves, I2 capacity, I2 charge). `T`, `T.J` and `J` are separate abstract objects. + +**Caveats, stated plainly.** +- Earlier (non-Lean) computations gave .0117604 and .0116675 using measured count profiles. The digits certified here are weaker by 9.0e-6 (.0117694 − .0117604) and 7.5e-6 (.0116750 − .0116675), because Lean takes only the stated counts. The certificate generator reported negative margins one digit lower (.0117693, .0116749); that is a generator output, not a Lean statement. +- The count behind `E48` (the (3,4,12) and (5,8,6) charts cover only 1,344 of the 4,992 even cells) is neither in Lean nor script-checked for this package. `NATIVES.md` recomputes the realised edge sets with an independent program (`e48.c`: all 29,212 subspaces, 2,350,136 nested pairs, all 4,992 even cells): three port classes of 24, 32 and 48 ports, and the 48-port class equals the `gbR` mask exactly (`cmp.py`); `cgR` has the same shapes and masks as `gaR` (`cgcmp.py`). +- Word-level premises are computed by programs that are not in the package (`NATIVES.md`: premise × word table). `aud.py` replays modulo two primes (2^61 − 1 and 2^64 − 59); the others are exact integer or rational computations. `aud2d.py` was reused from #7668, as were the `aud2a.py` entries for st1, w7637, x1t2a and the `hc12.py` entries for all words but `t7669`. The owned layers agree in mass 56/56 but not in shape: `t7669` has 23 rises / 23 descents and `len ks` = 36, the other four 23 / 24 and 37. Everything inherited from #7668 keeps its status there (`hcong`, `hdist`, `hspMono`, `hcstMono`, the brackets, the 8-row decoder constants; the bound |J| ≥ 4962 is a conjecture outside the known words). +- The hypotheses lists in `README.md` and `PROVED.md` are generated from the Lean binders (`gendocs.py`, `hyps.py`). +- `CHECK.txt`: the 148 new modules were compiled fresh, one at a time under a 3.5 GB guard. The 46 modules inherited from #7668 were not rebuilt for this package; their oleans are those of #7668's build of the same sources (prebuilt oleans). + +The premises under study are SYLforge's (#7616, #7620); the caller is rohanarun's (#7113). DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. + +🤖 Generated with [Claude Code](https://claude.com/claude-code) diff --git a/research/p104-tree-ceiling/README.md b/research/p104-tree-ceiling/README.md new file mode 100644 index 0000000000..f34a85646d --- /dev/null +++ b/research/p104-tree-ceiling/README.md @@ -0,0 +1,99 @@ +# P104: node-partition refinement of the frontier-word ceiling, kappa <= .0116750 (Lean, no kappa) + +Authors: DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. **No kappa claim.** Everything here is a Lean statement with named hypotheses (the tree hypotheses are open: they have not been checked on any word); it builds on #7668 (`ceiling_native_J`, t0 = .0118103), whose modules are included unchanged. Lean proves nothing about the extracted data's fidelity, the word files, or the checker programs. + +## The two new theorems +Both conclude `F(1 - t, invoice (caller 6 7) n 17) < 0` for `t` in `[t0, 1]`, i.e. kappa <= `t0` for any data meeting the hypotheses, on the 17-call invoice (`L = 17`) of the #7113 caller `caller 6 7` = C(8|9). Nothing shows that any word meets the tree hypotheses. On `[tJ0, 1]` they apply `ceiling_native_J` with its own hypotheses; on `[t0, tJ0]` they use the tree bound. + +| theorem (module `CongestionTree`) | `t0` | what is new | +|---|---|---| +| `CongestionNative.ceiling_tree_CG` | .0117694 (`a0CG`) | node-partition tree bound: each source's I2 paths contain an out-tree of charts; a move is charged c2 / n(A) per source tree; minimum over source counts (\|J\| >= 4962, <= 48 partners per source, <= 104 sources); all sources use the shape list `cgR` with root `cgr0` | +| `CongestionNative.ceiling_tree_GD` | .0116750 (`a0GD`) | the same with `Bset ⊆ S`, `48 <= |Bset|`, `|S| <= 104`: sources in `Bset` use `gbR`/`gbr0` (the `E48` edge set), sources in `S \ Bset` use `gaR`/`gar0` | + +The earlier (non-Lean) computations gave .0117604 and .0116675 using measured count profiles; the digits certified here are weaker by 9.0e-6 (.0117694 - .0117604) and 7.5e-6 (.0116750 - .0116675), because Lean takes only the stated counts (|J| >= 4962, <= 48 partners per source, <= 104 sources) and not the measured profiles. The certificate generator reported negative margins one digit lower (.0117693, .0116749); that is a generator output, not a Lean statement. + +Scope. The statements are about abstract data. The shape tables (230 shapes `(dim, n, m)`) and `E48` were computed for one 104-port set; they are not claimed for other port sets. The five word files checked in `NATIVES.md` share that port set; `t7669` is our reproduction of the word of #7669, not that file. + +What Lean proves: the soundness of 230-row DP tables (one `decide +kernel` per row, three tables), the tree cost bound over any `Tr` tree (`tree_cost_ge`), the double-counting reduction (`reduction`), the Lagrange line bound over the sources (`tree_lower`), a kernel certificate that the integer move weights are lower bounds of `c2` on the window (`W_lower`), and the per-piece numeric certificates (sigma, point enclosures, unit bounds, line checks, the derivative certificate for `hFbT_of`). All theorems print only propext, Classical.choice, Quot.sound; no `sorry`, no `native_decide` (`CHECK.txt`). + +## Hypotheses (generated from the Lean statements) +Generated by script (`gendocs.py`) from the binders of `ceiling_tree_CG` / `ceiling_tree_GD` and the fields of `TreeData` (`PROVED.md` has the full text). All of them are hypotheses. The 32 explicit binders shared with `ceiling_native_J` (after the implicit `{ι : Type*} [DecidableEq ι]`) are textually identical to that theorem (compared by `hyps.py`): `R`, `nR`, `dR`, `hmono`, `hd9`, `hmix`, `n`, `ks`, `mr`, `st`, `E`, `J`, `distF`, `spF`, `cstF`, `hk`, `hmass`, `hmd`, `hmr`, `hF`, `hY`, `hst`, `hEex`, `hcong`, `hdist`, `hJ`, `hspMono`, `hcstMono`, `hspTab`, `hcstTab`, `hspTabJ`, `hcstTabJ`. Their status is that of #7668. In particular `hcong`, `hdist` and `hJ` are used only on `[tJ0, 1]`. + +New binders (types abbreviated at 700 characters): + +| hypothesis | in | Lean type | +|---|---|---| +| `σ ρ μ` | CG, GD | `Type` | +| `T` | CG | `CTree.TreeData σ ρ μ CTree.cgR CTree.cgR CTree.cgr0 CTree.cgr0 0` | +| `hcstMonoT` | CG | `MonotoneOn cstF (Set.Icc ((a0CG : ℚ) : ℝ) (1 / 10))` | +| `hcst0` | CG | `cstF ((tCG1 : ℚ) : ℝ) ≤ ((cHCG0 : ℚ) : ℝ)` | +| `hcst1` | CG | `cstF ((tCG2 : ℚ) : ℝ) ≤ ((cHCG1 : ℚ) : ℝ)` | +| `hP1` | CG | `∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0CG : ℚ) : ℝ) → ∑ e ∈ T.Mreg, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) + capC s * ∑ x ∈ T.S, (T.x x : ℝ) ≤ ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s` | +| `hP2` | CG | `∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0CG : ℚ) : ℝ) → ∑ e ∈ T.Mun, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) ≤ corrC cstF s` | + +(`σ ρ μ : Type` with `DecidableEq`; `T` has the shape lists `rsA rsB`, roots `rootA rootB` and `nB` shown in its type: `cgR cgR cgr0 cgr0 0` for CG, `gaR gbR gar0 gbr0 48` for GD.) + +The tree data `T : TreeData` carries all of these fields; each is a hypothesis. The tree premises `htreeA`, `htreeB` (`Tr` out-trees), `hcap`, `hnd`, `hP1`, `hP2`, `hcell` are open and have not been checked on any word: + +| field | Lean type | +|---|---| +| `J` | `Finset (σ × ρ)` | +| `S` | `Finset σ` | +| `Bset` | `Finset σ` | +| `Mv` | `Finset μ` | +| `Mreg` | `Finset μ` | +| `Mun` | `Finset μ` | +| `dA` | `μ → ℕ` | +| `dB` | `μ → ℕ` | +| `nm` | `μ → ℕ` | +| `ms` | `σ → List μ` | +| `R` | `σ → Finset ρ` | +| `x` | `σ → ℕ` | +| `hJS` | `∀ p ∈ J, p.1 ∈ S` | +| `hScard` | `S.card ≤ 104` | +| `hfib` | `∀ s ∈ S, (J.filter fun p => p.1 = s).card ≤ 48` | +| `hJcard` | `4962 ≤ J.card` | +| `hB` | `Bset ⊆ S` | +| `hBcard` | `nB ≤ Bset.card` | +| `hcell` | `∀ s ∈ S, (J.filter fun p => p.1 = s).card ≤ x s + (R s).card` | +| `hxk` | `∀ s ∈ S, x s ≤ (J.filter fun p => p.1 = s).card` | +| `htreeA` | `∀ s ∈ S, s ∉ Bset → Tr rsA nm dA dB rootA (R s) (ms s)` | +| `htreeB` | `∀ s ∈ Bset, Tr rsB nm dA dB rootB (R s) (ms s)` | +| `hnd` | `∀ s ∈ S, (ms s).Nodup` | +| `hMv` | `∀ s ∈ S, ∀ e ∈ ms s, e ∈ Mv` | +| `hcap` | `∀ e ∈ Mv, (S.filter fun s => e ∈ ms s).card ≤ nm e` | +| `hMsub` | `Mv ⊆ Mreg ∪ Mun` | +| `hdim` | `∀ e ∈ Mreg ∪ Mun, 1 ≤ dA e ∧ dA e < dB e ∧ dB e ≤ 8` | + +Reading of the fields (status, as in `lean/Nov15/CongestionTree.md`): +- `J`, `S`, `hJS`, `hScard`, `hfib`, `hJcard`: junk cells, at most 104 sources, at most 48 partners per source, at least 4962 cells. Computed on the five word files (`NATIVES.md`); in Lean `T.J` is not tied to the `J` of `ceiling_native_J`. +- `R`, `x`, `hcell`, `hxk`: a source's cells are either transported (`x s`, each paying `capC`) or have a reader in `R s`. Open (I2 path and the own56 transport cap, as in `hcong`). +- `htreeA`, `htreeB` (`Tr`), `ms`, `Mv`, `hMv`: for each source the union of its cells' I2 paths contains an out-tree of charts whose nodes are shapes of the 230-shape DAG and whose edges are nested moves; readers of a node are covered by the readers of its children, and `|R| <= m(chart)`. Open (nested moves; path = chain of moves meeting at charts). Reader-set disjointness is not assumed. +- `hnd`, `hcap`, `nm`: tree moves are `Nodup` and every move is used by at most `nm e = n(A)` sources. Open (I2 capacity). +- `Mreg`, `Mun`, `hMsub`, `hdim`, `dA`, `dB`, and `hP1`, `hP2`: tree moves are register steps up to owned rises, `sum_{Mreg} c2 + capC * sum x <= sum over registers of c2 + Omega`, and owned-rise moves weigh at most `corrC`. Open (the same I2 charge as `hcong`, aggregated by moves). +- GD only: `Bset`, `hB`, `hBcard`, `htreeB` use `rsB`, the shape rows whose `mask` is E48, the edges realised by concrete nested charts for 48 ports. A computed fact on the one known port set (`NATIVES.md`, `e48.c`); the count behind it (the (3,4,12) and (5,8,6) charts cover only 1,344 of the 4,992 even cells) is neither in Lean nor script-checked for this package. +- `hcstMonoT`, `hcst0`, `hcst1`: monotonicity of cst on [a0, 1/10] (paper statement, as `hcstMono`) and two outward-rounded brackets (data, as `hcstTab`). + +## Files +| file | content | +|---|---| +| PROVED.md | the new statements, `TreeData`, `Tr`, `Row`, copied by script from the Lean text, with definitions (Appendix B: `cgR cgr0 gaR gar0 gbR gbr0 cfC dLo Fup Fc`) | +| NATIVES.md | table premise x word (st1, #7637, x1t2a, #7660 word, our reproduction of the #7669 word) -> result and program, including E48 | +| CHECK.txt | fresh compile table of the 148 new modules (one at a time, 3.5 GB guard) with the axiom lines; the 46 modules of #7668's closure are unchanged | +| PR_BODY.md | draft PR description | +| LICENSE | Apache-2.0 | +| lean/ | Lean subproject; sources in `lean/Nov15/`, notes in the per-file `.md` where present | + +New modules (148): `CTreeCore`; `CTree{cg,ga,gb}Defs` and `CTree{cg,ga,gb}P0..P28` (the DP row tables, 29 files each) with `CTreeData{CG,GA,GB}`; `CongestionTreeCore`, `CongestionTreeW`, `CongestionTreePiece`, `CongestionTree`; `CongestionTreeCert{CG,GD}{Defs,Wt0..Wt13,Wt,D,S0,T0,U0,L0,S1,T1,U1,L1}`. The other 46 modules of the import closure are those of #7668 (`CongestionNativeJ` and everything below it), byte-identical. + +## Pins and build +Toolchain `leanprover/lean4:v4.33.0-rc1` (`lean/lean-toolchain`); Mathlib commit `55b7917b472489c7c56a0fa6393af05cfd536599` (`lean/lakefile.toml`, `lean/lake-manifest.json`). +``` +cd lean +lake exe cache get +lake build +``` +CHECK.txt was produced file by file with `lean -j1 -o` in dependency order against an existing build of the pinned Mathlib, with an output directory first on the search path. `lake build` itself was not run. + +## Not included +The programs that compute the word-level premises, the DP tables and the realised-edge sets, the word files, and the working notes that the per-file `.md` notes cite (including the shape-list file whose labels `Row.i` index). diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreeCore.lean b/research/p104-tree-ceiling/lean/Nov15/CTreeCore.lean new file mode 100644 index 0000000000..87f43ef470 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreeCore.lean @@ -0,0 +1,39 @@ +/-! CTreeCore: Row structure and kernel-checkable DP certificate conditions (Lean core only). +Data and kernel check for the CongestionTree DP certificates (no imports; Lean core only). -/ +namespace CTree + +/-- one shape (dim, n, m) of the 230-shape DAG with its certificate rows; `i` is the shape's label in `shapes.txt`, +`mask` the bit-set of allowed child labels, `g` the table G(x, k), `ge` the table Ge(x, j) (min over allowed children). -/ +structure Row where + i : Nat + dim : Nat + n : Nat + m : Nat + mask : Nat + g : List Nat + ge : List Nat + +def Row.ok (r r' : Row) : Bool := + decide (r.dim < r'.dim) && decide (r.n ≤ r'.n) && decide (r'.m ≤ r.m) && ((r.mask >>> r'.i) % 2 == 1) + +def ew (W : List (List Nat)) (r r' : Row) : Nat := ((W.getD r.dim []).getD r'.dim 0) / r.n + +def rowLe : List Nat → List Nat → Nat → Bool + | a :: as, b :: bs, w => decide (a ≤ w + b) && rowLe as bs w + | _, _, _ => true + +def monoB : List Nat → Bool + | a :: b :: t => decide (a ≤ b) && monoB (b :: t) + | _ => true + +def Row.c4 (r : Row) : Bool := + (List.range r.m).all (fun k => (List.range (k + 1)).all (fun j => + decide (r.g.getD (k + 1) 0 ≤ r.ge.getD (j + 1) 0 + r.g.getD (k - j) 0))) + +def Row.check (W : List (List Nat)) (rs : List Row) (r : Row) : Bool := + decide (1 ≤ r.dim) && decide (r.dim ≤ 8) && decide (1 ≤ r.n) && (r.g.length == r.m + 1) && (r.ge.length == r.m + 1) + && (r.g.getD 0 0 == 0) && monoB r.g + && (if r.dim == 8 then decide (r.m ≤ 1) && r.g.all (fun v => v == 0) + else rs.all (fun r' => !(r.ok r') || rowLe (r.ge.drop 1) (r'.g.drop 1) (ew W r r')) && r.c4) + +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreeDataCG.lean b/research/p104-tree-ceiling/lean/Nov15/CTreeDataCG.lean new file mode 100644 index 0000000000..a43779be72 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreeDataCG.lean @@ -0,0 +1,35 @@ +import Nov15.CTreecgP0 +import Nov15.CTreecgP1 +import Nov15.CTreecgP2 +import Nov15.CTreecgP3 +import Nov15.CTreecgP4 +import Nov15.CTreecgP5 +import Nov15.CTreecgP6 +import Nov15.CTreecgP7 +import Nov15.CTreecgP8 +import Nov15.CTreecgP9 +import Nov15.CTreecgP10 +import Nov15.CTreecgP11 +import Nov15.CTreecgP12 +import Nov15.CTreecgP13 +import Nov15.CTreecgP14 +import Nov15.CTreecgP15 +import Nov15.CTreecgP16 +import Nov15.CTreecgP17 +import Nov15.CTreecgP18 +import Nov15.CTreecgP19 +import Nov15.CTreecgP20 +import Nov15.CTreecgP21 +import Nov15.CTreecgP22 +import Nov15.CTreecgP23 +import Nov15.CTreecgP24 +import Nov15.CTreecgP25 +import Nov15.CTreecgP26 +import Nov15.CTreecgP27 +import Nov15.CTreecgP28 +namespace CTree +set_option maxRecDepth 100000 in +theorem cg_all : ∀ r ∈ cgR, Row.check cgW cgR r = true := by + unfold cgR + exact List.forall_mem_cons.2 ⟨cgc0, List.forall_mem_cons.2 ⟨cgc1, List.forall_mem_cons.2 ⟨cgc2, List.forall_mem_cons.2 ⟨cgc3, List.forall_mem_cons.2 ⟨cgc4, List.forall_mem_cons.2 ⟨cgc5, List.forall_mem_cons.2 ⟨cgc6, List.forall_mem_cons.2 ⟨cgc7, List.forall_mem_cons.2 ⟨cgc8, List.forall_mem_cons.2 ⟨cgc9, List.forall_mem_cons.2 ⟨cgc10, List.forall_mem_cons.2 ⟨cgc11, List.forall_mem_cons.2 ⟨cgc12, List.forall_mem_cons.2 ⟨cgc13, List.forall_mem_cons.2 ⟨cgc14, List.forall_mem_cons.2 ⟨cgc15, List.forall_mem_cons.2 ⟨cgc16, List.forall_mem_cons.2 ⟨cgc17, List.forall_mem_cons.2 ⟨cgc18, List.forall_mem_cons.2 ⟨cgc19, List.forall_mem_cons.2 ⟨cgc20, List.forall_mem_cons.2 ⟨cgc21, List.forall_mem_cons.2 ⟨cgc22, List.forall_mem_cons.2 ⟨cgc23, List.forall_mem_cons.2 ⟨cgc24, List.forall_mem_cons.2 ⟨cgc25, List.forall_mem_cons.2 ⟨cgc26, List.forall_mem_cons.2 ⟨cgc27, List.forall_mem_cons.2 ⟨cgc28, List.forall_mem_cons.2 ⟨cgc29, List.forall_mem_cons.2 ⟨cgc30, List.forall_mem_cons.2 ⟨cgc31, List.forall_mem_cons.2 ⟨cgc32, List.forall_mem_cons.2 ⟨cgc33, List.forall_mem_cons.2 ⟨cgc34, List.forall_mem_cons.2 ⟨cgc35, List.forall_mem_cons.2 ⟨cgc36, List.forall_mem_cons.2 ⟨cgc37, List.forall_mem_cons.2 ⟨cgc38, List.forall_mem_cons.2 ⟨cgc39, List.forall_mem_cons.2 ⟨cgc40, List.forall_mem_cons.2 ⟨cgc41, List.forall_mem_cons.2 ⟨cgc42, List.forall_mem_cons.2 ⟨cgc43, List.forall_mem_cons.2 ⟨cgc44, List.forall_mem_cons.2 ⟨cgc45, List.forall_mem_cons.2 ⟨cgc46, List.forall_mem_cons.2 ⟨cgc47, List.forall_mem_cons.2 ⟨cgc48, List.forall_mem_cons.2 ⟨cgc49, List.forall_mem_cons.2 ⟨cgc50, List.forall_mem_cons.2 ⟨cgc51, List.forall_mem_cons.2 ⟨cgc52, List.forall_mem_cons.2 ⟨cgc53, List.forall_mem_cons.2 ⟨cgc54, List.forall_mem_cons.2 ⟨cgc55, List.forall_mem_cons.2 ⟨cgc56, List.forall_mem_cons.2 ⟨cgc57, List.forall_mem_cons.2 ⟨cgc58, List.forall_mem_cons.2 ⟨cgc59, List.forall_mem_cons.2 ⟨cgc60, List.forall_mem_cons.2 ⟨cgc61, List.forall_mem_cons.2 ⟨cgc62, List.forall_mem_cons.2 ⟨cgc63, List.forall_mem_cons.2 ⟨cgc64, List.forall_mem_cons.2 ⟨cgc65, List.forall_mem_cons.2 ⟨cgc66, List.forall_mem_cons.2 ⟨cgc67, List.forall_mem_cons.2 ⟨cgc68, List.forall_mem_cons.2 ⟨cgc69, List.forall_mem_cons.2 ⟨cgc70, List.forall_mem_cons.2 ⟨cgc71, List.forall_mem_cons.2 ⟨cgc72, List.forall_mem_cons.2 ⟨cgc73, List.forall_mem_cons.2 ⟨cgc74, List.forall_mem_cons.2 ⟨cgc75, List.forall_mem_cons.2 ⟨cgc76, List.forall_mem_cons.2 ⟨cgc77, List.forall_mem_cons.2 ⟨cgc78, List.forall_mem_cons.2 ⟨cgc79, List.forall_mem_cons.2 ⟨cgc80, List.forall_mem_cons.2 ⟨cgc81, List.forall_mem_cons.2 ⟨cgc82, List.forall_mem_cons.2 ⟨cgc83, List.forall_mem_cons.2 ⟨cgc84, List.forall_mem_cons.2 ⟨cgc85, List.forall_mem_cons.2 ⟨cgc86, List.forall_mem_cons.2 ⟨cgc87, List.forall_mem_cons.2 ⟨cgc88, List.forall_mem_cons.2 ⟨cgc89, List.forall_mem_cons.2 ⟨cgc90, List.forall_mem_cons.2 ⟨cgc91, List.forall_mem_cons.2 ⟨cgc92, List.forall_mem_cons.2 ⟨cgc93, List.forall_mem_cons.2 ⟨cgc94, List.forall_mem_cons.2 ⟨cgc95, List.forall_mem_cons.2 ⟨cgc96, List.forall_mem_cons.2 ⟨cgc97, List.forall_mem_cons.2 ⟨cgc98, List.forall_mem_cons.2 ⟨cgc99, List.forall_mem_cons.2 ⟨cgc100, List.forall_mem_cons.2 ⟨cgc101, List.forall_mem_cons.2 ⟨cgc102, List.forall_mem_cons.2 ⟨cgc103, List.forall_mem_cons.2 ⟨cgc104, List.forall_mem_cons.2 ⟨cgc105, List.forall_mem_cons.2 ⟨cgc106, List.forall_mem_cons.2 ⟨cgc107, List.forall_mem_cons.2 ⟨cgc108, List.forall_mem_cons.2 ⟨cgc109, List.forall_mem_cons.2 ⟨cgc110, List.forall_mem_cons.2 ⟨cgc111, List.forall_mem_cons.2 ⟨cgc112, List.forall_mem_cons.2 ⟨cgc113, List.forall_mem_cons.2 ⟨cgc114, List.forall_mem_cons.2 ⟨cgc115, List.forall_mem_cons.2 ⟨cgc116, List.forall_mem_cons.2 ⟨cgc117, List.forall_mem_cons.2 ⟨cgc118, List.forall_mem_cons.2 ⟨cgc119, List.forall_mem_cons.2 ⟨cgc120, List.forall_mem_cons.2 ⟨cgc121, List.forall_mem_cons.2 ⟨cgc122, List.forall_mem_cons.2 ⟨cgc123, List.forall_mem_cons.2 ⟨cgc124, List.forall_mem_cons.2 ⟨cgc125, List.forall_mem_cons.2 ⟨cgc126, List.forall_mem_cons.2 ⟨cgc127, List.forall_mem_cons.2 ⟨cgc128, List.forall_mem_cons.2 ⟨cgc129, List.forall_mem_cons.2 ⟨cgc130, List.forall_mem_cons.2 ⟨cgc131, List.forall_mem_cons.2 ⟨cgc132, List.forall_mem_cons.2 ⟨cgc133, List.forall_mem_cons.2 ⟨cgc134, List.forall_mem_cons.2 ⟨cgc135, List.forall_mem_cons.2 ⟨cgc136, List.forall_mem_cons.2 ⟨cgc137, List.forall_mem_cons.2 ⟨cgc138, List.forall_mem_cons.2 ⟨cgc139, List.forall_mem_cons.2 ⟨cgc140, List.forall_mem_cons.2 ⟨cgc141, List.forall_mem_cons.2 ⟨cgc142, List.forall_mem_cons.2 ⟨cgc143, List.forall_mem_cons.2 ⟨cgc144, List.forall_mem_cons.2 ⟨cgc145, List.forall_mem_cons.2 ⟨cgc146, List.forall_mem_cons.2 ⟨cgc147, List.forall_mem_cons.2 ⟨cgc148, List.forall_mem_cons.2 ⟨cgc149, List.forall_mem_cons.2 ⟨cgc150, List.forall_mem_cons.2 ⟨cgc151, List.forall_mem_cons.2 ⟨cgc152, List.forall_mem_cons.2 ⟨cgc153, List.forall_mem_cons.2 ⟨cgc154, List.forall_mem_cons.2 ⟨cgc155, List.forall_mem_cons.2 ⟨cgc156, List.forall_mem_cons.2 ⟨cgc157, List.forall_mem_cons.2 ⟨cgc158, List.forall_mem_cons.2 ⟨cgc159, List.forall_mem_cons.2 ⟨cgc160, List.forall_mem_cons.2 ⟨cgc161, List.forall_mem_cons.2 ⟨cgc162, List.forall_mem_cons.2 ⟨cgc163, List.forall_mem_cons.2 ⟨cgc164, List.forall_mem_cons.2 ⟨cgc165, List.forall_mem_cons.2 ⟨cgc166, List.forall_mem_cons.2 ⟨cgc167, List.forall_mem_cons.2 ⟨cgc168, List.forall_mem_cons.2 ⟨cgc169, List.forall_mem_cons.2 ⟨cgc170, List.forall_mem_cons.2 ⟨cgc171, List.forall_mem_cons.2 ⟨cgc172, List.forall_mem_cons.2 ⟨cgc173, List.forall_mem_cons.2 ⟨cgc174, List.forall_mem_cons.2 ⟨cgc175, List.forall_mem_cons.2 ⟨cgc176, List.forall_mem_cons.2 ⟨cgc177, List.forall_mem_cons.2 ⟨cgc178, List.forall_mem_cons.2 ⟨cgc179, List.forall_mem_cons.2 ⟨cgc180, List.forall_mem_cons.2 ⟨cgc181, List.forall_mem_cons.2 ⟨cgc182, List.forall_mem_cons.2 ⟨cgc183, List.forall_mem_cons.2 ⟨cgc184, List.forall_mem_cons.2 ⟨cgc185, List.forall_mem_cons.2 ⟨cgc186, List.forall_mem_cons.2 ⟨cgc187, List.forall_mem_cons.2 ⟨cgc188, List.forall_mem_cons.2 ⟨cgc189, List.forall_mem_cons.2 ⟨cgc190, List.forall_mem_cons.2 ⟨cgc191, List.forall_mem_cons.2 ⟨cgc192, List.forall_mem_cons.2 ⟨cgc193, List.forall_mem_cons.2 ⟨cgc194, List.forall_mem_cons.2 ⟨cgc195, List.forall_mem_cons.2 ⟨cgc196, List.forall_mem_cons.2 ⟨cgc197, List.forall_mem_cons.2 ⟨cgc198, List.forall_mem_cons.2 ⟨cgc199, List.forall_mem_cons.2 ⟨cgc200, List.forall_mem_cons.2 ⟨cgc201, List.forall_mem_cons.2 ⟨cgc202, List.forall_mem_cons.2 ⟨cgc203, List.forall_mem_cons.2 ⟨cgc204, List.forall_mem_cons.2 ⟨cgc205, List.forall_mem_cons.2 ⟨cgc206, List.forall_mem_cons.2 ⟨cgc207, List.forall_mem_cons.2 ⟨cgc208, List.forall_mem_cons.2 ⟨cgc209, List.forall_mem_cons.2 ⟨cgc210, List.forall_mem_cons.2 ⟨cgc211, List.forall_mem_cons.2 ⟨cgc212, List.forall_mem_cons.2 ⟨cgc213, List.forall_mem_cons.2 ⟨cgc214, List.forall_mem_cons.2 ⟨cgc215, List.forall_mem_cons.2 ⟨cgc216, List.forall_mem_cons.2 ⟨cgc217, List.forall_mem_cons.2 ⟨cgc218, List.forall_mem_cons.2 ⟨cgc219, List.forall_mem_cons.2 ⟨cgc220, List.forall_mem_cons.2 ⟨cgc221, List.forall_mem_cons.2 ⟨cgc222, List.forall_mem_cons.2 ⟨cgc223, List.forall_mem_cons.2 ⟨cgc224, List.forall_mem_cons.2 ⟨cgc225, List.forall_mem_cons.2 ⟨cgc226, List.forall_mem_cons.2 ⟨cgc227, List.forall_mem_cons.2 ⟨cgc228, List.forall_mem_cons.2 ⟨cgc229, fun _ h => nomatch h⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩ +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreeDataGA.lean b/research/p104-tree-ceiling/lean/Nov15/CTreeDataGA.lean new file mode 100644 index 0000000000..1d6bc1d943 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreeDataGA.lean @@ -0,0 +1,35 @@ +import Nov15.CTreegaP0 +import Nov15.CTreegaP1 +import Nov15.CTreegaP2 +import Nov15.CTreegaP3 +import Nov15.CTreegaP4 +import Nov15.CTreegaP5 +import Nov15.CTreegaP6 +import Nov15.CTreegaP7 +import Nov15.CTreegaP8 +import Nov15.CTreegaP9 +import Nov15.CTreegaP10 +import Nov15.CTreegaP11 +import Nov15.CTreegaP12 +import Nov15.CTreegaP13 +import Nov15.CTreegaP14 +import Nov15.CTreegaP15 +import Nov15.CTreegaP16 +import Nov15.CTreegaP17 +import Nov15.CTreegaP18 +import Nov15.CTreegaP19 +import Nov15.CTreegaP20 +import Nov15.CTreegaP21 +import Nov15.CTreegaP22 +import Nov15.CTreegaP23 +import Nov15.CTreegaP24 +import Nov15.CTreegaP25 +import Nov15.CTreegaP26 +import Nov15.CTreegaP27 +import Nov15.CTreegaP28 +namespace CTree +set_option maxRecDepth 100000 in +theorem ga_all : ∀ r ∈ gaR, Row.check gaW gaR r = true := by + unfold gaR + exact List.forall_mem_cons.2 ⟨gac0, List.forall_mem_cons.2 ⟨gac1, List.forall_mem_cons.2 ⟨gac2, List.forall_mem_cons.2 ⟨gac3, List.forall_mem_cons.2 ⟨gac4, List.forall_mem_cons.2 ⟨gac5, List.forall_mem_cons.2 ⟨gac6, List.forall_mem_cons.2 ⟨gac7, List.forall_mem_cons.2 ⟨gac8, List.forall_mem_cons.2 ⟨gac9, List.forall_mem_cons.2 ⟨gac10, List.forall_mem_cons.2 ⟨gac11, List.forall_mem_cons.2 ⟨gac12, List.forall_mem_cons.2 ⟨gac13, List.forall_mem_cons.2 ⟨gac14, List.forall_mem_cons.2 ⟨gac15, List.forall_mem_cons.2 ⟨gac16, List.forall_mem_cons.2 ⟨gac17, List.forall_mem_cons.2 ⟨gac18, List.forall_mem_cons.2 ⟨gac19, List.forall_mem_cons.2 ⟨gac20, List.forall_mem_cons.2 ⟨gac21, List.forall_mem_cons.2 ⟨gac22, List.forall_mem_cons.2 ⟨gac23, List.forall_mem_cons.2 ⟨gac24, List.forall_mem_cons.2 ⟨gac25, List.forall_mem_cons.2 ⟨gac26, List.forall_mem_cons.2 ⟨gac27, List.forall_mem_cons.2 ⟨gac28, List.forall_mem_cons.2 ⟨gac29, List.forall_mem_cons.2 ⟨gac30, List.forall_mem_cons.2 ⟨gac31, List.forall_mem_cons.2 ⟨gac32, List.forall_mem_cons.2 ⟨gac33, List.forall_mem_cons.2 ⟨gac34, List.forall_mem_cons.2 ⟨gac35, List.forall_mem_cons.2 ⟨gac36, List.forall_mem_cons.2 ⟨gac37, List.forall_mem_cons.2 ⟨gac38, List.forall_mem_cons.2 ⟨gac39, List.forall_mem_cons.2 ⟨gac40, List.forall_mem_cons.2 ⟨gac41, List.forall_mem_cons.2 ⟨gac42, List.forall_mem_cons.2 ⟨gac43, List.forall_mem_cons.2 ⟨gac44, List.forall_mem_cons.2 ⟨gac45, List.forall_mem_cons.2 ⟨gac46, List.forall_mem_cons.2 ⟨gac47, List.forall_mem_cons.2 ⟨gac48, List.forall_mem_cons.2 ⟨gac49, List.forall_mem_cons.2 ⟨gac50, List.forall_mem_cons.2 ⟨gac51, List.forall_mem_cons.2 ⟨gac52, List.forall_mem_cons.2 ⟨gac53, List.forall_mem_cons.2 ⟨gac54, List.forall_mem_cons.2 ⟨gac55, List.forall_mem_cons.2 ⟨gac56, List.forall_mem_cons.2 ⟨gac57, List.forall_mem_cons.2 ⟨gac58, List.forall_mem_cons.2 ⟨gac59, List.forall_mem_cons.2 ⟨gac60, List.forall_mem_cons.2 ⟨gac61, List.forall_mem_cons.2 ⟨gac62, List.forall_mem_cons.2 ⟨gac63, List.forall_mem_cons.2 ⟨gac64, List.forall_mem_cons.2 ⟨gac65, List.forall_mem_cons.2 ⟨gac66, List.forall_mem_cons.2 ⟨gac67, List.forall_mem_cons.2 ⟨gac68, List.forall_mem_cons.2 ⟨gac69, List.forall_mem_cons.2 ⟨gac70, List.forall_mem_cons.2 ⟨gac71, List.forall_mem_cons.2 ⟨gac72, List.forall_mem_cons.2 ⟨gac73, List.forall_mem_cons.2 ⟨gac74, List.forall_mem_cons.2 ⟨gac75, List.forall_mem_cons.2 ⟨gac76, List.forall_mem_cons.2 ⟨gac77, List.forall_mem_cons.2 ⟨gac78, List.forall_mem_cons.2 ⟨gac79, List.forall_mem_cons.2 ⟨gac80, List.forall_mem_cons.2 ⟨gac81, List.forall_mem_cons.2 ⟨gac82, List.forall_mem_cons.2 ⟨gac83, List.forall_mem_cons.2 ⟨gac84, List.forall_mem_cons.2 ⟨gac85, List.forall_mem_cons.2 ⟨gac86, List.forall_mem_cons.2 ⟨gac87, List.forall_mem_cons.2 ⟨gac88, List.forall_mem_cons.2 ⟨gac89, List.forall_mem_cons.2 ⟨gac90, List.forall_mem_cons.2 ⟨gac91, List.forall_mem_cons.2 ⟨gac92, List.forall_mem_cons.2 ⟨gac93, List.forall_mem_cons.2 ⟨gac94, List.forall_mem_cons.2 ⟨gac95, List.forall_mem_cons.2 ⟨gac96, List.forall_mem_cons.2 ⟨gac97, List.forall_mem_cons.2 ⟨gac98, List.forall_mem_cons.2 ⟨gac99, List.forall_mem_cons.2 ⟨gac100, List.forall_mem_cons.2 ⟨gac101, List.forall_mem_cons.2 ⟨gac102, List.forall_mem_cons.2 ⟨gac103, List.forall_mem_cons.2 ⟨gac104, List.forall_mem_cons.2 ⟨gac105, List.forall_mem_cons.2 ⟨gac106, List.forall_mem_cons.2 ⟨gac107, List.forall_mem_cons.2 ⟨gac108, List.forall_mem_cons.2 ⟨gac109, List.forall_mem_cons.2 ⟨gac110, List.forall_mem_cons.2 ⟨gac111, List.forall_mem_cons.2 ⟨gac112, List.forall_mem_cons.2 ⟨gac113, List.forall_mem_cons.2 ⟨gac114, List.forall_mem_cons.2 ⟨gac115, List.forall_mem_cons.2 ⟨gac116, List.forall_mem_cons.2 ⟨gac117, List.forall_mem_cons.2 ⟨gac118, List.forall_mem_cons.2 ⟨gac119, List.forall_mem_cons.2 ⟨gac120, List.forall_mem_cons.2 ⟨gac121, List.forall_mem_cons.2 ⟨gac122, List.forall_mem_cons.2 ⟨gac123, List.forall_mem_cons.2 ⟨gac124, List.forall_mem_cons.2 ⟨gac125, List.forall_mem_cons.2 ⟨gac126, List.forall_mem_cons.2 ⟨gac127, List.forall_mem_cons.2 ⟨gac128, List.forall_mem_cons.2 ⟨gac129, List.forall_mem_cons.2 ⟨gac130, List.forall_mem_cons.2 ⟨gac131, List.forall_mem_cons.2 ⟨gac132, List.forall_mem_cons.2 ⟨gac133, List.forall_mem_cons.2 ⟨gac134, List.forall_mem_cons.2 ⟨gac135, List.forall_mem_cons.2 ⟨gac136, List.forall_mem_cons.2 ⟨gac137, List.forall_mem_cons.2 ⟨gac138, List.forall_mem_cons.2 ⟨gac139, List.forall_mem_cons.2 ⟨gac140, List.forall_mem_cons.2 ⟨gac141, List.forall_mem_cons.2 ⟨gac142, List.forall_mem_cons.2 ⟨gac143, List.forall_mem_cons.2 ⟨gac144, List.forall_mem_cons.2 ⟨gac145, List.forall_mem_cons.2 ⟨gac146, List.forall_mem_cons.2 ⟨gac147, List.forall_mem_cons.2 ⟨gac148, List.forall_mem_cons.2 ⟨gac149, List.forall_mem_cons.2 ⟨gac150, List.forall_mem_cons.2 ⟨gac151, List.forall_mem_cons.2 ⟨gac152, List.forall_mem_cons.2 ⟨gac153, List.forall_mem_cons.2 ⟨gac154, List.forall_mem_cons.2 ⟨gac155, List.forall_mem_cons.2 ⟨gac156, List.forall_mem_cons.2 ⟨gac157, List.forall_mem_cons.2 ⟨gac158, List.forall_mem_cons.2 ⟨gac159, List.forall_mem_cons.2 ⟨gac160, List.forall_mem_cons.2 ⟨gac161, List.forall_mem_cons.2 ⟨gac162, List.forall_mem_cons.2 ⟨gac163, List.forall_mem_cons.2 ⟨gac164, List.forall_mem_cons.2 ⟨gac165, List.forall_mem_cons.2 ⟨gac166, List.forall_mem_cons.2 ⟨gac167, List.forall_mem_cons.2 ⟨gac168, List.forall_mem_cons.2 ⟨gac169, List.forall_mem_cons.2 ⟨gac170, List.forall_mem_cons.2 ⟨gac171, List.forall_mem_cons.2 ⟨gac172, List.forall_mem_cons.2 ⟨gac173, List.forall_mem_cons.2 ⟨gac174, List.forall_mem_cons.2 ⟨gac175, List.forall_mem_cons.2 ⟨gac176, List.forall_mem_cons.2 ⟨gac177, List.forall_mem_cons.2 ⟨gac178, List.forall_mem_cons.2 ⟨gac179, List.forall_mem_cons.2 ⟨gac180, List.forall_mem_cons.2 ⟨gac181, List.forall_mem_cons.2 ⟨gac182, List.forall_mem_cons.2 ⟨gac183, List.forall_mem_cons.2 ⟨gac184, List.forall_mem_cons.2 ⟨gac185, List.forall_mem_cons.2 ⟨gac186, List.forall_mem_cons.2 ⟨gac187, List.forall_mem_cons.2 ⟨gac188, List.forall_mem_cons.2 ⟨gac189, List.forall_mem_cons.2 ⟨gac190, List.forall_mem_cons.2 ⟨gac191, List.forall_mem_cons.2 ⟨gac192, List.forall_mem_cons.2 ⟨gac193, List.forall_mem_cons.2 ⟨gac194, List.forall_mem_cons.2 ⟨gac195, List.forall_mem_cons.2 ⟨gac196, List.forall_mem_cons.2 ⟨gac197, List.forall_mem_cons.2 ⟨gac198, List.forall_mem_cons.2 ⟨gac199, List.forall_mem_cons.2 ⟨gac200, List.forall_mem_cons.2 ⟨gac201, List.forall_mem_cons.2 ⟨gac202, List.forall_mem_cons.2 ⟨gac203, List.forall_mem_cons.2 ⟨gac204, List.forall_mem_cons.2 ⟨gac205, List.forall_mem_cons.2 ⟨gac206, List.forall_mem_cons.2 ⟨gac207, List.forall_mem_cons.2 ⟨gac208, List.forall_mem_cons.2 ⟨gac209, List.forall_mem_cons.2 ⟨gac210, List.forall_mem_cons.2 ⟨gac211, List.forall_mem_cons.2 ⟨gac212, List.forall_mem_cons.2 ⟨gac213, List.forall_mem_cons.2 ⟨gac214, List.forall_mem_cons.2 ⟨gac215, List.forall_mem_cons.2 ⟨gac216, List.forall_mem_cons.2 ⟨gac217, List.forall_mem_cons.2 ⟨gac218, List.forall_mem_cons.2 ⟨gac219, List.forall_mem_cons.2 ⟨gac220, List.forall_mem_cons.2 ⟨gac221, List.forall_mem_cons.2 ⟨gac222, List.forall_mem_cons.2 ⟨gac223, List.forall_mem_cons.2 ⟨gac224, List.forall_mem_cons.2 ⟨gac225, List.forall_mem_cons.2 ⟨gac226, List.forall_mem_cons.2 ⟨gac227, List.forall_mem_cons.2 ⟨gac228, List.forall_mem_cons.2 ⟨gac229, fun _ h => nomatch h⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩ +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreeDataGB.lean b/research/p104-tree-ceiling/lean/Nov15/CTreeDataGB.lean new file mode 100644 index 0000000000..7b81f22345 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreeDataGB.lean @@ -0,0 +1,35 @@ +import Nov15.CTreegbP0 +import Nov15.CTreegbP1 +import Nov15.CTreegbP2 +import Nov15.CTreegbP3 +import Nov15.CTreegbP4 +import Nov15.CTreegbP5 +import Nov15.CTreegbP6 +import Nov15.CTreegbP7 +import Nov15.CTreegbP8 +import Nov15.CTreegbP9 +import Nov15.CTreegbP10 +import Nov15.CTreegbP11 +import Nov15.CTreegbP12 +import Nov15.CTreegbP13 +import Nov15.CTreegbP14 +import Nov15.CTreegbP15 +import Nov15.CTreegbP16 +import Nov15.CTreegbP17 +import Nov15.CTreegbP18 +import Nov15.CTreegbP19 +import Nov15.CTreegbP20 +import Nov15.CTreegbP21 +import Nov15.CTreegbP22 +import Nov15.CTreegbP23 +import Nov15.CTreegbP24 +import Nov15.CTreegbP25 +import Nov15.CTreegbP26 +import Nov15.CTreegbP27 +import Nov15.CTreegbP28 +namespace CTree +set_option maxRecDepth 100000 in +theorem gb_all : ∀ r ∈ gbR, Row.check gbW gbR r = true := by + unfold gbR + exact List.forall_mem_cons.2 ⟨gbc0, List.forall_mem_cons.2 ⟨gbc1, List.forall_mem_cons.2 ⟨gbc2, List.forall_mem_cons.2 ⟨gbc3, List.forall_mem_cons.2 ⟨gbc4, List.forall_mem_cons.2 ⟨gbc5, List.forall_mem_cons.2 ⟨gbc6, List.forall_mem_cons.2 ⟨gbc7, List.forall_mem_cons.2 ⟨gbc8, List.forall_mem_cons.2 ⟨gbc9, List.forall_mem_cons.2 ⟨gbc10, List.forall_mem_cons.2 ⟨gbc11, List.forall_mem_cons.2 ⟨gbc12, List.forall_mem_cons.2 ⟨gbc13, List.forall_mem_cons.2 ⟨gbc14, List.forall_mem_cons.2 ⟨gbc15, List.forall_mem_cons.2 ⟨gbc16, List.forall_mem_cons.2 ⟨gbc17, List.forall_mem_cons.2 ⟨gbc18, List.forall_mem_cons.2 ⟨gbc19, List.forall_mem_cons.2 ⟨gbc20, List.forall_mem_cons.2 ⟨gbc21, List.forall_mem_cons.2 ⟨gbc22, List.forall_mem_cons.2 ⟨gbc23, List.forall_mem_cons.2 ⟨gbc24, List.forall_mem_cons.2 ⟨gbc25, List.forall_mem_cons.2 ⟨gbc26, List.forall_mem_cons.2 ⟨gbc27, List.forall_mem_cons.2 ⟨gbc28, List.forall_mem_cons.2 ⟨gbc29, List.forall_mem_cons.2 ⟨gbc30, List.forall_mem_cons.2 ⟨gbc31, List.forall_mem_cons.2 ⟨gbc32, List.forall_mem_cons.2 ⟨gbc33, List.forall_mem_cons.2 ⟨gbc34, List.forall_mem_cons.2 ⟨gbc35, List.forall_mem_cons.2 ⟨gbc36, List.forall_mem_cons.2 ⟨gbc37, List.forall_mem_cons.2 ⟨gbc38, List.forall_mem_cons.2 ⟨gbc39, List.forall_mem_cons.2 ⟨gbc40, List.forall_mem_cons.2 ⟨gbc41, List.forall_mem_cons.2 ⟨gbc42, List.forall_mem_cons.2 ⟨gbc43, List.forall_mem_cons.2 ⟨gbc44, List.forall_mem_cons.2 ⟨gbc45, List.forall_mem_cons.2 ⟨gbc46, List.forall_mem_cons.2 ⟨gbc47, List.forall_mem_cons.2 ⟨gbc48, List.forall_mem_cons.2 ⟨gbc49, List.forall_mem_cons.2 ⟨gbc50, List.forall_mem_cons.2 ⟨gbc51, List.forall_mem_cons.2 ⟨gbc52, List.forall_mem_cons.2 ⟨gbc53, List.forall_mem_cons.2 ⟨gbc54, List.forall_mem_cons.2 ⟨gbc55, List.forall_mem_cons.2 ⟨gbc56, List.forall_mem_cons.2 ⟨gbc57, List.forall_mem_cons.2 ⟨gbc58, List.forall_mem_cons.2 ⟨gbc59, List.forall_mem_cons.2 ⟨gbc60, List.forall_mem_cons.2 ⟨gbc61, List.forall_mem_cons.2 ⟨gbc62, List.forall_mem_cons.2 ⟨gbc63, List.forall_mem_cons.2 ⟨gbc64, List.forall_mem_cons.2 ⟨gbc65, List.forall_mem_cons.2 ⟨gbc66, List.forall_mem_cons.2 ⟨gbc67, List.forall_mem_cons.2 ⟨gbc68, List.forall_mem_cons.2 ⟨gbc69, List.forall_mem_cons.2 ⟨gbc70, List.forall_mem_cons.2 ⟨gbc71, List.forall_mem_cons.2 ⟨gbc72, List.forall_mem_cons.2 ⟨gbc73, List.forall_mem_cons.2 ⟨gbc74, List.forall_mem_cons.2 ⟨gbc75, List.forall_mem_cons.2 ⟨gbc76, List.forall_mem_cons.2 ⟨gbc77, List.forall_mem_cons.2 ⟨gbc78, List.forall_mem_cons.2 ⟨gbc79, List.forall_mem_cons.2 ⟨gbc80, List.forall_mem_cons.2 ⟨gbc81, List.forall_mem_cons.2 ⟨gbc82, List.forall_mem_cons.2 ⟨gbc83, List.forall_mem_cons.2 ⟨gbc84, List.forall_mem_cons.2 ⟨gbc85, List.forall_mem_cons.2 ⟨gbc86, List.forall_mem_cons.2 ⟨gbc87, List.forall_mem_cons.2 ⟨gbc88, List.forall_mem_cons.2 ⟨gbc89, List.forall_mem_cons.2 ⟨gbc90, List.forall_mem_cons.2 ⟨gbc91, List.forall_mem_cons.2 ⟨gbc92, List.forall_mem_cons.2 ⟨gbc93, List.forall_mem_cons.2 ⟨gbc94, List.forall_mem_cons.2 ⟨gbc95, List.forall_mem_cons.2 ⟨gbc96, List.forall_mem_cons.2 ⟨gbc97, List.forall_mem_cons.2 ⟨gbc98, List.forall_mem_cons.2 ⟨gbc99, List.forall_mem_cons.2 ⟨gbc100, List.forall_mem_cons.2 ⟨gbc101, List.forall_mem_cons.2 ⟨gbc102, List.forall_mem_cons.2 ⟨gbc103, List.forall_mem_cons.2 ⟨gbc104, List.forall_mem_cons.2 ⟨gbc105, List.forall_mem_cons.2 ⟨gbc106, List.forall_mem_cons.2 ⟨gbc107, List.forall_mem_cons.2 ⟨gbc108, List.forall_mem_cons.2 ⟨gbc109, List.forall_mem_cons.2 ⟨gbc110, List.forall_mem_cons.2 ⟨gbc111, List.forall_mem_cons.2 ⟨gbc112, List.forall_mem_cons.2 ⟨gbc113, List.forall_mem_cons.2 ⟨gbc114, List.forall_mem_cons.2 ⟨gbc115, List.forall_mem_cons.2 ⟨gbc116, List.forall_mem_cons.2 ⟨gbc117, List.forall_mem_cons.2 ⟨gbc118, List.forall_mem_cons.2 ⟨gbc119, List.forall_mem_cons.2 ⟨gbc120, List.forall_mem_cons.2 ⟨gbc121, List.forall_mem_cons.2 ⟨gbc122, List.forall_mem_cons.2 ⟨gbc123, List.forall_mem_cons.2 ⟨gbc124, List.forall_mem_cons.2 ⟨gbc125, List.forall_mem_cons.2 ⟨gbc126, List.forall_mem_cons.2 ⟨gbc127, List.forall_mem_cons.2 ⟨gbc128, List.forall_mem_cons.2 ⟨gbc129, List.forall_mem_cons.2 ⟨gbc130, List.forall_mem_cons.2 ⟨gbc131, List.forall_mem_cons.2 ⟨gbc132, List.forall_mem_cons.2 ⟨gbc133, List.forall_mem_cons.2 ⟨gbc134, List.forall_mem_cons.2 ⟨gbc135, List.forall_mem_cons.2 ⟨gbc136, List.forall_mem_cons.2 ⟨gbc137, List.forall_mem_cons.2 ⟨gbc138, List.forall_mem_cons.2 ⟨gbc139, List.forall_mem_cons.2 ⟨gbc140, List.forall_mem_cons.2 ⟨gbc141, List.forall_mem_cons.2 ⟨gbc142, List.forall_mem_cons.2 ⟨gbc143, List.forall_mem_cons.2 ⟨gbc144, List.forall_mem_cons.2 ⟨gbc145, List.forall_mem_cons.2 ⟨gbc146, List.forall_mem_cons.2 ⟨gbc147, List.forall_mem_cons.2 ⟨gbc148, List.forall_mem_cons.2 ⟨gbc149, List.forall_mem_cons.2 ⟨gbc150, List.forall_mem_cons.2 ⟨gbc151, List.forall_mem_cons.2 ⟨gbc152, List.forall_mem_cons.2 ⟨gbc153, List.forall_mem_cons.2 ⟨gbc154, List.forall_mem_cons.2 ⟨gbc155, List.forall_mem_cons.2 ⟨gbc156, List.forall_mem_cons.2 ⟨gbc157, List.forall_mem_cons.2 ⟨gbc158, List.forall_mem_cons.2 ⟨gbc159, List.forall_mem_cons.2 ⟨gbc160, List.forall_mem_cons.2 ⟨gbc161, List.forall_mem_cons.2 ⟨gbc162, List.forall_mem_cons.2 ⟨gbc163, List.forall_mem_cons.2 ⟨gbc164, List.forall_mem_cons.2 ⟨gbc165, List.forall_mem_cons.2 ⟨gbc166, List.forall_mem_cons.2 ⟨gbc167, List.forall_mem_cons.2 ⟨gbc168, List.forall_mem_cons.2 ⟨gbc169, List.forall_mem_cons.2 ⟨gbc170, List.forall_mem_cons.2 ⟨gbc171, List.forall_mem_cons.2 ⟨gbc172, List.forall_mem_cons.2 ⟨gbc173, List.forall_mem_cons.2 ⟨gbc174, List.forall_mem_cons.2 ⟨gbc175, List.forall_mem_cons.2 ⟨gbc176, List.forall_mem_cons.2 ⟨gbc177, List.forall_mem_cons.2 ⟨gbc178, List.forall_mem_cons.2 ⟨gbc179, List.forall_mem_cons.2 ⟨gbc180, List.forall_mem_cons.2 ⟨gbc181, List.forall_mem_cons.2 ⟨gbc182, List.forall_mem_cons.2 ⟨gbc183, List.forall_mem_cons.2 ⟨gbc184, List.forall_mem_cons.2 ⟨gbc185, List.forall_mem_cons.2 ⟨gbc186, List.forall_mem_cons.2 ⟨gbc187, List.forall_mem_cons.2 ⟨gbc188, List.forall_mem_cons.2 ⟨gbc189, List.forall_mem_cons.2 ⟨gbc190, List.forall_mem_cons.2 ⟨gbc191, List.forall_mem_cons.2 ⟨gbc192, List.forall_mem_cons.2 ⟨gbc193, List.forall_mem_cons.2 ⟨gbc194, List.forall_mem_cons.2 ⟨gbc195, List.forall_mem_cons.2 ⟨gbc196, List.forall_mem_cons.2 ⟨gbc197, List.forall_mem_cons.2 ⟨gbc198, List.forall_mem_cons.2 ⟨gbc199, List.forall_mem_cons.2 ⟨gbc200, List.forall_mem_cons.2 ⟨gbc201, List.forall_mem_cons.2 ⟨gbc202, List.forall_mem_cons.2 ⟨gbc203, List.forall_mem_cons.2 ⟨gbc204, List.forall_mem_cons.2 ⟨gbc205, List.forall_mem_cons.2 ⟨gbc206, List.forall_mem_cons.2 ⟨gbc207, List.forall_mem_cons.2 ⟨gbc208, List.forall_mem_cons.2 ⟨gbc209, List.forall_mem_cons.2 ⟨gbc210, List.forall_mem_cons.2 ⟨gbc211, List.forall_mem_cons.2 ⟨gbc212, List.forall_mem_cons.2 ⟨gbc213, List.forall_mem_cons.2 ⟨gbc214, List.forall_mem_cons.2 ⟨gbc215, List.forall_mem_cons.2 ⟨gbc216, List.forall_mem_cons.2 ⟨gbc217, List.forall_mem_cons.2 ⟨gbc218, List.forall_mem_cons.2 ⟨gbc219, List.forall_mem_cons.2 ⟨gbc220, List.forall_mem_cons.2 ⟨gbc221, List.forall_mem_cons.2 ⟨gbc222, List.forall_mem_cons.2 ⟨gbc223, List.forall_mem_cons.2 ⟨gbc224, List.forall_mem_cons.2 ⟨gbc225, List.forall_mem_cons.2 ⟨gbc226, List.forall_mem_cons.2 ⟨gbc227, List.forall_mem_cons.2 ⟨gbc228, List.forall_mem_cons.2 ⟨gbc229, fun _ h => nomatch h⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩⟩ +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgDefs.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgDefs.lean new file mode 100644 index 0000000000..f403c61168 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgDefs.lean @@ -0,0 +1,235 @@ +import Nov15.CTreeCore +namespace CTree +def cgW : List (List Nat) := [[0,0,0,0,0,0,0,0,0],[0,0,1624948169648,2229084044190,2619355899213,2908533909773,3138360887880,3329068303182,3492028489150],[0,0,0,2229084044190,3223491773755,3902941639338,4421946628005,4842481021414,3329068303182],[0,0,0,0,2619355899213,3902941639338,4812218483028,4421946628005,3138360887880],[0,0,0,0,0,2908533909773,3902941639338,3902941639338,2908533909773],[0,0,0,0,0,0,2619355899213,3223491773755,2619355899213],[0,0,0,0,0,0,0,2229084044190,2229084044190],[0,0,0,0,0,0,0,0,1624948169648],[0,0,0,0,0,0,0,0,0]] +def cgr0 : Row := ⟨0,1,1,48,1725436586697640946858688965569256363112777243042596638790631055949822,[0,2982922637934,3242635951600,3539847157492,3749562306434,4205711586879,4416640918667,4995298701325,5205013850267,6254171192017,6472670497688,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,10955823525974,11166752857762,11693649535342,11904578867130,12846804199121,13090604852046,13578472556962,13789401888750,15409592561186,15693717065301,16133690945144,16993896367310,17433870247153,17873844126996,18783486407229,18994415739017,20043573080767,20262072386438,20775241438608,20986170770396,22027526915544,22286350072405,22726323952248,23809157734260,24630639128799,24956154746512,25483051424092,25693980755880,26636206087871,26880006740796,27367874445712,27578803777500],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4205711586879,4416640918667,4995298701325,5205013850267,6254171192017,6472670497688,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,10955823525974,11166752857762,11693649535342,11904578867130,12846804199121,13090604852046,13578472556962,13789401888750,17059842078088,17318665234949,17758639114792,18618844536958,19058818416801,19498792296644,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr1 : Row := ⟨1,2,1,20,1725436586697640946858688965569256363112777243042596638790631055947776,[0,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,11698766012776,11909695344564,12455420519905,12666349851693],[1000000000000000000000000000000,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,13695839060357,13906768392145,14963495707778,15174425039566]⟩ +def cgr2 : Row := ⟨2,2,1,22,1725436586697640946858688965569256363112777243042596638790631055947776,[0,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,11698766012776,11909695344564,12455420519905,12666349851693,13450940073663,13694740726588],[1000000000000000000000000000000,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,13695839060357,13906768392145,14963495707778,15174425039566,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr3 : Row := ⟨3,2,1,24,1725436586697640946858688965569256363112777243042596638790631055947776,[0,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,11698766012776,11909695344564,12455420519905,12666349851693,13450940073663,13694740726588,14182608431504,14393537763292],[1000000000000000000000000000000,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,13695839060357,13906768392145,14963495707778,15174425039566,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr4 : Row := ⟨4,2,1,26,1725436586697640946858688965569256363112777243042596638790631055947776,[0,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,11698766012776,11909695344564,12455420519905,12666349851693,13450940073663,13694740726588,14182608431504,14393537763292,15434893908440,15693717065301],[1000000000000000000000000000000,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,13695839060357,13906768392145,14963495707778,15174425039566,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr5 : Row := ⟨5,2,1,28,1725436586697640946858688965569256363112777243042596638790631055947776,[0,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,11698766012776,11909695344564,12455420519905,12666349851693,13450940073663,13694740726588,14182608431504,14393537763292,15434893908440,15693717065301,16133690945144,16993896367310],[1000000000000000000000000000000,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,13695839060357,13906768392145,14963495707778,15174425039566,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr6 : Row := ⟨6,2,1,30,1725436586697640946858688965569256363112777243042596638790631055947776,[0,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,11698766012776,11909695344564,12455420519905,12666349851693,13450940073663,13694740726588,14182608431504,14393537763292,15434893908440,15693717065301,16133690945144,16993896367310,17433870247153,17873844126996],[1000000000000000000000000000000,3013674266160,3469983048661,3804414277272,4014129426214,4501997131130,4712926462918,5259865821105,5469580970047,6254171192017,6497971844942,6985839549858,7196768881646,8286018851867,8496948183655,8936922063498,10019755845510,13695839060357,13906768392145,14963495707778,15174425039566,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr7 : Row := ⟨7,2,2,18,1725436586697640946858688965569256072344153165092240253739596775424000,[0,1664534151591,2235025939264,2532237145156,2741952294098,3248648496775,3459577828563,3987688688989,4197403837931,5139629169922,5383429822847,5871297527763,6082226859551,7171476829772,7382406161560,7822380041403,8394807675862,9330875356326,9541804688114],[1000000000000000000000000000000,1664534151591,2235025939264,2532237145156,2741952294098,3248648496775,3459577828563,3987688688989,4197403837931,5139629169922,5383429822847,5871297527763,6082226859551,7171476829772,7382406161560,7822380041403,8905213823415,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr8 : Row := ⟨8,2,2,20,1725436586697640946858688965569256072344153165092240253739596775424000,[0,1664534151591,2235025939264,2532237145156,2741952294098,3248648496775,3459577828563,3987688688989,4197403837931,5139629169922,5383429822847,5871297527763,6082226859551,7171476829772,7382406161560,7822380041403,8394807675862,9330875356326,9541804688114,10068701365694,10279630697482],[1000000000000000000000000000000,1664534151591,2235025939264,2532237145156,2741952294098,3248648496775,3459577828563,3987688688989,4197403837931,5139629169922,5383429822847,5871297527763,6082226859551,7171476829772,7382406161560,7822380041403,8905213823415,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr9 : Row := ⟨9,2,2,22,1725436586697640946858688965569256072344153165092240253739596775424000,[0,1664534151591,2235025939264,2532237145156,2741952294098,3248648496775,3459577828563,3987688688989,4197403837931,5139629169922,5383429822847,5871297527763,6082226859551,7171476829772,7382406161560,7822380041403,8394807675862,9330875356326,9541804688114,10068701365694,10279630697482,11221856029473,11465656682398],[1000000000000000000000000000000,1664534151591,2235025939264,2532237145156,2741952294098,3248648496775,3459577828563,3987688688989,4197403837931,5139629169922,5383429822847,5871297527763,6082226859551,7171476829772,7382406161560,7822380041403,8905213823415,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr10 : Row := ⟨10,2,2,24,1725436586697640946858688965569256072344153165092240253739596775424000,[0,1664534151591,2235025939264,2532237145156,2741952294098,3248648496775,3459577828563,3987688688989,4197403837931,5139629169922,5383429822847,5871297527763,6082226859551,7171476829772,7382406161560,7822380041403,8394807675862,9330875356326,9541804688114,10068701365694,10279630697482,11221856029473,11465656682398,11953524387314,12164453719102],[1000000000000000000000000000000,1664534151591,2235025939264,2532237145156,2741952294098,3248648496775,3459577828563,3987688688989,4197403837931,5139629169922,5383429822847,5871297527763,6082226859551,7171476829772,7382406161560,7822380041403,8905213823415,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr11 : Row := ⟨11,3,1,8,1725436586697640946858688965569256363112769808131088451570363873099776,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267]⟩ +def cgr12 : Row := ⟨12,3,1,10,1725436586697640946858688965569256363112777243028422585784197460262912,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688]⟩ +def cgr13 : Row := ⟨13,3,1,11,1725436586697640946858688965569256363112777243033147258110076319170560,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985]⟩ +def cgr14 : Row := ⟨14,3,1,12,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773]⟩ +def cgr15 : Row := ⟨15,3,1,13,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,9601954376635],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,1000000000000000000000000000000]⟩ +def cgr16 : Row := ⟨16,3,1,14,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,9601954376635,9817232410002],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr17 : Row := ⟨17,3,1,15,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,9601954376635,9817232410002,10200312551592],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr18 : Row := ⟨18,3,1,16,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,9601954376635,9817232410002,10200312551592,10410027700534],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr19 : Row := ⟨19,3,1,17,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,9601954376635,9817232410002,10200312551592,10410027700534,11466755016167],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr20 : Row := ⟨20,3,1,18,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,9601954376635,9817232410002,10200312551592,10410027700534,11466755016167,11677684347955],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr21 : Row := ⟨21,3,1,19,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,9601954376635,9817232410002,10200312551592,10410027700534,11466755016167,11677684347955,12734411663588],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr22 : Row := ⟨22,3,1,20,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,9601954376635,9817232410002,10200312551592,10410027700534,11466755016167,11677684347955,12734411663588,12945340995376],[1000000000000000000000000000000,2982922637934,3242635951600,3539847157492,3749562306434,4396940526368,4612218559735,4995298701325,5205013850267,6261741165900,6472670497688,8333174494985,8544103826773,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr23 : Row := ⟨23,3,2,6,1725436586697640946858688964519793351043731158960419414395210547855360,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128]⟩ +def cgr24 : Row := ⟨24,3,2,7,1725436586697640946858688964869614258143869349367193180740345082675200,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718]⟩ +def cgr25 : Row := ⟨25,3,2,8,1725436586697640946858688965569256072344145730180740713430614152314880,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660]⟩ +def cgr26 : Row := ⟨26,3,2,9,1725436586697640946858688965569256072344148208479851515041139711279104,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293]⟩ +def cgr27 : Row := ⟨27,3,2,10,1725436586697640946858688965569256072344153165078073118262190829207552,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081]⟩ +def cgr28 : Row := ⟨28,3,2,11,1725436586697640946858688965569256072344153165082795484745060474421248,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,6125505108545],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,7023496545378]⟩ +def cgr29 : Row := ⟨29,3,2,12,1725436586697640946858688965569256072344153165092240217710799764848640,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,6125505108545,6335220257487],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,7023496545378,7234425877166]⟩ +def cgr30 : Row := ⟨30,3,2,13,1725436586697640946858688965569256072344153165092240217710799764848640,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,6125505108545,6335220257487,6982598477421],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,7023496545378,7234425877166,1000000000000000000000000000000]⟩ +def cgr31 : Row := ⟨31,3,2,14,1725436586697640946858688965569256072344153165092240217710799764848640,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,6125505108545,6335220257487,6982598477421,7197876510788],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,7023496545378,7234425877166,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr32 : Row := ⟨32,3,2,15,1725436586697640946858688965569256072344153165092240217710799764848640,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,6125505108545,6335220257487,6982598477421,7197876510788,7580956652378],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,7023496545378,7234425877166,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr33 : Row := ⟨33,3,2,16,1725436586697640946858688965569256072344153165092240217710799764848640,[0,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,6125505108545,6335220257487,6982598477421,7197876510788,7580956652378,7790671801320],[1000000000000000000000000000000,1569180443940,1932958001993,2230169207885,2439884356827,3087262576761,3302540610128,3685620751718,3895335900660,4952063216293,5162992548081,7023496545378,7234425877166,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr34 : Row := ⟨34,3,3,4,1725436586697640946849780764332283298176074888370600511503471000682496,[0,1046120295960,1496398685458,1793609891350,2003325040292],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292]⟩ +def cgr35 : Row := ⟨35,3,3,6,1725436586697640946858688964519783049526763825862118485357350877134848,[0,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340]⟩ +def cgr36 : Row := ⟨36,3,3,7,1725436586697640946858688964869593322802935736941613873340823816372224,[0,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183]⟩ +def cgr37 : Row := ⟨37,3,3,8,1725436586697640946858688965569213869355279559100604649307769694846976,[0,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125]⟩ +def cgr38 : Row := ⟨38,3,3,9,1725436586697640946858688965569213869355282037398534859297577842507776,[0,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4504896880085],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4515503899758]⟩ +def cgr39 : Row := ⟨39,3,3,10,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4504896880085,4726433231546],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4515503899758,4726433231546]⟩ +def cgr40 : Row := ⟨40,3,3,11,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4504896880085,4726433231546,5252386475475],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4515503899758,4726433231546,1000000000000000000000000000000]⟩ +def cgr41 : Row := ⟨41,3,3,12,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4504896880085,4726433231546,5252386475475,5462101624417],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4515503899758,4726433231546,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr42 : Row := ⟨42,3,3,13,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4504896880085,4726433231546,5252386475475,5462101624417,6056934807677],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4515503899758,4726433231546,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr43 : Row := ⟨43,3,3,14,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4504896880085,4726433231546,5252386475475,5462101624417,6056934807677,6267864139465],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4515503899758,4726433231546,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr44 : Row := ⟨44,3,3,15,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4504896880085,4726433231546,5252386475475,5462101624417,6056934807677,6267864139465,6707838019308],[1000000000000000000000000000000,1046120295960,1496398685458,1793609891350,2003325040292,2598158223552,2809087555340,3249061435183,3458776584125,4515503899758,4726433231546,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr45 : Row := ⟨45,3,4,3,1725436572984891677951467423971062446496094382868200824551407605514240,[0,784590221970,1240899004471,1575330233082],[1000000000000000000000000000000,784590221970,1240899004471,1575330233082]⟩ +def cgr46 : Row := ⟨46,3,4,4,1725436586697640898959295112272958727406674468635681809116020569276416,[0,784590221970,1240899004471,1575330233082,1785045382024],[1000000000000000000000000000000,784590221970,1240899004471,1575330233082,1785045382024]⟩ +def cgr47 : Row := ⟨47,3,4,5,1725436586697640898962264512335118362156649842518275365008053446377472,[0,784590221970,1240899004471,1575330233082,1785045382024,2272913086940],[1000000000000000000000000000000,784590221970,1240899004471,1575330233082,1785045382024,2272913086940]⟩ +def cgr48 : Row := ⟨48,3,4,6,1725436586697640898968203312459437631656600590283462476792119200579584,[0,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728],[1000000000000000000000000000000,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728]⟩ +def cgr49 : Row := ⟨49,3,4,7,1725436586697640898968203312807886775465088746904641456538550479618048,[0,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915],[1000000000000000000000000000000,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915]⟩ +def cgr50 : Row := ⟨50,3,4,8,1725436586697640898968203313504785063082065060146999416031413037694976,[0,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915,3240496925857],[1000000000000000000000000000000,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915,3240496925857]⟩ +def cgr51 : Row := ⟨51,3,4,9,1725436586697640898968203313504785063082067536027077986791962835943424,[0,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915,3240496925857,4025087147827],[1000000000000000000000000000000,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915,3240496925857,4297224241490]⟩ +def cgr52 : Row := ⟨52,3,4,10,1725436586697640898968203313504785063082072487787235128313062432440320,[0,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915,3240496925857,4025087147827,4268887800752],[1000000000000000000000000000000,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915,3240496925857,4297224241490,4508153573278]⟩ +def cgr53 : Row := ⟨53,3,4,11,1725436586697640898968203313504785063082072487787235128313062432440320,[0,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915,3240496925857,4025087147827,4268887800752,4756755505668],[1000000000000000000000000000000,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915,3240496925857,4297224241490,4508153573278,1000000000000000000000000000000]⟩ +def cgr54 : Row := ⟨54,3,4,12,1725436586697640898968203313504785063082072487787235128313062432440320,[0,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915,3240496925857,4025087147827,4268887800752,4756755505668,4967684837456],[1000000000000000000000000000000,784590221970,1240899004471,1575330233082,1785045382024,2272913086940,2483842418728,3030781776915,3240496925857,4297224241490,4508153573278,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr55 : Row := ⟨55,4,1,4,1725436586697640946849780764332285624630501836782856782355286582099968,[0,2908533909773,3312570571722,3603093053056,3812808201998],[1000000000000000000000000000000,2908533909773,3312570571722,3603093053056,3812808201998]⟩ +def cgr56 : Row := ⟨56,4,1,6,1725436586697640946858688964519793434364829842347494516881757994745856,[0,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667],[1000000000000000000000000000000,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667]⟩ +def cgr57 : Row := ⟨57,4,1,7,1725436586697640946858688964869614341383520862114826843778097958879232,[0,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045],[1000000000000000000000000000000,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045]⟩ +def cgr58 : Row := ⟨58,4,1,8,1725436586697640946858688965569256321574402374763975610546660422189056,[0,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045,5502889263987],[1000000000000000000000000000000,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045,5502889263987]⟩ +def cgr59 : Row := ⟨59,4,1,9,1725436586697640946858688965569256321574402374763975610546660422189056,[0,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045,5502889263987,8018519788877],[1000000000000000000000000000000,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045,5502889263987,1000000000000000000000000000000]⟩ +def cgr60 : Row := ⟨60,4,1,10,1725436586697640946858688965569256321574402374763975610546660422189056,[0,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045,5502889263987,8018519788877,8229449120665],[1000000000000000000000000000000,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045,5502889263987,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr61 : Row := ⟨61,4,1,11,1725436586697640946858688965569256321574402374763975610546660422189056,[0,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045,5502889263987,8018519788877,8229449120665,8622352505546],[1000000000000000000000000000000,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045,5502889263987,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr62 : Row := ⟨62,4,1,12,1725436586697640946858688965569256321574402374763975610546660422189056,[0,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045,5502889263987,8018519788877,8229449120665,8622352505546,8833281837334],[1000000000000000000000000000000,2908533909773,3312570571722,3603093053056,3812808201998,4205711586879,4416640918667,5293174115045,5502889263987,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr63 : Row := ⟨63,4,2,2,1725429058513974481006928856009369042408591087781735667604368899702784,[0,1454266954886,1858303616835],[1000000000000000000000000000000,1454266954886,1858303616835]⟩ +def cgr64 : Row := ⟨64,4,2,3,1725436572984891677951467423971191030149188575169341034321976229888000,[0,1454266954886,1858303616835,2148826098169],[1000000000000000000000000000000,1454266954886,1858303616835,2148826098169]⟩ +def cgr65 : Row := ⟨65,4,2,4,1725436586697640946849780764332285583092126968504235754111315948339200,[0,1454266954886,1858303616835,2148826098169,2358541247111],[1000000000000000000000000000000,1454266954886,1858303616835,2148826098169,2358541247111]⟩ +def cgr66 : Row := ⟨66,4,2,5,1725436586697640946852750164394788158644653058173367646790825996713984,[0,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992],[1000000000000000000000000000000,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992]⟩ +def cgr67 : Row := ⟨67,4,2,6,1725436586697640946858688964519793309749705237511631432149846093463552,[0,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780],[1000000000000000000000000000000,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780]⟩ +def cgr68 : Row := ⟨68,4,2,7,1725436586697640946858688964869614216768396257278963759046186057596928,[0,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158],[1000000000000000000000000000000,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158]⟩ +def cgr69 : Row := ⟨69,4,2,8,1725436586697640946858688965569256030805778296813628412838865985863680,[0,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158,4048622309100],[1000000000000000000000000000000,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158,4048622309100]⟩ +def cgr70 : Row := ⟨70,4,2,9,1725436586697640946858688965569256030805778296813628412838865985863680,[0,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158,4048622309100,5109985879103],[1000000000000000000000000000000,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158,4048622309100,1000000000000000000000000000000]⟩ +def cgr71 : Row := ⟨71,4,2,10,1725436586697640946858688965569256030805778296813628412838865985863680,[0,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158,4048622309100,5109985879103,5320915210891],[1000000000000000000000000000000,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158,4048622309100,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr72 : Row := ⟨72,4,2,11,1725436586697640946858688965569256030805778296813628412838865985863680,[0,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158,4048622309100,5109985879103,5320915210891,5713818595772],[1000000000000000000000000000000,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158,4048622309100,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr73 : Row := ⟨73,4,2,12,1725436586697640946858688965569256030805778296813628412838865985863680,[0,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158,4048622309100,5109985879103,5320915210891,5713818595772,5924747927560],[1000000000000000000000000000000,1454266954886,1858303616835,2148826098169,2358541247111,2751444631992,2962373963780,3838907160158,4048622309100,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr74 : Row := ⟨74,4,3,2,1725429058513974481006928856009368710101592141552767441652603829616640,[0,969511303257,1373547965206],[1000000000000000000000000000000,969511303257,1373547965206]⟩ +def cgr75 : Row := ⟨75,4,3,3,1725436572984891677951467423971190033228191736482436356466681019629568,[0,969511303257,1373547965206,1664070446540],[1000000000000000000000000000000,969511303257,1373547965206,1664070446540]⟩ +def cgr76 : Row := ⟨76,4,3,4,1725436586697640946849780764332283256943134344901458172448960457736192,[0,969511303257,1373547965206,1664070446540,1873785595482],[1000000000000000000000000000000,969511303257,1373547965206,1664070446540,1873785595482]⟩ +def cgr77 : Row := ⟨77,4,3,5,1725436586697640946852750164394783174039668864738844257514349945421824,[0,969511303257,1373547965206,1664070446540,1873785595482,2266688980363],[1000000000000000000000000000000,969511303257,1373547965206,1664070446540,1873785595482,2266688980363]⟩ +def cgr78 : Row := ⟨78,4,3,6,1725436586697640946858688964519783008232737904413616427645128920793088,[0,969511303257,1373547965206,1664070446540,1873785595482,2266688980363,2477618312151],[1000000000000000000000000000000,969511303257,1373547965206,1664070446540,1873785595482,2266688980363,2477618312151]⟩ +def cgr79 : Row := ⟨79,4,3,7,1725436586697640946858688964869593281427462644853965524084986642169856,[0,969511303257,1373547965206,1664070446540,1873785595482,2266688980363,2477618312151,3354151508529],[1000000000000000000000000000000,969511303257,1373547965206,1664070446540,1873785595482,2266688980363,2477618312151,3354151508529]⟩ +def cgr80 : Row := ⟨80,4,3,8,1725436586697640946858688965569213827816912125734663716964702084923392,[0,969511303257,1373547965206,1664070446540,1873785595482,2266688980363,2477618312151,3354151508529,3563866657471],[1000000000000000000000000000000,969511303257,1373547965206,1664070446540,1873785595482,2266688980363,2477618312151,3354151508529,3563866657471]⟩ +def cgr81 : Row := ⟨81,4,3,9,1725436586697640946858688965569213827816912125734663716964702084923392,[0,969511303257,1373547965206,1664070446540,1873785595482,2266688980363,2477618312151,3354151508529,3563866657471,4140474575845],[1000000000000000000000000000000,969511303257,1373547965206,1664070446540,1873785595482,2266688980363,2477618312151,3354151508529,3563866657471,1000000000000000000000000000000]⟩ +def cgr82 : Row := ⟨82,4,3,10,1725436586697640946858688965569213827816912125734663716964702084923392,[0,969511303257,1373547965206,1664070446540,1873785595482,2266688980363,2477618312151,3354151508529,3563866657471,4140474575845,4351403907633],[1000000000000000000000000000000,969511303257,1373547965206,1664070446540,1873785595482,2266688980363,2477618312151,3354151508529,3563866657471,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr83 : Row := ⟨83,4,4,1,1653786614870979874242332953218776295840243179859395196846919280230400,[0,727133477443],[1000000000000000000000000000000,727133477443]⟩ +def cgr84 : Row := ⟨84,4,4,2,1725429058513974481006928856009326174805727024244834519826674858590208,[0,727133477443,1111147757304],[1000000000000000000000000000000,727133477443,1111147757304]⟩ +def cgr85 : Row := ⟨85,4,4,3,1725436572984891677951467423971062427340596384558637590988894106550272,[0,727133477443,1111147757304,1408358963196],[1000000000000000000000000000000,727133477443,1111147757304,1408358963196]⟩ +def cgr86 : Row := ⟨86,4,4,4,1725436586697640898959295112272958686173733925298765731581860092313600,[0,727133477443,1111147757304,1408358963196,1618074112138],[1000000000000000000000000000000,727133477443,1111147757304,1408358963196,1618074112138]⟩ +def cgr87 : Row := ⟨87,4,4,5,1725436586697640898962264512335118320903347506672688442039817811787776,[0,727133477443,1111147757304,1408358963196,1618074112138,2024311154549],[1000000000000000000000000000000,727133477443,1111147757304,1408358963196,1618074112138,2024311154549]⟩ +def cgr88 : Row := ⟨88,4,4,6,1725436586697640898968203312459437590362574669420533862955733250736128,[0,727133477443,1111147757304,1408358963196,1618074112138,2024311154549,2235240486337],[1000000000000000000000000000000,727133477443,1111147757304,1408358963196,1618074112138,2024311154549,2235240486337]⟩ +def cgr89 : Row := ⟨89,4,4,7,1725436586697640898968203312807886734089615656007029460965863899267072,[0,727133477443,1111147757304,1408358963196,1618074112138,2024311154549,2235240486337,2962373963780],[1000000000000000000000000000000,727133477443,1111147757304,1408358963196,1618074112138,2024311154549,2235240486337,3111773682715]⟩ +def cgr90 : Row := ⟨90,4,4,8,1725436586697640898968203313504785021543697629180020656986125196328960,[0,727133477443,1111147757304,1408358963196,1618074112138,2024311154549,2235240486337,2962373963780,3236148224276],[1000000000000000000000000000000,727133477443,1111147757304,1408358963196,1618074112138,2024311154549,2235240486337,3111773682715,3321488831657]⟩ +def cgr91 : Row := ⟨91,4,4,9,1725436586697640898968203313504785021543697629180020656986125196328960,[0,727133477443,1111147757304,1408358963196,1618074112138,2024311154549,2235240486337,2962373963780,3236148224276,3642385266687],[1000000000000000000000000000000,727133477443,1111147757304,1408358963196,1618074112138,2024311154549,2235240486337,3111773682715,3321488831657,1000000000000000000000000000000]⟩ +def cgr92 : Row := ⟨92,4,4,10,1725436586697640898968203313504785021543697629180020656986125196328960,[0,727133477443,1111147757304,1408358963196,1618074112138,2024311154549,2235240486337,2962373963780,3236148224276,3642385266687,3853314598475],[1000000000000000000000000000000,727133477443,1111147757304,1408358963196,1618074112138,2024311154549,2235240486337,3111773682715,3321488831657,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr93 : Row := ⟨93,4,5,2,1725429058513974481006928855992992621193521977998592538669949984440320,[0,581706781954,916000675337],[1000000000000000000000000000000,581706781954,916000675337]⟩ +def cgr94 : Row := ⟨94,4,5,3,1725436572984891582170496119814897154848762079756415658785340930392064,[0,581706781954,916000675337,1213211881229],[1000000000000000000000000000000,581706781954,916000675337,1213211881229]⟩ +def cgr95 : Row := ⟨95,4,5,4,1725436586697640611616381199837129975922641103384583897284650312138752,[0,581706781954,916000675337,1213211881229,1422927030171],[1000000000000000000000000000000,581706781954,916000675337,1213211881229,1422927030171]⟩ +def cgr96 : Row := ⟨96,4,5,5,1725436586697640611619350599812177324720494438111882708240075369480192,[0,581706781954,916000675337,1213211881229,1422927030171,1878884459060],[1000000000000000000000000000000,581706781954,916000675337,1213211881229,1422927030171,1878884459060]⟩ +def cgr97 : Row := ⟨97,4,5,6,1725436586697640611625289399762272022316201107566480330150925484163072,[0,581706781954,916000675337,1213211881229,1422927030171,1878884459060,2089813790848],[1000000000000000000000000000000,581706781954,916000675337,1213211881229,1422927030171,1878884459060,2089813790848]⟩ +def cgr98 : Row := ⟨98,4,5,7,1725436586697640611625289399762272022316201107566480330150925484163072,[0,581706781954,916000675337,1213211881229,1422927030171,1878884459060,2089813790848,2636138911400],[1000000000000000000000000000000,581706781954,916000675337,1213211881229,1422927030171,1878884459060,2089813790848,1000000000000000000000000000000]⟩ +def cgr99 : Row := ⟨99,4,5,8,1725436586697640611625289399762272022316201107566480330150925484163072,[0,581706781954,916000675337,1213211881229,1422927030171,1878884459060,2089813790848,2636138911400,2845854060342],[1000000000000000000000000000000,581706781954,916000675337,1213211881229,1422927030171,1878884459060,2089813790848,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr100 : Row := ⟨100,4,6,1,1653786614870979874242332953213331777969508164443981203128010988847104,[0,484755651628],[1000000000000000000000000000000,484755651628]⟩ +def cgr101 : Row := ⟨101,4,6,2,1725429058513974481006928854599196046285358031652610146629427390316544,[0,484755651628,785902620693],[1000000000000000000000000000000,484755651628,785902620693]⟩ +def cgr102 : Row := ⟨102,4,6,3,1725436572984891582170496115633507430124270240718468482663773148020736,[0,484755651628,785902620693,1083113826585],[1000000000000000000000000000000,484755651628,785902620693,1083113826585]⟩ +def cgr103 : Row := ⟨103,4,6,4,1725436586697640228492495973608339361978736691385411248316211607371776,[0,484755651628,785902620693,1083113826585,1292828975527],[1000000000000000000000000000000,484755651628,785902620693,1083113826585,1292828975527]⟩ +def cgr104 : Row := ⟨104,4,6,5,1725436586697640228495465362433014111511278455344850922947455911723008,[0,484755651628,785902620693,1083113826585,1292828975527,1777584627155],[1000000000000000000000000000000,484755651628,785902620693,1083113826585,1292828975527,1781933328734]⟩ +def cgr105 : Row := ⟨105,4,6,6,1725436586697640228501404140082363610576361983263730272209944520425472,[0,484755651628,785902620693,1083113826585,1292828975527,1777584627155,1992862660522],[1000000000000000000000000000000,484755651628,785902620693,1083113826585,1292828975527,1781933328734,1992862660522]⟩ +def cgr106 : Row := ⟨106,4,6,7,1725436586697640228501404140082363610576361983263730272209944520425472,[0,484755651628,785902620693,1083113826585,1292828975527,1777584627155,1992862660522,2375942802112],[1000000000000000000000000000000,484755651628,785902620693,1083113826585,1292828975527,1781933328734,1992862660522,1000000000000000000000000000000]⟩ +def cgr107 : Row := ⟨107,4,6,8,1725436586697640228501404140082363610576361983263730272209944520425472,[0,484755651628,785902620693,1083113826585,1292828975527,1777584627155,1992862660522,2375942802112,2585657951054],[1000000000000000000000000000000,484755651628,785902620693,1083113826585,1292828975527,1781933328734,1992862660522,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr108 : Row := ⟨108,4,7,2,1725429058513973714759158287850295675928105607283708701369697262632960,[0,415504844253,692975438804],[1000000000000000000000000000000,415504844253,692975438804]⟩ +def cgr109 : Row := ⟨109,4,7,3,1725436572984889283427184504589787113175005533754637237478028788891648,[0,415504844253,692975438804,990186644696],[1000000000000000000000000000000,415504844253,692975438804,990186644696]⟩ +def cgr110 : Row := ⟨110,4,7,4,1725436586697634864758102273974979151845447419231720403278438785351680,[0,415504844253,692975438804,990186644696,1199901793638],[1000000000000000000000000000000,415504844253,692975438804,990186644696,1199901793638]⟩ +def cgr111 : Row := ⟨111,4,8,1,1653786614870979874242330054116455968988499764800605758841015211393024,[0,363566738721],[1000000000000000000000000000000,363566738721]⟩ +def cgr112 : Row := ⟨112,4,8,2,1725429058513967584776986260808706006780710656331157529442390231744512,[0,363566738721,623280052387],[1000000000000000000000000000000,363566738721,623280052387]⟩ +def cgr113 : Row := ⟨113,4,8,3,1725436572984870893480674132455788929572344914040861519676653227212800,[0,363566738721,623280052387,920491258279],[1000000000000000000000000000000,363566738721,623280052387,920491258279]⟩ +def cgr114 : Row := ⟨114,4,8,4,1725436586697591954882915211656163939332255461995495593728926162092032,[0,363566738721,623280052387,920491258279,1130206407221],[1000000000000000000000000000000,363566738721,623280052387,920491258279,1130206407221]⟩ +def cgr115 : Row := ⟨115,5,1,4,1725436586697640898968203313510229539414432644595434650705033487712256,[0,2619355899213,2894085999444,3051979452575,3261694601517],[1000000000000000000000000000000,2619355899213,2894085999444,3051979452575,3261694601517]⟩ +def cgr116 : Row := ⟨116,5,1,6,1725436586697640898968203313510229539414432644595434650705033487712256,[0,2619355899213,2894085999444,3051979452575,3261694601517,5881050500730,6103958905150],[1000000000000000000000000000000,2619355899213,2894085999444,3051979452575,3261694601517,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr117 : Row := ⟨117,5,1,8,1725436586697640898968203313510229539414432644595434650705033487712256,[0,2619355899213,2894085999444,3051979452575,3261694601517,5881050500730,6103958905150,6313674054092,6523389203034],[1000000000000000000000000000000,2619355899213,2894085999444,3051979452575,3261694601517,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr118 : Row := ⟨118,5,2,2,1725429058513974435512749127358223492903704978117757371786200885493760,[0,1309677949606,1584408049837],[1000000000000000000000000000000,1309677949606,1584408049837]⟩ +def cgr119 : Row := ⟨119,5,2,3,1725436572984891631661488454596408649253366394090421802641103400206336,[0,1309677949606,1584408049837,1742301502968],[1000000000000000000000000000000,1309677949606,1584408049837,1742301502968]⟩ +def cgr120 : Row := ⟨120,5,2,4,1725436586697640898968203313510229539414432644595434650705033487712256,[0,1309677949606,1584408049837,1742301502968,1952016651910],[1000000000000000000000000000000,1309677949606,1584408049837,1742301502968,1952016651910]⟩ +def cgr121 : Row := ⟨121,5,2,5,1725436586697640898968203313510229539414432644595434650705033487712256,[0,1309677949606,1584408049837,1742301502968,1952016651910,3261694601516],[1000000000000000000000000000000,1309677949606,1584408049837,1742301502968,1952016651910,1000000000000000000000000000000]⟩ +def cgr122 : Row := ⟨122,5,2,6,1725436586697640898968203313510229539414432644595434650705033487712256,[0,1309677949606,1584408049837,1742301502968,1952016651910,3261694601516,3484603005936],[1000000000000000000000000000000,1309677949606,1584408049837,1742301502968,1952016651910,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr123 : Row := ⟨123,5,2,7,1725436586697640898968203313510229539414432644595434650705033487712256,[0,1309677949606,1584408049837,1742301502968,1952016651910,3261694601516,3484603005936,3694318154878],[1000000000000000000000000000000,1309677949606,1584408049837,1742301502968,1952016651910,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr124 : Row := ⟨124,5,2,8,1725436586697640898968203313510229539414432644595434650705033487712256,[0,1309677949606,1584408049837,1742301502968,1952016651910,3261694601516,3484603005936,3694318154878,3904033303820],[1000000000000000000000000000000,1309677949606,1584408049837,1742301502968,1952016651910,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr125 : Row := ⟨125,5,3,2,1725429058513974435512749127358223492903704978117757371786200885493760,[0,873118633071,1147848733302],[1000000000000000000000000000000,873118633071,1147848733302]⟩ +def cgr126 : Row := ⟨126,5,3,3,1725436572984891631661488454596408649253366394090421802641103400206336,[0,873118633071,1147848733302,1305742186433],[1000000000000000000000000000000,873118633071,1147848733302,1305742186433]⟩ +def cgr127 : Row := ⟨127,5,3,4,1725436586697640898968203313510229539414432644595434650705033487712256,[0,873118633071,1147848733302,1305742186433,1515457335375],[1000000000000000000000000000000,873118633071,1147848733302,1305742186433,1515457335375]⟩ +def cgr128 : Row := ⟨128,5,3,5,1725436586697640898968203313510229539414432644595434650705033487712256,[0,873118633071,1147848733302,1305742186433,1515457335375,2388575968446],[1000000000000000000000000000000,873118633071,1147848733302,1305742186433,1515457335375,1000000000000000000000000000000]⟩ +def cgr129 : Row := ⟨129,5,3,6,1725436586697640898968203313510229539414432644595434650705033487712256,[0,873118633071,1147848733302,1305742186433,1515457335375,2388575968446,2611484372866],[1000000000000000000000000000000,873118633071,1147848733302,1305742186433,1515457335375,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr130 : Row := ⟨130,5,3,7,1725436586697640898968203313510229539414432644595434650705033487712256,[0,873118633071,1147848733302,1305742186433,1515457335375,2388575968446,2611484372866,2821199521808],[1000000000000000000000000000000,873118633071,1147848733302,1305742186433,1515457335375,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr131 : Row := ⟨131,5,3,8,1725436586697640898968203313510229539414432644595434650705033487712256,[0,873118633071,1147848733302,1305742186433,1515457335375,2388575968446,2611484372866,2821199521808,3030914670750],[1000000000000000000000000000000,873118633071,1147848733302,1305742186433,1515457335375,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr132 : Row := ⟨132,5,4,1,1653786614870979859077606377466340926842290479932363611513602153906176,[0,654838974803],[1000000000000000000000000000000,654838974803]⟩ +def cgr133 : Row := ⟨133,5,4,2,1725429058513974435512749127358223492903704978117757371786200885493760,[0,654838974803,929569075034],[1000000000000000000000000000000,654838974803,929569075034]⟩ +def cgr134 : Row := ⟨134,5,4,3,1725436572984891631661488454596408649253366394090421802641103400206336,[0,654838974803,929569075034,1087462528165],[1000000000000000000000000000000,654838974803,929569075034,1087462528165]⟩ +def cgr135 : Row := ⟨135,5,4,4,1725436586697640851077717661451202715716088046148272662619435919474688,[0,654838974803,929569075034,1087462528165,1297177677107],[1000000000000000000000000000000,654838974803,929569075034,1087462528165,1297177677107]⟩ +def cgr136 : Row := ⟨136,5,4,5,1725436586697640851077717661451202715716088046148272662619435919474688,[0,654838974803,929569075034,1087462528165,1297177677107,1952016651910],[1000000000000000000000000000000,654838974803,929569075034,1087462528165,1297177677107,1000000000000000000000000000000]⟩ +def cgr137 : Row := ⟨137,5,4,6,1725436586697640851077717661451202715716088046148272662619435919474688,[0,654838974803,929569075034,1087462528165,1297177677107,1952016651910,2174925056330],[1000000000000000000000000000000,654838974803,929569075034,1087462528165,1297177677107,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr138 : Row := ⟨138,5,4,7,1725436586697640851077717661451202715716088046148272662619435919474688,[0,654838974803,929569075034,1087462528165,1297177677107,1952016651910,2174925056330,2384640205272],[1000000000000000000000000000000,654838974803,929569075034,1087462528165,1297177677107,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr139 : Row := ⟨139,5,4,8,1725436586697640851077717661451202715716088046148272662619435919474688,[0,654838974803,929569075034,1087462528165,1297177677107,1952016651910,2174925056330,2384640205272,2594355354214],[1000000000000000000000000000000,654838974803,929569075034,1087462528165,1297177677107,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr140 : Row := ⟨140,5,5,2,1725429058513974435512749127358223492903704978117757371786200885493760,[0,523871179842,780110702221],[1000000000000000000000000000000,523871179842,780110702221]⟩ +def cgr141 : Row := ⟨141,5,5,3,1725436572984891535880517150478355001856677197196097826469908263731200,[0,523871179842,780110702221,956494733204],[1000000000000000000000000000000,523871179842,780110702221,956494733204]⟩ +def cgr142 : Row := ⟨142,5,5,4,1725436586697640563734803749097041773526020455465300734105850510049280,[0,523871179842,780110702221,956494733204,1166209882146],[1000000000000000000000000000000,523871179842,780110702221,956494733204,1166209882146]⟩ +def cgr143 : Row := ⟨143,5,5,5,1725436586697640563734803749097041773526020455465300734105850510049280,[0,523871179842,780110702221,956494733204,1166209882146,1690081061988],[1000000000000000000000000000000,523871179842,780110702221,956494733204,1166209882146,1000000000000000000000000000000]⟩ +def cgr144 : Row := ⟨144,5,5,6,1725436586697640563734803749097041773526020455465300734105850510049280,[0,523871179842,780110702221,956494733204,1166209882146,1690081061988,1912989466408],[1000000000000000000000000000000,523871179842,780110702221,956494733204,1166209882146,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr145 : Row := ⟨145,5,6,1,1653786614870979859077606377466340926842290479932363611513602153906176,[0,436559316535],[1000000000000000000000000000000,436559316535]⟩ +def cgr146 : Row := ⟨146,5,6,2,1725429058513974435512749127358223492903704978117757371786200885493760,[0,436559316535,672660976429],[1000000000000000000000000000000,436559316535,672660976429]⟩ +def cgr147 : Row := ⟨147,5,6,3,1725436572984891535880517150478355001856677197196097826469908263731200,[0,436559316535,672660976429,869182869897],[1000000000000000000000000000000,436559316535,672660976429,869182869897]⟩ +def cgr148 : Row := ⟨148,5,6,4,1725436586697640180610918532624827183939263667888004829421069964148736,[0,436559316535,672660976429,869182869897,1078898018839],[1000000000000000000000000000000,436559316535,672660976429,869182869897,1078898018839]⟩ +def cgr149 : Row := ⟨149,5,6,5,1725436586697640180610918532624827183939263667888004829421069964148736,[0,436559316535,672660976429,869182869897,1078898018839,1515457335374],[1000000000000000000000000000000,436559316535,672660976429,869182869897,1078898018839,1000000000000000000000000000000]⟩ +def cgr150 : Row := ⟨150,5,6,6,1725436586697640180610918532624827183939263667888004829421069964148736,[0,436559316535,672660976429,869182869897,1078898018839,1515457335374,1738365739794],[1000000000000000000000000000000,436559316535,672660976429,869182869897,1078898018839,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr151 : Row := ⟨151,5,7,1,1653786614870979859077606377466340926842290479932363611513602153906176,[0,374193699887],[1000000000000000000000000000000,374193699887]⟩ +def cgr152 : Row := ⟨152,5,7,2,1725429058513973669264978694413794313730191402963165562416639793692672,[0,374193699887,595911172292],[1000000000000000000000000000000,374193699887,595911172292]⟩ +def cgr153 : Row := ⟨153,5,7,3,1725436572984889237137205851645067464336136471732322398361224988327936,[0,374193699887,595911172292,806817253249],[1000000000000000000000000000000,374193699887,595911172292,806817253249]⟩ +def cgr154 : Row := ⟨154,5,7,4,1725436586697634816876525502013822929724668641805862163834142321541120,[0,374193699887,595911172292,806817253249,1016532402191],[1000000000000000000000000000000,374193699887,595911172292,806817253249,1016532402191]⟩ +def cgr155 : Row := ⟨155,5,7,5,1725436586697634816876525502013822929724668641805862163834142321541120,[0,374193699887,595911172292,806817253249,1016532402191,1390726102078],[1000000000000000000000000000000,374193699887,595911172292,806817253249,1016532402191,1000000000000000000000000000000]⟩ +def cgr156 : Row := ⟨156,5,7,6,1725436586697634816876525502013822929724668641805862163834142321541120,[0,374193699887,595911172292,806817253249,1016532402191,1390726102078,1612443574483],[1000000000000000000000000000000,374193699887,595911172292,806817253249,1016532402191,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr157 : Row := ⟨157,5,8,1,1653786614870979859077606377466340926842290479932363611513602153906176,[0,327419487401],[1000000000000000000000000000000,327419487401]⟩ +def cgr158 : Row := ⟨158,5,8,2,1725429058513967539282815230858360880342082801726431087460151059283968,[0,327419487401,538348819189],[1000000000000000000000000000000,327419487401,538348819189]⟩ +def cgr159 : Row := ⟨159,5,8,3,1725436572984870847190715460978767164171810668022118973491758785101824,[0,327419487401,538348819189,760043040763],[1000000000000000000000000000000,327419487401,538348819189,760043040763]⟩ +def cgr160 : Row := ⟨160,5,8,4,1725436586697591907001381257125788896007908433148720839138721180680192,[0,327419487401,538348819189,760043040763,969758189705],[1000000000000000000000000000000,327419487401,538348819189,760043040763,969758189705]⟩ +def cgr161 : Row := ⟨161,5,8,5,1725436586697591907001381257125788896007908433148720839138721180680192,[0,327419487401,538348819189,760043040763,969758189705,1297177677106],[1000000000000000000000000000000,327419487401,538348819189,760043040763,969758189705,1000000000000000000000000000000]⟩ +def cgr162 : Row := ⟨162,5,8,6,1725436586697591907001381257125788896007908433148720839138721180680192,[0,327419487401,538348819189,760043040763,969758189705,1297177677106,1508107008894],[1000000000000000000000000000000,327419487401,538348819189,760043040763,969758189705,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr163 : Row := ⟨163,5,9,1,1653786614870930819220298669022873459737421670038487811861692278636544,[0,291039544357],[1000000000000000000000000000000,291039544357]⟩ +def cgr164 : Row := ⟨164,5,9,2,1725429058513820419710892105527958479027476372044803688504421433475072,[0,291039544357,493578100109],[1000000000000000000000000000000,291039544357,493578100109]⟩ +def cgr165 : Row := ⟨165,5,9,3,1725436572984527568189561501874494894437728998764988375928389658214400,[0,291039544357,493578100109,723663097719],[1000000000000000000000000000000,291039544357,493578100109,723663097719]⟩ +def cgr166 : Row := ⟨166,5,9,4,1725436586696856309141765630473776889434876284740583844360073051635712,[0,291039544357,493578100109,723663097719,933378246661],[1000000000000000000000000000000,291039544357,493578100109,723663097719,933378246661]⟩ +def cgr167 : Row := ⟨167,5,10,1,1653786614870930819220298669022873459737421670038487811861692278636544,[0,261935589921],[1000000000000000000000000000000,261935589921]⟩ +def cgr168 : Row := ⟨168,5,10,2,1725429058513035781993968770432479005349575413742790894073863429160960,[0,261935589921,457761524845],[1000000000000000000000000000000,261935589921,457761524845]⟩ +def cgr169 : Row := ⟨169,5,10,3,1725436572982173655038791496588056473404026123858949992636715645272064,[0,261935589921,457761524845,694559143283],[1000000000000000000000000000000,261935589921,457761524845,694559143283]⟩ +def cgr170 : Row := ⟨170,5,10,4,1725436586691363845123302284805420573689569576626494283346167021436928,[0,261935589921,457761524845,694559143283,904274292225],[1000000000000000000000000000000,261935589921,457761524845,694559143283,904274292225]⟩ +def cgr171 : Row := ⟨171,5,11,1,1653786614864653717484911988259037670314214003622385456417228244123648,[0,238123263564],[1000000000000000000000000000000,238123263564]⟩ +def cgr172 : Row := ⟨172,5,11,2,1725429058494204476787808728140971637079952414494483827740471325622272,[0,238123263564,428457054175],[1000000000000000000000000000000,238123263564,428457054175]⟩ +def cgr173 : Row := ⟨173,5,12,1,1653786614764220089718725096037665039542891340964747769305803691917312,[0,218279658267],[1000000000000000000000000000000,218279658267]⟩ +def cgr174 : Row := ⟨174,5,12,2,1725429058192903593489248051476853744765984426521570766406197669003264,[0,218279658267,404036661949],[1000000000000000000000000000000,218279658267,404036661949]⟩ +def cgr175 : Row := ⟨175,6,3,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,743028014730,878440362200,1621468376930,1756880724400],[1000000000000000000000000000000,743028014730,878440362200,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr176 : Row := ⟨176,6,4,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,557271011047,692683358517,1249954369564],[1000000000000000000000000000000,557271011047,692683358517,1000000000000000000000000000000]⟩ +def cgr177 : Row := ⟨177,6,4,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,557271011047,692683358517,1249954369564,1385366717034],[1000000000000000000000000000000,557271011047,692683358517,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr178 : Row := ⟨178,6,5,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,445816808838,581229156308,1027045965146,1162458312616],[1000000000000000000000000000000,445816808838,581229156308,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr179 : Row := ⟨179,6,6,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,371514007365,506926354835],[1000000000000000000000000000000,371514007365,506926354835]⟩ +def cgr180 : Row := ⟨180,6,6,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,371514007365,506926354835,878440362200],[1000000000000000000000000000000,371514007365,506926354835,1000000000000000000000000000000]⟩ +def cgr181 : Row := ⟨181,6,6,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,371514007365,506926354835,878440362200,1013852709670],[1000000000000000000000000000000,371514007365,506926354835,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr182 : Row := ⟨182,6,7,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,318440577741,453852925211],[1000000000000000000000000000000,318440577741,453852925211]⟩ +def cgr183 : Row := ⟨183,6,7,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,318440577741,453852925211,772293502952],[1000000000000000000000000000000,318440577741,453852925211,1000000000000000000000000000000]⟩ +def cgr184 : Row := ⟨184,6,7,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,318440577741,453852925211,772293502952,907705850422],[1000000000000000000000000000000,318440577741,453852925211,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr185 : Row := ⟨185,6,8,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,278635505523],[1000000000000000000000000000000,278635505523]⟩ +def cgr186 : Row := ⟨186,6,8,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,278635505523,414047852993],[1000000000000000000000000000000,278635505523,414047852993]⟩ +def cgr187 : Row := ⟨187,6,8,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,278635505523,414047852993,692683358516],[1000000000000000000000000000000,278635505523,414047852993,1000000000000000000000000000000]⟩ +def cgr188 : Row := ⟨188,6,8,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,278635505523,414047852993,692683358516,828095705986],[1000000000000000000000000000000,278635505523,414047852993,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr189 : Row := ⟨189,6,9,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,247676004910,383088352380],[1000000000000000000000000000000,247676004910,383088352380]⟩ +def cgr190 : Row := ⟨190,6,9,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,247676004910,383088352380,630764357290],[1000000000000000000000000000000,247676004910,383088352380,1000000000000000000000000000000]⟩ +def cgr191 : Row := ⟨191,6,9,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,247676004910,383088352380,630764357290,766176704760],[1000000000000000000000000000000,247676004910,383088352380,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr192 : Row := ⟨192,6,10,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,222908404419],[1000000000000000000000000000000,222908404419]⟩ +def cgr193 : Row := ⟨193,6,10,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,222908404419,358320751889],[1000000000000000000000000000000,222908404419,358320751889]⟩ +def cgr194 : Row := ⟨194,6,10,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,222908404419,358320751889,581229156308],[1000000000000000000000000000000,222908404419,358320751889,1000000000000000000000000000000]⟩ +def cgr195 : Row := ⟨195,6,10,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,222908404419,358320751889,581229156308,716641503778],[1000000000000000000000000000000,222908404419,358320751889,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr196 : Row := ⟨196,6,11,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,202644004017],[1000000000000000000000000000000,202644004017]⟩ +def cgr197 : Row := ⟨197,6,11,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,202644004017,338056351487],[1000000000000000000000000000000,202644004017,338056351487]⟩ +def cgr198 : Row := ⟨198,6,11,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,202644004017,338056351487,540700355504],[1000000000000000000000000000000,202644004017,338056351487,1000000000000000000000000000000]⟩ +def cgr199 : Row := ⟨199,6,11,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,202644004017,338056351487,540700355504,676112702974],[1000000000000000000000000000000,202644004017,338056351487,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr200 : Row := ⟨200,6,12,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,185757003682],[1000000000000000000000000000000,185757003682]⟩ +def cgr201 : Row := ⟨201,6,12,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,185757003682,321169351152],[1000000000000000000000000000000,185757003682,321169351152]⟩ +def cgr202 : Row := ⟨202,6,12,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,185757003682,321169351152,506926354834],[1000000000000000000000000000000,185757003682,321169351152,1000000000000000000000000000000]⟩ +def cgr203 : Row := ⟨203,6,12,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,185757003682,321169351152,506926354834,642338702304],[1000000000000000000000000000000,185757003682,321169351152,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgr204 : Row := ⟨204,6,13,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,171468003399],[1000000000000000000000000000000,171468003399]⟩ +def cgr205 : Row := ⟨205,6,13,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,171468003399,306880350869],[1000000000000000000000000000000,171468003399,306880350869]⟩ +def cgr206 : Row := ⟨206,6,13,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,171468003399,306880350869,478348354268],[1000000000000000000000000000000,171468003399,306880350869,1000000000000000000000000000000]⟩ +def cgr207 : Row := ⟨207,6,14,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,159220288870],[1000000000000000000000000000000,159220288870]⟩ +def cgr208 : Row := ⟨208,6,14,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,159220288870,294632636340],[1000000000000000000000000000000,159220288870,294632636340]⟩ +def cgr209 : Row := ⟨209,6,14,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,159220288870,294632636340,453852925210],[1000000000000000000000000000000,159220288870,294632636340,1000000000000000000000000000000]⟩ +def cgr210 : Row := ⟨210,6,15,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,148605602946],[1000000000000000000000000000000,148605602946]⟩ +def cgr211 : Row := ⟨211,6,15,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,148605602946,284017950416],[1000000000000000000000000000000,148605602946,284017950416]⟩ +def cgr212 : Row := ⟨212,6,15,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,148605602946,284017950416,432623553362],[1000000000000000000000000000000,148605602946,284017950416,1000000000000000000000000000000]⟩ +def cgr213 : Row := ⟨213,6,16,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,139317752761],[1000000000000000000000000000000,139317752761]⟩ +def cgr214 : Row := ⟨214,6,16,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,139317752761,274730100231],[1000000000000000000000000000000,139317752761,274730100231]⟩ +def cgr215 : Row := ⟨215,6,17,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,131122590834],[1000000000000000000000000000000,131122590834]⟩ +def cgr216 : Row := ⟨216,6,18,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,123838002455],[1000000000000000000000000000000,123838002455]⟩ +def cgr217 : Row := ⟨217,6,19,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,117320212852],[1000000000000000000000000000000,117320212852]⟩ +def cgr218 : Row := ⟨218,6,20,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,111454202209],[1000000000000000000000000000000,111454202209]⟩ +def cgr219 : Row := ⟨219,7,18,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,90274898313,180549796626],[1000000000000000000000000000000,90274898313,1000000000000000000000000000000]⟩ +def cgr220 : Row := ⟨220,7,20,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,81247408482],[1000000000000000000000000000000,81247408482]⟩ +def cgr221 : Row := ⟨221,7,20,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,81247408482,162494816964],[1000000000000000000000000000000,81247408482,1000000000000000000000000000000]⟩ +def cgr222 : Row := ⟨222,7,22,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,73861280438],[1000000000000000000000000000000,73861280438]⟩ +def cgr223 : Row := ⟨223,7,22,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,73861280438,147722560876],[1000000000000000000000000000000,73861280438,1000000000000000000000000000000]⟩ +def cgr224 : Row := ⟨224,7,24,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,67706173735],[1000000000000000000000000000000,67706173735]⟩ +def cgr225 : Row := ⟨225,7,24,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,67706173735,135412347470],[1000000000000000000000000000000,67706173735,1000000000000000000000000000000]⟩ +def cgr226 : Row := ⟨226,7,26,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,62498006524],[1000000000000000000000000000000,62498006524]⟩ +def cgr227 : Row := ⟨227,7,28,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,58033863201],[1000000000000000000000000000000,58033863201]⟩ +def cgr228 : Row := ⟨228,7,30,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,54164938988],[1000000000000000000000000000000,54164938988]⟩ +def cgr229 : Row := ⟨229,8,48,1,0,[0,0],[1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def cgR : List Row := [cgr0, cgr1, cgr2, cgr3, cgr4, cgr5, cgr6, cgr7, cgr8, cgr9, cgr10, cgr11, cgr12, cgr13, cgr14, cgr15, cgr16, cgr17, cgr18, cgr19, cgr20, cgr21, cgr22, cgr23, cgr24, cgr25, cgr26, cgr27, cgr28, cgr29, cgr30, cgr31, cgr32, cgr33, cgr34, cgr35, cgr36, cgr37, cgr38, cgr39, cgr40, cgr41, cgr42, cgr43, cgr44, cgr45, cgr46, cgr47, cgr48, cgr49, cgr50, cgr51, cgr52, cgr53, cgr54, cgr55, cgr56, cgr57, cgr58, cgr59, cgr60, cgr61, cgr62, cgr63, cgr64, cgr65, cgr66, cgr67, cgr68, cgr69, cgr70, cgr71, cgr72, cgr73, cgr74, cgr75, cgr76, cgr77, cgr78, cgr79, cgr80, cgr81, cgr82, cgr83, cgr84, cgr85, cgr86, cgr87, cgr88, cgr89, cgr90, cgr91, cgr92, cgr93, cgr94, cgr95, cgr96, cgr97, cgr98, cgr99, cgr100, cgr101, cgr102, cgr103, cgr104, cgr105, cgr106, cgr107, cgr108, cgr109, cgr110, cgr111, cgr112, cgr113, cgr114, cgr115, cgr116, cgr117, cgr118, cgr119, cgr120, cgr121, cgr122, cgr123, cgr124, cgr125, cgr126, cgr127, cgr128, cgr129, cgr130, cgr131, cgr132, cgr133, cgr134, cgr135, cgr136, cgr137, cgr138, cgr139, cgr140, cgr141, cgr142, cgr143, cgr144, cgr145, cgr146, cgr147, cgr148, cgr149, cgr150, cgr151, cgr152, cgr153, cgr154, cgr155, cgr156, cgr157, cgr158, cgr159, cgr160, cgr161, cgr162, cgr163, cgr164, cgr165, cgr166, cgr167, cgr168, cgr169, cgr170, cgr171, cgr172, cgr173, cgr174, cgr175, cgr176, cgr177, cgr178, cgr179, cgr180, cgr181, cgr182, cgr183, cgr184, cgr185, cgr186, cgr187, cgr188, cgr189, cgr190, cgr191, cgr192, cgr193, cgr194, cgr195, cgr196, cgr197, cgr198, cgr199, cgr200, cgr201, cgr202, cgr203, cgr204, cgr205, cgr206, cgr207, cgr208, cgr209, cgr210, cgr211, cgr212, cgr213, cgr214, cgr215, cgr216, cgr217, cgr218, cgr219, cgr220, cgr221, cgr222, cgr223, cgr224, cgr225, cgr226, cgr227, cgr228, cgr229] +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP0.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP0.lean new file mode 100644 index 0000000000..f8b92a1d5a --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP0.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc0 : Row.check cgW cgR cgr0 = true := by decide +kernel +theorem cgc1 : Row.check cgW cgR cgr1 = true := by decide +kernel +theorem cgc2 : Row.check cgW cgR cgr2 = true := by decide +kernel +theorem cgc3 : Row.check cgW cgR cgr3 = true := by decide +kernel +theorem cgc4 : Row.check cgW cgR cgr4 = true := by decide +kernel +theorem cgc5 : Row.check cgW cgR cgr5 = true := by decide +kernel +theorem cgc6 : Row.check cgW cgR cgr6 = true := by decide +kernel +theorem cgc7 : Row.check cgW cgR cgr7 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP1.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP1.lean new file mode 100644 index 0000000000..63aa3204df --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP1.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc8 : Row.check cgW cgR cgr8 = true := by decide +kernel +theorem cgc9 : Row.check cgW cgR cgr9 = true := by decide +kernel +theorem cgc10 : Row.check cgW cgR cgr10 = true := by decide +kernel +theorem cgc11 : Row.check cgW cgR cgr11 = true := by decide +kernel +theorem cgc12 : Row.check cgW cgR cgr12 = true := by decide +kernel +theorem cgc13 : Row.check cgW cgR cgr13 = true := by decide +kernel +theorem cgc14 : Row.check cgW cgR cgr14 = true := by decide +kernel +theorem cgc15 : Row.check cgW cgR cgr15 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP10.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP10.lean new file mode 100644 index 0000000000..984933cae2 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP10.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc80 : Row.check cgW cgR cgr80 = true := by decide +kernel +theorem cgc81 : Row.check cgW cgR cgr81 = true := by decide +kernel +theorem cgc82 : Row.check cgW cgR cgr82 = true := by decide +kernel +theorem cgc83 : Row.check cgW cgR cgr83 = true := by decide +kernel +theorem cgc84 : Row.check cgW cgR cgr84 = true := by decide +kernel +theorem cgc85 : Row.check cgW cgR cgr85 = true := by decide +kernel +theorem cgc86 : Row.check cgW cgR cgr86 = true := by decide +kernel +theorem cgc87 : Row.check cgW cgR cgr87 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP11.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP11.lean new file mode 100644 index 0000000000..464b96d4fc --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP11.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc88 : Row.check cgW cgR cgr88 = true := by decide +kernel +theorem cgc89 : Row.check cgW cgR cgr89 = true := by decide +kernel +theorem cgc90 : Row.check cgW cgR cgr90 = true := by decide +kernel +theorem cgc91 : Row.check cgW cgR cgr91 = true := by decide +kernel +theorem cgc92 : Row.check cgW cgR cgr92 = true := by decide +kernel +theorem cgc93 : Row.check cgW cgR cgr93 = true := by decide +kernel +theorem cgc94 : Row.check cgW cgR cgr94 = true := by decide +kernel +theorem cgc95 : Row.check cgW cgR cgr95 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP12.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP12.lean new file mode 100644 index 0000000000..d9833396f7 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP12.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc96 : Row.check cgW cgR cgr96 = true := by decide +kernel +theorem cgc97 : Row.check cgW cgR cgr97 = true := by decide +kernel +theorem cgc98 : Row.check cgW cgR cgr98 = true := by decide +kernel +theorem cgc99 : Row.check cgW cgR cgr99 = true := by decide +kernel +theorem cgc100 : Row.check cgW cgR cgr100 = true := by decide +kernel +theorem cgc101 : Row.check cgW cgR cgr101 = true := by decide +kernel +theorem cgc102 : Row.check cgW cgR cgr102 = true := by decide +kernel +theorem cgc103 : Row.check cgW cgR cgr103 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP13.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP13.lean new file mode 100644 index 0000000000..0908fd6e69 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP13.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc104 : Row.check cgW cgR cgr104 = true := by decide +kernel +theorem cgc105 : Row.check cgW cgR cgr105 = true := by decide +kernel +theorem cgc106 : Row.check cgW cgR cgr106 = true := by decide +kernel +theorem cgc107 : Row.check cgW cgR cgr107 = true := by decide +kernel +theorem cgc108 : Row.check cgW cgR cgr108 = true := by decide +kernel +theorem cgc109 : Row.check cgW cgR cgr109 = true := by decide +kernel +theorem cgc110 : Row.check cgW cgR cgr110 = true := by decide +kernel +theorem cgc111 : Row.check cgW cgR cgr111 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP14.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP14.lean new file mode 100644 index 0000000000..80ff302703 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP14.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc112 : Row.check cgW cgR cgr112 = true := by decide +kernel +theorem cgc113 : Row.check cgW cgR cgr113 = true := by decide +kernel +theorem cgc114 : Row.check cgW cgR cgr114 = true := by decide +kernel +theorem cgc115 : Row.check cgW cgR cgr115 = true := by decide +kernel +theorem cgc116 : Row.check cgW cgR cgr116 = true := by decide +kernel +theorem cgc117 : Row.check cgW cgR cgr117 = true := by decide +kernel +theorem cgc118 : Row.check cgW cgR cgr118 = true := by decide +kernel +theorem cgc119 : Row.check cgW cgR cgr119 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP15.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP15.lean new file mode 100644 index 0000000000..9695b52325 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP15.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc120 : Row.check cgW cgR cgr120 = true := by decide +kernel +theorem cgc121 : Row.check cgW cgR cgr121 = true := by decide +kernel +theorem cgc122 : Row.check cgW cgR cgr122 = true := by decide +kernel +theorem cgc123 : Row.check cgW cgR cgr123 = true := by decide +kernel +theorem cgc124 : Row.check cgW cgR cgr124 = true := by decide +kernel +theorem cgc125 : Row.check cgW cgR cgr125 = true := by decide +kernel +theorem cgc126 : Row.check cgW cgR cgr126 = true := by decide +kernel +theorem cgc127 : Row.check cgW cgR cgr127 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP16.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP16.lean new file mode 100644 index 0000000000..6fd39486c6 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP16.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc128 : Row.check cgW cgR cgr128 = true := by decide +kernel +theorem cgc129 : Row.check cgW cgR cgr129 = true := by decide +kernel +theorem cgc130 : Row.check cgW cgR cgr130 = true := by decide +kernel +theorem cgc131 : Row.check cgW cgR cgr131 = true := by decide +kernel +theorem cgc132 : Row.check cgW cgR cgr132 = true := by decide +kernel +theorem cgc133 : Row.check cgW cgR cgr133 = true := by decide +kernel +theorem cgc134 : Row.check cgW cgR cgr134 = true := by decide +kernel +theorem cgc135 : Row.check cgW cgR cgr135 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP17.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP17.lean new file mode 100644 index 0000000000..b25f31559a --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP17.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc136 : Row.check cgW cgR cgr136 = true := by decide +kernel +theorem cgc137 : Row.check cgW cgR cgr137 = true := by decide +kernel +theorem cgc138 : Row.check cgW cgR cgr138 = true := by decide +kernel +theorem cgc139 : Row.check cgW cgR cgr139 = true := by decide +kernel +theorem cgc140 : Row.check cgW cgR cgr140 = true := by decide +kernel +theorem cgc141 : Row.check cgW cgR cgr141 = true := by decide +kernel +theorem cgc142 : Row.check cgW cgR cgr142 = true := by decide +kernel +theorem cgc143 : Row.check cgW cgR cgr143 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP18.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP18.lean new file mode 100644 index 0000000000..427896b3c7 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP18.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc144 : Row.check cgW cgR cgr144 = true := by decide +kernel +theorem cgc145 : Row.check cgW cgR cgr145 = true := by decide +kernel +theorem cgc146 : Row.check cgW cgR cgr146 = true := by decide +kernel +theorem cgc147 : Row.check cgW cgR cgr147 = true := by decide +kernel +theorem cgc148 : Row.check cgW cgR cgr148 = true := by decide +kernel +theorem cgc149 : Row.check cgW cgR cgr149 = true := by decide +kernel +theorem cgc150 : Row.check cgW cgR cgr150 = true := by decide +kernel +theorem cgc151 : Row.check cgW cgR cgr151 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP19.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP19.lean new file mode 100644 index 0000000000..0ded7bef6d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP19.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc152 : Row.check cgW cgR cgr152 = true := by decide +kernel +theorem cgc153 : Row.check cgW cgR cgr153 = true := by decide +kernel +theorem cgc154 : Row.check cgW cgR cgr154 = true := by decide +kernel +theorem cgc155 : Row.check cgW cgR cgr155 = true := by decide +kernel +theorem cgc156 : Row.check cgW cgR cgr156 = true := by decide +kernel +theorem cgc157 : Row.check cgW cgR cgr157 = true := by decide +kernel +theorem cgc158 : Row.check cgW cgR cgr158 = true := by decide +kernel +theorem cgc159 : Row.check cgW cgR cgr159 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP2.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP2.lean new file mode 100644 index 0000000000..8daaffeb6d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP2.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc16 : Row.check cgW cgR cgr16 = true := by decide +kernel +theorem cgc17 : Row.check cgW cgR cgr17 = true := by decide +kernel +theorem cgc18 : Row.check cgW cgR cgr18 = true := by decide +kernel +theorem cgc19 : Row.check cgW cgR cgr19 = true := by decide +kernel +theorem cgc20 : Row.check cgW cgR cgr20 = true := by decide +kernel +theorem cgc21 : Row.check cgW cgR cgr21 = true := by decide +kernel +theorem cgc22 : Row.check cgW cgR cgr22 = true := by decide +kernel +theorem cgc23 : Row.check cgW cgR cgr23 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP20.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP20.lean new file mode 100644 index 0000000000..f142d20df9 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP20.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc160 : Row.check cgW cgR cgr160 = true := by decide +kernel +theorem cgc161 : Row.check cgW cgR cgr161 = true := by decide +kernel +theorem cgc162 : Row.check cgW cgR cgr162 = true := by decide +kernel +theorem cgc163 : Row.check cgW cgR cgr163 = true := by decide +kernel +theorem cgc164 : Row.check cgW cgR cgr164 = true := by decide +kernel +theorem cgc165 : Row.check cgW cgR cgr165 = true := by decide +kernel +theorem cgc166 : Row.check cgW cgR cgr166 = true := by decide +kernel +theorem cgc167 : Row.check cgW cgR cgr167 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP21.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP21.lean new file mode 100644 index 0000000000..a7ccf3a575 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP21.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc168 : Row.check cgW cgR cgr168 = true := by decide +kernel +theorem cgc169 : Row.check cgW cgR cgr169 = true := by decide +kernel +theorem cgc170 : Row.check cgW cgR cgr170 = true := by decide +kernel +theorem cgc171 : Row.check cgW cgR cgr171 = true := by decide +kernel +theorem cgc172 : Row.check cgW cgR cgr172 = true := by decide +kernel +theorem cgc173 : Row.check cgW cgR cgr173 = true := by decide +kernel +theorem cgc174 : Row.check cgW cgR cgr174 = true := by decide +kernel +theorem cgc175 : Row.check cgW cgR cgr175 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP22.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP22.lean new file mode 100644 index 0000000000..b8715a7ad7 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP22.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc176 : Row.check cgW cgR cgr176 = true := by decide +kernel +theorem cgc177 : Row.check cgW cgR cgr177 = true := by decide +kernel +theorem cgc178 : Row.check cgW cgR cgr178 = true := by decide +kernel +theorem cgc179 : Row.check cgW cgR cgr179 = true := by decide +kernel +theorem cgc180 : Row.check cgW cgR cgr180 = true := by decide +kernel +theorem cgc181 : Row.check cgW cgR cgr181 = true := by decide +kernel +theorem cgc182 : Row.check cgW cgR cgr182 = true := by decide +kernel +theorem cgc183 : Row.check cgW cgR cgr183 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP23.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP23.lean new file mode 100644 index 0000000000..fdfb08ce41 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP23.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc184 : Row.check cgW cgR cgr184 = true := by decide +kernel +theorem cgc185 : Row.check cgW cgR cgr185 = true := by decide +kernel +theorem cgc186 : Row.check cgW cgR cgr186 = true := by decide +kernel +theorem cgc187 : Row.check cgW cgR cgr187 = true := by decide +kernel +theorem cgc188 : Row.check cgW cgR cgr188 = true := by decide +kernel +theorem cgc189 : Row.check cgW cgR cgr189 = true := by decide +kernel +theorem cgc190 : Row.check cgW cgR cgr190 = true := by decide +kernel +theorem cgc191 : Row.check cgW cgR cgr191 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP24.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP24.lean new file mode 100644 index 0000000000..1f77aacde1 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP24.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc192 : Row.check cgW cgR cgr192 = true := by decide +kernel +theorem cgc193 : Row.check cgW cgR cgr193 = true := by decide +kernel +theorem cgc194 : Row.check cgW cgR cgr194 = true := by decide +kernel +theorem cgc195 : Row.check cgW cgR cgr195 = true := by decide +kernel +theorem cgc196 : Row.check cgW cgR cgr196 = true := by decide +kernel +theorem cgc197 : Row.check cgW cgR cgr197 = true := by decide +kernel +theorem cgc198 : Row.check cgW cgR cgr198 = true := by decide +kernel +theorem cgc199 : Row.check cgW cgR cgr199 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP25.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP25.lean new file mode 100644 index 0000000000..d68a2928b2 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP25.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc200 : Row.check cgW cgR cgr200 = true := by decide +kernel +theorem cgc201 : Row.check cgW cgR cgr201 = true := by decide +kernel +theorem cgc202 : Row.check cgW cgR cgr202 = true := by decide +kernel +theorem cgc203 : Row.check cgW cgR cgr203 = true := by decide +kernel +theorem cgc204 : Row.check cgW cgR cgr204 = true := by decide +kernel +theorem cgc205 : Row.check cgW cgR cgr205 = true := by decide +kernel +theorem cgc206 : Row.check cgW cgR cgr206 = true := by decide +kernel +theorem cgc207 : Row.check cgW cgR cgr207 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP26.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP26.lean new file mode 100644 index 0000000000..58f1700334 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP26.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc208 : Row.check cgW cgR cgr208 = true := by decide +kernel +theorem cgc209 : Row.check cgW cgR cgr209 = true := by decide +kernel +theorem cgc210 : Row.check cgW cgR cgr210 = true := by decide +kernel +theorem cgc211 : Row.check cgW cgR cgr211 = true := by decide +kernel +theorem cgc212 : Row.check cgW cgR cgr212 = true := by decide +kernel +theorem cgc213 : Row.check cgW cgR cgr213 = true := by decide +kernel +theorem cgc214 : Row.check cgW cgR cgr214 = true := by decide +kernel +theorem cgc215 : Row.check cgW cgR cgr215 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP27.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP27.lean new file mode 100644 index 0000000000..2891113fd1 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP27.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc216 : Row.check cgW cgR cgr216 = true := by decide +kernel +theorem cgc217 : Row.check cgW cgR cgr217 = true := by decide +kernel +theorem cgc218 : Row.check cgW cgR cgr218 = true := by decide +kernel +theorem cgc219 : Row.check cgW cgR cgr219 = true := by decide +kernel +theorem cgc220 : Row.check cgW cgR cgr220 = true := by decide +kernel +theorem cgc221 : Row.check cgW cgR cgr221 = true := by decide +kernel +theorem cgc222 : Row.check cgW cgR cgr222 = true := by decide +kernel +theorem cgc223 : Row.check cgW cgR cgr223 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP28.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP28.lean new file mode 100644 index 0000000000..e3b908fcdb --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP28.lean @@ -0,0 +1,9 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc224 : Row.check cgW cgR cgr224 = true := by decide +kernel +theorem cgc225 : Row.check cgW cgR cgr225 = true := by decide +kernel +theorem cgc226 : Row.check cgW cgR cgr226 = true := by decide +kernel +theorem cgc227 : Row.check cgW cgR cgr227 = true := by decide +kernel +theorem cgc228 : Row.check cgW cgR cgr228 = true := by decide +kernel +theorem cgc229 : Row.check cgW cgR cgr229 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP3.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP3.lean new file mode 100644 index 0000000000..ef83f1523c --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP3.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc24 : Row.check cgW cgR cgr24 = true := by decide +kernel +theorem cgc25 : Row.check cgW cgR cgr25 = true := by decide +kernel +theorem cgc26 : Row.check cgW cgR cgr26 = true := by decide +kernel +theorem cgc27 : Row.check cgW cgR cgr27 = true := by decide +kernel +theorem cgc28 : Row.check cgW cgR cgr28 = true := by decide +kernel +theorem cgc29 : Row.check cgW cgR cgr29 = true := by decide +kernel +theorem cgc30 : Row.check cgW cgR cgr30 = true := by decide +kernel +theorem cgc31 : Row.check cgW cgR cgr31 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP4.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP4.lean new file mode 100644 index 0000000000..6076242bd9 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP4.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc32 : Row.check cgW cgR cgr32 = true := by decide +kernel +theorem cgc33 : Row.check cgW cgR cgr33 = true := by decide +kernel +theorem cgc34 : Row.check cgW cgR cgr34 = true := by decide +kernel +theorem cgc35 : Row.check cgW cgR cgr35 = true := by decide +kernel +theorem cgc36 : Row.check cgW cgR cgr36 = true := by decide +kernel +theorem cgc37 : Row.check cgW cgR cgr37 = true := by decide +kernel +theorem cgc38 : Row.check cgW cgR cgr38 = true := by decide +kernel +theorem cgc39 : Row.check cgW cgR cgr39 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP5.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP5.lean new file mode 100644 index 0000000000..1bc0dadca2 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP5.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc40 : Row.check cgW cgR cgr40 = true := by decide +kernel +theorem cgc41 : Row.check cgW cgR cgr41 = true := by decide +kernel +theorem cgc42 : Row.check cgW cgR cgr42 = true := by decide +kernel +theorem cgc43 : Row.check cgW cgR cgr43 = true := by decide +kernel +theorem cgc44 : Row.check cgW cgR cgr44 = true := by decide +kernel +theorem cgc45 : Row.check cgW cgR cgr45 = true := by decide +kernel +theorem cgc46 : Row.check cgW cgR cgr46 = true := by decide +kernel +theorem cgc47 : Row.check cgW cgR cgr47 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP6.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP6.lean new file mode 100644 index 0000000000..e12da5a58b --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP6.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc48 : Row.check cgW cgR cgr48 = true := by decide +kernel +theorem cgc49 : Row.check cgW cgR cgr49 = true := by decide +kernel +theorem cgc50 : Row.check cgW cgR cgr50 = true := by decide +kernel +theorem cgc51 : Row.check cgW cgR cgr51 = true := by decide +kernel +theorem cgc52 : Row.check cgW cgR cgr52 = true := by decide +kernel +theorem cgc53 : Row.check cgW cgR cgr53 = true := by decide +kernel +theorem cgc54 : Row.check cgW cgR cgr54 = true := by decide +kernel +theorem cgc55 : Row.check cgW cgR cgr55 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP7.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP7.lean new file mode 100644 index 0000000000..241620f19d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP7.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc56 : Row.check cgW cgR cgr56 = true := by decide +kernel +theorem cgc57 : Row.check cgW cgR cgr57 = true := by decide +kernel +theorem cgc58 : Row.check cgW cgR cgr58 = true := by decide +kernel +theorem cgc59 : Row.check cgW cgR cgr59 = true := by decide +kernel +theorem cgc60 : Row.check cgW cgR cgr60 = true := by decide +kernel +theorem cgc61 : Row.check cgW cgR cgr61 = true := by decide +kernel +theorem cgc62 : Row.check cgW cgR cgr62 = true := by decide +kernel +theorem cgc63 : Row.check cgW cgR cgr63 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP8.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP8.lean new file mode 100644 index 0000000000..288763c7f5 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP8.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc64 : Row.check cgW cgR cgr64 = true := by decide +kernel +theorem cgc65 : Row.check cgW cgR cgr65 = true := by decide +kernel +theorem cgc66 : Row.check cgW cgR cgr66 = true := by decide +kernel +theorem cgc67 : Row.check cgW cgR cgr67 = true := by decide +kernel +theorem cgc68 : Row.check cgW cgR cgr68 = true := by decide +kernel +theorem cgc69 : Row.check cgW cgR cgr69 = true := by decide +kernel +theorem cgc70 : Row.check cgW cgR cgr70 = true := by decide +kernel +theorem cgc71 : Row.check cgW cgR cgr71 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreecgP9.lean b/research/p104-tree-ceiling/lean/Nov15/CTreecgP9.lean new file mode 100644 index 0000000000..c1c6ab0f78 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreecgP9.lean @@ -0,0 +1,11 @@ +import Nov15.CTreecgDefs +namespace CTree +theorem cgc72 : Row.check cgW cgR cgr72 = true := by decide +kernel +theorem cgc73 : Row.check cgW cgR cgr73 = true := by decide +kernel +theorem cgc74 : Row.check cgW cgR cgr74 = true := by decide +kernel +theorem cgc75 : Row.check cgW cgR cgr75 = true := by decide +kernel +theorem cgc76 : Row.check cgW cgR cgr76 = true := by decide +kernel +theorem cgc77 : Row.check cgW cgR cgr77 = true := by decide +kernel +theorem cgc78 : Row.check cgW cgR cgr78 = true := by decide +kernel +theorem cgc79 : Row.check cgW cgR cgr79 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaDefs.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaDefs.lean new file mode 100644 index 0000000000..94e0a8c8ab --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaDefs.lean @@ -0,0 +1,235 @@ +import Nov15.CTreeCore +namespace CTree +def gaW : List (List Nat) := [[0,0,0,0,0,0,0,0,0],[0,0,1611967451585,2211350167403,2598567796704,2885490879130,3113530662322,3302758400007,3464456577896],[0,0,0,2211350167403,3197950512521,3872091224248,4387054089866,4804321610743,3302758400007],[0,0,0,0,2598567796704,3872091224248,4774271719168,4387054089866,3113530662322],[0,0,0,0,0,2885490879130,3872091224248,3872091224248,2885490879130],[0,0,0,0,0,0,2598567796704,3197950512521,2598567796704],[0,0,0,0,0,0,0,2211350167403,2211350167403],[0,0,0,0,0,0,0,0,1611967451585],[0,0,0,0,0,0,0,0,0]] +def gar0 : Row := ⟨0,1,1,48,1725436586697640946858688965569256363112777243042596638790631055949822,[0,2959254156595,3216909820699,3511756509685,3719798802895,4172352431466,4381605891907,4955661784562,5163704077772,6204511063227,6421297938485,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526241,10868825337424,11078078797865,11600776249851,11810029710292,12744754152489,12986604030871,13470615433902,13679868894343,15287256905950,15569113606646,16005584772546,16858975603130,17295446769030,17731917934930,18634319511674,18843572972115,19884379957570,20101166832828,20610241238983,20819494699424,21852562998336,22109356695908,22545827861808,23620059420584,24435072574111,24757947692208,25280645144194,25489898604635,26424623046832,26666472925214,27150484328245,27359737788686],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4172352431466,4381605891907,4955661784562,5163704077772,6204511063227,6421297938485,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526241,10868825337424,11078078797865,11600776249851,11810029710292,12744754152489,12986604030871,13470615433902,13679868894343,16924287360659,17181081058231,17617552224131,18470943054715,18907414220615,19343885386515,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar1 : Row := ⟨1,2,1,20,1725436586697640946858688965569256363112777243042596638790631055947776,[0,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,11605860330882,11815113791323,12356500742287,12565754202728],[1000000000000000000000000000000,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,13587098723219,13796352183660,14844692583932,15053946044373]⟩ +def gar2 : Row := ⟨2,2,1,22,1725436586697640946858688965569256363112777243042596638790631055947776,[0,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,11605860330882,11815113791323,12356500742287,12565754202728,13344136868308,13585986746690],[1000000000000000000000000000000,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,13587098723219,13796352183660,14844692583932,15053946044373,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar3 : Row := ⟨3,2,1,24,1725436586697640946858688965569256363112777243042596638790631055947776,[0,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,11605860330882,11815113791323,12356500742287,12565754202728,13344136868308,13585986746690,14069998149721,14279251610162],[1000000000000000000000000000000,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,13587098723219,13796352183660,14844692583932,15053946044373,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar4 : Row := ⟨4,2,1,26,1725436586697640946858688965569256363112777243042596638790631055947776,[0,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,11605860330882,11815113791323,12356500742287,12565754202728,13344136868308,13585986746690,14069998149721,14279251610162,15312319909074,15569113606646],[1000000000000000000000000000000,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,13587098723219,13796352183660,14844692583932,15053946044373,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar5 : Row := ⟨5,2,1,28,1725436586697640946858688965569256363112777243042596638790631055947776,[0,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,11605860330882,11815113791323,12356500742287,12565754202728,13344136868308,13585986746690,14069998149721,14279251610162,15312319909074,15569113606646,16005584772546,16858975603130],[1000000000000000000000000000000,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,13587098723219,13796352183660,14844692583932,15053946044373,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar6 : Row := ⟨6,2,1,30,1725436586697640946858688965569256363112777243042596638790631055947776,[0,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,11605860330882,11815113791323,12356500742287,12565754202728,13344136868308,13585986746690,14069998149721,14279251610162,15312319909074,15569113606646,16005584772546,16858975603130,17295446769030,17731917934930],[1000000000000000000000000000000,2989732832983,3442444310833,3774180829560,3982223122770,4466234525801,4675487986242,5218086104437,5426128397647,6204511063227,6446360941609,6930372344640,7139625805081,8220234341124,8429487801565,8865958967465,9940190526243,13587098723219,13796352183660,14844692583932,15053946044373,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar7 : Row := ⟨7,2,2,18,1725436586697640946858688965569256072344153165092240253739596775424000,[0,1651379200003,2217317280255,2512163969241,2720206262451,3222907164460,3432160624901,3956069244118,4164111537328,5098835979525,5340685857907,5824697260938,6033950721379,7114559257422,7323812717863,7760283883763,8328223074656,9256857885839,9466111346280],[1000000000000000000000000000000,1651379200003,2217317280255,2512163969241,2720206262451,3222907164460,3432160624901,3956069244118,4164111537328,5098835979525,5340685857907,5824697260938,6033950721379,7114559257422,7323812717863,7760283883763,8834515442541,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar8 : Row := ⟨8,2,2,20,1725436586697640946858688965569256072344153165092240253739596775424000,[0,1651379200003,2217317280255,2512163969241,2720206262451,3222907164460,3432160624901,3956069244118,4164111537328,5098835979525,5340685857907,5824697260938,6033950721379,7114559257422,7323812717863,7760283883763,8328223074656,9256857885839,9466111346280,9988808798266,10198062258707],[1000000000000000000000000000000,1651379200003,2217317280255,2512163969241,2720206262451,3222907164460,3432160624901,3956069244118,4164111537328,5098835979525,5340685857907,5824697260938,6033950721379,7114559257422,7323812717863,7760283883763,8834515442541,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar9 : Row := ⟨9,2,2,22,1725436586697640946858688965569256072344153165092240253739596775424000,[0,1651379200003,2217317280255,2512163969241,2720206262451,3222907164460,3432160624901,3956069244118,4164111537328,5098835979525,5340685857907,5824697260938,6033950721379,7114559257422,7323812717863,7760283883763,8328223074656,9256857885839,9466111346280,9988808798266,10198062258707,11132786700904,11374636579286],[1000000000000000000000000000000,1651379200003,2217317280255,2512163969241,2720206262451,3222907164460,3432160624901,3956069244118,4164111537328,5098835979525,5340685857907,5824697260938,6033950721379,7114559257422,7323812717863,7760283883763,8834515442541,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar10 : Row := ⟨10,2,2,24,1725436586697640946858688965569256072344153165092240253739596775424000,[0,1651379200003,2217317280255,2512163969241,2720206262451,3222907164460,3432160624901,3956069244118,4164111537328,5098835979525,5340685857907,5824697260938,6033950721379,7114559257422,7323812717863,7760283883763,8328223074656,9256857885839,9466111346280,9988808798266,10198062258707,11132786700904,11374636579286,11858647982317,12067901442758],[1000000000000000000000000000000,1651379200003,2217317280255,2512163969241,2720206262451,3222907164460,3432160624901,3956069244118,4164111537328,5098835979525,5340685857907,5824697260938,6033950721379,7114559257422,7323812717863,7760283883763,8834515442541,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar11 : Row := ⟨11,3,1,8,1725436586697640946858688965569256363112769808131088451570363873099776,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772]⟩ +def gar12 : Row := ⟨12,3,1,10,1725436586697640946858688965569256363112777243028422585784197460262912,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485]⟩ +def gar13 : Row := ⟨13,3,1,11,1725436586697640946858688965569256363112777243033147258110076319170560,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947]⟩ +def gar14 : Row := ⟨14,3,1,12,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388]⟩ +def gar15 : Row := ⟨15,3,1,13,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,9525755161531],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,1000000000000000000000000000000]⟩ +def gar16 : Row := ⟨16,3,1,14,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,9525755161531,9739302033774],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar17 : Row := ⟨17,3,1,15,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,9525755161531,9739302033774,10119365862334],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar18 : Row := ⟨18,3,1,16,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,9525755161531,9739302033774,10119365862334,10327408155544],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar19 : Row := ⟨19,3,1,17,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,9525755161531,9739302033774,10119365862334,10327408155544,11375748555816],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar20 : Row := ⟨20,3,1,18,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,9525755161531,9739302033774,10119365862334,10327408155544,11375748555816,11585002016257],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar21 : Row := ⟨21,3,1,19,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,9525755161531,9739302033774,10119365862334,10327408155544,11375748555816,11585002016257,12633342416529],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar22 : Row := ⟨22,3,1,20,1725436586697640946858688965569256363112777243042596602761834036985856,[0,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,9525755161531,9739302033774,10119365862334,10327408155544,11375748555816,11585002016257,12633342416529,12842595876970],[1000000000000000000000000000000,2959254156595,3216909820699,3511756509685,3719798802895,4362051083759,4575597956002,4955661784562,5163704077772,6212044478044,6421297938485,8267035240947,8476288701388,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar23 : Row := ⟨23,3,2,6,1725436586697640946858688964519793351043731158960419414395210547855360,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650]⟩ +def gar24 : Row := ⟨24,3,2,7,1725436586697640946858688964869614258143869349367193180740345082675200,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210]⟩ +def gar25 : Row := ⟨25,3,2,8,1725436586697640946858688965569256072344145730180740713430614152314880,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420]⟩ +def gar26 : Row := ⟨26,3,2,9,1725436586697640946858688965569256072344148208479851515041139711279104,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692]⟩ +def gar27 : Row := ⟨27,3,2,10,1725436586697640946858688965569256072344153165078073118262190829207552,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133]⟩ +def gar28 : Row := ⟨28,3,2,11,1725436586697640946858688965569256072344153165082795484745060474421248,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6076892790753],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6967751342595]⟩ +def gar29 : Row := ⟨29,3,2,12,1725436586697640946858688965569256072344153165092240217710799764848640,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6076892790753,6284935083963],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6967751342595,7177004803036]⟩ +def gar30 : Row := ⟨30,3,2,13,1725436586697640946858688965569256072344153165092240217710799764848640,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6076892790753,6284935083963,6927187364827],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6967751342595,7177004803036,1000000000000000000000000000000]⟩ +def gar31 : Row := ⟨31,3,2,14,1725436586697640946858688965569256072344153165092240217710799764848640,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6076892790753,6284935083963,6927187364827,7140734237070],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6967751342595,7177004803036,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar32 : Row := ⟨32,3,2,15,1725436586697640946858688965569256072344153165092240217710799764848640,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6076892790753,6284935083963,6927187364827,7140734237070,7520798065630],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6967751342595,7177004803036,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar33 : Row := ⟨33,3,2,16,1725436586697640946858688965569256072344153165092240217710799764848640,[0,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6076892790753,6284935083963,6927187364827,7140734237070,7520798065630,7728840358840],[1000000000000000000000000000000,1556765331161,1917625922347,2212472611333,2420514904543,3062767185407,3276314057650,3656377886210,3864420179420,4912760579692,5122014040133,6967751342595,7177004803036,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar34 : Row := ⟨34,3,3,4,1725436586697640946849780764332283298176074888370600511503471000682496,[0,1037843554107,1484531289563,1779377978549,1987420271759],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759]⟩ +def gar35 : Row := ⟨35,3,3,6,1725436586697640946858688964519783049526763825862118485357350877134848,[0,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526]⟩ +def gar36 : Row := ⟨36,3,3,7,1725436586697640946858688964869593322802935736941613873340823816372224,[0,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426]⟩ +def gar37 : Row := ⟨37,3,3,8,1725436586697640946858688965569213869355279559100604649307769694846976,[0,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636]⟩ +def gar38 : Row := ⟨38,3,3,9,1725436586697640946858688965569213869355282037398534859297577842507776,[0,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4469169100743],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4479665946908]⟩ +def gar39 : Row := ⟨39,3,3,10,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4469169100743,4688919407349],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4479665946908,4688919407349]⟩ +def gar40 : Row := ⟨40,3,3,11,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4469169100743,4688919407349,5210703525185],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4479665946908,4688919407349,1000000000000000000000000000000]⟩ +def gar41 : Row := ⟨41,3,3,12,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4469169100743,4688919407349,5210703525185,5418745818395],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4479665946908,4688919407349,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar42 : Row := ⟨42,3,3,13,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4469169100743,4688919407349,5210703525185,5418745818395,6008884173721],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4479665946908,4688919407349,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar43 : Row := ⟨43,3,3,14,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4469169100743,4688919407349,5210703525185,5418745818395,6008884173721,6218137634162],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4479665946908,4688919407349,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar44 : Row := ⟨44,3,3,15,1725436586697640946858688965569213869355286993994395279277194137829376,[0,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4469169100743,4688919407349,5210703525185,5418745818395,6008884173721,6218137634162,6654608800062],[1000000000000000000000000000000,1037843554107,1484531289563,1779377978549,1987420271759,2577558627085,2786812087526,3223283253426,3431325546636,4479665946908,4688919407349,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar45 : Row := ⟨45,3,4,3,1725436572984891677951467423971062446496094382868200824551407605514240,[0,778382665580,1231094143430,1562830662157],[1000000000000000000000000000000,778382665580,1231094143430,1562830662157]⟩ +def gar46 : Row := ⟨46,3,4,4,1725436586697640898959295112272958727406674468635681809116020569276416,[0,778382665580,1231094143430,1562830662157,1770872955367],[1000000000000000000000000000000,778382665580,1231094143430,1562830662157,1770872955367]⟩ +def gar47 : Row := ⟨47,3,4,5,1725436586697640898962264512335118362156649842518275365008053446377472,[0,778382665580,1231094143430,1562830662157,1770872955367,2254884358398],[1000000000000000000000000000000,778382665580,1231094143430,1562830662157,1770872955367,2254884358398]⟩ +def gar48 : Row := ⟨48,3,4,6,1725436586697640898968203312459437631656600590283462476792119200579584,[0,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839],[1000000000000000000000000000000,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839]⟩ +def gar49 : Row := ⟨49,3,4,7,1725436586697640898968203312807886775465088746904641456538550479618048,[0,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034],[1000000000000000000000000000000,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034]⟩ +def gar50 : Row := ⟨50,3,4,8,1725436586697640898968203313504785063082065060146999416031413037694976,[0,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034,3214778230244],[1000000000000000000000000000000,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034,3214778230244]⟩ +def gar51 : Row := ⟨51,3,4,9,1725436586697640898968203313504785063082067536027077986791962835943424,[0,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034,3214778230244,3993160895824],[1000000000000000000000000000000,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034,3214778230244,4263118630516]⟩ +def gar52 : Row := ⟨52,3,4,10,1725436586697640898968203313504785063082072487787235128313062432440320,[0,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034,3214778230244,3993160895824,4235010774206],[1000000000000000000000000000000,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034,3214778230244,4263118630516,4472372090957]⟩ +def gar53 : Row := ⟨53,3,4,11,1725436586697640898968203313504785063082072487787235128313062432440320,[0,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034,3214778230244,3993160895824,4235010774206,4719022177237],[1000000000000000000000000000000,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034,3214778230244,4263118630516,4472372090957,1000000000000000000000000000000]⟩ +def gar54 : Row := ⟨54,3,4,12,1725436586697640898968203313504785063082072487787235128313062432440320,[0,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034,3214778230244,3993160895824,4235010774206,4719022177237,4928275637678],[1000000000000000000000000000000,778382665580,1231094143430,1562830662157,1770872955367,2254884358398,2464137818839,3006735937034,3214778230244,4263118630516,4472372090957,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar55 : Row := ⟨55,4,1,4,1725436586697640946849780764332285624630501836782856782355286582099968,[0,2885490879130,3286317376137,3574524968750,3782567261960],[1000000000000000000000000000000,2885490879130,3286317376137,3574524968750,3782567261960]⟩ +def gar56 : Row := ⟨56,4,1,6,1725436586697640946858688964519793434364829842347494516881757994745856,[0,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907],[1000000000000000000000000000000,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907]⟩ +def gar57 : Row := ⟨57,4,1,7,1725436586697640946858688964869614341383520862114826843778097958879232,[0,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592],[1000000000000000000000000000000,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592]⟩ +def gar58 : Row := ⟨58,4,1,8,1725436586697640946858688965569256321574402374763975610546660422189056,[0,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592,5459213983802],[1000000000000000000000000000000,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592,5459213983802]⟩ +def gar59 : Row := ⟨59,4,1,9,1725436586697640946858688965569256321574402374763975610546660422189056,[0,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592,5459213983802,7954919693426],[1000000000000000000000000000000,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592,5459213983802,1000000000000000000000000000000]⟩ +def gar60 : Row := ⟨60,4,1,10,1725436586697640946858688965569256321574402374763975610546660422189056,[0,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592,5459213983802,7954919693426,8164173153867],[1000000000000000000000000000000,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592,5459213983802,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar61 : Row := ⟨61,4,1,11,1725436586697640946858688965569256321574402374763975610546660422189056,[0,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592,5459213983802,7954919693426,8164173153867,8553958323373],[1000000000000000000000000000000,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592,5459213983802,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar62 : Row := ⟨62,4,1,12,1725436586697640946858688965569256321574402374763975610546660422189056,[0,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592,5459213983802,7954919693426,8164173153867,8553958323373,8763211783814],[1000000000000000000000000000000,2885490879130,3286317376137,3574524968750,3782567261960,4172352431466,4381605891907,5251171690592,5459213983802,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar63 : Row := ⟨63,4,2,2,1725429058513974481006928856009369042408591087781735667604368899702784,[0,1442745439565,1843571936572],[1000000000000000000000000000000,1442745439565,1843571936572]⟩ +def gar64 : Row := ⟨64,4,2,3,1725436572984891677951467423971191030149188575169341034321976229888000,[0,1442745439565,1843571936572,2131779529185],[1000000000000000000000000000000,1442745439565,1843571936572,2131779529185]⟩ +def gar65 : Row := ⟨65,4,2,4,1725436586697640946849780764332285583092126968504235754111315948339200,[0,1442745439565,1843571936572,2131779529185,2339821822395],[1000000000000000000000000000000,1442745439565,1843571936572,2131779529185,2339821822395]⟩ +def gar66 : Row := ⟨66,4,2,5,1725436586697640946852750164394788158644653058173367646790825996713984,[0,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901],[1000000000000000000000000000000,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901]⟩ +def gar67 : Row := ⟨67,4,2,6,1725436586697640946858688964519793309749705237511631432149846093463552,[0,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342],[1000000000000000000000000000000,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342]⟩ +def gar68 : Row := ⟨68,4,2,7,1725436586697640946858688964869614216768396257278963759046186057596928,[0,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027],[1000000000000000000000000000000,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027]⟩ +def gar69 : Row := ⟨69,4,2,8,1725436586697640946858688965569256030805778296813628412838865985863680,[0,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027,4016468544237],[1000000000000000000000000000000,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027,4016468544237]⟩ +def gar70 : Row := ⟨70,4,2,9,1725436586697640946858688965569256030805778296813628412838865985863680,[0,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027,4016468544237,5069428814296],[1000000000000000000000000000000,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027,4016468544237,1000000000000000000000000000000]⟩ +def gar71 : Row := ⟨71,4,2,10,1725436586697640946858688965569256030805778296813628412838865985863680,[0,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027,4016468544237,5069428814296,5278682274737],[1000000000000000000000000000000,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027,4016468544237,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar72 : Row := ⟨72,4,2,11,1725436586697640946858688965569256030805778296813628412838865985863680,[0,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027,4016468544237,5069428814296,5278682274737,5668467444243],[1000000000000000000000000000000,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027,4016468544237,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar73 : Row := ⟨73,4,2,12,1725436586697640946858688965569256030805778296813628412838865985863680,[0,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027,4016468544237,5069428814296,5278682274737,5668467444243,5877720904684],[1000000000000000000000000000000,1442745439565,1843571936572,2131779529185,2339821822395,2729606991901,2938860452342,3808426251027,4016468544237,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar74 : Row := ⟨74,4,3,2,1725429058513974481006928856009368710101592141552767441652603829616640,[0,961830293043,1362656790050],[1000000000000000000000000000000,961830293043,1362656790050]⟩ +def gar75 : Row := ⟨75,4,3,3,1725436572984891677951467423971190033228191736482436356466681019629568,[0,961830293043,1362656790050,1650864382663],[1000000000000000000000000000000,961830293043,1362656790050,1650864382663]⟩ +def gar76 : Row := ⟨76,4,3,4,1725436586697640946849780764332283256943134344901458172448960457736192,[0,961830293043,1362656790050,1650864382663,1858906675873],[1000000000000000000000000000000,961830293043,1362656790050,1650864382663,1858906675873]⟩ +def gar77 : Row := ⟨77,4,3,5,1725436586697640946852750164394783174039668864738844257514349945421824,[0,961830293043,1362656790050,1650864382663,1858906675873,2248691845379],[1000000000000000000000000000000,961830293043,1362656790050,1650864382663,1858906675873,2248691845379]⟩ +def gar78 : Row := ⟨78,4,3,6,1725436586697640946858688964519783008232737904413616427645128920793088,[0,961830293043,1362656790050,1650864382663,1858906675873,2248691845379,2457945305820],[1000000000000000000000000000000,961830293043,1362656790050,1650864382663,1858906675873,2248691845379,2457945305820]⟩ +def gar79 : Row := ⟨79,4,3,7,1725436586697640946858688964869593281427462644853965524084986642169856,[0,961830293043,1362656790050,1650864382663,1858906675873,2248691845379,2457945305820,3327511104505],[1000000000000000000000000000000,961830293043,1362656790050,1650864382663,1858906675873,2248691845379,2457945305820,3327511104505]⟩ +def gar80 : Row := ⟨80,4,3,8,1725436586697640946858688965569213827816912125734663716964702084923392,[0,961830293043,1362656790050,1650864382663,1858906675873,2248691845379,2457945305820,3327511104505,3535553397715],[1000000000000000000000000000000,961830293043,1362656790050,1650864382663,1858906675873,2248691845379,2457945305820,3327511104505,3535553397715]⟩ +def gar81 : Row := ⟨81,4,3,9,1725436586697640946858688965569213827816912125734663716964702084923392,[0,961830293043,1362656790050,1650864382663,1858906675873,2248691845379,2457945305820,3327511104505,3535553397715,4107598521252],[1000000000000000000000000000000,961830293043,1362656790050,1650864382663,1858906675873,2248691845379,2457945305820,3327511104505,3535553397715,1000000000000000000000000000000]⟩ +def gar82 : Row := ⟨82,4,3,10,1725436586697640946858688965569213827816912125734663716964702084923392,[0,961830293043,1362656790050,1650864382663,1858906675873,2248691845379,2457945305820,3327511104505,3535553397715,4107598521252,4316851981693],[1000000000000000000000000000000,961830293043,1362656790050,1650864382663,1858906675873,2248691845379,2457945305820,3327511104505,3535553397715,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar83 : Row := ⟨83,4,4,1,1653786614870979874242332953218776295840243179859395196846919280230400,[0,721372719782],[1000000000000000000000000000000,721372719782]⟩ +def gar84 : Row := ⟨84,4,4,2,1725429058513974481006928856009326174805727024244834519826674858590208,[0,721372719782,1102353427026],[1000000000000000000000000000000,721372719782,1102353427026]⟩ +def gar85 : Row := ⟨85,4,4,3,1725436572984891677951467423971062427340596384558637590988894106550272,[0,721372719782,1102353427026,1397200116012],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012]⟩ +def gar86 : Row := ⟨86,4,4,4,1725436586697640898959295112272958686173733925298765731581860092313600,[0,721372719782,1102353427026,1397200116012,1605242409222],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1605242409222]⟩ +def gar87 : Row := ⟨87,4,4,5,1725436586697640898962264512335118320903347506672688442039817811787776,[0,721372719782,1102353427026,1397200116012,1605242409222,2008234272118],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1605242409222,2008234272118]⟩ +def gar88 : Row := ⟨88,4,4,6,1725436586697640898968203312459437590362574669420533862955733250736128,[0,721372719782,1102353427026,1397200116012,1605242409222,2008234272118,2217487732559],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1605242409222,2008234272118,2217487732559]⟩ +def gar89 : Row := ⟨89,4,4,7,1725436586697640898968203312807886734089615656007029460965863899267072,[0,721372719782,1102353427026,1397200116012,1605242409222,2008234272118,2217487732559,2938860452341],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1605242409222,2008234272118,2217487732559,3087053531244]⟩ +def gar90 : Row := ⟨90,4,4,8,1725436586697640898968203313504785021543697629180020656986125196328960,[0,721372719782,1102353427026,1397200116012,1605242409222,2008234272118,2217487732559,2938860452341,3210484818444],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1605242409222,2008234272118,2217487732559,3087053531244,3295095824454]⟩ +def gar91 : Row := ⟨91,4,4,9,1725436586697640898968203313504785021543697629180020656986125196328960,[0,721372719782,1102353427026,1397200116012,1605242409222,2008234272118,2217487732559,2938860452341,3210484818444,3613476681340],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1605242409222,2008234272118,2217487732559,3087053531244,3295095824454,1000000000000000000000000000000]⟩ +def gar92 : Row := ⟨92,4,4,10,1725436586697640898968203313504785021543697629180020656986125196328960,[0,721372719782,1102353427026,1397200116012,1605242409222,2008234272118,2217487732559,2938860452341,3210484818444,3613476681340,3822730141781],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1605242409222,2008234272118,2217487732559,3087053531244,3295095824454,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar93 : Row := ⟨93,4,5,2,1725429058513974481006928855992992621193521977998592538669949984440320,[0,577098175826,908748865813],[1000000000000000000000000000000,577098175826,908748865813]⟩ +def gar94 : Row := ⟨94,4,5,3,1725436572984891582170496119814897154848762079756415658785340930392064,[0,577098175826,908748865813,1203595554799],[1000000000000000000000000000000,577098175826,908748865813,1203595554799]⟩ +def gar95 : Row := ⟨95,4,5,4,1725436586697640611616381199837129975922641103384583897284650312138752,[0,577098175826,908748865813,1203595554799,1411637848009],[1000000000000000000000000000000,577098175826,908748865813,1203595554799,1411637848009]⟩ +def gar96 : Row := ⟨96,4,5,5,1725436586697640611619350599812177324720494438111882708240075369480192,[0,577098175826,908748865813,1203595554799,1411637848009,1863959728162],[1000000000000000000000000000000,577098175826,908748865813,1203595554799,1411637848009,1863959728162]⟩ +def gar97 : Row := ⟨97,4,5,6,1725436586697640611625289399762272022316201107566480330150925484163072,[0,577098175826,908748865813,1203595554799,1411637848009,1863959728162,2073213188603],[1000000000000000000000000000000,577098175826,908748865813,1203595554799,1411637848009,1863959728162,2073213188603]⟩ +def gar98 : Row := ⟨98,4,5,7,1725436586697640611625289399762272022316201107566480330150925484163072,[0,577098175826,908748865813,1203595554799,1411637848009,1863959728162,2073213188603,2615233402808],[1000000000000000000000000000000,577098175826,908748865813,1203595554799,1411637848009,1863959728162,2073213188603,1000000000000000000000000000000]⟩ +def gar99 : Row := ⟨99,4,5,8,1725436586697640611625289399762272022316201107566480330150925484163072,[0,577098175826,908748865813,1203595554799,1411637848009,1863959728162,2073213188603,2615233402808,2823275696018],[1000000000000000000000000000000,577098175826,908748865813,1203595554799,1411637848009,1863959728162,2073213188603,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar100 : Row := ⟨100,4,6,1,1653786614870979874242332953213331777969508164443981203128010988847104,[0,480915146521],[1000000000000000000000000000000,480915146521]⟩ +def gar101 : Row := ⟨101,4,6,2,1725429058513974481006928854599196046285358031652610146629427390316544,[0,480915146521,779679158338],[1000000000000000000000000000000,480915146521,779679158338]⟩ +def gar102 : Row := ⟨102,4,6,3,1725436572984891582170496115633507430124270240718468482663773148020736,[0,480915146521,779679158338,1074525847324],[1000000000000000000000000000000,480915146521,779679158338,1074525847324]⟩ +def gar103 : Row := ⟨103,4,6,4,1725436586697640228492495973608339361978736691385411248316211607371776,[0,480915146521,779679158338,1074525847324,1282568140534],[1000000000000000000000000000000,480915146521,779679158338,1074525847324,1282568140534]⟩ +def gar104 : Row := ⟨104,4,6,5,1725436586697640228495465362433014111511278455344850922947455911723008,[0,480915146521,779679158338,1074525847324,1282568140534,1763483287055],[1000000000000000000000000000000,480915146521,779679158338,1074525847324,1282568140534,1767776698857]⟩ +def gar105 : Row := ⟨105,4,6,6,1725436586697640228501404140082363610576361983263730272209944520425472,[0,480915146521,779679158338,1074525847324,1282568140534,1763483287055,1977030159298],[1000000000000000000000000000000,480915146521,779679158338,1074525847324,1282568140534,1767776698857,1977030159298]⟩ +def gar106 : Row := ⟨106,4,6,7,1725436586697640228501404140082363610576361983263730272209944520425472,[0,480915146521,779679158338,1074525847324,1282568140534,1763483287055,1977030159298,2357093987858],[1000000000000000000000000000000,480915146521,779679158338,1074525847324,1282568140534,1767776698857,1977030159298,1000000000000000000000000000000]⟩ +def gar107 : Row := ⟨107,4,6,8,1725436586697640228501404140082363610576361983263730272209944520425472,[0,480915146521,779679158338,1074525847324,1282568140534,1763483287055,1977030159298,2357093987858,2565136281068],[1000000000000000000000000000000,480915146521,779679158338,1074525847324,1282568140534,1767776698857,1977030159298,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar108 : Row := ⟨108,4,7,2,1725429058513973714759158287850295675928105607283708701369697262632960,[0,412212982732,687486510142],[1000000000000000000000000000000,412212982732,687486510142]⟩ +def gar109 : Row := ⟨109,4,7,3,1725436572984889283427184504589787113175005533754637237478028788891648,[0,412212982732,687486510142,982333199128],[1000000000000000000000000000000,412212982732,687486510142,982333199128]⟩ +def gar110 : Row := ⟨110,4,7,4,1725436586697634864758102273974979151845447419231720403278438785351680,[0,412212982732,687486510142,982333199128,1190375492338],[1000000000000000000000000000000,412212982732,687486510142,982333199128,1190375492338]⟩ +def gar111 : Row := ⟨111,4,8,1,1653786614870979874242330054116455968988499764800605758841015211393024,[0,360686359891],[1000000000000000000000000000000,360686359891]⟩ +def gar112 : Row := ⟨112,4,8,2,1725429058513967584776986260808706006780710656331157529442390231744512,[0,360686359891,618342023995],[1000000000000000000000000000000,360686359891,618342023995]⟩ +def gar113 : Row := ⟨113,4,8,3,1725436572984870893480674132455788929572344914040861519676653227212800,[0,360686359891,618342023995,913188712981],[1000000000000000000000000000000,360686359891,618342023995,913188712981]⟩ +def gar114 : Row := ⟨114,4,8,4,1725436586697591954882915211656163939332255461995495593728926162092032,[0,360686359891,618342023995,913188712981,1121231006191],[1000000000000000000000000000000,360686359891,618342023995,913188712981,1121231006191]⟩ +def gar115 : Row := ⟨115,5,1,4,1725436586697640898968203313510229539414432644595434650705033487712256,[0,2598567796704,2871107803130,3027745106654,3235787399864],[1000000000000000000000000000000,2598567796704,2871107803130,3027745106654,3235787399864]⟩ +def gar116 : Row := ⟨116,5,1,6,1725436586697640898968203313510229539414432644595434650705033487712256,[0,2598567796704,2871107803130,3027745106654,3235787399864,5834355196568,6055490213308],[1000000000000000000000000000000,2598567796704,2871107803130,3027745106654,3235787399864,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar117 : Row := ⟨117,5,1,8,1725436586697640898968203313510229539414432644595434650705033487712256,[0,2598567796704,2871107803130,3027745106654,3235787399864,5834355196568,6055490213308,6263532506518,6471574799728],[1000000000000000000000000000000,2598567796704,2871107803130,3027745106654,3235787399864,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar118 : Row := ⟨118,5,2,2,1725429058513974435512749127358223492903704978117757371786200885493760,[0,1299283898352,1571823904778],[1000000000000000000000000000000,1299283898352,1571823904778]⟩ +def gar119 : Row := ⟨119,5,2,3,1725436572984891631661488454596408649253366394090421802641103400206336,[0,1299283898352,1571823904778,1728461208302],[1000000000000000000000000000000,1299283898352,1571823904778,1728461208302]⟩ +def gar120 : Row := ⟨120,5,2,4,1725436586697640898968203313510229539414432644595434650705033487712256,[0,1299283898352,1571823904778,1728461208302,1936503501512],[1000000000000000000000000000000,1299283898352,1571823904778,1728461208302,1936503501512]⟩ +def gar121 : Row := ⟨121,5,2,5,1725436586697640898968203313510229539414432644595434650705033487712256,[0,1299283898352,1571823904778,1728461208302,1936503501512,3235787399864],[1000000000000000000000000000000,1299283898352,1571823904778,1728461208302,1936503501512,1000000000000000000000000000000]⟩ +def gar122 : Row := ⟨122,5,2,6,1725436586697640898968203313510229539414432644595434650705033487712256,[0,1299283898352,1571823904778,1728461208302,1936503501512,3235787399864,3456922416604],[1000000000000000000000000000000,1299283898352,1571823904778,1728461208302,1936503501512,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar123 : Row := ⟨123,5,2,7,1725436586697640898968203313510229539414432644595434650705033487712256,[0,1299283898352,1571823904778,1728461208302,1936503501512,3235787399864,3456922416604,3664964709814],[1000000000000000000000000000000,1299283898352,1571823904778,1728461208302,1936503501512,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar124 : Row := ⟨124,5,2,8,1725436586697640898968203313510229539414432644595434650705033487712256,[0,1299283898352,1571823904778,1728461208302,1936503501512,3235787399864,3456922416604,3664964709814,3873007003024],[1000000000000000000000000000000,1299283898352,1571823904778,1728461208302,1936503501512,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar125 : Row := ⟨125,5,3,2,1725429058513974435512749127358223492903704978117757371786200885493760,[0,866189265568,1138729271994],[1000000000000000000000000000000,866189265568,1138729271994]⟩ +def gar126 : Row := ⟨126,5,3,3,1725436572984891631661488454596408649253366394090421802641103400206336,[0,866189265568,1138729271994,1295366575518],[1000000000000000000000000000000,866189265568,1138729271994,1295366575518]⟩ +def gar127 : Row := ⟨127,5,3,4,1725436586697640898968203313510229539414432644595434650705033487712256,[0,866189265568,1138729271994,1295366575518,1503408868728],[1000000000000000000000000000000,866189265568,1138729271994,1295366575518,1503408868728]⟩ +def gar128 : Row := ⟨128,5,3,5,1725436586697640898968203313510229539414432644595434650705033487712256,[0,866189265568,1138729271994,1295366575518,1503408868728,2369598134296],[1000000000000000000000000000000,866189265568,1138729271994,1295366575518,1503408868728,1000000000000000000000000000000]⟩ +def gar129 : Row := ⟨129,5,3,6,1725436586697640898968203313510229539414432644595434650705033487712256,[0,866189265568,1138729271994,1295366575518,1503408868728,2369598134296,2590733151036],[1000000000000000000000000000000,866189265568,1138729271994,1295366575518,1503408868728,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar130 : Row := ⟨130,5,3,7,1725436586697640898968203313510229539414432644595434650705033487712256,[0,866189265568,1138729271994,1295366575518,1503408868728,2369598134296,2590733151036,2798775444246],[1000000000000000000000000000000,866189265568,1138729271994,1295366575518,1503408868728,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar131 : Row := ⟨131,5,3,8,1725436586697640898968203313510229539414432644595434650705033487712256,[0,866189265568,1138729271994,1295366575518,1503408868728,2369598134296,2590733151036,2798775444246,3006817737456],[1000000000000000000000000000000,866189265568,1138729271994,1295366575518,1503408868728,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar132 : Row := ⟨132,5,4,1,1653786614870979859077606377466340926842290479932363611513602153906176,[0,649641949176],[1000000000000000000000000000000,649641949176]⟩ +def gar133 : Row := ⟨133,5,4,2,1725429058513974435512749127358223492903704978117757371786200885493760,[0,649641949176,922181955602],[1000000000000000000000000000000,649641949176,922181955602]⟩ +def gar134 : Row := ⟨134,5,4,3,1725436572984891631661488454596408649253366394090421802641103400206336,[0,649641949176,922181955602,1078819259126],[1000000000000000000000000000000,649641949176,922181955602,1078819259126]⟩ +def gar135 : Row := ⟨135,5,4,4,1725436586697640851077717661451202715716088046148272662619435919474688,[0,649641949176,922181955602,1078819259126,1286861552336],[1000000000000000000000000000000,649641949176,922181955602,1078819259126,1286861552336]⟩ +def gar136 : Row := ⟨136,5,4,5,1725436586697640851077717661451202715716088046148272662619435919474688,[0,649641949176,922181955602,1078819259126,1286861552336,1936503501512],[1000000000000000000000000000000,649641949176,922181955602,1078819259126,1286861552336,1000000000000000000000000000000]⟩ +def gar137 : Row := ⟨137,5,4,6,1725436586697640851077717661451202715716088046148272662619435919474688,[0,649641949176,922181955602,1078819259126,1286861552336,1936503501512,2157638518252],[1000000000000000000000000000000,649641949176,922181955602,1078819259126,1286861552336,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar138 : Row := ⟨138,5,4,7,1725436586697640851077717661451202715716088046148272662619435919474688,[0,649641949176,922181955602,1078819259126,1286861552336,1936503501512,2157638518252,2365680811462],[1000000000000000000000000000000,649641949176,922181955602,1078819259126,1286861552336,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar139 : Row := ⟨139,5,4,8,1725436586697640851077717661451202715716088046148272662619435919474688,[0,649641949176,922181955602,1078819259126,1286861552336,1936503501512,2157638518252,2365680811462,2573723104672],[1000000000000000000000000000000,649641949176,922181955602,1078819259126,1286861552336,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar140 : Row := ⟨140,5,5,2,1725429058513974435512749127358223492903704978117757371786200885493760,[0,519713559340,773920723468],[1000000000000000000000000000000,519713559340,773920723468]⟩ +def gar141 : Row := ⟨141,5,5,3,1725436572984891535880517150478355001856677197196097826469908263731200,[0,519713559340,773920723468,948890869290],[1000000000000000000000000000000,519713559340,773920723468,948890869290]⟩ +def gar142 : Row := ⟨142,5,5,4,1725436586697640563734803749097041773526020455465300734105850510049280,[0,519713559340,773920723468,948890869290,1156933162500],[1000000000000000000000000000000,519713559340,773920723468,948890869290,1156933162500]⟩ +def gar143 : Row := ⟨143,5,5,5,1725436586697640563734803749097041773526020455465300734105850510049280,[0,519713559340,773920723468,948890869290,1156933162500,1676646721840],[1000000000000000000000000000000,519713559340,773920723468,948890869290,1156933162500,1000000000000000000000000000000]⟩ +def gar144 : Row := ⟨144,5,5,6,1725436586697640563734803749097041773526020455465300734105850510049280,[0,519713559340,773920723468,948890869290,1156933162500,1676646721840,1897781738580],[1000000000000000000000000000000,519713559340,773920723468,948890869290,1156933162500,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar145 : Row := ⟨145,5,6,1,1653786614870979859077606377466340926842290479932363611513602153906176,[0,433094632784],[1000000000000000000000000000000,433094632784]⟩ +def gar146 : Row := ⟨146,5,6,2,1725429058513974435512749127358223492903704978117757371786200885493760,[0,433094632784,667322373050],[1000000000000000000000000000000,433094632784,667322373050]⟩ +def gar147 : Row := ⟨147,5,6,3,1725436572984891535880517150478355001856677197196097826469908263731200,[0,433094632784,667322373050,862271942734],[1000000000000000000000000000000,433094632784,667322373050,862271942734]⟩ +def gar148 : Row := ⟨148,5,6,4,1725436586697640180610918532624827183939263667888004829421069964148736,[0,433094632784,667322373050,862271942734,1070314235944],[1000000000000000000000000000000,433094632784,667322373050,862271942734,1070314235944]⟩ +def gar149 : Row := ⟨149,5,6,5,1725436586697640180610918532624827183939263667888004829421069964148736,[0,433094632784,667322373050,862271942734,1070314235944,1503408868728],[1000000000000000000000000000000,433094632784,667322373050,862271942734,1070314235944,1000000000000000000000000000000]⟩ +def gar150 : Row := ⟨150,5,6,6,1725436586697640180610918532624827183939263667888004829421069964148736,[0,433094632784,667322373050,862271942734,1070314235944,1503408868728,1724543885468],[1000000000000000000000000000000,433094632784,667322373050,862271942734,1070314235944,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar151 : Row := ⟨151,5,7,1,1653786614870979859077606377466340926842290479932363611513602153906176,[0,371223970957],[1000000000000000000000000000000,371223970957]⟩ +def gar152 : Row := ⟨152,5,7,2,1725429058513973669264978694413794313730191402963165562416639793692672,[0,371223970957,591180694181],[1000000000000000000000000000000,371223970957,591180694181]⟩ +def gar153 : Row := ⟨153,5,7,3,1725436572984889237137205851645067464336136471732322398361224988327936,[0,371223970957,591180694181,800401280907],[1000000000000000000000000000000,371223970957,591180694181,800401280907]⟩ +def gar154 : Row := ⟨154,5,7,4,1725436586697634816876525502013822929724668641805862163834142321541120,[0,371223970957,591180694181,800401280907,1008443574117],[1000000000000000000000000000000,371223970957,591180694181,800401280907,1008443574117]⟩ +def gar155 : Row := ⟨155,5,7,5,1725436586697634816876525502013822929724668641805862163834142321541120,[0,371223970957,591180694181,800401280907,1008443574117,1379667545074],[1000000000000000000000000000000,371223970957,591180694181,800401280907,1008443574117,1000000000000000000000000000000]⟩ +def gar156 : Row := ⟨156,5,7,6,1725436586697634816876525502013822929724668641805862163834142321541120,[0,371223970957,591180694181,800401280907,1008443574117,1379667545074,1599624268298],[1000000000000000000000000000000,371223970957,591180694181,800401280907,1008443574117,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar157 : Row := ⟨157,5,8,1,1653786614870979859077606377466340926842290479932363611513602153906176,[0,324820974588],[1000000000000000000000000000000,324820974588]⟩ +def gar158 : Row := ⟨158,5,8,2,1725429058513967539282815230858360880342082801726431087460151059283968,[0,324820974588,534074435029],[1000000000000000000000000000000,324820974588,534074435029]⟩ +def gar159 : Row := ⟨159,5,8,3,1725436572984870847190715460978767164171810668022118973491758785101824,[0,324820974588,534074435029,753998284538],[1000000000000000000000000000000,324820974588,534074435029,753998284538]⟩ +def gar160 : Row := ⟨160,5,8,4,1725436586697591907001381257125788896007908433148720839138721180680192,[0,324820974588,534074435029,753998284538,962040577748],[1000000000000000000000000000000,324820974588,534074435029,753998284538,962040577748]⟩ +def gar161 : Row := ⟨161,5,8,5,1725436586697591907001381257125788896007908433148720839138721180680192,[0,324820974588,534074435029,753998284538,962040577748,1286861552336],[1000000000000000000000000000000,324820974588,534074435029,753998284538,962040577748,1000000000000000000000000000000]⟩ +def gar162 : Row := ⟨162,5,8,6,1725436586697591907001381257125788896007908433148720839138721180680192,[0,324820974588,534074435029,753998284538,962040577748,1286861552336,1496115012777],[1000000000000000000000000000000,324820974588,534074435029,753998284538,962040577748,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar163 : Row := ⟨163,5,9,1,1653786614870930819220298669022873459737421670038487811861692278636544,[0,288729755189],[1000000000000000000000000000000,288729755189]⟩ +def gar164 : Row := ⟨164,5,9,2,1725429058513820419710892105527958479027476372044803688504421433475072,[0,288729755189,489658455688],[1000000000000000000000000000000,288729755189,489658455688]⟩ +def gar165 : Row := ⟨165,5,9,3,1725436572984527568189561501874494894437728998764988375928389658214400,[0,288729755189,489658455688,717907065139],[1000000000000000000000000000000,288729755189,489658455688,717907065139]⟩ +def gar166 : Row := ⟨166,5,9,4,1725436586696856309141765630473776889434876284740583844360073051635712,[0,288729755189,489658455688,717907065139,925949358349],[1000000000000000000000000000000,288729755189,489658455688,717907065139,925949358349]⟩ +def gar167 : Row := ⟨167,5,10,1,1653786614870930819220298669022873459737421670038487811861692278636544,[0,259856779670],[1000000000000000000000000000000,259856779670]⟩ +def gar168 : Row := ⟨168,5,10,2,1725429058513035781993968770432479005349575413742790894073863429160960,[0,259856779670,454125672216],[1000000000000000000000000000000,259856779670,454125672216]⟩ +def gar169 : Row := ⟨169,5,10,3,1725436572982173655038791496588056473404026123858949992636715645272064,[0,259856779670,454125672216,689034089620],[1000000000000000000000000000000,259856779670,454125672216,689034089620]⟩ +def gar170 : Row := ⟨170,5,10,4,1725436586691363845123302284805420573689569576626494283346167021436928,[0,259856779670,454125672216,689034089620,897076382830],[1000000000000000000000000000000,259856779670,454125672216,689034089620,897076382830]⟩ +def gar171 : Row := ⟨171,5,11,1,1653786614864653717484911988259037670314214003622385456417228244123648,[0,236233436064],[1000000000000000000000000000000,236233436064]⟩ +def gar172 : Row := ⟨172,5,11,2,1725429058494204476787808728140971637079952414494483827740471325622272,[0,236233436064,425053394829],[1000000000000000000000000000000,236233436064,425053394829]⟩ +def gar173 : Row := ⟨173,5,12,1,1653786614764220089718725096037665039542891340964747769305803691917312,[0,216547316392],[1000000000000000000000000000000,216547316392]⟩ +def gar174 : Row := ⟨174,5,12,2,1725429058192903593489248051476853744765984426521570766406197669003264,[0,216547316392,400826497007],[1000000000000000000000000000000,216547316392,400826497007]⟩ +def gar175 : Row := ⟨175,6,3,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,737116722467,871447343431,1608564065898,1742894686862],[1000000000000000000000000000000,737116722467,871447343431,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar176 : Row := ⟨176,6,4,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,552837541850,687168162814,1240005704664],[1000000000000000000000000000000,552837541850,687168162814,1000000000000000000000000000000]⟩ +def gar177 : Row := ⟨177,6,4,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,552837541850,687168162814,1240005704664,1374336325628],[1000000000000000000000000000000,552837541850,687168162814,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar178 : Row := ⟨178,6,5,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,442270033480,576600654444,1018870687924,1153201308888],[1000000000000000000000000000000,442270033480,576600654444,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar179 : Row := ⟨179,6,6,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,368558361233,502888982197],[1000000000000000000000000000000,368558361233,502888982197]⟩ +def gar180 : Row := ⟨180,6,6,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,368558361233,502888982197,871447343430],[1000000000000000000000000000000,368558361233,502888982197,1000000000000000000000000000000]⟩ +def gar181 : Row := ⟨181,6,6,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,368558361233,502888982197,871447343430,1005777964394],[1000000000000000000000000000000,368558361233,502888982197,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar182 : Row := ⟨182,6,7,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,315907166771,450237787735],[1000000000000000000000000000000,315907166771,450237787735]⟩ +def gar183 : Row := ⟨183,6,7,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,315907166771,450237787735,766144954506],[1000000000000000000000000000000,315907166771,450237787735,1000000000000000000000000000000]⟩ +def gar184 : Row := ⟨184,6,7,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,315907166771,450237787735,766144954506,900475575470],[1000000000000000000000000000000,315907166771,450237787735,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar185 : Row := ⟨185,6,8,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,276418770925],[1000000000000000000000000000000,276418770925]⟩ +def gar186 : Row := ⟨186,6,8,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,276418770925,410749391889],[1000000000000000000000000000000,276418770925,410749391889]⟩ +def gar187 : Row := ⟨187,6,8,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,276418770925,410749391889,687168162814],[1000000000000000000000000000000,276418770925,410749391889,1000000000000000000000000000000]⟩ +def gar188 : Row := ⟨188,6,8,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,276418770925,410749391889,687168162814,821498783778],[1000000000000000000000000000000,276418770925,410749391889,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar189 : Row := ⟨189,6,9,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,245705574155,380036195119],[1000000000000000000000000000000,245705574155,380036195119]⟩ +def gar190 : Row := ⟨190,6,9,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,245705574155,380036195119,625741769274],[1000000000000000000000000000000,245705574155,380036195119,1000000000000000000000000000000]⟩ +def gar191 : Row := ⟨191,6,9,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,245705574155,380036195119,625741769274,760072390238],[1000000000000000000000000000000,245705574155,380036195119,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar192 : Row := ⟨192,6,10,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,221135016740],[1000000000000000000000000000000,221135016740]⟩ +def gar193 : Row := ⟨193,6,10,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,221135016740,355465637704],[1000000000000000000000000000000,221135016740,355465637704]⟩ +def gar194 : Row := ⟨194,6,10,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,221135016740,355465637704,576600654444],[1000000000000000000000000000000,221135016740,355465637704,1000000000000000000000000000000]⟩ +def gar195 : Row := ⟨195,6,10,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,221135016740,355465637704,576600654444,710931275408],[1000000000000000000000000000000,221135016740,355465637704,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar196 : Row := ⟨196,6,11,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,201031833400],[1000000000000000000000000000000,201031833400]⟩ +def gar197 : Row := ⟨197,6,11,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,201031833400,335362454364],[1000000000000000000000000000000,201031833400,335362454364]⟩ +def gar198 : Row := ⟨198,6,11,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,201031833400,335362454364,536394287764],[1000000000000000000000000000000,201031833400,335362454364,1000000000000000000000000000000]⟩ +def gar199 : Row := ⟨199,6,11,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,201031833400,335362454364,536394287764,670724908728],[1000000000000000000000000000000,201031833400,335362454364,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar200 : Row := ⟨200,6,12,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,184279180616],[1000000000000000000000000000000,184279180616]⟩ +def gar201 : Row := ⟨201,6,12,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,184279180616,318609801580],[1000000000000000000000000000000,184279180616,318609801580]⟩ +def gar202 : Row := ⟨202,6,12,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,184279180616,318609801580,502888982196],[1000000000000000000000000000000,184279180616,318609801580,1000000000000000000000000000000]⟩ +def gar203 : Row := ⟨203,6,12,4,1724594088364292489365105621347786999654226082279392245900596568129536,[0,184279180616,318609801580,502888982196,637219603160],[1000000000000000000000000000000,184279180616,318609801580,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gar204 : Row := ⟨204,6,13,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,170103859031],[1000000000000000000000000000000,170103859031]⟩ +def gar205 : Row := ⟨205,6,13,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,170103859031,304434479995],[1000000000000000000000000000000,170103859031,304434479995]⟩ +def gar206 : Row := ⟨206,6,13,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,170103859031,304434479995,474538339026],[1000000000000000000000000000000,170103859031,304434479995,1000000000000000000000000000000]⟩ +def gar207 : Row := ⟨207,6,14,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,157953583385],[1000000000000000000000000000000,157953583385]⟩ +def gar208 : Row := ⟨208,6,14,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,157953583385,292284204349],[1000000000000000000000000000000,157953583385,292284204349]⟩ +def gar209 : Row := ⟨209,6,14,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,157953583385,292284204349,450237787734],[1000000000000000000000000000000,157953583385,292284204349,1000000000000000000000000000000]⟩ +def gar210 : Row := ⟨210,6,15,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,147423344493],[1000000000000000000000000000000,147423344493]⟩ +def gar211 : Row := ⟨211,6,15,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,147423344493,281753965457],[1000000000000000000000000000000,147423344493,281753965457]⟩ +def gar212 : Row := ⟨212,6,15,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,147423344493,281753965457,429177309950],[1000000000000000000000000000000,147423344493,281753965457,1000000000000000000000000000000]⟩ +def gar213 : Row := ⟨213,6,16,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,138209385462],[1000000000000000000000000000000,138209385462]⟩ +def gar214 : Row := ⟨214,6,16,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,138209385462,272540006426],[1000000000000000000000000000000,138209385462,272540006426]⟩ +def gar215 : Row := ⟨215,6,17,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,130079421611],[1000000000000000000000000000000,130079421611]⟩ +def gar216 : Row := ⟨216,6,18,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,122852787077],[1000000000000000000000000000000,122852787077]⟩ +def gar217 : Row := ⟨217,6,19,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,116386850915],[1000000000000000000000000000000,116386850915]⟩ +def gar218 : Row := ⟨218,6,20,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,110567508370],[1000000000000000000000000000000,110567508370]⟩ +def gar219 : Row := ⟨219,7,18,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,89553747310,179107494620],[1000000000000000000000000000000,89553747310,1000000000000000000000000000000]⟩ +def gar220 : Row := ⟨220,7,20,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,80598372579],[1000000000000000000000000000000,80598372579]⟩ +def gar221 : Row := ⟨221,7,20,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,80598372579,161196745158],[1000000000000000000000000000000,80598372579,1000000000000000000000000000000]⟩ +def gar222 : Row := ⟨222,7,22,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,73271247799],[1000000000000000000000000000000,73271247799]⟩ +def gar223 : Row := ⟨223,7,22,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,73271247799,146542495598],[1000000000000000000000000000000,73271247799,1000000000000000000000000000000]⟩ +def gar224 : Row := ⟨224,7,24,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,67165310482],[1000000000000000000000000000000,67165310482]⟩ +def gar225 : Row := ⟨225,7,24,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,67165310482,134330620964],[1000000000000000000000000000000,67165310482,1000000000000000000000000000000]⟩ +def gar226 : Row := ⟨226,7,26,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,61998748137],[1000000000000000000000000000000,61998748137]⟩ +def gar227 : Row := ⟨227,7,28,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,57570266128],[1000000000000000000000000000000,57570266128]⟩ +def gar228 : Row := ⟨228,7,30,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,53732248386],[1000000000000000000000000000000,53732248386]⟩ +def gar229 : Row := ⟨229,8,48,1,0,[0,0],[1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gaR : List Row := [gar0, gar1, gar2, gar3, gar4, gar5, gar6, gar7, gar8, gar9, gar10, gar11, gar12, gar13, gar14, gar15, gar16, gar17, gar18, gar19, gar20, gar21, gar22, gar23, gar24, gar25, gar26, gar27, gar28, gar29, gar30, gar31, gar32, gar33, gar34, gar35, gar36, gar37, gar38, gar39, gar40, gar41, gar42, gar43, gar44, gar45, gar46, gar47, gar48, gar49, gar50, gar51, gar52, gar53, gar54, gar55, gar56, gar57, gar58, gar59, gar60, gar61, gar62, gar63, gar64, gar65, gar66, gar67, gar68, gar69, gar70, gar71, gar72, gar73, gar74, gar75, gar76, gar77, gar78, gar79, gar80, gar81, gar82, gar83, gar84, gar85, gar86, gar87, gar88, gar89, gar90, gar91, gar92, gar93, gar94, gar95, gar96, gar97, gar98, gar99, gar100, gar101, gar102, gar103, gar104, gar105, gar106, gar107, gar108, gar109, gar110, gar111, gar112, gar113, gar114, gar115, gar116, gar117, gar118, gar119, gar120, gar121, gar122, gar123, gar124, gar125, gar126, gar127, gar128, gar129, gar130, gar131, gar132, gar133, gar134, gar135, gar136, gar137, gar138, gar139, gar140, gar141, gar142, gar143, gar144, gar145, gar146, gar147, gar148, gar149, gar150, gar151, gar152, gar153, gar154, gar155, gar156, gar157, gar158, gar159, gar160, gar161, gar162, gar163, gar164, gar165, gar166, gar167, gar168, gar169, gar170, gar171, gar172, gar173, gar174, gar175, gar176, gar177, gar178, gar179, gar180, gar181, gar182, gar183, gar184, gar185, gar186, gar187, gar188, gar189, gar190, gar191, gar192, gar193, gar194, gar195, gar196, gar197, gar198, gar199, gar200, gar201, gar202, gar203, gar204, gar205, gar206, gar207, gar208, gar209, gar210, gar211, gar212, gar213, gar214, gar215, gar216, gar217, gar218, gar219, gar220, gar221, gar222, gar223, gar224, gar225, gar226, gar227, gar228, gar229] +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP0.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP0.lean new file mode 100644 index 0000000000..cd875b15c3 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP0.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac0 : Row.check gaW gaR gar0 = true := by decide +kernel +theorem gac1 : Row.check gaW gaR gar1 = true := by decide +kernel +theorem gac2 : Row.check gaW gaR gar2 = true := by decide +kernel +theorem gac3 : Row.check gaW gaR gar3 = true := by decide +kernel +theorem gac4 : Row.check gaW gaR gar4 = true := by decide +kernel +theorem gac5 : Row.check gaW gaR gar5 = true := by decide +kernel +theorem gac6 : Row.check gaW gaR gar6 = true := by decide +kernel +theorem gac7 : Row.check gaW gaR gar7 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP1.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP1.lean new file mode 100644 index 0000000000..2c530b1a75 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP1.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac8 : Row.check gaW gaR gar8 = true := by decide +kernel +theorem gac9 : Row.check gaW gaR gar9 = true := by decide +kernel +theorem gac10 : Row.check gaW gaR gar10 = true := by decide +kernel +theorem gac11 : Row.check gaW gaR gar11 = true := by decide +kernel +theorem gac12 : Row.check gaW gaR gar12 = true := by decide +kernel +theorem gac13 : Row.check gaW gaR gar13 = true := by decide +kernel +theorem gac14 : Row.check gaW gaR gar14 = true := by decide +kernel +theorem gac15 : Row.check gaW gaR gar15 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP10.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP10.lean new file mode 100644 index 0000000000..0fc7a8dc5a --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP10.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac80 : Row.check gaW gaR gar80 = true := by decide +kernel +theorem gac81 : Row.check gaW gaR gar81 = true := by decide +kernel +theorem gac82 : Row.check gaW gaR gar82 = true := by decide +kernel +theorem gac83 : Row.check gaW gaR gar83 = true := by decide +kernel +theorem gac84 : Row.check gaW gaR gar84 = true := by decide +kernel +theorem gac85 : Row.check gaW gaR gar85 = true := by decide +kernel +theorem gac86 : Row.check gaW gaR gar86 = true := by decide +kernel +theorem gac87 : Row.check gaW gaR gar87 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP11.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP11.lean new file mode 100644 index 0000000000..108d9da26e --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP11.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac88 : Row.check gaW gaR gar88 = true := by decide +kernel +theorem gac89 : Row.check gaW gaR gar89 = true := by decide +kernel +theorem gac90 : Row.check gaW gaR gar90 = true := by decide +kernel +theorem gac91 : Row.check gaW gaR gar91 = true := by decide +kernel +theorem gac92 : Row.check gaW gaR gar92 = true := by decide +kernel +theorem gac93 : Row.check gaW gaR gar93 = true := by decide +kernel +theorem gac94 : Row.check gaW gaR gar94 = true := by decide +kernel +theorem gac95 : Row.check gaW gaR gar95 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP12.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP12.lean new file mode 100644 index 0000000000..ba97404987 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP12.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac96 : Row.check gaW gaR gar96 = true := by decide +kernel +theorem gac97 : Row.check gaW gaR gar97 = true := by decide +kernel +theorem gac98 : Row.check gaW gaR gar98 = true := by decide +kernel +theorem gac99 : Row.check gaW gaR gar99 = true := by decide +kernel +theorem gac100 : Row.check gaW gaR gar100 = true := by decide +kernel +theorem gac101 : Row.check gaW gaR gar101 = true := by decide +kernel +theorem gac102 : Row.check gaW gaR gar102 = true := by decide +kernel +theorem gac103 : Row.check gaW gaR gar103 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP13.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP13.lean new file mode 100644 index 0000000000..47176b0466 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP13.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac104 : Row.check gaW gaR gar104 = true := by decide +kernel +theorem gac105 : Row.check gaW gaR gar105 = true := by decide +kernel +theorem gac106 : Row.check gaW gaR gar106 = true := by decide +kernel +theorem gac107 : Row.check gaW gaR gar107 = true := by decide +kernel +theorem gac108 : Row.check gaW gaR gar108 = true := by decide +kernel +theorem gac109 : Row.check gaW gaR gar109 = true := by decide +kernel +theorem gac110 : Row.check gaW gaR gar110 = true := by decide +kernel +theorem gac111 : Row.check gaW gaR gar111 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP14.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP14.lean new file mode 100644 index 0000000000..21d8c021a9 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP14.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac112 : Row.check gaW gaR gar112 = true := by decide +kernel +theorem gac113 : Row.check gaW gaR gar113 = true := by decide +kernel +theorem gac114 : Row.check gaW gaR gar114 = true := by decide +kernel +theorem gac115 : Row.check gaW gaR gar115 = true := by decide +kernel +theorem gac116 : Row.check gaW gaR gar116 = true := by decide +kernel +theorem gac117 : Row.check gaW gaR gar117 = true := by decide +kernel +theorem gac118 : Row.check gaW gaR gar118 = true := by decide +kernel +theorem gac119 : Row.check gaW gaR gar119 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP15.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP15.lean new file mode 100644 index 0000000000..20fb484048 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP15.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac120 : Row.check gaW gaR gar120 = true := by decide +kernel +theorem gac121 : Row.check gaW gaR gar121 = true := by decide +kernel +theorem gac122 : Row.check gaW gaR gar122 = true := by decide +kernel +theorem gac123 : Row.check gaW gaR gar123 = true := by decide +kernel +theorem gac124 : Row.check gaW gaR gar124 = true := by decide +kernel +theorem gac125 : Row.check gaW gaR gar125 = true := by decide +kernel +theorem gac126 : Row.check gaW gaR gar126 = true := by decide +kernel +theorem gac127 : Row.check gaW gaR gar127 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP16.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP16.lean new file mode 100644 index 0000000000..af3d1fc941 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP16.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac128 : Row.check gaW gaR gar128 = true := by decide +kernel +theorem gac129 : Row.check gaW gaR gar129 = true := by decide +kernel +theorem gac130 : Row.check gaW gaR gar130 = true := by decide +kernel +theorem gac131 : Row.check gaW gaR gar131 = true := by decide +kernel +theorem gac132 : Row.check gaW gaR gar132 = true := by decide +kernel +theorem gac133 : Row.check gaW gaR gar133 = true := by decide +kernel +theorem gac134 : Row.check gaW gaR gar134 = true := by decide +kernel +theorem gac135 : Row.check gaW gaR gar135 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP17.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP17.lean new file mode 100644 index 0000000000..229e9cda18 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP17.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac136 : Row.check gaW gaR gar136 = true := by decide +kernel +theorem gac137 : Row.check gaW gaR gar137 = true := by decide +kernel +theorem gac138 : Row.check gaW gaR gar138 = true := by decide +kernel +theorem gac139 : Row.check gaW gaR gar139 = true := by decide +kernel +theorem gac140 : Row.check gaW gaR gar140 = true := by decide +kernel +theorem gac141 : Row.check gaW gaR gar141 = true := by decide +kernel +theorem gac142 : Row.check gaW gaR gar142 = true := by decide +kernel +theorem gac143 : Row.check gaW gaR gar143 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP18.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP18.lean new file mode 100644 index 0000000000..47a36532e1 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP18.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac144 : Row.check gaW gaR gar144 = true := by decide +kernel +theorem gac145 : Row.check gaW gaR gar145 = true := by decide +kernel +theorem gac146 : Row.check gaW gaR gar146 = true := by decide +kernel +theorem gac147 : Row.check gaW gaR gar147 = true := by decide +kernel +theorem gac148 : Row.check gaW gaR gar148 = true := by decide +kernel +theorem gac149 : Row.check gaW gaR gar149 = true := by decide +kernel +theorem gac150 : Row.check gaW gaR gar150 = true := by decide +kernel +theorem gac151 : Row.check gaW gaR gar151 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP19.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP19.lean new file mode 100644 index 0000000000..2328710a5a --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP19.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac152 : Row.check gaW gaR gar152 = true := by decide +kernel +theorem gac153 : Row.check gaW gaR gar153 = true := by decide +kernel +theorem gac154 : Row.check gaW gaR gar154 = true := by decide +kernel +theorem gac155 : Row.check gaW gaR gar155 = true := by decide +kernel +theorem gac156 : Row.check gaW gaR gar156 = true := by decide +kernel +theorem gac157 : Row.check gaW gaR gar157 = true := by decide +kernel +theorem gac158 : Row.check gaW gaR gar158 = true := by decide +kernel +theorem gac159 : Row.check gaW gaR gar159 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP2.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP2.lean new file mode 100644 index 0000000000..f013483296 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP2.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac16 : Row.check gaW gaR gar16 = true := by decide +kernel +theorem gac17 : Row.check gaW gaR gar17 = true := by decide +kernel +theorem gac18 : Row.check gaW gaR gar18 = true := by decide +kernel +theorem gac19 : Row.check gaW gaR gar19 = true := by decide +kernel +theorem gac20 : Row.check gaW gaR gar20 = true := by decide +kernel +theorem gac21 : Row.check gaW gaR gar21 = true := by decide +kernel +theorem gac22 : Row.check gaW gaR gar22 = true := by decide +kernel +theorem gac23 : Row.check gaW gaR gar23 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP20.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP20.lean new file mode 100644 index 0000000000..e063206e16 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP20.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac160 : Row.check gaW gaR gar160 = true := by decide +kernel +theorem gac161 : Row.check gaW gaR gar161 = true := by decide +kernel +theorem gac162 : Row.check gaW gaR gar162 = true := by decide +kernel +theorem gac163 : Row.check gaW gaR gar163 = true := by decide +kernel +theorem gac164 : Row.check gaW gaR gar164 = true := by decide +kernel +theorem gac165 : Row.check gaW gaR gar165 = true := by decide +kernel +theorem gac166 : Row.check gaW gaR gar166 = true := by decide +kernel +theorem gac167 : Row.check gaW gaR gar167 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP21.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP21.lean new file mode 100644 index 0000000000..941f7c2239 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP21.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac168 : Row.check gaW gaR gar168 = true := by decide +kernel +theorem gac169 : Row.check gaW gaR gar169 = true := by decide +kernel +theorem gac170 : Row.check gaW gaR gar170 = true := by decide +kernel +theorem gac171 : Row.check gaW gaR gar171 = true := by decide +kernel +theorem gac172 : Row.check gaW gaR gar172 = true := by decide +kernel +theorem gac173 : Row.check gaW gaR gar173 = true := by decide +kernel +theorem gac174 : Row.check gaW gaR gar174 = true := by decide +kernel +theorem gac175 : Row.check gaW gaR gar175 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP22.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP22.lean new file mode 100644 index 0000000000..cc0f3c57de --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP22.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac176 : Row.check gaW gaR gar176 = true := by decide +kernel +theorem gac177 : Row.check gaW gaR gar177 = true := by decide +kernel +theorem gac178 : Row.check gaW gaR gar178 = true := by decide +kernel +theorem gac179 : Row.check gaW gaR gar179 = true := by decide +kernel +theorem gac180 : Row.check gaW gaR gar180 = true := by decide +kernel +theorem gac181 : Row.check gaW gaR gar181 = true := by decide +kernel +theorem gac182 : Row.check gaW gaR gar182 = true := by decide +kernel +theorem gac183 : Row.check gaW gaR gar183 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP23.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP23.lean new file mode 100644 index 0000000000..ac31665606 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP23.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac184 : Row.check gaW gaR gar184 = true := by decide +kernel +theorem gac185 : Row.check gaW gaR gar185 = true := by decide +kernel +theorem gac186 : Row.check gaW gaR gar186 = true := by decide +kernel +theorem gac187 : Row.check gaW gaR gar187 = true := by decide +kernel +theorem gac188 : Row.check gaW gaR gar188 = true := by decide +kernel +theorem gac189 : Row.check gaW gaR gar189 = true := by decide +kernel +theorem gac190 : Row.check gaW gaR gar190 = true := by decide +kernel +theorem gac191 : Row.check gaW gaR gar191 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP24.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP24.lean new file mode 100644 index 0000000000..898c505b00 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP24.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac192 : Row.check gaW gaR gar192 = true := by decide +kernel +theorem gac193 : Row.check gaW gaR gar193 = true := by decide +kernel +theorem gac194 : Row.check gaW gaR gar194 = true := by decide +kernel +theorem gac195 : Row.check gaW gaR gar195 = true := by decide +kernel +theorem gac196 : Row.check gaW gaR gar196 = true := by decide +kernel +theorem gac197 : Row.check gaW gaR gar197 = true := by decide +kernel +theorem gac198 : Row.check gaW gaR gar198 = true := by decide +kernel +theorem gac199 : Row.check gaW gaR gar199 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP25.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP25.lean new file mode 100644 index 0000000000..e9eeca7bb8 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP25.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac200 : Row.check gaW gaR gar200 = true := by decide +kernel +theorem gac201 : Row.check gaW gaR gar201 = true := by decide +kernel +theorem gac202 : Row.check gaW gaR gar202 = true := by decide +kernel +theorem gac203 : Row.check gaW gaR gar203 = true := by decide +kernel +theorem gac204 : Row.check gaW gaR gar204 = true := by decide +kernel +theorem gac205 : Row.check gaW gaR gar205 = true := by decide +kernel +theorem gac206 : Row.check gaW gaR gar206 = true := by decide +kernel +theorem gac207 : Row.check gaW gaR gar207 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP26.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP26.lean new file mode 100644 index 0000000000..f8f59dfe54 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP26.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac208 : Row.check gaW gaR gar208 = true := by decide +kernel +theorem gac209 : Row.check gaW gaR gar209 = true := by decide +kernel +theorem gac210 : Row.check gaW gaR gar210 = true := by decide +kernel +theorem gac211 : Row.check gaW gaR gar211 = true := by decide +kernel +theorem gac212 : Row.check gaW gaR gar212 = true := by decide +kernel +theorem gac213 : Row.check gaW gaR gar213 = true := by decide +kernel +theorem gac214 : Row.check gaW gaR gar214 = true := by decide +kernel +theorem gac215 : Row.check gaW gaR gar215 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP27.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP27.lean new file mode 100644 index 0000000000..e21d1816ce --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP27.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac216 : Row.check gaW gaR gar216 = true := by decide +kernel +theorem gac217 : Row.check gaW gaR gar217 = true := by decide +kernel +theorem gac218 : Row.check gaW gaR gar218 = true := by decide +kernel +theorem gac219 : Row.check gaW gaR gar219 = true := by decide +kernel +theorem gac220 : Row.check gaW gaR gar220 = true := by decide +kernel +theorem gac221 : Row.check gaW gaR gar221 = true := by decide +kernel +theorem gac222 : Row.check gaW gaR gar222 = true := by decide +kernel +theorem gac223 : Row.check gaW gaR gar223 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP28.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP28.lean new file mode 100644 index 0000000000..6e7af1342f --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP28.lean @@ -0,0 +1,9 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac224 : Row.check gaW gaR gar224 = true := by decide +kernel +theorem gac225 : Row.check gaW gaR gar225 = true := by decide +kernel +theorem gac226 : Row.check gaW gaR gar226 = true := by decide +kernel +theorem gac227 : Row.check gaW gaR gar227 = true := by decide +kernel +theorem gac228 : Row.check gaW gaR gar228 = true := by decide +kernel +theorem gac229 : Row.check gaW gaR gar229 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP3.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP3.lean new file mode 100644 index 0000000000..b1359496e0 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP3.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac24 : Row.check gaW gaR gar24 = true := by decide +kernel +theorem gac25 : Row.check gaW gaR gar25 = true := by decide +kernel +theorem gac26 : Row.check gaW gaR gar26 = true := by decide +kernel +theorem gac27 : Row.check gaW gaR gar27 = true := by decide +kernel +theorem gac28 : Row.check gaW gaR gar28 = true := by decide +kernel +theorem gac29 : Row.check gaW gaR gar29 = true := by decide +kernel +theorem gac30 : Row.check gaW gaR gar30 = true := by decide +kernel +theorem gac31 : Row.check gaW gaR gar31 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP4.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP4.lean new file mode 100644 index 0000000000..7497fd89ea --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP4.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac32 : Row.check gaW gaR gar32 = true := by decide +kernel +theorem gac33 : Row.check gaW gaR gar33 = true := by decide +kernel +theorem gac34 : Row.check gaW gaR gar34 = true := by decide +kernel +theorem gac35 : Row.check gaW gaR gar35 = true := by decide +kernel +theorem gac36 : Row.check gaW gaR gar36 = true := by decide +kernel +theorem gac37 : Row.check gaW gaR gar37 = true := by decide +kernel +theorem gac38 : Row.check gaW gaR gar38 = true := by decide +kernel +theorem gac39 : Row.check gaW gaR gar39 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP5.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP5.lean new file mode 100644 index 0000000000..34cf59feeb --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP5.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac40 : Row.check gaW gaR gar40 = true := by decide +kernel +theorem gac41 : Row.check gaW gaR gar41 = true := by decide +kernel +theorem gac42 : Row.check gaW gaR gar42 = true := by decide +kernel +theorem gac43 : Row.check gaW gaR gar43 = true := by decide +kernel +theorem gac44 : Row.check gaW gaR gar44 = true := by decide +kernel +theorem gac45 : Row.check gaW gaR gar45 = true := by decide +kernel +theorem gac46 : Row.check gaW gaR gar46 = true := by decide +kernel +theorem gac47 : Row.check gaW gaR gar47 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP6.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP6.lean new file mode 100644 index 0000000000..e104e18c04 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP6.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac48 : Row.check gaW gaR gar48 = true := by decide +kernel +theorem gac49 : Row.check gaW gaR gar49 = true := by decide +kernel +theorem gac50 : Row.check gaW gaR gar50 = true := by decide +kernel +theorem gac51 : Row.check gaW gaR gar51 = true := by decide +kernel +theorem gac52 : Row.check gaW gaR gar52 = true := by decide +kernel +theorem gac53 : Row.check gaW gaR gar53 = true := by decide +kernel +theorem gac54 : Row.check gaW gaR gar54 = true := by decide +kernel +theorem gac55 : Row.check gaW gaR gar55 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP7.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP7.lean new file mode 100644 index 0000000000..08ea24659f --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP7.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac56 : Row.check gaW gaR gar56 = true := by decide +kernel +theorem gac57 : Row.check gaW gaR gar57 = true := by decide +kernel +theorem gac58 : Row.check gaW gaR gar58 = true := by decide +kernel +theorem gac59 : Row.check gaW gaR gar59 = true := by decide +kernel +theorem gac60 : Row.check gaW gaR gar60 = true := by decide +kernel +theorem gac61 : Row.check gaW gaR gar61 = true := by decide +kernel +theorem gac62 : Row.check gaW gaR gar62 = true := by decide +kernel +theorem gac63 : Row.check gaW gaR gar63 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP8.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP8.lean new file mode 100644 index 0000000000..ff4c7ac7e0 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP8.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac64 : Row.check gaW gaR gar64 = true := by decide +kernel +theorem gac65 : Row.check gaW gaR gar65 = true := by decide +kernel +theorem gac66 : Row.check gaW gaR gar66 = true := by decide +kernel +theorem gac67 : Row.check gaW gaR gar67 = true := by decide +kernel +theorem gac68 : Row.check gaW gaR gar68 = true := by decide +kernel +theorem gac69 : Row.check gaW gaR gar69 = true := by decide +kernel +theorem gac70 : Row.check gaW gaR gar70 = true := by decide +kernel +theorem gac71 : Row.check gaW gaR gar71 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegaP9.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegaP9.lean new file mode 100644 index 0000000000..cfb5c1cf1d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegaP9.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegaDefs +namespace CTree +theorem gac72 : Row.check gaW gaR gar72 = true := by decide +kernel +theorem gac73 : Row.check gaW gaR gar73 = true := by decide +kernel +theorem gac74 : Row.check gaW gaR gar74 = true := by decide +kernel +theorem gac75 : Row.check gaW gaR gar75 = true := by decide +kernel +theorem gac76 : Row.check gaW gaR gar76 = true := by decide +kernel +theorem gac77 : Row.check gaW gaR gar77 = true := by decide +kernel +theorem gac78 : Row.check gaW gaR gar78 = true := by decide +kernel +theorem gac79 : Row.check gaW gaR gar79 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbDefs.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbDefs.lean new file mode 100644 index 0000000000..5cc14b60a5 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbDefs.lean @@ -0,0 +1,235 @@ +import Nov15.CTreeCore +namespace CTree +def gbW : List (List Nat) := [[0,0,0,0,0,0,0,0,0],[0,0,1611967451585,2211350167403,2598567796704,2885490879130,3113530662322,3302758400007,3464456577896],[0,0,0,2211350167403,3197950512521,3872091224248,4387054089866,4804321610743,3302758400007],[0,0,0,0,2598567796704,3872091224248,4774271719168,4387054089866,3113530662322],[0,0,0,0,0,2885490879130,3872091224248,3872091224248,2885490879130],[0,0,0,0,0,0,2598567796704,3197950512521,2598567796704],[0,0,0,0,0,0,0,2211350167403,2211350167403],[0,0,0,0,0,0,0,0,1611967451585],[0,0,0,0,0,0,0,0,0]] +def gbr0 : Row := ⟨0,1,1,48,1725436573842136496999949450566182365151713209810570198837308615032830,[0,2959254156595,3229121695333,3542707972272,3784255571050,4173563598697,4486293440944,4989167090130,5488854103858,6237637300267,6550367142514,7036271060908,7994349440529,8359638362960,8724927285391,9224614299119,10590490578413,11079411602729,11532137978477,12031824992205,12689554031779,13081356718888,13473159405997,14220168230416,14770012943371,15761198346299,16260885360027,17084565648351,17449854570782,17949541584510,18449228598238,19631723861402,20023526548511,20509430466905,21256439291324,21806284004279,22198086691388,22697773705116,23444782529535,23994627242490,24985812645418,25485499659146,26162713437776,26554516124885,26946318811994,27673842897357,28243172349368,28990181173787,29540025886742],[1000000000000000000000000000000,2959254156595,3229121695333,3542707972272,3784255571050,4173563598697,4486293440944,4989167090130,5488854103858,6237637300267,6550367142514,7036271060908,7994349440529,8359638362960,8724927285391,9224614299119,10590490578413,11079411602729,11532137978477,12031824992205,12689554031779,13081356718888,13473159405997,14220168230416,14770012943371,17865920529485,18331244177505,18696533099936,19061822022367,19561509036095,20061196049823,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr1 : Row := ⟨1,2,1,20,1725015324675462241969512331649767709784406448675510684105221314271232,[0,3249193721510,3777237817747,4152065280295,4393612879073,4893629217240,5213498404091,5766484508027,6336787561399,7075891928910,7395761115761,8783071894530,9081835906347,10979982912118,11532969016054,12103272069426,12609259519852,13162245623788,13732548677160,14471653044671,14791522231522],[1000000000000000000000000000000,3249193721510,3777237817747,4152065280295,4393612879073,4893629217240,5213498404091,5766484508027,6336787561399,7075891928910,7395761115761,8783071894530,9081835906347,12235125206827,12476672805605,12947510776341,13189058375119,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr2 : Row := ⟨2,2,1,22,1725436573842136447612886120834963482967112704359188715965219430987776,[0,3249193721510,3777237817747,4152065280295,4393612879073,4893629217240,5213498404091,5766484508027,6336787561399,6837020016084,7395761115761,7895777453928,8969505123621,9282234965868,9591116550959,12050518420175,12603504524111,13109275858019,13662261961955,14232565015327,14732797470012,15291538569689,15791554907856],[1000000000000000000000000000000,3249193721510,3777237817747,4152065280295,4393612879073,4893629217240,5213498404091,5766484508027,6336787561399,6837020016084,7395761115761,7895777453928,8969505123621,9282234965868,9591116550959,12947510776341,13189058375119,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr3 : Row := ⟨3,2,1,24,1725436573842136496999949449869273237804383384200179514115807745931264,[0,3249193721510,3777237817747,4152065280295,4393612879073,4790119961719,5102849803966,5468138726397,5967825740125,6837020016084,7149749858331,7650401438067,7994349440529,9282234965868,9591116550959,10090803564687,11935651480250,12617888584728,13097199244495,13462488166926,13962175180654,14800151296398,15144099298860,15644750878596,15988698881058],[1000000000000000000000000000000,3249193721510,3777237817747,4152065280295,4393612879073,4790119961719,5102849803966,5468138726397,5967825740125,6837020016084,7149749858331,7650401438067,7994349440529,9282234965868,9591116550959,10090803564687,13189058375119,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr4 : Row := ⟨4,2,1,26,1725436573842136496999949450566182326208219110527728180569517609447424,[0,3249193721510,3777237817747,4152065280295,4393612879073,4790119961719,5102849803966,5468138726397,5967825740125,6716608936534,7149749858331,7650401438067,7994349440529,8359638362960,9591116550959,10090803564687,10590490578415,12617888584728,13097199244495,13462488166926,13827777089357,14327464103085,15076247299494,15509388221291,15988698881058,16353987803489,16719276725920],[1000000000000000000000000000000,3249193721510,3777237817747,4152065280295,4393612879073,4790119961719,5102849803966,5468138726397,5967825740125,6716608936534,7149749858331,7650401438067,7994349440529,8359638362960,9591116550959,10090803564687,10590490578415,14306803392802,14619533235049,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr5 : Row := ⟨5,2,1,28,1725436573842136496999949450566182323936589234862045025185675257823232,[0,3249193721510,3777237817747,4152065280295,4393612879073,4790119961719,5102849803966,5468138726397,5967825740125,6716608936534,7029338778781,7650401438067,7994349440529,8359638362960,8724927285391,10090803564687,10590490578415,12497477505178,12997164518906,13462488166926,13827777089357,14193066011788,14692753025516,15388977141741,15754266064172,16353987803489,16719276725920,17084565648351,17449854570782],[1000000000000000000000000000000,3249193721510,3777237817747,4152065280295,4393612879073,4790119961719,5102849803966,5468138726397,5967825740125,6716608936534,7029338778781,7650401438067,7994349440529,8359638362960,8724927285391,10090803564687,10590490578415,14306803392802,14619533235049,14999354610184,15312084452431,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr6 : Row := ⟨6,2,1,30,1725015324675462220362672081789483245120996129535018132130068314914816,[0,3249193721510,3777237817747,4152065280295,4393612879073,4790119961719,5102849803966,5468138726397,5967825740125,6716608936534,7029338778781,7650401438067,7994349440529,8359638362960,8724927285391,9224614299119,10590490578415,12497477505178,12997164518906,13462488166926,13827777089357,14193066011788,14692753025516,15192440039244,15754266064172,16253953077900,16719276725920,17084565648351,17449854570782,17949541584510,18449228598238],[1000000000000000000000000000000,3249193721510,3777237817747,4152065280295,4393612879073,4790119961719,5102849803966,5468138726397,5967825740125,6716608936534,7029338778781,7650401438067,7994349440529,8359638362960,8724927285391,9224614299119,10590490578415,14306803392802,14619533235049,14999354610184,15312084452431,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr7 : Row := ⟨7,2,2,18,1725429991823894950618280102410716233792959863254033303260316540338176,[0,1651379200003,2229529154889,2590215514780,2864251953661,3453180261922,3660589497592,4408943401400,4714431605571,5341554015345,6290086032059,7113769759514,7321178995184,8069532898992,8375021103163,9002143512937,9428863211142,10055985620916,10683108030690],[1000000000000000000000000000000,1651379200003,2229529154889,2590215514780,2864251953661,3453180261922,3660589497592,4408943401400,4714431605571,5341554015345,6290086032059,7373341416771,7863830039919,8176559882166,8485441467257,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr8 : Row := ⟨8,2,2,20,1725436573842136449106449451380146306440222793220369896478428312371200,[0,1651379200003,2229529154889,2590215514780,2844296956556,3327627587212,3660589497592,4145916326303,4576779327932,5226063447850,5538793290097,6544726354365,6888674356827,7806505823895,8237368825524,8722695654235,9153558655864,9684709616400,10115572618029,10764856737947,11077586580194],[1000000000000000000000000000000,1651379200003,2229529154889,2590215514780,2844296956556,3327627587212,3660589497592,4145916326303,4576779327932,5226063447850,5538793290097,6544726354365,6888674356827,8176559882166,8485441467257,8985128480985,9484815494713,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr9 : Row := ⟨9,2,2,22,1725436573842135874423635973797346292484320015926037067947319207395328,[0,1651379200003,2229529154889,2590215514780,2844296956556,3224118331691,3536848173938,3989574549686,4489261563414,5226063447850,5538793290097,5930595977206,6888674356827,7253963279258,7619252201689,8478836113100,8978523126828,9467444151144,9920170526892,10419857540620,11077586580194,11469389267303,11861191954412],[1000000000000000000000000000000,1651379200003,2229529154889,2590215514780,2844296956556,3224118331691,3536848173938,3989574549686,4489261563414,5226063447850,5538793290097,5930595977206,6888674356827,7253963279258,7619252201689,8985128480985,9484815494713,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr10 : Row := ⟨10,2,2,24,1725436573842136449109463797452115421265356903594975184230350592147456,[0,1651379200003,2229529154889,2590215514780,2844296956556,3224118331691,3536848173938,3989574549686,4489261563414,5226063447850,5538793290097,5930595977206,6888674356827,7253963279258,7619252201689,8118939215417,8978523126828,9467444151144,9920170526892,10419857540620,11077586580194,11469389267303,11861191954412,12608200778831,13158045491786],[1000000000000000000000000000000,1651379200003,2229529154889,2590215514780,2844296956556,3224118331691,3536848173938,3989574549686,4489261563414,5226063447850,5538793290097,5930595977206,6888674356827,7253963279258,7619252201689,8118939215417,9484815494713,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr11 : Row := ⟨11,3,1,8,1724665551259309023959167626008348319961715277350436801067566493597696,[0,3113530662322,3507316662517,3823223829287,4043710950281,4951980064835,5458179828327,7866934779568,8087421900562],[1000000000000000000000000000000,3113530662322,3507316662517,3823223829287,4043710950281,4951980064835,5458179828327,10211899715556,10453447314334]⟩ +def gbr12 : Row := ⟨12,3,1,10,1725015324675462182851678330511975086674439558869577858681712161062912,[0,3113530662322,3507316662517,3823223829287,4043710950281,4608013236053,5044484401954,6123030944604,6480862205542,8651724186334,9088195352235],[1000000000000000000000000000000,3113530662322,3507316662517,3823223829287,4043710950281,4608013236053,5044484401954,6123030944604,6480862205542,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr13 : Row := ⟨13,3,1,11,1725008742657232706465568507346084986831539491448450406198920678998016,[0,3113530662322,3507316662517,3823223829287,4043710950281,4608013236053,5044484401954,6123030944604,6480862205542,8651724186334,9088195352235,9652497638007],[1000000000000000000000000000000,3113530662322,3507316662517,3823223829287,4043710950281,4608013236053,5044484401954,6123030944604,6480862205542,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr14 : Row := ⟨14,3,1,12,1725436573842136456589383505393830850254954330535398785531668154286080,[0,3113530662322,3507316662517,3802163351503,4043710950281,4608013236053,4920743078300,5625391976930,6480862205542,7767677278717,8060204114968,9528756314353,9841486156600],[1000000000000000000000000000000,3113530662322,3507316662517,3802163351503,4043710950281,4608013236053,4920743078300,5625391976930,6480862205542,7767677278717,8060204114968,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr15 : Row := ⟨15,3,1,13,1725436573842136212647130871363085760565117322918546857094666522722304,[0,3113530662322,3700921223730,3995767912716,4228191860918,4608013236053,4920743078300,5625391976930,6480862205542,7767677278717,8060204114968,9528756314353,9841486156600,10546135055230],[1000000000000000000000000000000,3113530662322,3700921223730,3995767912716,4228191860918,4608013236053,4920743078300,5625391976930,6480862205542,7767677278717,8060204114968,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr16 : Row := ⟨16,3,1,14,1725436573842136461082085210825013918548383579434705192576838979813376,[0,3113530662322,3507316662517,3802163351503,4043710950281,4567247947618,4900209857998,5287512871760,5857815925132,6840938009743,8060204114968,9331223822041,9800419715996,10187722729758,10575025743520],[1000000000000000000000000000000,3113530662322,3507316662517,3802163351503,4043710950281,4567247947618,4900209857998,5287512871760,5857815925132,6840938009743,8060204114968,11361934091866,11571154678592,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr17 : Row := ⟨17,3,1,15,1725436573842136461082085210825013918548373661407244180670942271242240,[0,3113530662322,3507316662517,3802163351503,4043710950281,4567247947618,4900209857998,5287512871760,5857815925132,6840938009743,7102347855980,9331223822041,9800419715996,10187722729758,10575025743520,11145328796892],[1000000000000000000000000000000,3113530662322,3507316662517,3802163351503,4043710950281,4567247947618,4900209857998,5287512871760,5857815925132,6840938009743,7102347855980,11361934091866,11571154678592,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr18 : Row := ⟨18,3,1,16,1725436573842136458088927003767307364525301676655395407645176997347328,[0,3113530662322,3507316662517,3802163351503,4043710950281,4567247947618,4776468534344,5247306505080,5488854103858,6840938009743,7102347855980,8372933957215,9532565054139,10023775039424,10265322638202,10736160608938,10977708207716],[1000000000000000000000000000000,3113530662322,3507316662517,3802163351503,4043710950281,4567247947618,4776468534344,5247306505080,5488854103858,6840938009743,7102347855980,8372933957215,11571154678592,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr19 : Row := ⟨19,3,1,17,1725436573842136212650188036964751983929217180609891469519930766917632,[0,3113530662322,3700921223730,3995767912716,4228191860918,4608013236053,4920743078300,5625391976930,5857815925132,6237637300267,7102347855980,8372933957215,8685663799462,10465829161185,10778559003432,11158380378567,11715631850264,12095453225399],[1000000000000000000000000000000,3113530662322,3700921223730,3995767912716,4228191860918,4608013236053,4920743078300,5625391976930,5857815925132,6237637300267,7102347855980,8372933957215,8685663799462,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr20 : Row := ⟨20,3,1,18,1725436573842087364354822892145008391131027892872137172767700458405888,[0,3113530662322,3700921223730,3995767912716,4228191860918,4608013236053,4920743078300,5625391976930,5857815925132,6237637300267,6550367142514,8372933957215,8685663799462,10465829161185,10778559003432,11158380378567,11471110220814,12095453225399,12408183067646],[1000000000000000000000000000000,3113530662322,3700921223730,3995767912716,4228191860918,4608013236053,4920743078300,5625391976930,5857815925132,6237637300267,6550367142514,8372933957215,8685663799462,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr21 : Row := ⟨21,3,1,19,1725015324675406047815971936975081915591629661211475837569764750786560,[0,3113530662322,3700921223730,3995767912716,4228191860918,4608013236053,4920743078300,5625391976930,5857815925132,6237637300267,6550367142514,8372933957215,8685663799462,10465829161185,10778559003432,11158380378567,11471110220814,12095453225399,12408183067646,12788004442781],[1000000000000000000000000000000,3113530662322,3700921223730,3995767912716,4228191860918,4608013236053,4920743078300,5625391976930,5857815925132,6237637300267,6550367142514,8372933957215,8685663799462,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr22 : Row := ⟨22,3,1,20,1291727644945858549761499930060666410898826548798041813746238686756864,[0,3113530662322,3700921223730,3995767912716,4228191860918,4608013236053,4920743078300,5625391976930,5857815925132,6317943194312,6550367142514,8476443212736,8685663799462,10465829161185,10778559003432,11158380378567,11471110220814,12175759119444,12408183067646,12868310336826,13100734285028],[1000000000000000000000000000000,3113530662322,3700921223730,3995767912716,4228191860918,4608013236053,4920743078300,5625391976930,5857815925132,6317943194312,6550367142514,8476443212736,8685663799462,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr23 : Row := ⟨23,3,2,6,1724797191619175975297343553089215692387588540281254256104103743586304,[0,1556765331161,2078963056690,2690043896662,2938031613142,3412238593222,4941788811737],[1000000000000000000000000000000,1556765331161,2078963056690,2690043896662,2938031613142,3412238593222,4941788811737]⟩ +def gbr24 : Row := ⟨24,3,2,7,1724797191622311652735897769930209714542452753805723716393404630827008,[0,1556765331161,2078963056690,2394870223460,2744427051929,3412238593222,4158895929975,5139297275389],[1000000000000000000000000000000,1556765331161,2078963056690,2394870223460,2744427051929,3412238593222,4158895929975,5871286453510]⟩ +def gbr25 : Row := ⟨25,3,2,8,1725015323871993165913391303162760336592071943928683259895811133145088,[0,1556765331161,2078963056690,2373809745676,2615357344454,3308729337701,3745200503602,4989167090130,5230714688908],[1000000000000000000000000000000,1556765331161,2078963056690,2373809745676,2615357344454,3308729337701,3745200503602,5822145338680,5956475959644]⟩ +def gbr26 : Row := ⟨26,3,2,9,1725436573038667209084596745471251349607076882312760220776945885904896,[0,1556765331161,2078963056690,2394870223460,2744427051929,3308729337701,3621459179948,4326108078578,5488854103858,6016329403408],[1000000000000000000000000000000,1556765331161,2078963056690,2394870223460,2744427051929,3308729337701,3621459179948,4326108078578,6175866544114,1000000000000000000000000000000]⟩ +def gbr27 : Row := ⟨27,3,2,10,1725436573842136495503280429037541542316120011854259919972113443717120,[0,1556765331161,2078963056690,2373809745676,2615357344454,3153488904014,3621459179948,4326108078578,4558532026780,5768846248468,6236816524402],[1000000000000000000000000000000,1556765331161,2078963056690,2373809745676,2615357344454,3153488904014,3621459179948,4326108078578,4558532026780,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr28 : Row := ⟨28,3,2,11,1725436573842136495503371773238334168992674498805312607334012028977152,[0,1556765331161,2078963056690,2373809745676,2615357344454,3153488904014,3536848173938,4326108078578,4558532026780,5768846248468,6152205518392,6690337077952],[1000000000000000000000000000000,1556765331161,2078963056690,2373809745676,2615357344454,3153488904014,3536848173938,4326108078578,4558532026780,6571902635886,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr29 : Row := ⟨29,3,2,12,1725436573842136496999949450566182033085877348056804696181482622812160,[0,1556765331161,2078963056690,2373809745676,2615357344454,3136478857655,3435242869472,4326108078578,4558532026780,5541654111391,6050600213926,6571721727127,6870485738944],[1000000000000000000000000000000,1556765331161,2078963056690,2373809745676,2615357344454,3136478857655,3435242869472,4326108078578,4558532026780,5541654111391,6760920216616,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr30 : Row := ⟨30,3,2,13,1725436573842136257547521190271047582287474783619737795531825815224320,[0,1556765331161,2078963056690,2373809745676,2615357344454,3136478857655,3435242869472,3988228973408,4558532026780,4938353401915,5803063957628,6571721727127,6870485738944,7423471842880],[1000000000000000000000000000000,1556765331161,2078963056690,2373809745676,2615357344454,3136478857655,3435242869472,3988228973408,4558532026780,4938353401915,5803063957628,7073650058863,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr31 : Row := ⟨31,3,2,14,1725436573842136449109463798501708033142884011668502545689700928061440,[0,1556765331161,2078963056690,2373809745676,2615357344454,3068271764440,3381001606687,3689883191778,4189570205506,4938353401915,5251083244162,6305240536232,6758154956218,7070884798465,7379766383556],[1000000000000000000000000000000,1556765331161,2078963056690,2373809745676,2615357344454,3068271764440,3381001606687,3689883191778,4189570205506,4938353401915,5251083244162,7073650058863,7386379901110,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr32 : Row := ⟨32,3,2,15,1725436573842136257547521190265525304658189638216171958347066448543744,[0,1556765331161,2078963056690,2373809745676,2615357344454,3068271764440,3381001606687,3689883191778,4189570205506,4938353401915,5251083244162,6305240536232,6758154956218,7070884798465,7379766383556,7879453397284],[1000000000000000000000000000000,1556765331161,2078963056690,2373809745676,2615357344454,3068271764440,3381001606687,3689883191778,4189570205506,4938353401915,5251083244162,7073650058863,7386379901110,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr33 : Row := ⟨33,3,2,16,1725436573842122640686100788618991433673919456044545315668613671157760,[0,1556765331161,2078963056690,2373809745676,2615357344454,3136478857655,3435242869472,3948022606728,4189570205506,5018659295960,5251083244162,6563379951182,6804927549960,7326049063161,7624813074978,8137592812234,8379140411012],[1000000000000000000000000000000,1556765331161,2078963056690,2373809745676,2615357344454,3136478857655,3435242869472,3948022606728,4189570205506,5018659295960,5251083244162,7177159314384,7386379901110,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr34 : Row := ⟨34,3,3,4,998362378030908667417563943951657574248149882886323660759697125801984,[0,1037843554107,1641458857908,2628420839518,2869968438296],[1000000000000000000000000000000,1037843554107,1641458857908,2628420839518,2869968438296]⟩ +def gbr35 : Row := ⟨35,3,3,6,1724981481704708208044660068023339766542834044167370048694556171436032,[0,1037843554107,1596681984252,2090845298151,2311332419145,3219601533699,3725801297191],[1000000000000000000000000000000,1037843554107,1596681984252,2090845298151,2311332419145,3219601533699,3725801297191]⟩ +def gbr36 : Row := ⟨36,3,3,7,1724138983421241331034605756681957787456231791428861707420782005583872,[0,1037843554107,1580541899904,1940715112892,2182262711670,3219601533699,3552563444079,4122977824562],[1000000000000000000000000000000,1037843554107,1580541899904,1940715112892,2182262711670,3219601533699,3552563444079,4270401169057]⟩ +def gbr37 : Row := ⟨37,3,3,8,1725429991823889729807055189047416851244024546099647768003257277874176,[0,1037843554107,1565887650344,1940715112892,2182262711670,2820291390533,3015240960217,3893013445794,4364525423340],[1000000000000000000000000000000,1037843554107,1565887650344,1940715112892,2182262711670,2820291390533,3015240960217,3893013445794,4364525423341]⟩ +def gbr38 : Row := ⟨38,3,3,9,1725436573841695280455999333928870854608338608384770828651301510840320,[0,1037843554107,1596681984252,1940715112892,2182262711670,2720394271230,3015240960217,3893013445794,4125437393996,4902656982900],[1000000000000000000000000000000,1037843554107,1596681984252,1940715112892,2182262711670,2720394271230,3015240960217,3893013445794,4125437393996,1000000000000000000000000000000]⟩ +def gbr39 : Row := ⟨39,3,3,10,1725436573842136449106449450238002792127553429092823763083365506351104,[0,1037843554107,1565887650344,1940715112892,2182262711670,2682279049837,3002148236688,3555134340624,4125437393996,4864541761507,5184410948358],[1000000000000000000000000000000,1037843554107,1565887650344,1940715112892,2182262711670,2682279049837,3002148236688,3555134340624,4125437393996,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr40 : Row := ⟨40,3,3,11,1725436573842136257544506842001895497007111257582165228278559818121216,[0,1037843554107,1565887650344,1940715112892,2182262711670,2682279049837,3002148236688,3555134340624,4125437393996,4864541761507,5184410948358,5684427286525],[1000000000000000000000000000000,1037843554107,1565887650344,1940715112892,2182262711670,2682279049837,3002148236688,3555134340624,4125437393996,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr41 : Row := ⟨41,3,3,12,1725436573842122081963765325226559189160748860002050336828123661729792,[0,1037843554107,1565887650344,1940715112892,2182262711670,2578769794316,2891499636563,3256788558994,3756475572722,4761032505986,5073762348233,5439051270664,5782999273126],[1000000000000000000000000000000,1037843554107,1565887650344,1940715112892,2182262711670,2578769794316,2891499636563,3256788558994,3756475572722,5108559478607,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr42 : Row := ⟨42,3,3,13,1725436573842063080885441988494453214577201261746743827380562359746560,[0,1037843554107,1596681984252,1940715112892,2182262711670,2578769794316,2891499636563,3256788558994,3756475572722,4505258769131,5073762348233,5439051270664,5782999273126,6148288195557],[1000000000000000000000000000000,1037843554107,1596681984252,1940715112892,2182262711670,2578769794316,2891499636563,3256788558994,3756475572722,4505258769131,5369969324844,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr43 : Row := ⟨43,3,3,14,1725436573842063080885441943892962817510849559210789463157620997095424,[0,1037843554107,1596681984252,1940715112892,2182262711670,2578769794316,2891499636563,3256788558994,3756475572722,4505258769131,4817988611378,5439051270664,5782999273126,6148288195557,6513577117988],[1000000000000000000000000000000,1037843554107,1596681984252,1940715112892,2182262711670,2578769794316,2891499636563,3256788558994,3756475572722,4505258769131,4817988611378,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr44 : Row := ⟨44,3,3,15,1724172826341819715286999461175918587779858331707613093632601481019392,[0,1037843554107,1596681984252,1940715112892,2182262711670,2578769794316,2891499636563,3256788558994,3756475572722,4505258769131,4817988611378,5439051270664,5782999273126,6148288195557,6513577117988,7013264131716],[1000000000000000000000000000000,1037843554107,1596681984252,1940715112892,2182262711670,2578769794316,2891499636563,3256788558994,3756475572722,4505258769131,4817988611378,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr45 : Row := ⟨45,3,4,3,0,[0,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000],[1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr46 : Row := ⟨46,3,4,4,1217425111951842417774445728977741092036181853561627783630929375789056,[0,778382665580,1257960267624,2036342933204,2328596030646],[1000000000000000000000000000000,778382665580,1257960267624,2046842065188,2328596030646]⟩ +def gbr47 : Row := ⟨47,3,4,5,1711949085610381755412222851521837156972125571415050677602692446027776,[0,778382665580,1231094143430,1722021090600,1953640320030,2732022985610],[1000000000000000000000000000000,778382665580,1231094143430,1722021090600,1953640320030,2762596644046]⟩ +def gbr48 : Row := ⟨48,3,4,6,1725429065421940265757606742932447172469589048670815814814747959754752,[0,778382665580,1231094143430,1696456911988,1904499205200,2659087388525,3095558554426],[1000000000000000000000000000000,778382665580,1231094143430,1696456911988,1904499205200,2659087388525,3095558554426]⟩ +def gbr49 : Row := ⟨49,3,4,7,1725429991822320455121495916335180487343313814483030917651236384669696,[0,778382665580,1231094143430,1640882207696,1864292838520,2497617121846,2865804544642,3440920595338],[1000000000000000000000000000000,778382665580,1231094143430,1640882207696,1864292838520,2497617121846,2865804544642,3440920595338]⟩ +def gbr50 : Row := ⟨50,3,4,8,1725436573840551274031366283120767677749667998792781161351064554831872,[0,778382665580,1231094143430,1622745239742,1864292838520,2359604781150,2692566691530,3338587024232,3608756521870],[1000000000000000000000000000000,778382665580,1231094143430,1622745239742,1864292838520,2359604781150,2692566691530,3338587024232,3608756521870]⟩ +def gbr51 : Row := ⟨51,3,4,9,1725436573038666469167241256029755228080650314063368332893797113397248,[0,778382665580,1231094143430,1622745239742,1876274150494,2359604781150,2692566691530,3338587024232,3752548300988,4235878931644],[1000000000000000000000000000000,778382665580,1231094143430,1622745239742,1876274150494,2359604781150,2692566691530,3338587024232,3908890077604,1000000000000000000000000000000]⟩ +def gbr52 : Row := ⟨52,3,4,10,1725436573842078405840852706019897410967521518242578966598401317142528,[0,778382665580,1231094143430,1622745239742,1864292838520,2256095525629,2568825367876,3040241242602,3539928256330,4120388364149,4433118206396],[1000000000000000000000000000000,778382665580,1231094143430,1622745239742,1864292838520,2256095525629,2568825367876,3040241242602,3539928256330,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr53 : Row := ⟨53,3,4,11,1725436573838041812586162001054180667492084376406608905998688462045184,[0,778382665580,1231094143430,1622745239742,1864292838520,2256095525629,2568825367876,3040241242602,3539928256330,4120388364149,4433118206396,4824920893505],[1000000000000000000000000000000,778382665580,1231094143430,1622745239742,1864292838520,2256095525629,2568825367876,3040241242602,3539928256330,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr54 : Row := ⟨54,3,4,12,0,[0,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000],[1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr55 : Row := ⟨55,4,1,4,1239316981823147026693528510288703429715336109433268712656357466046464,[0,2885490879130,3476671573311,3879742777496,4165276828708],[1000000000000000000000000000000,2885490879130,3476671573311,3879742777496,4165276828708]⟩ +def gbr56 : Row := ⟨56,4,1,6,1293306507428935343466857220948700212742576373845571467526529213267968,[0,2885490879130,3476671573311,3685892160037,3927439758815,5288594318994,5566946088318],[1000000000000000000000000000000,2885490879130,3476671573311,3685892160037,3927439758815,5288594318994,5566946088318]⟩ +def gbr57 : Row := ⟨57,4,1,7,1724599724699482344649655364594831117126166680771311008975668048297984,[0,2885490879130,3476671573311,3685892160037,3927439758815,5288594318994,5566946088318,7613331918852],[1000000000000000000000000000000,2885490879130,3476671573311,3685892160037,3927439758815,5288594318994,5566946088318,1000000000000000000000000000000]⟩ +def gbr58 : Row := ⟨58,4,1,8,1724771790000978681898069229841887291366171795481021025178423406886912,[0,2885490879130,3375149334818,3685892160037,3927439758815,4595642906538,4783272617710,7613331918852,7854879517630],[1000000000000000000000000000000,2885490879130,3375149334818,3685892160037,3927439758815,4595642906538,4783272617710,9468440632050,9602771253014]⟩ +def gbr59 : Row := ⟨59,4,1,9,1724982414584315796247709864866371727767131019039862766286710507569152,[0,2885490879130,3476671573311,3685892160037,3927439758815,4595642906538,4783272617710,7613331918852,7854879517630,8469164777747],[1000000000000000000000000000000,2885490879130,3476671573311,3685892160037,3927439758815,4595642906538,4783272617710,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr60 : Row := ⟨60,4,1,10,1724988996602496041214622243614292945787687068082977602629261116571648,[0,2885490879130,3476671573311,3685892160037,3927439758815,4277072854218,4783272617710,5824988606758,5959319227722,8204512613033,8554145708436],[1000000000000000000000000000000,2885490879130,3476671573311,3685892160037,3927439758815,4277072854218,4783272617710,5824988606758,5959319227722,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr61 : Row := ⟨61,4,1,11,1724607213834181677586631354307764152730358194266699354200462552203264,[0,2885490879130,3476671573311,3685892160037,3927439758815,4277072854218,4610034764598,5824988606758,5959319227722,8204512613033,8537474523413,8887107618816],[1000000000000000000000000000000,2885490879130,3476671573311,3685892160037,3927439758815,4277072854218,4610034764598,5824988606758,5959319227722,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr62 : Row := ⟨62,4,1,12,1724605360927892125009436352783555288042517265488812713331387059404800,[0,2885490879130,3476671573311,3685892160037,3927439758815,4277072854218,4486293440944,5824988606758,5959319227722,8172185600981,8413733199759,8763366295162,8972586881888],[1000000000000000000000000000000,2885490879130,3476671573311,3685892160037,3927439758815,4277072854218,4486293440944,5824988606758,5959319227722,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr63 : Row := ⟨63,4,2,2,1657209653241867727754277428799190269559553157320145843044180880785408,[0,1442745439565,2097242357282],[1000000000000000000000000000000,1442745439565,2097242357282]⟩ +def gbr64 : Row := ⟨64,4,2,3,1670689703910324887239382332531820263817647415964050393636211093667840,[0,1442745439565,2033926133746,2326077860083],[1000000000000000000000000000000,1442745439565,2033926133746,2326077860083]⟩ +def gbr65 : Row := ⟨65,4,2,4,1724665551256172196738972296447320190686788868115340450817012374962176,[0,1442745439565,1976819874594,2326077860083,2546564981077],[1000000000000000000000000000000,1442745439565,1976819874594,2326077860083,2546564981077]⟩ +def gbr66 : Row := ⟨66,4,2,5,1724798117217071194839542966803644998336291209630814422947367143604224,[0,1442745439565,1976819874594,2196743724103,2546564981077,3412754246645],[1000000000000000000000000000000,1442745439565,1976819874594,2196743724103,2546564981077,3412754246645]⟩ +def gbr67 : Row := ⟨67,4,2,6,1724798118073895821173737500282617106276083350308934662539976195964928,[0,1442745439565,1976819874594,2196743724103,2438291322881,3152897466973,3642504913385],[1000000000000000000000000000000,1442745439565,1976819874594,2196743724103,2438291322881,3152897466973,3642504913385]⟩ +def gbr68 : Row := ⟨68,4,2,7,1725015324675462220768831137498766641192409365134159272047907025453056,[0,1442745439565,1896871111781,2196743724103,2438291322881,2972339755349,3340527178145,4635035046984],[1000000000000000000000000000000,1442745439565,1896871111781,2196743724103,2438291322881,2972339755349,3340527178145,5377986280951]⟩ +def gbr69 : Row := ⟨69,4,2,8,1725436573842136449515438650050132237783285280392032879505793752236032,[0,1442745439565,1896871111781,2196743724103,2438291322881,2972339755349,3167289325033,4610034764598,4876582645762],[1000000000000000000000000000000,1442745439565,1896871111781,2196743724103,2438291322881,2972339755349,3167289325033,5328845166121,5463175787085]⟩ +def gbr70 : Row := ⟨70,4,2,9,1725436573842136209665527526069248486331124894378292911854357533687808,[0,1442745439565,1976819874594,2196743724103,2438291322881,2834327414653,3167289325033,3915643228841,4876582645762,5272618737534],[1000000000000000000000000000000,1442745439565,1976819874594,2196743724103,2438291322881,2834327414653,3167289325033,3915643228841,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr71 : Row := ⟨71,4,2,10,1725436573842136401230393135470115380059572703949939830154224801415168,[0,1442745439565,1976819874594,2196743724103,2438291322881,2730818159132,3167289325033,3915643228841,4083479155373,5169109482013,5461636318264],[1000000000000000000000000000000,1442745439565,1976819874594,2196743724103,2438291322881,2730818159132,3167289325033,3915643228841,4083479155373,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr72 : Row := ⟨72,4,2,11,1724646705943459306822234965357863655674844939633377566875201763803136,[0,1442745439565,1976819874594,2196743724103,2438291322881,2730818159132,3043548001379,3915643228841,4083479155373,5169109482013,5461636318264,5774366160511],[1000000000000000000000000000000,1442745439565,1976819874594,2196743724103,2438291322881,2730818159132,3043548001379,3915643228841,4083479155373,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr73 : Row := ⟨73,4,2,12,1722946692333229248764981672107714498145507701326248865345787811332096,[0,1442745439565,1976819874594,2196743724103,2438291322881,2834327414653,3043548001379,3949148534409,4083479155373,5240291725482,5481839324260,5877875416032,6087096002758],[1000000000000000000000000000000,1442745439565,1976819874594,2196743724103,2438291322881,2834327414653,3043548001379,3949148534409,4083479155373,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr74 : Row := ⟨74,4,3,2,1653829864215765078349203098538676163514551658653302879285521814650880,[0,961830293043,1469804569369],[1000000000000000000000000000000,961830293043,1469804569369]⟩ +def gbr75 : Row := ⟨75,4,3,3,1656357359215864854421665288239140158184582560514623040981482828988416,[0,961830293043,1451893819907,1762231573950],[1000000000000000000000000000000,961830293043,1451893819907,1762231573950]⟩ +def gbr76 : Row := ⟨76,4,3,4,1724770857123213191661187996747302388710358999420241830932328847769600,[0,961830293043,1425027695713,1762231573950,2003779172728],[1000000000000000000000000000000,961830293043,1425027695713,1762231573950,2003779172728]⟩ +def gbr77 : Row := ⟨77,4,3,5,1724988995745286375412850804557021486473316662175488330656117929541632,[0,961830293043,1425027695713,1719874384699,2003779172728,2965609465771],[1000000000000000000000000000000,961830293043,1425027695713,1719874384699,2003779172728,1000000000000000000000000000000]⟩ +def gbr78 : Row := ⟨78,4,3,6,1724988996602545042805252797250692691045772948673089297444616311668736,[0,961830293043,1399095562506,1700797835966,1961421983477,2353412268131,2859612031623],[1000000000000000000000000000000,961830293043,1399095562506,1700797835966,1961421983477,2353412268131,2859612031623]⟩ +def gbr79 : Row := ⟨79,4,3,7,1724988996602544851338309222853525992781114460921175422697902822129664,[0,961830293043,1399095562506,1679737358182,1941147204419,2353412268131,2686374178511,3620884562601],[1000000000000000000000000000000,961830293043,1399095562506,1679737358182,1941147204419,2353412268131,2686374178511,3941534387351]⟩ +def gbr80 : Row := ⟨80,4,3,8,1724988996602531247248370930036307042612179883724104712883056278503424,[0,961830293043,1399095562506,1679737358182,1941147204419,2353412268131,2562632854857,3524463147900,3882294408838],[1000000000000000000000000000000,961830293043,1399095562506,1679737358182,1941147204419,2353412268131,2562632854857,3901328020671,4035658641635]⟩ +def gbr81 : Row := ⟨81,4,3,9,1724988996601588947668470689708921509844255690125611938086509212598272,[0,961830293043,1425027695713,1679737358182,1941147204419,2353412268131,2562632854857,3524463147900,3882294408838,4242370213039],[1000000000000000000000000000000,961830293043,1425027695713,1679737358182,1941147204419,2353412268131,2562632854857,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr82 : Row := ⟨82,4,3,10,1723303999934695873204516371103176940114976684751502084778490427604992,[0,961830293043,1425027695713,1679737358182,1941147204419,2353412268131,2562632854857,3524463147900,3882294408838,4242370213039,4503780059276],[1000000000000000000000000000000,961830293043,1425027695713,1679737358182,1941147204419,2353412268131,2562632854857,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr83 : Row := ⟨83,4,4,1,1652996772683465680177557579065700088316417642379738466562555881979904,[0,721372719782],[1000000000000000000000000000000,721372719782]⟩ +def gbr84 : Row := ⟨84,4,4,2,1670877291429661812815476363931486076365867370696622508504321034813440,[0,721372719782,1114565301660],[1000000000000000000000000000000,721372719782,1114565301660]⟩ +def gbr85 : Row := ⟨85,4,4,3,1725007816203674529354605507025318698522806696333083685609561443532800,[0,721372719782,1102353427026,1470911788258],[1000000000000000000000000000000,721372719782,1102353427026,1470911788258]⟩ +def gbr86 : Row := ⟨86,4,4,4,1725015323871980902955908308906566683699909250269833413292692613365760,[0,721372719782,1102353427026,1397200116012,1678954081470],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1678954081470]⟩ +def gbr87 : Row := ⟨87,4,4,5,1725436573842136226022838078417684694330497254121867829285424767959040,[0,721372719782,1102353427026,1397200116012,1638747714790,2112954694870],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1638747714790,2112954694870]⟩ +def gbr88 : Row := ⟨88,4,4,6,1725436573842136257547429845362478598467268773511614090693544641560576,[0,721372719782,1102353427026,1397200116012,1629624064214,2009445439349,2445916605250],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1629624064214,2009445439349,2445916605250]⟩ +def gbr89 : Row := ⟨89,4,4,7,1725436573842136257547521188158575312977063513223344076914064608985088,[0,721372719782,1102353427026,1397200116012,1629624064214,2009445439349,2322175281596,3026824180226],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1629624064214,2009445439349,2322175281596,3194270509058]⟩ +def gbr90 : Row := ⟨90,4,4,8,1725436573842066513835685033601645491242898389591000490536156667052032,[0,721372719782,1102353427026,1397200116012,1629624064214,2009445439349,2322175281596,3026824180226,3259248128428],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1629624064214,2009445439349,2322175281596,3227775814626,3362106435590]⟩ +def gbr91 : Row := ⟨91,4,4,9,1722909078734203536619517881827344946293541769869686838314199173562368,[0,721372719782,1102353427026,1397200116012,1629624064214,2009445439349,2322175281596,3026824180226,3259248128428,3639069503563],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1629624064214,2009445439349,2322175281596,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr92 : Row := ⟨92,4,4,10,1716169091852425141435088852236724043577941223290227711096793375703040,[0,721372719782,1102353427026,1397200116012,1629624064214,2112954694870,2322175281596,3026824180226,3259248128428,3719375397608,3951799345810],[1000000000000000000000000000000,721372719782,1102353427026,1397200116012,1629624064214,2112954694870,2322175281596,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr93 : Row := ⟨93,4,5,2,1220847838564979176479569252607127231657536889195429319619070096572416,[0,577098175826,953525739469],[1000000000000000000000000000000,577098175826,953525739469]⟩ +def gbr94 : Row := ⟨94,4,5,3,1724138983367772555627460989543758557592359108128053136223854682701824,[0,577098175826,908748865813,1310812532613],[1000000000000000000000000000000,577098175826,908748865813,1310812532613]⟩ +def gbr95 : Row := ⟨95,4,5,4,1724982414155665836171579288444025490833843043768833864449683389153280,[0,577098175826,908748865813,1224656032583,1445143153577],[1000000000000000000000000000000,577098175826,908748865813,1224656032583,1445143153577]⟩ +def gbr96 : Row := ⟨96,4,5,5,1724988995744347731577246642412515358398450033233404779897166013399040,[0,577098175826,908748865813,1203595554799,1556415087202,2112344420612],[1000000000000000000000000000000,577098175826,908748865813,1203595554799,1556415087202,1000000000000000000000000000000]⟩ +def gbr97 : Row := ⟨97,4,5,6,1724988995748785835471480418824204757774043736334929493589374456037376,[0,577098175826,908748865813,1203595554799,1534490635087,2111588810913,2407191109598],[1000000000000000000000000000000,577098175826,908748865813,1203595554799,1534490635087,2287250203234,2474879914406]⟩ +def gbr98 : Row := ⟨98,4,5,7,1724146471752757452390714399458108489094238941601554986413362591563776,[0,577098175826,908748865813,1203595554799,1485349520257,1968680150914,2301642061294,2688945075056],[1000000000000000000000000000000,577098175826,908748865813,1203595554799,1485349520257,1968680150914,2301642061294,1000000000000000000000000000000]⟩ +def gbr99 : Row := ⟨99,4,5,8,1720776477078025442084861927323261590543872593788115347628848702291968,[0,577098175826,908748865813,1203595554799,1445143153577,1968680150914,2177900737640,2648738708376,2890286307154],[1000000000000000000000000000000,577098175826,908748865813,1203595554799,1445143153577,1968680150914,2177900737640,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr100 : Row := ⟨100,4,6,1,1653154741020485848532871223618558363173908517733387401430128689938432,[0,480915146521],[1000000000000000000000000000000,480915146521]⟩ +def gbr101 : Row := ⟨101,4,6,2,1711527836013669720619157512792911780928988661216424104463838847434752,[0,480915146521,779679158338],[1000000000000000000000000000000,480915146521,779679158338]⟩ +def gbr102 : Row := ⟨102,4,6,3,1725429990964883811577620967393716633027783442393098501486389437136896,[0,480915146521,779679158338,1095586325108],[1000000000000000000000000000000,480915146521,779679158338,1095586325108]⟩ +def gbr103 : Row := ⟨103,4,6,4,1725436573841459276142700725211995427570382209072624187129862115295232,[0,480915146521,779679158338,1074525847324,1316073446102],[1000000000000000000000000000000,480915146521,779679158338,1074525847324,1316073446102]⟩ +def gbr104 : Row := ⟨104,4,6,5,1725436572887845537388989471885885425104782879842991970950338597355520,[0,480915146521,779679158338,1074525847324,1389166490953,1854205005662],[1000000000000000000000000000000,480915146521,779679158338,1074525847324,1389166490953,2010509462305]⟩ +def gbr105 : Row := ⟨105,4,6,6,1725436573031409719458399527908506746479372275175274555290329492226048,[0,480915146521,779679158338,1074525847324,1356279812782,1837194959303,2135958971120],[1000000000000000000000000000000,480915146521,779679158338,1074525847324,1356279812782,1872497121609,2205459031989]⟩ +def gbr106 : Row := ⟨106,4,6,7,1721224055912000688755552777459026530638507064502999122273681698455552,[0,480915146521,779679158338,1074525847324,1316073446102,1768987866088,2081717708335,2390599293426],[1000000000000000000000000000000,480915146521,779679158338,1074525847324,1316073446102,1768987866088,2081717708335,1000000000000000000000000000000]⟩ +def gbr107 : Row := ⟨107,4,6,8,0,[0,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000],[1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr108 : Row := ⟨108,4,7,2,1652526597180825727144528021218859838264623012884717259265070677884928,[0,412212982732,732263383798],[1000000000000000000000000000000,412212982732,732263383798]⟩ +def gbr109 : Row := ⟨109,4,7,3,1655054091967455770603934705049722619749297750199283555005517250166784,[0,412212982732,714352634336,1126565617068],[1000000000000000000000000000000,412212982732,714352634336,1212614263639]⟩ +def gbr110 : Row := ⟨110,4,7,4,1662636577181025603833808106683060221438917249194374941985278114398208,[0,412212982732,699698384776,1111911367508,1399396769552],[1000000000000000000000000000000,412212982732,699698384776,1212614263639,1454161862417]⟩ +def gbr111 : Row := ⟨111,4,8,1,1626826642386109796790553044274187217316101172287346979122090189258752,[0,360686359891],[1000000000000000000000000000000,360686359891]⟩ +def gbr112 : Row := ⟨112,4,8,2,1658029166014983666588021635564622926603895785551905050652956854059008,[0,360686359891,645208148189],[1000000000000000000000000000000,360686359891,645208148189]⟩ +def gbr113 : Row := ⟨113,4,8,3,1671509139348657066200335935404400401880002898759106006952242392858624,[0,360686359891,630553898629,991240258520],[1000000000000000000000000000000,360686359891,630553898629,1114684644429]⟩ +def gbr114 : Row := ⟨114,4,8,4,1662239804681587891876486247191639090184327876014508943389138761023488,[0,360686359891,630553898629,991240258520,1261107797258],[1000000000000000000000000000000,360686359891,630553898629,1114684644429,1305510186809]⟩ +def gbr115 : Row := ⟨115,5,1,4,902315715017087972413119526148179874144310719450291367972144582492160,[0,2598567796704,3005470116017,3644304608822,3805501353980],[1000000000000000000000000000000,2598567796704,3005470116017,3644304608822,3805501353980]⟩ +def gbr116 : Row := ⟨116,5,1,6,1293234996545408277214922385718446798270627323200845745335089812733952,[0,2598567796704,2903002276699,3224309565978,3358640186942,5957207983646,6261642463641],[1000000000000000000000000000000,2598567796704,2903002276699,3224309565978,3358640186942,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr117 : Row := ⟨117,5,1,8,934330651686995133162622820233130030222982791276963094496493495648256,[0,2598567796704,2978603991823,3224309565978,3358640186942,5957207983646,6337244178765,6582949752920,6717280373884],[1000000000000000000000000000000,2598567796704,2978603991823,3224309565978,3358640186942,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr118 : Row := ⟨118,5,2,2,1006785508370385895857949945222228281726380116113775778249895766392832,[0,1299283898352,1654749536056],[1000000000000000000000000000000,1299283898352,1654749536056]⟩ +def gbr119 : Row := ⟨119,5,2,3,1010155501704572026026910986647877000973621469014524237936202639998976,[0,1299283898352,1654749536056,2197597365976],[1000000000000000000000000000000,1299283898352,1654749536056,2197597365976]⟩ +def gbr120 : Row := ⟨120,5,2,4,1293234946530666143258484996058519511216936864268439904710101557051392,[0,1299283898352,1617893699932,1986452061166,2329485612014],[1000000000000000000000000000000,1299283898352,1617893699932,1986452061166,2329485612014]⟩ +def gbr121 : Row := ⟨121,5,2,5,1293234996573292033580977233496276922429627198796788703663220454326272,[0,1299283898352,1603718378347,1875884552796,2329485612014,3479602931143],[1000000000000000000000000000000,1299283898352,1603718378347,1875884552796,2329485612014,1000000000000000000000000000000]⟩ +def gbr122 : Row := ⟨122,5,2,6,1724594554671286130046827066796802718158994177257056816239526195232768,[0,1299283898352,1591568102701,1875884552796,2010215173760,3309499072112,3601783276461],[1000000000000000000000000000000,1299283898352,1591568102701,1875884552796,2010215173760,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr123 : Row := ⟨123,5,2,7,1077555368381146687079648093053253465797062697419799727711695245672448,[0,1299283898352,1654749536056,1875884552796,2059356288590,3358640186942,3714105824646,3935240841386],[1000000000000000000000000000000,1299283898352,1654749536056,1875884552796,2059356288590,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr124 : Row := ⟨124,5,2,8,934330651737214628912912781649318472715941635646853270845669593055232,[0,1299283898352,1654749536056,1875884552796,2010215173760,3309499072112,3664964709816,3886099726556,4020430347520],[1000000000000000000000000000000,1299283898352,1654749536056,1875884552796,2010215173760,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr125 : Row := ⟨125,5,3,2,1006785508672428506998289712093791614001488853731560309319306286465024,[0,866189265568,1201551719932],[1000000000000000000000000000000,866189265568,1201551719932]⟩ +def gbr126 : Row := ⟨126,5,3,3,1009313003672479243213432775369203958591737362103316153576337392533504,[0,866189265568,1201551719932,1659200344268],[1000000000000000000000000000000,866189265568,1201551719932,1659200344268]⟩ +def gbr127 : Row := ⟨127,5,3,4,1293236875589552520933371883975616787879659970425865496329701233262592,[0,866189265568,1170623745563,1402583553332,1626261655806],[1000000000000000000000000000000,866189265568,1170623745563,1402583553332,1626261655806]⟩ +def gbr128 : Row := ⟨128,5,3,5,1724596406372365013747451269212560532528032446694712788916521242984448,[0,866189265568,1158473469917,1402583553332,1577120540976,2443309806544],[1000000000000000000000000000000,866189265568,1158473469917,1402583553332,1577120540976,1000000000000000000000000000000]⟩ +def gbr129 : Row := ⟨129,5,3,6,1724597956157390501126236735241605678443074892528490108511101659381760,[0,866189265568,1147943231025,1340727604594,1536914174296,2403103439864,2681455209188],[1000000000000000000000000000000,866189265568,1147943231025,1340727604594,1536914174296,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr130 : Row := ⟨130,5,3,7,1075027873832845369524836963916929247456939117772471706576726934945792,[0,866189265568,1200314125137,1402583553332,1577120540976,2443309806544,2777434666113,2979704094308],[1000000000000000000000000000000,866189265568,1200314125137,1402583553332,1577120540976,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr131 : Row := ⟨131,5,3,8,934330652540680586051326187642582802192468636289587530258821643501568,[0,866189265568,1200314125137,1402583553332,1536914174296,2403103439864,2737228299433,2939497727628,3073828348592],[1000000000000000000000000000000,866189265568,1200314125137,1402583553332,1536914174296,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr132 : Row := ⟨132,5,4,1,1221622585068961179313720678101214994539744848136188526540598636707840,[0,649641949176],[1000000000000000000000000000000,649641949176]⟩ +def gbr133 : Row := ⟨133,5,4,2,1293235152519836892601660551833876753706053253523521877128803445112832,[0,649641949176,933818249094],[1000000000000000000000000000000,649641949176,933818249094]⟩ +def gbr134 : Row := ⟨134,5,4,3,1724596433636592050584658301857237195224826539026888306719755998330880,[0,649641949176,933818249094,1186036236940],[1000000000000000000000000000000,649641949176,933818249094,1186036236940]⟩ +def gbr135 : Row := ⟨135,5,4,4,1724609604154578640483768508526662304956356341621750763314427547615232,[0,649641949176,933818249094,1152530931372,1360573224584],[1000000000000000000000000000000,649641949176,933818249094,1152530931372,1360573224584]⟩ +def gbr136 : Row := ⟨136,5,4,5,1724612973100089391932552724182717490027122940689335867923835641659392,[0,649641949176,931395914633,1124180288202,1320366857904,1970008807080],[1000000000000000000000000000000,649641949176,931395914633,1124180288202,1320366857904,1000000000000000000000000000000]⟩ +def gbr137 : Row := ⟨137,5,4,6,1724625106981807601729229812456964539643236356816346790762387368574976,[0,649641949176,922181955602,1099879736910,1320366857904,1970008807080,2199759473820],[1000000000000000000000000000000,649641949176,922181955602,1099879736910,1320366857904,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr138 : Row := ⟨138,5,4,7,1077555376064317295573519265627186771869462452842603268311770759954432,[0,649641949176,933818249094,1152530931372,1320366857904,1970008807080,2254185106998,2472897789276],[1000000000000000000000000000000,649641949176,933818249094,1152530931372,1320366857904,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr139 : Row := ⟨139,5,4,8,933488154204169057761395648817461810469879237371394059820600200790016,[0,649641949176,933818249094,1186036236940,1320366857904,1970008807080,2254185106998,2506403094844,2640733715808],[1000000000000000000000000000000,649641949176,933818249094,1186036236940,1320366857904,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr140 : Row := ⟨140,5,5,2,1239316981823070018792594194199733014980220058586174267668605792419840,[0,519713559340,786132598102],[1000000000000000000000000000000,519713559340,786132598102]⟩ +def gbr141 : Row := ⟨141,5,5,3,1293240577971226727734960972460232914357906854670115761551765577662464,[0,519713559340,773920723468,1056107847104],[1000000000000000000000000000000,519713559340,773920723468,1056107847104]⟩ +def gbr142 : Row := ⟨142,5,5,4,1724665654103279491311286124596740145606725127649811505448166415663104,[0,519713559340,773920723468,994251898366,1279785949578],[1000000000000000000000000000000,519713559340,773920723468,994251898366,1279785949578]⟩ +def gbr143 : Row := ⟨143,5,5,5,1724600630101379141066789610820907158235274423216523900056142987919360,[0,519713559340,773920723468,969951347074,1190438468068,1710152027408],[1000000000000000000000000000000,519713559340,773920723468,969951347074,1190438468068,1000000000000000000000000000000]⟩ +def gbr144 : Row := ⟨144,5,5,6,1722920364260112885046417138362232148833833092427163512036496576086016,[0,519713559340,773920723468,948890869290,1190438468068,1710152027408,1897781738580],[1000000000000000000000000000000,519713559340,773920723468,948890869290,1190438468068,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr145 : Row := ⟨145,5,6,1,1652996772683465680177371992258713398599898766716859493179194821574656,[0,433094632784],[1000000000000000000000000000000,433094632784]⟩ +def gbr146 : Row := ⟨146,5,6,2,1724612888253543117315840262643675047053233541128403116173979975417856,[0,433094632784,667322373050],[1000000000000000000000000000000,433094632784,667322373050]⟩ +def gbr147 : Row := ⟨147,5,6,3,1724798117216637881724063662380226703911013118052171238200390442811392,[0,433094632784,667322373050,883332420518],[1000000000000000000000000000000,433094632784,667322373050,883332420518]⟩ +def gbr148 : Row := ⟨148,5,6,4,1724798118073831600029694265858676321812402808363394872498177401946112,[0,433094632784,667322373050,883332420518,1103819541512],[1000000000000000000000000000000,433094632784,667322373050,883332420518,1103819541512]⟩ +def gbr149 : Row := ⟨149,5,6,5,1724646705823392495552840718194043011096595614457697823012136452882432,[0,433094632784,667322373050,862271942734,1103819541512,1529594315784],[1000000000000000000000000000000,433094632784,667322373050,862271942734,1103819541512,1000000000000000000000000000000]⟩ +def gbr150 : Row := ⟨150,5,6,6,1715364207117878652535193849492819274017655389633730539505151643746304,[0,433094632784,667322373050,862271942734,1103819541512,1529594315784,1724543885468],[1000000000000000000000000000000,433094632784,667322373050,862271942734,1103819541512,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr151 : Row := ⟨151,5,7,1,1652983608646958070671727044061785472690990094936058624888378157432832,[0,371223970957],[1000000000000000000000000000000,371223970957]⟩ +def gbr152 : Row := ⟨152,5,7,2,1724665544399327589804111080269620235991010603627635781708136163835904,[0,371223970957,591180694181],[1000000000000000000000000000000,371223970957,591180694181]⟩ +def gbr153 : Row := ⟨153,5,7,3,1724988995745144619539653111141576030296066136658508190726175806455808,[0,371223970957,591180694181,800401280907],[1000000000000000000000000000000,371223970957,591180694181,800401280907]⟩ +def gbr154 : Row := ⟨154,5,7,4,1724988996495760935455765473965494404194287574794966612771704152260608,[0,371223970957,591180694181,800401280907,1041948879685],[1000000000000000000000000000000,371223970957,591180694181,800401280907,1041948879685]⟩ +def gbr155 : Row := ⟨155,5,7,5,1722079712887031048896507859243078410244396551237856898667978147495936,[0,371223970957,591180694181,800401280907,1082155246365,1391581975088],[1000000000000000000000000000000,371223970957,591180694181,800401280907,1082155246365,1000000000000000000000000000000]⟩ +def gbr156 : Row := ⟨156,5,7,6,1711967830645300390726067324802818450647166908398143296891178348183552,[0,371223970957,591180694181,800401280907,1041948879685,1391581975088,1600802561814],[1000000000000000000000000000000,371223970957,591180694181,800401280907,1041948879685,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr157 : Row := ⟨157,5,8,1,1653049428829299958770720951272555233816058214264559767734821977063424,[0,324820974588],[1000000000000000000000000000000,324820974588]⟩ +def gbr158 : Row := ⟨158,5,8,2,1725007809347244270678715850304158731507938411450953091363223940104192,[0,324820974588,534074435029],[1000000000000000000000000000000,324820974588,534074435029]⟩ +def gbr159 : Row := ⟨159,5,8,3,1725436572984723727618792335648364762857204238340491574536029159292928,[0,324820974588,534074435029,753998284538],[1000000000000000000000000000000,324820974588,534074435029,753998284538]⟩ +def gbr160 : Row := ⟨160,5,8,4,1725436546416302154306973501391776423872330413460762560019084580225024,[0,324820974588,534074435029,753998284538,995545883316],[1000000000000000000000000000000,324820974588,534074435029,753998284538,995545883316]⟩ +def gbr161 : Row := ⟨161,5,8,5,1712007322754676099671079044063199827059286494058918502807898714800128,[0,324820974588,534074435029,753998284538,995545883316,1288072719567],[1000000000000000000000000000000,324820974588,534074435029,753998284538,995545883316,1000000000000000000000000000000]⟩ +def gbr162 : Row := ⟨162,5,8,6,0,[0,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000],[1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr163 : Row := ⟨163,5,9,1,1220110597673101594896698658036310199253681338105286529160551086424064,[0,288729755189],[1000000000000000000000000000000,288729755189]⟩ +def gbr164 : Row := ⟨164,5,9,2,1724981481166733684448929045829614985817689780513598517795144020787200,[0,288729755189,489658455688],[1000000000000000000000000000000,288729755189,489658455688]⟩ +def gbr165 : Row := ⟨165,5,9,3,1719084897325991940802223620433570589293316217023973182165491707281408,[0,288729755189,489658455688,738967542923],[1000000000000000000000000000000,288729755189,489658455688,738967542923]⟩ +def gbr166 : Row := ⟨166,5,9,4,1719076454473507404067315922964737428825002565369443847371935033851904,[0,288729755189,489658455688,717907065139,979316911376],[1000000000000000000000000000000,288729755189,489658455688,717907065139,1000000000000000000000000000000]⟩ +def gbr167 : Row := ⟨167,5,10,1,1653365365597545860971933423926930357813615760583145572860786448007168,[0,259856779670],[1000000000000000000000000000000,259856779670]⟩ +def gbr168 : Row := ⟨168,5,10,2,1725429058393770849021621835919599006308629751836846140629046773415936,[0,259856779670,454125672216],[1000000000000000000000000000000,259856779670,454125672216]⟩ +def gbr169 : Row := ⟨169,5,10,3,1712798854587327003016494715533281136648493428042051740193260090425344,[0,259856779670,454125672216,689034089620],[1000000000000000000000000000000,259856779670,454125672216,689034089620]⟩ +def gbr170 : Row := ⟨170,5,10,4,1699251261300849264808366402224925605189360721528803074030198803398656,[0,259856779670,454125672216,689034089620,908251344432],[1000000000000000000000000000000,259856779670,454125672216,689034089620,1000000000000000000000000000000]⟩ +def gbr171 : Row := ⟨171,5,11,1,1651680341612902193581932051270636061096749196179285892773239272243200,[0,236233436064],[1000000000000000000000000000000,236233436064]⟩ +def gbr172 : Row := ⟨172,5,11,2,1662634725774952632160982318916779302676760877433693626735990281338880,[0,236233436064,437265269463],[1000000000000000000000000000000,236233436064,437265269463]⟩ +def gbr173 : Row := ⟨173,5,12,1,1653786587446273337315890411824309469743127098087296874998325491793920,[0,216547316392],[1000000000000000000000000000000,216547316392]⟩ +def gbr174 : Row := ⟨174,5,12,2,1636109189097058702243463664610030627854113970235274331773225033269248,[0,216547316392,413038371641],[1000000000000000000000000000000,216547316392,413038371641]⟩ +def gbr175 : Row := ⟨175,6,3,4,863560791682168930922927827006097545014939782284502712285350015795200,[0,737116722467,916224217087,1653340939554,1832448434174],[1000000000000000000000000000000,737116722467,916224217087,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr176 : Row := ⟨176,6,4,3,0,[0,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000],[1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr177 : Row := ⟨177,6,4,4,866930785015562760897261203891974998849144425337320283845487967076352,[0,552837541850,714034287008,1266871828858,1428068574016],[1000000000000000000000000000000,552837541850,714034287008,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr178 : Row := ⟨178,6,5,4,866930785015562760897261203891974998849144425337320283845487967076352,[0,442270033480,603466778638,1045736812118,1206933557276],[1000000000000000000000000000000,442270033480,603466778638,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr179 : Row := ⟨179,6,6,2,871985775015653505858761269220791179600451389916546641185694893998080,[0,368558361233,547665855853],[1000000000000000000000000000000,368558361233,547665855853]⟩ +def gbr180 : Row := ⟨180,6,6,3,875355768349047335833094646106668633434656032969364212745832845279232,[0,368558361233,529755106391,898313467624],[1000000000000000000000000000000,368558361233,529755106391,1000000000000000000000000000000]⟩ +def gbr181 : Row := ⟨181,6,6,4,880410758349138080794594711435484814185962997548590570086039772200960,[0,368558361233,515100856831,883659218064,1030201713662],[1000000000000000000000000000000,368558361233,515100856831,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr182 : Row := ⟨182,6,7,2,870300778348956590871594580777852452683349068390137855405625918357504,[0,315907166771,495014661391],[1000000000000000000000000000000,315907166771,495014661391]⟩ +def gbr183 : Row := ⟨183,6,7,3,872828273349001963352344613442260543059002550679751034075729381818368,[0,315907166771,477103911929,793011078700],[1000000000000000000000000000000,315907166771,477103911929,1000000000000000000000000000000]⟩ +def gbr184 : Row := ⟨184,6,7,4,880410758349138080794594711435484814185962997548590570086039772200960,[0,315907166771,462449662369,778356829140,924899324738],[1000000000000000000000000000000,315907166771,462449662369,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr185 : Row := ⟨185,6,8,1,898103223349455688159844940086341446815537373575882820776764016427008,[0,276418770925],[1000000000000000000000000000000,276418770925]⟩ +def gbr186 : Row := ⟨186,6,8,2,902315715016197975627761661193688264108293177391904785226936455528448,[0,276418770925,437615516083],[1000000000000000000000000000000,276418770925,437615516083]⟩ +def gbr187 : Row := ⟨187,6,8,3,1293234941689882252650433379955472908876031771518743086202938804142080,[0,276418770925,410749391889,687168162814],[1000000000000000000000000000000,276418770925,410749391889,1000000000000000000000000000000]⟩ +def gbr188 : Row := ⟨188,6,8,4,934330651683439360383928741609524075533237286393671715048246992699392,[0,276418770925,410749391889,687168162814,821498783778],[1000000000000000000000000000000,276418770925,410749391889,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr189 : Row := ⟨189,6,9,2,900630718349501060640594972750749537191190855865495999446867479887872,[0,245705574155,406902319313],[1000000000000000000000000000000,245705574155,406902319313]⟩ +def gbr190 : Row := ⟨190,6,9,3,1291549945023185337663266691512534181958929449992334300422869828501504,[0,245705574155,380036195119,625741769274],[1000000000000000000000000000000,245705574155,380036195119,1000000000000000000000000000000]⟩ +def gbr191 : Row := ⟨191,6,9,4,934330651683439360383928741609524075533237286393671715048246992699392,[0,245705574155,380036195119,625741769274,760072390238],[1000000000000000000000000000000,245705574155,380036195119,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr192 : Row := ⟨192,6,10,1,1005943010018058247338513000434419969510085951266045110701178457423872,[0,221135016740],[1000000000000000000000000000000,221135016740]⟩ +def gbr193 : Row := ⟨193,6,10,2,1293234941689882252650433379955472908876031771518743086202938804142080,[0,221135016740,355465637704],[1000000000000000000000000000000,221135016740,355465637704]⟩ +def gbr194 : Row := ⟨194,6,10,3,1724594088364292489365105621347786999654226082279392245900596568129536,[0,221135016740,355465637704,576600654444],[1000000000000000000000000000000,221135016740,355465637704,1000000000000000000000000000000]⟩ +def gbr195 : Row := ⟨195,6,10,4,933488153350090902890345397388054712074686125630467322158212504879104,[0,221135016740,355465637704,576600654444,710931275408],[1000000000000000000000000000000,221135016740,355465637704,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr196 : Row := ⟨196,6,11,1,1004258013351361332351346311991481242592983629739636324921109481783296,[0,201031833400],[1000000000000000000000000000000,201031833400]⟩ +def gbr197 : Row := ⟨197,6,11,2,1291549945023185337663266691512534181958929449992334300422869828501504,[0,201031833400,335362454364],[1000000000000000000000000000000,201031833400,335362454364]⟩ +def gbr198 : Row := ⟨198,6,11,3,1722066593364247116884355588683378909278572599989779067230493104668672,[0,201031833400,335362454364,536394287764],[1000000000000000000000000000000,201031833400,335362454364,1000000000000000000000000000000]⟩ +def gbr199 : Row := ⟨199,6,11,4,930118160016697072916012020502177258240481482577649750598074553597952,[0,201031833400,335362454364,536394287764,670724908728],[1000000000000000000000000000000,201031833400,335362454364,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr200 : Row := ⟨200,6,12,1,1221622583355263365695849121130577014899183106646369690550007339417600,[0,184279180616],[1000000000000000000000000000000,184279180616]⟩ +def gbr201 : Row := ⟨201,6,12,2,1724594088364292489365105621347786999654226082279392245900596568129536,[0,184279180616,318609801580],[1000000000000000000000000000000,184279180616,318609801580]⟩ +def gbr202 : Row := ⟨202,6,12,3,1715326606697459456935688834911624001610163313884143924110217202106368,[0,184279180616,318609801580,502888982196],[1000000000000000000000000000000,184279180616,318609801580,1000000000000000000000000000000]⟩ +def gbr203 : Row := ⟨203,6,12,4,0,[0,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000],[1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbr204 : Row := ⟨204,6,13,1,1219937586688566450708682432687638287982080785119960904769938363777024,[0,170103859031],[1000000000000000000000000000000,170103859031]⟩ +def gbr205 : Row := ⟨205,6,13,2,1291549945023185337663266691512534181958929449992334300422869828501504,[0,170103859031,304434479995],[1000000000000000000000000000000,170103859031,304434479995]⟩ +def gbr206 : Row := ⟨206,6,13,3,1253637520022504750452016201546412826324127215648136620371317876588544,[0,170103859031,304434479995,474538339026],[1000000000000000000000000000000,170103859031,304434479995,1000000000000000000000000000000]⟩ +def gbr207 : Row := ⟨207,6,14,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,157953583385],[1000000000000000000000000000000,157953583385]⟩ +def gbr208 : Row := ⟨208,6,14,2,1722909091697595574377938932904848272737123760752983460120527592488960,[0,157953583385,292284204349],[1000000000000000000000000000000,157953583385,292284204349]⟩ +def gbr209 : Row := ⟨209,6,14,3,1577156880028312427988020382590648394407772948718623490144561199579136,[0,157953583385,292284204349,450237787734],[1000000000000000000000000000000,157953583385,292284204349,1000000000000000000000000000000]⟩ +def gbr210 : Row := ⟨210,6,15,1,1651296733362976687423354674079952378760275095880610064467596127764480,[0,147423344493],[1000000000000000000000000000000,147423344493]⟩ +def gbr211 : Row := ⟨211,6,15,2,1716169105030807914429272179133093365068714474647348317000251689926656,[0,147423344493,281753965457],[1000000000000000000000000000000,147423344493,281753965457]⟩ +def gbr212 : Row := ⟨212,6,15,3,1347997333357531989733350754350981533681857221127028624055180512460800,[0,147423344493,281753965457,429177309950],[1000000000000000000000000000000,147423344493,281753965457,1000000000000000000000000000000]⟩ +def gbr213 : Row := ⟨213,6,16,1,1652981730029673602410521362522891105677377417407018850247665103405056,[0,138209385462],[1000000000000000000000000000000,138209385462]⟩ +def gbr214 : Row := ⟨214,6,16,2,1688366660030308817141021819824604370936526169461603351629113591857152,[0,138209385462,272540006426],[1000000000000000000000000000000,138209385462,272540006426]⟩ +def gbr215 : Row := ⟨215,6,17,1,1186237653354628150965348663828863749640034354591785189168558850965504,[0,130079421611],[1000000000000000000000000000000,130079421611]⟩ +def gbr216 : Row := ⟨216,6,18,1,1617596800029038387680020905221177840418228665352434348866216614952960,[0,122852787077],[1000000000000000000000000000000,122852787077]⟩ +def gbr217 : Row := ⟨217,6,19,1,1509757013360435828501352844873099317723680087662272058941802173956096,[0,116386850915],[1000000000000000000000000000000,116386850915]⟩ +def gbr218 : Row := ⟨218,6,20,1,1509757013360435828501352844873099317723680087662272058941802173956096,[0,110567508370],[1000000000000000000000000000000,110567508370]⟩ +def gbr219 : Row := ⟨219,7,18,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,89553747310,179107494620],[1000000000000000000000000000000,89553747310,1000000000000000000000000000000]⟩ +def gbr220 : Row := ⟨220,7,20,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,80598372579],[1000000000000000000000000000000,80598372579]⟩ +def gbr221 : Row := ⟨221,7,20,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,80598372579,161196745158],[1000000000000000000000000000000,80598372579,1000000000000000000000000000000]⟩ +def gbr222 : Row := ⟨222,7,22,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,73271247799],[1000000000000000000000000000000,73271247799]⟩ +def gbr223 : Row := ⟨223,7,22,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,73271247799,146542495598],[1000000000000000000000000000000,73271247799,1000000000000000000000000000000]⟩ +def gbr224 : Row := ⟨224,7,24,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,67165310482],[1000000000000000000000000000000,67165310482]⟩ +def gbr225 : Row := ⟨225,7,24,2,862718293348820473429344482784628181556388621521298319395315527974912,[0,67165310482,134330620964],[1000000000000000000000000000000,67165310482,1000000000000000000000000000000]⟩ +def gbr226 : Row := ⟨226,7,26,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,61998748137],[1000000000000000000000000000000,61998748137]⟩ +def gbr227 : Row := ⟨227,7,28,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,57570266128],[1000000000000000000000000000000,57570266128]⟩ +def gbr228 : Row := ⟨228,7,30,1,862718293348820473429344482784628181556388621521298319395315527974912,[0,53732248386],[1000000000000000000000000000000,53732248386]⟩ +def gbr229 : Row := ⟨229,8,48,1,0,[0,0],[1000000000000000000000000000000,1000000000000000000000000000000]⟩ +def gbR : List Row := [gbr0, gbr1, gbr2, gbr3, gbr4, gbr5, gbr6, gbr7, gbr8, gbr9, gbr10, gbr11, gbr12, gbr13, gbr14, gbr15, gbr16, gbr17, gbr18, gbr19, gbr20, gbr21, gbr22, gbr23, gbr24, gbr25, gbr26, gbr27, gbr28, gbr29, gbr30, gbr31, gbr32, gbr33, gbr34, gbr35, gbr36, gbr37, gbr38, gbr39, gbr40, gbr41, gbr42, gbr43, gbr44, gbr45, gbr46, gbr47, gbr48, gbr49, gbr50, gbr51, gbr52, gbr53, gbr54, gbr55, gbr56, gbr57, gbr58, gbr59, gbr60, gbr61, gbr62, gbr63, gbr64, gbr65, gbr66, gbr67, gbr68, gbr69, gbr70, gbr71, gbr72, gbr73, gbr74, gbr75, gbr76, gbr77, gbr78, gbr79, gbr80, gbr81, gbr82, gbr83, gbr84, gbr85, gbr86, gbr87, gbr88, gbr89, gbr90, gbr91, gbr92, gbr93, gbr94, gbr95, gbr96, gbr97, gbr98, gbr99, gbr100, gbr101, gbr102, gbr103, gbr104, gbr105, gbr106, gbr107, gbr108, gbr109, gbr110, gbr111, gbr112, gbr113, gbr114, gbr115, gbr116, gbr117, gbr118, gbr119, gbr120, gbr121, gbr122, gbr123, gbr124, gbr125, gbr126, gbr127, gbr128, gbr129, gbr130, gbr131, gbr132, gbr133, gbr134, gbr135, gbr136, gbr137, gbr138, gbr139, gbr140, gbr141, gbr142, gbr143, gbr144, gbr145, gbr146, gbr147, gbr148, gbr149, gbr150, gbr151, gbr152, gbr153, gbr154, gbr155, gbr156, gbr157, gbr158, gbr159, gbr160, gbr161, gbr162, gbr163, gbr164, gbr165, gbr166, gbr167, gbr168, gbr169, gbr170, gbr171, gbr172, gbr173, gbr174, gbr175, gbr176, gbr177, gbr178, gbr179, gbr180, gbr181, gbr182, gbr183, gbr184, gbr185, gbr186, gbr187, gbr188, gbr189, gbr190, gbr191, gbr192, gbr193, gbr194, gbr195, gbr196, gbr197, gbr198, gbr199, gbr200, gbr201, gbr202, gbr203, gbr204, gbr205, gbr206, gbr207, gbr208, gbr209, gbr210, gbr211, gbr212, gbr213, gbr214, gbr215, gbr216, gbr217, gbr218, gbr219, gbr220, gbr221, gbr222, gbr223, gbr224, gbr225, gbr226, gbr227, gbr228, gbr229] +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP0.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP0.lean new file mode 100644 index 0000000000..bd08ba5fe2 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP0.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc0 : Row.check gbW gbR gbr0 = true := by decide +kernel +theorem gbc1 : Row.check gbW gbR gbr1 = true := by decide +kernel +theorem gbc2 : Row.check gbW gbR gbr2 = true := by decide +kernel +theorem gbc3 : Row.check gbW gbR gbr3 = true := by decide +kernel +theorem gbc4 : Row.check gbW gbR gbr4 = true := by decide +kernel +theorem gbc5 : Row.check gbW gbR gbr5 = true := by decide +kernel +theorem gbc6 : Row.check gbW gbR gbr6 = true := by decide +kernel +theorem gbc7 : Row.check gbW gbR gbr7 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP1.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP1.lean new file mode 100644 index 0000000000..11aceb78ff --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP1.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc8 : Row.check gbW gbR gbr8 = true := by decide +kernel +theorem gbc9 : Row.check gbW gbR gbr9 = true := by decide +kernel +theorem gbc10 : Row.check gbW gbR gbr10 = true := by decide +kernel +theorem gbc11 : Row.check gbW gbR gbr11 = true := by decide +kernel +theorem gbc12 : Row.check gbW gbR gbr12 = true := by decide +kernel +theorem gbc13 : Row.check gbW gbR gbr13 = true := by decide +kernel +theorem gbc14 : Row.check gbW gbR gbr14 = true := by decide +kernel +theorem gbc15 : Row.check gbW gbR gbr15 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP10.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP10.lean new file mode 100644 index 0000000000..af1a8e68a3 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP10.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc80 : Row.check gbW gbR gbr80 = true := by decide +kernel +theorem gbc81 : Row.check gbW gbR gbr81 = true := by decide +kernel +theorem gbc82 : Row.check gbW gbR gbr82 = true := by decide +kernel +theorem gbc83 : Row.check gbW gbR gbr83 = true := by decide +kernel +theorem gbc84 : Row.check gbW gbR gbr84 = true := by decide +kernel +theorem gbc85 : Row.check gbW gbR gbr85 = true := by decide +kernel +theorem gbc86 : Row.check gbW gbR gbr86 = true := by decide +kernel +theorem gbc87 : Row.check gbW gbR gbr87 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP11.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP11.lean new file mode 100644 index 0000000000..47db254cdf --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP11.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc88 : Row.check gbW gbR gbr88 = true := by decide +kernel +theorem gbc89 : Row.check gbW gbR gbr89 = true := by decide +kernel +theorem gbc90 : Row.check gbW gbR gbr90 = true := by decide +kernel +theorem gbc91 : Row.check gbW gbR gbr91 = true := by decide +kernel +theorem gbc92 : Row.check gbW gbR gbr92 = true := by decide +kernel +theorem gbc93 : Row.check gbW gbR gbr93 = true := by decide +kernel +theorem gbc94 : Row.check gbW gbR gbr94 = true := by decide +kernel +theorem gbc95 : Row.check gbW gbR gbr95 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP12.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP12.lean new file mode 100644 index 0000000000..d0dc9cf423 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP12.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc96 : Row.check gbW gbR gbr96 = true := by decide +kernel +theorem gbc97 : Row.check gbW gbR gbr97 = true := by decide +kernel +theorem gbc98 : Row.check gbW gbR gbr98 = true := by decide +kernel +theorem gbc99 : Row.check gbW gbR gbr99 = true := by decide +kernel +theorem gbc100 : Row.check gbW gbR gbr100 = true := by decide +kernel +theorem gbc101 : Row.check gbW gbR gbr101 = true := by decide +kernel +theorem gbc102 : Row.check gbW gbR gbr102 = true := by decide +kernel +theorem gbc103 : Row.check gbW gbR gbr103 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP13.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP13.lean new file mode 100644 index 0000000000..6c9c1b6bc7 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP13.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc104 : Row.check gbW gbR gbr104 = true := by decide +kernel +theorem gbc105 : Row.check gbW gbR gbr105 = true := by decide +kernel +theorem gbc106 : Row.check gbW gbR gbr106 = true := by decide +kernel +theorem gbc107 : Row.check gbW gbR gbr107 = true := by decide +kernel +theorem gbc108 : Row.check gbW gbR gbr108 = true := by decide +kernel +theorem gbc109 : Row.check gbW gbR gbr109 = true := by decide +kernel +theorem gbc110 : Row.check gbW gbR gbr110 = true := by decide +kernel +theorem gbc111 : Row.check gbW gbR gbr111 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP14.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP14.lean new file mode 100644 index 0000000000..13752b6d1a --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP14.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc112 : Row.check gbW gbR gbr112 = true := by decide +kernel +theorem gbc113 : Row.check gbW gbR gbr113 = true := by decide +kernel +theorem gbc114 : Row.check gbW gbR gbr114 = true := by decide +kernel +theorem gbc115 : Row.check gbW gbR gbr115 = true := by decide +kernel +theorem gbc116 : Row.check gbW gbR gbr116 = true := by decide +kernel +theorem gbc117 : Row.check gbW gbR gbr117 = true := by decide +kernel +theorem gbc118 : Row.check gbW gbR gbr118 = true := by decide +kernel +theorem gbc119 : Row.check gbW gbR gbr119 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP15.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP15.lean new file mode 100644 index 0000000000..08536da43e --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP15.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc120 : Row.check gbW gbR gbr120 = true := by decide +kernel +theorem gbc121 : Row.check gbW gbR gbr121 = true := by decide +kernel +theorem gbc122 : Row.check gbW gbR gbr122 = true := by decide +kernel +theorem gbc123 : Row.check gbW gbR gbr123 = true := by decide +kernel +theorem gbc124 : Row.check gbW gbR gbr124 = true := by decide +kernel +theorem gbc125 : Row.check gbW gbR gbr125 = true := by decide +kernel +theorem gbc126 : Row.check gbW gbR gbr126 = true := by decide +kernel +theorem gbc127 : Row.check gbW gbR gbr127 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP16.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP16.lean new file mode 100644 index 0000000000..1b6225ea24 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP16.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc128 : Row.check gbW gbR gbr128 = true := by decide +kernel +theorem gbc129 : Row.check gbW gbR gbr129 = true := by decide +kernel +theorem gbc130 : Row.check gbW gbR gbr130 = true := by decide +kernel +theorem gbc131 : Row.check gbW gbR gbr131 = true := by decide +kernel +theorem gbc132 : Row.check gbW gbR gbr132 = true := by decide +kernel +theorem gbc133 : Row.check gbW gbR gbr133 = true := by decide +kernel +theorem gbc134 : Row.check gbW gbR gbr134 = true := by decide +kernel +theorem gbc135 : Row.check gbW gbR gbr135 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP17.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP17.lean new file mode 100644 index 0000000000..86f2d7a057 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP17.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc136 : Row.check gbW gbR gbr136 = true := by decide +kernel +theorem gbc137 : Row.check gbW gbR gbr137 = true := by decide +kernel +theorem gbc138 : Row.check gbW gbR gbr138 = true := by decide +kernel +theorem gbc139 : Row.check gbW gbR gbr139 = true := by decide +kernel +theorem gbc140 : Row.check gbW gbR gbr140 = true := by decide +kernel +theorem gbc141 : Row.check gbW gbR gbr141 = true := by decide +kernel +theorem gbc142 : Row.check gbW gbR gbr142 = true := by decide +kernel +theorem gbc143 : Row.check gbW gbR gbr143 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP18.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP18.lean new file mode 100644 index 0000000000..517aca6afc --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP18.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc144 : Row.check gbW gbR gbr144 = true := by decide +kernel +theorem gbc145 : Row.check gbW gbR gbr145 = true := by decide +kernel +theorem gbc146 : Row.check gbW gbR gbr146 = true := by decide +kernel +theorem gbc147 : Row.check gbW gbR gbr147 = true := by decide +kernel +theorem gbc148 : Row.check gbW gbR gbr148 = true := by decide +kernel +theorem gbc149 : Row.check gbW gbR gbr149 = true := by decide +kernel +theorem gbc150 : Row.check gbW gbR gbr150 = true := by decide +kernel +theorem gbc151 : Row.check gbW gbR gbr151 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP19.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP19.lean new file mode 100644 index 0000000000..3f394378b2 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP19.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc152 : Row.check gbW gbR gbr152 = true := by decide +kernel +theorem gbc153 : Row.check gbW gbR gbr153 = true := by decide +kernel +theorem gbc154 : Row.check gbW gbR gbr154 = true := by decide +kernel +theorem gbc155 : Row.check gbW gbR gbr155 = true := by decide +kernel +theorem gbc156 : Row.check gbW gbR gbr156 = true := by decide +kernel +theorem gbc157 : Row.check gbW gbR gbr157 = true := by decide +kernel +theorem gbc158 : Row.check gbW gbR gbr158 = true := by decide +kernel +theorem gbc159 : Row.check gbW gbR gbr159 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP2.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP2.lean new file mode 100644 index 0000000000..60fc04db0b --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP2.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc16 : Row.check gbW gbR gbr16 = true := by decide +kernel +theorem gbc17 : Row.check gbW gbR gbr17 = true := by decide +kernel +theorem gbc18 : Row.check gbW gbR gbr18 = true := by decide +kernel +theorem gbc19 : Row.check gbW gbR gbr19 = true := by decide +kernel +theorem gbc20 : Row.check gbW gbR gbr20 = true := by decide +kernel +theorem gbc21 : Row.check gbW gbR gbr21 = true := by decide +kernel +theorem gbc22 : Row.check gbW gbR gbr22 = true := by decide +kernel +theorem gbc23 : Row.check gbW gbR gbr23 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP20.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP20.lean new file mode 100644 index 0000000000..78875f0cce --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP20.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc160 : Row.check gbW gbR gbr160 = true := by decide +kernel +theorem gbc161 : Row.check gbW gbR gbr161 = true := by decide +kernel +theorem gbc162 : Row.check gbW gbR gbr162 = true := by decide +kernel +theorem gbc163 : Row.check gbW gbR gbr163 = true := by decide +kernel +theorem gbc164 : Row.check gbW gbR gbr164 = true := by decide +kernel +theorem gbc165 : Row.check gbW gbR gbr165 = true := by decide +kernel +theorem gbc166 : Row.check gbW gbR gbr166 = true := by decide +kernel +theorem gbc167 : Row.check gbW gbR gbr167 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP21.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP21.lean new file mode 100644 index 0000000000..e375f5e257 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP21.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc168 : Row.check gbW gbR gbr168 = true := by decide +kernel +theorem gbc169 : Row.check gbW gbR gbr169 = true := by decide +kernel +theorem gbc170 : Row.check gbW gbR gbr170 = true := by decide +kernel +theorem gbc171 : Row.check gbW gbR gbr171 = true := by decide +kernel +theorem gbc172 : Row.check gbW gbR gbr172 = true := by decide +kernel +theorem gbc173 : Row.check gbW gbR gbr173 = true := by decide +kernel +theorem gbc174 : Row.check gbW gbR gbr174 = true := by decide +kernel +theorem gbc175 : Row.check gbW gbR gbr175 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP22.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP22.lean new file mode 100644 index 0000000000..5aa0e511fb --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP22.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc176 : Row.check gbW gbR gbr176 = true := by decide +kernel +theorem gbc177 : Row.check gbW gbR gbr177 = true := by decide +kernel +theorem gbc178 : Row.check gbW gbR gbr178 = true := by decide +kernel +theorem gbc179 : Row.check gbW gbR gbr179 = true := by decide +kernel +theorem gbc180 : Row.check gbW gbR gbr180 = true := by decide +kernel +theorem gbc181 : Row.check gbW gbR gbr181 = true := by decide +kernel +theorem gbc182 : Row.check gbW gbR gbr182 = true := by decide +kernel +theorem gbc183 : Row.check gbW gbR gbr183 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP23.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP23.lean new file mode 100644 index 0000000000..f2e52b136a --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP23.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc184 : Row.check gbW gbR gbr184 = true := by decide +kernel +theorem gbc185 : Row.check gbW gbR gbr185 = true := by decide +kernel +theorem gbc186 : Row.check gbW gbR gbr186 = true := by decide +kernel +theorem gbc187 : Row.check gbW gbR gbr187 = true := by decide +kernel +theorem gbc188 : Row.check gbW gbR gbr188 = true := by decide +kernel +theorem gbc189 : Row.check gbW gbR gbr189 = true := by decide +kernel +theorem gbc190 : Row.check gbW gbR gbr190 = true := by decide +kernel +theorem gbc191 : Row.check gbW gbR gbr191 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP24.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP24.lean new file mode 100644 index 0000000000..9d4dfe1bd3 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP24.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc192 : Row.check gbW gbR gbr192 = true := by decide +kernel +theorem gbc193 : Row.check gbW gbR gbr193 = true := by decide +kernel +theorem gbc194 : Row.check gbW gbR gbr194 = true := by decide +kernel +theorem gbc195 : Row.check gbW gbR gbr195 = true := by decide +kernel +theorem gbc196 : Row.check gbW gbR gbr196 = true := by decide +kernel +theorem gbc197 : Row.check gbW gbR gbr197 = true := by decide +kernel +theorem gbc198 : Row.check gbW gbR gbr198 = true := by decide +kernel +theorem gbc199 : Row.check gbW gbR gbr199 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP25.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP25.lean new file mode 100644 index 0000000000..a33e4dc412 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP25.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc200 : Row.check gbW gbR gbr200 = true := by decide +kernel +theorem gbc201 : Row.check gbW gbR gbr201 = true := by decide +kernel +theorem gbc202 : Row.check gbW gbR gbr202 = true := by decide +kernel +theorem gbc203 : Row.check gbW gbR gbr203 = true := by decide +kernel +theorem gbc204 : Row.check gbW gbR gbr204 = true := by decide +kernel +theorem gbc205 : Row.check gbW gbR gbr205 = true := by decide +kernel +theorem gbc206 : Row.check gbW gbR gbr206 = true := by decide +kernel +theorem gbc207 : Row.check gbW gbR gbr207 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP26.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP26.lean new file mode 100644 index 0000000000..cb8c1c5781 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP26.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc208 : Row.check gbW gbR gbr208 = true := by decide +kernel +theorem gbc209 : Row.check gbW gbR gbr209 = true := by decide +kernel +theorem gbc210 : Row.check gbW gbR gbr210 = true := by decide +kernel +theorem gbc211 : Row.check gbW gbR gbr211 = true := by decide +kernel +theorem gbc212 : Row.check gbW gbR gbr212 = true := by decide +kernel +theorem gbc213 : Row.check gbW gbR gbr213 = true := by decide +kernel +theorem gbc214 : Row.check gbW gbR gbr214 = true := by decide +kernel +theorem gbc215 : Row.check gbW gbR gbr215 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP27.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP27.lean new file mode 100644 index 0000000000..99ff194394 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP27.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc216 : Row.check gbW gbR gbr216 = true := by decide +kernel +theorem gbc217 : Row.check gbW gbR gbr217 = true := by decide +kernel +theorem gbc218 : Row.check gbW gbR gbr218 = true := by decide +kernel +theorem gbc219 : Row.check gbW gbR gbr219 = true := by decide +kernel +theorem gbc220 : Row.check gbW gbR gbr220 = true := by decide +kernel +theorem gbc221 : Row.check gbW gbR gbr221 = true := by decide +kernel +theorem gbc222 : Row.check gbW gbR gbr222 = true := by decide +kernel +theorem gbc223 : Row.check gbW gbR gbr223 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP28.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP28.lean new file mode 100644 index 0000000000..6fac390fe1 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP28.lean @@ -0,0 +1,9 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc224 : Row.check gbW gbR gbr224 = true := by decide +kernel +theorem gbc225 : Row.check gbW gbR gbr225 = true := by decide +kernel +theorem gbc226 : Row.check gbW gbR gbr226 = true := by decide +kernel +theorem gbc227 : Row.check gbW gbR gbr227 = true := by decide +kernel +theorem gbc228 : Row.check gbW gbR gbr228 = true := by decide +kernel +theorem gbc229 : Row.check gbW gbR gbr229 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP3.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP3.lean new file mode 100644 index 0000000000..b2154aba6d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP3.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc24 : Row.check gbW gbR gbr24 = true := by decide +kernel +theorem gbc25 : Row.check gbW gbR gbr25 = true := by decide +kernel +theorem gbc26 : Row.check gbW gbR gbr26 = true := by decide +kernel +theorem gbc27 : Row.check gbW gbR gbr27 = true := by decide +kernel +theorem gbc28 : Row.check gbW gbR gbr28 = true := by decide +kernel +theorem gbc29 : Row.check gbW gbR gbr29 = true := by decide +kernel +theorem gbc30 : Row.check gbW gbR gbr30 = true := by decide +kernel +theorem gbc31 : Row.check gbW gbR gbr31 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP4.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP4.lean new file mode 100644 index 0000000000..8afc17a274 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP4.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc32 : Row.check gbW gbR gbr32 = true := by decide +kernel +theorem gbc33 : Row.check gbW gbR gbr33 = true := by decide +kernel +theorem gbc34 : Row.check gbW gbR gbr34 = true := by decide +kernel +theorem gbc35 : Row.check gbW gbR gbr35 = true := by decide +kernel +theorem gbc36 : Row.check gbW gbR gbr36 = true := by decide +kernel +theorem gbc37 : Row.check gbW gbR gbr37 = true := by decide +kernel +theorem gbc38 : Row.check gbW gbR gbr38 = true := by decide +kernel +theorem gbc39 : Row.check gbW gbR gbr39 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP5.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP5.lean new file mode 100644 index 0000000000..f89ddcd847 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP5.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc40 : Row.check gbW gbR gbr40 = true := by decide +kernel +theorem gbc41 : Row.check gbW gbR gbr41 = true := by decide +kernel +theorem gbc42 : Row.check gbW gbR gbr42 = true := by decide +kernel +theorem gbc43 : Row.check gbW gbR gbr43 = true := by decide +kernel +theorem gbc44 : Row.check gbW gbR gbr44 = true := by decide +kernel +theorem gbc45 : Row.check gbW gbR gbr45 = true := by decide +kernel +theorem gbc46 : Row.check gbW gbR gbr46 = true := by decide +kernel +theorem gbc47 : Row.check gbW gbR gbr47 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP6.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP6.lean new file mode 100644 index 0000000000..703f2271df --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP6.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc48 : Row.check gbW gbR gbr48 = true := by decide +kernel +theorem gbc49 : Row.check gbW gbR gbr49 = true := by decide +kernel +theorem gbc50 : Row.check gbW gbR gbr50 = true := by decide +kernel +theorem gbc51 : Row.check gbW gbR gbr51 = true := by decide +kernel +theorem gbc52 : Row.check gbW gbR gbr52 = true := by decide +kernel +theorem gbc53 : Row.check gbW gbR gbr53 = true := by decide +kernel +theorem gbc54 : Row.check gbW gbR gbr54 = true := by decide +kernel +theorem gbc55 : Row.check gbW gbR gbr55 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP7.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP7.lean new file mode 100644 index 0000000000..e64ac5f905 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP7.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc56 : Row.check gbW gbR gbr56 = true := by decide +kernel +theorem gbc57 : Row.check gbW gbR gbr57 = true := by decide +kernel +theorem gbc58 : Row.check gbW gbR gbr58 = true := by decide +kernel +theorem gbc59 : Row.check gbW gbR gbr59 = true := by decide +kernel +theorem gbc60 : Row.check gbW gbR gbr60 = true := by decide +kernel +theorem gbc61 : Row.check gbW gbR gbr61 = true := by decide +kernel +theorem gbc62 : Row.check gbW gbR gbr62 = true := by decide +kernel +theorem gbc63 : Row.check gbW gbR gbr63 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP8.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP8.lean new file mode 100644 index 0000000000..1ba316678d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP8.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc64 : Row.check gbW gbR gbr64 = true := by decide +kernel +theorem gbc65 : Row.check gbW gbR gbr65 = true := by decide +kernel +theorem gbc66 : Row.check gbW gbR gbr66 = true := by decide +kernel +theorem gbc67 : Row.check gbW gbR gbr67 = true := by decide +kernel +theorem gbc68 : Row.check gbW gbR gbr68 = true := by decide +kernel +theorem gbc69 : Row.check gbW gbR gbr69 = true := by decide +kernel +theorem gbc70 : Row.check gbW gbR gbr70 = true := by decide +kernel +theorem gbc71 : Row.check gbW gbR gbr71 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CTreegbP9.lean b/research/p104-tree-ceiling/lean/Nov15/CTreegbP9.lean new file mode 100644 index 0000000000..e9912d02d3 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CTreegbP9.lean @@ -0,0 +1,11 @@ +import Nov15.CTreegbDefs +namespace CTree +theorem gbc72 : Row.check gbW gbR gbr72 = true := by decide +kernel +theorem gbc73 : Row.check gbW gbR gbr73 = true := by decide +kernel +theorem gbc74 : Row.check gbW gbR gbr74 = true := by decide +kernel +theorem gbc75 : Row.check gbW gbR gbr75 = true := by decide +kernel +theorem gbc76 : Row.check gbW gbR gbr76 = true := by decide +kernel +theorem gbc77 : Row.check gbW gbR gbr77 = true := by decide +kernel +theorem gbc78 : Row.check gbW gbR gbr78 = true := by decide +kernel +theorem gbc79 : Row.check gbW gbR gbr79 = true := by decide +kernel +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CallerCost.lean b/research/p104-tree-ceiling/lean/Nov15/CallerCost.lean new file mode 100644 index 0000000000..644e5b918d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CallerCost.lean @@ -0,0 +1,279 @@ +/- +CALLER-COST . Closed form of the CALLERCO caller invoice (internal notes `caller`, ck.py), +histograms as lists of (rank, count) terms, S = sum r*(T-P), D0 = sum (T-P)*f(r), f r = r ln r (FloorD0 convention), +invoice = caller + calls * native, reproduction of the #7113 caller at 8|9, S(k) = 3408 k - 208, single-crossing in the native +D0 per call, and the abstract composition lemma. Kernel only, no sorry / native_decide. +-/ +import Mathlib.Analysis.SpecialFunctions.Log.Basic +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Algebra.Order.BigOperators.Group.Finset +import Mathlib.Tactic + +namespace CallerCost +open Real + +/-- a histogram: list of (rank, count) terms -/ +abbrev Hist := List (ℕ × ℕ) + +def cnt (l : Hist) (r : ℕ) : ℕ := (l.map fun p => if p.1 = r then p.2 else 0).sum +def Sh (l : Hist) : ℤ := (l.map fun p => (p.1 : ℤ) * p.2).sum +noncomputable def fL (r : ℕ) : ℝ := (r : ℝ) * Real.log r +noncomputable def Dh (l : Hist) : ℝ := (l.map fun p => (p.2 : ℝ) * fL p.1).sum +def scale (L : ℕ) (l : Hist) : Hist := l.map fun p => (p.1, L * p.2) + +structure Inv where + T : Hist + P : Hist + +def Sinv (i : Inv) : ℤ := Sh i.T - Sh i.P +noncomputable def Dinv (i : Inv) : ℝ := Dh i.T - Dh i.P +/-- invoice = caller + L * native (pricekit.invoice, counts scaled by L) -/ +def invoice (c n : Inv) (L : ℕ) : Inv := ⟨c.T ++ scale L n.T, c.P ++ scale L n.P⟩ + +theorem Sh_append (l m : Hist) : Sh (l ++ m) = Sh l + Sh m := by simp [Sh] +theorem Dh_append (l m : Hist) : Dh (l ++ m) = Dh l + Dh m := by simp [Dh] +theorem Sh_scale (L : ℕ) (l : Hist) : Sh (scale L l) = L * Sh l := by + induction l with + | nil => simp [Sh, scale] + | cons p l ih => + simp only [Sh, scale, List.map_cons, List.sum_cons] at ih ⊢ + rw [ih]; push_cast; ring +theorem Dh_scale (L : ℕ) (l : Hist) : Dh (scale L l) = L * Dh l := by + induction l with + | nil => simp [Dh, scale] + | cons p l ih => + simp only [Dh, scale, List.map_cons, List.sum_cons] at ih ⊢ + rw [ih]; push_cast; ring + +theorem invoice_S (c n : Inv) (L : ℕ) : Sinv (invoice c n L) = Sinv c + L * Sinv n := by + simp only [Sinv, invoice, Sh_append, Sh_scale]; ring +theorem invoice_D0 (c n : Inv) (L : ℕ) : Dinv (invoice c n L) = Dinv c + L * Dinv n := by + simp only [Dinv, invoice, Dh_append, Dh_scale]; ring + +/-! ### the caller family C(a|b): g = 8, 96 A ports x 4 thin queries, 8 B ports (s1.py) -/ +def armT (n c : ℕ) : Hist := (List.range n).map fun i => (8 * i + 9, c) +def armP (m c : ℕ) : Hist := (List.range m).map fun i => (8 * i + 16, c) +/-- C(a'+2 | b'+2); stage count k = a'+b'+4. 208 = 2 * 104 ports. -/ +def callerT (a b : ℕ) : Hist := armT (a + 2) 208 ++ armT (b + 2) 208 ++ [(8 * (a + b + 4) + 1, 208)] +def callerP (a b : ℕ) : Hist := + armP a 208 ++ armP b 208 ++ [(8, 384), (1, 384), (8, 16 * (a + b + 4)), (9, 32)] +def caller (a b : ℕ) : Inv := ⟨callerT a b, callerP a b⟩ + +/-- #7113 caller invoice (PRICEKIT caller_invoice of MONOCALLER/7113_CALLER.json), data; nJ = 17 -/ +def dataT : Hist := [(9,416),(17,416),(25,416),(33,416),(41,416),(49,416),(57,416),(65,416),(73,208),(137,208)] +def dataP : Hist := [(1,384),(8,656),(9,32),(16,416),(24,416),(32,416),(40,416),(48,416),(56,416),(64,208)] + +theorem cnt_zero {l : Hist} {r : ℕ} (h : ∀ p ∈ l, p.1 ≠ r) : cnt l r = 0 := by + unfold cnt + apply List.sum_eq_zero + intro x hx + obtain ⟨p, hp, rfl⟩ := List.mem_map.mp hx + simp [h p hp] + +theorem keys_T : ∀ p ∈ callerT 6 7, p.1 < 200 := by decide +theorem keys_P : ∀ p ∈ callerP 6 7, p.1 < 200 := by decide +theorem keys_dT : ∀ p ∈ dataT, p.1 < 200 := by decide +theorem keys_dP : ∀ p ∈ dataP, p.1 < 200 := by decide + +theorem cnt_big {l : Hist} (hl : ∀ p ∈ l, p.1 < 200) {r : ℕ} (hr : 200 ≤ r) : cnt l r = 0 := + cnt_zero fun p hp => by have := hl p hp; omega + +theorem repro_T : ∀ r, cnt (callerT 6 7) r = cnt dataT r := by + intro r + by_cases hr : r < 200 + · interval_cases r <;> decide + · rw [cnt_big keys_T (by omega), cnt_big keys_dT (by omega)] +theorem repro_P : ∀ r, cnt (callerP 6 7) r = cnt dataP r := by + intro r + by_cases hr : r < 200 + · interval_cases r <;> decide + · rw [cnt_big keys_P (by omega), cnt_big keys_dP (by omega)] + +/-- weighted sums depend only on the histogram (keys below N) -/ +theorem wsum_cnt (w : ℕ → ℝ) (N : ℕ) : ∀ l : Hist, (∀ p ∈ l, p.1 < N) → + (l.map fun p => (p.2 : ℝ) * w p.1).sum = ∑ r ∈ Finset.range N, (cnt l r : ℝ) * w r := by + intro l + induction l with + | nil => intro _; simp [cnt] + | cons p l ih => + intro h + have hp : p.1 < N := h p (by simp) + have ih' := ih (fun q hq => h q (by simp [hq])) + have hc : ∀ r, (cnt (p :: l) r : ℝ) = (if p.1 = r then (p.2 : ℝ) else 0) + cnt l r := by + intro r; simp only [cnt, List.map_cons, List.sum_cons]; split_ifs <;> simp + simp only [List.map_cons, List.sum_cons] + rw [ih'] + simp only [hc, add_mul, Finset.sum_add_distrib] + congr 1 + rw [Finset.sum_eq_single p.1] + · simp + · intro b _ hb; simp [Ne.symm hb] + · intro h'; exact absurd (Finset.mem_range.mpr hp) h' + +theorem Dh_congr (l m : Hist) (hl : ∀ p ∈ l, p.1 < 200) (hm : ∀ p ∈ m, p.1 < 200) + (h : ∀ r, cnt l r = cnt m r) : Dh l = Dh m := by + unfold Dh; rw [wsum_cnt fL 200 l hl, wsum_cnt fL 200 m hm] + exact Finset.sum_congr rfl fun r _ => by rw [h r] + +theorem caller89_D0 : + Dh (callerT 6 7) = Dh dataT ∧ Dh (callerP 6 7) = Dh dataP := + ⟨Dh_congr _ _ keys_T keys_dT repro_T, Dh_congr _ _ keys_P keys_dP repro_P⟩ + +theorem caller89_S : Sh (callerT 6 7) = Sh dataT ∧ Sh (callerP 6 7) = Sh dataP := by + constructor <;> decide + +/-- REPRODUCTION: C(8|9) equals the #7113 caller invoice (histograms term for term; hence S and D0). -/ +theorem reproduction : + (∀ r, cnt (caller 6 7).T r = cnt dataT r) ∧ (∀ r, cnt (caller 6 7).P r = cnt dataP r) ∧ + Sinv (caller 6 7) = Sh dataT - Sh dataP ∧ Dinv (caller 6 7) = Dh dataT - Dh dataP := by + refine ⟨repro_T, repro_P, ?_, ?_⟩ + · simp only [Sinv, caller, caller89_S.1, caller89_S.2] + · simp only [Dinv, caller, caller89_D0.1, caller89_D0.2] + +theorem S_data : Sh dataT - Sh dataP = 57728 := by decide + +/-! ### closed forms -/ +theorem Sh_armT (n c : ℕ) : Sh (armT n c) = c * (4 * n * n + 5 * n) := by + induction n with + | zero => simp [armT, Sh] + | succ n ih => + have : armT (n + 1) c = armT n c ++ [(8 * n + 9, c)] := by simp [armT, List.range_succ] + rw [this, Sh_append, ih]; simp [Sh]; push_cast; ring +theorem Sh_armP (m c : ℕ) : Sh (armP m c) = c * (4 * m * m + 12 * m) := by + induction m with + | zero => simp [armP, Sh] + | succ n ih => + have : armP (n + 1) c = armP n c ++ [(8 * n + 16, c)] := by simp [armP, List.range_succ] + rw [this, Sh_append, ih]; simp [Sh]; push_cast; ring + +/-- caller S is affine in the stage count k = a+b+4: S = 3408 k - 208 (96 A + 8 B ports; both arms >= 2) -/ +theorem S_caller (a b : ℕ) : Sinv (caller a b) = 3408 * ((a : ℤ) + b + 4) - 208 := by + simp only [Sinv, caller, callerT, callerP, Sh_append, Sh_armT, Sh_armP] + simp [Sh]; push_cast; ring + +/-- S of the whole invoice with calls = k: (3408 + Sn) k - 208 -/ +theorem S_invoice (a b : ℕ) (n : Inv) : + Sinv (invoice (caller a b) n (a + b + 4)) = (3408 + Sinv n) * ((a : ℤ) + b + 4) - 208 := by + rw [invoice_S, S_caller]; push_cast; ring + +/-- with the #7630 native (S per call = -3312, from S = 1424 at k = 17): S(k) = 96 k - 208 -/ +theorem S_7630 (a b : ℕ) (n : Inv) (hn : Sinv n = -3312) : + Sinv (invoice (caller a b) n (a + b + 4)) = 96 * ((a : ℤ) + b + 4) - 208 := by + rw [S_invoice, hn]; ring + +theorem S_7630_k17 (n : Inv) (hn : Sinv n = -3312) : + Sinv (invoice (caller 6 7) n 17) = 1424 := by + have := S_7630 6 7 n hn; simpa using this + +theorem Dh_armT (n c : ℕ) : Dh (armT n c) = c * ∑ i ∈ Finset.range n, fL (8 * i + 9) := by + induction n with + | zero => simp [armT, Dh] + | succ n ih => + have : armT (n + 1) c = armT n c ++ [(8 * n + 9, c)] := by simp [armT, List.range_succ] + rw [this, Dh_append, ih, Finset.sum_range_succ]; simp [Dh]; ring +theorem Dh_armP (n c : ℕ) : Dh (armP n c) = c * ∑ i ∈ Finset.range n, fL (8 * i + 16) := by + induction n with + | zero => simp [armP, Dh] + | succ n ih => + have : armP (n + 1) c = armP n c ++ [(8 * n + 16, c)] := by simp [armP, List.range_succ] + rw [this, Dh_append, ih, Finset.sum_range_succ]; simp [Dh]; ring + +theorem fL_one : fL 1 = 0 := by simp [fL] + +/-- caller D0 (the stage-count cost C(k), exact): the sums are over the ranks 8j+1 (T) and 8j (P) -/ +theorem D0_caller (a b : ℕ) : Dinv (caller a b) = + 208 * (∑ i ∈ Finset.range (a + 2), fL (8 * i + 9) + ∑ i ∈ Finset.range (b + 2), fL (8 * i + 9) + + fL (8 * (a + b + 4) + 1) + - ∑ i ∈ Finset.range a, fL (8 * i + 16) - ∑ i ∈ Finset.range b, fL (8 * i + 16)) + - (384 + 16 * ((a : ℝ) + b + 4)) * fL 8 - 32 * fL 9 := by + simp only [Dinv, caller, callerT, callerP, Dh_append, Dh_armT, Dh_armP] + simp [Dh, fL_one]; ring + +/-! ### single crossing: a cheaper native can only lower the best stage count (first-order proxy K = S/D0) -/ +section crossing +variable {s ρ Dc1 Dc2 k1 k2 d d' : ℝ} + +/-- proxy objective K_d(k) = S(k) / (Dc(k) + k d), S(k) = s k - ρ, d = native D0 per call, calls = k -/ +theorem single_crossing (hρ : 0 < ρ) (hk : k1 ≤ k2) (hd : d ≤ d') + (hD1 : 0 < Dc1 + k1 * d) (hD2 : 0 < Dc2 + k2 * d) + (hD1' : 0 < Dc1 + k1 * d') (hD2' : 0 < Dc2 + k2 * d') + (h : (s * k1 - ρ) / (Dc1 + k1 * d) ≤ (s * k2 - ρ) / (Dc2 + k2 * d)) : + (s * k1 - ρ) / (Dc1 + k1 * d') ≤ (s * k2 - ρ) / (Dc2 + k2 * d') := by + rw [div_le_div_iff₀ hD1 hD2] at h + rw [div_le_div_iff₀ hD1' hD2'] + have : 0 ≤ (d' - d) * (ρ * (k2 - k1)) := mul_nonneg (by linarith) (mul_nonneg hρ.le (by linarith)) + nlinarith + +/-- contrapositive form: if at the costlier native the smaller k is (weakly) preferred, it is at the cheaper native too; + equivalently the best k never goes up when D0 per call goes down -/ +theorem cheaper_native_lowers_k (hρ : 0 < ρ) (hk : k1 ≤ k2) (hd : d ≤ d') + (hD1 : 0 < Dc1 + k1 * d) (hD2 : 0 < Dc2 + k2 * d) + (hD1' : 0 < Dc1 + k1 * d') (hD2' : 0 < Dc2 + k2 * d') + (h : (s * k2 - ρ) / (Dc2 + k2 * d') < (s * k1 - ρ) / (Dc1 + k1 * d')) : + (s * k2 - ρ) / (Dc2 + k2 * d) < (s * k1 - ρ) / (Dc1 + k1 * d) := by + by_contra hn + exact absurd (single_crossing hρ hk hd hD1 hD2 hD1' hD2' (not_lt.mp hn)) (not_le.mpr h) + +/-- the crossing native D0 per call at which k1 and k2 tie (proxy): d* = (S1 Dc2 - S2 Dc1) / (ρ (k2 - k1)) -/ +theorem crossing_value (hρ : 0 < ρ) (hk : k1 < k2) : + (s * k1 - ρ) * (Dc2 + k2 * d) = (s * k2 - ρ) * (Dc1 + k1 * d) ↔ + d = ((s * k1 - ρ) * Dc2 - (s * k2 - ρ) * Dc1) / (ρ * (k2 - k1)) := by + have hne : ρ * (k2 - k1) ≠ 0 := (mul_pos hρ (by linarith)).ne' + rw [eq_div_iff hne] + constructor <;> intro h <;> nlinarith + +/-- sensitivity: d/dd of the stationarity numerator N = S'D - SD' (D = Dc + k d) is k S' - S = rho > 0. + (CALLERCO R1 sec 3 writes -(kS'-S); the sign convention there is reversed, the conclusion "cheaper native -> smaller k" is the same.) -/ +theorem stationarity_slope (s ρ Dc Dc' k d : ℝ) : + (s * (Dc + k * d) - (s * k - ρ) * (Dc' + d)) = (s * Dc - (s * k - ρ) * Dc') + ρ * d := by ring +end crossing + +/-! ### composition: invoice D0 >= caller floor + calls * native floor -/ +section composition +variable {Cl : Type} + +/-- Abstract composition. A caller class Cl with D0 cost Dc and call count `calls`; native per-call D0 Dn. + hc: caller floor as a function of the number of calls it makes; hn: a floor on the TOTAL native D0 per call. -/ +theorem composition (Dc : Cl → ℝ) (calls : Cl → ℕ) (Fc : ℕ → ℝ) (Dn Fn : ℝ) + (hc : ∀ c, Fc (calls c) ≤ Dc c) (hn : Fn ≤ Dn) (c : Cl) : + Fc (calls c) + calls c * Fn ≤ Dc c + calls c * Dn := by + have := hc c + have : (calls c : ℝ) * Fn ≤ calls c * Dn := mul_le_mul_of_nonneg_left hn (Nat.cast_nonneg _) + linarith + +/-- the native's D0 per call splits as helperD0 + rest (mains and owned MOVEs; these are CREDITS, rest <= 0 on #7630). + The helper-only floor therefore needs a cap R on the credits: rest >= -R. -/ +theorem composition_helper (Dc : Cl → ℝ) (calls : Cl → ℕ) (Fc : ℕ → ℝ) (H rest Hf R : ℝ) + (hc : ∀ c, Fc (calls c) ≤ Dc c) (hH : Hf ≤ H) (hR : -R ≤ rest) (c : Cl) : + Fc (calls c) + calls c * (Hf - R) ≤ Dc c + calls c * (H + rest) := + composition Dc calls Fc (H + rest) (Hf - R) hc (by linarith) c + +/-- the proxy kappa is bounded by S / (floor) when the floor is positive -/ +theorem kappa_proxy_le {S D F : ℝ} (hS : 0 ≤ S) (hF : 0 < F) (hFD : F ≤ D) : S / D ≤ S / F := + div_le_div_of_nonneg_left hS hF hFD + +/-- FALSE AS WRITTEN: "invoice D0 >= caller D0 + calls * helperD0-floor" (helper floor 9,928.76 per call on #7630, + caller D0 270,813, calls 17, invoice D0 391,295.63 (R1 sec 2; numbers are hypotheses/data)). The missing term is the + mains/owned MOVE credits (negative D0). Counterexample: -/ +theorem naive_composition_false : + ¬ ((270813 : ℝ) + 17 * 9928.76 ≤ 391295.63) := by norm_num + +/-- the credits implied by the data: rest per call = (391295.63 - 270813)/17 - 9928.76 < 0 -/ +theorem rest_negative : (391295.63 - 270813 : ℝ) / 17 - 9928.76 < 0 := by norm_num + +end composition + +#print axioms reproduction +#print axioms S_caller +#print axioms S_7630_k17 +#print axioms D0_caller +#print axioms invoice_S +#print axioms invoice_D0 +#print axioms single_crossing +#print axioms cheaper_native_lowers_k +#print axioms crossing_value +#print axioms composition +#print axioms composition_helper +#print axioms naive_composition_false + +end CallerCost diff --git a/research/p104-tree-ceiling/lean/Nov15/CallerCost.md b/research/p104-tree-ceiling/lean/Nov15/CallerCost.md new file mode 100644 index 0000000000..da373369e1 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CallerCost.md @@ -0,0 +1,18 @@ +# CallerCost.lean: caller cost closed form, reproduction, single crossing, composition +Imports Mathlib only (no Nov15 deps).9 GB. 12 `#print axioms` within [propext, Classical.choice, Quot.sound]; no sorry, no native_decide. + +## Model +- Histograms = lists of (rank,count). S = sum r*(T-P) (Sinv), D0 = sum (T-P) f(r), f r = r ln r (fL, FloorD0 convention). invoice c n L = caller + L*native (counts scaled), `invoice_S`, `invoice_D0` exact. In the pricer the number of calls L = nJ = k = a+b (stage count). +- Caller family C(a|b), g=8, 96 A ports x 4 thin queries, 8 B ports (a,b >= 2; Lean params a'=a-2, b'=b-2, k = a'+b'+4). T: ranks 8j+1, j<=arm (and 8k+1), 208 = 2*104 each; P: ranks 8j, 2<=j<=arm-1, plus (8: 384+16k, 1: 384, 9: 32). +- The code does NOT use a Z^4 over ln 2/3/5/7 form (it works in Decimal over all ranks up to 137, which involve many primes). Exact form in Lean: `D0_caller`, a finite sum of f over the ranks 8j+1 and 8j, minus (384+16k) f(8) + 32 f(9) (f(1)=0). + +## Proved +- `reproduction`: C(8|9) = caller 6 7 equals the #7113 caller invoice (data lists dataT/dataP, transcribed from the pricer's invoice of the #7113 caller file) term for term as histograms (cnt equal at every rank), hence S and D0 equal (`caller89_S`, `caller89_D0`). S = 57728 (`S_data`). Data are transcribed; the Lean statement is about those lists. +- `S_caller`: S(caller) = 3408 k - 208. `S_invoice`: with calls = k, S = (3408 + S_n) k - 208. `S_7630`: S_n = -3312 gives 96 k - 208, and `S_7630_k17` gives 1424 (S' = 96, rho = 208 as in R1 sec 3). +- Single crossing (first-order proxy K = S/D0, S = sk - rho, D = Dc(k) + k d): `single_crossing`: for k1 <= k2, d <= d', K_d(k1) <= K_d(k2) implies K_d'(k1) <= K_d'(k2). `cheaper_native_lowers_k`: strict contrapositive, a cheaper native (d down) never favours a larger k. `crossing_value`: tie at d* = (S1 Dc2 - S2 Dc1)/(rho (k2-k1)). Convexity of C(k) not attempted (not clean: arm terms are sums of r ln r over unequal strides). +- `composition`: abstract caller class, caller floor Fc(calls) <= Dc, total native floor Fn <= Dn gives Fc(k) + k Fn <= invoice D0. `composition_helper`: with native D0 = helperD0 + rest, needs a cap rest >= -R on the mains/owned credits. `kappa_proxy_le`: S/D <= S/F. + +## Statements false / imprecise +1. FALSE as written: "invoice D0 >= caller floor + calls * (helperD0 floor)". With the numbers of the caller-floor note (helper floor 9,928.76 per call as helper D0 on #7630, caller D0 270,813 = 666,499 - 395,686, 17 calls, invoice D0 391,295.63): 270,813 + 17*9,928.76 = 439,602 > 391,296 (`naive_composition_false`). Reason: the native's main/owned MOVEs are credits (negative D0, `rest_negative`: about -2,842 per call). FloorD0's floor is on helperD0 only. Corrected: `composition` with a floor on TOTAL native D0 per call, or `composition_helper` with an explicit credit cap R. A caller-floor statement needs one of these. +2. Sign slip in the caller-ceiling note, section 3: d/dd of the numerator S'D - SD' is +(kS' - S) = +rho (`stationarity_slope`), not -rho. The conclusion (cheaper native lowers k*) is unchanged. +3. Scope: monotonicity is for the proxy S/D0 (kappa ~ S/D), not the exact root kappa of F(t) = 0; the exact-kappa version is not proved here. diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3.lean new file mode 100644 index 0000000000..3088163ca8 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3.lean @@ -0,0 +1,377 @@ +import Nov15.CongestionI3Cfg +import Nov15.CongestionI3Mu +import Nov15.CongestionI3NumA +import Nov15.CongestionI3NumC4 +import Nov15.WholeFloorCover +import Mathlib.Analysis.Convex.SpecificFunctions.Pow +import Mathlib.Analysis.Convex.SpecificFunctions.Basic +import Mathlib.Analysis.SpecialFunctions.Log.Base + +/-! +CONGESTION-I3 : the I3 congestion bound and F1's restricted-class ceilings (internal notes: F1.md, +AUDIT.md, LIFT1.md, AUDIT-LIFT.md, LIFT2.md; JUNKINT I3). See CongestionI3.md for the scope list. Kernel only: no sorry, no native_decide. + +Sections: 1 per-pair bound (I3 is a HYPOTHESIS `I3Path`, in model M_V; the shape-DAG minimum is a data hypothesis), 2 forced junk >= 1936 +(kernel-checked configurations + census; per-chain flag-DP minima are a data hypothesis), 3 combination with R3 by MAX, 4 the ceilings. +-/ +namespace CongestionI3 +open NumCertK JointCeiling CallerCost + +/-! ### 1. I3: public excess >= per-pair distance, summed over supp J -/ + +/-- JUNKINT I3 (F1.md sec. 1): in model M_V (every public register except the Y mains ends at V; owned code fixed; X_q born at A_q) the public +excess `E` over R3's per-register floors is at least the sum over the junk pairs of the shortest-path distance. NOT derived here (the +telescoping I1/I2 and the path bound are not formalised): it is the hypothesis `I3Path`, always taken together with its scope. -/ +def I3Path (J : Finset (ℕ × ℕ)) (dist : ℕ × ℕ → ℝ) (E : ℝ) : Prop := ∑ p ∈ J, dist p ≤ E + +/-- per-pair minimum => E >= delta * |J| -/ +theorem pair_bound {J : Finset (ℕ × ℕ)} {dist : ℕ × ℕ → ℝ} {E δ : ℝ} (hd : ∀ p ∈ J, δ ≤ dist p) (h : I3Path J dist E) : + δ * J.card ≤ E := by + have := Finset.card_nsmul_le_sum J dist δ hd + rw [nsmul_eq_mul] at this + unfold I3Path at h + linarith + +/-- D0 currency: shape-DAG minimum 0.541495 per even pair (F1 sec. 1, reproduced by the auditor); 1936 pairs give >= 1048.33 D0 per call. -/ +theorem i3_D0_per_call {J : Finset (ℕ × ℕ)} {dist : ℕ × ℕ → ℝ} {E : ℝ} (hd : ∀ p ∈ J, (0.541495 : ℝ) ≤ dist p) + (h : I3Path J dist E) (hJ : 1936 ≤ J.card) : (1048.33 : ℝ) ≤ E := by + have h1 := pair_bound hd h + have h2 : (1936 : ℝ) ≤ J.card := by exact_mod_cast hJ + nlinarith + +/-! ### 2. forced junk >= 1936 pairs per call for rank-8 C = 56 decoders -/ + +def mu (i k : ℕ) : ℕ := (muTab.getD i []).getD k 0 +/-- every configuration's per-chain minima sum to >= 1936 (kernel) -/ +theorem mu_sum : ∀ i < 8, 1936 ≤ ∑ k ∈ Finset.range 8, mu i k := by decide +kernel + +/-- **forced junk >= 1936 pairs** for a rank-8, C = 56 decoder (one of the 8 configurations `i` of `cfgs`). Scope/hypotheses, all explicit: +* `hsub`: the chain-k forced cells `F k` are unique cells of chain k (exactly one chain can touch them; kernel-defined `uniqCells`); +* `hJ`: forced cells lie in supp J (a product forced non-zero on a cell no other chain touches cannot be cancelled); +* `hDP`: the per-chain flag-DP minimum (data, internal notes, python exact DP over the subspace lattice, NOT kernel-checked). +The decoder class itself (rank-8 on P104 labels, C = 56, rigidity M^ = D1 G D2 quoted numerically, enumeration exhaustive = 12,870 subsets) is the +hypothesis `i < 8`. -/ +theorem forced_junk_ge (i : ℕ) (hi : i < 8) (J : Finset (ℕ × ℕ)) (F : ℕ → Finset (ℕ × ℕ)) + (hsub : ∀ k < 8, F k ⊆ uniqCells (cfgs.getD i []) k) (hJ : ∀ k < 8, F k ⊆ J) + (hDP : ∀ k < 8, mu i k ≤ (F k).card) : 1936 ≤ J.card := by + have hdisj : ∀ k ∈ Finset.range 8, ∀ k' ∈ Finset.range 8, k ≠ k' → Disjoint (F k) (F k') := by + intro k hk k' hk' hne + exact (uniqCells_disjoint (cfgs.getD i []) hne).mono (hsub k (Finset.mem_range.mp hk)) (hsub k' (Finset.mem_range.mp hk')) + have h1 : (Finset.range 8).biUnion F ⊆ J := by + intro p hp + obtain ⟨k, hk, hp⟩ := Finset.mem_biUnion.mp hp + exact hJ k (Finset.mem_range.mp hk) hp + have h2 : ((Finset.range 8).biUnion F).card = ∑ k ∈ Finset.range 8, (F k).card := + Finset.card_biUnion (fun k hk k' hk' hne => hdisj k hk k' hk' hne) + have h3 : ∑ k ∈ Finset.range 8, mu i k ≤ ∑ k ∈ Finset.range 8, (F k).card := + Finset.sum_le_sum fun k hk => hDP k (Finset.mem_range.mp hk) + have h4 := mu_sum i hi + calc 1936 ≤ ∑ k ∈ Finset.range 8, (F k).card := le_trans h4 h3 + _ = ((Finset.range 8).biUnion F).card := h2.symm + _ ≤ J.card := Finset.card_le_card h1 + +/-! ### 3. combination with R3: by MAX, not sum -/ + +/-- **F1 floor in F currency (max rule).** The word's public overpay `E` (F currency) is priced by BOTH R3's forced stops (E >= (2 - 2^s) st, +st + mp >= 104 with lat = 0, nested words) and by I3 (E >= I). Both bound the SAME quantity, so the floor is R1/R2's owned 16 plus +`max (88 (2 - 2^s)) I`. I = 0 recovers R3's `-Nfl`. -/ +theorem f1_floor (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (mp st : ℕ) (Fn E I : ℝ) + (hF : Fn ≤ -400 * (8 : ℝ) ^ s - mp - E) (hmp : 16 ≤ mp) (hY : 104 ≤ st + mp) + (hst : (2 - (2 : ℝ) ^ s) * st ≤ E) (hI : I ≤ E) : + Fn ≤ -400 * (8 : ℝ) ^ s - 16 - max (88 * (2 - (2 : ℝ) ^ s)) I := by + have hu1 : (1 : ℝ) ≤ (2 : ℝ) ^ s := Real.one_le_rpow (by norm_num) hs0 + have hu2 : (2 : ℝ) ^ s ≤ 2 := by + have := Real.rpow_le_rpow_of_exponent_le (show (1 : ℝ) ≤ 2 by norm_num) hs1 + simpa using this + set c : ℝ := 2 - (2 : ℝ) ^ s with hc + have hc0 : 0 ≤ c := by linarith + have hc1 : c ≤ 1 := by linarith + have hm : (16 : ℝ) ≤ mp := by exact_mod_cast hmp + have hY' : (104 : ℝ) ≤ st + mp := by exact_mod_cast hY + have hst0 : (0 : ℝ) ≤ st := Nat.cast_nonneg _ + have hE0 : 0 ≤ E := le_trans (mul_nonneg hc0 hst0) hst + suffices h : (16 : ℝ) + max (88 * c) I ≤ mp + E by linarith + rcases le_total (88 * c) I with h | h + · rw [max_eq_right h]; linarith + · rw [max_eq_left h] + rcases le_or_gt (mp : ℝ) 104 with h2 | h2 + · have h3 : c * (104 - mp) ≤ c * st := mul_le_mul_of_nonneg_left (by linarith) hc0 + nlinarith + · nlinarith + +/-- the max rule is not a sum rule: both hypotheses hold with E = max and fail for the sum (so `max` is all the two bounds give). -/ +theorem sum_not_implied : ∃ E I R : ℝ, I ≤ E ∧ R ≤ E ∧ ¬ (I + R ≤ E) := ⟨1, 1, 1, le_refl _, le_refl _, by norm_num⟩ + +/-! ### 4. the ceiling kappa <= .0183952347 (8|9) -/ + +/-- the native of F1's relaxation: owned floor `400 * 8^s + 16`, no stops -/ +def natBase : Inv := ⟨[], [(8, 400), (1, 16)]⟩ +theorem natBase_F (s : ℝ) : Finv s natBase = -(400 * (8 : ℝ) ^ s + 16) := by + simp [Finv, natBase, Fh] + +theorem base_eq (s : ℝ) : Finv s (invoice (caller 6 7) natBase 17) = Fc cfB s := by + simp only [Finv, Fh, invoice, caller, callerT, callerP, armT, armP, natBase, scale, Fc, cfB, + List.range_succ, List.range_zero] + norm_num + ring + +/-- tbar = .0183952347 -/ +def tbarA : ℚ := 183952347 / 10 ^ 10 +theorem sA_eq : sA = 1 - tbarA := by unfold sA tbarA; norm_num + +/-- **F1 ceiling, 8|9 (kappa <= .0183952347)** for words in the restricted class, with every hypothesis explicit: +* scope (propositions the caller must supply): `MV` (model M_V), `Rank8C56` (rank-8 decoder, C = 56 on P104 labels, one of the 8 configurations `i`), + `PlaneSep` (no second-plane carrier of plane-1 content) -- under `PlaneSep` fails the junk bound collapses to 0 (F1 f1k2); LIFT1 replaces it by + the public-provenance direction law (see `ceiling_A_noSep`). `nested`: lat = 0 (verifier rule, WholeFloorNest). +* `hI3`: I3 in F currency, `E s >= sum of per-pair F-distances` (hypothesis `I3Path`, valid under the scope); +* `hdist`: per-pair shape-DAG minimum `sigma0 <= sp_F(t)` for t in [tbar, .1] (DATA: f1ceil.spF at tbar; monotone in t numerically, AUDIT: the + convex/superadditive proof of monotonicity was not re-derived); +* `hforced`/`hDP`: section 2 (|J| >= 1936). +Conclusion: F < 0 on the 17-call invoice of the #7113 caller for every t in [tbar, 1] -- the ceiling convention of JointCeiling/WholeFloorCover. -/ +theorem ceiling_A (MV Rank8C56 PlaneSep : Prop) (hMV : MV) (hR : Rank8C56) (hP : PlaneSep) + (n : Inv) (mp st : ℕ) (E : ℝ → ℝ) (J : Finset (ℕ × ℕ)) (distF : ℝ → ℕ × ℕ → ℝ) + (hF : ∀ s, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - mp - E s) + (hmp : 16 ≤ mp) (hY : 104 ≤ st + mp) + (hst : ∀ s, 0 ≤ s → s ≤ 1 → (2 - (2 : ℝ) ^ s) * st ≤ E s) + (hI3 : MV → Rank8C56 → PlaneSep → ∀ s, 0 ≤ s → s ≤ 1 → I3Path J (distF s) (E s)) + (hdist : ∀ s, 9 / 10 ≤ s → s ≤ ((sA : ℚ) : ℝ) → ∀ p ∈ J, ((sigma0 : ℚ) : ℝ) ≤ distF s p) + (hJ : 1936 ≤ J.card) : + ∀ t : ℝ, ((tbarA : ℚ) : ℝ) ≤ t → t ≤ 1 → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 := by + intro t ht ht1 + have hsA : ((sA : ℚ) : ℝ) = 1 - ((tbarA : ℚ) : ℝ) := by rw [sA_eq]; push_cast; ring + have htb0 : (0 : ℝ) ≤ ((tbarA : ℚ) : ℝ) := by unfold tbarA; norm_num + have hs0 : (0 : ℝ) ≤ 1 - t := by linarith + have htb1 : ((tbarA : ℚ) : ℝ) ≤ 1 / 10 := by unfold tbarA; norm_num + have hs1 : 1 - t ≤ 1 := by linarith + have hu1 : (1 : ℝ) ≤ (2 : ℝ) ^ (1 - t) := Real.one_le_rpow (by norm_num) hs0 + have hu2 : (2 : ℝ) ^ (1 - t) ≤ 2 := by + have := Real.rpow_le_rpow_of_exponent_le (show (1 : ℝ) ≤ 2 by norm_num) hs1; simpa using this + have hE0 : 0 ≤ E (1 - t) := + le_trans (mul_nonneg (by linarith) (Nat.cast_nonneg st)) (hst _ hs0 hs1) + rcases le_or_gt (1 / 10 : ℝ) t with h10 | h10 + · -- t >= .1: R3 (I = 0), then the WholeFloorCover cover + have h1 := f1_floor (1 - t) hs0 hs1 mp st (Finv (1 - t) n) (E (1 - t)) 0 (hF _ hs0 hs1) hmp hY (hst _ hs0 hs1) hE0 + have hc0 : (0 : ℝ) ≤ 88 * (2 - (2 : ℝ) ^ (1 - t)) := by linarith + rw [max_eq_left hc0] at h1 + have h2 := invoice_F (1 - t) (caller 6 7) n 17 + have h3 := invoice_F (1 - t) (caller 6 7) natFloor 17 + have h4 := natFloor_F (1 - t) + have h5 := WholeFloorCover.cover t (by linarith) ht1 + have h6 : Nfl (1 - t) = 400 * (8 : ℝ) ^ (1 - t) + 16 + 88 * (2 - (2 : ℝ) ^ (1 - t)) := rfl + push_cast at h2 h3 + nlinarith + · -- t in [tbar, .1): I3 lift + have hsl : (9 / 10 : ℝ) ≤ 1 - t := by linarith + have hsr : 1 - t ≤ ((sA : ℚ) : ℝ) := by rw [hsA]; linarith + have hsum := pair_bound (hdist _ hsl hsr) (hI3 hMV hR hP _ hs0 hs1) + have hE : (1936 : ℝ) * ((sigma0 : ℚ) : ℝ) ≤ E (1 - t) := by + have : (1936 : ℝ) ≤ J.card := by exact_mod_cast hJ + have h0 : (0 : ℝ) ≤ ((sigma0 : ℚ) : ℝ) := by unfold sigma0; norm_num + nlinarith + have h1 := f1_floor (1 - t) hs0 hs1 mp st (Finv (1 - t) n) (E (1 - t)) (1936 * ((sigma0 : ℚ) : ℝ)) (hF _ hs0 hs1) hmp hY + (hst _ hs0 hs1) hE + have h1' : Finv (1 - t) n ≤ -400 * (8 : ℝ) ^ (1 - t) - 16 - 1936 * ((sigma0 : ℚ) : ℝ) := by + have := le_max_right (88 * (2 - (2 : ℝ) ^ (1 - t))) (1936 * ((sigma0 : ℚ) : ℝ)) + linarith + have h2 := invoice_F (1 - t) (caller 6 7) n 17 + have h3 := invoice_F (1 - t) (caller 6 7) natBase 17 + have h4 := natBase_F (1 - t) + have h5 := cfB_neg (1 - t) hsl hsr + have h6 := base_eq (1 - t) + have h7 : ((liftA : ℚ) : ℝ) = 17 * 1936 * ((sigma0 : ℚ) : ℝ) := by unfold liftA; push_cast; ring + push_cast at h2 h3 + nlinarith + + +/-! ### 5. descent-mass >= 56 charge and the own56 ceiling (kappa <= .0134769139) -/ + +/-- F price of a descent list (owned MOVEs of ranks `k`): sum of k^s -/ +noncomputable def dprice (ks : List ℕ) (s : ℝ) : ℝ := (ks.map fun k : ℕ => ((k : ℕ) : ℝ) ^ s).sum + +/-- concavity chord on [1, 9] -/ +theorem chord_k (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (k : ℝ) (hk1 : 1 ≤ k) (hk9 : k ≤ 9) : + 1 + ((9 : ℝ) ^ s - 1) / 8 * (k - 1) ≤ k ^ s := by + have hc := (Real.concaveOn_rpow hs0 hs1).2 (show (1 : ℝ) ∈ Set.Ici 0 by simp) (show (9 : ℝ) ∈ Set.Ici 0 by simp) + (show 0 ≤ (9 - k) / 8 by linarith) (show 0 ≤ (k - 1) / 8 by linarith) (show (9 - k) / 8 + (k - 1) / 8 = 1 by ring) + simp only [smul_eq_mul, Real.one_rpow] at hc + have e : (9 - k) / 8 * 1 + (k - 1) / 8 * 9 = k := by ring + rw [e] at hc + nlinarith + +theorem dprice_ge (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (ks : List ℕ) (hk : ∀ k ∈ ks, 1 ≤ k ∧ k ≤ 9) : + ks.length + ((9 : ℝ) ^ s - 1) / 8 * ((ks.sum : ℕ) - ks.length) ≤ dprice ks s := by + induction ks with + | nil => simp [dprice] + | cons a l ih => + have ha := hk a (by simp) + have hl : ∀ k ∈ l, 1 ≤ k ∧ k ≤ 9 := fun k hk' => hk k (by simp [hk']) + have ih := ih hl + have h1 := chord_k s hs0 hs1 (a : ℝ) (by exact_mod_cast ha.1) (by exact_mod_cast ha.2) + simp only [dprice, List.map_cons, List.sum_cons, List.length_cons] at ih ⊢ + simp only [Nat.cast_add, Nat.cast_one] + nlinarith + +/-- 9^s <= 8 * 2^s - 7 on [0,1] (convexity of u -> u^p, p = log_2 9, on [1,2]; equality at s = 0, 1). It gives +`(9 - 9^s)/8 >= 2 - 2^s`: an extra descent move is never cheaper than a forced stop it replaces. -/ +theorem nine_chord (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : (9 : ℝ) ^ s ≤ 8 * (2 : ℝ) ^ s - 7 := by + set p : ℝ := Real.logb 2 9 with hp + have h2p : (2 : ℝ) ^ p = 9 := Real.rpow_logb (by norm_num) (by norm_num) (by norm_num) + have hp1 : 1 ≤ p := by + have : (2 : ℝ) ^ (1 : ℝ) ≤ (2 : ℝ) ^ p := by rw [Real.rpow_one, h2p]; norm_num + exact (Real.rpow_le_rpow_left_iff (by norm_num : (1 : ℝ) < 2)).mp this + have hu1 : (1 : ℝ) ≤ (2 : ℝ) ^ s := Real.one_le_rpow (by norm_num) hs0 + have hu2 : (2 : ℝ) ^ s ≤ 2 := by + have := Real.rpow_le_rpow_of_exponent_le (show (1 : ℝ) ≤ 2 by norm_num) hs1; simpa using this + have hc := (convexOn_rpow hp1).2 (show (1 : ℝ) ∈ Set.Ici 0 by simp) (show (2 : ℝ) ∈ Set.Ici 0 by simp) + (show 0 ≤ 2 - (2 : ℝ) ^ s by linarith) (show 0 ≤ (2 : ℝ) ^ s - 1 by linarith) + (show (2 - (2 : ℝ) ^ s) + ((2 : ℝ) ^ s - 1) = 1 by ring) + simp only [smul_eq_mul, Real.one_rpow] at hc + have e : (2 - (2 : ℝ) ^ s) * 1 + ((2 : ℝ) ^ s - 1) * 2 = (2 : ℝ) ^ s := by ring + rw [e, h2p] at hc + have e2 : ((2 : ℝ) ^ s) ^ p = (9 : ℝ) ^ s := by + rw [← Real.rpow_mul (by norm_num), mul_comm, Real.rpow_mul (by norm_num), h2p] + rw [e2] at hc + nlinarith + +/-- **own56 floor (F currency, max rule)**: a rank-8 C = 56 decoder has descent mass >= 56 (hypothesis `hmass`, the F1 premise; descents are owned +MOVEs of rank k in 1..9), at least 8 descents and 8 rises (R1/R2). Charging the descents at their true F price `sum k^s` (>= 6 * 9^s + 2) and the 8 +rises at 1 each gives the floor `-400 8^s - (6 9^s + 10) - max (88 (2 - 2^s)) I`; extra moves beyond 8 + 8 cost at least what the stops they remove +save (`nine_chord`). -/ +theorem own56_floor (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (ks : List ℕ) (hk : ∀ k ∈ ks, 1 ≤ k ∧ k ≤ 9) + (hmass : 56 ≤ ks.sum) (hmd : 8 ≤ ks.length) (mr st : ℕ) (hmr : 8 ≤ mr) (Fn E I : ℝ) + (hF : Fn ≤ -400 * (8 : ℝ) ^ s - dprice ks s - mr - E) (hY : 104 ≤ st + (ks.length + mr)) + (hst : (2 - (2 : ℝ) ^ s) * st ≤ E) (hI : I ≤ E) : + Fn ≤ -400 * (8 : ℝ) ^ s - (6 * (9 : ℝ) ^ s + 10) - max (88 * (2 - (2 : ℝ) ^ s)) I := by + have hu1 : (1 : ℝ) ≤ (2 : ℝ) ^ s := Real.one_le_rpow (by norm_num) hs0 + have hu2 : (2 : ℝ) ^ s ≤ 2 := by + have := Real.rpow_le_rpow_of_exponent_le (show (1 : ℝ) ≤ 2 by norm_num) hs1; simpa using this + have h9a : (1 : ℝ) ≤ (9 : ℝ) ^ s := Real.one_le_rpow (by norm_num) hs0 + have h9b : (9 : ℝ) ^ s ≤ 9 := by + have := Real.rpow_le_rpow_of_exponent_le (show (1 : ℝ) ≤ 9 by norm_num) hs1; simpa using this + have hch := nine_chord s hs0 hs1 + have hdp := dprice_ge s hs0 hs1 ks hk + set c : ℝ := 2 - (2 : ℝ) ^ s with hc + have hc0 : 0 ≤ c := by linarith + have hc1 : c ≤ 1 := by linarith + set b : ℝ := ((9 : ℝ) ^ s - 1) / 8 with hb + have hb0 : 0 ≤ b := by rw [hb]; linarith + have hcb : c ≤ 1 - b := by rw [hb, hc]; linarith + have hm : (8 : ℝ) ≤ ks.length := by exact_mod_cast hmd + have hmr' : (8 : ℝ) ≤ mr := by exact_mod_cast hmr + have hmass' : (56 : ℝ) ≤ ((ks.sum : ℕ) : ℝ) := by exact_mod_cast hmass + have hY' : (104 : ℝ) ≤ st + (ks.length + mr) := by exact_mod_cast hY + have hst0 : (0 : ℝ) ≤ st := Nat.cast_nonneg _ + have hE0 : 0 ≤ E := le_trans (mul_nonneg hc0 hst0) hst + have hA : (ks.length : ℝ) + b * (56 - ks.length) ≤ dprice ks s := by + have : b * (56 - ks.length) ≤ b * (((ks.sum : ℕ) : ℝ) - ks.length) := mul_le_mul_of_nonneg_left (by linarith) hb0 + linarith + have e9 : (9 : ℝ) ^ s = 8 * b + 1 := by rw [hb]; ring + rw [e9] + suffices h : (6 * (8 * b + 1) + 10) + max (88 * c) I ≤ dprice ks s + mr + E by linarith + have hx : 0 ≤ ((ks.length : ℝ) - 8) * (1 - b - c) := mul_nonneg (by linarith) (by linarith) + have hy : 0 ≤ ((mr : ℝ) - 8) * (1 - c) := mul_nonneg (by linarith) (by linarith) + have hxb : 0 ≤ ((ks.length : ℝ) - 8) * b := mul_nonneg (by linarith) hb0 + rcases le_total (88 * c) I with h | h + · rw [max_eq_right h] + have hx2 : 0 ≤ ((ks.length : ℝ) - 8) * (1 - b) := mul_nonneg (by linarith) (by linarith) + nlinarith + · rw [max_eq_left h] + have h3 : c * (104 - ks.length - mr) ≤ c * st := mul_le_mul_of_nonneg_left (by linarith) hc0 + nlinarith + +/-- the cap/correction form of I3 without plane separation (LIFT1 sec. 1; HYPOTHESIS, valid under the public-provenance direction law only): +transport by owned rank caps each pair's contribution at `cap` and the 8 relaxation rises save at most `corr`. -/ +def I3Cap (J : Finset (ℕ × ℕ)) (dist : ℕ × ℕ → ℝ) (cap corr E : ℝ) : Prop := ∑ p ∈ J, min (dist p) cap - corr ≤ E + +def tbarC : ℚ := 134769139 / 10 ^ 10 +theorem sC_eq : sC = 1 - tbarC := by unfold sC tbarC; norm_num + +def natBaseC : Inv := ⟨[], [(8, 400), (9, 6), (1, 10)]⟩ +theorem natBaseC_F (s : ℝ) : Finv s natBaseC = -(400 * (8 : ℝ) ^ s + (6 * (9 : ℝ) ^ s + 10)) := by + simp [Finv, natBaseC, Fh] +theorem baseC_eq (s : ℝ) : Finv s (invoice (caller 6 7) natBaseC 17) = Fc cfC s := by + simp only [Finv, Fh, invoice, caller, callerT, callerP, armT, armP, natBaseC, scale, Fc, cfC, + List.range_succ, List.range_zero] + norm_num + ring +theorem base88_eq (s : ℝ) : + Finv s (invoice (caller 6 7) natBaseC 17) - 17 * (88 * (2 - (2 : ℝ) ^ s)) = Fc cfC88 s := by + rw [baseC_eq] + simp only [Fc, cfC, cfC88, List.map_cons, List.sum_cons, List.map_nil, List.sum_nil] + push_cast + simp only [Real.one_rpow] + ring + +/-- **own56 ceiling, 8|9 (kappa <= .0134769139)**: as `ceiling_A` but (i) the descent mass >= 56 of the rank-8 C = 56 decoder is charged +(`own56_floor`), and (ii) plane separation is NOT assumed: the junk lift is the capped, corrected one (`I3Cap`, LIFT1), valid under the +public-provenance direction law `Prov` (LIFT1 (i) junk reflux, (ii) non-monotone owned lifetimes, (iii) >= 9-row/network decoders are OPEN and are +exactly what `Prov`/`Rank8C56` stand for here; rank-8 decoders with C = 57 do not exist and C >= 58 is not covered by the junk bound 1936). +Data hypotheses: `hdist` (per-pair `ell s <= min dist cap`, from sp_F and unit/48), `hLc` (1936 * ell - corr >= 13.64105 on [tbarC, .1], python, +monotone numerically). -/ +theorem ceiling_C (MV Rank8C56 Prov : Prop) (hMV : MV) (hR : Rank8C56) (hP : Prov) + (n : Inv) (ks : List ℕ) (mr st : ℕ) (E cap corr ell : ℝ → ℝ) (J : Finset (ℕ × ℕ)) (distF : ℝ → ℕ × ℕ → ℝ) + (hk : ∀ k ∈ ks, 1 ≤ k ∧ k ≤ 9) (hmass : 56 ≤ ks.sum) (hmd : 8 ≤ ks.length) (hmr : 8 ≤ mr) (hcorr0 : ∀ s, 0 ≤ corr s) + (hF : ∀ s, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - dprice ks s - mr - E s) + (hY : 104 ≤ st + (ks.length + mr)) + (hst : ∀ s, 0 ≤ s → s ≤ 1 → (2 - (2 : ℝ) ^ s) * st ≤ E s) + (hI3 : MV → Rank8C56 → Prov → ∀ s, 0 ≤ s → s ≤ 1 → I3Cap J (distF s) (cap s) (corr s) (E s)) + (hdist : ∀ s, 9 / 10 ≤ s → s ≤ ((sC : ℚ) : ℝ) → ∀ p ∈ J, ell s ≤ min (distF s p) (cap s)) + (hLc : ∀ s, 9 / 10 ≤ s → s ≤ ((sC : ℚ) : ℝ) → ((LcC : ℚ) : ℝ) ≤ 1936 * ell s - corr s) + (hJ : 1936 ≤ J.card) : + ∀ t : ℝ, ((tbarC : ℚ) : ℝ) ≤ t → t ≤ 1 → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 := by + intro t ht ht1 + have hsC : ((sC : ℚ) : ℝ) = 1 - ((tbarC : ℚ) : ℝ) := by rw [sC_eq]; push_cast; ring + have htb0 : (0 : ℝ) ≤ ((tbarC : ℚ) : ℝ) := by unfold tbarC; norm_num + have htb1 : ((tbarC : ℚ) : ℝ) ≤ 1 / 10 := by unfold tbarC; norm_num + have hs0 : (0 : ℝ) ≤ 1 - t := by linarith + have hs1 : 1 - t ≤ 1 := by linarith + have hu1 : (1 : ℝ) ≤ (2 : ℝ) ^ (1 - t) := Real.one_le_rpow (by norm_num) hs0 + have hu2 : (2 : ℝ) ^ (1 - t) ≤ 2 := by + have := Real.rpow_le_rpow_of_exponent_le (show (1 : ℝ) ≤ 2 by norm_num) hs1; simpa using this + have hE0 : 0 ≤ E (1 - t) := + le_trans (mul_nonneg (by linarith) (Nat.cast_nonneg st)) (hst _ hs0 hs1) + have h2 := invoice_F (1 - t) (caller 6 7) n 17 + have h3 := invoice_F (1 - t) (caller 6 7) natBaseC 17 + have h4 := natBaseC_F (1 - t) + push_cast at h2 h3 + rcases le_or_gt (1 / 10 : ℝ) t with h10 | h10 + · have h1 := own56_floor (1 - t) hs0 hs1 ks hk hmass hmd mr st hmr (Finv (1 - t) n) (E (1 - t)) 0 (hF _ hs0 hs1) hY + (hst _ hs0 hs1) hE0 + have hc0 : (0 : ℝ) ≤ 88 * (2 - (2 : ℝ) ^ (1 - t)) := by linarith + rw [max_eq_left hc0] at h1 + have h5 := cfC88_neg (1 - t) hs0 (by linarith) + have h6 := base88_eq (1 - t) + nlinarith + · have hsl : (9 / 10 : ℝ) ≤ 1 - t := by linarith + have hsr : 1 - t ≤ ((sC : ℚ) : ℝ) := by rw [hsC]; linarith + have hcap := hI3 hMV hR hP _ hs0 hs1 + unfold I3Cap at hcap + have hLc' := hLc _ hsl hsr + have hLcpos : (0 : ℝ) < ((LcC : ℚ) : ℝ) := by unfold LcC; norm_num + have hell : 0 ≤ ell (1 - t) := by have := hcorr0 (1 - t); nlinarith + have hsum : (1936 : ℝ) * ell (1 - t) ≤ ∑ p ∈ J, min (distF (1 - t) p) (cap (1 - t)) := by + have := Finset.card_nsmul_le_sum J (fun p => min (distF (1 - t) p) (cap (1 - t))) (ell (1 - t)) (hdist _ hsl hsr) + rw [nsmul_eq_mul] at this + have hj : (1936 : ℝ) ≤ J.card := by exact_mod_cast hJ + nlinarith + have hE : ((LcC : ℚ) : ℝ) ≤ E (1 - t) := by linarith + have h1 := own56_floor (1 - t) hs0 hs1 ks hk hmass hmd mr st hmr (Finv (1 - t) n) (E (1 - t)) ((LcC : ℚ) : ℝ) (hF _ hs0 hs1) hY + (hst _ hs0 hs1) hE + have h1' : Finv (1 - t) n ≤ -400 * (8 : ℝ) ^ (1 - t) - (6 * (9 : ℝ) ^ (1 - t) + 10) - ((LcC : ℚ) : ℝ) := by + have := le_max_right (88 * (2 - (2 : ℝ) ^ (1 - t))) ((LcC : ℚ) : ℝ) + linarith + have h5 := cfC_neg (1 - t) hsl hsr + have h6 := baseC_eq (1 - t) + have h7 : ((liftC : ℚ) : ℝ) = 17 * ((LcC : ℚ) : ℝ) := by unfold liftC; push_cast; ring + nlinarith + +end CongestionI3 + +#print axioms CongestionI3.forced_junk_ge +#print axioms CongestionI3.f1_floor +#print axioms CongestionI3.ceiling_A +#print axioms CongestionI3.chord_k +#print axioms CongestionI3.dprice_ge +#print axioms CongestionI3.nine_chord +#print axioms CongestionI3.own56_floor +#print axioms CongestionI3.ceiling_C diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3.md b/research/p104-tree-ceiling/lean/Nov15/CongestionI3.md new file mode 100644 index 0000000000..f4043c17df --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3.md @@ -0,0 +1,21 @@ +# CongestionI3*.lean: the I3 congestion bound and F1's restricted-class ceilings in Lean +Files (build order, each with `-o .lake/build/lib/lean/Nov15/.olean`, the memory-guarded build script, <= 3.5 GB): CongestionI3Data (11 s), CongestionI3Cfg (121 s / 3.37 GB), CongestionI3Mu (5 s), CongestionI3NumA (35 s / 3.2 GB), CongestionI3NumC1..C4 (34/31/28/17 s, <= 3.2 GB), CongestionI3 (24 s / 3.0 GB). Kernel only: no sorry, no native_decide; every `#print axioms` is within [propext, Classical.choice, Quot.sound]. The numeric files are split only for the memory guard (NumCertK interval checks, as in WholeFloorCoverData). +Sources: internal notes (not included in this package). + +## What is proved (kernel) +- **(1) per pair.** `pair_bound`: per-pair minimum delta => E >= delta |J|; `i3_D0_per_call`: 0.541495 per pair and |J| >= 1936 give >= 1048.33 D0/call. I3 itself is the HYPOTHESIS `I3Path J dist E` (sum of path distances <= public excess, model M_V): the telescoping/path bound is NOT formalised, and the shape-DAG minimum (0.541495 in D0, `sigma0` = 9785438/10^9 <= sp_F(t) in F currency) is a data hypothesis (230-shape DAG, f1ceil.py). +- **(2) forced junk >= 1936.** `cfgs` = the 8 valid rank-8 C = 56 configurations (f1enum, z.z' = 0); kernel: `cfgs_ok` (8 rows each, z.z' = 0 on the F2^9 labels `Ulab`), `cfg_uniq0..7` (every chain of every configuration has exactly 330 unique cells = 2640 per configuration, recomputed from `Ulab`/`Gmask`), `uniqCells_disjoint` (a unique cell belongs to one chain). `forced_junk_ge`: if the forced cells F k of chain k are unique cells (hsub), lie in supp J (hJ) and number >= mu(i,k) (hDP), then |J| >= sum_k mu = 1936 (`mu_sum`, kernel on the table `muTab`, all entries 242, from the per-chain rerun f1dp_chain_*.log; per-config sums reproduce f1dp.log). hDP is the python flag-DP minimum over the subspace lattice: DATA, not kernel-checked (a kernel re-run would be ~64 chain DPs). +- **(3) max, not sum.** `f1_floor`: from hF (F <= -400 8^s - mp - E), mp >= 16, st + mp >= 104 (lat = 0, nested words), E >= (2 - 2^s) st (R3's stops) and E >= I (I3): F <= -400 8^s - 16 - max(88 (2 - 2^s), I). I = 0 is R3's -Nfl. `sum_not_implied` records that the sum is not a consequence (E = max satisfies both bounds). +- **(4a) ceiling 8|9, kappa <= .0183952347.** `ceiling_A`: for t in [tbarA = .0183952347, 1], F(1 - t) < 0 on the 17-call #7113 invoice. t >= .1: f1_floor with I = 0 + WholeFloorCover.cover (R3). t in [tbar, .1): lift 17 * 1936 * sigma0 against `cfB_neg`: three Fup pieces on [.9, .93], dF/ds > 0 on [.93, 1 - tbar] (`Fc_mono`) and F_base(s0) < 17 * 1936 * sigma0 at the endpoint (true F_base(s0) = 322.05830, lift 322.05834; python root .0183952344, so .0183952347 is rounded up). +- **(4b) ceiling with descent mass >= 56, kappa <= .0134769139.** `own56_floor`: descents are owned MOVEs of rank k in 1..9 with sum >= 56 (rank-8 C = 56 premise), >= 8 descents and >= 8 rises: F price sum k^s >= 6 9^s + 2 (`chord_k`, `dprice_ge`: concavity chord on [1,9]); extra moves beyond 8 + 8 cost at least the stops they remove save, by `nine_chord` (9^s <= 8 2^s - 7 on [0,1], convexity of u -> u^(log_2 9); so (9 - 9^s)/8 >= 2 - 2^s). This RE-DERIVES the m-tradeoff at the own56 base, which LIFT1/f1ceil only assume (python charges the fixed 6x9 + 2x1 + 8 rises; the Lean statement shows it is sound). `ceiling_C`: F < 0 on [tbarC = .0134769139, 1]: t >= .1 by cfC88_neg (13 pieces, = base + 88 stops), t in [tbar, .1) by cfC_neg (lift 17 * 13.64105; true F_base(sC) = 231.89777, lift 231.89785). + +## Scope and hypotheses (stated in the theorems; none discharged by the kernel unless marked) +- **M_V**: every public register except Y mains ends at V, owned code fixed, X_q born at A_q (AUDIT (1)). Hypothesis `MV` in `hI3`. NO known native is in M_V (224 of 1,501 public registers end at dim <= 7): the ceilings are NOT a floor on the native class; the control pass (S22/#7641/#7637 under both ceilings) is feasibility only. +- **rank-8, C = 56** decoder on P104 labels, one of the 8 enumerated configurations (index i < 8): exhaustiveness over the 12,870 subsets and rigidity M^ = D1 G D2 are quoted/numerical. LIFT2: C = 57 impossible; C = 58 elementary mixes give junk >= 2093 >= 1936, C = 60 sampled; C >= 59 general X only sampled; >= 9-row and network decoders open. The junk bound 1936 is the min over C = 56 EXACTLY (AUDIT-LIFT (3)): a C >= 58 decoder is not covered. `hJ`/`Rank8C56` carry this. +- **plane separation** (`PlaneSep`, ceiling_A): without it the LB collapses to 0 (f1k2). ceiling_C does not assume it but replaces it by the **public-provenance direction law** `Prov` + the cap/correction inequality `I3Cap` (LIFT1 sec. 1; AUDIT-LIFT (1): holders with owned origin/reflux (i), non-monotone owned lifetimes (ii), >= 9-row/network decoders (iii) are OPEN; the split LB 242 < break-even 578 is a count, not a proof). +- **data hypotheses**: `hdist` (per-pair sp_F lower bound on [tbar, .1]; sp_F increasing in t is numerical, the convex/superadditive proof was not re-derived, AUDIT (1)); `hLc` (N min(sp_F, unit/48) - corr >= 13.64105 on [tbarC, .1]; python lift1c, monotone numerically); `hDP` (flag-DP minima); `corr >= 0`. +- **nested** (lat = 0): `hY : 104 <= st + mp` is Theorem Y with lateral owned MOVEs excluded by the verifier nesting rule (WholeFloorNest); R3's port lemma/Theorem Y and slack-rank independence stay upstream. +- The D0 floor 171,478.76 is not formalised (LIFT1: it does not survive without plane separation: owned mass is a D0 credit). + +## Statements false as written +None found. Two points to read carefully: (a) the sum of I3 and R3's stops is NOT implied (`sum_not_implied`); only max is (F1 uses max). (b) F1.md's "k <= 4" for the joint table is not a restriction (AUDIT: k <= 17), not touched here. The own56 ceiling's R3 trade-off is TRUE (nine_chord). diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3Cfg.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3Cfg.lean new file mode 100644 index 0000000000..4d50ff918d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3Cfg.lean @@ -0,0 +1,73 @@ +import Nov15.CongestionI3Data + +/-! +CONGESTION-I3 configuration half . Kernel-checked facts about the 8 rank-8 C=56 decoder configurations +(internal notes sec. 2): z.z' = 0, and the census of the "unique" even cells (cells that exactly one chain can touch). +`dot` = F2 dot product of 9-bit labels; chain k = (z_k, z'_k) (virtual lines 104..119, labels `Ulab`); the chain k's support on the +cell (t, s) (t, s < 104) is G[t, z_k] * G[s, z'_k] (nonzero pattern `Gmask`). +-/ +set_option linter.constructorNameAsVariable false +namespace CongestionI3 + +/-- parity of the 9 low bits -/ +def par (x : ℕ) : ℕ := + let a := (x ^^^ (x >>> 4)) &&& 15 + let b := a ^^^ (a >>> 2) + ((b ^^^ (b >>> 1)) ^^^ (x >>> 8)) &&& 1 +theorem par_test : (List.range 512).all (fun x => par x == ((List.range 9).foldl (fun acc i => acc + (x >>> i) % 2) 0) % 2) = true := by decide +kernel +def dot (a b : ℕ) : ℕ := par (a &&& b) +def lab (i : ℕ) : ℕ := Ulab.getD i 0 +/-- G[t, z] ≠ 0 for t < 104, z in 104..119 -/ +def gnz (t z : ℕ) : Bool := ((Gmask.getD t 0) >>> (z - 104)) % 2 == 1 + +/-- the even cells: t ≠ s, q_t . q_s = 0 -/ +def even (t s : ℕ) : Bool := t != s && dot (lab t) (lab s) == 0 +/-- chains that may touch (t,s): q_t ⊥ z_k and q_s ⊥ z'_k (frames of the chain) -/ +def Kset (c : List (ℕ × ℕ)) (t s : ℕ) : List ℕ := + (List.range c.length).filter fun k => + dot (lab t) (lab (c.getD k (0, 0)).1) == 0 && dot (lab s) (lab (c.getD k (0, 0)).2) == 0 +/-- chains whose product is nonzero at (t,s) -/ +def Tset (c : List (ℕ × ℕ)) (t s : ℕ) : List ℕ := + (List.range c.length).filter fun k => gnz t (c.getD k (0, 0)).1 && gnz s (c.getD k (0, 0)).2 +/-- the unique cells of chain k: even, exactly one chain (k) may touch them, and it does -/ +def isUniq (c : List (ℕ × ℕ)) (k t s : ℕ) : Bool := even t s && Kset c t s == [k] && Tset c t s == [k] +def uniqCells (c : List (ℕ × ℕ)) (k : ℕ) : Finset (ℕ × ℕ) := + (Finset.range 104 ×ˢ Finset.range 104).filter fun p => isUniq c k p.1 p.2 = true + +/-- orthogonality z.z' = 0 for all rows -/ +def cfgOK (c : List (ℕ × ℕ)) : Bool := c.length == 8 && c.all fun p => dot (lab p.1) (lab p.2) == 0 +/-- chain index of every unique cell, one pass over the 104 x 104 cells -/ +def uniqOwners (c : List (ℕ × ℕ)) : List ℕ := + (List.range 104).flatMap fun t => (List.range 104).filterMap fun s => + if even t s then + (match Kset c t s with + | [k] => if Tset c t s == [k] then some k else none + | _ => none) + else none +def uniqCensus (c : List (ℕ × ℕ)) : List ℕ := (List.range 8).map fun k => (uniqOwners c).count k + +theorem cfgs_len : cfgs.length = 8 := by decide +kernel +theorem cfgs_ok : cfgs.all cfgOK = true := by decide +kernel +/-- every chain of every configuration has exactly 330 unique cells (2640 = 8 * 330 per configuration, F1 sec. 2); one theorem per +configuration (kernel memory is per declaration). -/ +theorem cfg_uniq0 : uniqCensus (cfgs.getD 0 []) = List.replicate 8 330 := by decide +kernel +theorem cfg_uniq1 : uniqCensus (cfgs.getD 1 []) = List.replicate 8 330 := by decide +kernel +theorem cfg_uniq2 : uniqCensus (cfgs.getD 2 []) = List.replicate 8 330 := by decide +kernel +theorem cfg_uniq3 : uniqCensus (cfgs.getD 3 []) = List.replicate 8 330 := by decide +kernel +theorem cfg_uniq4 : uniqCensus (cfgs.getD 4 []) = List.replicate 8 330 := by decide +kernel +theorem cfg_uniq5 : uniqCensus (cfgs.getD 5 []) = List.replicate 8 330 := by decide +kernel +theorem cfg_uniq6 : uniqCensus (cfgs.getD 6 []) = List.replicate 8 330 := by decide +kernel +theorem cfg_uniq7 : uniqCensus (cfgs.getD 7 []) = List.replicate 8 330 := by decide +kernel + +theorem uniqCells_disjoint (c : List (ℕ × ℕ)) {k k' : ℕ} (h : k ≠ k') : Disjoint (uniqCells c k) (uniqCells c k') := by + rw [Finset.disjoint_left] + intro p hp hp' + simp only [uniqCells, Finset.mem_filter, isUniq, Bool.and_eq_true, beq_iff_eq] at hp hp' + have := hp.2.1.2.symm.trans hp'.2.1.2 + simp at this + exact h this + +end CongestionI3 + +#print axioms CongestionI3.cfg_uniq7 +#print axioms CongestionI3.uniqCells_disjoint diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3Data.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3Data.lean new file mode 100644 index 0000000000..4f0921cc87 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3Data.lean @@ -0,0 +1,26 @@ +import Mathlib.Data.Finset.Basic +import Mathlib.Data.Finset.Card +import Mathlib.Data.Finset.Prod +import Mathlib.Data.Finset.Powerset +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Order.Interval.Finset.Nat + +/-! +CONGESTION-I3 data : the 8 valid rank-8 C=56 decoder configurations of internal notes (f1enum.py, z.z'=0), +the F2^9 labels U of the 120 E8 lines (PORTSET geo.py), the nonzero pattern of G[t,z] for t<104, z in 104..119, and the per-chain +flag-DP minima mu (internal notes,b}.log, a rerun of f1dp.py printing per-chain values). +-/ +namespace CongestionI3 + +def Ulab : List ℕ := [11, 19, 35, 131, 259, 13, 21, 37, 69, 133, 261, 41, 73, 265, 49, 145, 161, 193, 321, 385, 14, 22, 38, 70, 134, 26, 74, 138, 50, 146, 274, 194, 322, 386, 28, 44, 140, 84, 148, 276, 100, 292, 196, 324, 388, 56, 88, 152, 168, 296, 200, 328, 392, 112, 176, 304, 208, 336, 400, 224, 352, 416, 508, 506, 502, 494, 478, 446, 382, 254, 505, 501, 493, 477, 445, 381, 253, 499, 475, 443, 379, 251, 487, 471, 439, 375, 247, 463, 431, 367, 239, 415, 351, 223, 319, 191, 81, 98, 164, 262, 268, 273, 280, 290, 42, 266, 25, 137, 7, 67, 448, 104, 76, 82, 162, 97, 289, 127, 52, 491] +def Gmask : List ℕ := [16511, 33780, 7537, 26040, 29106, 34652, 17623, 55890, 36147, 41627, 46737, 6861, 19884, 30222, 55622, 41359, 16138, 26731, 31841, 21449, 39251, 23256, 50269, 37692, 48276, 39495, 21411, 31755, 51017, 49024, 43914, 30308, 25198, 19910, 23908, 50145, 47912, 22283, 30883, 27817, 51598, 61996, 45383, 42317, 35557, 49397, 38804, 47164, 9913, 12979, 29144, 26066, 19066, 51866, 58674, 61752, 45651, 42585, 35313, 11478, 14556, 6004, 7695, 55596, 6579, 55864, 17597, 5084, 15476, 10366, 50979, 1980, 50231, 23218, 3539, 8827, 13937, 49311, 40337, 51952, 58712, 61778, 50059, 23822, 2671, 9671, 12749, 40581, 51684, 58956, 62022, 22369, 30921, 27843, 12200, 15266, 36391, 3757, 58918, 43166, 44834, 46469, 44086, 13583] +def cfgs : List (List (ℕ × ℕ)) := [[(104, 105), (106, 107), (108, 109), (110, 118), (111, 115), (112, 116), (114, 117), (119, 113)], + [(104, 110), (105, 118), (111, 108), (112, 119), (114, 106), (115, 109), (116, 113), (117, 107)], + [(104, 111), (105, 115), (106, 119), (107, 113), (110, 108), (114, 112), (117, 116), (118, 109)], + [(104, 114), (105, 117), (108, 119), (109, 113), (110, 106), (111, 112), (115, 116), (118, 107)], + [(105, 104), (107, 106), (109, 108), (113, 119), (115, 111), (116, 112), (117, 114), (118, 110)], + [(106, 110), (107, 118), (112, 111), (113, 109), (114, 104), (116, 115), (117, 105), (119, 108)], + [(106, 114), (107, 117), (108, 111), (109, 115), (110, 104), (113, 116), (118, 105), (119, 112)], + [(108, 110), (109, 118), (111, 104), (112, 114), (113, 107), (115, 105), (116, 117), (119, 106)]] + +end CongestionI3 diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualAlg.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualAlg.lean new file mode 100644 index 0000000000..47362970ba --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualAlg.lean @@ -0,0 +1,224 @@ +import Nov15.WordDuality +import Mathlib.Analysis.MeanInequalitiesPow +import Mathlib.Analysis.SpecialFunctions.Pow.NNReal + +/-! +CONGESTION-I3-DUAL, algebra half. Source: internal notes (audited SOUND, i3dual/audit/AUD.md). +Two-sided I3: the excess of one public register is telescoped from the END (h9 charge, needs e = 9) or from the BIRTH (k0 charge, needs d0 = 0); +every move of a non-mixed register carries a charge >= c2 = min (h9, k0), and a mixed register (d0 >= 1, e <= 8) loses at most c2 (d0, e). +Kernel only; no sorry, no native_decide. `g` is an arbitrary price function with g 0 = 0 (instance: `gs s x = x^s`, s = 1 - t). +Nothing numeric here. See CongestionI3Dual.md. +-/ +namespace CongestionI3Dual +open Finset WordDuality + +/-! ### 1. move prices -/ + +/-- end-anchored move price (target V = dim 9): g(b-a) + g(9-b) - g(9-a) -/ +def h9 (g : ℝ → ℝ) (a b : ℝ) : ℝ := g (b - a) + g (9 - b) - g (9 - a) +/-- start-anchored move price (birth {0}): g(b-a) + g(a) - g(b) -/ +def k0 (g : ℝ → ℝ) (a b : ℝ) : ℝ := g (b - a) + g a - g b +/-- the uniform charge of ID1 sec. 1 -/ +def c2 (g : ℝ → ℝ) (a b : ℝ) : ℝ := min (h9 g a b) (k0 g a b) + +/-- the price function of the F currency: x^s on x > 0, and 0 at 0 -/ +noncomputable def gs (s : ℝ) (x : ℝ) : ℝ := if 0 < x then x ^ s else 0 +theorem gs_zero (s : ℝ) : gs s 0 = 0 := by simp [gs] + +/-- x^s is subadditive on [0, inf) for 0 <= s <= 1 -/ +theorem gs_subadd (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (x y : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) : + gs s (x + y) ≤ gs s x + gs s y := by + have key : (x + y) ^ s ≤ x ^ s + y ^ s := by + have := NNReal.rpow_add_le_add_rpow x.toNNReal y.toNNReal hs0 hs1 + have h3 : ((x.toNNReal + y.toNNReal) ^ s : NNReal) ≤ (x.toNNReal ^ s + y.toNNReal ^ s : NNReal) := this + have h4 := (NNReal.coe_le_coe.mpr h3) + simpa [NNReal.coe_rpow, Real.coe_toNNReal _ hx, Real.coe_toNNReal _ hy] using h4 + unfold gs + by_cases hx0 : 0 < x + · by_cases hy0 : 0 < y + · rw [if_pos hx0, if_pos hy0, if_pos (by linarith)]; exact key + · have : y = 0 := le_antisymm (not_lt.mp hy0) hy + subst this; simp + · have : x = 0 := le_antisymm (not_lt.mp hx0) hx + subst this; simp + +/-- the two prices are >= 0 for a subadditive g with g 0 = 0 on 0 <= a <= b <= 9 -/ +theorem h9_nonneg (g : ℝ → ℝ) (hg : ∀ x y, 0 ≤ x → 0 ≤ y → g (x + y) ≤ g x + g y) (a b : ℝ) (hab : a ≤ b) (hb : b ≤ 9) : + 0 ≤ h9 g a b := by + have := hg (b - a) (9 - b) (by linarith) (by linarith) + have e : b - a + (9 - b) = 9 - a := by ring + rw [e] at this; unfold h9; linarith +theorem k0_nonneg (g : ℝ → ℝ) (hg : ∀ x y, 0 ≤ x → 0 ≤ y → g (x + y) ≤ g x + g y) (a b : ℝ) (ha : 0 ≤ a) (hab : a ≤ b) : + 0 ≤ k0 g a b := by + have := hg (b - a) a (by linarith) ha + have e : b - a + a = b := by ring + rw [e] at this; unfold k0; linarith + +/-- duality at the level of move prices (DU1): the start-anchored price of (a,b) is the end-anchored price of the swapped move +`swapN 9 (a,b) = (9-b, 9-a)` of WordDuality. -/ +theorem k0_eq_h9_swapN (g : ℝ → ℝ) (a b : ℕ) (hb : b ≤ 9) (hab : a ≤ b) : + k0 g a b = h9 g (swapN 9 (a, b)).1 (swapN 9 (a, b)).2 := by + simp only [swapN, k0, h9] + have h1 : (((9 - b : ℕ) : ℕ) : ℝ) = 9 - b := by rw [Nat.cast_sub hb]; norm_num + have h2 : (((9 - a : ℕ) : ℕ) : ℝ) = 9 - a := by rw [Nat.cast_sub (le_trans hab hb)]; norm_num + rw [h1, h2] + have e1 : (9 - (a : ℝ)) - (9 - b) = b - a := by ring + have e2 : (9 : ℝ) - (9 - a) = a := by ring + have e3 : (9 : ℝ) - (9 - b) = b := by ring + rw [e1, e2, e3] + +/-- the dual helper (WordDuality `dualH 9`) has the same move prices: its end-anchored charge list is the start-anchored charge list of the +original (reversed order, equal sum). -/ +theorem dualH_charge (g : ℝ → ℝ) (h : FibreK.Helper) (hs : ∀ s ∈ h.steps, s.2 ≤ 9 ∧ s.1 ≤ s.2) : + (((dualH 9 h).steps).map fun s : ℕ × ℕ => h9 g s.1 s.2).sum = (h.steps.map fun s : ℕ × ℕ => k0 g s.1 s.2).sum := by + simp only [dualH, List.map_reverse, List.sum_reverse, List.map_map] + congr 1 + apply List.map_congr_left + intro s hs' + obtain ⟨h1, h2⟩ := hs s hs' + simp only [Function.comp] + exact (k0_eq_h9_swapN g s.1 s.2 h1 h2).symm + +/-! ### 2. one register: telescoping -/ + +/-- a register path: levels `d 0, ..., d n` (born at `d 0`, ending at `d n`); its excess over R3's floor is +`ex = sum g(gaps) - g(e - d0)` (ID1 sec. 1). -/ +def gsum (g : ℝ → ℝ) (d : ℕ → ℝ) (n : ℕ) : ℝ := ∑ i ∈ range n, g (d (i + 1) - d i) +def ex (g : ℝ → ℝ) (d : ℕ → ℝ) (n : ℕ) : ℝ := gsum g d n - g (d n - d 0) + +/-- end-anchored telescoping: for e = 9 the h9 charges sum to the excess -/ +theorem sum_h9_eq (g : ℝ → ℝ) (hg0 : g 0 = 0) (d : ℕ → ℝ) (n : ℕ) (he : d n = 9) : + ∑ i ∈ range n, h9 g (d i) (d (i + 1)) = ex g d n := by + have t : ∑ i ∈ range n, (g (9 - d (i + 1)) - g (9 - d i)) = g (9 - d n) - g (9 - d 0) := + Finset.sum_range_sub (fun i => g (9 - d i)) n + have h : ∑ i ∈ range n, h9 g (d i) (d (i + 1)) = gsum g d n + ∑ i ∈ range n, (g (9 - d (i + 1)) - g (9 - d i)) := by + unfold h9 gsum; rw [← Finset.sum_add_distrib]; apply Finset.sum_congr rfl; intro i _; ring + rw [h, t, he]; unfold ex + have e : (9 : ℝ) - 9 = 0 := by ring + rw [e, hg0, he]; ring + +/-- start-anchored telescoping: for d0 = 0 the k0 charges sum to the excess -/ +theorem sum_k0_eq (g : ℝ → ℝ) (hg0 : g 0 = 0) (d : ℕ → ℝ) (n : ℕ) (hd : d 0 = 0) : + ∑ i ∈ range n, k0 g (d i) (d (i + 1)) = ex g d n := by + have t : ∑ i ∈ range n, (g (d i) - g (d (i + 1))) = g (d 0) - g (d n) := by + have := Finset.sum_range_sub (fun i => g (d i)) n + have h2 : ∑ i ∈ range n, (g (d i) - g (d (i + 1))) = -∑ i ∈ range n, (g (d (i + 1)) - g (d i)) := by + rw [← Finset.sum_neg_distrib]; apply Finset.sum_congr rfl; intro i _; ring + rw [h2, this]; ring + have h : ∑ i ∈ range n, k0 g (d i) (d (i + 1)) = gsum g d n + ∑ i ∈ range n, (g (d i) - g (d (i + 1))) := by + unfold k0 gsum; rw [← Finset.sum_add_distrib]; apply Finset.sum_congr rfl; intro i _; ring + rw [h, t, hd]; unfold ex + rw [hd, hg0]; ring_nf + +/-- **non-mixed register: every move is charged >= c2 and the charges sum to the excess** (ID1 sec. 1, `charge_V`/`charge_Z`). -/ +theorem nonmixed_charge (g : ℝ → ℝ) (hg0 : g 0 = 0) (d : ℕ → ℝ) (n : ℕ) (h : d n = 9 ∨ d 0 = 0) : + ∃ w : ℕ → ℝ, (∀ i ∈ range n, c2 g (d i) (d (i + 1)) ≤ w i) ∧ ∑ i ∈ range n, w i = ex g d n := by + rcases h with h | h + · exact ⟨fun i => h9 g (d i) (d (i + 1)), fun i _ => min_le_left _ _, sum_h9_eq g hg0 d n h⟩ + · exact ⟨fun i => k0 g (d i) (d (i + 1)), fun i _ => min_le_right _ _, sum_k0_eq g hg0 d n h⟩ + +/-- **the slack of any register** (covers mixed registers, ID1 sec. 2): the c2-charges sum to at most the excess plus c2 of the whole register. +No hypothesis on g or on the levels: pointwise `c2 <= g(gap) - max (g(9-a)-g(9-b), g(b)-g(a))`, and both maxima telescope. -/ +theorem sum_c2_le (g : ℝ → ℝ) (d : ℕ → ℝ) (n : ℕ) : + ∑ i ∈ range n, c2 g (d i) (d (i + 1)) ≤ ex g d n + c2 g (d 0) (d n) := by + have t1 : ∑ i ∈ range n, (g (9 - d (i + 1)) - g (9 - d i)) = g (9 - d n) - g (9 - d 0) := + Finset.sum_range_sub (fun i => g (9 - d i)) n + have t2 : ∑ i ∈ range n, (g (d i) - g (d (i + 1))) = g (d 0) - g (d n) := by + have := Finset.sum_range_sub (fun i => g (d i)) n + have h2 : ∑ i ∈ range n, (g (d i) - g (d (i + 1))) = -∑ i ∈ range n, (g (d (i + 1)) - g (d i)) := by + rw [← Finset.sum_neg_distrib]; apply Finset.sum_congr rfl; intro i _; ring + rw [h2, this]; ring + have A : ∑ i ∈ range n, c2 g (d i) (d (i + 1)) ≤ ex g d n + h9 g (d 0) (d n) := by + have : ∑ i ∈ range n, c2 g (d i) (d (i + 1)) ≤ ∑ i ∈ range n, (g (d (i + 1) - d i) + (g (9 - d (i + 1)) - g (9 - d i))) := by + apply Finset.sum_le_sum; intro i _ + have : c2 g (d i) (d (i + 1)) ≤ h9 g (d i) (d (i + 1)) := min_le_left _ _ + unfold h9 at this; linarith + rw [Finset.sum_add_distrib, t1] at this + unfold ex gsum h9 at *; linarith + have B : ∑ i ∈ range n, c2 g (d i) (d (i + 1)) ≤ ex g d n + k0 g (d 0) (d n) := by + have : ∑ i ∈ range n, c2 g (d i) (d (i + 1)) ≤ ∑ i ∈ range n, (g (d (i + 1) - d i) + (g (d i) - g (d (i + 1)))) := by + apply Finset.sum_le_sum; intro i _ + have : c2 g (d i) (d (i + 1)) ≤ k0 g (d i) (d (i + 1)) := min_le_right _ _ + unfold k0 at this; linarith + rw [Finset.sum_add_distrib, t2] at this + unfold ex gsum k0 at *; linarith + unfold c2 + rcases le_total (h9 g (d 0) (d n)) (k0 g (d 0) (d n)) with h | h + · rw [min_eq_left h]; exact A + · rw [min_eq_right h]; exact B + +/-- non-mixed (born at 0 or ending at 9): c2 of the whole register vanishes -/ +theorem c2_total_nonmixed (g : ℝ → ℝ) (hg0 : g 0 = 0) (a e : ℝ) (h : e = 9 ∨ a = 0) : c2 g a e ≤ 0 := by + unfold c2 + rcases h with h | h + · subst h; have : h9 g a 9 = g 0 := by unfold h9; simp + rw [hg0] at this; exact le_trans (min_le_left _ _) this.le + · subst h; have : k0 g 0 e = g 0 := by unfold k0; simp + rw [hg0] at this; exact le_trans (min_le_right _ _) this.le + +/-! ### 3. many registers: <= m mixed -/ + +section Many +variable {ι : Type*} [DecidableEq ι] + +/-- a register is MIXED if it is born above {0} and ends below V (levels are dims) -/ +def Mixed (d : ι → ℕ → ℕ) (n : ι → ℕ) (r : ι) : Prop := 1 ≤ d r 0 ∧ d r (n r) ≤ 8 +instance (d : ι → ℕ → ℕ) (n : ι → ℕ) (r : ι) : Decidable (Mixed d n r) := by unfold Mixed; infer_instance + +/-- the dim sequence of register `r` as reals -/ +def lev (d : ι → ℕ → ℕ) (r : ι) : ℕ → ℝ := fun i => (d r i : ℝ) + +/-- **summing over registers**: c2-charges of all moves <= total excess + (number of mixed registers) * sigma, where `sigma` bounds c2 of one +mixed register (dims 1 <= a <= b <= 8). -/ +theorem sum_all_c2_le (g : ℝ → ℝ) (hg0 : g 0 = 0) (R : Finset ι) (n : ι → ℕ) (d : ι → ℕ → ℕ) + (hmono : ∀ r ∈ R, ∀ i < n r, d r i ≤ d r (i + 1)) (hd9 : ∀ r ∈ R, d r (n r) ≤ 9) + (m : ℕ) (hm : (R.filter fun r => Mixed d n r).card ≤ m) (σ : ℝ) (hσ0 : 0 ≤ σ) + (hσ : ∀ a b : ℕ, 1 ≤ a → a ≤ b → b ≤ 8 → c2 g (a : ℝ) (b : ℝ) ≤ σ) : + ∑ r ∈ R, ∑ i ∈ range (n r), c2 g (lev d r i) (lev d r (i + 1)) ≤ ∑ r ∈ R, ex g (lev d r) (n r) + m * σ := by + have step : ∀ r ∈ R, ∑ i ∈ range (n r), c2 g (lev d r i) (lev d r (i + 1)) ≤ + ex g (lev d r) (n r) + (if Mixed d n r then σ else 0) := by + intro r hr + have h1 := sum_c2_le g (lev d r) (n r) + have hle : ∀ k ≤ n r, d r 0 ≤ d r k := by + intro k + induction k with + | zero => intro _; exact le_refl _ + | succ k ih => intro hk; exact le_trans (ih (by omega)) (hmono r hr k (by omega)) + have h0e := hle (n r) (le_refl _) + by_cases hmx : Mixed d n r + · rw [if_pos hmx] + have := hσ (d r 0) (d r (n r)) hmx.1 h0e hmx.2 + simp only [lev] at h1 ⊢ + linarith + · rw [if_neg hmx] + have hne : d r (n r) = 9 ∨ d r 0 = 0 := by + unfold Mixed at hmx + have := hd9 r hr + omega + have h2 := c2_total_nonmixed g hg0 (lev d r 0) (lev d r (n r)) + (by + rcases hne with h | h + · left; simp [lev, h] + · right; simp [lev, h]) + simp only [lev] at h1 h2 ⊢ + linarith + calc ∑ r ∈ R, ∑ i ∈ range (n r), c2 g (lev d r i) (lev d r (i + 1)) + ≤ ∑ r ∈ R, (ex g (lev d r) (n r) + (if Mixed d n r then σ else 0)) := Finset.sum_le_sum step + _ = ∑ r ∈ R, ex g (lev d r) (n r) + ∑ r ∈ R, (if Mixed d n r then σ else 0) := Finset.sum_add_distrib + _ ≤ ∑ r ∈ R, ex g (lev d r) (n r) + m * σ := by + have : ∑ r ∈ R, (if Mixed d n r then σ else 0) = ((R.filter fun r => Mixed d n r).card : ℝ) * σ := by + rw [← Finset.sum_filter]; simp + rw [this] + have hm' : ((R.filter fun r => Mixed d n r).card : ℝ) ≤ m := by exact_mod_cast hm + nlinarith + +end Many + +end CongestionI3Dual + +#print axioms CongestionI3Dual.gs_subadd +#print axioms CongestionI3Dual.k0_eq_h9_swapN +#print axioms CongestionI3Dual.dualH_charge +#print axioms CongestionI3Dual.nonmixed_charge +#print axioms CongestionI3Dual.sum_c2_le +#print axioms CongestionI3Dual.sum_all_c2_le diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC0.lean new file mode 100644 index 0000000000..75912b05b7 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC0.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionI3DualSig +namespace CongestionI3Dual +open NumCertK +theorem sigC0 : sigOK (1 - tC1) (1 - tC0) sgC0 = true := by decide +kernel +end CongestionI3Dual diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC1.lean new file mode 100644 index 0000000000..55e0eb46d3 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC1.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionI3DualSig +namespace CongestionI3Dual +open NumCertK +theorem sigC1 : sigOK (1 - tC2) (1 - tC1) sgC1 = true := by decide +kernel +end CongestionI3Dual diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC2.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC2.lean new file mode 100644 index 0000000000..87999f43fe --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC2.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionI3DualSig +namespace CongestionI3Dual +open NumCertK +theorem sigC2 : sigOK (1 - tC3) (1 - tC2) sgC2 = true := by decide +kernel +end CongestionI3Dual diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC3.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC3.lean new file mode 100644 index 0000000000..ae82c32969 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualCertC3.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionI3DualSig +namespace CongestionI3Dual +open NumCertK +theorem sigC3 : sigOK (9 / 10) (1 - tC3) sgC3 = true := by decide +kernel +end CongestionI3Dual diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualConst.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualConst.lean new file mode 100644 index 0000000000..192da15a75 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualConst.lean @@ -0,0 +1,43 @@ +import Mathlib.Data.Rat.Defs + +/-! CONGESTION-I3-DUAL constants: t-breakpoints of the pieces, certified sigma_j (Sig/Cert*), data lower bounds lcp_j +(python: internal notes; lcp_j = lower bound of 1936 spF(t_j) [8|9] resp. 1936 min(sp, cap) - 8 cst [own56], rounded down), L_j = lcp_j - 5 sigma_j. -/ +namespace CongestionI3Dual +-- 8|9 plain, m = 5: t-breakpoints +def tA0 : ℚ := 186470 / 10 ^ 7 +def tA1 : ℚ := 186490 / 10 ^ 7 +def tA2 : ℚ := 187490 / 10 ^ 7 +def tA3 : ℚ := 287490 / 10 ^ 7 +-- own56, m = 5 +def tC0 : ℚ := 136564 / 10 ^ 7 +def tC1 : ℚ := 136584 / 10 ^ 7 +def tC2 : ℚ := 137584 / 10 ^ 7 +def tC3 : ℚ := 237584 / 10 ^ 7 +def sgA0 : ℚ := 37981 / 500000 +def sgA1 : ℚ := 77257 / 10 ^ 6 +def sgA2 : ℚ := 213457 / 10 ^ 6 +def sgA3 : ℚ := 560567 / 500000 +def sgC0 : ℚ := 28029 / 500000 +def sgC1 : ℚ := 28683 / 500000 +def sgC2 : ℚ := 200709 / 10 ^ 6 +def sgC3 : ℚ := 1185727 / 10 ^ 6 + + +def lcpA0 : ℚ := 862761 / 50000 +def lcpA1 : ℚ := 17257043 / 10 ^ 6 +def lcpA2 : ℚ := 3469639 / 200000 +def lcpA3 : ℚ := 6597489 / 250000 +def LA0 : ℚ := lcpA0 - 5 * sgA0 +def LA1 : ℚ := lcpA1 - 5 * sgA1 +def LA2 : ℚ := lcpA2 - 5 * sgA2 +def LA3 : ℚ := lcpA3 - 5 * sgA3 +def lcpC0 : ℚ := 12418057 / 10 ^ 6 +def lcpC1 : ℚ := 248359 / 20000 +def lcpC2 : ℚ := 3079357 / 250000 +def lcpC3 : ℚ := 5022921 / 250000 +def LC0 : ℚ := lcpC0 - 5 * sgC0 +def LC1 : ℚ := lcpC1 - 5 * sgC1 +def LC2 : ℚ := lcpC2 - 5 * sgC2 +def LC3 : ℚ := lcpC3 - 5 * sgC3 + +end CongestionI3Dual diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualData.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualData.lean new file mode 100644 index 0000000000..ffe636e516 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualData.lean @@ -0,0 +1,12 @@ +import Nov15.CongestionI3DualConst +import Nov15.CongestionI3NumC4 +import Nov15.CongestionI3NumA + +namespace CongestionI3Dual +open NumCertK CongestionI3 + +/-- the tail pieces are covered by the F1 theorems `cfB_neg` / `cfC_neg` -/ +theorem LA3_ge : liftA ≤ 17 * LA3 := by unfold liftA sigma0 LA3 lcpA3 sgA3; norm_num +theorem LC3_ge : liftC ≤ 17 * LC3 := by unfold liftC LcC LC3 lcpC3 sgC3; norm_num + +end CongestionI3Dual diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualNumC.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualNumC.lean new file mode 100644 index 0000000000..965d2006a9 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualNumC.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionI3DualConst +import Nov15.CongestionI3NumC4 +namespace CongestionI3Dual +open NumCertK CongestionI3 +theorem ptC0 : Fup cfC (1 - tC0) (1 - tC0) < 17 * LC0 := by unfold tC0 LC0 lcpC0 sgC0; decide +kernel +theorem ptC1 : Fup cfC (1 - tC1) (1 - tC1) < 17 * LC1 := by unfold tC1 LC1 lcpC1 sgC1; decide +kernel +theorem ptC2 : Fup cfC (1 - tC2) (1 - tC2) < 17 * LC2 := by unfold tC2 LC2 lcpC2 sgC2; decide +kernel +end CongestionI3Dual diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualSig.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualSig.lean new file mode 100644 index 0000000000..4f46eb66c0 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3DualSig.lean @@ -0,0 +1,78 @@ +import Nov15.CongestionI3DualAlg +import Nov15.NumCertK +import Nov15.CongestionI3DualConst + +/-! +CONGESTION-I3-DUAL, sigma certificates. `sigma(t)` = the largest c2 of one mixed register (dims 1 <= a <= b <= 8) is CERTIFIED here +on each t-piece by `NumCertK.Fup` (kernel interval arithmetic): for every pair (a,b), min(Fup h9, Fup k0) < sigma on the whole s-interval. So sigma needs +no monotonicity hypothesis: each piece carries its own certified bound. +-/ +namespace CongestionI3Dual +open NumCertK + +def h9CF (a b : ℕ) : CF := [(b - a, 1), (9 - b, 1), (9 - a, -1)] +def k0CF (a b : ℕ) : CF := [(b - a, 1), (a, 1), (b, -1)] + +theorem gs_nat (s : ℝ) (k : ℕ) (hk : 1 ≤ k) : gs s (k : ℝ) = (k : ℝ) ^ s := by + have : (0 : ℝ) < k := by exact_mod_cast hk + simp [gs, this] + +theorem h9_Fc (s : ℝ) (a b : ℕ) (ha : 1 ≤ a) (hab : a < b) (hb : b ≤ 8) : + h9 (gs s) (a : ℝ) (b : ℝ) = Fc (h9CF a b) s := by + have e1 : (b : ℝ) - a = ((b - a : ℕ) : ℝ) := by rw [Nat.cast_sub hab.le] + have e2 : (9 : ℝ) - b = ((9 - b : ℕ) : ℝ) := by rw [Nat.cast_sub (by omega)]; norm_num + have e3 : (9 : ℝ) - a = ((9 - a : ℕ) : ℝ) := by rw [Nat.cast_sub (by omega)]; norm_num + unfold h9; rw [e1, e2, e3, gs_nat s _ (by omega), gs_nat s _ (by omega), gs_nat s _ (by omega)] + simp [Fc, h9CF]; ring + +theorem k0_Fc (s : ℝ) (a b : ℕ) (ha : 1 ≤ a) (hab : a < b) (hb : b ≤ 8) : + k0 (gs s) (a : ℝ) (b : ℝ) = Fc (k0CF a b) s := by + have e1 : (b : ℝ) - a = ((b - a : ℕ) : ℝ) := by rw [Nat.cast_sub hab.le] + unfold k0; rw [e1, gs_nat s _ (by omega), gs_nat s _ ha, gs_nat s _ (by omega)] + simp [Fc, k0CF]; ring + +def pairs : List (ℕ × ℕ) := [(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(2,3),(2,4),(2,5),(2,6),(2,7),(2,8),(3,4),(3,5),(3,6),(3,7),(3,8), + (4,5),(4,6),(4,7),(4,8),(5,6),(5,7),(5,8),(6,7),(6,8),(7,8)] +theorem mem_pairs (a : ℕ) (ha : a < 9) (b : ℕ) (hb : b < 9) (h : 1 ≤ a ∧ a < b ∧ b ≤ 8) : (a, b) ∈ pairs := by + obtain ⟨h1, h2, h3⟩ := h + interval_cases a <;> interval_cases b <;> simp [pairs] at h2 h3 ⊢ + +def sigOK (lo hi σ : ℚ) : Bool := + pairs.all fun p => decide (Fup (h9CF p.1 p.2) lo hi < σ) || decide (Fup (k0CF p.1 p.2) lo hi < σ) + +theorem okR_h9CF (a b : ℕ) (ha : 1 ≤ a) (hab : a < b) (hb : b ≤ 8) : okR (h9CF a b) := by + intro p hp; simp [h9CF] at hp + rcases hp with h | h | h <;> subst h <;> simp <;> omega +theorem okR_k0CF (a b : ℕ) (ha : 1 ≤ a) (hab : a < b) (hb : b ≤ 8) : okR (k0CF a b) := by + intro p hp; simp [k0CF] at hp + rcases hp with h | h | h <;> subst h <;> simp <;> omega + +/-- **sigma certificate**: if `sigOK lo hi σ`, then for every s in [lo, hi], every 1 <= a <= b <= 8: c2 (gs s) a b <= σ (σ >= 0). -/ +theorem sig_of_ok (lo hi σ : ℚ) (hok : sigOK lo hi σ = true) (hlo : 0 ≤ lo) (hhi : hi ≤ 1) (hσ : 0 ≤ σ) (s : ℝ) + (h1 : (lo : ℝ) ≤ s) (h2 : s ≤ (hi : ℝ)) (a b : ℕ) (ha : 1 ≤ a) (hab : a ≤ b) (hb : b ≤ 8) : + c2 (gs s) (a : ℝ) (b : ℝ) ≤ (σ : ℝ) := by + rcases Nat.lt_or_ge a b with h | h + · have hm : (a, b) ∈ pairs := mem_pairs a (by omega) b (by omega) ⟨ha, h, hb⟩ + have := List.all_eq_true.mp hok (a, b) hm + simp only [Bool.or_eq_true, decide_eq_true_eq] at this + unfold c2 + rcases this with hh | hh + · have := Fc_le (h9CF a b) (okR_h9CF a b ha h hb) lo hi hlo hhi s h1 h2 + have h' : ((Fup (h9CF a b) lo hi : ℚ) : ℝ) < σ := by exact_mod_cast hh + rw [← h9_Fc s a b ha h hb] at this + exact le_trans (min_le_left _ _) (by linarith) + · have := Fc_le (k0CF a b) (okR_k0CF a b ha h hb) lo hi hlo hhi s h1 h2 + have h' : ((Fup (k0CF a b) lo hi : ℚ) : ℝ) < σ := by exact_mod_cast hh + rw [← k0_Fc s a b ha h hb] at this + exact le_trans (min_le_right _ _) (by linarith) + · have hba : a = b := le_antisymm hab h + subst hba + have h0 : h9 (gs s) (a : ℝ) (a : ℝ) = 0 := by unfold h9; simp [gs_zero] + have : c2 (gs s) (a : ℝ) (a : ℝ) ≤ 0 := by unfold c2; rw [h0]; exact min_le_left _ _ + have hσ' : (0 : ℝ) ≤ σ := by exact_mod_cast hσ + linarith + +/-! ### the pieces (t in [t_j, t_{j+1}], s in [1 - t_{j+1}, 1 - t_j]) -/ +end CongestionI3Dual + +#print axioms CongestionI3Dual.sig_of_ok diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3Mu.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3Mu.lean new file mode 100644 index 0000000000..b64a8e7023 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3Mu.lean @@ -0,0 +1,10 @@ +import Nov15.CongestionI3Data + +/-! +Per-chain flag-DP minima mu[i][k] (config i of `cfgs`, chain k): the minimum, over complete flags < ... < z_k^perp, of the number of +FORCED unique cells of chain k (F1 f1dp.py `flagdp(zp, z, cu)`). DATA from internal notes,b}.log (a rerun of f1dp.py with per-chain +printing; per-config sums reproduce f1dp.log: 1936 each). Python exact DP over the 29k-subspace lattice; NOT kernel-checked. +-/ +namespace CongestionI3 +def muTab : List (List ℕ) := [[242, 242, 242, 242, 242, 242, 242, 242], [242, 242, 242, 242, 242, 242, 242, 242], [242, 242, 242, 242, 242, 242, 242, 242], [242, 242, 242, 242, 242, 242, 242, 242], [242, 242, 242, 242, 242, 242, 242, 242], [242, 242, 242, 242, 242, 242, 242, 242], [242, 242, 242, 242, 242, 242, 242, 242], [242, 242, 242, 242, 242, 242, 242, 242]] +end CongestionI3 diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumA.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumA.lean new file mode 100644 index 0000000000..f31be96ce8 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumA.lean @@ -0,0 +1,47 @@ +import Nov15.NumCertK + +/-! +CONGESTION-I3 numeric half A : the 8|9 crossing of F1 (internal notes sec. 3) with NumCertK. +F_base = F of the #7113 caller C(8|9) (caller 6 7) at 17 calls with the native replaced by R1/R2's owned floor (400 * 8^s + 16) and NO stops +(`cfB`; = WholeFloorCover.cfW with the 17 * 88 stop terms (1, -2992), (2, +1496) removed). The I3 lift is the constant 17 * 1936 * sigma0, +sigma0 = 9785438/10^9 <= sp_F(t) (shape-DAG path bound in F currency, F1 f1ceil.spF at t = tbar = .0183952347; DATA, python). +Crossing: dF_base/ds > 0 on [.9, s0] (dLo, kernel), F_base(s0) < 17 * 1936 * sigma0 (kernel), s0 = 1 - tbar, tbar = .0183952347. +-/ +namespace CongestionI3 +open NumCertK + +def cfB : CF := [(1, -656), (8, -7456), (9, 384), (16, -416), (17, 416), (24, -416), (25, 416), (32, -416), (33, 416), + (40, -416), (41, 416), (48, -416), (49, 416), (56, -416), (57, 416), (64, -208), (65, 416), (73, 208), (137, 208)] +def sigma0 : ℚ := 9785438 / 10 ^ 9 +def sA : ℚ := 9816047653 / 10 ^ 10 +def liftA : ℚ := 17 * 1936 * sigma0 + +theorem cfB_ok : okR cfB := by decide +kernel +theorem cfB_p1 : Fup cfB (90 / 100) (91 / 100) < liftA := by decide +kernel +theorem cfB_p2 : Fup cfB (91 / 100) (92 / 100) < liftA := by decide +kernel +theorem cfB_p3 : Fup cfB (92 / 100) (93 / 100) < liftA := by decide +kernel +theorem cfB_d : 0 < dLo cfB (93 / 100) sA := by decide +kernel +theorem cfB_end : Fup cfB sA sA < liftA := by decide +kernel + +/-- F_base(s) < 17 * 1936 * sigma0 on s in [.9, 1 - tbar] -/ +theorem cfB_neg (s : ℝ) (h1 : (9 / 10 : ℝ) ≤ s) (h2 : s ≤ ((sA : ℚ) : ℝ)) : Fc cfB s < ((liftA : ℚ) : ℝ) := by + have piece : ∀ a b : ℚ, 0 ≤ a → b ≤ 1 → Fup cfB a b < liftA → (a : ℝ) ≤ s → s ≤ b → Fc cfB s < ((liftA : ℚ) : ℝ) := by + intro a b ha hb hF h1 h2 + have := Fc_le cfB cfB_ok a b ha hb s h1 h2 + have h' : ((Fup cfB a b : ℚ) : ℝ) < ((liftA : ℚ) : ℝ) := by exact_mod_cast hF + linarith + by_cases c1 : s ≤ (((91 / 100 : ℚ)) : ℝ) + · exact piece (90 / 100) (91 / 100) (by norm_num) (by norm_num) cfB_p1 (by push_cast; linarith) c1 + by_cases c2 : s ≤ (((92 / 100 : ℚ)) : ℝ) + · exact piece (91 / 100) (92 / 100) (by norm_num) (by norm_num) cfB_p2 (by push_neg at c1; exact c1.le) c2 + by_cases hc : s ≤ (((93 / 100 : ℚ)) : ℝ) + · exact piece (92 / 100) (93 / 100) (by norm_num) (by norm_num) cfB_p3 (by push_neg at c2; exact c2.le) hc + have h1' : (((93 / 100 : ℚ)) : ℝ) ≤ s := by push_neg at hc; exact hc.le + have hm := Fc_mono cfB cfB_ok (93 / 100) sA (by norm_num) (by unfold sA; norm_num) cfB_d s h1' h2 + have he := Fc_le cfB cfB_ok sA sA (by unfold sA; norm_num) (by unfold sA; norm_num) sA (le_refl _) (le_refl _) + have he' : ((Fup cfB sA sA : ℚ) : ℝ) < ((liftA : ℚ) : ℝ) := by exact_mod_cast cfB_end + linarith + +end CongestionI3 + +#print axioms CongestionI3.cfB_neg diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC1.lean new file mode 100644 index 0000000000..2533bd0108 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC1.lean @@ -0,0 +1,23 @@ +import Nov15.NumCertK + +/-! +CONGESTION-I3 numeric half C1 : own56 ceiling data, part 1. With the decoder's descent mass >= 56 charged (LIFT1 sec. 3: +cheapest F form 6 * 9^s + 2 * 1 plus 8 rises), the 17-call base is F_base = F(caller 6 7) - 17 (400 * 8^s + 6 * 9^s + 10) (`cfC`). `cfC88` +adds R3's 88 forced stops (-17 * 88 * (2 - 2^s): (1, -2992), (2, +1496)); F < 0 on s in [0, .9] (t >= .1) is covered here and in C2. +-/ +namespace CongestionI3 +open NumCertK + +def cfC : CF := [(1, -554), (8, -7456), (9, 282), (16, -416), (17, 416), (24, -416), (25, 416), (32, -416), (33, 416), + (40, -416), (41, 416), (48, -416), (49, 416), (56, -416), (57, 416), (64, -208), (65, 416), (73, 208), (137, 208)] +def cfC88 : CF := [(1, -3546), (2, 1496), (8, -7456), (9, 282), (16, -416), (17, 416), (24, -416), (25, 416), (32, -416), (33, 416), + (40, -416), (41, 416), (48, -416), (49, 416), (56, -416), (57, 416), (64, -208), (65, 416), (73, 208), (137, 208)] +theorem cfC_ok : okR cfC := by decide +kernel +theorem cfC88_ok : okR cfC88 := by decide +kernel +theorem cfC88_p1 : Fup cfC88 (0) (22/100) < 0 := by decide +kernel +theorem cfC88_p2 : Fup cfC88 (22/100) (39/100) < 0 := by decide +kernel +theorem cfC88_p3 : Fup cfC88 (39/100) (51/100) < 0 := by decide +kernel +theorem cfC88_p4 : Fup cfC88 (51/100) (6/10) < 0 := by decide +kernel +theorem cfC88_p5 : Fup cfC88 (6/10) (67/100) < 0 := by decide +kernel + +end CongestionI3 diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC2.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC2.lean new file mode 100644 index 0000000000..00254cf788 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC2.lean @@ -0,0 +1,13 @@ +import Nov15.CongestionI3NumC1 + +/-! CONGESTION-I3 numeric part C2 : kernel interval pieces for the own56 ceiling; see CongestionI3NumC1 and CongestionI3.md. -/ +namespace CongestionI3 +open NumCertK + +theorem cfC88_p6 : Fup cfC88 (67/100) (72/100) < 0 := by decide +kernel +theorem cfC88_p7 : Fup cfC88 (72/100) (76/100) < 0 := by decide +kernel +theorem cfC88_p8 : Fup cfC88 (76/100) (79/100) < 0 := by decide +kernel +theorem cfC88_p9 : Fup cfC88 (79/100) (81/100) < 0 := by decide +kernel +theorem cfC88_p10 : Fup cfC88 (81/100) (83/100) < 0 := by decide +kernel + +end CongestionI3 diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC3.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC3.lean new file mode 100644 index 0000000000..ddb23f0913 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC3.lean @@ -0,0 +1,17 @@ +import Nov15.CongestionI3NumC2 + +/-! CONGESTION-I3 numeric part C3 : kernel interval pieces for the own56 ceiling; see CongestionI3NumC1 and CongestionI3.md. -/ +namespace CongestionI3 +open NumCertK + +def sC : ℚ := 1 - 134769139 / 10 ^ 10 +def LcC : ℚ := 1364105 / 10 ^ 5 +def liftC : ℚ := 17 * LcC + +theorem cfC88_p11 : Fup cfC88 (83/100) (86/100) < 0 := by decide +kernel +theorem cfC88_p12 : Fup cfC88 (86/100) (88/100) < 0 := by decide +kernel +theorem cfC88_p13 : Fup cfC88 (88/100) (9/10) < 0 := by decide +kernel +theorem cfC_q1 : Fup cfC (90 / 100) (915 / 1000) < liftC := by decide +kernel +theorem cfC_q2 : Fup cfC (915 / 1000) (93 / 100) < liftC := by decide +kernel + +end CongestionI3 diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC4.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC4.lean new file mode 100644 index 0000000000..b6b5c40c1d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionI3NumC4.lean @@ -0,0 +1,59 @@ +import Nov15.CongestionI3NumC3 + +/-! CONGESTION-I3 numeric part C4 : kernel interval pieces for the own56 ceiling; see CongestionI3NumC1 and CongestionI3.md. -/ +namespace CongestionI3 +open NumCertK + +theorem cfC_d : 0 < dLo cfC (93 / 100) sC := by decide +kernel +theorem cfC_end : Fup cfC sC sC < liftC := by decide +kernel + +theorem cfC88_neg (s : ℝ) (h0 : 0 ≤ s) (hs : s ≤ (9 / 10 : ℝ)) : Fc cfC88 s < 0 := by + have piece : ∀ a b : ℚ, 0 ≤ a → b ≤ 1 → Fup cfC88 a b < 0 → (a : ℝ) ≤ s → s ≤ b → Fc cfC88 s < 0 := + fun a b ha hb hF h1 h2 => Fc_neg_piece cfC88 cfC88_ok a b ha hb hF s h1 h2 + by_cases c1 : s ≤ (((22/100) : ℚ) : ℝ) + · exact piece (0) (22/100) (by norm_num) (by norm_num) cfC88_p1 (by simpa using h0) c1 + by_cases c2 : s ≤ (((39/100) : ℚ) : ℝ) + · exact piece (22/100) (39/100) (by norm_num) (by norm_num) cfC88_p2 (by push_cast; push_neg at c1; linarith) c2 + by_cases c3 : s ≤ (((51/100) : ℚ) : ℝ) + · exact piece (39/100) (51/100) (by norm_num) (by norm_num) cfC88_p3 (by push_cast; push_neg at c2; linarith) c3 + by_cases c4 : s ≤ (((6/10) : ℚ) : ℝ) + · exact piece (51/100) (6/10) (by norm_num) (by norm_num) cfC88_p4 (by push_cast; push_neg at c3; linarith) c4 + by_cases c5 : s ≤ (((67/100) : ℚ) : ℝ) + · exact piece (6/10) (67/100) (by norm_num) (by norm_num) cfC88_p5 (by push_cast; push_neg at c4; linarith) c5 + by_cases c6 : s ≤ (((72/100) : ℚ) : ℝ) + · exact piece (67/100) (72/100) (by norm_num) (by norm_num) cfC88_p6 (by push_cast; push_neg at c5; linarith) c6 + by_cases c7 : s ≤ (((76/100) : ℚ) : ℝ) + · exact piece (72/100) (76/100) (by norm_num) (by norm_num) cfC88_p7 (by push_cast; push_neg at c6; linarith) c7 + by_cases c8 : s ≤ (((79/100) : ℚ) : ℝ) + · exact piece (76/100) (79/100) (by norm_num) (by norm_num) cfC88_p8 (by push_cast; push_neg at c7; linarith) c8 + by_cases c9 : s ≤ (((81/100) : ℚ) : ℝ) + · exact piece (79/100) (81/100) (by norm_num) (by norm_num) cfC88_p9 (by push_cast; push_neg at c8; linarith) c9 + by_cases c10 : s ≤ (((83/100) : ℚ) : ℝ) + · exact piece (81/100) (83/100) (by norm_num) (by norm_num) cfC88_p10 (by push_cast; push_neg at c9; linarith) c10 + by_cases c11 : s ≤ (((86/100) : ℚ) : ℝ) + · exact piece (83/100) (86/100) (by norm_num) (by norm_num) cfC88_p11 (by push_cast; push_neg at c10; linarith) c11 + by_cases c12 : s ≤ (((88/100) : ℚ) : ℝ) + · exact piece (86/100) (88/100) (by norm_num) (by norm_num) cfC88_p12 (by push_cast; push_neg at c11; linarith) c12 + exact piece (88/100) (9/10) (by norm_num) (by norm_num) cfC88_p13 (by push_cast; push_neg at c12; linarith) (by push_cast; linarith) + +/-- F_base < 17 * LcC on s in [.9, 1 - tbarC] (the lift is the constant 17 * LcC) -/ +theorem cfC_neg (s : ℝ) (h1 : (9 / 10 : ℝ) ≤ s) (h2 : s ≤ ((sC : ℚ) : ℝ)) : Fc cfC s < ((liftC : ℚ) : ℝ) := by + have piece : ∀ a b : ℚ, 0 ≤ a → b ≤ 1 → Fup cfC a b < liftC → (a : ℝ) ≤ s → s ≤ b → Fc cfC s < ((liftC : ℚ) : ℝ) := by + intro a b ha hb hF h1 h2 + have := Fc_le cfC cfC_ok a b ha hb s h1 h2 + have h' : ((Fup cfC a b : ℚ) : ℝ) < ((liftC : ℚ) : ℝ) := by exact_mod_cast hF + linarith + by_cases c1 : s ≤ (((915 / 1000 : ℚ)) : ℝ) + · exact piece (90 / 100) (915 / 1000) (by norm_num) (by norm_num) cfC_q1 (by push_cast; linarith) c1 + by_cases c2 : s ≤ (((93 / 100 : ℚ)) : ℝ) + · exact piece (915 / 1000) (93 / 100) (by norm_num) (by norm_num) cfC_q2 (by push_neg at c1; exact c1.le) c2 + have h1' : (((93 / 100 : ℚ)) : ℝ) ≤ s := by push_neg at c2; exact c2.le + have hm := Fc_mono cfC cfC_ok (93 / 100) sC (by norm_num) (by unfold sC; norm_num) cfC_d s h1' h2 + have he := Fc_le cfC cfC_ok sC sC (by unfold sC; norm_num) (by unfold sC; norm_num) sC (le_refl _) (le_refl _) + have he' : ((Fup cfC sC sC : ℚ) : ℝ) < ((liftC : ℚ) : ℝ) := by exact_mod_cast cfC_end + linarith + +end CongestionI3 + +#print axioms CongestionI3.cfC88_neg +#print axioms CongestionI3.cfC_neg diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNative.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNative.lean new file mode 100644 index 0000000000..899afcb54b --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNative.lean @@ -0,0 +1,319 @@ +import Nov15.CongestionI3 +import Nov15.CongestionI3DualAlg +import Nov15.CongestionI3DualSig +import Nov15.CongestionI3DualConst +import Nov15.CongestionI3DualData +import Nov15.CongestionI3DualNumC +import Nov15.CongestionI3DualCertC0 +import Nov15.CongestionI3DualCertC1 +import Nov15.CongestionI3DualCertC2 +import Nov15.CongestionI3DualCertC3 +import Nov15.CongestionNativeTab + +/-! +CONGESTION-NATIVE: the native-covering ceiling kappa <= .0136564 (own56, 8|9, m <= 5), the corrected form of +`CongestionI3Dual.ceiling_C2` (a COPY; the shipped files are unchanged). See CongestionNative.md for the hypothesis ledger. +Changes against ceiling_C2 (HC1-HC4, AUD, AUD2 FIX A-C): +* hcong* carries the owned surplus `Omega = dprice ks s + mr - (6 * 9^s + 10)` on the right (ks = descents + non-unit rises, mr = unit rises: FIX-1) and is + stated only for s in [.9, 1 - tC0]; `hE` is generalised to `Lj <= E + Omega` (`branchC_om`, `E_lower_cap_om`). +* ONE J throughout (J = J^arr, the arrival residual): hcong*, hdist and hJ all use the same variable `J`. +* The placeholder Props (Rank8C56, Prov) are gone; `ell`, `corr`, `cap` are concrete (`ellC`, `corrC`, `capC`); `LcTabC` is DERIVED from + rational tables (CongestionNativeTab) and the hypotheses hspMono/hcstMono/hspTab/hcstTab/hunitTab. +* `hcong_of_capclass` (+ PathCut.lean) formalises the accounting that proves hcong* from the Cap class. +-/ +namespace CongestionNative +open NumCertK JointCeiling CallerCost CongestionI3 CongestionI3Dual Finset + +/-! ### 0. copied from CongestionI3Dual (F_base monotonicity and point enclosures, own56 side) -/ +theorem Fc_monoOn (cf : CF) (hok : okR cf) (a b : ℚ) (ha : 0 ≤ a) (hb1 : b ≤ 1) (hd : 0 < dLo cf a b) + (s s' : ℝ) (h1 : (a : ℝ) ≤ s) (hss : s ≤ s') (h2 : s' ≤ (b : ℝ)) : Fc cf s ≤ Fc cf s' := by + have hab : (a : ℝ) ≤ b := le_trans h1 (le_trans hss h2) + have hcont : ContinuousOn (Fc cf) (Set.Icc (a : ℝ) b) := + fun x _ => (Fc_hasDerivAt cf hok x).continuousAt.continuousWithinAt + have hm : StrictMonoOn (Fc cf) (Set.Icc (a : ℝ) b) := by + apply strictMonoOn_of_deriv_pos (convex_Icc _ _) hcont + intro x hx + rw [interior_Icc] at hx + rw [(Fc_hasDerivAt cf hok x).deriv] + have := dFc_ge cf hok a b ha hb1 x hx.1.le hx.2.le + have hd' : (0:ℝ) < ((dLo cf a b : ℚ) : ℝ) := by exact_mod_cast hd + linarith + exact hm.monotoneOn ⟨h1, le_trans hss h2⟩ ⟨le_trans h1 hss, h2⟩ hss + +theorem cfC_monoOn (s s' : ℝ) (h1 : (93 / 100 : ℝ) ≤ s) (hss : s ≤ s') (h2 : s' ≤ ((sC : ℚ) : ℝ)) : Fc cfC s ≤ Fc cfC s' := + Fc_monoOn cfC cfC_ok (93 / 100) sC (by norm_num) (by unfold sC; norm_num) cfC_d s s' + (by rw [show (((93 / 100 : ℚ)) : ℝ) = 93 / 100 by norm_num]; exact h1) hss h2 + +theorem pt_of_Fup (cf : CF) (hok : okR cf) (q L : ℚ) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (h : Fup cf q q < 17 * L) : + Fc cf (q : ℝ) < 17 * (L : ℝ) := by + have h1 := Fc_le cf hok q q hq0 hq1 (q : ℝ) (le_refl _) (le_refl _) + have h2 : ((Fup cf q q : ℚ) : ℝ) < ((17 * L : ℚ) : ℝ) := by exact_mod_cast h + push_cast at h2 + linarith + +theorem hFbC_of (a b L : ℚ) (hb93 : 93 / 100 ≤ 1 - b) (hab : a ≤ b) (haA : 1 - a ≤ sC) (ha0 : 0 ≤ a) + (hpt : Fup cfC (1 - a) (1 - a) < 17 * L) : + ∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → Fc cfC s < 17 * (L : ℝ) := by + intro s h1 h2 + have hb : (((93 / 100 : ℚ)) : ℝ) ≤ s := le_trans (by exact_mod_cast hb93) h1 + have hb' : (93 / 100 : ℝ) ≤ s := by rwa [show (((93 / 100 : ℚ)) : ℝ) = 93 / 100 by norm_num] at hb + have hm := cfC_monoOn s ((1 - a : ℚ) : ℝ) hb' h2 (by exact_mod_cast haA) + exact lt_of_le_of_lt hm (pt_of_Fup cfC cfC_ok (1 - a) L (by linarith [(by exact_mod_cast hab : (a : ℚ) ≤ b)]) (by linarith) hpt) + +/-! ### 1. concrete definitions -/ + +/-- owned surplus: all owned moves `|k|^s` (ks = descents + non-unit rises, mr = unit rises, price 1 each) minus what `own56_floor` charges (6 * 9^s + 10). -/ +noncomputable def Omega (ks : List ℕ) (mr : ℕ) (s : ℝ) : ℝ := dprice ks s + mr - (6 * (9 : ℝ) ^ s + 10) +/-- per-cell cap `(9^s - 8^s) / 48` -/ +noncomputable def capC (s : ℝ) : ℝ := ((9 : ℝ) ^ s - (8 : ℝ) ^ s) / 48 +/-- lower bound of the capped per-cell distance: `min (spF (1 - s)) (cap s)` -/ +noncomputable def ellC (spF : ℝ → ℝ) (s : ℝ) : ℝ := min (spF (1 - s)) (capC s) +/-- LIFT1 rise correction `8 * cst(1 - s)` -/ +noncomputable def corrC (cstF : ℝ → ℝ) (s : ℝ) : ℝ := 8 * cstF (1 - s) + +/-! ### 2. two-sided I3 with the owned surplus on the right -/ +section Elower +variable {ι : Type*} [DecidableEq ι] + +/-- two-sided I3, cap/correction form with surplus: `sum min (dist, cap) - corr <= charges + Om` gives `E + Om >= 1936 ell - corr - m sigma`. -/ +theorem E_lower_cap_om (R : Finset ι) (n : ι → ℕ) (d : ι → ℕ → ℕ) (J : Finset (ℕ × ℕ)) (dist : ℕ × ℕ → ℝ) + (E s cap corr ell σ Om : ℝ) (m : ℕ) + (hmono : ∀ r ∈ R, ∀ i < n r, d r i ≤ d r (i + 1)) (hd9 : ∀ r ∈ R, d r (n r) ≤ 9) + (hm : (R.filter fun r => Mixed d n r).card ≤ m) (hσ0 : 0 ≤ σ) + (hσ : ∀ a b : ℕ, 1 ≤ a → a ≤ b → b ≤ 8 → c2 (gs s) (a : ℝ) (b : ℝ) ≤ σ) + (hcong : ∑ p ∈ J, min (dist p) cap - corr ≤ ∑ r ∈ R, ∑ i ∈ range (n r), c2 (gs s) (lev d r i) (lev d r (i + 1)) + Om) + (hEex : ∑ r ∈ R, ex (gs s) (lev d r) (n r) ≤ E) (hdist : ∀ p ∈ J, ell ≤ min (dist p) cap) (hJ : 1936 ≤ J.card) (hell : 0 ≤ ell) : + 1936 * ell - corr - m * σ ≤ E + Om := by + have h1 := sum_all_c2_le (gs s) (gs_zero s) R n d hmono hd9 m hm σ hσ0 hσ + have h2 := Finset.card_nsmul_le_sum J (fun p => min (dist p) cap) ell hdist + rw [nsmul_eq_mul] at h2 + have hj : (1936 : ℝ) ≤ J.card := by exact_mod_cast hJ + nlinarith + +end Elower + +/-! ### 3. the branch with the surplus (the 88c branch is only needed for t >= .1) -/ + +theorem branchC_om (n : Inv) (ks : List ℕ) (mr : ℕ) (E Lj s : ℝ) + (hF : Finv s n ≤ -400 * (8 : ℝ) ^ s - dprice ks s - mr - E) + (hE : Lj ≤ E + Omega ks mr s) (hFb : Fc cfC s < 17 * Lj) : + Finv s (invoice (caller 6 7) n 17) < 0 := by + have h1' : Finv s n ≤ -400 * (8 : ℝ) ^ s - (6 * (9 : ℝ) ^ s + 10) - Lj := by + unfold Omega at hE; linarith + have h2 := invoice_F s (caller 6 7) n 17 + have h3 := invoice_F s (caller 6 7) natBaseC 17 + have h4 := natBaseC_F s + have h6 := baseC_eq s + push_cast at h2 h3 + nlinarith + +/-! ### 4. the Cap-class accounting (HC1 sec. 2): hcong* from legal + transported cells -/ + +/-- `J` splits into LEGAL cells (a descent-free D_t-confined path: I3 charge + rise saving `cst * Rm`) and TRANSPORTED cells (cut at an owned descent, `<= 48 * Nf` of them, each at most `cap = U/48`). +Then `sum min - 8 cst <= Pub + Om` as soon as the Cap class inequality `cst (Rm - 8) + U Nf <= Om` holds. -/ +theorem hcong_of_capclass (J : Finset (ℕ × ℕ)) (leg : ℕ × ℕ → Prop) [DecidablePred leg] (dist : ℕ × ℕ → ℝ) + (cap U Pub cst Rm Nf Om : ℝ) (hcap : cap = U / 48) (hU : 0 ≤ U) + (hleg : ∑ p ∈ J.filter leg, dist p ≤ Pub + cst * Rm) + (hT : ((J.filter fun p => ¬ leg p).card : ℝ) ≤ 48 * Nf) + (hclass : cst * (Rm - 8) + U * Nf ≤ Om) : + ∑ p ∈ J, min (dist p) cap - 8 * cst ≤ Pub + Om := by + have hsplit := Finset.sum_filter_add_sum_filter_not J leg (fun p => min (dist p) cap) + have h1 : ∑ p ∈ J.filter leg, min (dist p) cap ≤ ∑ p ∈ J.filter leg, dist p := + Finset.sum_le_sum fun p _ => min_le_left _ _ + have h2 : ∑ p ∈ J.filter (fun p => ¬ leg p), min (dist p) cap ≤ ∑ _p ∈ J.filter (fun p => ¬ leg p), cap := + Finset.sum_le_sum fun p _ => min_le_right _ _ + rw [Finset.sum_const, nsmul_eq_mul] at h2 + have hc0 : 0 ≤ cap := by rw [hcap]; positivity + have h3 : ((J.filter fun p => ¬ leg p).card : ℝ) * cap ≤ 48 * Nf * cap := mul_le_mul_of_nonneg_right hT hc0 + have h4 : 48 * Nf * cap = U * Nf := by rw [hcap]; ring + nlinarith + +/-! ### 5. the derived table `LcTabC` -/ + +theorem unit_mono (s s' : ℝ) (hs : 0 ≤ s) (h : s ≤ s') : (9 : ℝ) ^ s - (8 : ℝ) ^ s ≤ (9 : ℝ) ^ s' - (8 : ℝ) ^ s' := by + have e : ∀ x : ℝ, (9 : ℝ) ^ x - (8 : ℝ) ^ x = (8 : ℝ) ^ x * (((9 : ℝ) / 8) ^ x - 1) := by + intro x + have h9 : (9 : ℝ) ^ x = (8 : ℝ) ^ x * ((9 : ℝ) / 8) ^ x := by + rw [← Real.mul_rpow (by norm_num) (by norm_num)]; norm_num + rw [h9]; ring + rw [e, e] + have h1 : (8 : ℝ) ^ s ≤ (8 : ℝ) ^ s' := Real.rpow_le_rpow_of_exponent_le (by norm_num) h + have h2 : ((9 : ℝ) / 8) ^ s ≤ ((9 : ℝ) / 8) ^ s' := Real.rpow_le_rpow_of_exponent_le (by norm_num) h + have h3 : (1 : ℝ) ≤ ((9 : ℝ) / 8) ^ s := Real.one_le_rpow (by norm_num) hs + exact mul_le_mul h1 (by linarith) (by linarith) (by positivity) + +/-- one t-piece `[a, b]` of the own56 table: `lcp <= 1936 ell - corr` follows from the rational table and endpoint hypotheses (monotonicity of spF and cst in t). -/ +theorem tab_piece (spF cstF : ℝ → ℝ) (a b : ℚ) (lcp cH spLo unLo : ℚ) (hlcp : 0 ≤ lcp) (hcH : 0 ≤ cH) (ha0 : tC0 ≤ a) (hab : a ≤ b) (hb : b ≤ 1 / 10) + (hmS : MonotoneOn spF (Set.Icc ((tC0 : ℚ) : ℝ) (1 / 10))) (hmC : MonotoneOn cstF (Set.Icc ((tC0 : ℚ) : ℝ) (1 / 10))) + (hsp : (spLo : ℝ) ≤ spF (a : ℝ)) (hcs : cstF (b : ℝ) ≤ cH) + (hun : (unLo : ℝ) ≤ (9 : ℝ) ^ (1 - (b : ℝ)) - (8 : ℝ) ^ (1 - (b : ℝ))) + (hn1 : lcp + 8 * cH ≤ 1936 * spLo) (hn2 : lcp + 8 * cH ≤ 1936 * (unLo / 48)) : + ∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → (lcp : ℝ) ≤ 1936 * ellC spF s - corrC cstF s ∧ 0 ≤ ellC spF s := by + intro s h1 h2 + push_cast at h1 h2 + have ha' : ((tC0 : ℚ) : ℝ) ≤ a := by exact_mod_cast ha0 + have hab' : (a : ℝ) ≤ b := by exact_mod_cast hab + have hb' : (b : ℝ) ≤ 1 / 10 := by + have := (Rat.cast_le (K := ℝ)).mpr hb + push_cast at this; exact this + have htl : (a : ℝ) ≤ 1 - s := by linarith + have htu : 1 - s ≤ (b : ℝ) := by linarith + have hspt : spF a ≤ spF (1 - s) := hmS ⟨ha', by linarith⟩ ⟨by linarith, by linarith⟩ htl + have hcst : cstF (1 - s) ≤ cstF b := hmC ⟨by linarith, by linarith⟩ ⟨by linarith, hb'⟩ htu + have hcap : (unLo : ℝ) / 48 ≤ capC s := by + have := unit_mono (1 - b) s (by linarith) h1 + unfold capC; linarith + have hell : min (spLo : ℝ) ((unLo : ℝ) / 48) ≤ ellC spF s := by + unfold ellC + exact le_min (le_trans (min_le_left _ _) (by linarith)) (le_trans (min_le_right _ _) hcap) + have hcorr : corrC cstF s ≤ 8 * (cH : ℝ) := by unfold corrC; linarith + have hn1' : (lcp : ℝ) + 8 * cH ≤ 1936 * spLo := by exact_mod_cast hn1 + have hn2' : (lcp : ℝ) + 8 * cH ≤ 1936 * ((unLo : ℝ) / 48) := by exact_mod_cast hn2 + have hl0 : (0 : ℝ) ≤ lcp := by exact_mod_cast hlcp + have hc0 : (0 : ℝ) ≤ cH := by exact_mod_cast hcH + rcases le_total (spLo : ℝ) ((unLo : ℝ) / 48) with hh | hh + · rw [min_eq_left hh] at hell; exact ⟨by linarith, by linarith⟩ + · rw [min_eq_right hh] at hell; exact ⟨by linarith, by linarith⟩ + +/-! ### 6. the native-covering ceiling -/ + +/-- **native-covering ceiling.** For a word whose public registers have at most 5 mixed registers (`hmix`) and whose owned layer splits as `ks` (descents + non-unit rises) and `mr` (unit rises), +if the congestion step `hcong` (with the owned surplus), the distance floor `hdist`, `hJ` (|J| >= 1936) hold for ONE set `J` (= J^arr), together with the accounting identities and the +certified tables, then `F(1 - t, invoice (caller 6 7) n 17) < 0` for all t in [tC0, 1], i.e. kappa <= tC0 = .0136564 (8|9). Every hypothesis is listed in CongestionNative.md. -/ +theorem ceiling_native {ι : Type*} [DecidableEq ι] + (R : Finset ι) (nR : ι → ℕ) (dR : ι → ℕ → ℕ) + (hmono : ∀ r ∈ R, ∀ i < nR r, dR r i ≤ dR r (i + 1)) (hd9 : ∀ r ∈ R, dR r (nR r) ≤ 9) + (hmix : (R.filter fun r => Mixed dR nR r).card ≤ 5) + (n : Inv) (ks : List ℕ) (mr st : ℕ) (E : ℝ → ℝ) (J : Finset (ℕ × ℕ)) (distF : ℝ → ℕ × ℕ → ℝ) (spF cstF : ℝ → ℝ) + (hk : ∀ k ∈ ks, 1 ≤ k ∧ k ≤ 9) (hmass : 56 ≤ ks.sum) (hmd : 8 ≤ ks.length) (hmr : 8 ≤ mr) + (hF : ∀ s, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - dprice ks s - mr - E s) + (hY : 104 ≤ st + (ks.length + mr)) + (hst : ∀ s, 0 ≤ s → s ≤ 1 → (2 - (2 : ℝ) ^ s) * st ≤ E s) + (hEex : ∀ s, 0 ≤ s → s ≤ 1 → ∑ r ∈ R, ex (gs s) (lev dR r) (nR r) ≤ E s) + (hcong : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tC0 : ℚ) : ℝ) → + ∑ p ∈ J, min (distF s p) (capC s) - corrC cstF s ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hdist : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tC0 : ℚ) : ℝ) → ∀ p ∈ J, spF (1 - s) ≤ distF s p) + (hJ : 1936 ≤ J.card) + (hspMono : MonotoneOn spF (Set.Icc ((tC0 : ℚ) : ℝ) (1 / 10))) + (hcstMono : MonotoneOn cstF (Set.Icc ((tC0 : ℚ) : ℝ) (1 / 10))) + (hspTab : ((spFloC0 : ℚ) : ℝ) ≤ spF ((tC0 : ℚ) : ℝ) ∧ ((spFloC1 : ℚ) : ℝ) ≤ spF ((tC1 : ℚ) : ℝ) ∧ + ((spFloC2 : ℚ) : ℝ) ≤ spF ((tC2 : ℚ) : ℝ) ∧ ((spFloC3 : ℚ) : ℝ) ≤ spF ((tC3 : ℚ) : ℝ)) + (hcstTab : cstF ((tC1 : ℚ) : ℝ) ≤ ((cHC0 : ℚ) : ℝ) ∧ cstF ((tC2 : ℚ) : ℝ) ≤ ((cHC1 : ℚ) : ℝ) ∧ + cstF ((tC3 : ℚ) : ℝ) ≤ ((cHC2 : ℚ) : ℝ) ∧ cstF (1 / 10) ≤ ((cHC3 : ℚ) : ℝ)) + (hunitTab : ((unitLoC0 : ℚ) : ℝ) ≤ (9 : ℝ) ^ (1 - ((tC1 : ℚ) : ℝ)) - (8 : ℝ) ^ (1 - ((tC1 : ℚ) : ℝ)) ∧ + ((unitLoC1 : ℚ) : ℝ) ≤ (9 : ℝ) ^ (1 - ((tC2 : ℚ) : ℝ)) - (8 : ℝ) ^ (1 - ((tC2 : ℚ) : ℝ)) ∧ + ((unitLoC2 : ℚ) : ℝ) ≤ (9 : ℝ) ^ (1 - ((tC3 : ℚ) : ℝ)) - (8 : ℝ) ^ (1 - ((tC3 : ℚ) : ℝ)) ∧ + ((unitLoC3 : ℚ) : ℝ) ≤ (9 : ℝ) ^ (1 - (1 / 10 : ℝ)) - (8 : ℝ) ^ (1 - (1 / 10 : ℝ))) : + ∀ t : ℝ, ((tC0 : ℚ) : ℝ) ≤ t → t ≤ 1 → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 := by + have piece : ∀ (a b lcp σ : ℚ), sigOK (1 - b) (1 - a) σ = true → 0 ≤ σ → tC0 ≤ a → a ≤ b → b ≤ 1 / 10 → 0 ≤ lcp → + (∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → (lcp : ℝ) ≤ 1936 * ellC spF s - corrC cstF s ∧ 0 ≤ ellC spF s) → + (∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → Fc cfC s < 17 * (((lcp - 5 * σ : ℚ)) : ℝ)) → + ∀ t : ℝ, (a : ℝ) ≤ t → t ≤ (b : ℝ) → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 := by + intro a b lcp σ hσc hσ0 ha0 hab hb hl0 hLcp hFb t h1 h2 + have ha0q : (0 : ℚ) ≤ a := le_trans (by unfold tC0; norm_num) ha0 + have ha0' : ((tC0 : ℚ) : ℝ) ≤ a := by exact_mod_cast ha0 + have hb' : (b : ℝ) ≤ 1 / 10 := by + have := (Rat.cast_le (K := ℝ)).mpr hb + push_cast at this; exact this + have hab' : (a : ℝ) ≤ b := by exact_mod_cast hab + have hA0 : (0 : ℝ) ≤ a := by exact_mod_cast ha0q + have hs0 : 0 ≤ 1 - t := by linarith + have hs1 : 1 - t ≤ 1 := by linarith + have hσ : ∀ a' b' : ℕ, 1 ≤ a' → a' ≤ b' → b' ≤ 8 → c2 (gs (1 - t)) (a' : ℝ) (b' : ℝ) ≤ (σ : ℝ) := by + intro a' b' h1' h2' h3' + exact sig_of_ok (1 - b) (1 - a) σ hσc (by linarith) (by linarith) hσ0 (1 - t) + (by push_cast; linarith) (by push_cast; linarith) a' b' h1' h2' h3' + have hl0' : (0 : ℝ) ≤ lcp := by exact_mod_cast hl0 + have hLcp' := hLcp (1 - t) (by push_cast; linarith) (by push_cast; linarith) + have hslo : (9 / 10 : ℝ) ≤ 1 - t := by linarith + have hshi : 1 - t ≤ 1 - ((tC0 : ℚ) : ℝ) := by linarith + have hell : 0 ≤ ellC spF (1 - t) := hLcp'.2 + have hE := E_lower_cap_om R nR dR J (distF (1 - t)) (E (1 - t)) (1 - t) (capC (1 - t)) (corrC cstF (1 - t)) (ellC spF (1 - t)) + (σ : ℝ) (Omega ks mr (1 - t)) 5 hmono hd9 hmix (by exact_mod_cast hσ0) hσ (hcong (1 - t) hslo hshi) (hEex _ hs0 hs1) + (fun p hp => le_min (le_trans (min_le_left _ _) (hdist (1 - t) hslo hshi p hp)) (min_le_right _ _)) hJ hell + have hE' : (((lcp - 5 * σ : ℚ)) : ℝ) ≤ E (1 - t) + Omega ks mr (1 - t) := by push_cast; push_cast at hE; linarith [hLcp'.1] + exact branchC_om n ks mr (E (1 - t)) _ (1 - t) (hF _ hs0 hs1) hE' + (hFb (1 - t) (by push_cast; linarith) (by push_cast; linarith)) + intro t ht ht1 + have htC0 : (0 : ℝ) ≤ ((tC0 : ℚ) : ℝ) := by unfold tC0; norm_num + have hs0 : (0 : ℝ) ≤ 1 - t := by linarith + have hs1 : 1 - t ≤ 1 := by linarith + have hu1 : (1 : ℝ) ≤ (2 : ℝ) ^ (1 - t) := Real.one_le_rpow (by norm_num) hs0 + have hu2 : (2 : ℝ) ^ (1 - t) ≤ 2 := by + have := Real.rpow_le_rpow_of_exponent_le (show (1 : ℝ) ≤ 2 by norm_num) hs1; simpa using this + have hE0 : 0 ≤ E (1 - t) := + le_trans (mul_nonneg (by linarith) (Nat.cast_nonneg st)) (hst _ hs0 hs1) + rcases le_or_gt (1 / 10 : ℝ) t with h10 | h10 + · have h2 := invoice_F (1 - t) (caller 6 7) n 17 + have h3 := invoice_F (1 - t) (caller 6 7) natBaseC 17 + have h4 := natBaseC_F (1 - t) + push_cast at h2 h3 + have h1 := own56_floor (1 - t) hs0 hs1 ks hk hmass hmd mr st hmr (Finv (1 - t) n) (E (1 - t)) 0 (hF _ hs0 hs1) hY + (hst _ hs0 hs1) hE0 + have hc0 : (0 : ℝ) ≤ 88 * (2 - (2 : ℝ) ^ (1 - t)) := by linarith + rw [max_eq_left hc0] at h1 + have h5 := cfC88_neg (1 - t) hs0 (by linarith) + have h6 := base88_eq (1 - t) + nlinarith + · obtain ⟨sp0, sp1, sp2, sp3⟩ := hspTab + obtain ⟨cs0, cs1, cs2, cs3⟩ := hcstTab + obtain ⟨un0, un1, un2, un3⟩ := hunitTab + have q01 : tC0 ≤ tC1 := by unfold tC0 tC1; norm_num + have q12 : tC1 ≤ tC2 := by unfold tC1 tC2; norm_num + have q23 : tC2 ≤ tC3 := by unfold tC2 tC3; norm_num + have q3 : tC3 ≤ 1 / 10 := by unfold tC3; norm_num + have lcp0 : ∀ q : ℚ, q = lcpC0 ∨ q = lcpC1 ∨ q = lcpC2 ∨ q = lcpC3 → 0 ≤ q := by + intro q h; unfold lcpC0 lcpC1 lcpC2 lcpC3 at h; rcases h with h | h | h | h <;> rw [h] <;> norm_num + have cH0 : ∀ q : ℚ, q = cHC0 ∨ q = cHC1 ∨ q = cHC2 ∨ q = cHC3 → 0 ≤ q := by + intro q h; unfold cHC0 cHC1 cHC2 cHC3 at h; rcases h with h | h | h | h <;> rw [h] <;> norm_num + have e1 : ((tC0 : ℚ) : ℝ) ≤ ((tC1 : ℚ) : ℝ) := by exact_mod_cast q01 + have e2 : ((tC1 : ℚ) : ℝ) ≤ ((tC2 : ℚ) : ℝ) := by exact_mod_cast q12 + have e3 : ((tC2 : ℚ) : ℝ) ≤ ((tC3 : ℚ) : ℝ) := by exact_mod_cast q23 + by_cases k1 : t ≤ ((tC1 : ℚ) : ℝ) + · exact piece tC0 tC1 lcpC0 sgC0 sigC0 (by unfold sgC0; norm_num) (le_refl _) q01 (by linarith) (lcp0 _ (Or.inl rfl)) + (tab_piece spF cstF tC0 tC1 lcpC0 cHC0 spFloC0 unitLoC0 (lcp0 _ (Or.inl rfl)) (cH0 _ (Or.inl rfl)) (le_refl _) q01 (by linarith) + hspMono hcstMono sp0 cs0 un0 tabC0.1 tabC0.2) + (hFbC_of tC0 tC1 LC0 (by unfold tC1; norm_num) q01 (by unfold tC0 sC; norm_num) (by unfold tC0; norm_num) ptC0) t ht k1 + by_cases k2 : t ≤ ((tC2 : ℚ) : ℝ) + · exact piece tC1 tC2 lcpC1 sgC1 sigC1 (by unfold sgC1; norm_num) q01 q12 (by linarith) (lcp0 _ (Or.inr (Or.inl rfl))) + (tab_piece spF cstF tC1 tC2 lcpC1 cHC1 spFloC1 unitLoC1 (lcp0 _ (Or.inr (Or.inl rfl))) (cH0 _ (Or.inr (Or.inl rfl))) q01 q12 (by linarith) + hspMono hcstMono sp1 cs1 un1 tabC1.1 tabC1.2) + (hFbC_of tC1 tC2 LC1 (by unfold tC2; norm_num) q12 (by unfold tC1 sC; norm_num) (by unfold tC1; norm_num) ptC1) t + (by push Not at k1; exact k1.le) k2 + by_cases k3 : t ≤ ((tC3 : ℚ) : ℝ) + · exact piece tC2 tC3 lcpC2 sgC2 sigC2 (by unfold sgC2; norm_num) (le_trans q01 q12) q23 (by linarith) (lcp0 _ (Or.inr (Or.inr (Or.inl rfl)))) + (tab_piece spF cstF tC2 tC3 lcpC2 cHC2 spFloC2 unitLoC2 (lcp0 _ (Or.inr (Or.inr (Or.inl rfl)))) (cH0 _ (Or.inr (Or.inr (Or.inl rfl)))) + (le_trans q01 q12) q23 (by linarith) hspMono hcstMono sp2 cs2 un2 tabC2.1 tabC2.2) + (hFbC_of tC2 tC3 LC2 (by unfold tC3; norm_num) q23 (by unfold tC2 sC; norm_num) (by unfold tC2; norm_num) ptC2) t + (by push Not at k2; exact k2.le) k3 + · have h110 : (((1 / 10 : ℚ)) : ℝ) = 1 / 10 := by norm_num + refine piece tC3 (1 / 10) lcpC3 sgC3 ?_ (by unfold sgC3; norm_num) (le_trans q01 (le_trans q12 q23)) q3 (le_refl _) + (lcp0 _ (Or.inr (Or.inr (Or.inr rfl)))) ?_ ?_ t (by push Not at k3; exact k3.le) (by push_cast; exact h10.le) + · rw [show (1 - 1 / 10 : ℚ) = 9 / 10 by norm_num]; exact sigC3 + · refine tab_piece spF cstF tC3 (1 / 10) lcpC3 cHC3 spFloC3 unitLoC3 (lcp0 _ (Or.inr (Or.inr (Or.inr rfl)))) (cH0 _ (Or.inr (Or.inr (Or.inr rfl)))) + (le_trans q01 (le_trans q12 q23)) q3 (le_refl _) hspMono hcstMono sp3 ?_ ?_ tabC3.1 tabC3.2 + · rw [h110]; exact cs3 + · rw [h110]; exact un3 + · intro s hs1' hs2' + have hsC' : s ≤ ((sC : ℚ) : ℝ) := by + have : (1 : ℚ) - tC3 ≤ sC := by unfold tC3 sC; norm_num + have h' : (((1 - tC3 : ℚ)) : ℝ) ≤ ((sC : ℚ) : ℝ) := by exact_mod_cast this + linarith + have h9 : (9 / 10 : ℝ) ≤ s := by + have : ((((1 - 1 / 10 : ℚ)) : ℚ) : ℝ) = 9 / 10 := by norm_num + linarith + have := cfC_neg s h9 hsC' + have h7 : ((liftC : ℚ) : ℝ) ≤ 17 * (((lcpC3 - 5 * sgC3 : ℚ)) : ℝ) := by + have : liftC ≤ 17 * LC3 := LC3_ge + exact_mod_cast this + linarith + +end CongestionNative + +#print axioms CongestionNative.E_lower_cap_om +#print axioms CongestionNative.branchC_om +#print axioms CongestionNative.hcong_of_capclass +#print axioms CongestionNative.unit_mono +#print axioms CongestionNative.tab_piece +#print axioms CongestionNative.ceiling_native diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNative.md b/research/p104-tree-ceiling/lean/Nov15/CongestionNative.md new file mode 100644 index 0000000000..ea9a98b175 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNative.md @@ -0,0 +1,33 @@ +# CongestionNative.lean (+ CongestionNativeTab.lean, PathCut.lean): the native-covering ceiling kappa <= .0136564 +Copy of the own56 half of CongestionI3Dual*.lean (shipped files untouched), with the HC1-HC4 / AUD / AUD2 edits. Kernel only: no sorry, no native_decide; `#print axioms` of every theorem = [propext, Classical.choice, Quot.sound]. Builds (runlean.sh, one at a time): CongestionNativeTab 10 s / 1.3 GB, PathCut 4 s / 1.4 GB, CongestionNative 11 s / 3.0 GB. + +## What changed against `ceiling_C2` (all done) +- hcong* has the owned surplus on the right: `Omega ks mr s = dprice ks s + mr - (6*9^s+10)`; ks = 24 descents + 13 non-unit rises (sum 102), mr = 10 unit rises (AUD FIX-1; the literal split gives Omega 16.1 < 24.8 and is out of class); stated only for s in [.9, 1 - tC0]. +- `hE` generalised to `Lj <= E + Omega` (`E_lower_cap_om`, `branchC_om`). Omega cancels, so tC0 = .0136564 is unchanged. `branchC_om` needs no ks-hypotheses; hk/hmass/hmd/hmr are used only in the t >= .1 branch (own56_floor, 88c). +- ONE J: a single `J : Finset (ℕ × ℕ)` in hcong, hdist, hJ. It is J^arr (the arrival residual) by interpretation; Lean cannot see that, it is a name for the set the data hypotheses are about. +- FIX C: `Rank8C56`, `Prov`, `PlaneSep`, `MV` are gone. No bare `Prop` stands in for a condition. `ell`, `corr`, `cap` are concrete: `ellC spF s = min (spF (1-s)) (capC s)`, `capC s = (9^s-8^s)/48`, `corrC cstF s = 8 * cstF (1-s)`. +- `LcTabC` is no longer a hypothesis: it is DERIVED (`tab_piece`, `unit_mono` proved) from the rational tables of CongestionNativeTab (outward-rounded, emitted from hc9's 80-digit Decimals; the arithmetic `lcp_j + 8 cH_j <= 1936 min(spFlo_j, unitLo_j/48)` is norm_num-proved) and the hypotheses 11-13 below. +- PathCut.lean: `path_cut` PROVED (abstract: preorder of charts, monotone `Hold`, public edges ascend, owned edges NESTED (FIX A), confinement to G; conclusion: legal path, or a first owned strict descent dropping u_s with all earlier charts holding u_s and c_i <= G). `nested_needed`: Lean counterexample (lateral owned move {0} -> {1}) showing the nestedness premise cannot be dropped. `transported_card_le`: |Jt| <= 48 |V| from the 48-law and "every transported cell lies in cells(visit)". +- `hcong_of_capclass` PROVED: legal cells (charge `Pub + cst*Rm`) + transported cells (`<= 48 Nf`, cap U/48) + Cap class `cst (Rm-8) + U Nf <= Omega` give hcong*. It is the accounting of HC1 sec. 2, not used inside `ceiling_native` (which takes hcong* itself). +No paper statement was found false as written. Known and already encoded: hcong* fails for the natives at t > ~.507 (hence the s-range); the literal ks/mr split is out of class (hence FIX-1). + +## `ceiling_native`: EVERY hypothesis (status for st1 / #7637 / x1t2a; "Lean" = what the kernel checked) +Lean treats R, n, ks, mr, st, E, J, distF, spF, cstF as abstract data. The statement is: IF the listed facts hold for these objects THEN F(1-t, invoice (caller 6 7) n 17) < 0 for t in [tC0, 1]. **That st1, #7637 and x1t2a satisfy the hypotheses (class membership) rests on the computed facts below, not on Lean.** One owned layer is shared by all three words (one data point, not three). +1. hmono, hd9 (public registers ascend, end <= 9): natives: computed fact (0 non-ascending public moves; WHOLEFLOOR/hcong/audit/au2.py, audit2/aud2a.py). +2. hmix (<= 5 mixed registers): natives: computed fact (hmix = 5, aud2a.py). +3. hk, hmass, hmd, hmr (ks/mr split, ranks <= 6 in [1,9], sum 102 >= 56, length 37 >= 8, mr 10 >= 8): natives: computed fact (au1.py, aud2a.py). +4. hF (F-currency identity, equality up to float noise): natives: computed fact (hc6.py, aud2a.py; needs all 400 mains to span 8). +5. hY (104 <= st + 47, st = 1266): natives: computed fact (aud2a.py). +6. hst (slack >= 158 on the grid; 0 only at s = 1): natives: computed fact (hc6.py, aud2a.py). +7. hEex (E >= sum of register excesses; identity): proved as an identity on the natives (hc6.py); open as a general lemma outside the natives. +8. **hcong\*** (sum_J min(dist,cap) - 8 cst <= sum_pub c2 + Omega, s in [.9, 1-tC0]): paper-proved on the Cap class from Path-Cut + I3 + rise charge (PV1 sec. 3, HC1 sec. 2); in Lean only `path_cut`, `transported_card_le`, `hcong_of_capclass` (the combinatorial/arithmetic parts) are proved; the register-machine facts (SP span law, D_t-confined ADD path, I3 distance bound) are NOT formalised. Natives: computed fact: Cap margin Omega - cst(Rm-8) - U Nf >= 19.356 on [.9, 1-tC0] (Omega 47.995, Nf 24, Rm 56); 6124 public moves nested strict ascents, 47 owned moves nested (23 up, 24 down), 207,881 ADDs same chart; all 4962 cells have a legal owned-descent-free path (WHOLEFLOOR/hcong/audit/au1.py, audit2/aud2a.py, prov/pv1-pv4.py). 48-law: computed exhaustively (aud2d.py, max n*m = 48 over all 1,398,491 port-spanned subspaces of dim <= 4; natives max 24, hc8.py). +9. hdist (spF(1-s) <= distF s p for p in J): paper-proved (I3 path bound, ID1, audited); Lean: hypothesis. Natives: covered by the same computed census as 8. +10. **hJ (1936 <= |J^arr|)**: HYPOTHESIS, and for the general Desc56 class a CONJECTURE (AUD2 FIX B: rigidity is numerical, span-form L1-L3 and shared carriers open). Natives: computed fact: |J^arr| = 4962 (aud2b.py exact mod 2^61-1; hc11.py; 2536 forced cells on route flags). +11. hspMono, hcstMono (spF, cst nondecreasing in t on [tC0, 1/10]): paper-proved (HC3: psi = x^s ln x convex, superadditive, so c2 nondecreasing in t); Lean: NOT proved (spF is a min over a 230+dual shape DAG, not defined in Lean); kept as named hypotheses. +12. hspTab, hcstTab (spFlo_j <= spF(tC_j); cst(t_{j+1}) <= cH_j): computed fact, outward-rounded (hc9.py / hc9.log "ALL TABLE ENTRIES CERTIFIED", relative slack ~1e-9); Lean: hypotheses over certified rationals, arithmetic proved (CongestionNativeTab). +13. hunitTab (unitLo_j <= 9^s - 8^s at s = 1 - t_{j+1}): computed fact (hc9.py unit_lo, Decimal 80 digits, outward); Lean: hypothesis (rpow numerics not kernel-checked). +Proved inside Lean (not hypotheses): sigma certificates sigC0..3, F_base point enclosures ptC0..2, tail cfC_neg/cfC88_neg, own56_floor, two-sided I3 (`E_lower_cap_om`), branches, table derivation. + +## Not covered / open +- Class extension (Desc56 in general, >= 9-row and network decoders, non-Desc56 words): open; Rank8C56 rigidity [Q] enters only through hJ. +- Hypotheses 8, 9, 11 are the formalisation gaps (statements about the register machine and the shape DAG); 10 is a conjecture beyond the natives; 12-13 are certified numerics outside the kernel. diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJ.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJ.lean new file mode 100644 index 0000000000..67279ebd4c --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJ.lean @@ -0,0 +1,213 @@ +import Nov15.CongestionNative +import Nov15.CongestionNativeJSig0 +import Nov15.CongestionNativeJSig1 +import Nov15.CongestionNativeJSig2 +import Nov15.CongestionNativeJPt0 +import Nov15.CongestionNativeJPt1 +import Nov15.CongestionNativeJPt2 +import Nov15.CongestionNativeJD +import Nov15.CongestionNativeJUnit + +/-! +CONGESTION-NATIVE-J: `ceiling_native` with the junk count hypothesis raised to `hJ : 4962 ≤ |J|` +(the COMPUTED |J^arr| of the natives st1 / #7637 / x1t2a / #7660-e1). Conclusion: F(1 - t, invoice (caller 6 7) n 17) < 0 for t in [tJ0, 1], +tJ0 = .0118103, i.e. kappa <= .0118103 (own56, m <= 5) for every word satisfying the hypotheses. +* [tC0, 1]: `ceiling_native` itself (its hypotheses are restrictions of the ones here; its unit table is now kernel-proved, `unit_of_Fup`). +* [tJ0, tC0]: three new pieces (CongestionNativeJ{Defs,Sig*,Pt*,D,Unit}): kernel sigma certificates, kernel F_base point enclosures, + kernel derivative bound of F_base on [.93, 1 - tJ0], kernel unit lower bounds, norm_num table arithmetic with N = 4962. +Hypotheses that are still data (same status as in ceiling_native): hcong*, hdist (now on s in [.9, 1 - tJ0]), hJ (now 4962), hspMono/hcstMono +(now on [tJ0, 1/10]), hspTab/hcstTab (+ the three new spF / cst endpoint brackets). hunitTab is GONE (kernel). +The junk count `hJ`, `hcong` and `hdist` all refer to the same `J`; Lean does not tie `J` to any word. -/ +namespace CongestionNative +open NumCertK JointCeiling CallerCost CongestionI3 CongestionI3Dual Finset + +/-- kernel unit lower bound: `lo <= 9^(1-t) - 8^(1-t)` from a `Fup` enclosure of `8^s - 9^s`. -/ +theorem unit_of_Fup (t lo : ℚ) (h0 : 0 ≤ 1 - t) (h1 : 1 - t ≤ 1) (h : Fup unitCF (1 - t) (1 - t) < -lo) : + (lo : ℝ) ≤ (9 : ℝ) ^ (1 - (t : ℝ)) - (8 : ℝ) ^ (1 - (t : ℝ)) := by + have hF := Fc_le unitCF unitCF_ok (1 - t) (1 - t) h0 h1 (((1 - t : ℚ)) : ℝ) (le_refl _) (le_refl _) + have h2 : ((Fup unitCF (1 - t) (1 - t) : ℚ) : ℝ) < ((-lo : ℚ) : ℝ) := by exact_mod_cast h + have hc : (((1 - t : ℚ)) : ℝ) = 1 - (t : ℝ) := by push_cast; ring + rw [hc] at hF + have e : Fc unitCF (1 - (t : ℝ)) = (8 : ℝ) ^ (1 - (t : ℝ)) - (9 : ℝ) ^ (1 - (t : ℝ)) := by + simp [Fc, unitCF]; ring + rw [e] at hF + push_cast at h2 + linarith + +/-- two-sided I3 with a general junk count `Nn` in place of 1936. -/ +theorem E_lower_cap_omN {ι : Type*} [DecidableEq ι] (R : Finset ι) (n : ι → ℕ) (d : ι → ℕ → ℕ) (J : Finset (ℕ × ℕ)) (dist : ℕ × ℕ → ℝ) + (E s cap corr ell σ Om : ℝ) (m Nn : ℕ) + (hmono : ∀ r ∈ R, ∀ i < n r, d r i ≤ d r (i + 1)) (hd9 : ∀ r ∈ R, d r (n r) ≤ 9) + (hm : (R.filter fun r => Mixed d n r).card ≤ m) (hσ0 : 0 ≤ σ) + (hσ : ∀ a b : ℕ, 1 ≤ a → a ≤ b → b ≤ 8 → c2 (gs s) (a : ℝ) (b : ℝ) ≤ σ) + (hcong : ∑ p ∈ J, min (dist p) cap - corr ≤ ∑ r ∈ R, ∑ i ∈ range (n r), c2 (gs s) (lev d r i) (lev d r (i + 1)) + Om) + (hEex : ∑ r ∈ R, ex (gs s) (lev d r) (n r) ≤ E) (hdist : ∀ p ∈ J, ell ≤ min (dist p) cap) (hJ : Nn ≤ J.card) (hell : 0 ≤ ell) : + (Nn : ℝ) * ell - corr - m * σ ≤ E + Om := by + have h1 := sum_all_c2_le (gs s) (gs_zero s) R n d hmono hd9 m hm σ hσ0 hσ + have h2 := Finset.card_nsmul_le_sum J (fun p => min (dist p) cap) ell hdist + rw [nsmul_eq_mul] at h2 + have hj : (Nn : ℝ) ≤ J.card := by exact_mod_cast hJ + have h3 : (Nn : ℝ) * ell ≤ (J.card : ℝ) * ell := mul_le_mul_of_nonneg_right hj hell + linarith + +/-- one t-piece `[a, b]` with N = 4962 (copy of `tab_piece`, domain [tJ0, 1/10]). -/ +theorem tab_pieceJ (spF cstF : ℝ → ℝ) (a b : ℚ) (lcp cH spLo unLo : ℚ) (hlcp : 0 ≤ lcp) (hcH : 0 ≤ cH) (ha0 : tJ0 ≤ a) (hab : a ≤ b) (hb : b ≤ 1 / 10) + (hmS : MonotoneOn spF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) (hmC : MonotoneOn cstF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hsp : (spLo : ℝ) ≤ spF (a : ℝ)) (hcs : cstF (b : ℝ) ≤ cH) + (hun : (unLo : ℝ) ≤ (9 : ℝ) ^ (1 - (b : ℝ)) - (8 : ℝ) ^ (1 - (b : ℝ))) + (hn1 : lcp + 8 * cH ≤ 4962 * spLo) (hn2 : lcp + 8 * cH ≤ 4962 * (unLo / 48)) : + ∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → (lcp : ℝ) ≤ 4962 * ellC spF s - corrC cstF s ∧ 0 ≤ ellC spF s := by + intro s h1 h2 + push_cast at h1 h2 + have ha' : ((tJ0 : ℚ) : ℝ) ≤ a := by exact_mod_cast ha0 + have hab' : (a : ℝ) ≤ b := by exact_mod_cast hab + have hb' : (b : ℝ) ≤ 1 / 10 := by + have := (Rat.cast_le (K := ℝ)).mpr hb + push_cast at this; exact this + have htl : (a : ℝ) ≤ 1 - s := by linarith + have htu : 1 - s ≤ (b : ℝ) := by linarith + have hspt : spF a ≤ spF (1 - s) := hmS ⟨ha', by linarith⟩ ⟨by linarith, by linarith⟩ htl + have hcst : cstF (1 - s) ≤ cstF b := hmC ⟨by linarith, by linarith⟩ ⟨by linarith, hb'⟩ htu + have hcap : (unLo : ℝ) / 48 ≤ capC s := by + have := unit_mono (1 - b) s (by linarith) h1 + unfold capC; linarith + have hell : min (spLo : ℝ) ((unLo : ℝ) / 48) ≤ ellC spF s := by + unfold ellC + exact le_min (le_trans (min_le_left _ _) (by linarith)) (le_trans (min_le_right _ _) hcap) + have hcorr : corrC cstF s ≤ 8 * (cH : ℝ) := by unfold corrC; linarith + have hn1' : (lcp : ℝ) + 8 * cH ≤ 4962 * spLo := by exact_mod_cast hn1 + have hn2' : (lcp : ℝ) + 8 * cH ≤ 4962 * ((unLo : ℝ) / 48) := by exact_mod_cast hn2 + have hl0 : (0 : ℝ) ≤ lcp := by exact_mod_cast hlcp + have hc0 : (0 : ℝ) ≤ cH := by exact_mod_cast hcH + rcases le_total (spLo : ℝ) ((unLo : ℝ) / 48) with hh | hh + · rw [min_eq_left hh] at hell; exact ⟨by linarith, by linarith⟩ + · rw [min_eq_right hh] at hell; exact ⟨by linarith, by linarith⟩ + +theorem cfC_monoOnJ (s s' : ℝ) (h1 : (93 / 100 : ℝ) ≤ s) (hss : s ≤ s') (h2 : s' ≤ ((1 - tJ0 : ℚ) : ℝ)) : Fc cfC s ≤ Fc cfC s' := + Fc_monoOn cfC cfC_ok (93 / 100) (1 - tJ0) (by norm_num) (by unfold tJ0; norm_num) cfC_dJ s s' + (by rw [show (((93 / 100 : ℚ)) : ℝ) = 93 / 100 by norm_num]; exact h1) hss h2 + +theorem hFbJ_of (a b L : ℚ) (hb93 : 93 / 100 ≤ 1 - b) (hab : a ≤ b) (haJ : tJ0 ≤ a) + (hpt : Fup cfC (1 - a) (1 - a) < 17 * L) : + ∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → Fc cfC s < 17 * (L : ℝ) := by + intro s h1 h2 + have hb : (((93 / 100 : ℚ)) : ℝ) ≤ s := le_trans (by exact_mod_cast hb93) h1 + have hb' : (93 / 100 : ℝ) ≤ s := by rwa [show (((93 / 100 : ℚ)) : ℝ) = 93 / 100 by norm_num] at hb + have haA : (1 - a : ℚ) ≤ 1 - tJ0 := by linarith + have hm := cfC_monoOnJ s ((1 - a : ℚ) : ℝ) hb' h2 (by exact_mod_cast haA) + have hJ0 : (0 : ℚ) ≤ tJ0 := by unfold tJ0; norm_num + exact lt_of_le_of_lt hm (pt_of_Fup cfC cfC_ok (1 - a) L (by linarith) (by linarith) hpt) + +/-- **native-covering ceiling at the computed junk count.** Same statement as `ceiling_native` with `hJ : 4962 ≤ |J|`; hcong*/hdist on +s in [.9, 1 - tJ0]; monotonicity on [tJ0, 1/10]; three more endpoint brackets of spF / cst. Conclusion on t in [tJ0, 1]: kappa <= .0118103. -/ +theorem ceiling_native_J {ι : Type*} [DecidableEq ι] + (R : Finset ι) (nR : ι → ℕ) (dR : ι → ℕ → ℕ) + (hmono : ∀ r ∈ R, ∀ i < nR r, dR r i ≤ dR r (i + 1)) (hd9 : ∀ r ∈ R, dR r (nR r) ≤ 9) + (hmix : (R.filter fun r => Mixed dR nR r).card ≤ 5) + (n : Inv) (ks : List ℕ) (mr st : ℕ) (E : ℝ → ℝ) (J : Finset (ℕ × ℕ)) (distF : ℝ → ℕ × ℕ → ℝ) (spF cstF : ℝ → ℝ) + (hk : ∀ k ∈ ks, 1 ≤ k ∧ k ≤ 9) (hmass : 56 ≤ ks.sum) (hmd : 8 ≤ ks.length) (hmr : 8 ≤ mr) + (hF : ∀ s, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - dprice ks s - mr - E s) + (hY : 104 ≤ st + (ks.length + mr)) + (hst : ∀ s, 0 ≤ s → s ≤ 1 → (2 - (2 : ℝ) ^ s) * st ≤ E s) + (hEex : ∀ s, 0 ≤ s → s ≤ 1 → ∑ r ∈ R, ex (gs s) (lev dR r) (nR r) ≤ E s) + (hcong : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tJ0 : ℚ) : ℝ) → + ∑ p ∈ J, min (distF s p) (capC s) - corrC cstF s ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hdist : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tJ0 : ℚ) : ℝ) → ∀ p ∈ J, spF (1 - s) ≤ distF s p) + (hJ : 4962 ≤ J.card) + (hspMono : MonotoneOn spF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hcstMono : MonotoneOn cstF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hspTab : ((spFloC0 : ℚ) : ℝ) ≤ spF ((tC0 : ℚ) : ℝ) ∧ ((spFloC1 : ℚ) : ℝ) ≤ spF ((tC1 : ℚ) : ℝ) ∧ + ((spFloC2 : ℚ) : ℝ) ≤ spF ((tC2 : ℚ) : ℝ) ∧ ((spFloC3 : ℚ) : ℝ) ≤ spF ((tC3 : ℚ) : ℝ)) + (hcstTab : cstF ((tC1 : ℚ) : ℝ) ≤ ((cHC0 : ℚ) : ℝ) ∧ cstF ((tC2 : ℚ) : ℝ) ≤ ((cHC1 : ℚ) : ℝ) ∧ + cstF ((tC3 : ℚ) : ℝ) ≤ ((cHC2 : ℚ) : ℝ) ∧ cstF (1 / 10) ≤ ((cHC3 : ℚ) : ℝ)) + (hspTabJ : ((spFloJ0 : ℚ) : ℝ) ≤ spF ((tJ0 : ℚ) : ℝ) ∧ ((spFloJ1 : ℚ) : ℝ) ≤ spF ((tJ1 : ℚ) : ℝ) ∧ + ((spFloJ2 : ℚ) : ℝ) ≤ spF ((tJ2 : ℚ) : ℝ)) + (hcstTabJ : cstF ((tJ1 : ℚ) : ℝ) ≤ ((cHJ0 : ℚ) : ℝ) ∧ cstF ((tJ2 : ℚ) : ℝ) ≤ ((cHJ1 : ℚ) : ℝ) ∧ + cstF ((tC0 : ℚ) : ℝ) ≤ ((cHJ2 : ℚ) : ℝ)) : + ∀ t : ℝ, ((tJ0 : ℚ) : ℝ) ≤ t → t ≤ 1 → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 := by + have qJC : tJ0 ≤ tC0 := by unfold tJ0 tC0; norm_num + have eJC : ((tJ0 : ℚ) : ℝ) ≤ ((tC0 : ℚ) : ℝ) := by exact_mod_cast qJC + intro t ht ht1 + rcases le_or_gt ((tC0 : ℚ) : ℝ) t with hC | hC + · -- [tC0, 1]: the shipped `ceiling_native` + have u0 := unit_of_Fup tC1 unitLoC0 (by unfold tC1; norm_num) (by unfold tC1; norm_num) unitC0' + have u1 := unit_of_Fup tC2 unitLoC1 (by unfold tC2; norm_num) (by unfold tC2; norm_num) unitC1' + have u2 := unit_of_Fup tC3 unitLoC2 (by unfold tC3; norm_num) (by unfold tC3; norm_num) unitC2' + have u3 := unit_of_Fup (1 / 10) unitLoC3 (by norm_num) (by norm_num) unitC3' + have h110 : (((1 / 10 : ℚ)) : ℝ) = 1 / 10 := by norm_num + rw [h110] at u3 + exact ceiling_native R nR dR hmono hd9 hmix n ks mr st E J distF spF cstF hk hmass hmd hmr hF hY hst hEex + (fun s h1 h2 => hcong s h1 (by linarith)) (fun s h1 h2 => hdist s h1 (by linarith)) (le_trans (by norm_num) hJ) + (hspMono.mono (Set.Icc_subset_Icc eJC (le_refl _))) (hcstMono.mono (Set.Icc_subset_Icc eJC (le_refl _))) + hspTab hcstTab ⟨u0, u1, u2, u3⟩ t hC ht1 + · -- [tJ0, tC0]: three new pieces with N = 4962 + have piece : ∀ (a b lcp σ : ℚ), sigOK (1 - b) (1 - a) σ = true → 0 ≤ σ → tJ0 ≤ a → a ≤ b → b ≤ tC0 → 0 ≤ lcp → + (∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → (lcp : ℝ) ≤ 4962 * ellC spF s - corrC cstF s ∧ 0 ≤ ellC spF s) → + (∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → Fc cfC s < 17 * (((lcp - 5 * σ : ℚ)) : ℝ)) → + ∀ t : ℝ, (a : ℝ) ≤ t → t ≤ (b : ℝ) → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 := by + intro a b lcp σ hσc hσ0 ha0 hab hb hl0 hLcp hFb t h1 h2 + have ha0q : (0 : ℚ) ≤ a := le_trans (by unfold tJ0; norm_num) ha0 + have ha0' : ((tJ0 : ℚ) : ℝ) ≤ a := by exact_mod_cast ha0 + have hbC : (b : ℝ) ≤ ((tC0 : ℚ) : ℝ) := by exact_mod_cast hb + have hC1 : ((tC0 : ℚ) : ℝ) ≤ 1 / 10 := by + have : tC0 ≤ 1 / 10 := by unfold tC0; norm_num + have := (Rat.cast_le (K := ℝ)).mpr this + push_cast at this; exact this + have hb' : (b : ℝ) ≤ 1 / 10 := le_trans hbC hC1 + have hA0 : (0 : ℝ) ≤ a := by exact_mod_cast ha0q + have hs0 : 0 ≤ 1 - t := by linarith + have hs1 : 1 - t ≤ 1 := by linarith + have hbq : b ≤ 1 / 10 := le_trans hb (by unfold tC0; norm_num) + have hσ : ∀ a' b' : ℕ, 1 ≤ a' → a' ≤ b' → b' ≤ 8 → c2 (gs (1 - t)) (a' : ℝ) (b' : ℝ) ≤ (σ : ℝ) := by + intro a' b' h1' h2' h3' + exact sig_of_ok (1 - b) (1 - a) σ hσc (by linarith) (by linarith) hσ0 (1 - t) + (by push_cast; linarith) (by push_cast; linarith) a' b' h1' h2' h3' + have hLcp' := hLcp (1 - t) (by push_cast; linarith) (by push_cast; linarith) + have hslo : (9 / 10 : ℝ) ≤ 1 - t := by linarith + have hshi : 1 - t ≤ 1 - ((tJ0 : ℚ) : ℝ) := by linarith + have hell : 0 ≤ ellC spF (1 - t) := hLcp'.2 + have hE := E_lower_cap_omN R nR dR J (distF (1 - t)) (E (1 - t)) (1 - t) (capC (1 - t)) (corrC cstF (1 - t)) (ellC spF (1 - t)) + (σ : ℝ) (Omega ks mr (1 - t)) 5 4962 hmono hd9 hmix (by exact_mod_cast hσ0) hσ (hcong (1 - t) hslo hshi) (hEex _ hs0 hs1) + (fun p hp => le_min (le_trans (min_le_left _ _) (hdist (1 - t) hslo hshi p hp)) (min_le_right _ _)) hJ hell + have hE' : (((lcp - 5 * σ : ℚ)) : ℝ) ≤ E (1 - t) + Omega ks mr (1 - t) := by + push_cast; push_cast at hE; linarith [hLcp'.1] + exact branchC_om n ks mr (E (1 - t)) _ (1 - t) (hF _ hs0 hs1) hE' + (hFb (1 - t) (by push_cast; linarith) (by push_cast; linarith)) + obtain ⟨sp0, sp1, sp2⟩ := hspTabJ + obtain ⟨cs0, cs1, cs2⟩ := hcstTabJ + have q01 : tJ0 ≤ tJ1 := by unfold tJ0 tJ1; norm_num + have q12 : tJ1 ≤ tJ2 := by unfold tJ1 tJ2; norm_num + have q2C : tJ2 ≤ tC0 := by unfold tJ2 tC0; norm_num + have qC : tC0 ≤ 1 / 10 := by unfold tC0; norm_num + have un0 := unit_of_Fup tJ1 unitLoJ0 (by unfold tJ1; norm_num) (by unfold tJ1; norm_num) unitJ0 + have un1 := unit_of_Fup tJ2 unitLoJ1 (by unfold tJ2; norm_num) (by unfold tJ2; norm_num) unitJ1 + have un2 := unit_of_Fup tC0 unitLoJ2 (by unfold tC0; norm_num) (by unfold tC0; norm_num) unitJ2 + have l0 : (0 : ℚ) ≤ lcpJ0 := by unfold lcpJ0; norm_num + have l1 : (0 : ℚ) ≤ lcpJ1 := by unfold lcpJ1; norm_num + have l2 : (0 : ℚ) ≤ lcpJ2 := by unfold lcpJ2; norm_num + have c0 : (0 : ℚ) ≤ cHJ0 := by unfold cHJ0; norm_num + have c1 : (0 : ℚ) ≤ cHJ1 := by unfold cHJ1; norm_num + have c2' : (0 : ℚ) ≤ cHJ2 := by unfold cHJ2; norm_num + have e1 : ((tJ1 : ℚ) : ℝ) ≤ ((tJ2 : ℚ) : ℝ) := by exact_mod_cast q12 + by_cases k1 : t ≤ ((tJ1 : ℚ) : ℝ) + · exact piece tJ0 tJ1 lcpJ0 sgJ0 sigJ0 (by unfold sgJ0; norm_num) (le_refl _) q01 (le_trans q12 q2C) l0 + (tab_pieceJ spF cstF tJ0 tJ1 lcpJ0 cHJ0 spFloJ0 unitLoJ0 l0 c0 (le_refl _) q01 (le_trans (le_trans q12 q2C) qC) + hspMono hcstMono sp0 cs0 un0 tabJ0.1 tabJ0.2) + (hFbJ_of tJ0 tJ1 LJ0 (by unfold tJ1; norm_num) q01 (le_refl _) ptJ0) t ht k1 + by_cases k2 : t ≤ ((tJ2 : ℚ) : ℝ) + · exact piece tJ1 tJ2 lcpJ1 sgJ1 sigJ1 (by unfold sgJ1; norm_num) q01 q12 q2C l1 + (tab_pieceJ spF cstF tJ1 tJ2 lcpJ1 cHJ1 spFloJ1 unitLoJ1 l1 c1 q01 q12 (le_trans q2C qC) + hspMono hcstMono sp1 cs1 un1 tabJ1.1 tabJ1.2) + (hFbJ_of tJ1 tJ2 LJ1 (by unfold tJ2; norm_num) q12 q01 ptJ1) t (by push Not at k1; exact k1.le) k2 + · exact piece tJ2 tC0 lcpJ2 sgJ2 sigJ2 (by unfold sgJ2; norm_num) (le_trans q01 q12) q2C (le_refl _) l2 + (tab_pieceJ spF cstF tJ2 tC0 lcpJ2 cHJ2 spFloJ2 unitLoJ2 l2 c2' (le_trans q01 q12) q2C qC + hspMono hcstMono sp2 cs2 un2 tabJ2.1 tabJ2.2) + (hFbJ_of tJ2 tC0 LJ2 (by unfold tC0; norm_num) q2C (le_trans q01 q12) ptJ2) t (by push Not at k2; exact k2.le) hC.le + +end CongestionNative + +#print axioms CongestionNative.unit_of_Fup +#print axioms CongestionNative.E_lower_cap_omN +#print axioms CongestionNative.tab_pieceJ +#print axioms CongestionNative.ceiling_native_J diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJD.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJD.lean new file mode 100644 index 0000000000..3060b75a60 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJD.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionNativeJDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem cfC_dJ : 0 < dLo cfC (93 / 100) (1 - tJ0) := by unfold tJ0; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJDefs.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJDefs.lean new file mode 100644 index 0000000000..c70a731406 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJDefs.lean @@ -0,0 +1,43 @@ +import Nov15.CongestionI3DualConst +import Nov15.CongestionI3NumC1 +import Nov15.CongestionNativeTab + +/-! CONGESTION-NATIVE-J certificates: the three own56 t-pieces on [tJ0, tC0] for the junk count N = 4962. +Source: internal table generators (Decimal 80 digits, +-1e-70 brackets; spF DAG weights rounded DOWN, cst rounded UP, +unit_lo = 9^s lower - 8^s upper; all rounded outward to 14 / 6 / 7 digits). Kernel-checked here: sigma certificates (`sigOK`), F_base point +enclosures (`Fup`), the derivative bound of F_base on [.93, 1 - tJ0], the rational table arithmetic, and ALL unit lower bounds (old and new). -/ +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual + +def tJ0 : ℚ := 118103 / 10 ^ 7 +def tJ1 : ℚ := 118123 / 10 ^ 7 +def tJ2 : ℚ := 120123 / 10 ^ 7 +def sgJ0 : ℚ := 24309 / 500000 +def sgJ1 : ℚ := 25631 / 500000 +def sgJ2 : ℚ := 57 / 800 +def cHJ0 : ℚ := 291901 / 10 ^ 7 +def cHJ1 : ℚ := 296781 / 10 ^ 7 +def cHJ2 : ℚ := 336819 / 10 ^ 7 +def lcpJ0 : ℚ := 27930489 / 10 ^ 6 +def lcpJ1 : ℚ := 2793131 / 10 ^ 5 +def lcpJ2 : ℚ := 28371641 / 10 ^ 6 +def LJ0 : ℚ := lcpJ0 - 5 * sgJ0 +def LJ1 : ℚ := lcpJ1 - 5 * sgJ1 +def LJ2 : ℚ := lcpJ2 - 5 * sgJ2 +/-- lower bounds of spF(tJ_j) -/ +def spFloJ0 : ℚ := 113518785551 / 20000000000000 +def spFloJ1 : ℚ := 17740285593 / 3125000000000 +def spFloJ2 : ℚ := 577208719357 / 100000000000000 +/-- lower bounds of 9^(1-t_{j+1}) - 8^(1-t_{j+1}) (t_{j+1} = tJ1, tJ2, tC0) -/ +def unitLoJ0 : ℚ := 48176347373057 / 50000000000000 +def unitLoJ1 : ℚ := 96291982180651 / 100000000000000 +def unitLoJ2 : ℚ := 95794193417421 / 100000000000000 + +theorem tabJ0 : lcpJ0 + 8 * cHJ0 ≤ 4962 * spFloJ0 ∧ lcpJ0 + 8 * cHJ0 ≤ 4962 * (unitLoJ0 / 48) := by + unfold lcpJ0 cHJ0 spFloJ0 unitLoJ0; constructor <;> norm_num +theorem tabJ1 : lcpJ1 + 8 * cHJ1 ≤ 4962 * spFloJ1 ∧ lcpJ1 + 8 * cHJ1 ≤ 4962 * (unitLoJ1 / 48) := by + unfold lcpJ1 cHJ1 spFloJ1 unitLoJ1; constructor <;> norm_num +theorem tabJ2 : lcpJ2 + 8 * cHJ2 ≤ 4962 * spFloJ2 ∧ lcpJ2 + 8 * cHJ2 ≤ 4962 * (unitLoJ2 / 48) := by + unfold lcpJ2 cHJ2 spFloJ2 unitLoJ2; constructor <;> norm_num + +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJPt0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJPt0.lean new file mode 100644 index 0000000000..d28bdf6efc --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJPt0.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionNativeJDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem ptJ0 : Fup cfC (1 - tJ0) (1 - tJ0) < 17 * LJ0 := by unfold tJ0 LJ0 lcpJ0 sgJ0; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJPt1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJPt1.lean new file mode 100644 index 0000000000..9bbcfbdafe --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJPt1.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionNativeJDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem ptJ1 : Fup cfC (1 - tJ1) (1 - tJ1) < 17 * LJ1 := by unfold tJ1 LJ1 lcpJ1 sgJ1; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJPt2.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJPt2.lean new file mode 100644 index 0000000000..885ad815aa --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJPt2.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionNativeJDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem ptJ2 : Fup cfC (1 - tJ2) (1 - tJ2) < 17 * LJ2 := by unfold tJ2 LJ2 lcpJ2 sgJ2; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJSig0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJSig0.lean new file mode 100644 index 0000000000..8b0742d04e --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJSig0.lean @@ -0,0 +1,6 @@ +import Nov15.CongestionI3DualSig +import Nov15.CongestionNativeJDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem sigJ0 : sigOK (1 - tJ1) (1 - tJ0) sgJ0 = true := by decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJSig1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJSig1.lean new file mode 100644 index 0000000000..405bf16d0a --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJSig1.lean @@ -0,0 +1,6 @@ +import Nov15.CongestionI3DualSig +import Nov15.CongestionNativeJDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem sigJ1 : sigOK (1 - tJ2) (1 - tJ1) sgJ1 = true := by decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJSig2.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJSig2.lean new file mode 100644 index 0000000000..19afd04daa --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJSig2.lean @@ -0,0 +1,6 @@ +import Nov15.CongestionI3DualSig +import Nov15.CongestionNativeJDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem sigJ2 : sigOK (1 - tC0) (1 - tJ2) sgJ2 = true := by decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJUnit.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJUnit.lean new file mode 100644 index 0000000000..f4ed40d499 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeJUnit.lean @@ -0,0 +1,14 @@ +import Nov15.CongestionNativeJDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +/-- `8^s - 9^s` as an exponential polynomial -/ +def unitCF : CF := [(8, 1), (9, -1)] +theorem unitCF_ok : okR unitCF := by decide +kernel +theorem unitJ0 : Fup unitCF (1 - tJ1) (1 - tJ1) < -unitLoJ0 := by unfold tJ1 unitLoJ0; decide +kernel +theorem unitJ1 : Fup unitCF (1 - tJ2) (1 - tJ2) < -unitLoJ1 := by unfold tJ2 unitLoJ1; decide +kernel +theorem unitJ2 : Fup unitCF (1 - tC0) (1 - tC0) < -unitLoJ2 := by unfold tC0 unitLoJ2; decide +kernel +theorem unitC0' : Fup unitCF (1 - tC1) (1 - tC1) < -unitLoC0 := by unfold tC1 unitLoC0; decide +kernel +theorem unitC1' : Fup unitCF (1 - tC2) (1 - tC2) < -unitLoC1 := by unfold tC2 unitLoC1; decide +kernel +theorem unitC2' : Fup unitCF (1 - tC3) (1 - tC3) < -unitLoC2 := by unfold tC3 unitLoC2; decide +kernel +theorem unitC3' : Fup unitCF (1 - 1 / 10) (1 - 1 / 10) < -unitLoC3 := by unfold unitLoC3; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionNativeTab.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeTab.lean new file mode 100644 index 0000000000..bb00941798 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionNativeTab.lean @@ -0,0 +1,38 @@ +import Mathlib.Data.Rat.Defs +import Mathlib.Tactic.NormNum +import Nov15.CongestionI3DualConst + +/-! CONGESTION-NATIVE certified rational tables. +Source: internal notes (Decimal exp/ln at 80 digits, +-1e-70 brackets; every weight of the spF DAG rounded DOWN, +cst rounded UP, unit_lo = 9^s lower - 8^s upper). The values below were emitted by re-running hc9's `spF_lo` / `unit_lo` and converting the +80-digit Decimals to exact rationals, rounded DOWN to 14 digits (outward). `cHC_j` are hc9's own rounded-UP cst brackets. +Here only the pure arithmetic is proved (kernel, norm_num): lcpC_j + 8 cHC_j <= 1936 * min(spFloC_j, unitLoC_j / 48). +The statements `spFloC_j <= spF(tC_j)`, `cst(t_{j+1}) <= cHC_j`, `unitLoC_j <= 9^s - 8^s` are HYPOTHESES of the ceiling (computed, hc9.log). -/ +namespace CongestionNative +open CongestionI3Dual + +def spFloC0 : ℚ := 131069767447 / 20000000000000 +def spFloC1 : ℚ := 655443767027 / 100000000000000 +def spFloC2 : ℚ := 26407594739 / 4000000000000 +def spFloC3 : ℚ := 141372084217 / 12500000000000 +/-- lower bound of 9^(1-t_{j+1}) - 8^(1-t_{j+1}) (t_1, t_2, t_3, 1/10) -/ +def unitLoC0 : ℚ := 11974198659989 / 12500000000000 +def unitLoC1 : ℚ := 95763386760327 / 100000000000000 +def unitLoC2 : ℚ := 23196470570391 / 25000000000000 +def unitLoC3 : ℚ := 72665488499219 / 100000000000000 +/-- upper brackets of cst(t_{j+1}) -/ +def cHC0 : ℚ := 84217 / 2500000 +def cHC1 : ℚ := 339299 / 10 ^ 7 +def cHC2 : ℚ := 579807 / 10 ^ 7 +def cHC3 : ℚ := 2255027 / 10 ^ 7 + +theorem tabC0 : lcpC0 + 8 * cHC0 ≤ 1936 * spFloC0 ∧ lcpC0 + 8 * cHC0 ≤ 1936 * (unitLoC0 / 48) := by + unfold lcpC0 cHC0 spFloC0 unitLoC0; constructor <;> norm_num +theorem tabC1 : lcpC1 + 8 * cHC1 ≤ 1936 * spFloC1 ∧ lcpC1 + 8 * cHC1 ≤ 1936 * (unitLoC1 / 48) := by + unfold lcpC1 cHC1 spFloC1 unitLoC1; constructor <;> norm_num +theorem tabC2 : lcpC2 + 8 * cHC2 ≤ 1936 * spFloC2 ∧ lcpC2 + 8 * cHC2 ≤ 1936 * (unitLoC2 / 48) := by + unfold lcpC2 cHC2 spFloC2 unitLoC2; constructor <;> norm_num +theorem tabC3 : lcpC3 + 8 * cHC3 ≤ 1936 * spFloC3 ∧ lcpC3 + 8 * cHC3 ≤ 1936 * (unitLoC3 / 48) := by + unfold lcpC3 cHC3 spFloC3 unitLoC3; constructor <;> norm_num + +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTree.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTree.lean new file mode 100644 index 0000000000..a6b5301d29 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTree.lean @@ -0,0 +1,167 @@ +import Nov15.CongestionTreePiece +import Nov15.CTreeDataCG +import Nov15.CTreeDataGA +import Nov15.CTreeDataGB +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeCertCGWt +import Nov15.CongestionTreeCertCGD +import Nov15.CongestionTreeCertCGS0 +import Nov15.CongestionTreeCertCGT0 +import Nov15.CongestionTreeCertCGU0 +import Nov15.CongestionTreeCertCGL0 +import Nov15.CongestionTreeCertCGS1 +import Nov15.CongestionTreeCertCGT1 +import Nov15.CongestionTreeCertCGU1 +import Nov15.CongestionTreeCertCGL1 +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeCertGDWt +import Nov15.CongestionTreeCertGDD +import Nov15.CongestionTreeCertGDS0 +import Nov15.CongestionTreeCertGDT0 +import Nov15.CongestionTreeCertGDU0 +import Nov15.CongestionTreeCertGDL0 +import Nov15.CongestionTreeCertGDS1 +import Nov15.CongestionTreeCertGDT1 +import Nov15.CongestionTreeCertGDU1 +import Nov15.CongestionTreeCertGDL1 + +/-! +CONGESTION-TREE. Tree-refined ceilings on top of `ceiling_native_J` (kappa <= .0118103). +* `ceiling_tree_CG` : the node-partition tree bound with the class-min over source counts (|J| >= 4962, <= 48 partners, <= 104 sources). +* `ceiling_tree_GD` : the port-realised refinement (48 of the 104 sources restricted to the realised shape edges `E48`). +Both: F(1 - t, invoice (caller 6 7) n 17) < 0 for t in [a0, 1], a0 = .0117694 (CG), .0116750 (GD). Lean text: see CongestionTree.md for every hypothesis. +-/ +namespace CongestionNative +open NumCertK JointCeiling CallerCost CongestionI3 CongestionI3Dual Finset + +theorem hFbT_of (a0 a b L : ℚ) (hd : 0 < dLo cfC (93 / 100) (1 - a0)) (ha00 : 0 ≤ a0) (hb93 : 93 / 100 ≤ 1 - b) (hab : a ≤ b) + (haJ : a0 ≤ a) (hpt : Fup cfC (1 - a) (1 - a) < 17 * L) : + ∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → Fc cfC s < 17 * (L : ℝ) := by + intro s h1 h2 + have hb : (((93 / 100 : ℚ)) : ℝ) ≤ s := le_trans (by exact_mod_cast hb93) h1 + have haA : (1 - a : ℚ) ≤ 1 - a0 := by linarith + have hA : ((1 - a : ℚ) : ℝ) ≤ ((1 - a0 : ℚ) : ℝ) := by exact_mod_cast haA + have hm := Fc_monoOn cfC cfC_ok (93 / 100) (1 - a0) (by norm_num) (by linarith) hd s ((1 - a : ℚ) : ℝ) hb h2 hA + exact lt_of_le_of_lt hm (pt_of_Fup cfC cfC_ok (1 - a) L (by linarith) (by linarith) hpt) + +theorem ceiling_tree_CG + {ι : Type*} [DecidableEq ι] + (R : Finset ι) (nR : ι → ℕ) (dR : ι → ℕ → ℕ) + (hmono : ∀ r ∈ R, ∀ i < nR r, dR r i ≤ dR r (i + 1)) (hd9 : ∀ r ∈ R, dR r (nR r) ≤ 9) + (hmix : (R.filter fun r => Mixed dR nR r).card ≤ 5) + (n : Inv) (ks : List ℕ) (mr st : ℕ) (E : ℝ → ℝ) (J : Finset (ℕ × ℕ)) (distF : ℝ → ℕ × ℕ → ℝ) (spF cstF : ℝ → ℝ) + (hk : ∀ k ∈ ks, 1 ≤ k ∧ k ≤ 9) (hmass : 56 ≤ ks.sum) (hmd : 8 ≤ ks.length) (hmr : 8 ≤ mr) + (hF : ∀ s, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - dprice ks s - mr - E s) + (hY : 104 ≤ st + (ks.length + mr)) + (hst : ∀ s, 0 ≤ s → s ≤ 1 → (2 - (2 : ℝ) ^ s) * st ≤ E s) + (hEex : ∀ s, 0 ≤ s → s ≤ 1 → ∑ r ∈ R, ex (gs s) (lev dR r) (nR r) ≤ E s) + (hcong : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tJ0 : ℚ) : ℝ) → + ∑ p ∈ J, min (distF s p) (capC s) - corrC cstF s ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hdist : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tJ0 : ℚ) : ℝ) → ∀ p ∈ J, spF (1 - s) ≤ distF s p) + (hJ : 4962 ≤ J.card) + (hspMono : MonotoneOn spF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hcstMono : MonotoneOn cstF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hspTab : ((spFloC0 : ℚ) : ℝ) ≤ spF ((tC0 : ℚ) : ℝ) ∧ ((spFloC1 : ℚ) : ℝ) ≤ spF ((tC1 : ℚ) : ℝ) ∧ + ((spFloC2 : ℚ) : ℝ) ≤ spF ((tC2 : ℚ) : ℝ) ∧ ((spFloC3 : ℚ) : ℝ) ≤ spF ((tC3 : ℚ) : ℝ)) + (hcstTab : cstF ((tC1 : ℚ) : ℝ) ≤ ((cHC0 : ℚ) : ℝ) ∧ cstF ((tC2 : ℚ) : ℝ) ≤ ((cHC1 : ℚ) : ℝ) ∧ + cstF ((tC3 : ℚ) : ℝ) ≤ ((cHC2 : ℚ) : ℝ) ∧ cstF (1 / 10) ≤ ((cHC3 : ℚ) : ℝ)) + (hspTabJ : ((spFloJ0 : ℚ) : ℝ) ≤ spF ((tJ0 : ℚ) : ℝ) ∧ ((spFloJ1 : ℚ) : ℝ) ≤ spF ((tJ1 : ℚ) : ℝ) ∧ + ((spFloJ2 : ℚ) : ℝ) ≤ spF ((tJ2 : ℚ) : ℝ)) + (hcstTabJ : cstF ((tJ1 : ℚ) : ℝ) ≤ ((cHJ0 : ℚ) : ℝ) ∧ cstF ((tJ2 : ℚ) : ℝ) ≤ ((cHJ1 : ℚ) : ℝ) ∧ + cstF ((tC0 : ℚ) : ℝ) ≤ ((cHJ2 : ℚ) : ℝ)) + {σ ρ μ : Type} [DecidableEq σ] [DecidableEq ρ] [DecidableEq μ] + (T : CTree.TreeData σ ρ μ CTree.cgR CTree.cgR CTree.cgr0 CTree.cgr0 0) + (hcstMonoT : MonotoneOn cstF (Set.Icc ((a0CG : ℚ) : ℝ) (1 / 10))) + (hcst0 : cstF ((tCG1 : ℚ) : ℝ) ≤ ((cHCG0 : ℚ) : ℝ)) + (hcst1 : cstF ((tCG2 : ℚ) : ℝ) ≤ ((cHCG1 : ℚ) : ℝ)) + (hP1 : ∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0CG : ℚ) : ℝ) → + ∑ e ∈ T.Mreg, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) + capC s * ∑ x ∈ T.S, (T.x x : ℝ) ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hP2 : ∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0CG : ℚ) : ℝ) → + ∑ e ∈ T.Mun, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) ≤ corrC cstF s) : + ∀ t : ℝ, ((a0CG : ℚ) : ℝ) ≤ t → t ≤ 1 → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 := by + have eJ : tTJ0 = tJ0 := rfl + have hwin := wtCG + rw [eJ] at hwin + have hdd := cfC_dCG + intro t ht ht1 + rcases le_or_gt ((tJ0 : ℚ) : ℝ) t with hC | hC + · exact ceiling_native_J R nR dR hmono hd9 hmix n ks mr st E J distF spF cstF hk hmass hmd hmr hF hY hst hEex hcong hdist hJ hspMono hcstMono hspTab hcstTab hspTabJ hcstTabJ t hC ht1 + have p0 := CTree.tree_piece R nR dR hmono hd9 hmix n ks mr E cstF hF hEex CTree.cgW CTree.cgR CTree.cgR CTree.cgr0 CTree.cgr0 0 T + CTree.cg_all CTree.cg_all (by decide) (by decide) a0CG tCG0 tCG1 lcpCG0 sgCG0 cHCG0 unLoCG0 capICG0 lamCG0 gACG0 gBCG0 + hwin (by unfold tCG0 a0CG; norm_num) (by unfold tCG0 tCG1; norm_num) (by unfold tCG1 tJ0; norm_num) (by unfold a0CG; norm_num) sigCG0 (by unfold sgCG0; norm_num) lineCG0 numCG0 capCG0 + (unit_of_Fup tCG1 unLoCG0 (by unfold tCG1; norm_num) (by unfold tCG1; norm_num) (by have := unCG0; exact this)) hcst0 hcstMonoT hP1 hP2 + (hFbT_of a0CG tCG0 tCG1 _ hdd (by unfold a0CG; norm_num) (by unfold tCG1; norm_num) (by unfold tCG0 tCG1; norm_num) (by unfold tCG0 a0CG; norm_num) ptCG0) + have p1 := CTree.tree_piece R nR dR hmono hd9 hmix n ks mr E cstF hF hEex CTree.cgW CTree.cgR CTree.cgR CTree.cgr0 CTree.cgr0 0 T + CTree.cg_all CTree.cg_all (by decide) (by decide) a0CG tCG1 tCG2 lcpCG1 sgCG1 cHCG1 unLoCG1 capICG1 lamCG1 gACG1 gBCG1 + hwin (by unfold tCG1 a0CG; norm_num) (by unfold tCG1 tCG2; norm_num) (tCGend.trans eJ).le (by unfold a0CG; norm_num) sigCG1 (by unfold sgCG1; norm_num) lineCG1 numCG1 capCG1 + (unit_of_Fup tCG2 unLoCG1 (by unfold tCG2; norm_num) (by unfold tCG2; norm_num) (by have := unCG1; exact this)) hcst1 hcstMonoT hP1 hP2 + (hFbT_of a0CG tCG1 tCG2 _ hdd (by unfold a0CG; norm_num) (by unfold tCG2; norm_num) (by unfold tCG1 tCG2; norm_num) (by unfold tCG1 a0CG; norm_num) ptCG1) + rcases le_or_gt t ((tCG1 : ℚ) : ℝ) with h1 | h1 + · exact p0 t (by rw [tCGstart]; exact ht) h1 + · exact p1 t h1.le (by rw [show tCG2 = tJ0 from tCGend.trans eJ]; exact hC.le) + +theorem ceiling_tree_GD + {ι : Type*} [DecidableEq ι] + (R : Finset ι) (nR : ι → ℕ) (dR : ι → ℕ → ℕ) + (hmono : ∀ r ∈ R, ∀ i < nR r, dR r i ≤ dR r (i + 1)) (hd9 : ∀ r ∈ R, dR r (nR r) ≤ 9) + (hmix : (R.filter fun r => Mixed dR nR r).card ≤ 5) + (n : Inv) (ks : List ℕ) (mr st : ℕ) (E : ℝ → ℝ) (J : Finset (ℕ × ℕ)) (distF : ℝ → ℕ × ℕ → ℝ) (spF cstF : ℝ → ℝ) + (hk : ∀ k ∈ ks, 1 ≤ k ∧ k ≤ 9) (hmass : 56 ≤ ks.sum) (hmd : 8 ≤ ks.length) (hmr : 8 ≤ mr) + (hF : ∀ s, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - dprice ks s - mr - E s) + (hY : 104 ≤ st + (ks.length + mr)) + (hst : ∀ s, 0 ≤ s → s ≤ 1 → (2 - (2 : ℝ) ^ s) * st ≤ E s) + (hEex : ∀ s, 0 ≤ s → s ≤ 1 → ∑ r ∈ R, ex (gs s) (lev dR r) (nR r) ≤ E s) + (hcong : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tJ0 : ℚ) : ℝ) → + ∑ p ∈ J, min (distF s p) (capC s) - corrC cstF s ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hdist : ∀ s, 9 / 10 ≤ s → s ≤ 1 - ((tJ0 : ℚ) : ℝ) → ∀ p ∈ J, spF (1 - s) ≤ distF s p) + (hJ : 4962 ≤ J.card) + (hspMono : MonotoneOn spF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hcstMono : MonotoneOn cstF (Set.Icc ((tJ0 : ℚ) : ℝ) (1 / 10))) + (hspTab : ((spFloC0 : ℚ) : ℝ) ≤ spF ((tC0 : ℚ) : ℝ) ∧ ((spFloC1 : ℚ) : ℝ) ≤ spF ((tC1 : ℚ) : ℝ) ∧ + ((spFloC2 : ℚ) : ℝ) ≤ spF ((tC2 : ℚ) : ℝ) ∧ ((spFloC3 : ℚ) : ℝ) ≤ spF ((tC3 : ℚ) : ℝ)) + (hcstTab : cstF ((tC1 : ℚ) : ℝ) ≤ ((cHC0 : ℚ) : ℝ) ∧ cstF ((tC2 : ℚ) : ℝ) ≤ ((cHC1 : ℚ) : ℝ) ∧ + cstF ((tC3 : ℚ) : ℝ) ≤ ((cHC2 : ℚ) : ℝ) ∧ cstF (1 / 10) ≤ ((cHC3 : ℚ) : ℝ)) + (hspTabJ : ((spFloJ0 : ℚ) : ℝ) ≤ spF ((tJ0 : ℚ) : ℝ) ∧ ((spFloJ1 : ℚ) : ℝ) ≤ spF ((tJ1 : ℚ) : ℝ) ∧ + ((spFloJ2 : ℚ) : ℝ) ≤ spF ((tJ2 : ℚ) : ℝ)) + (hcstTabJ : cstF ((tJ1 : ℚ) : ℝ) ≤ ((cHJ0 : ℚ) : ℝ) ∧ cstF ((tJ2 : ℚ) : ℝ) ≤ ((cHJ1 : ℚ) : ℝ) ∧ + cstF ((tC0 : ℚ) : ℝ) ≤ ((cHJ2 : ℚ) : ℝ)) + {σ ρ μ : Type} [DecidableEq σ] [DecidableEq ρ] [DecidableEq μ] + (T : CTree.TreeData σ ρ μ CTree.gaR CTree.gbR CTree.gar0 CTree.gbr0 48) + (hcstMonoT : MonotoneOn cstF (Set.Icc ((a0GD : ℚ) : ℝ) (1 / 10))) + (hcst0 : cstF ((tGD1 : ℚ) : ℝ) ≤ ((cHGD0 : ℚ) : ℝ)) + (hcst1 : cstF ((tGD2 : ℚ) : ℝ) ≤ ((cHGD1 : ℚ) : ℝ)) + (hP1 : ∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0GD : ℚ) : ℝ) → + ∑ e ∈ T.Mreg, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) + capC s * ∑ x ∈ T.S, (T.x x : ℝ) ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hP2 : ∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0GD : ℚ) : ℝ) → + ∑ e ∈ T.Mun, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) ≤ corrC cstF s) : + ∀ t : ℝ, ((a0GD : ℚ) : ℝ) ≤ t → t ≤ 1 → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 := by + have eJ : tTJ0GD = tJ0 := rfl + have hwin := wtGD + rw [eJ] at hwin + have hdd := cfC_dGD + intro t ht ht1 + rcases le_or_gt ((tJ0 : ℚ) : ℝ) t with hC | hC + · exact ceiling_native_J R nR dR hmono hd9 hmix n ks mr st E J distF spF cstF hk hmass hmd hmr hF hY hst hEex hcong hdist hJ hspMono hcstMono hspTab hcstTab hspTabJ hcstTabJ t hC ht1 + have p0 := CTree.tree_piece R nR dR hmono hd9 hmix n ks mr E cstF hF hEex CTree.gaW CTree.gaR CTree.gbR CTree.gar0 CTree.gbr0 48 T + CTree.ga_all (by have h := CTree.gb_all; rwa [show CTree.gbW = CTree.gaW from rfl] at h) (by decide) (by decide) a0GD tGD0 tGD1 lcpGD0 sgGD0 cHGD0 unLoGD0 capIGD0 lamGD0 gAGD0 gBGD0 + hwin (by unfold tGD0 a0GD; norm_num) (by unfold tGD0 tGD1; norm_num) (by unfold tGD1 tJ0; norm_num) (by unfold a0GD; norm_num) sigGD0 (by unfold sgGD0; norm_num) lineGD0 numGD0 capGD0 + (unit_of_Fup tGD1 unLoGD0 (by unfold tGD1; norm_num) (by unfold tGD1; norm_num) (by have := unGD0; exact this)) hcst0 hcstMonoT hP1 hP2 + (hFbT_of a0GD tGD0 tGD1 _ hdd (by unfold a0GD; norm_num) (by unfold tGD1; norm_num) (by unfold tGD0 tGD1; norm_num) (by unfold tGD0 a0GD; norm_num) ptGD0) + have p1 := CTree.tree_piece R nR dR hmono hd9 hmix n ks mr E cstF hF hEex CTree.gaW CTree.gaR CTree.gbR CTree.gar0 CTree.gbr0 48 T + CTree.ga_all (by have h := CTree.gb_all; rwa [show CTree.gbW = CTree.gaW from rfl] at h) (by decide) (by decide) a0GD tGD1 tGD2 lcpGD1 sgGD1 cHGD1 unLoGD1 capIGD1 lamGD1 gAGD1 gBGD1 + hwin (by unfold tGD1 a0GD; norm_num) (by unfold tGD1 tGD2; norm_num) (tGDend.trans eJ).le (by unfold a0GD; norm_num) sigGD1 (by unfold sgGD1; norm_num) lineGD1 numGD1 capGD1 + (unit_of_Fup tGD2 unLoGD1 (by unfold tGD2; norm_num) (by unfold tGD2; norm_num) (by have := unGD1; exact this)) hcst1 hcstMonoT hP1 hP2 + (hFbT_of a0GD tGD1 tGD2 _ hdd (by unfold a0GD; norm_num) (by unfold tGD2; norm_num) (by unfold tGD1 tGD2; norm_num) (by unfold tGD1 a0GD; norm_num) ptGD1) + rcases le_or_gt t ((tGD1 : ℚ) : ℝ) with h1 | h1 + · exact p0 t (by rw [tGDstart]; exact ht) h1 + · exact p1 t h1.le (by rw [show tGD2 = tJ0 from tGDend.trans eJ]; exact hC.le) + +end CongestionNative + +#print axioms CongestionNative.hFbT_of +#print axioms CongestionNative.ceiling_tree_CG +#print axioms CongestionNative.ceiling_tree_GD diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTree.md b/research/p104-tree-ceiling/lean/Nov15/CongestionTree.md new file mode 100644 index 0000000000..5fb59acbd7 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTree.md @@ -0,0 +1,38 @@ +# CongestionTree: node-partition tree bound + port-realised refinement, kernel-certified + +Files (all `Nov15/`, kernel only, no sorry / native_decide, axioms propext, Classical.choice, Quot.sound; each file built alone under runlean.sh, peak <= 3.2 GB): +`CTreeCore` (core-only: `Row`, `Row.check` = the DP-row conditions), `CTree{cg,ga,gb}Defs/P*/Data{CG,GA,GB}` (the certified DP tables, 230 rows each, one `decide +kernel` per row), +`CongestionTreeCore` (row soundness, `Tr`, `tree_cost_ge`, `reduction`, `tree_lower`), `CongestionTreeW` (weight certificate `W_lower`), `CongestionTreePiece` (`tree_regs_lower`, `tree_piece`), +`CongestionTreeCert{CG,GD}*` (Defs, Wt0-13/Wt, D, S/T/U/L per piece), `CongestionTree` (final). The generators of the data files are not part of this package. + +## Certified results (true values, not the earlier digits) +| theorem | covers t in | kappa <= | earlier (measured-profile) figure | why different | +|---|---|---|---|---| +| `ceiling_native_J` (old) | [.0118103, 1] | .0118103 | | | +| `ceiling_tree_CG` | [.0117694, 1] | **.0117694** | .0117604 | The earlier computation used the frontier count profile (79x48, 21x47, ...); Lean takes only the stated counts (|J| >= 4962, <= 48 partners, <= 104 sources): Lagrange line, tree lift 28.5096 = 1.0165 x 4962 spF; float class crossing .0117696, certified at .0117694 (margin 6.2e-3). .0117693 fails (margin -5.0e-3). | +| `ceiling_tree_GD` | [.0116750, 1] | **.0116750** | .0116675 | same reason (class-min x1.0525 at t=.0118; the DP weights here are frozen at a0 = .011675 and bounded below by a kernel monotonicity cert); .0116749 fails (margin -8.1e-3). | +Both, for t in [t0, 1]: F(1 - t, invoice (caller 6 7) n 17) < 0, on [tJ0, 1] by `ceiling_native_J` (its own hypotheses are kept), on [a0, tJ0] by two `tree_piece`s. Only the tree piece uses the new premises. + +## What is kernel-checked +* `Row.check W rs r` (per row, 230 rows x 3 tables): G(x,0)=0, G(x,.) monotone, `Ge(x,j) <= floor(W[dim x][dim y]/n x) + G(y,j)` for every allowed child y with j <= m(y), `G(x,k) <= Ge(x,j) + G(x,k-j)` (all 1<=j<=k<=m(x)); leaves have G = 0. `rowOK_of_check`, `step` (child families), `tree_cost_ge`: G(r,|R|)/SC <= cost of ANY `Tr` tree (induction on `Tr`, nested list recursion). +* `reduction`: double counting `sum_s tree_s <= sum_e w_e` from "a move is used by <= nm e sources" + Nodup of each tree's move list. +* `tree_lower`: per source `lam k_s - gamma_c <= SC (tree_s + cap x_s)` from `lineOK` (49x49 integer check per class and piece), summed with |J| >= 4962, |S| <= 104, |B| >= nB. DP data is NOT shrunk: full 230-shape DP tables checked by `decide`; no float, no rounding gap (weights floor(1e14 c2) from `W_lower`). +* `W_lower`/`wtOK`: for every s in [1 - tJ0, 1 - a0], W a b / 1e14 <= c2(gs s) a b: point enclosure at s = 1 - a0 (`Fup (negCF cf)`) plus `dLo (negCF cf) > 0` on the window (h9, k0 nonincreasing in s, so no monotonicity hypothesis). 28 pairs x 2. +* per piece: sigma (`sigOK`), `Fup cfC` point, unit lower bound (`Fup` of 8^s-9^s), `lineOK`, table arithmetic (norm_num), `cfC` derivative cert on [.93, 1 - a0] (so F_base monotonicity is proved, `hFbT_of`). + +## Hypotheses of `ceiling_tree_CG` / `_GD` (status) +Old ones (as `ceiling_native_J`; unchanged status): hmono, hd9, hmix, hk, hmass, hmd, hmr, hF, hY, hst, hEex = natives computed facts (register/lifetime structure, exact identities); hcong*, hdist, hJ (used only for t in [tJ0, 1]) = open (I2 / register machine), hspMono/hcstMono (paper theorem: c2 nondecreasing in t), hspTab/hcstTab/hspTabJ/hcstTabJ (outward-Decimal brackets, data). +New ones (all in `TreeData` + 4 binders): +1. `T.J, T.S`: junk cells (source, reader) with sources <= 104 (`hScard`), each source <= 48 partners (`hfib`), |J| >= 4962 (`hJcard`; natives: |J^arr| = 4962 computed) -- natives. +2. `T.R, T.x, hcell, hxk`: a source's cells are either transported (x_s, each pays `capC`) or have a reader in R_s -- open (I2 path + own56 transport cap, as in hcong). +3. `T.htreeA/htreeB (Tr ...)`: for each source the union of its cells' I2 paths contains an out-tree of charts: nodes are shapes (rows) of the 230-shape DAG (`hr`, `hside`: shape in list, `Row.ok` = dim up, n up, m down), child edge = a nested move e with nm e = n(A), dA, dB its dimensions; readers of a node are covered by the readers of its children (`hcov`, subset, NOT disjoint) and |R| <= m(chart) (`hm`) -- open (nested moves, path = chain of moves meeting at charts; the node-partition argument). Disjointness of reader sets is not needed for the lower bound and is dropped. +4. `T.hMv, hnd, hcap`: tree moves Nodup, every move used by <= nm e = n(A) sources (I2 capacity) -- open. +5. `T.Mreg, T.Mun, hMsub, hdim` and `hP1`: the tree's moves are register steps up to owned rises; `sum_{Mreg} c2 + capC * sum x <= sum regs c2 + Omega` -- open (same I2 charge as hcong, aggregated by moves; includes the transported cap). `hP2`: owned-rise moves weigh <= corrC = 8 cst -- open (an uncharged edge saves <= c2). +6. `hcstMonoT` (cst monotone on [a0, 1/10]), `hcst0/1` (cst(b) <= cH brackets) -- same status as hcstMono/hcstTab (data). +7. GD only: `Bset` (>= 48 sources) whose trees use only the edges `E48` realised by concrete nested charts (`rsB` = rows with `mask` = E48) -- natives computed fact (per-port union of cell lattices over all 29,212 subspaces; edge sets fall into 3 classes of 24, 32 and 48 ports; the 48 ports of the last class have the edge set E48 = the mask of `gbR`; the other 56 sources are assigned the unrestricted DAG `gaR`, whose edge set contains every port's realised set). The exhaustive count (the (3,4,12) and (5,8,6) charts cover only 1,344 of 4,992 cells) is the reason for E48; it is a concrete enumeration, NOT reproduced in Lean and not script-checked for this package (open: would need the subspace lattice of F_2^8 as data). Source/class counts (104, 48) are computed facts. +8. `T.dA, dB, nm` positivity / dims: derived inside (`hdim`, row facts). + +## Paper checks +* No false step found: tree DP (independent Python and C programs) = `Row.check` DP (same recursion; Python/C/Lean agree on F(48) = .2755792 at t=.0117604, restricted class B .2975394). +* Corrections to the earlier (measured-profile) statements: (i) ceilings .0117604 / .0116675 use measured count profiles / max(out,in) and are not statements of the Lean form; the Lean certificates are .0117694 / .0116750 (9.0e-6 and 7.5e-6 weaker). (ii) reader-set disjointness is not needed. (iii) OUT and IN give the identical DP table (F equal at every k), so `max(out,in)` only differs through the count profile; only OUT is formalised. +* `hdist`-style per-cell claim is replaced, not weakened: nothing here uses spF; weights enter only through `W_lower`. diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGD.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGD.lean new file mode 100644 index 0000000000..1a1d2a7ebb --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGD.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionTreeCertCGDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem cfC_dCG : 0 < dLo cfC (93 / 100) (1 - a0CG) := by unfold a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGDefs.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGDefs.lean new file mode 100644 index 0000000000..2b08437e00 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGDefs.lean @@ -0,0 +1,28 @@ +import Nov15.NumCertK +import Nov15.CongestionI3NumC1 +namespace CongestionNative +open NumCertK CongestionI3 +def tTJ0 : ℚ := 118103 / 10 ^ 7 +def a0CG : ℚ := (58847 : ℚ) / 5000000 +def tCG0 : ℚ := (58847 : ℚ) / 5000000 +def tCG1 : ℚ := (7359 : ℚ) / 625000 +def sgCG0 : ℚ := (48493 : ℚ) / 1000000 +def cHCG0 : ℚ := (9093 : ℚ) / 312500 +def lcpCG0 : ℚ := (28276807 : ℚ) / 1000000 +def unLoCG0 : ℚ := (96364203646413 : ℚ) / 100000000000000 +def capICG0 : ℕ := 2007587575966 +def lamCG0 : ℕ := 574558412032 +def gACG0 : ℕ := 36 +def gBCG0 : ℕ := 36 +def tCG2 : ℚ := (118103 : ℚ) / 10000000 +def sgCG1 : ℚ := (12231 : ℚ) / 250000 +def cHCG1 : ℚ := (72963 : ℚ) / 2500000 +def lcpCG1 : ℚ := (14138053 : ℚ) / 500000 +def unLoCG1 : ℚ := (12044162755641 : ℚ) / 12500000000000 +def capICG1 : ℕ := 2007360459273 +def lamCG1 : ℕ := 574558412032 +def gACG1 : ℕ := 36 +def gBCG1 : ℕ := 36 +theorem tCGend : tCG2 = tTJ0 := by unfold tCG2 tTJ0; norm_num +theorem tCGstart : tCG0 = a0CG := by unfold tCG0 a0CG; norm_num +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGL0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGL0.lean new file mode 100644 index 0000000000..2d11fad3a5 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGL0.lean @@ -0,0 +1,10 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeCore +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem lineCG0 : CTree.lineOK CTree.cgr0 CTree.cgr0 capICG0 lamCG0 gACG0 gBCG0 = true := by unfold capICG0 lamCG0 gACG0 gBCG0; decide +kernel +theorem numCG0 : lcpCG0 + 8 * cHCG0 ≤ (((lamCG0 : ℚ) * 4962 - ((gACG0 : ℚ) * 104 - ((gACG0 : ℚ) - gBCG0) * 0)) / 10 ^ 14) := by + unfold lcpCG0 cHCG0 lamCG0 gACG0 gBCG0; norm_num +theorem capCG0 : (capICG0 : ℚ) ≤ unLoCG0 * 10 ^ 14 / 48 := by unfold capICG0 unLoCG0; norm_num +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGL1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGL1.lean new file mode 100644 index 0000000000..5cffe6d167 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGL1.lean @@ -0,0 +1,10 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeCore +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem lineCG1 : CTree.lineOK CTree.cgr0 CTree.cgr0 capICG1 lamCG1 gACG1 gBCG1 = true := by unfold capICG1 lamCG1 gACG1 gBCG1; decide +kernel +theorem numCG1 : lcpCG1 + 8 * cHCG1 ≤ (((lamCG1 : ℚ) * 4962 - ((gACG1 : ℚ) * 104 - ((gACG1 : ℚ) - gBCG1) * 0)) / 10 ^ 14) := by + unfold lcpCG1 cHCG1 lamCG1 gACG1 gBCG1; norm_num +theorem capCG1 : (capICG1 : ℚ) ≤ unLoCG1 * 10 ^ 14 / 48 := by unfold capICG1 unLoCG1; norm_num +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGS0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGS0.lean new file mode 100644 index 0000000000..60fea1f44d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGS0.lean @@ -0,0 +1,6 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionI3DualSig +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem sigCG0 : sigOK (1 - tCG1) (1 - tCG0) sgCG0 = true := by unfold tCG0 tCG1 sgCG0; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGS1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGS1.lean new file mode 100644 index 0000000000..ee05c58fb1 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGS1.lean @@ -0,0 +1,6 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionI3DualSig +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem sigCG1 : sigOK (1 - tCG2) (1 - tCG1) sgCG1 = true := by unfold tCG1 tCG2 sgCG1; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGT0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGT0.lean new file mode 100644 index 0000000000..fde650ff82 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGT0.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionTreeCertCGDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem ptCG0 : Fup cfC (1 - tCG0) (1 - tCG0) < 17 * (lcpCG0 - 5 * sgCG0) := by unfold tCG0 lcpCG0 sgCG0; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGT1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGT1.lean new file mode 100644 index 0000000000..3bc41e3f01 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGT1.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionTreeCertCGDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem ptCG1 : Fup cfC (1 - tCG1) (1 - tCG1) < 17 * (lcpCG1 - 5 * sgCG1) := by unfold tCG1 lcpCG1 sgCG1; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGU0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGU0.lean new file mode 100644 index 0000000000..cac161d048 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGU0.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionTreeCertCGDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem unCG0 : Fup [(8, 1), (9, -1)] (1 - tCG1) (1 - tCG1) < -unLoCG0 := by unfold tCG1 unLoCG0; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGU1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGU1.lean new file mode 100644 index 0000000000..e8adf3f794 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGU1.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionTreeCertCGDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem unCG1 : Fup [(8, 1), (9, -1)] (1 - tCG2) (1 - tCG2) < -unLoCG1 := by unfold tCG2 unLoCG1; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt.lean new file mode 100644 index 0000000000..7a34b9bfcb --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt.lean @@ -0,0 +1,52 @@ +import Nov15.CongestionTreeCertCGWt0 +import Nov15.CongestionTreeCertCGWt1 +import Nov15.CongestionTreeCertCGWt2 +import Nov15.CongestionTreeCertCGWt3 +import Nov15.CongestionTreeCertCGWt4 +import Nov15.CongestionTreeCertCGWt5 +import Nov15.CongestionTreeCertCGWt6 +import Nov15.CongestionTreeCertCGWt7 +import Nov15.CongestionTreeCertCGWt8 +import Nov15.CongestionTreeCertCGWt9 +import Nov15.CongestionTreeCertCGWt10 +import Nov15.CongestionTreeCertCGWt11 +import Nov15.CongestionTreeCertCGWt12 +import Nov15.CongestionTreeCertCGWt13 +import Nov15.CongestionTreeW +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG : CTree.wtOK CTree.cgW (1 - tTJ0) (1 - a0CG) = true := by + unfold CTree.wtOK + rw [List.all_eq_true] + intro p hp + simp only [pairs, List.mem_cons, List.not_mem_nil, or_false] at hp + rcases hp with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl + · exact wtCG_1_2 + · exact wtCG_1_3 + · exact wtCG_1_4 + · exact wtCG_1_5 + · exact wtCG_1_6 + · exact wtCG_1_7 + · exact wtCG_1_8 + · exact wtCG_2_3 + · exact wtCG_2_4 + · exact wtCG_2_5 + · exact wtCG_2_6 + · exact wtCG_2_7 + · exact wtCG_2_8 + · exact wtCG_3_4 + · exact wtCG_3_5 + · exact wtCG_3_6 + · exact wtCG_3_7 + · exact wtCG_3_8 + · exact wtCG_4_5 + · exact wtCG_4_6 + · exact wtCG_4_7 + · exact wtCG_4_8 + · exact wtCG_5_6 + · exact wtCG_5_7 + · exact wtCG_5_8 + · exact wtCG_6_7 + · exact wtCG_6_8 + · exact wtCG_7_8 +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt0.lean new file mode 100644 index 0000000000..1f0d3249f9 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt0.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_1_2 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (1, 2) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_1_3 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (1, 3) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt1.lean new file mode 100644 index 0000000000..c86ddc54eb --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt1.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_1_4 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (1, 4) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_1_5 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (1, 5) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt10.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt10.lean new file mode 100644 index 0000000000..781ff4d16e --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt10.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_4_7 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (4, 7) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_4_8 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (4, 8) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt11.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt11.lean new file mode 100644 index 0000000000..eea38054b0 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt11.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_5_6 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (5, 6) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_5_7 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (5, 7) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt12.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt12.lean new file mode 100644 index 0000000000..fd00b9b4e9 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt12.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_5_8 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (5, 8) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_6_7 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (6, 7) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt13.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt13.lean new file mode 100644 index 0000000000..5527acc5e4 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt13.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_6_8 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (6, 8) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_7_8 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (7, 8) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt2.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt2.lean new file mode 100644 index 0000000000..9121e6a04c --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt2.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_1_6 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (1, 6) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_1_7 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (1, 7) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt3.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt3.lean new file mode 100644 index 0000000000..dae210bcd3 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt3.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_1_8 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (1, 8) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_2_3 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (2, 3) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt4.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt4.lean new file mode 100644 index 0000000000..6db7512361 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt4.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_2_4 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (2, 4) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_2_5 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (2, 5) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt5.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt5.lean new file mode 100644 index 0000000000..a513f78f0b --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt5.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_2_6 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (2, 6) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_2_7 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (2, 7) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt6.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt6.lean new file mode 100644 index 0000000000..6d77423ca3 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt6.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_2_8 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (2, 8) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_3_4 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (3, 4) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt7.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt7.lean new file mode 100644 index 0000000000..8fd9fcc401 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt7.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_3_5 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (3, 5) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_3_6 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (3, 6) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt8.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt8.lean new file mode 100644 index 0000000000..96b65ebeda --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt8.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_3_7 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (3, 7) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_3_8 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (3, 8) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt9.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt9.lean new file mode 100644 index 0000000000..4a73c459f2 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertCGWt9.lean @@ -0,0 +1,8 @@ +import Nov15.CongestionTreeCertCGDefs +import Nov15.CongestionTreeW +import Nov15.CTreecgDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtCG_4_5 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (4, 5) = true := by unfold tTJ0 a0CG; decide +kernel +theorem wtCG_4_6 : CTree.wtPair CTree.cgW (1 - tTJ0) (1 - a0CG) (4, 6) = true := by unfold tTJ0 a0CG; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDD.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDD.lean new file mode 100644 index 0000000000..b649d9ef79 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDD.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionTreeCertGDDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem cfC_dGD : 0 < dLo cfC (93 / 100) (1 - a0GD) := by unfold a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDDefs.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDDefs.lean new file mode 100644 index 0000000000..71a160f4e2 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDDefs.lean @@ -0,0 +1,28 @@ +import Nov15.NumCertK +import Nov15.CongestionI3NumC1 +namespace CongestionNative +open NumCertK CongestionI3 +def tTJ0GD : ℚ := 118103 / 10 ^ 7 +def a0GD : ℚ := (467 : ℚ) / 40000 +def tGD0 : ℚ := (467 : ℚ) / 40000 +def tGD1 : ℚ := (73 : ℚ) / 6250 +def sgGD0 : ℚ := (48111 : ℚ) / 1000000 +def cHGD0 : ℚ := (9021 : ℚ) / 312500 +def lcpGD0 : ℚ := (29075199 : ℚ) / 1000000 +def unLoGD0 : ℚ := (19278574995077 : ℚ) / 20000000000000 +def capIGD0 : ℕ := 2008184895320 +def lamGD0 : ℕ := 648426768687 +def gAGD0 : ℕ := 3764747108290 +def gBGD0 : ℕ := 1584459010234 +def tGD2 : ℚ := (118103 : ℚ) / 10000000 +def sgGD1 : ℚ := (249 : ℚ) / 5000 +def cHGD1 : ℚ := (72963 : ℚ) / 2500000 +def lcpGD1 : ℚ := (5814531 : ℚ) / 200000 +def unLoGD1 : ℚ := (12044162755641 : ℚ) / 12500000000000 +def capIGD1 : ℕ := 2007360459273 +def lamGD1 : ℕ := 648426768687 +def gAGD1 : ℕ := 3764747108290 +def gBGD1 : ℕ := 1584459010234 +theorem tGDend : tGD2 = tTJ0GD := by unfold tGD2 tTJ0GD; norm_num +theorem tGDstart : tGD0 = a0GD := by unfold tGD0 a0GD; norm_num +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDL0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDL0.lean new file mode 100644 index 0000000000..2b806802b4 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDL0.lean @@ -0,0 +1,11 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeCore +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem lineGD0 : CTree.lineOK CTree.gar0 CTree.gbr0 capIGD0 lamGD0 gAGD0 gBGD0 = true := by unfold capIGD0 lamGD0 gAGD0 gBGD0; decide +kernel +theorem numGD0 : lcpGD0 + 8 * cHGD0 ≤ (((lamGD0 : ℚ) * 4962 - ((gAGD0 : ℚ) * 104 - ((gAGD0 : ℚ) - gBGD0) * 48)) / 10 ^ 14) := by + unfold lcpGD0 cHGD0 lamGD0 gAGD0 gBGD0; norm_num +theorem capGD0 : (capIGD0 : ℚ) ≤ unLoGD0 * 10 ^ 14 / 48 := by unfold capIGD0 unLoGD0; norm_num +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDL1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDL1.lean new file mode 100644 index 0000000000..ebecefe553 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDL1.lean @@ -0,0 +1,11 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeCore +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem lineGD1 : CTree.lineOK CTree.gar0 CTree.gbr0 capIGD1 lamGD1 gAGD1 gBGD1 = true := by unfold capIGD1 lamGD1 gAGD1 gBGD1; decide +kernel +theorem numGD1 : lcpGD1 + 8 * cHGD1 ≤ (((lamGD1 : ℚ) * 4962 - ((gAGD1 : ℚ) * 104 - ((gAGD1 : ℚ) - gBGD1) * 48)) / 10 ^ 14) := by + unfold lcpGD1 cHGD1 lamGD1 gAGD1 gBGD1; norm_num +theorem capGD1 : (capIGD1 : ℚ) ≤ unLoGD1 * 10 ^ 14 / 48 := by unfold capIGD1 unLoGD1; norm_num +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDS0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDS0.lean new file mode 100644 index 0000000000..8830ac3c89 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDS0.lean @@ -0,0 +1,6 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionI3DualSig +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem sigGD0 : sigOK (1 - tGD1) (1 - tGD0) sgGD0 = true := by unfold tGD0 tGD1 sgGD0; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDS1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDS1.lean new file mode 100644 index 0000000000..4fa9feef6b --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDS1.lean @@ -0,0 +1,6 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionI3DualSig +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem sigGD1 : sigOK (1 - tGD2) (1 - tGD1) sgGD1 = true := by unfold tGD1 tGD2 sgGD1; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDT0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDT0.lean new file mode 100644 index 0000000000..ef7cfa6842 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDT0.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionTreeCertGDDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem ptGD0 : Fup cfC (1 - tGD0) (1 - tGD0) < 17 * (lcpGD0 - 5 * sgGD0) := by unfold tGD0 lcpGD0 sgGD0; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDT1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDT1.lean new file mode 100644 index 0000000000..354d043f91 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDT1.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionTreeCertGDDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem ptGD1 : Fup cfC (1 - tGD1) (1 - tGD1) < 17 * (lcpGD1 - 5 * sgGD1) := by unfold tGD1 lcpGD1 sgGD1; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDU0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDU0.lean new file mode 100644 index 0000000000..11241c1961 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDU0.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionTreeCertGDDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem unGD0 : Fup [(8, 1), (9, -1)] (1 - tGD1) (1 - tGD1) < -unLoGD0 := by unfold tGD1 unLoGD0; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDU1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDU1.lean new file mode 100644 index 0000000000..c1aa4400b8 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDU1.lean @@ -0,0 +1,5 @@ +import Nov15.CongestionTreeCertGDDefs +namespace CongestionNative +open NumCertK CongestionI3 +theorem unGD1 : Fup [(8, 1), (9, -1)] (1 - tGD2) (1 - tGD2) < -unLoGD1 := by unfold tGD2 unLoGD1; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt.lean new file mode 100644 index 0000000000..7a96d4333c --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt.lean @@ -0,0 +1,52 @@ +import Nov15.CongestionTreeCertGDWt0 +import Nov15.CongestionTreeCertGDWt1 +import Nov15.CongestionTreeCertGDWt2 +import Nov15.CongestionTreeCertGDWt3 +import Nov15.CongestionTreeCertGDWt4 +import Nov15.CongestionTreeCertGDWt5 +import Nov15.CongestionTreeCertGDWt6 +import Nov15.CongestionTreeCertGDWt7 +import Nov15.CongestionTreeCertGDWt8 +import Nov15.CongestionTreeCertGDWt9 +import Nov15.CongestionTreeCertGDWt10 +import Nov15.CongestionTreeCertGDWt11 +import Nov15.CongestionTreeCertGDWt12 +import Nov15.CongestionTreeCertGDWt13 +import Nov15.CongestionTreeW +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD : CTree.wtOK CTree.gaW (1 - tTJ0GD) (1 - a0GD) = true := by + unfold CTree.wtOK + rw [List.all_eq_true] + intro p hp + simp only [pairs, List.mem_cons, List.not_mem_nil, or_false] at hp + rcases hp with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl + · exact wtGD_1_2 + · exact wtGD_1_3 + · exact wtGD_1_4 + · exact wtGD_1_5 + · exact wtGD_1_6 + · exact wtGD_1_7 + · exact wtGD_1_8 + · exact wtGD_2_3 + · exact wtGD_2_4 + · exact wtGD_2_5 + · exact wtGD_2_6 + · exact wtGD_2_7 + · exact wtGD_2_8 + · exact wtGD_3_4 + · exact wtGD_3_5 + · exact wtGD_3_6 + · exact wtGD_3_7 + · exact wtGD_3_8 + · exact wtGD_4_5 + · exact wtGD_4_6 + · exact wtGD_4_7 + · exact wtGD_4_8 + · exact wtGD_5_6 + · exact wtGD_5_7 + · exact wtGD_5_8 + · exact wtGD_6_7 + · exact wtGD_6_8 + · exact wtGD_7_8 +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt0.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt0.lean new file mode 100644 index 0000000000..459bedf343 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt0.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_1_2 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (1, 2) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_1_3 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (1, 3) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt1.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt1.lean new file mode 100644 index 0000000000..7332c9123b --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt1.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_1_4 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (1, 4) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_1_5 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (1, 5) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt10.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt10.lean new file mode 100644 index 0000000000..bea35d3baf --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt10.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_4_7 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (4, 7) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_4_8 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (4, 8) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt11.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt11.lean new file mode 100644 index 0000000000..76d365b5f5 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt11.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_5_6 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (5, 6) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_5_7 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (5, 7) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt12.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt12.lean new file mode 100644 index 0000000000..786c102ba0 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt12.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_5_8 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (5, 8) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_6_7 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (6, 7) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt13.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt13.lean new file mode 100644 index 0000000000..245ea8d9b4 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt13.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_6_8 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (6, 8) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_7_8 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (7, 8) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt2.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt2.lean new file mode 100644 index 0000000000..4f13ad7ca6 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt2.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_1_6 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (1, 6) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_1_7 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (1, 7) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt3.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt3.lean new file mode 100644 index 0000000000..27a2fca9be --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt3.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_1_8 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (1, 8) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_2_3 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (2, 3) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt4.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt4.lean new file mode 100644 index 0000000000..d6c11764d8 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt4.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_2_4 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (2, 4) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_2_5 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (2, 5) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt5.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt5.lean new file mode 100644 index 0000000000..f93e1dfb6f --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt5.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_2_6 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (2, 6) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_2_7 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (2, 7) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt6.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt6.lean new file mode 100644 index 0000000000..f9353fd75e --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt6.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_2_8 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (2, 8) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_3_4 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (3, 4) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt7.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt7.lean new file mode 100644 index 0000000000..9a06460720 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt7.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_3_5 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (3, 5) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_3_6 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (3, 6) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt8.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt8.lean new file mode 100644 index 0000000000..a18b08c508 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt8.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_3_7 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (3, 7) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_3_8 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (3, 8) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt9.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt9.lean new file mode 100644 index 0000000000..812f083a58 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCertGDWt9.lean @@ -0,0 +1,9 @@ +import Nov15.CongestionTreeCertGDDefs +import Nov15.CongestionTreeW +import Nov15.CTreegaDefs +import Nov15.CTreegbDefs +namespace CongestionNative +open NumCertK CongestionI3 CongestionI3Dual +theorem wtGD_4_5 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (4, 5) = true := by unfold tTJ0GD a0GD; decide +kernel +theorem wtGD_4_6 : CTree.wtPair CTree.gaW (1 - tTJ0GD) (1 - a0GD) (4, 6) = true := by unfold tTJ0GD a0GD; decide +kernel +end CongestionNative diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCore.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCore.lean new file mode 100644 index 0000000000..ac07cdcdd0 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeCore.lean @@ -0,0 +1,421 @@ +import Nov15.NumCertK +import Nov15.CTreeCore + +/-! +CONGESTION-TREE-CORE. Abstract part of the node-partition (whole-meeting) tree bound and its port-realised refinement: +* soundness of the kernel-checked DP rows (`Row.check`, file `CTreeCore`) as lower bounds `G(x,k)` for the cost of out-trees; +* the inductive predicate `Tr` (an out-tree of charts: shapes in a given shape list, children = nested moves, readers covered); +* `tree_cost_ge` : a `Tr` tree delivering `R` readers from shape `r` costs at least `G(r, |R|) / SC` (each edge charged `w e / nm e`); +* `reduction` : double counting (every move carries at most `nm e` sources) `sum_s tree_s <= sum_e w e`; +* `tree_lower` : the Lagrange/line bound over the 104 sources with `sum |J_s| >= 4962`, `|J_s| <= 48`, transported cells pay `cap`. +No sorry, no native_decide. +-/ +namespace CTree +open Finset + +def SCn : ℕ := 10 ^ 14 +noncomputable def SCr : ℝ := 10 ^ 14 + +def gv (r : Row) (k : ℕ) : ℕ := r.g.getD k 0 + +theorem rowLe_sound : ∀ (a b : List ℕ) (w : ℕ), rowLe a b w = true → + ∀ j, j < b.length → j < a.length → a.getD j 0 ≤ w + b.getD j 0 := by + intro a + induction a with + | nil => intro b w _ j _ hj; simp at hj + | cons a as ih => + intro b w h j hjb hja + cases b with + | nil => simp at hjb + | cons b bs => + simp only [rowLe, Bool.and_eq_true, decide_eq_true_eq] at h + cases j with + | zero => simpa using h.1 + | succ j => + have := ih bs w h.2 j (by simpa using hjb) (by simpa using hja) + simpa using this + +theorem monoB_adj : ∀ (l : List ℕ), monoB l = true → ∀ i, i + 1 < l.length → l.getD i 0 ≤ l.getD (i + 1) 0 := by + intro l + induction l with + | nil => intro _ i hi; simp at hi + | cons a t ih => + intro h i hi + cases t with + | nil => simp at hi + | cons b t' => + simp only [monoB, Bool.and_eq_true, decide_eq_true_eq] at h + cases i with + | zero => simpa using h.1 + | succ i => simpa using ih h.2 i (by simpa using hi) + +theorem monoB_mono (l : List ℕ) (h : monoB l = true) : ∀ i j, i ≤ j → j < l.length → l.getD i 0 ≤ l.getD j 0 := by + intro i j hij hj + induction j, hij using Nat.le_induction with + | base => exact le_refl _ + | succ j hij ih => exact le_trans (ih (by omega)) (monoB_adj l h j hj) + +theorem getD_zero_of_all (l : List ℕ) (h : ∀ v ∈ l, v = 0) (k : ℕ) : l.getD k 0 = 0 := by + by_cases hk : k < l.length + · rw [List.getD_eq_getElem?_getD, List.getElem?_eq_getElem hk]; exact h _ (List.getElem_mem hk) + · rw [List.getD_eq_getElem?_getD, List.getElem?_eq_none (by omega)]; rfl + +/-- the facts packed in `Row.check` -/ +structure RowOK (W : List (List ℕ)) (rs : List Row) (r : Row) : Prop where + dim1 : 1 ≤ r.dim + dim8 : r.dim ≤ 8 + n1 : 1 ≤ r.n + glen : r.g.length = r.m + 1 + gelen : r.ge.length = r.m + 1 + g0 : r.g.getD 0 0 = 0 + mono : monoB r.g = true + leaf : r.dim = 8 → r.m ≤ 1 ∧ ∀ v ∈ r.g, v = 0 + edge : r.dim ≠ 8 → ∀ r' ∈ rs, r.ok r' = true → rowLe (r.ge.drop 1) (r'.g.drop 1) (ew W r r') = true + c4 : r.dim ≠ 8 → r.c4 = true + +theorem rowOK_of_check (W : List (List ℕ)) (rs : List Row) (r : Row) (h : r.check W rs = true) : RowOK W rs r := by + unfold Row.check at h + simp only [Bool.and_eq_true, decide_eq_true_eq, beq_iff_eq] at h + obtain ⟨⟨⟨⟨⟨⟨⟨h1, h2⟩, h3⟩, h4⟩, h5⟩, h6⟩, h7⟩, h8⟩ := h + refine ⟨h1, h2, h3, h4, h5, h6, h7, ?_, ?_, ?_⟩ + · intro h8' + rw [if_pos h8'] at h8 + simp only [Bool.and_eq_true, decide_eq_true_eq, List.all_eq_true, beq_iff_eq] at h8 + exact ⟨h8.1, h8.2⟩ + · intro hne r' hr' hok + rw [if_neg hne] at h8 + simp only [Bool.and_eq_true, List.all_eq_true] at h8 + have := h8.1 r' hr' + simp only [Bool.or_eq_true, Bool.not_eq_true'] at this + rcases this with h | h + · rw [h] at hok; exact absurd hok (by simp) + · exact h + · intro hne + rw [if_neg hne] at h8 + simp only [Bool.and_eq_true] at h8 + exact h8.2 + +theorem gv_zero {W rs r} (h : RowOK W rs r) : gv r 0 = 0 := h.g0 + +theorem gv_mono {W rs r} (h : RowOK W rs r) {i j : ℕ} (hij : i ≤ j) (hj : j ≤ r.m) : gv r i ≤ gv r j := + monoB_mono r.g h.mono i j hij (by rw [h.glen]; omega) + +theorem edge_sem {W rs r} (hr : RowOK W rs r) (hne : r.dim ≠ 8) {r' : Row} (hr' : r' ∈ rs) (hr'ok : RowOK W rs r') + (hok : r.ok r' = true) {j : ℕ} (hj1 : 1 ≤ j) (hj : j ≤ r'.m) : + r.ge.getD j 0 ≤ ew W r r' + gv r' j := by + have hm : r'.m ≤ r.m := by + simp only [Row.ok, Bool.and_eq_true, decide_eq_true_eq] at hok; exact hok.1.2 + have := rowLe_sound _ _ _ (hr.edge hne r' hr' hok) (j - 1) (by simp [List.length_drop, hr'ok.glen]; omega) + (by simp [List.length_drop, hr.gelen]; omega) + have e1 : (r.ge.drop 1).getD (j - 1) 0 = r.ge.getD j 0 := by + simp [List.getD_eq_getElem?_getD, List.getElem?_drop]; congr 2; omega + have e2 : (r'.g.drop 1).getD (j - 1) 0 = gv r' j := by + simp [gv, List.getD_eq_getElem?_getD, List.getElem?_drop]; congr 2; omega + rw [e1, e2] at this; exact this + +theorem c4_sem {r : Row} (h : r.c4 = true) {k : ℕ} (hk1 : 1 ≤ k) (hk : k ≤ r.m) {j : ℕ} (hj1 : 1 ≤ j) (hjk : j ≤ k) : + gv r k ≤ r.ge.getD j 0 + gv r (k - j) := by + unfold Row.c4 at h + simp only [List.all_eq_true, List.mem_range, decide_eq_true_eq] at h + have := h (k - 1) (by omega) (j - 1) (by omega) + have e1 : k - 1 + 1 = k := by omega + have e2 : j - 1 + 1 = j := by omega + have e3 : k - 1 - (j - 1) = k - j := by omega + rw [e1, e2, e3] at this; exact this + +theorem list_card_foldr (l : List (Finset ρ)) [DecidableEq ρ] : (l.foldr (· ∪ ·) ∅).card ≤ (l.map Finset.card).sum := by + induction l with + | nil => simp + | cons a t ih => + simp only [List.foldr_cons, List.map_cons, List.sum_cons] + exact le_trans (Finset.card_union_le _ _) (by omega) + +/-- the DP step: children `(row, count, cost)` deliver `k` readers at cost at least `G(r,k)` (costs in units of 1/SC). -/ +theorem step {W rs r} (hr : RowOK W rs r) (hne : r.dim ≠ 8) (cs : List (Row × ℕ × ℝ)) + (hcs : ∀ c ∈ cs, c.1 ∈ rs ∧ RowOK W rs c.1 ∧ r.ok c.1 = true ∧ c.2.1 ≤ c.1.m ∧ + (((ew W r c.1 + gv c.1 c.2.1 : ℕ)) : ℝ) ≤ c.2.2) : + ∀ k, k ≤ r.m → k ≤ (cs.map fun c => c.2.1).sum → ((gv r k : ℕ) : ℝ) ≤ (cs.map fun c => c.2.2).sum := by + induction cs with + | nil => + intro k _ hk + simp at hk + subst hk + simp [gv_zero hr] + | cons c cs ih => + intro k hkm hk + simp only [List.map_cons, List.sum_cons] at hk ⊢ + have hc := hcs c (by simp) + have hcs' : ∀ c' ∈ cs, c'.1 ∈ rs ∧ RowOK W rs c'.1 ∧ r.ok c'.1 = true ∧ c'.2.1 ≤ c'.1.m ∧ + (((ew W r c'.1 + gv c'.1 c'.2.1 : ℕ)) : ℝ) ≤ c'.2.2 := fun c' hc' => hcs c' (by simp [hc']) + have ih' := ih hcs' + have hnn : ∀ l : List (Row × ℕ × ℝ), (∀ c' ∈ l, (0 : ℝ) ≤ c'.2.2) → 0 ≤ (l.map fun c => c.2.2).sum := by + intro l hl + induction l with + | nil => simp + | cons a t iht => + simp only [List.map_cons, List.sum_cons] + have h1 := hl a (by simp) + have h2 := iht (fun c' hc' => hl c' (by simp [hc'])) + linarith + have hcost0 : ∀ c' ∈ cs, (0 : ℝ) ≤ c'.2.2 := fun c' hc' => le_trans (Nat.cast_nonneg _) (hcs' c' hc').2.2.2.2 + have hS0 := hnn cs hcost0 + have hc0 : (0 : ℝ) ≤ c.2.2 := le_trans (Nat.cast_nonneg _) hc.2.2.2.2 + by_cases hk0 : k = 0 + · subst hk0; simp [gv_zero hr]; linarith + by_cases hcnt : c.2.1 = 0 + · have := ih' k hkm (by omega) + linarith + · set j := min k c.2.1 with hj + have hj1 : 1 ≤ j := by omega + have hjk : j ≤ k := min_le_left _ _ + have hjc : j ≤ c.2.1 := min_le_right _ _ + have h4 := c4_sem (hr.c4 hne) (by omega) hkm hj1 hjk + have he := edge_sem hr hne hc.1 hc.2.1 hc.2.2.1 hj1 (le_trans hjc hc.2.2.2.1) + have hmo := gv_mono hc.2.1 hjc hc.2.2.2.1 + have ih2 := ih' (k - j) (by omega) (by omega) + have hnat : gv r k ≤ ew W r c.1 + gv c.1 c.2.1 + gv r (k - j) := by omega + have hr' : ((gv r k : ℕ) : ℝ) ≤ ((ew W r c.1 + gv c.1 c.2.1 : ℕ) : ℝ) + ((gv r (k - j) : ℕ) : ℝ) := by + exact_mod_cast hnat + have := hc.2.2.2.2 + linarith + +variable {ρ μ : Type} [DecidableEq ρ] + +/-- out-trees of charts. A node is a chart of shape `r` (a row of the shape list `rs`), delivering readers `R`; +its children are `(row, readers, move, moves-below)`; the edge to a child is the move `e` with source capacity `nm e = n(r)` +and dimensions `dA e = dim r`, `dB e = dim child`. `moves` lists the moves of the tree (edge, then the subtree). -/ +inductive Tr (rs : List Row) (nm dA dB : μ → ℕ) : Row → Finset ρ → List μ → Prop + | node (r : Row) (R : Finset ρ) (ch : List (Row × Finset ρ × μ × List μ)) + (hr : r ∈ rs) + (hsub : ∀ c ∈ ch, Tr rs nm dA dB c.1 c.2.1 c.2.2.2) + (hside : ∀ c ∈ ch, c.1 ∈ rs ∧ r.ok c.1 = true ∧ nm c.2.2.1 = r.n ∧ dA c.2.2.1 = r.dim ∧ + dB c.2.2.1 = c.1.dim ∧ c.2.1.card ≤ c.1.m) + (hm : R.card ≤ r.m) + (hcov : r.dim ≠ 8 → R ⊆ (ch.map fun c => c.2.1).foldr (· ∪ ·) ∅) : + Tr rs nm dA dB r R (ch.flatMap fun c => c.2.2.1 :: c.2.2.2) + +theorem sum_flatMap_eq (ch : List (Row × Finset ρ × μ × List μ)) (f : μ → ℝ) : + (((ch.flatMap fun c => c.2.2.1 :: c.2.2.2).map f).sum) = + (ch.map fun c => f c.2.2.1 + ((c.2.2.2.map f).sum)).sum := by + induction ch with + | nil => simp + | cons c t ih => simp [List.flatMap_cons, List.map_append, List.sum_append, ih]; ring + +/-- **tree DP lower bound**: a tree from shape `r` delivering `R` costs at least `G(r,|R|)/SC`, edge `e` charged `w e / nm e`. -/ +theorem tree_cost_ge (W : List (List ℕ)) (rs : List Row) (hcert : ∀ r ∈ rs, r.check W rs = true) + (nm dA dB : μ → ℕ) (w : μ → ℝ) + (hW : ∀ e, 1 ≤ dA e → dA e < dB e → dB e ≤ 8 → (((W.getD (dA e) []).getD (dB e) 0 : ℕ) : ℝ) ≤ SCr * w e) + {r : Row} {R : Finset ρ} {ms : List μ} (h : Tr rs nm dA dB r R ms) : + ((gv r R.card : ℕ) : ℝ) ≤ SCr * (ms.map fun e => w e / nm e).sum := by + induction h with + | node r R ch hr hsub hside hm hcov ih => + have hro := rowOK_of_check W rs r (hcert r hr) + by_cases h8 : r.dim = 8 + · have hch : ch = [] := by + cases ch with + | nil => rfl + | cons c t => + exfalso + have h1 := hside c (by simp) + have hco := rowOK_of_check W rs c.1 (hcert c.1 h1.1) + have h3 := h1.2.1 + simp only [Row.ok, Bool.and_eq_true, decide_eq_true_eq] at h3 + have := hco.dim8 + omega + subst hch + have hz := getD_zero_of_all r.g (hro.leaf h8).2 R.card + have hz' : gv r R.card = 0 := hz + rw [hz']; simp + · set F : Row × Finset ρ × μ × List μ → ℝ := fun c => w c.2.2.1 / nm c.2.2.1 + (c.2.2.2.map fun e => w e / nm e).sum with hF + set cs : List (Row × ℕ × ℝ) := ch.map fun c => (c.1, c.2.1.card, SCr * F c) with hcs + have key := step hro h8 cs ?_ R.card hm ?_ + · rw [sum_flatMap_eq] + have e1 : (cs.map fun c => c.2.2).sum = SCr * (ch.map F).sum := by + rw [hcs, List.map_map] + have : ((fun c : Row × ℕ × ℝ => c.2.2) ∘ fun c : Row × Finset ρ × μ × List μ => (c.1, c.2.1.card, SCr * F c)) = + fun c => SCr * F c := rfl + rw [this, List.sum_map_mul_left] + rw [e1] at key + exact key + · intro c' hc' + rw [hcs, List.mem_map] at hc' + obtain ⟨c0, hc0, rfl⟩ := hc' + have hs := hside c0 hc0 + have hco := rowOK_of_check W rs c0.1 (hcert c0.1 hs.1) + have hokc := hs.2.1 + have hd : r.dim < c0.1.dim := by + simp only [Row.ok, Bool.and_eq_true, decide_eq_true_eq] at hokc; exact hokc.1.1.1 + have hwe := hW c0.2.2.1 (by rw [hs.2.2.2.1]; exact hro.dim1) (by rw [hs.2.2.2.1, hs.2.2.2.2.1]; exact hd) + (by rw [hs.2.2.2.2.1]; exact hco.dim8) + rw [hs.2.2.2.1, hs.2.2.2.2.1] at hwe + have hn : (0 : ℝ) < r.n := by exact_mod_cast hro.n1 + have hdiv : ((ew W r c0.1 : ℕ) : ℝ) ≤ SCr * (w c0.2.2.1 / nm c0.2.2.1) := by + have h1 : ((ew W r c0.1 : ℕ) : ℝ) ≤ (((W.getD r.dim []).getD c0.1.dim 0 : ℕ) : ℝ) / r.n := Nat.cast_div_le + have h2 : SCr * (w c0.2.2.1 / nm c0.2.2.1) = SCr * w c0.2.2.1 / r.n := by rw [hs.2.2.1]; ring + rw [h2] + exact le_trans h1 (div_le_div_of_nonneg_right hwe hn.le) + have hih := ih c0 hc0 + refine ⟨hs.1, hco, hokc, hs.2.2.2.2.2, ?_⟩ + show (((ew W r c0.1 + gv c0.1 c0.2.1.card : ℕ)) : ℝ) ≤ SCr * F c0 + push_cast + rw [hF]; simp only [] + rw [mul_add] + linarith + · have h1 : R ⊆ _ := hcov h8 + have h2 := le_trans (Finset.card_le_card h1) (list_card_foldr (ch.map fun c => c.2.1)) + have : (cs.map fun c => c.2.1) = ch.map fun c => c.2.1.card := by simp [hcs, List.map_map] + have h3 : (((ch.map fun c => c.2.1)).map Finset.card).sum = (ch.map fun c => c.2.1.card).sum := by + simp [List.map_map, Function.comp_def] + rw [this, ← h3] + exact h2 + + +theorem Tr.card_le {rs : List Row} {nm dA dB : μ → ℕ} {r : Row} {R : Finset ρ} {ms : List μ} + (h : Tr rs nm dA dB r R ms) : R.card ≤ r.m := by + cases h with + | node r R ch hr hsub hside hm hcov => exact hm + +theorem reduction {σ : Type} [DecidableEq σ] [DecidableEq μ] (S : Finset σ) (ms : σ → List μ) (nm : μ → ℕ) (w : μ → ℝ) + (Mv : Finset μ) (hnd : ∀ s ∈ S, (ms s).Nodup) (hsub : ∀ s ∈ S, ∀ e ∈ ms s, e ∈ Mv) + (hcap : ∀ e ∈ Mv, (S.filter fun s => e ∈ ms s).card ≤ nm e) (hw0 : ∀ e ∈ Mv, 0 ≤ w e) : + ∑ s ∈ S, ((ms s).map fun e => w e / nm e).sum ≤ ∑ e ∈ Mv, w e := by + have h1 : ∑ s ∈ S, ((ms s).map fun e => w e / nm e).sum = ∑ s ∈ S, ∑ e ∈ (ms s).toFinset, w e / nm e := by + apply Finset.sum_congr rfl + intro s hs + rw [List.sum_toFinset _ (hnd s hs)] + have h2 : ∑ s ∈ S, ∑ e ∈ (ms s).toFinset, w e / nm e = ∑ e ∈ Mv, ∑ s ∈ S.filter (fun s => e ∈ ms s), w e / nm e := by + apply Finset.sum_comm' + intro s e + constructor + · rintro ⟨hs, he⟩ + have he' : e ∈ ms s := List.mem_toFinset.mp he + exact ⟨Finset.mem_filter.2 ⟨hs, he'⟩, hsub s hs e he'⟩ + · rintro ⟨hs, he⟩ + have := Finset.mem_filter.1 hs + exact ⟨this.1, List.mem_toFinset.2 this.2⟩ + rw [h1, h2] + apply Finset.sum_le_sum + intro e he + rw [Finset.sum_const, nsmul_eq_mul] + have hc := hcap e he + have hw := hw0 e he + by_cases h0 : nm e = 0 + · have : (S.filter fun s => e ∈ ms s).card = 0 := by omega + rw [this]; simpa using hw + · have hpos : (0 : ℝ) < nm e := by exact_mod_cast Nat.pos_of_ne_zero h0 + have hcr : (((S.filter fun s => e ∈ ms s).card : ℕ) : ℝ) ≤ nm e := by exact_mod_cast hc + calc (((S.filter fun s => e ∈ ms s).card : ℕ) : ℝ) * (w e / nm e) ≤ (nm e : ℝ) * (w e / nm e) := + mul_le_mul_of_nonneg_right hcr (div_nonneg hw hpos.le) + _ = w e := by field_simp + +def lineOK (rA rB : Row) (capI lam gA gB : ℕ) : Bool := + (List.range 49).all (fun x => (List.range 49).all (fun r => + decide (lam * min 48 (x + r) ≤ gv rA r + x * capI + gA) && decide (lam * min 48 (x + r) ≤ gv rB r + x * capI + gB))) + && decide (gB ≤ gA) + +/-- the combinatorial data of the whole-meeting tree reduction (all hypotheses named; none depends on the weights). +`S` = source ports (<= 104), `Bset` = the sources whose trees use only the port-realised (restricted) shape edges (`rsB`), `J` = junk cells (source, reader), +`R s` = readers of the non-transported cells of source `s`, `x s` = transported cells, `ms s` = moves of the out-tree of `s`. -/ +structure TreeData (σ ρ μ : Type) [DecidableEq σ] [DecidableEq ρ] [DecidableEq μ] + (rsA rsB : List Row) (rootA rootB : Row) (nB : ℕ) where + J : Finset (σ × ρ) + S : Finset σ + Bset : Finset σ + Mv : Finset μ + Mreg : Finset μ + Mun : Finset μ + dA : μ → ℕ + dB : μ → ℕ + nm : μ → ℕ + ms : σ → List μ + R : σ → Finset ρ + x : σ → ℕ + hJS : ∀ p ∈ J, p.1 ∈ S + hScard : S.card ≤ 104 + hfib : ∀ s ∈ S, (J.filter fun p => p.1 = s).card ≤ 48 + hJcard : 4962 ≤ J.card + hB : Bset ⊆ S + hBcard : nB ≤ Bset.card + hcell : ∀ s ∈ S, (J.filter fun p => p.1 = s).card ≤ x s + (R s).card + hxk : ∀ s ∈ S, x s ≤ (J.filter fun p => p.1 = s).card + htreeA : ∀ s ∈ S, s ∉ Bset → Tr rsA nm dA dB rootA (R s) (ms s) + htreeB : ∀ s ∈ Bset, Tr rsB nm dA dB rootB (R s) (ms s) + hnd : ∀ s ∈ S, (ms s).Nodup + hMv : ∀ s ∈ S, ∀ e ∈ ms s, e ∈ Mv + hcap : ∀ e ∈ Mv, (S.filter fun s => e ∈ ms s).card ≤ nm e + hMsub : Mv ⊆ Mreg ∪ Mun + hdim : ∀ e ∈ Mreg ∪ Mun, 1 ≤ dA e ∧ dA e < dB e ∧ dB e ≤ 8 + +theorem tree_lower {σ : Type} [DecidableEq σ] [DecidableEq μ] + (W : List (List ℕ)) (rsA rsB : List Row) (rootA rootB : Row) (nB : ℕ) (T : TreeData σ ρ μ rsA rsB rootA rootB nB) + (hcA : ∀ r ∈ rsA, Row.check W rsA r = true) (hcB : ∀ r ∈ rsB, Row.check W rsB r = true) + (hrA : rootA.m ≤ 48) (hrB : rootB.m ≤ 48) (capI lam gA gB : ℕ) (hline : lineOK rootA rootB capI lam gA gB = true) + (w : μ → ℝ) + (hW : ∀ e, 1 ≤ T.dA e → T.dA e < T.dB e → T.dB e ≤ 8 → + (((W.getD (T.dA e) []).getD (T.dB e) 0 : ℕ) : ℝ) ≤ SCr * w e) + (hw0 : ∀ e ∈ T.Mv, 0 ≤ w e) (cap : ℝ) (hcap : (capI : ℝ) ≤ SCr * cap) : + (lam : ℝ) * 4962 - ((gA : ℝ) * 104 - ((gA : ℝ) - gB) * nB) ≤ + SCr * (∑ e ∈ T.Mv, w e + cap * ∑ s ∈ T.S, (T.x s : ℝ)) := by + have hred := reduction T.S T.ms T.nm w T.Mv T.hnd T.hMv T.hcap hw0 + have hSC : (0 : ℝ) < SCr := by unfold SCr; positivity + unfold lineOK at hline + simp only [Bool.and_eq_true, List.all_eq_true, List.mem_range, decide_eq_true_eq] at hline + obtain ⟨hline, hBA⟩ := hline + set k : σ → ℕ := fun s => (T.J.filter fun p => p.1 = s).card with hk + set γ : σ → ℕ := fun s => if s ∈ T.Bset then gB else gA with hγ + have per : ∀ s ∈ T.S, (lam : ℝ) * k s - γ s ≤ SCr * (((T.ms s).map fun e => w e / T.nm e).sum + cap * T.x s) := by + intro s hs + have hk48 : k s ≤ 48 := T.hfib s hs + have hx := T.hxk s hs + have hc := T.hcell s hs + -- tree bound and line bound + have key : ∀ (root : Row) (rs : List Row) (g : ℕ), (∀ r ∈ rs, Row.check W rs r = true) → root.m ≤ 48 → + (∀ x < 49, ∀ r < 49, lam * min 48 (x + r) ≤ gv root r + x * capI + g) → + Tr rs T.nm T.dA T.dB root (T.R s) (T.ms s) → + (lam : ℝ) * k s - g ≤ SCr * (((T.ms s).map fun e => w e / T.nm e).sum + cap * T.x s) := by + intro root rs g hcert hr48 hl htr + have hcost := tree_cost_ge W rs hcert T.nm T.dA T.dB w hW htr + have hrc := htr.card_le + have hl' := hl (T.x s) (by have := T.hfib s hs; omega) (T.R s).card (by omega) + have hn : lam * k s ≤ gv root (T.R s).card + T.x s * capI + g := by + have : k s ≤ min 48 (T.x s + (T.R s).card) := le_min hk48 hc + exact le_trans (Nat.mul_le_mul_left _ this) hl' + have hr : (lam : ℝ) * k s ≤ ((gv root (T.R s).card : ℕ) : ℝ) + T.x s * capI + g := by exact_mod_cast hn + have hcx : (T.x s : ℝ) * capI ≤ SCr * (cap * T.x s) := by + have : (0 : ℝ) ≤ T.x s := by positivity + nlinarith + linarith + by_cases hb : s ∈ T.Bset + · have := key rootB rsB gB hcB hrB (fun x hx r hr => (hline x hx r hr).2) (T.htreeB s hb) + simpa [hγ, hb] using this + · have := key rootA rsA gA hcA hrA (fun x hx r hr => (hline x hx r hr).1) (T.htreeA s hs hb) + simpa [hγ, hb] using this + have hsum := Finset.sum_le_sum per + have hJ : (T.J.card : ℝ) = ∑ s ∈ T.S, (k s : ℝ) := by + have := Finset.card_eq_sum_card_fiberwise (f := Prod.fst) (s := T.J) (t := T.S) T.hJS + exact_mod_cast this + have hJge : (4962 : ℝ) ≤ ∑ s ∈ T.S, (k s : ℝ) := by rw [← hJ]; exact_mod_cast T.hJcard + have hγs : ∑ s ∈ T.S, (γ s : ℝ) ≤ gA * 104 - (gA - gB) * nB := by + have e : ∀ s, (γ s : ℝ) = gA - (if s ∈ T.Bset then ((gA : ℝ) - gB) else 0) := by + intro s; simp only [hγ]; split_ifs <;> push_cast <;> ring + rw [Finset.sum_congr rfl (fun s _ => e s), Finset.sum_sub_distrib, Finset.sum_const, Finset.sum_ite_mem, + Finset.inter_eq_right.2 T.hB, Finset.sum_const, nsmul_eq_mul, nsmul_eq_mul] + have h1 : (T.S.card : ℝ) ≤ 104 := by exact_mod_cast T.hScard + have h2 : (nB : ℝ) ≤ T.Bset.card := by exact_mod_cast T.hBcard + have h3 : (gB : ℝ) ≤ gA := by exact_mod_cast hBA + have h4 : (0 : ℝ) ≤ gA := by positivity + nlinarith [mul_nonneg h4 (sub_nonneg.2 h1), mul_nonneg (sub_nonneg.2 h3) (sub_nonneg.2 h2)] + have hlam : (0 : ℝ) ≤ lam := by positivity + have hgl : (lam : ℝ) * 4962 ≤ lam * ∑ s ∈ T.S, (k s : ℝ) := mul_le_mul_of_nonneg_left hJge hlam + have e1 : ∑ s ∈ T.S, ((lam : ℝ) * k s - γ s) = lam * ∑ s ∈ T.S, (k s : ℝ) - ∑ s ∈ T.S, (γ s : ℝ) := by + rw [Finset.sum_sub_distrib, ← Finset.mul_sum] + have e2 : ∑ s ∈ T.S, SCr * (((T.ms s).map fun e => w e / T.nm e).sum + cap * T.x s) = + SCr * (∑ s ∈ T.S, ((T.ms s).map fun e => w e / T.nm e).sum + cap * ∑ s ∈ T.S, (T.x s : ℝ)) := by + rw [← Finset.mul_sum, Finset.sum_add_distrib, ← Finset.mul_sum] + rw [e1, e2] at hsum + have h5 : SCr * (∑ s ∈ T.S, ((T.ms s).map fun e => w e / T.nm e).sum + cap * ∑ s ∈ T.S, (T.x s : ℝ)) ≤ + SCr * (∑ e ∈ T.Mv, w e + cap * ∑ s ∈ T.S, (T.x s : ℝ)) := + mul_le_mul_of_nonneg_left (add_le_add_left hred _ |> fun h => by linarith) hSC.le + linarith + +end CTree diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreePiece.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreePiece.lean new file mode 100644 index 0000000000..d758769556 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreePiece.lean @@ -0,0 +1,137 @@ +import Nov15.CongestionNativeJ +import Nov15.CongestionTreeW + +/-! +CONGESTION-TREE-PIECE: generic piece lemma of the whole-meeting tree ceiling. +`tree_regs_lower` : tree reduction + the two I2-charge premises => `LT/SC - corr <= sum of register c2 + Omega`. +`tree_piece` : one t-piece [a, b] inside [a0, tJ0]: the tree bound replaces `hcong`/`hdist`/`hJ` of `ceiling_native_J`. +-/ +namespace CTree +open NumCertK JointCeiling CallerCost CongestionI3 CongestionI3Dual CongestionNative Finset + +theorem tree_regs_lower {σ ρ μ : Type} [DecidableEq σ] [DecidableEq ρ] [DecidableEq μ] + (W : List (List ℕ)) (rsA rsB : List Row) (rootA rootB : Row) (nB : ℕ) (T : TreeData σ ρ μ rsA rsB rootA rootB nB) + (hcA : ∀ r ∈ rsA, Row.check W rsA r = true) (hcB : ∀ r ∈ rsB, Row.check W rsB r = true) + (hrA : rootA.m ≤ 48) (hrB : rootB.m ≤ 48) (capI lam gA gB : ℕ) (hline : lineOK rootA rootB capI lam gA gB = true) + (lo hi : ℚ) (hwin : wtOK W lo hi = true) (hlo : 0 ≤ lo) (hhi : hi ≤ 1) (s : ℝ) (h1 : (lo : ℝ) ≤ s) (h2 : s ≤ (hi : ℝ)) + (capR corr Om regs : ℝ) (hcap : (capI : ℝ) ≤ SCr * capR) + (hP1 : ∑ e ∈ T.Mreg, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) + capR * ∑ x ∈ T.S, (T.x x : ℝ) ≤ regs + Om) + (hP2 : ∑ e ∈ T.Mun, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) ≤ corr) : + ((lam : ℝ) * 4962 - ((gA : ℝ) * 104 - ((gA : ℝ) - gB) * nB)) / SCr - corr ≤ regs + Om := by + have hSC : (0 : ℝ) < SCr := by unfold SCr; positivity + set w : μ → ℝ := fun e => c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) with hw + have hWl : ∀ e, 1 ≤ T.dA e → T.dA e < T.dB e → T.dB e ≤ 8 → + (((W.getD (T.dA e) []).getD (T.dB e) 0 : ℕ) : ℝ) ≤ SCr * w e := by + intro e ha hab hb + have := W_lower W lo hi hwin hlo hhi s h1 h2 (T.dA e) (T.dB e) ha hab hb + have h' := (div_le_iff₀ hSC).1 this + simp only [hw] + rw [mul_comm]; exact h' + have hw0 : ∀ e ∈ T.Mreg ∪ T.Mun, 0 ≤ w e := by + intro e he + obtain ⟨ha, hab, hb⟩ := T.hdim e he + have := W_lower W lo hi hwin hlo hhi s h1 h2 (T.dA e) (T.dB e) ha hab hb + exact le_trans (div_nonneg (Nat.cast_nonneg _) hSC.le) this + have tl := tree_lower W rsA rsB rootA rootB nB T hcA hcB hrA hrB capI lam gA gB hline w hWl + (fun e he => hw0 e (T.hMsub he)) capR hcap + have u1 : ∑ e ∈ T.Mv, w e ≤ ∑ e ∈ T.Mreg ∪ T.Mun, w e := + Finset.sum_le_sum_of_subset_of_nonneg T.hMsub (fun e he _ => hw0 e he) + have u2 : ∑ e ∈ T.Mreg ∪ T.Mun, w e ≤ ∑ e ∈ T.Mreg, w e + ∑ e ∈ T.Mun, w e := by + have h := Finset.sum_union_inter (s₁ := T.Mreg) (s₂ := T.Mun) (f := w) + have h0 : 0 ≤ ∑ e ∈ T.Mreg ∩ T.Mun, w e := + Finset.sum_nonneg (fun e he => hw0 e (Finset.mem_union_left _ (Finset.mem_of_mem_inter_left he))) + linarith + have h3 : ∑ e ∈ T.Mv, w e + capR * ∑ x ∈ T.S, (T.x x : ℝ) ≤ regs + Om + corr := by + have : ∑ e ∈ T.Mreg, w e = ∑ e ∈ T.Mreg, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) := rfl + have : ∑ e ∈ T.Mun, w e = ∑ e ∈ T.Mun, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) := rfl + linarith + have h4 := mul_le_mul_of_nonneg_left h3 hSC.le + rw [sub_le_iff_le_add, div_le_iff₀ hSC] + nlinarith + +/-- one t-piece [a, b] of the tree ceiling, inside [a0, tJ0]. Same shape as `piece` of `ceiling_native_J`; the junk-count/`hcong`/`hdist` +hypotheses are replaced by the tree data `T`, the weight certificate `hwin`, the line certificate `hline`, and the two I2-charge premises +`hP1`, `hP2` (on the window s in [1 - tJ0, 1 - a0]). -/ +theorem tree_piece {ι : Type*} [DecidableEq ι] {σ' ρ' μ' : Type} [DecidableEq σ'] [DecidableEq ρ'] [DecidableEq μ'] + (R : Finset ι) (nR : ι → ℕ) (dR : ι → ℕ → ℕ) + (hmono : ∀ r ∈ R, ∀ i < nR r, dR r i ≤ dR r (i + 1)) (hd9 : ∀ r ∈ R, dR r (nR r) ≤ 9) + (hmix : (R.filter fun r => Mixed dR nR r).card ≤ 5) + (n : Inv) (ks : List ℕ) (mr : ℕ) (E : ℝ → ℝ) (cstF : ℝ → ℝ) + (hF : ∀ s, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - dprice ks s - mr - E s) + (hEex : ∀ s, 0 ≤ s → s ≤ 1 → ∑ r ∈ R, ex (gs s) (lev dR r) (nR r) ≤ E s) + (W : List (List ℕ)) (rsA rsB : List Row) (rootA rootB : Row) (nB : ℕ) (T : TreeData σ' ρ' μ' rsA rsB rootA rootB nB) + (hcA : ∀ r ∈ rsA, Row.check W rsA r = true) (hcB : ∀ r ∈ rsB, Row.check W rsB r = true) + (hrA : rootA.m ≤ 48) (hrB : rootB.m ≤ 48) + (a0 a b lcp σc cH unLo : ℚ) (capI lam gA gB : ℕ) + (hwin : wtOK W (1 - tJ0) (1 - a0) = true) (ha0 : a0 ≤ a) (hab : a ≤ b) (hb : b ≤ tJ0) (ha00 : 0 ≤ a0) + (hσc : sigOK (1 - b) (1 - a) σc = true) (hσ0 : 0 ≤ σc) + (hline : lineOK rootA rootB capI lam gA gB = true) + (hnum : lcp + 8 * cH ≤ (((lam : ℚ) * 4962 - ((gA : ℚ) * 104 - ((gA : ℚ) - gB) * nB)) / 10 ^ 14)) + (hcapI : (capI : ℚ) ≤ unLo * 10 ^ 14 / 48) (hun : (unLo : ℝ) ≤ (9 : ℝ) ^ (1 - (b : ℝ)) - (8 : ℝ) ^ (1 - (b : ℝ))) + (hcst : cstF (b : ℝ) ≤ (cH : ℝ)) (hcstMono : MonotoneOn cstF (Set.Icc ((a0 : ℚ) : ℝ) (1 / 10))) + (hP1 : ∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0 : ℚ) : ℝ) → + ∑ e ∈ T.Mreg, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) + capC s * ∑ x ∈ T.S, (T.x x : ℝ) ≤ + ∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs s) (lev dR r i) (lev dR r (i + 1)) + Omega ks mr s) + (hP2 : ∀ s : ℝ, ((1 - tJ0 : ℚ) : ℝ) ≤ s → s ≤ ((1 - a0 : ℚ) : ℝ) → + ∑ e ∈ T.Mun, c2 (gs s) (T.dA e : ℝ) (T.dB e : ℝ) ≤ corrC cstF s) + (hFb : ∀ s : ℝ, ((1 - b : ℚ) : ℝ) ≤ s → s ≤ ((1 - a : ℚ) : ℝ) → Fc cfC s < 17 * (((lcp - 5 * σc : ℚ)) : ℝ)) : + ∀ t : ℝ, (a : ℝ) ≤ t → t ≤ (b : ℝ) → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 := by + intro t h1 h2 + have hbJ : b ≤ tJ0 := hb + have htJ : tJ0 ≤ 1 / 10 := by unfold tJ0; norm_num + have hbq : (b : ℝ) ≤ ((tJ0 : ℚ) : ℝ) := by exact_mod_cast hb + have hbq' : (b : ℝ) ≤ 1 / 10 := by + have := (Rat.cast_le (K := ℝ)).mpr (le_trans hb htJ); push_cast at this; exact this + have haq : ((a0 : ℚ) : ℝ) ≤ a := by exact_mod_cast ha0 + have hab' : (a : ℝ) ≤ b := by exact_mod_cast hab + have hA0 : (0 : ℝ) ≤ a0 := by exact_mod_cast ha00 + have hs0 : 0 ≤ 1 - t := by linarith + have hs1 : 1 - t ≤ 1 := by linarith + have hσ : ∀ a' b' : ℕ, 1 ≤ a' → a' ≤ b' → b' ≤ 8 → c2 (gs (1 - t)) (a' : ℝ) (b' : ℝ) ≤ (σc : ℝ) := by + intro a' b' h1' h2' h3' + have hb0 : 0 ≤ 1 - b := by + have : b ≤ 1 := le_trans hb (by unfold tJ0; norm_num) + linarith + exact sig_of_ok (1 - b) (1 - a) σc hσc hb0 (by linarith) hσ0 (1 - t) + (by push_cast; linarith) (by push_cast; linarith) a' b' h1' h2' h3' + -- window + have hlo : (0 : ℚ) ≤ 1 - tJ0 := by unfold tJ0; norm_num + have hhi : (1 - a0 : ℚ) ≤ 1 := by linarith + have hw1 : ((1 - tJ0 : ℚ) : ℝ) ≤ 1 - t := by push_cast; linarith + have hw2 : 1 - t ≤ ((1 - a0 : ℚ) : ℝ) := by push_cast; linarith + -- cap and corr + have hcap : (capI : ℝ) ≤ SCr * capC (1 - t) := by + have hu : (unLo : ℝ) ≤ (9 : ℝ) ^ (1 - t) - (8 : ℝ) ^ (1 - t) := by + have := unit_mono (1 - (b : ℝ)) (1 - t) (by linarith) (by linarith) + linarith + have hc : (capI : ℝ) ≤ (unLo : ℝ) * 10 ^ 14 / 48 := by exact_mod_cast hcapI + unfold SCr capC + have : (unLo : ℝ) * 10 ^ 14 / 48 ≤ 10 ^ 14 * (((9 : ℝ) ^ (1 - t) - (8 : ℝ) ^ (1 - t)) / 48) := by nlinarith + linarith + have hcorr : corrC cstF (1 - t) ≤ 8 * (cH : ℝ) := by + unfold corrC + have e : 1 - (1 - t) = t := by ring + rw [e] + have : cstF t ≤ cstF (b : ℝ) := + hcstMono ⟨le_trans haq h1, by linarith⟩ ⟨le_trans haq hab', hbq'⟩ h2 + linarith + have hT := tree_regs_lower W rsA rsB rootA rootB nB T hcA hcB hrA hrB capI lam gA gB hline (1 - tJ0) (1 - a0) hwin hlo hhi + (1 - t) hw1 hw2 (capC (1 - t)) (corrC cstF (1 - t)) (Omega ks mr (1 - t)) + (∑ r ∈ R, ∑ i ∈ range (nR r), c2 (gs (1 - t)) (lev dR r i) (lev dR r (i + 1))) hcap + (hP1 (1 - t) hw1 hw2) (hP2 (1 - t) hw1 hw2) + have hnum' : (lcp : ℝ) + 8 * cH ≤ ((lam : ℝ) * 4962 - ((gA : ℝ) * 104 - ((gA : ℝ) - gB) * nB)) / SCr := by + have := (Rat.cast_le (K := ℝ)).mpr hnum + push_cast at this + unfold SCr; linarith + have hreg := sum_all_c2_le (gs (1 - t)) (gs_zero (1 - t)) R nR dR hmono hd9 5 hmix (σc : ℝ) (by exact_mod_cast hσ0) hσ + push_cast at hreg + have hE' : (((lcp - 5 * σc : ℚ)) : ℝ) ≤ E (1 - t) + Omega ks mr (1 - t) := by + have := hEex (1 - t) hs0 hs1 + push_cast + linarith + exact branchC_om n ks mr (E (1 - t)) _ (1 - t) (hF _ hs0 hs1) hE' (hFb (1 - t) (by push_cast; linarith) (by push_cast; linarith)) + +end CTree + +#print axioms CTree.tree_regs_lower +#print axioms CTree.tree_piece diff --git a/research/p104-tree-ceiling/lean/Nov15/CongestionTreeW.lean b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeW.lean new file mode 100644 index 0000000000..f22bfe0d0c --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/CongestionTreeW.lean @@ -0,0 +1,71 @@ +import Nov15.CongestionI3DualSig +import Nov15.CongestionTreeCore + +/-! +CONGESTION-TREE-W: kernel certificate that the integer weight table `W a b` (units 1/10^14, rounded DOWN) is a lower bound of +`c2 (gs s) a b = min (h9, k0)` for every `s` in a window `[lo, hi]`. Method: `h9`, `k0` are exponential polynomials (`h9CF`, `k0CF`); +`dLo (negCF cf) lo hi > 0` proves them nonincreasing in `s` on the window (so nondecreasing in `t = 1 - s`), and a point enclosure +`Fup (negCF cf) hi hi <= -W/10^14` bounds them below at `s = hi`. No monotonicity hypothesis remains. +-/ +namespace CTree +open NumCertK CongestionI3Dual + +def negCF (cf : CF) : CF := cf.map fun p => (p.1, -p.2) + +theorem Fc_negCF (cf : CF) (s : ℝ) : Fc (negCF cf) s = - Fc cf s := by + induction cf with + | nil => simp [Fc, negCF] + | cons p l ih => + simp only [Fc, negCF, List.map_cons, List.sum_cons] at ih ⊢ + push_cast + linarith + +theorem okR_negCF (cf : CF) (h : okR cf) : okR (negCF cf) := by + intro p hp + simp only [negCF, List.mem_map] at hp + obtain ⟨q, hq, rfl⟩ := hp + exact h q hq + +def Wt (W : List (List ℕ)) (a b : ℕ) : ℕ := (W.getD a []).getD b 0 + +def wtPair (W : List (List ℕ)) (lo hi : ℚ) (p : ℕ × ℕ) : Bool := + decide (0 < dLo (negCF (h9CF p.1 p.2)) lo hi) && decide (0 < dLo (negCF (k0CF p.1 p.2)) lo hi) && + decide (Fup (negCF (h9CF p.1 p.2)) hi hi ≤ -((Wt W p.1 p.2 : ℚ) / 10 ^ 14)) && + decide (Fup (negCF (k0CF p.1 p.2)) hi hi ≤ -((Wt W p.1 p.2 : ℚ) / 10 ^ 14)) + +def wtOK (W : List (List ℕ)) (lo hi : ℚ) : Bool := pairs.all (wtPair W lo hi) + +theorem cf_lower (cf : CF) (hok : okR cf) (lo hi : ℚ) (hlo : 0 ≤ lo) (hhi : hi ≤ 1) (hd : 0 < dLo (negCF cf) lo hi) (q : ℚ) + (hq : Fup (negCF cf) hi hi ≤ -q) (s : ℝ) (h1 : (lo : ℝ) ≤ s) (h2 : s ≤ (hi : ℝ)) : (q : ℝ) ≤ Fc cf s := by + have hok' := okR_negCF cf hok + have m1 := Fc_mono (negCF cf) hok' lo hi hlo hhi hd s h1 h2 + have hhi0 : 0 ≤ hi := by + have : (0 : ℝ) ≤ hi := le_trans (by exact_mod_cast hlo) (le_trans h1 h2) + exact_mod_cast this + have m2 := Fc_le (negCF cf) hok' hi hi hhi0 hhi (hi : ℝ) (le_refl _) (le_refl _) + have m3 : ((Fup (negCF cf) hi hi : ℚ) : ℝ) ≤ ((-q : ℚ) : ℝ) := by exact_mod_cast hq + simp only [Fc_negCF] at m1 m2 + push_cast at m3 + linarith + +theorem W_lower (W : List (List ℕ)) (lo hi : ℚ) (hok : wtOK W lo hi = true) (hlo : 0 ≤ lo) (hhi : hi ≤ 1) (s : ℝ) + (h1 : (lo : ℝ) ≤ s) (h2 : s ≤ (hi : ℝ)) (a b : ℕ) (ha : 1 ≤ a) (hab : a < b) (hb : b ≤ 8) : + ((Wt W a b : ℕ) : ℝ) / SCr ≤ c2 (gs s) (a : ℝ) (b : ℝ) := by + have hm : (a, b) ∈ pairs := mem_pairs a (by omega) b (by omega) ⟨ha, hab, hb⟩ + have := List.all_eq_true.mp hok (a, b) hm + simp only [wtPair, Bool.and_eq_true, decide_eq_true_eq] at this + obtain ⟨⟨⟨d1, d2⟩, f1⟩, f2⟩ := this + have e1 := cf_lower (h9CF a b) (okR_h9CF a b ha hab hb) lo hi hlo hhi d1 ((Wt W a b : ℚ) / 10 ^ 14) f1 s h1 h2 + have e2 := cf_lower (k0CF a b) (okR_k0CF a b ha hab hb) lo hi hlo hhi d2 ((Wt W a b : ℚ) / 10 ^ 14) f2 s h1 h2 + rw [← h9_Fc s a b ha hab hb] at e1 + rw [← k0_Fc s a b ha hab hb] at e2 + have hS : SCr = ((10 ^ 14 : ℚ) : ℝ) := by unfold SCr; push_cast; ring + have : (((Wt W a b : ℚ) / 10 ^ 14 : ℚ) : ℝ) = ((Wt W a b : ℕ) : ℝ) / SCr := by + rw [hS]; push_cast; ring + rw [this] at e1 e2 + unfold c2 + exact le_min e1 e2 + +end CTree + +#print axioms CTree.W_lower diff --git a/research/p104-tree-ceiling/lean/Nov15/FibreK.lean b/research/p104-tree-ceiling/lean/Nov15/FibreK.lean new file mode 100644 index 0000000000..33e2d3f083 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/FibreK.lean @@ -0,0 +1,537 @@ +/- +FibreK . See FibreK.md. Formalises the AUDITED parts of internal notes,2}.md, AUDIT2.md. + +Part 1 THEOREM K. Price premise P0 as an explicit hypothesis (a `Table`: the ranks charged for a helper climb d = e - b on T, + and for a helper MOVE of |dim step| = d on P). The invoice F(t) = sum_r (T_r - P_r) r^(1-t) of the word is + `FK E tb S Pi t`: a function of the ends E, the step multiset S and the climb multiset Pi only (`K_word`, `K_invoice`). +Part 2 G2 for PURE relabels. Helpers end identity; hub gauge L in Blk(V'), M in Blk(G0) (SwapNull.Blk / Undo). + * tail: row relabel (SwapNull.rowSw), V' = sigma^-1 V (the corrected hypothesis), `tail_pairs`; + * head: column relabel (SwapNull.colSw), prefix block G1 = the NEW births-at-0 set, proved DIRECTLY `head_pairs`; + the (birth,end) multiset, hence Pi, hence F(t) by K, is unchanged. +Kernel only: no sorry, no native_decide. +-/ +import Nov15.SwapNull +import Nov15.CallerCost + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace FibreK +open CallerCost + +/-! ### Part 1: THEOREM K -/ + +/-- P0: rank tables. `tT d` = ranks charged to T for a helper with climb d = e - b; +`tP d` = ranks charged to P for a helper MOVE with |Δdim| = d. (Hist = (rank, count) lists.) -/ +structure Table where + tT : ℕ → Hist + tP : ℕ → Hist + +/-- A helper: birth dim, end dim, and its MOVE steps as (source dim, target dim). -/ +structure Helper where + b : ℕ + e : ℕ + steps : List (ℕ × ℕ) + +def gap (s : ℕ × ℕ) : ℕ := Int.natAbs ((s.2 : ℤ) - s.1) + +/-- F-contribution of a histogram: sum count * rank^(1-t). -/ +noncomputable def Fh (l : Hist) (t : ℝ) : ℝ := (l.map fun p => (p.2 : ℝ) * (p.1 : ℝ) ^ (1 - t)).sum +noncomputable def Fi (i : Inv) (t : ℝ) : ℝ := Fh i.T t - Fh i.P t + +theorem Fh_append (l m : Hist) (t : ℝ) : Fh (l ++ m) t = Fh l t + Fh m t := by simp [Fh] + +theorem Fh_scale (L : ℕ) (l : Hist) (t : ℝ) : Fh (scale L l) t = L * Fh l t := by + induction l with + | nil => simp [Fh, scale] + | cons p l ih => + simp only [Fh, scale, List.map_cons, List.sum_cons] at ih ⊢ + rw [ih]; push_cast; ring + +theorem Fh_flatMap {α : Type*} (l : List α) (g : α → Hist) (t : ℝ) : + Fh (l.flatMap g) t = (l.map fun x => Fh (g x) t).sum := by + induction l with + | nil => simp [Fh] + | cons x l ih => simp [List.flatMap_cons, Fh_append, ih] + +/-- invoice = caller + L * native, at the level of F. -/ +theorem Fi_invoice (c n : Inv) (L : ℕ) (t : ℝ) : + Fi (invoice c n L) t = Fi c t + L * Fi n t := by + simp only [Fi, invoice, Fh_append, Fh_scale]; ring + +/-- the native's invoice histograms from the helper list (P0). -/ +def nativeInv (E : Inv) (tb : Table) (H : List Helper) : Inv := + ⟨E.T ++ H.flatMap fun h => tb.tT (h.e - h.b), + E.P ++ H.flatMap fun h => h.steps.flatMap fun s => tb.tP (gap s)⟩ + +/-- the timed-step data: S = multiset of all helper MOVEs, Pi = multiset of climbs e - b. -/ +def Ssum (H : List Helper) : Multiset (ℕ × ℕ) := ↑(H.flatMap Helper.steps) +def PiW (H : List Helper) : Multiset ℕ := ↑(H.map fun h => h.e - h.b) + +/-- F as a function of the DATA (E, S, Pi). -/ +noncomputable def FK (E : Inv) (tb : Table) (S : Multiset (ℕ × ℕ)) (Pi : Multiset ℕ) (t : ℝ) : ℝ := + Fi E t + (Pi.map fun d => Fh (tb.tT d) t).sum - (S.map fun s => Fh (tb.tP (gap s)) t).sum + +theorem sum_flatMap_map {α β : Type*} (H : List α) (g : α → List β) (φ : β → ℝ) : + ((H.flatMap g).map φ).sum = (H.map fun h => ((g h).map φ).sum).sum := by + induction H with + | nil => simp + | cons h H ih => simp [List.flatMap_cons, List.map_append, List.sum_append, ih] + +/-- **THEOREM K** (P0 as hypothesis `tb`): the word's F is `FK` of its (E, S, Pi). -/ +theorem K_word (E : Inv) (tb : Table) (H : List Helper) (t : ℝ) : + Fi (nativeInv E tb H) t = FK E tb (Ssum H) (PiW H) t := by + simp only [Fi, nativeInv, FK, Ssum, PiW, Fh_append, Fh_flatMap, Multiset.map_coe, Multiset.sum_coe] + rw [sum_flatMap_map] + have : ∀ h : Helper, (h.steps.map fun s => Fh (tb.tP (gap s)) t).sum + = Fh (h.steps.flatMap fun s => tb.tP (gap s)) t := fun h => (Fh_flatMap _ _ _).symm + simp only [List.map_map, Function.comp_def, this] + ring + +/-- κ depends only on (E, S, Pi): two words with the same data have the same F, so the same roots. -/ +theorem K_congr (E : Inv) (tb : Table) (H H' : List Helper) + (hS : Ssum H' = Ssum H) (hP : PiW H' = PiW H) (t : ℝ) : + Fi (nativeInv E tb H') t = Fi (nativeInv E tb H) t := by + rw [K_word, K_word, hS, hP] + +/-- the caller invoice of the native (calls = L) is a function of (E, S, Pi) (and the fixed caller). -/ +theorem K_invoice (c E : Inv) (tb : Table) (H : List Helper) (L : ℕ) (t : ℝ) : + Fi (invoice c (nativeInv E tb H) L) t = Fi c t + L * FK E tb (Ssum H) (PiW H) t := by + rw [Fi_invoice, K_word] + +/-- κ = a root of F: invariant when F is. -/ +def IsRoot (F : ℝ → ℝ) (κ : ℝ) : Prop := F κ = 0 + +theorem kappa_depends_only (c E : Inv) (tb : Table) (H H' : List Helper) (L : ℕ) + (hS : Ssum H' = Ssum H) (hP : PiW H' = PiW H) (κ : ℝ) : + IsRoot (Fi (invoice c (nativeInv E tb H') L)) κ ↔ IsRoot (Fi (invoice c (nativeInv E tb H) L)) κ := by + unfold IsRoot + rw [K_invoice, K_invoice, hS, hP] + +/-- the instance used by FloorD0 / V2Bridge: D0 table `tT d = tP d = [(d, 1)]`; then the helper part is +Σ_h [f(e-b) - Σ_steps f(gap)] (the per-helper D0 identity). -/ +def d0Table : Table := ⟨fun d => [(d, 1)], fun d => [(d, 1)]⟩ + +theorem Dh_flatMap {α : Type*} (l : List α) (g : α → Hist) : + Dh (l.flatMap g) = (l.map fun x => Dh (g x)).sum := by + induction l with + | nil => simp [Dh] + | cons x l ih => simp [List.flatMap_cons, Dh_append, ih] + +theorem d0_native (E : Inv) (H : List Helper) : + Dinv (nativeInv E d0Table H) = Dinv E + (H.map fun h => + (fL (h.e - h.b) - (h.steps.map fun s => fL (gap s)).sum)).sum := by + simp only [Dinv, nativeInv, Dh_append, Dh_flatMap, d0Table] + have h1 : ∀ h : Helper, Dh [(h.e - h.b, 1)] = fL (h.e - h.b) := by intro h; simp [Dh] + have h2 : ∀ h : Helper, (h.steps.map fun s => Dh [(gap s, 1)]).sum = (h.steps.map fun s => fL (gap s)).sum := by + intro h; simp [Dh] + have hs : ∀ (l : List Helper) (a b : Helper → ℝ), + (l.map fun h => a h - b h).sum = (l.map a).sum - (l.map b).sum := by + intro l a b + induction l with + | nil => simp + | cons x l ih => simp [ih]; ring + simp only [h1, h2] + rw [hs] + ring + +/-! ### Part 2: G2 for pure relabels -/ +section G2 +open SwapNull +variable {K Reg : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] + +/-- helpers end identity: the final row of a helper is its own unit vector. -/ +def HelpersId (H : Reg → Prop) (F : Matrix Reg Reg K) : Prop := + ∀ x, H x → ∀ k, F x k = (1 : Matrix Reg Reg K) x k + +/-- Row x ∉ V' of L * A * M is the row of A * M. -/ +theorem lrow {V' : Reg → Prop} {L : Matrix Reg Reg K} (hL : Blk V' L) (A : Matrix Reg Reg K) + {x : Reg} (hx : ¬ V' x) (j : Reg) : (L * A) x j = A x j := by + rw [Matrix.mul_apply, Finset.sum_eq_single x] + · rw [hL x x (fun h => hx h.1)]; simp + · intro i _ hi; rw [hL x i (fun h => hx h.1), Matrix.one_apply_ne (Ne.symm hi)]; simp + · simp + +/-- TAIL force: if L ∈ Blk(V'), M ∈ Blk(G0) undo a row relabel of an identity-final matrix, every moved +helper x ∉ V' has x and σ x in G0. -/ +theorem tail_force {H V' G0 : Reg → Prop} {F : Matrix Reg Reg K} (hF : HelpersId H F) + (σ : Equiv.Perm Reg) (hσH : ∀ x, H x → H (σ x)) + (hu : Undo V' G0 F (rowSw σ F)) {x : Reg} (hx : H x) (hV : ¬ V' x) (hm : σ x ≠ x) : + G0 x ∧ G0 (σ x) := by + obtain ⟨L, M, hL, hM, h⟩ := hu + have key : ∀ k, M (σ x) k = (1 : Matrix Reg Reg K) x k := by + intro k + have h1 : (L * rowSw σ F * M) x k = M (σ x) k := by + rw [Matrix.mul_apply, Finset.sum_eq_single (σ x)] + · rw [lrow hL _ hV]; simp [rowSw, hF (σ x) (hσH x hx)] + · intro j _ hj + rw [lrow hL _ hV]; simp [rowSw, hF (σ x) (hσH x hx), Matrix.one_apply_ne (Ne.symm hj)] + · simp + rw [← h1, h]; exact hF x hx k + constructor + · by_contra hg + have := hM (σ x) x (fun h => hg h.2) + rw [key x, Matrix.one_apply_ne hm] at this + simp at this + · by_contra hg + have := hM (σ x) (σ x) (fun h => hg h.1) + rw [key (σ x), Matrix.one_apply_ne (Ne.symm hm)] at this + simp at this + +/-- HEAD force (direct, not by time reversal): a column relabel undone by L ∈ Blk(V), M ∈ Blk(G1): +every moved helper x ∉ V has σ⁻¹ x and x in G1. -/ +theorem head_force {H V G1 : Reg → Prop} {F : Matrix Reg Reg K} (hF : HelpersId H F) + (σ : Equiv.Perm Reg) + (hu : Undo V G1 F (colSw σ F)) {x : Reg} (hx : H x) (hV : ¬ V x) (hm : σ x ≠ x) : + G1 (σ.symm x) ∧ G1 x := by + obtain ⟨L, M, hL, hM, h⟩ := hu + have key : ∀ k, M (σ.symm x) k = (1 : Matrix Reg Reg K) x k := by + intro k + have h1 : (L * colSw σ F * M) x k = M (σ.symm x) k := by + rw [Matrix.mul_apply, Finset.sum_eq_single (σ.symm x)] + · rw [lrow hL _ hV]; simp [colSw, hF x hx] + · intro j _ hj + rw [lrow hL _ hV] + have : x ≠ σ j := fun e => hj (by rw [e]; simp) + simp [colSw, hF x hx, Matrix.one_apply_ne this] + · simp + rw [← h1, h]; exact hF x hx k + have hy : σ.symm x ≠ x := fun e => hm (by + have := congrArg σ e; simpa using this.symm) + constructor + · by_contra hg + have := hM (σ.symm x) (σ.symm x) (fun h => hg h.1) + rw [key (σ.symm x), Matrix.one_apply_ne (Ne.symm hy)] at this + simp at this + · by_contra hg + have := hM (σ.symm x) x (fun h => hg h.2) + rw [key x, Matrix.one_apply_ne hy] at this + simp at this + +/-! counting lemma: equal cardinality, differing only on birth-0 elements, so equal birth multisets -/ +theorem map_birth_eq (β : Reg → ℕ) (A B : Finset Reg) (hc : A.card = B.card) + (hA : ∀ x ∈ A, x ∉ B → β x = 0) (hB : ∀ x ∈ B, x ∉ A → β x = 0) : + A.val.map β = B.val.map β := by + classical + have hne : ∀ b : ℕ, b ≠ 0 → A.filter (fun x => b = β x) = B.filter (fun x => b = β x) := by + intro b hb + ext x + simp only [Finset.mem_filter] + constructor + · rintro ⟨ha, e⟩ + refine ⟨?_, e⟩ + by_contra hn + exact hb (e.trans (hA x ha hn)) + · rintro ⟨ha, e⟩ + refine ⟨?_, e⟩ + by_contra hn + exact hb (e.trans (hB x ha hn)) + apply Multiset.ext.2 + intro b + rw [Multiset.count_map, Multiset.count_map] + simp only [← Finset.filter_val, Finset.card_val] + by_cases hb : b = 0 + · subst hb + have h1 := Finset.card_filter_add_card_filter_not (s := A) (fun x => 0 = β x) + have h2 := Finset.card_filter_add_card_filter_not (s := B) (fun x => 0 = β x) + have h3 : A.filter (fun x => ¬ (0 = β x)) = B.filter (fun x => ¬ (0 = β x)) := by + ext x + simp only [Finset.mem_filter] + constructor + · rintro ⟨ha, e⟩ + refine ⟨?_, e⟩ + by_contra hn + exact e (hA x ha hn).symm + · rintro ⟨ha, e⟩ + refine ⟨?_, e⟩ + by_contra hn + exact e (hB x ha hn).symm + rw [h3] at h1 + omega + · rw [hne b hb] + +variable (β ε : Reg → ℕ) (d : ℕ) + +/-- birth/end pairs of the helpers `Hs`. -/ +def pairs (Hs : Finset Reg) : Multiset (ℕ × ℕ) := Hs.val.map fun x => (β x, ε x) +/-- after a tail relabel x keeps its birth but takes σ x's end. -/ +def pairsTail (σ : Equiv.Perm Reg) (Hs : Finset Reg) : Multiset (ℕ × ℕ) := + Hs.val.map fun x => (β x, ε (σ x)) +/-- after a head relabel x takes σ x's birth but keeps its end. -/ +def pairsHead (σ : Equiv.Perm Reg) (Hs : Finset Reg) : Multiset (ℕ × ℕ) := + Hs.val.map fun x => (β (σ x), ε x) + +theorem sigma_H {H : Reg → Prop} (σ : Equiv.Perm Reg) (hσ : ∀ x, ¬ H x → σ x = x) : + ∀ x, H x → H (σ x) := by + intro x hx + by_contra h + have h1 := hσ _ h + have : σ x = x := σ.injective h1 + exact h (by rw [this]; exact hx) + +theorem split_map {α γ : Type*} (s : Multiset α) (p : α → Prop) [DecidablePred p] (f : α → γ) : + s.map f = (s.filter p).map f + (s.filter (fun x => ¬ p x)).map f := by + rw [← Multiset.map_add, Multiset.filter_add_not] + +/-- the (birth, end) pair multiset determines the climb multiset Pi -/ +def PiOf (ps : Multiset (ℕ × ℕ)) : Multiset ℕ := ps.map fun p => p.2 - p.1 + +theorem PiW_eq (H : List Helper) : PiW H = PiOf (↑(H.map fun h => (h.b, h.e)) : Multiset (ℕ × ℕ)) := by + simp [PiW, PiOf, Multiset.map_coe, List.map_map, Function.comp_def] + +section Pairs + +theorem symm_fix (σ : Equiv.Perm Reg) (x : Reg) (h : σ.symm x = x) : σ x = x := by + have h2 := congrArg σ h + rw [Equiv.apply_symm_apply] at h2 + exact h2.symm + +/-- **G2, TAIL case.** Hypotheses (AUDIT2): helpers end identity; G0-members are born at 0; the V-enders +(= the helpers ending at the single chart `d`) are exactly V ⊆ H; σ permutes helpers only; hub gauge +L ∈ Blk(V'), M ∈ Blk(G0) with V' = σ⁻¹ V. Then the (birth,end) multiset is unchanged. -/ +theorem tail_pairs {H V G0 : Reg → Prop} [DecidablePred H] [DecidablePred V] + {F : Matrix Reg Reg K} (hF : HelpersId H F) (σ : Equiv.Perm Reg) (hσ : ∀ x, ¬ H x → σ x = x) + (hVH : ∀ x, V x → H x) (hE : ∀ x, H x → (ε x = d ↔ V x)) (hG : ∀ x, G0 x → β x = 0) + (hu : Undo (fun x => V (σ x)) G0 F (rowSw σ F)) : + pairsTail β ε σ (Finset.univ.filter H) = pairs β ε (Finset.univ.filter H) := by + classical + have hσH := sigma_H σ hσ + have hσs : ∀ x, ¬ H x → σ.symm x = x := fun x hx => (Equiv.symm_apply_eq σ).2 (hσ x hx).symm + have hσsH := sigma_H σ.symm hσs + set Hs : Finset Reg := Finset.univ.filter H with hHs + have memH : ∀ x, x ∈ Hs ↔ H x := by intro x; simp [hHs] + have F1 : ∀ x, H x → ¬ V (σ x) → σ x ≠ x → β x = 0 ∧ β (σ x) = 0 := by + intro x hx hv hm + obtain ⟨a, b⟩ := tail_force hF σ hσH hu hx hv hm + exact ⟨hG _ a, hG _ b⟩ + have F2 : ∀ x, H x → ¬ V (σ x) → β (σ x) = β x := by + intro x hx hv + by_cases hm : σ x = x + · rw [hm] + · obtain ⟨a, b⟩ := F1 x hx hv hm; rw [a, b] + set V' : Finset Reg := Hs.filter (fun x => V (σ x)) with hV' + set Vf : Finset Reg := Hs.filter V with hVf + have hcard : V'.card = Vf.card := by + apply Finset.card_bij (fun x _ => σ x) + · intro x hx + simp only [hV', hVf, Finset.mem_filter, memH] at hx ⊢ + exact ⟨hσH x hx.1, hx.2⟩ + · intro x _ y _ e; exact σ.injective e + · intro y hy + simp only [hV', hVf, Finset.mem_filter, memH] at hy ⊢ + refine ⟨σ.symm y, ⟨hσsH y hy.1, by simpa using hy.2⟩, by simp⟩ + have F4 : ∀ x ∈ V', x ∉ Vf → β x = 0 := by + intro x hx hxn + simp only [hV', hVf, Finset.mem_filter, memH] at hx hxn + have hnV : ¬ V x := fun h => hxn ⟨hx.1, h⟩ + have hmu : σ (σ.symm x) ≠ σ.symm x := by + intro e + rw [Equiv.apply_symm_apply] at e + exact hnV (by have := symm_fix σ x e.symm; rw [← this]; exact hx.2) + have := (F1 _ (hσsH x hx.1) (by rw [Equiv.apply_symm_apply]; exact hnV) hmu).2 + rwa [Equiv.apply_symm_apply] at this + have F5 : ∀ y ∈ Vf, y ∉ V' → β y = 0 := by + intro y hy hyn + simp only [hV', hVf, Finset.mem_filter, memH] at hy hyn + have hnV : ¬ V (σ y) := fun h => hyn ⟨hy.1, h⟩ + have hm : σ y ≠ y := fun e => hnV (by rw [e]; exact hy.2) + exact (F1 y hy.1 hnV hm).1 + have hV'map : V'.val.map β = Vf.val.map β := + map_birth_eq β V' Vf hcard F4 F5 + -- the non-V' part is carried to the non-V part by σ + set N1 : Finset Reg := Hs.filter (fun x => ¬ V (σ x)) with hN1 + set N2 : Finset Reg := Hs.filter (fun x => ¬ V x) with hN2 + have hN : N2 = N1.map σ.toEmbedding := by + ext y + simp only [hN1, hN2, Finset.mem_filter, Finset.mem_map, memH, Equiv.coe_toEmbedding] + constructor + · rintro ⟨hy, hv⟩ + exact ⟨σ.symm y, ⟨hσsH y hy, by simpa using hv⟩, by simp⟩ + · rintro ⟨x, ⟨hx, hv⟩, rfl⟩ + exact ⟨hσH x hx, hv⟩ + unfold pairsTail pairs + rw [split_map Hs.val (fun x => V (σ x)), split_map Hs.val V] + congr 1 + · have e1 : (Hs.val.filter (fun x => V (σ x))).map (fun x => (β x, ε (σ x))) = + V'.val.map (fun x => (β x, d)) := by + apply Multiset.map_congr rfl + intro x hx + have hx' : x ∈ V' := hx + simp only [hV', Finset.mem_filter, memH] at hx' + rw [(hE (σ x) (hσH x hx'.1)).2 hx'.2] + have e2 : (Hs.val.filter V).map (fun x => (β x, ε x)) = Vf.val.map (fun x => (β x, d)) := by + apply Multiset.map_congr rfl + intro x hx + have hx' : x ∈ Vf := hx + simp only [hVf, Finset.mem_filter, memH] at hx' + rw [(hE x hx'.1).2 hx'.2] + rw [e1, e2] + have h3 : ∀ A : Finset Reg, A.val.map (fun x => (β x, d)) = (A.val.map β).map (fun b => (b, d)) := by + intro A; rw [Multiset.map_map]; rfl + rw [h3, h3, hV'map] + · have e : (Hs.val.filter (fun x => ¬ V (σ x))) = N1.val := rfl + have e' : (Hs.val.filter (fun x => ¬ V x)) = N2.val := rfl + rw [e, e', hN, Finset.map_val, Multiset.map_map] + apply Multiset.map_congr rfl + intro x hx + have hx' : x ∈ N1 := hx + simp only [hN1, Finset.mem_filter, memH] at hx' + simp [F2 x hx'.1 hx'.2] + +/-- **G2, HEAD case, proved directly** (no time reversal). A head relabel x ↦ birth of σ x, same end; +the hub undoing it is L ∈ Blk(V) (the V-enders are unchanged) and the prefix M ∈ Blk(G1), where G1 is the set +of helpers born at 0 in the NEW word (`G1 x → β (σ x) = 0`; the head-side analogue of V' = σ⁻¹ V). -/ +theorem head_pairs {H V G1 : Reg → Prop} [DecidablePred H] [DecidablePred V] + {F : Matrix Reg Reg K} (hF : HelpersId H F) (σ : Equiv.Perm Reg) (hσ : ∀ x, ¬ H x → σ x = x) + (hVH : ∀ x, V x → H x) (hE : ∀ x, H x → (ε x = d ↔ V x)) (hG : ∀ x, G1 x → β (σ x) = 0) + (hu : Undo V G1 F (colSw σ F)) : + pairsHead β ε σ (Finset.univ.filter H) = pairs β ε (Finset.univ.filter H) := by + classical + have hσH := sigma_H σ hσ + have hσs : ∀ x, ¬ H x → σ.symm x = x := fun x hx => (Equiv.symm_apply_eq σ).2 (hσ x hx).symm + have hσsH := sigma_H σ.symm hσs + set Hs : Finset Reg := Finset.univ.filter H with hHs + have memH : ∀ x, x ∈ Hs ↔ H x := by intro x; simp [hHs] + have F1 : ∀ x, H x → ¬ V x → σ x ≠ x → β x = 0 ∧ β (σ x) = 0 := by + intro x hx hv hm + obtain ⟨a, b⟩ := head_force hF σ hu hx hv hm + refine ⟨?_, hG _ b⟩ + have := hG _ a + rwa [Equiv.apply_symm_apply] at this + have F2 : ∀ x, H x → ¬ V x → β (σ x) = β x := by + intro x hx hv + by_cases hm : σ x = x + · rw [hm] + · obtain ⟨a, b⟩ := F1 x hx hv hm; rw [a, b] + set Vf : Finset Reg := Hs.filter V with hVf + set Vs : Finset Reg := Vf.map σ.toEmbedding with hVs + have hcard : Vs.card = Vf.card := Finset.card_map _ + have F4 : ∀ x ∈ Vs, x ∉ Vf → β x = 0 := by + intro x hx hxn + simp only [hVs, hVf, Finset.mem_map, Finset.mem_filter, memH, Equiv.coe_toEmbedding] at hx hxn + obtain ⟨w, ⟨hw, hv⟩, rfl⟩ := hx + have hnV : ¬ V (σ w) := fun h => hxn ⟨hσH w hw, h⟩ + have hm : σ (σ w) ≠ σ w := fun e => hnV (by have := σ.injective e; rw [this]; exact hv) + exact (F1 (σ w) (hσH w hw) hnV hm).1 + have F5 : ∀ x ∈ Vf, x ∉ Vs → β x = 0 := by + intro x hx hxn + simp only [hVs, hVf, Finset.mem_map, Finset.mem_filter, memH, Equiv.coe_toEmbedding] at hx hxn + have hnV : ¬ V (σ.symm x) := fun h => hxn ⟨σ.symm x, ⟨hσsH x hx.1, h⟩, by simp⟩ + have hm : σ (σ.symm x) ≠ σ.symm x := by + intro e + rw [Equiv.apply_symm_apply] at e + exact hnV (by rw [← e]; exact hx.2) + have := (F1 (σ.symm x) (hσsH x hx.1) hnV hm).2 + rwa [Equiv.apply_symm_apply] at this + have hmap : Vs.val.map β = Vf.val.map β := map_birth_eq β Vs Vf hcard F4 F5 + unfold pairsHead pairs + rw [split_map Hs.val V] + conv_rhs => rw [split_map Hs.val V] + congr 1 + · have e1 : (Hs.val.filter V).map (fun x => (β (σ x), ε x)) = Vf.val.map (fun x => (β (σ x), d)) := by + apply Multiset.map_congr rfl + intro x hx + have hx' : x ∈ Vf := hx + simp only [hVf, Finset.mem_filter, memH] at hx' + rw [(hE x hx'.1).2 hx'.2] + have e2 : (Hs.val.filter V).map (fun x => (β x, ε x)) = Vf.val.map (fun x => (β x, d)) := by + apply Multiset.map_congr rfl + intro x hx + have hx' : x ∈ Vf := hx + simp only [hVf, Finset.mem_filter, memH] at hx' + rw [(hE x hx'.1).2 hx'.2] + rw [e1, e2] + have h3 : Vf.val.map (fun x => (β (σ x), d)) = (Vs.val.map β).map (fun b => (b, d)) := by + rw [hVs, Finset.map_val, Multiset.map_map, Multiset.map_map]; rfl + have h4 : Vf.val.map (fun x => (β x, d)) = (Vf.val.map β).map (fun b => (b, d)) := by + rw [Multiset.map_map]; rfl + rw [h3, h4, hmap] + · have e' : (Hs.val.filter (fun x => ¬ V x)) = (Hs.filter (fun x => ¬ V x)).val := rfl + rw [e'] + apply Multiset.map_congr rfl + intro x hx + have hx' : x ∈ Hs.filter (fun x => ¬ V x) := hx + simp only [Finset.mem_filter, memH] at hx' + simp [F2 x hx'.1 hx'.2] + +/-! ### G2 ⇒ Π ⇒ F: the combined statement -/ + +theorem tail_Pi {H V G0 : Reg → Prop} [DecidablePred H] [DecidablePred V] + {F : Matrix Reg Reg K} (hF : HelpersId H F) (σ : Equiv.Perm Reg) (hσ : ∀ x, ¬ H x → σ x = x) + (hVH : ∀ x, V x → H x) (hE : ∀ x, H x → (ε x = d ↔ V x)) (hG : ∀ x, G0 x → β x = 0) + (hu : Undo (fun x => V (σ x)) G0 F (rowSw σ F)) : + PiOf (pairsTail β ε σ (Finset.univ.filter H)) = PiOf (pairs β ε (Finset.univ.filter H)) := by + rw [tail_pairs β ε d hF σ hσ hVH hE hG hu] + +theorem head_Pi {H V G1 : Reg → Prop} [DecidablePred H] [DecidablePred V] + {F : Matrix Reg Reg K} (hF : HelpersId H F) (σ : Equiv.Perm Reg) (hσ : ∀ x, ¬ H x → σ x = x) + (hVH : ∀ x, V x → H x) (hE : ∀ x, H x → (ε x = d ↔ V x)) (hG : ∀ x, G1 x → β (σ x) = 0) + (hu : Undo V G1 F (colSw σ F)) : + PiOf (pairsHead β ε σ (Finset.univ.filter H)) = PiOf (pairs β ε (Finset.univ.filter H)) := by + rw [head_pairs β ε d hF σ hσ hVH hE hG hu] + +/-- G2 + K: a hub-undoable pure tail relabel that keeps the step multiset S (SwapNull.stays_multiset) leaves +F(t), hence κ, unchanged. -/ +theorem tail_F_null {H V G0 : Reg → Prop} [DecidablePred H] [DecidablePred V] + {F : Matrix Reg Reg K} (hF : HelpersId H F) (σ : Equiv.Perm Reg) (hσ : ∀ x, ¬ H x → σ x = x) + (hVH : ∀ x, V x → H x) (hE : ∀ x, H x → (ε x = d ↔ V x)) (hG : ∀ x, G0 x → β x = 0) + (hu : Undo (fun x => V (σ x)) G0 F (rowSw σ F)) + (E : Inv) (tb : Table) (S : Multiset (ℕ × ℕ)) (t : ℝ) : + FK E tb S (PiOf (pairsTail β ε σ (Finset.univ.filter H))) t = + FK E tb S (PiOf (pairs β ε (Finset.univ.filter H))) t := by + rw [tail_Pi β ε d hF σ hσ hVH hE hG hu] + +theorem head_F_null {H V G1 : Reg → Prop} [DecidablePred H] [DecidablePred V] + {F : Matrix Reg Reg K} (hF : HelpersId H F) (σ : Equiv.Perm Reg) (hσ : ∀ x, ¬ H x → σ x = x) + (hVH : ∀ x, V x → H x) (hE : ∀ x, H x → (ε x = d ↔ V x)) (hG : ∀ x, G1 x → β (σ x) = 0) + (hu : Undo V G1 F (colSw σ F)) + (E : Inv) (tb : Table) (S : Multiset (ℕ × ℕ)) (t : ℝ) : + FK E tb S (PiOf (pairsHead β ε σ (Finset.univ.filter H))) t = + FK E tb S (PiOf (pairs β ε (Finset.univ.filter H))) t := by + rw [head_Pi β ε d hF σ hσ hVH hE hG hu] + +end Pairs + +/-! ### C3 (R1's 3-cycle) is NOT undoable once V' = σ⁻¹ V is used (Lean check of AUDIT2's observation) -/ +section C3 +open SwapNull + +/-- a = (5→9), b = (0→7), c = (0→9) on Fin 3; σ: a ↦ b, b ↦ c, c ↦ a. -/ +def c3β : Fin 3 → ℕ := ![5, 0, 0] +def c3ε : Fin 3 → ℕ := ![9, 7, 9] +def c3σ : Equiv.Perm (Fin 3) := Equiv.swap 0 1 * Equiv.swap 1 2 + +theorem c3σ_apply : c3σ 0 = 1 ∧ c3σ 1 = 2 ∧ c3σ 2 = 0 := by decide + +/-- the pair multiset changes (Π {4,7,9} → {2,9,9} in R1's words) -/ +theorem c3_pairs_change : + pairsTail c3β c3ε c3σ Finset.univ ≠ pairs c3β c3ε Finset.univ := by decide + +theorem c3_not_undoable (G0 : Fin 3 → Prop) (hG : ∀ x, G0 x → c3β x = 0) : + ¬ Undo (fun x => (c3ε (c3σ x) = 9 : Prop)) G0 (1 : Matrix (Fin 3) (Fin 3) ℚ) + (rowSw c3σ 1) := by + intro hu + have := tail_pairs (K := ℚ) (H := fun _ => True) (V := fun x => c3ε x = 9) c3β c3ε 9 + (F := 1) (fun _ _ _ => rfl) c3σ (fun x hx => absurd trivial hx) (fun _ _ => trivial) + (fun x _ => Iff.rfl) hG hu + have h2 : (Finset.univ.filter (fun _ : Fin 3 => True)) = (Finset.univ : Finset (Fin 3)) := by simp + rw [h2] at this + exact c3_pairs_change this +end C3 + +#print axioms K_word +#print axioms K_congr +#print axioms K_invoice +#print axioms kappa_depends_only +#print axioms d0_native +#print axioms tail_force +#print axioms head_force +#print axioms tail_pairs +#print axioms head_pairs +#print axioms tail_F_null +#print axioms head_F_null +#print axioms c3_not_undoable + +end G2 + +end FibreK diff --git a/research/p104-tree-ceiling/lean/Nov15/FibreK.md b/research/p104-tree-ceiling/lean/Nov15/FibreK.md new file mode 100644 index 0000000000..eaeb3e7e8e --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/FibreK.md @@ -0,0 +1,51 @@ +# FibreK (Nov 17): Theorem K and G2 for pure relabels, in Lean + +`Nov15/FibreK.lean`, Lean 4.33.0-rc1 + Mathlib, kernel only: no `sorry`, no `native_decide`; every theorem prints +`[propext, Classical.choice, Quot.sound]`. Builds in 10 s / 2.9 GB (runlean.sh guard). Reuses `SwapNull` (Blk, Undo, rowSw, +colSw; olean built into .lake/build/lib/lean/Nov15) and `CallerCost` (Hist, Inv, invoice, Dh/Dinv). + +## 1. THEOREM K (AUDIT2: sound with fixes) +P0 is an explicit hypothesis: `Table {tT tP : ℕ → Hist}` = the ranks a helper pays on T for climb d = e - b and on P for a +helper MOVE of |Δdim| = d (the price checker's per-call ranks; AUDIT2 could not find the README in the tree, so the table is a parameter, +not a quoted constant). A word is `E : Inv` (fixed by the ends) plus helpers `{b, e, steps}`. +* `K_word`: `Fi (nativeInv E tb H) t = FK E tb (Ssum H) (PiW H) t`, i.e. F(t) = Σ_r (T_r − P_r) r^(1−t) is a function of + (E, S = multiset of helper MOVEs (src dim, tgt dim), Π = multiset {e_h − b_h}). Births/ends enter only through Π; ADD/SCALE/SWAP + appear nowhere (they are not in the table). +* `K_congr`, `kappa_depends_only`: same (E, S, Π) ⇒ same F, same roots, also for the caller invoice + `K_invoice : Fi (invoice c n L) t = Fi c t + L · FK E tb S Π t` (CallerCost.invoice). +* `d0_native`: for `d0Table` (ranks = gaps) the helper part is Σ_h [f(e−b) − Σ_steps f(gap)] (the per-helper D0 identity of + FloorD0/V2Bridge, f = r ln r, Dh convention). +Remark: the dependence on S is only through the multiset of GAPS |Δdim|; the source dim itself is not priced. + +## 2. G2 for PURE relabels (AUDIT2: sound with fixes) +Model: registers `Reg` (Fintype), final matrix `F : Matrix Reg Reg K`; `HelpersId H F` = every helper's final row is its own unit +vector; hub gauge = `Undo V G F F'` := ∃ L M, Blk V L ∧ Blk G M ∧ L·F'·M = F (SwapNull; invertibility NOT demanded, which only +strengthens the conclusions). σ permutes helpers only (`σ x = x` off H). β, ε : birth/end dims; V ⊆ H = the helpers with ε = d +(one chart, `hE : ε x = d ↔ V x`). +* `tail_force`: F' = rowSw σ F (SwapNull.tail_run), L ∈ Blk(V′), M ∈ Blk(G0) ⇒ every moved helper x ∉ V′ has x, σ x ∈ G0. +* `tail_pairs`: with G0 ⊆ {β = 0} and **V′ = σ⁻¹ V** (`fun x => V (σ x)`), the (birth,end) multiset {(β x, ε (σ x))} equals + {(β x, ε x)}. Proof: σ carries H∖V′ onto H∖V keeping β (moved ⇒ both birth 0); V′∖V and V∖V′ are birth-0 and |V′| = |V| + (`map_birth_eq`). +* `head_force`, `head_pairs`, DIRECT (not by time reversal): F' = colSw σ F (SwapNull.head_run), L ∈ Blk(V) (V unchanged), M ∈ Blk(G1) + where **G1 is the NEW births-at-0 set** (`G1 x → β (σ x) = 0`); moved x ∉ V ⇒ σ⁻¹x, x ∈ G1 ⇒ β x = β (σ x) = 0. Pair multiset + {(β (σ x), ε x)} = {(β x, ε x)}. This is the head analogue of V′ = σ⁻¹V (the time-reversal image of "prefix ↔ V"); using the + native G0 here is the head-side form of R1's slip. +* `tail_Pi`, `head_Pi`: Π unchanged. `tail_F_null`, `head_F_null`: FK (hence F(t), hence κ by K) unchanged, for any S, E, tb. S + being unchanged by a swap is SwapNull.stays_multiset (not re-proved; the theorem takes S as the common argument). +* `c3_not_undoable`: Lean check of AUDIT2's observation. R1's 3-cycle C3 (a=(5→9), b=(0→7), c=(0→9), σ: a→b→c→a, identity F) + is NOT undoable under V′ = σ⁻¹V for any G0 ⊆ {β=0}: its pair multiset changes (`c3_pairs_change`), which `tail_pairs` forbids + for undoable relabels. (Undoable only under the native V = the retracted slip.) + +No paper statement was found false as written. Corrections to the wording: (i) heads need the NEW G0 (G1 above), "same proof under +time reversal" is right only with that substitution; (ii) K needs P0 as a stated table; (iii) G2 conclusions about κ also need +S unchanged (SwapNull.stays_multiset), which is a separate hypothesis here. + +## 3. NOT covered +* relabel + interior gauge D(t) jointly (D(end) ≠ I on helper rows; AUDIT2 item 2/4): the model has D = I, F' = P_σ F exactly. +* the LOOP claim (THEORY2 §2 "interiors differ by a time-slice gauge, κ-null"): UNSOUND as stated (D(t) = U′U⁻¹ exists for any two + circuits; legality of D(t+1) T D(t)⁻¹ and D(end) = I are the content). Not formalised; only the true restatement + "same skeleton ⇒ κ-null" follows from K_word (S and Π fixed). +* "native = max over fibre": NOT established (needs the joint case above, theorem R with the real the price checker concavity, and S that + includes END charts for D helpers). R (re-pairing monotonicity), G1-tree, T (cover lemma), U in full generality are not formalised. +* mixed head+tail sequences (only each pure case); multi-chart V ends; helpers not ending identity. +* The real the price checker table values are not instantiated (`Table` is abstract; `d0Table` is the D0 convention). diff --git a/research/p104-tree-ceiling/lean/Nov15/FrameSep.lean b/research/p104-tree-ceiling/lean/Nov15/FrameSep.lean new file mode 100644 index 0000000000..abf460717d --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/FrameSep.lean @@ -0,0 +1,165 @@ +/- +SPEC7/SPEC8 frame-separation law, See FrameSep.md. +Source: internal notes (sec 2, 4), SPEC8.md (sec 2, 4). +Abstract model: frames = submodules of V; a route is a time-indexed frame sequence whose +non-owned (public) steps ascend by inclusion; owned steps are arbitrary. +-/ +import Mathlib.LinearAlgebra.Span.Basic +import Mathlib.Algebra.Field.Rat +import Mathlib.Data.Rat.Defs + +namespace FrameSep + +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] + +/-- A register's frame history; `owned t` marks step t -> t+1 as an owned MOVE. -/ +structure Route (K V : Type*) [Field K] [AddCommGroup V] [Module K V] where + f : ℕ → Submodule K V + owned : ℕ → Prop + pub : ∀ t, ¬ owned t → f t ≤ f (t + 1) + +namespace Route +variable (R : Route K V) + +/-- public stretch: no owned step in [a,b) -/ +def Pub (a b : ℕ) : Prop := ∀ s, a ≤ s → s < b → ¬ R.owned s + +theorem pub_mono {a b : ℕ} (hab : a ≤ b) (h : R.Pub a b) : R.f a ≤ R.f b := by + induction b, hab using Nat.le_induction with + | base => exact le_rfl + | succ b hb ih => + exact (ih fun s h1 h2 => h s h1 (by omega)).trans (R.pub b (h b hb (by omega))) + +theorem persist {u : V} {a b : ℕ} (hab : a ≤ b) (h : R.Pub a b) (hu : u ∈ R.f a) : + u ∈ R.f b := R.pub_mono hab h hu + +/-- First-exit law: leaving a u-containing frame needs an OWNED step that genuinely drops u. -/ +theorem exit_owned {u : V} {a b : ℕ} (hab : a ≤ b) (hu : u ∈ R.f a) (hb : u ∉ R.f b) : + ∃ s, a ≤ s ∧ s < b ∧ R.owned s ∧ u ∈ R.f s ∧ u ∉ R.f (s + 1) := by + induction b, hab using Nat.le_induction with + | base => exact absurd hu hb + | succ b hb' ih => + by_cases hb0 : u ∈ R.f b + · refine ⟨b, hb', by omega, ?_, hb0, hb⟩ + by_contra hno + exact hb (R.pub b hno hb0) + · obtain ⟨s, h1, h2, h3, h4, h5⟩ := ih hb0 + exact ⟨s, h1, by omega, h3, h4, h5⟩ + +/-- A route is public if it has no owned steps. -/ +def IsPublic : Prop := ∀ t, ¬ R.owned t + +theorem IsPublic.mono {R : Route K V} (h : R.IsPublic) {a b : ℕ} (hab : a ≤ b) : + R.f a ≤ R.f b := R.pub_mono hab fun s _ _ => h s + +theorem IsPublic.persist {R : Route K V} (h : R.IsPublic) {u : V} {a b : ℕ} (hab : a ≤ b) + (hu : u ∈ R.f a) : u ∈ R.f b := h.mono hab hu + +end Route + +/-- SPEC7 core: X contains u at the start of a public route, Y's frames lie in W with u ∉ W. + Then X's frames never equal Y's frames. -/ +theorem X_Y_never_share (X Y : Route K V) (u : V) (W : Submodule K V) (hu : u ∉ W) + (hX : X.IsPublic) (hX0 : u ∈ X.f 0) (hY : ∀ t, Y.f t ≤ W) (s t : ℕ) : + X.f s ≠ Y.f t := by + intro h + exact hu (hY t (h ▸ hX.persist (Nat.zero_le s) hX0)) + +/-- Any public register that has read X_a (co-present at X's frame, X's frame containing u) + at time t0 never again shares a frame with Y at any time t ≥ t0. -/ +theorem reader_never_meets_Y_after (X Y P : Route K V) (u : V) (W : Submodule K V) + (hu : u ∉ W) (hX : X.IsPublic) (hX0 : u ∈ X.f 0) (hP : P.IsPublic) + (hY : ∀ t, Y.f t ≤ W) {s t0 : ℕ} (hread : P.f t0 = X.f s) {t t' : ℕ} (htt : t0 ≤ t) : + P.f t ≠ Y.f t' := by + intro h + have h1 : u ∈ P.f t0 := hread ▸ hX.persist (Nat.zero_le s) hX0 + exact hu (hY t' (h ▸ hP.persist htt h1)) + +/-- Scope: "ever reads X_a ⇒ never meets Y_a" needs "afterwards"; a public helper may meet Y + before it reads X. Concrete counterexample over ℚ×ℚ. -/ +theorem meet_before_read_possible : + ∃ (X Y P : Route ℚ (ℚ × ℚ)) (u : ℚ × ℚ) (W : Submodule ℚ (ℚ × ℚ)), + u ∉ W ∧ X.IsPublic ∧ u ∈ X.f 0 ∧ P.IsPublic ∧ (∀ t, Y.f t ≤ W) ∧ + P.f 1 = X.f 1 ∧ P.f 0 = Y.f 0 := by + let W : Submodule ℚ (ℚ × ℚ) := Submodule.span ℚ {((0 : ℚ), (1 : ℚ))} + refine ⟨⟨fun _ => ⊤, fun _ => False, fun _ _ => le_rfl⟩, + ⟨fun _ => W, fun _ => False, fun _ _ => le_rfl⟩, + ⟨fun t => if t = 0 then W else ⊤, fun _ => False, ?_⟩, (1, 0), W, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · intro t _ + by_cases h : t = 0 + · subst h; simp + · simp [h] + · intro h + obtain ⟨a, ha⟩ := Submodule.mem_span_singleton.mp h + have := congrArg Prod.fst ha + simp at this + · intro t h; exact h + · trivial + · intro t h; exact h + · intro t; exact le_rfl + · simp + · simp + +/-- Entry law: content (u) in a register's history, then a u-free frame at time t: + an owned step dropped it. With all owned destinations in D and F = frame(t) ∉ D, + the register took an owned MOVE to a landing frame d ∈ D and then ASCENDED + publicly (d < F strictly) before reaching F. -/ +theorem owned_landing_then_ascent (R : Route K V) (D : Set (Submodule K V)) (u : V) + (hD : ∀ s, R.owned s → R.f (s + 1) ∈ D) {a t : ℕ} (hat : a ≤ t) (hu : u ∈ R.f a) + (hF : u ∉ R.f t) (hFD : R.f t ∉ D) : + ∃ s, a ≤ s ∧ s < t ∧ R.owned s ∧ R.f (s + 1) ∈ D ∧ R.f (s + 1) < R.f t := by + -- last owned step before t + have key : ∀ t, a ≤ t → R.Pub a t ∨ + ∃ s, a ≤ s ∧ s < t ∧ R.owned s ∧ R.f (s + 1) ≤ R.f t := by + intro t hat + induction t, hat using Nat.le_induction with + | base => exact Or.inl fun s h1 h2 => by omega + | succ t ht ih => + by_cases ho : R.owned t + · exact Or.inr ⟨t, ht, by omega, ho, le_rfl⟩ + · rcases ih with h | ⟨s, h1, h2, h3, h4⟩ + · left + intro s h1 h2 + by_cases hs : s = t + · subst hs; exact ho + · exact h s h1 (by omega) + · exact Or.inr ⟨s, h1, by omega, h3, h4.trans (R.pub t ho)⟩ + rcases key t hat with h | ⟨s, h1, h2, h3, h4⟩ + · exact absurd (R.persist hat h hu) hF + · refine ⟨s, h1, h2, h3, hD s h3, lt_of_le_of_ne h4 ?_⟩ + intro heq + exact hFD (heq ▸ hD s h3) + +/-- SPEC8 corollary: a u-holding register sitting in Y's final frame F (u-free since F ≤ W, + u ∉ W) with F ∉ D has landed by an owned MOVE in D and climbed publicly strictly above + the landing frame: it is a ferrying register, not an owned register at a landing frame. -/ +theorem delivery_needs_ferry (R : Route K V) (D : Set (Submodule K V)) (u : V) + (W F : Submodule K V) (hu : u ∉ W) (hFW : F ≤ W) (hFD : F ∉ D) + (hD : ∀ s, R.owned s → R.f (s + 1) ∈ D) {a t : ℕ} (hat : a ≤ t) (hua : u ∈ R.f a) + (hFt : R.f t = F) : + ∃ s, a ≤ s ∧ s < t ∧ R.owned s ∧ R.f (s + 1) ∈ D ∧ R.f (s + 1) < F := by + have hF : u ∉ R.f t := fun h => hu (hFW (hFt ▸ h)) + obtain ⟨s, h1, h2, h3, h4, h5⟩ := + owned_landing_then_ascent R D u hD hat hua hF (hFt ▸ hFD) + exact ⟨s, h1, h2, h3, h4, hFt ▸ h5⟩ + +/-- Consequently no owned destination (a fixed set D) equals a delivered frame: + strict ascent means the delivering register took at least one public step after its + owned landing (landing frame ≠ F). -/ +theorem landing_ne_final (R : Route K V) (D : Set (Submodule K V)) (u : V) + (W F : Submodule K V) (hu : u ∉ W) (hFW : F ≤ W) (hFD : F ∉ D) + (hD : ∀ s, R.owned s → R.f (s + 1) ∈ D) {a t : ℕ} (hat : a ≤ t) (hua : u ∈ R.f a) + (hFt : R.f t = F) : + ∃ s, s < t ∧ R.owned s ∧ R.f (s + 1) ≠ F := by + obtain ⟨s, -, h2, h3, -, h5⟩ := delivery_needs_ferry R D u W F hu hFW hFD hD hat hua hFt + exact ⟨s, h2, h3, h5.ne⟩ + +end FrameSep + +#print axioms FrameSep.X_Y_never_share +#print axioms FrameSep.reader_never_meets_Y_after +#print axioms FrameSep.meet_before_read_possible +#print axioms FrameSep.Route.exit_owned +#print axioms FrameSep.owned_landing_then_ascent +#print axioms FrameSep.delivery_needs_ferry +#print axioms FrameSep.landing_ne_final diff --git a/research/p104-tree-ceiling/lean/Nov15/FrameSep.md b/research/p104-tree-ceiling/lean/Nov15/FrameSep.md new file mode 100644 index 0000000000..16dbbd840e --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/FrameSep.md @@ -0,0 +1,13 @@ +# FrameSep.lean: SPEC7 frame-separation law + SPEC8 corollary +Kernel-only, no sorry/native_decide, ~3 s / 1.5 GB, imports Mathlib only (does not need TokenCancel/TCLemma/W0Cancel: the law is purely about frames). Axioms [propext, Classical.choice, Quot.sound] (two theorems: [propext, Quot.sound]). + +**Model.** Frames = submodules of V. `Route`: frame sequence f, flag `owned t` for step t->t+1; non-owned (public) steps satisfy f t <= f (t+1); owned steps arbitrary. "Holds x_a content" = frame contains u_a. + +**Theorems.** +- `Route.exit_owned`: u in f a, u not in f b (a<=b) => an OWNED step s with u in f s, u not in f (s+1). (public routes never drop u.) +- `X_Y_never_share`: X public with u in f 0, Y frames <= W, u not in W => X.f s != Y.f t for all s,t (SPEC7 core; "below V" is automatic since W != V). +- `reader_never_meets_Y_after`: public P co-present with X at t0 => P.f t != Y.f t' for all t >= t0. +- `owned_landing_then_ascent`, `delivery_needs_ferry`, `landing_ne_final` (SPEC8): all owned MOVE destinations in D, F = Y's final frame (F <= W), F not in D, a register that ever held u sits in F at t => it took an owned MOVE to some d in D and climbed publicly with d < F strictly, i.e. it is a ferrying register, never an owned register at its landing frame. + +**Scope / correction (stated at once).** SPEC7's "any public that ever reads X_a can never meet Y_a" is true only AFTER the read (its parenthetical "later frames contain u_a"). `meet_before_read_possible` (over Q x Q): a public helper has frame W = Y's frame at time 0, then reads X at time 1. The paper statement is not false (it says later), but the unqualified reading is; use the `_after` form. +Modelling limits: content is tracked by "frame contained u" along one register's history (direct holders; multi-hop taint through u-free registers not modelled); owned steps are assumed to land in D (every owned step is a MOVE with destination in D); CLEAR of content is not modelled. diff --git a/research/p104-tree-ceiling/lean/Nov15/JointCeiling.lean b/research/p104-tree-ceiling/lean/Nov15/JointCeiling.lean new file mode 100644 index 0000000000..4989827790 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/JointCeiling.lean @@ -0,0 +1,809 @@ +/- +JOINT-CEILING (; CORRECTED by , Nov 17 per CALLERFLOOR R2 + AUDIT2: arms of 1 repriced). Formalises the AUDITED structure of CALLERFLOOR R1 (internal notes + AUDIT1.md) +on top of Nov15/CallerCost.lean. Kernel only (no sorry, no native_decide; `decide +kernel` is kernel evaluation, no extra axiom). +F(s) = sum (T-P) r^s, s = 1-t (so F = the R1 "F(t)" = sum (T-P) r^(1-t)). + 1. invoice F = caller F + k * native F for ALL s (invoice_F, same proof as D0). + 2. native floor Nfl(s) = 400*8^s + 16 + 88*(2-2^s): the exact F of the floor histogram (natFloor_F); the bound F_nat <= -Nfl is a HYPOTHESIS (hN). + 3. class lemmas as HYPOTHESES (structure InClass): B-form per-split optimality pointwise in F, sign floor th >= 4 (or 3), two arms (rho = 2). + 4. closed form FB a b th (all a,b >= 1) with bridge to CallerCost.caller for a,b >= 2 (FB_eq). + 5. ceiling theorem, REDUCED to the named numeric hypothesis NumCert th tbar (finite list of rational inequalities, tail.py). + 6. kernel-checked numerics: split 2|2 at t >= 141/4096, the CORRECTED argmax split 1|1 at t >= 176/4096 (36 rational cells), and the control C(8|9): root of the invoice F in (.0204,.0205). + CORRECTION (R2/AUDIT2): R1's FB overcharged every arm of length 1 by 208 one-stage lines (P[8]) -- FBc below adds 208*8^s per arm of 1; + the old .0336 ceiling (and the NumCert built from cf.py) is WITHDRAWN; the certified ceiling is kappa <= .0419448764 (A = 4 QUERY, B-form masks, peak 1|1). +-/ +import Nov15.CallerCost +import Mathlib.Analysis.SpecialFunctions.Pow.Real + +namespace JointCeiling +open CallerCost Real + +/-! ### 1. F-form of the invoice -/ +noncomputable def Fh (s : ℝ) (l : Hist) : ℝ := (l.map fun p => (p.2 : ℝ) * (p.1 : ℝ) ^ s).sum +noncomputable def Finv (s : ℝ) (i : Inv) : ℝ := Fh s i.T - Fh s i.P + +theorem Fh_append (s : ℝ) (l m : Hist) : Fh s (l ++ m) = Fh s l + Fh s m := by simp [Fh] +theorem Fh_scale (s : ℝ) (L : ℕ) (l : Hist) : Fh s (scale L l) = L * Fh s l := by + induction l with + | nil => simp [Fh, scale] + | cons p l ih => + simp only [Fh, scale, List.map_cons, List.sum_cons] at ih ⊢ + rw [ih]; push_cast; ring + +/-- the invoice in kappa form: F = caller part + k * native part, for every s (hence every t = 1 - s) -/ +theorem invoice_F (s : ℝ) (c n : Inv) (L : ℕ) : Finv s (invoice c n L) = Finv s c + L * Finv s n := by + simp only [Finv, invoice, Fh_append, Fh_scale]; ring + +theorem Fh_mono (l : Hist) (hl : ∀ p ∈ l, 1 ≤ p.1) {s s' : ℝ} (h : s ≤ s') : Fh s l ≤ Fh s' l := by + induction l with + | nil => simp [Fh] + | cons p l ih => + have ih' := ih (fun q hq => hl q (by simp [hq])) + have hp : (1 : ℝ) ≤ p.1 := by exact_mod_cast hl p (by simp) + simp only [Fh, List.map_cons, List.sum_cons] at ih' ⊢ + have := Real.rpow_le_rpow_of_exponent_le hp h + have h2 : (p.2 : ℝ) * (p.1 : ℝ) ^ s ≤ (p.2 : ℝ) * (p.1 : ℝ) ^ s' := + mul_le_mul_of_nonneg_left this (Nat.cast_nonneg _) + linarith + +/-! ### 2. native floor -/ +noncomputable def Nfl (s : ℝ) : ℝ := 400 * (8 : ℝ) ^ s + 16 + 88 * (2 - (2 : ℝ) ^ s) +/-- the per-call native floor histogram: 88 stops priced T[2]-2P[1], 400 rank-8 mains, 16 owned (rank 1) + 176 stop credits -/ +def natFloor : Inv := ⟨[(2, 88)], [(8, 400), (1, 192)]⟩ +theorem natFloor_F (s : ℝ) : Finv s natFloor = -Nfl s := by + simp [Finv, natFloor, Fh, Nfl]; ring + +/-! ### 3. closed form of the caller family, all a,b >= 1 -/ +noncomputable def FB (a b th : ℕ) (s : ℝ) : ℝ := + 208 * (∑ i ∈ Finset.range a, ((8 * i + 9 : ℕ) : ℝ) ^ s + ∑ i ∈ Finset.range b, ((8 * i + 9 : ℕ) : ℝ) ^ s + + ((8 * (a + b) + 1 : ℕ) : ℝ) ^ s) + - 208 * (∑ i ∈ Finset.range (a - 2), ((8 * i + 16 : ℕ) : ℝ) ^ s + ∑ i ∈ Finset.range (b - 2), ((8 * i + 16 : ℕ) : ℝ) ^ s) + - (384 + 16 * ((a + b : ℕ) : ℝ)) * (8 : ℝ) ^ s - 96 * th - 32 * (9 : ℝ) ^ s + +theorem Fh_armT (s : ℝ) (n c : ℕ) : + Fh s (armT n c) = c * ∑ i ∈ Finset.range n, ((8 * i + 9 : ℕ) : ℝ) ^ s := by + induction n with + | zero => simp [armT, Fh] + | succ n ih => + have : armT (n + 1) c = armT n c ++ [(8 * n + 9, c)] := by simp [armT, List.range_succ] + rw [this, Fh_append, ih, Finset.sum_range_succ]; simp [Fh]; ring +theorem Fh_armP (s : ℝ) (m c : ℕ) : + Fh s (armP m c) = c * ∑ i ∈ Finset.range m, ((8 * i + 16 : ℕ) : ℝ) ^ s := by + induction m with + | zero => simp [armP, Fh] + | succ n ih => + have : armP (n + 1) c = armP n c ++ [(8 * n + 16, c)] := by simp [armP, List.range_succ] + rw [this, Fh_append, ih, Finset.sum_range_succ]; simp [Fh]; ring + +/-- bridge: CallerCost's histogram caller (a' + 2 | b' + 2), thin 4, has F = FB (a'+2) (b'+2) 4 -/ +theorem FB_eq (s : ℝ) (a' b' : ℕ) : Finv s (caller a' b') = FB (a' + 2) (b' + 2) 4 s := by + have hk : a' + 2 + (b' + 2) = a' + b' + 4 := by ring + simp only [Finv, caller, callerT, callerP, Fh_append, Fh_armT, Fh_armP, FB, hk] + simp [Fh] + ring + +theorem FB_th_mono (a b : ℕ) {th th0 : ℕ} (h : th0 ≤ th) (s : ℝ) : FB a b th s ≤ FB a b th0 s := by + unfold FB + have : (th0 : ℝ) ≤ th := by exact_mod_cast h + linarith + +/-! ### 3b. CORRECTION (R2/AUDIT2): arms of length 1. + cf.py / CALLERCO s1h priced every arm of 1 with 208 spurious one-stage lines (P[8]); the ledger-correct caller (r2.py port model) + has the same histograms except P[8] is lowered by 208 per arm of 1. FBc = FB + 208 * 8^s per arm of 1; for a,b >= 2 FBc = FB. -/ +def ind (x : ℕ) : ℕ := if x = 1 then 1 else 0 +noncomputable def FBc (a b th : ℕ) (s : ℝ) : ℝ := FB a b th s + 208 * ((ind a + ind b : ℕ) : ℝ) * (8 : ℝ) ^ s + +theorem FBc_two (a b th : ℕ) (s : ℝ) (ha : 2 ≤ a) (hb : 2 ≤ b) : FBc a b th s = FB a b th s := by + have h1 : ind a = 0 := by unfold ind; split_ifs <;> omega + have h2 : ind b = 0 := by unfold ind; split_ifs <;> omega + simp [FBc, h1, h2] + +theorem FBc_th_mono (a b : ℕ) {th th0 : ℕ} (h : th0 ≤ th) (s : ℝ) : FBc a b th s ≤ FBc a b th0 s := by + unfold FBc + have := FB_th_mono a b h s + linarith + +/-- the corrected caller histograms (a, b >= 1; thin queries th): arms as in CallerCost, P[8] = 384 + 16 (a+b) - 208 (#arms of 1) -/ +def callerG (a b th : ℕ) : Inv := + ⟨armT a 208 ++ armT b 208 ++ [(8 * (a + b) + 1, 208)], + armP (a - 2) 208 ++ armP (b - 2) 208 ++ [(8, 384 + 16 * (a + b) - 208 * (ind a + ind b)), (1, 96 * th), (9, 32)]⟩ + +theorem ind_le (a b : ℕ) (ha : 1 ≤ a) (hb : 1 ≤ b) : 208 * (ind a + ind b) ≤ 384 + 16 * (a + b) := by + unfold ind; split_ifs <;> omega + +theorem callerG_F (a b th : ℕ) (ha : 1 ≤ a) (hb : 1 ≤ b) (s : ℝ) : Finv s (callerG a b th) = FBc a b th s := by + have hle := ind_le a b ha hb + have hc : (((384 + 16 * (a + b) - 208 * (ind a + ind b) : ℕ)) : ℝ) = 384 + 16 * ((a + b : ℕ) : ℝ) - 208 * ((ind a + ind b : ℕ) : ℝ) := by + rw [Nat.cast_sub hle]; push_cast; ring + simp only [Finv, callerG, Fh_append, Fh_armT, Fh_armP, FBc, FB] + simp [Fh, hc] + push_cast + ring + +/-- for a, b >= 2 the corrected caller has the same F as CallerCost.caller (so reproduction of #7113 is unaffected) -/ +theorem callerG_eq_caller_F (a' b' : ℕ) (s : ℝ) : Finv s (callerG (a' + 2) (b' + 2) 4) = Finv s (caller a' b') := by + rw [callerG_F _ _ _ (by omega) (by omega), FBc_two _ _ _ _ (by omega) (by omega), FB_eq] + +/-- LEDGER LAW for ALL arms >= 1: S(callerG) = 3408 (a+b) - 208 (+ 96 (4 - th)); at a,b >= 2 this is CallerCost.S_caller. + (cf.py's version gave 3408 (a+b) - 208 - 1664 per arm of 1: the broken ledger.) -/ +theorem Sh_armP' (x : ℕ) (hx : 1 ≤ x) : + Sh (armP (x - 2) 208) = 208 * (4 * ((x : ℤ) - 2) * ((x : ℤ) - 2) + 12 * ((x : ℤ) - 2)) + 1664 * (ind x : ℤ) := by + rw [Sh_armP] + rcases Nat.lt_or_ge x 2 with h | h + · have : x = 1 := by omega + subst this; simp [ind] + · have h1 : ((x - 2 : ℕ) : ℤ) = (x : ℤ) - 2 := by omega + have h2 : ind x = 0 := by unfold ind; split_ifs <;> omega + rw [h1, h2]; simp + +theorem callerG_S (a b : ℕ) (ha : 1 ≤ a) (hb : 1 ≤ b) : + Sinv (callerG a b 4) = 3408 * ((a : ℤ) + b) - 208 := by + have hle := ind_le a b ha hb + have hc : (((384 + 16 * (a + b) - 208 * (ind a + ind b) : ℕ)) : ℤ) = 384 + 16 * ((a + b : ℕ) : ℤ) - 208 * ((ind a + ind b : ℕ) : ℤ) := by + rw [Nat.cast_sub hle]; push_cast; ring + simp only [Sinv, callerG, Sh_append, Sh_armT, Sh_armP' a ha, Sh_armP' b hb] + simp only [Sh, List.map_cons, List.sum_cons, List.map_nil, List.sum_nil] + rw [hc] + push_cast + ring + +/-! ### 4. class lemmas as explicit hypotheses -/ +/-- A caller in the audited class (CALLERFLOOR R1 sec 1): two-arm nested rho = 2 root with arms a|b >= 1 (k = a+b calls), + thin queries th. The CLASS LEMMAS are fields (hypotheses; a parallel lane proves them): + hB : B-form per-split optimality, pointwise in F(t) (CALLEROPEN Crossing + Floor lemmas; AUDIT1 item 1: only the D0/ratio form is proved); + hth : sign floor thin >= th0 (SIGNCAP/BEAUTY84; th0 = 4 built, 3 unbuilt); + hrho: rho >= 2 (rho = 1 needs t = -1, closed). rho = 2 enters only through the shape of FB (the two-arm closed form). -/ +structure InClass (th0 : ℕ) where + a : ℕ + b : ℕ + th : ℕ + rho : ℕ + ci : Inv + ha : 1 ≤ a + hb : 1 ≤ b + hth : th0 ≤ th + hrho : 2 ≤ rho + hB : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s ci ≤ FBc a b th s + + +/-- the NUMERIC CERTIFICATE as a named hypothesis (REGENERATED, , from the AUDITED r2c.py; R1's cf.py-based list is withdrawn). + Statement: for every split a|b (a,b>=1) and 0 <= s <= 1-tbar, FBc a b th0 s - (a+b) Nfl s < 0. + Source: internal notes (lines 8-12: 1|1 root via cf.cert on the ledger-correct port model, th = th0; lines 13-17: 1|b, b = 2..59, + interval cover on [t0, 1] with pk._coef of joint(A(1,b), B(1,b), 1+b); lines 18-26: tail k >= 61 with R1's U plus the arm-of-1 correction + +208*8^s, U < 0 and U' < 0 by cover) together with a,b >= 2 splits from R1 tail.py lines 6-26 / cf.py `cert` lines 33-40 (unchanged: FBc = FB there, + FBc_two + callerG_eq_caller_F; r2.py asserts identity with the port model). Output r2c.out (th4: kbar .041944876391, cert True, 1|b True, tail True; + th3: .068120327915). Not discharged in Lean: ~1,800 (a,b) pairs of 40-digit interval covers, plus the R1 tail Jensen/MVT step (AUDIT2: unaudited). + tbar = .0419448764 (th0 = 4, rounded UP from .041944876391; A = 4 QUERY, B-form masks) and .0681203280 (th0 = 3: th3 B-form-A class only; + AUDIT2: scanned, not covered, for the true sign-floor class). -/ +def NumCert (th0 : ℕ) (tbar : ℝ) : Prop := + ∀ a b : ℕ, 1 ≤ a → 1 ≤ b → ∀ s : ℝ, 0 ≤ s → s ≤ 1 - tbar → FBc a b th0 s - ((a + b : ℕ) : ℝ) * Nfl s < 0 + +noncomputable def tbar4 : ℝ := 419448764 / 10 ^ 10 +noncomputable def tbar3 : ℝ := 681203280 / 10 ^ 10 + +/-- CEILING THEOREM (conditional on the class lemmas hB/hth/hrho, the native floor hN, and NumCert): + for every caller in the class and every native meeting the floor, the invoice F(t) = Finv (1-t) is < 0 for t >= tbar. -/ +theorem ceiling {th0 : ℕ} {tbar : ℝ} (hnum : NumCert th0 tbar) (c : InClass th0) (n : Inv) + (hN : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s n ≤ -Nfl s) (htb : 0 ≤ tbar) + (s : ℝ) (hs0 : 0 ≤ s) (hs : s ≤ 1 - tbar) : + Finv s (invoice c.ci n (c.a + c.b)) < 0 := by + have hs1 : s ≤ 1 := by linarith + rw [invoice_F] + have h1 := c.hB s hs0 hs1 + have h2 := hN s hs0 hs1 + have h3 : ((c.a + c.b : ℕ) : ℝ) * Finv s n ≤ ((c.a + c.b : ℕ) : ℝ) * (-Nfl s) := + mul_le_mul_of_nonneg_left h2 (Nat.cast_nonneg _) + have h4 := FBc_th_mono c.a c.b c.hth s + have h5 := hnum c.a c.b c.ha c.hb s hs0 hs + linarith + +theorem ceiling4 (hnum : NumCert 4 tbar4) (c : InClass 4) (n : Inv) + (hN : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s n ≤ -Nfl s) (t : ℝ) (ht : tbar4 ≤ t) (ht1 : t ≤ 1) : + Finv (1 - t) (invoice c.ci n (c.a + c.b)) < 0 := + ceiling hnum c n hN (by unfold tbar4; norm_num) (1 - t) (by linarith) (by linarith) + +theorem ceiling3 (hnum : NumCert 3 tbar3) (c : InClass 3) (n : Inv) + (hN : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s n ≤ -Nfl s) (t : ℝ) (ht : tbar3 ≤ t) (ht1 : t ≤ 1) : + Finv (1 - t) (invoice c.ci n (c.a + c.b)) < 0 := + ceiling hnum c n hN (by unfold tbar3; norm_num) (1 - t) (by linarith) (by linarith) + + +/-! ### 5. kernel-checked numerics: rational rpow bounds through natural-number powers -/ +theorem rp_pow {x : ℕ} {p q : ℕ} (hq : 0 < q) : (((x : ℝ) ^ ((p : ℝ) / q)) ^ q) = (x : ℝ) ^ p := by + rw [← Real.rpow_natCast, ← Real.rpow_mul (Nat.cast_nonneg x), div_mul_cancel₀ _ (by exact_mod_cast hq.ne'), + Real.rpow_natCast] + +theorem rp_le_nat {x p q n d : ℕ} (hq : 0 < q) (hd : 0 < d) (h : x ^ p * d ^ q ≤ n ^ q) : + (x : ℝ) ^ ((p : ℝ) / q) ≤ (n : ℝ) / d := by + by_contra hc + have hc := not_le.mp hc + have hdr : (0 : ℝ) < d := by exact_mod_cast hd + have h1 : (((n : ℝ) / d)) ^ q < (((x : ℝ) ^ ((p : ℝ) / q)) ^ q) := + pow_lt_pow_left₀ hc (by positivity) hq.ne' + rw [rp_pow hq, div_pow, div_lt_iff₀ (by positivity)] at h1 + have h2 : ((x ^ p * d ^ q : ℕ) : ℝ) ≤ ((n ^ q : ℕ) : ℝ) := by exact_mod_cast h + push_cast at h2 + linarith + +theorem rp_ge_nat {x p q n d : ℕ} (hq : 0 < q) (hd : 0 < d) (h : n ^ q ≤ x ^ p * d ^ q) : + (n : ℝ) / d ≤ (x : ℝ) ^ ((p : ℝ) / q) := by + by_contra hc + have hc := not_le.mp hc + have hdr : (0 : ℝ) < d := by exact_mod_cast hd + have h1 : (((x : ℝ) ^ ((p : ℝ) / q))) ^ q < (((n : ℝ) / d)) ^ q := + pow_lt_pow_left₀ hc (by positivity) hq.ne' + rw [rp_pow hq, div_pow, lt_div_iff₀ (by positivity)] at h1 + have h2 : ((n ^ q : ℕ) : ℝ) ≤ ((x ^ p * d ^ q : ℕ) : ℝ) := by exact_mod_cast h + push_cast at h2 + linarith + +/-- upper bound of F-sum of a histogram at s = p/q by natural numerators U r / d -/ +theorem Fh_le (l : Hist) (p q d : ℕ) (U : ℕ → ℕ) (hq : 0 < q) (hd : 0 < d) + (h : ∀ pr ∈ l, pr.1 ^ p * d ^ q ≤ (U pr.1) ^ q) : + Fh ((p : ℝ) / q) l ≤ ((l.map fun pr => pr.2 * U pr.1).sum : ℕ) / (d : ℝ) := by + induction l with + | nil => simp [Fh] + | cons pr l ih => + have ih' := ih (fun r hr => h r (by simp [hr])) + have h1 := rp_le_nat hq hd (h pr (by simp)) + simp only [Fh, List.map_cons, List.sum_cons] at ih' ⊢ + rw [Nat.cast_add, Nat.cast_mul] + have h2 : (pr.2 : ℝ) * (pr.1 : ℝ) ^ ((p : ℝ) / q) ≤ (pr.2 : ℝ) * ((U pr.1 : ℝ) / d) := + mul_le_mul_of_nonneg_left h1 (Nat.cast_nonneg _) + have h3 : (pr.2 : ℝ) * ((U pr.1 : ℝ) / d) = ((pr.2 : ℝ) * U pr.1) / d := by ring + rw [add_div] + linarith + +theorem Fh_ge (l : Hist) (p q d : ℕ) (L : ℕ → ℕ) (hq : 0 < q) (hd : 0 < d) + (h : ∀ pr ∈ l, (L pr.1) ^ q ≤ pr.1 ^ p * d ^ q) : + ((l.map fun pr => pr.2 * L pr.1).sum : ℕ) / (d : ℝ) ≤ Fh ((p : ℝ) / q) l := by + induction l with + | nil => simp [Fh] + | cons pr l ih => + have ih' := ih (fun r hr => h r (by simp [hr])) + have h1 := rp_ge_nat hq hd (h pr (by simp)) + simp only [Fh, List.map_cons, List.sum_cons] at ih' ⊢ + rw [Nat.cast_add, Nat.cast_mul] + have h2 : (pr.2 : ℝ) * ((L pr.1 : ℝ) / d) ≤ (pr.2 : ℝ) * (pr.1 : ℝ) ^ ((p : ℝ) / q) := + mul_le_mul_of_nonneg_left h1 (Nat.cast_nonneg _) + have h3 : (pr.2 : ℝ) * ((L pr.1 : ℝ) / d) = ((pr.2 : ℝ) * L pr.1) / d := by ring + rw [add_div] + linarith + +/-- certificate cell: for s in [px/q, py/q], F(s) <= (T-part at py) - (P-part at px) < 0 by natural-number checks -/ +theorem cell_neg (i : Inv) (px py q d : ℕ) (U L : ℕ → ℕ) (hq : 0 < q) (hd : 0 < d) + (hrT : ∀ pr ∈ i.T, 1 ≤ pr.1) (hrP : ∀ pr ∈ i.P, 1 ≤ pr.1) + (hT : ∀ pr ∈ i.T, pr.1 ^ py * d ^ q ≤ (U pr.1) ^ q) + (hP : ∀ pr ∈ i.P, (L pr.1) ^ q ≤ pr.1 ^ px * d ^ q) + (hsum : (i.T.map fun pr => pr.2 * U pr.1).sum < (i.P.map fun pr => pr.2 * L pr.1).sum) + (s : ℝ) (hx : (px : ℝ) / q ≤ s) (hy : s ≤ (py : ℝ) / q) : Finv s i < 0 := by + have a1 := Fh_mono i.T hrT hy + have a2 := Fh_mono i.P hrP hx + have a3 := Fh_le i.T py q d U hq hd hT + have a4 := Fh_ge i.P px q d L hq hd hP + have hdr : (0 : ℝ) < d := by exact_mod_cast hd + have a5 : (((i.T.map fun pr => pr.2 * U pr.1).sum : ℕ) : ℝ) < (((i.P.map fun pr => pr.2 * L pr.1).sum : ℕ) : ℝ) := by + exact_mod_cast hsum + have a6 : (((i.T.map fun pr => pr.2 * U pr.1).sum : ℕ) : ℝ) / d < (((i.P.map fun pr => pr.2 * L pr.1).sum : ℕ) : ℝ) / d := + div_lt_div_of_pos_right a5 hdr + unfold Finv + linarith + +/-- the converse cell for a positive sign (used for the control bracket): F(s) > 0 at the single point s = p/q -/ +theorem pt_pos (i : Inv) (p q d : ℕ) (U L : ℕ → ℕ) (hq : 0 < q) (hd : 0 < d) + (hT : ∀ pr ∈ i.T, (L pr.1) ^ q ≤ pr.1 ^ p * d ^ q) + (hP : ∀ pr ∈ i.P, pr.1 ^ p * d ^ q ≤ (U pr.1) ^ q) + (hsum : (i.P.map fun pr => pr.2 * U pr.1).sum < (i.T.map fun pr => pr.2 * L pr.1).sum) : + 0 < Finv ((p : ℝ) / q) i := by + have a3 := Fh_le i.P p q d U hq hd hP + have a4 := Fh_ge i.T p q d L hq hd hT + have hdr : (0 : ℝ) < d := by exact_mod_cast hd + have a5 : (((i.P.map fun pr => pr.2 * U pr.1).sum : ℕ) : ℝ) < (((i.T.map fun pr => pr.2 * L pr.1).sum : ℕ) : ℝ) := by + exact_mod_cast hsum + have a6 : (((i.P.map fun pr => pr.2 * U pr.1).sum : ℕ) : ℝ) / d < (((i.T.map fun pr => pr.2 * L pr.1).sum : ℕ) : ℝ) / d := + div_lt_div_of_pos_right a5 hdr + unfold Finv + linarith + +/-! ### 6. the argmax split 2|2 (k = 4, thin 4): F < 0 for t >= 141/4096 (= .034424), 28-cell rational cover (python: internal notes cover, generators Nov15/jointceiling_gen/) + (the exact crossing .0336321541 needs rpow to 1e-10: held in NumCert, see sec 4) -/ +def I22 : Inv := invoice (caller 0 0) natFloor 4 +theorem I22_F (s : ℝ) : Finv s I22 = FBc 2 2 4 s - ((2 + 2 : ℕ) : ℝ) * Nfl s := by + rw [FBc_two 2 2 4 s (by norm_num) (by norm_num)] + have h := invoice_F s (caller 0 0) natFloor 4 + rw [natFloor_F, FB_eq] at h + show Finv s (invoice (caller 0 0) natFloor 4) = _ + rw [h]; push_cast; ring +theorem cell22_0 (s : ℝ) (hx : ((0 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((988 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 0 988 4096 100000000 (fun r => if r = 2 then 118198437 else if r = 9 then 169892315 else if r = 17 then 198060441 else if r = 33 then 232424644 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 99999999 else if r = 9 then 99999999 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_1 (s : ℝ) (hx : ((988 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((1977 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 988 1977 4096 100000000 (fun r => if r = 2 then 139732347 else if r = 9 then 288788857 else if r = 17 then 392550812 else if r = 33 then 540673488 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 165133497 else if r = 9 then 169892312 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_2 (s : ℝ) (hx : ((1977 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((2471 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 1977 2471 4096 100000000 (fun r => if r = 2 then 151915755 else if r = 9 then 376415325 else if r = 17 then 552452252 else if r = 33 then 824282651 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 272829196 else if r = 9 then 288788854 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_3 (s : ℝ) (hx : ((2471 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((2718 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 2471 2718 4096 100000000 (fun r => if r = 2 then 158400208 else if r = 9 then 429744898 else if r = 17 then 655381507 else if r = 33 then 1017763102 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 350597193 else if r = 9 then 376415322 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_4 (s : ℝ) (hx : ((2718 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((2966 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 2718 2966 4096 100000000 (fun r => if r = 2 then 165189399 else if r = 9 then 490893330 else if r = 17 then 778025837 else if r = 33 then 1257731609 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 397436025 else if r = 9 then 429744895 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_5 (s : ℝ) (hx : ((2966 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3213 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 2966 3213 4096 100000000 (fun r => if r = 2 then 172240432 else if r = 9 then 560441857 else if r = 17 then 922982473 else if r = 33 then 1552953737 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 450761181 else if r = 9 then 490893327 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_6 (s : ℝ) (hx : ((3213 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3336 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3213 3336 4096 100000000 (fun r => if r = 2 then 175863141 else if r = 9 then 598667655 else if r = 17 then 1004946564 else if r = 33 then 1724878163 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 510981649 else if r = 9 then 560441854 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_7 (s : ℝ) (hx : ((3336 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3460 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3336 3460 4096 100000000 (fun r => if r = 2 then 179592434 else if r = 9 then 639843844 else if r = 17 then 1094946471 else if r = 33 then 1917472133 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 543906765 else if r = 9 then 598667652 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_8 (s : ℝ) (hx : ((3460 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3583 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3460 3583 4096 100000000 (fun r => if r = 2 then 183369777 else if r = 9 then 683485377 else if r = 17 then 1192181571 else if r = 33 then 2129751667 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 579247408 else if r = 9 then 639843841 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_9 (s : ℝ) (hx : ((3583 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3645 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3583 3645 4096 100000000 (fun r => if r = 2 then 185303816 else if r = 9 then 706599503 else if r = 17 then 1244421092 else if r = 33 then 2245506338 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 616571231 else if r = 9 then 683485374 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_10 (s : ℝ) (hx : ((3645 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3707 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3645 3707 4096 100000000 (fun r => if r = 2 then 187258254 else if r = 9 then 730495304 else if r = 17 then 1298949666 else if r = 33 then 2367552420 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 636287037 else if r = 9 then 706599500 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_11 (s : ℝ) (hx : ((3707 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3769 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3707 3769 4096 100000000 (fun r => if r = 2 then 189233305 else if r = 9 then 755199213 else if r = 17 then 1355867597 else if r = 33 then 2496231861 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 656633287 else if r = 9 then 730495301 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_12 (s : ℝ) (hx : ((3769 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3800 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3769 3800 4096 100000000 (fun r => if r = 2 then 190228629 else if r = 9 then 767862713 else if r = 17 then 1385255112 else if r = 33 then 2563171002 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 677630139 else if r = 9 then 755199210 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_13 (s : ℝ) (hx : ((3800 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3831 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3800 3831 4096 100000000 (fun r => if r = 2 then 191229188 else if r = 9 then 780738560 else if r = 17 then 1415279582 else if r = 33 then 2631905189 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 688379017 else if r = 9 then 767862710 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_14 (s : ℝ) (hx : ((3831 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3862 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3831 3862 4096 100000000 (fun r => if r = 2 then 192235010 else if r = 9 then 793830314 else if r = 17 then 1445954812 else if r = 33 then 2702482558 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 699298398 else if r = 9 then 780738557 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_15 (s : ℝ) (hx : ((3862 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3877 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3862 3877 4096 100000000 (fun r => if r = 2 then 192723596 else if r = 9 then 800243619 else if r = 17 then 1461035469 else if r = 33 then 2737309242 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 710390987 else if r = 9 then 793830311 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_16 (s : ℝ) (hx : ((3877 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3893 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3877 3893 4096 100000000 (fun r => if r = 2 then 193246122 else if r = 9 then 807141597 else if r = 17 then 1477294906 else if r = 33 then 2774952534 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 715821366 else if r = 9 then 800243616 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_17 (s : ℝ) (hx : ((3893 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3908 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3893 3908 4096 100000000 (fun r => if r = 2 then 193737278 else if r = 9 then 813662443 else if r = 17 then 1492702427 else if r = 33 then 2810713133 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 721659532 else if r = 9 then 807141594 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_18 (s : ℝ) (hx : ((3908 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3924 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3908 3924 4096 100000000 (fun r => if r = 2 then 194262553 else if r = 9 then 820676089 else if r = 17 then 1509314276 else if r = 33 then 2849365870 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 727176050 else if r = 9 then 813662440 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_19 (s : ℝ) (hx : ((3924 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3931 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3924 3931 4096 100000000 (fun r => if r = 2 then 194492808 else if r = 9 then 823763539 else if r = 17 then 1516639972 else if r = 33 then 2866443162 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 733106824 else if r = 9 then 820676086 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_20 (s : ℝ) (hx : ((3931 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3939 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3931 3939 4096 100000000 (fun r => if r = 2 then 194756291 else if r = 9 then 827306279 else if r = 17 then 1525055745 else if r = 33 then 2886085429 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 735716725 else if r = 9 then 823763536 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_21 (s : ℝ) (hx : ((3939 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3943 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3939 3943 4096 100000000 (fun r => if r = 2 then 194888167 else if r = 9 then 829083358 else if r = 17 then 1529281127 else if r = 33 then 2895956979 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 738710847 else if r = 9 then 827306276 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_22 (s : ℝ) (hx : ((3943 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3947 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3943 3947 4096 100000000 (fun r => if r = 2 then 195020132 else if r = 9 then 830864255 else if r = 17 then 1533518216 else if r = 33 then 2905862294 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 740212475 else if r = 9 then 829083355 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_23 (s : ℝ) (hx : ((3947 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3949 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3947 3949 4096 100000000 (fun r => if r = 2 then 195086147 else if r = 9 then 831756137 else if r = 17 then 1535641161 else if r = 33 then 2910827650 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 741717155 else if r = 9 then 830864252 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_24 (s : ℝ) (hx : ((3949 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3951 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3949 3951 4096 100000000 (fun r => if r = 2 then 195152186 else if r = 9 then 832648977 else if r = 17 then 1537767044 else if r = 33 then 2915801489 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 742470642 else if r = 9 then 831756134 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_25 (s : ℝ) (hx : ((3951 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3953 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3951 3953 4096 100000000 (fun r => if r = 2 then 195218246 else if r = 9 then 833542775 else if r = 17 then 1539895871 else if r = 33 then 2920783828 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 743224894 else if r = 9 then 832648974 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_26 (s : ℝ) (hx : ((3953 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3954 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3953 3954 4096 100000000 (fun r => if r = 2 then 195251285 else if r = 9 then 833990034 else if r = 17 then 1540961389 else if r = 33 then 2923278189 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 743979912 else if r = 9 then 833542772 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell22_27 (s : ℝ) (hx : ((3954 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3955 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I22 < 0 := + cell_neg I22 3954 3955 4096 100000000 (fun r => if r = 2 then 195284329 else if r = 9 then 834437532 else if r = 17 then 1542027645 else if r = 33 then 2925774680 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 744357709 else if r = 9 then 833990031 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem I22_neg (s : ℝ) (h0 : 0 ≤ s) (h1 : s ≤ ((3955 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : Finv s I22 < 0 := by + rcases le_total s (((988 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h2 | h2 + · exact cell22_0 s (by rw [Nat.cast_zero, zero_div]; exact h0) h2 + · rcases le_total s (((1977 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h3 | h3 + · exact cell22_1 s h2 h3 + · rcases le_total s (((2471 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h4 | h4 + · exact cell22_2 s h3 h4 + · rcases le_total s (((2718 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h5 | h5 + · exact cell22_3 s h4 h5 + · rcases le_total s (((2966 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h6 | h6 + · exact cell22_4 s h5 h6 + · rcases le_total s (((3213 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h7 | h7 + · exact cell22_5 s h6 h7 + · rcases le_total s (((3336 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h8 | h8 + · exact cell22_6 s h7 h8 + · rcases le_total s (((3460 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h9 | h9 + · exact cell22_7 s h8 h9 + · rcases le_total s (((3583 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h10 | h10 + · exact cell22_8 s h9 h10 + · rcases le_total s (((3645 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h11 | h11 + · exact cell22_9 s h10 h11 + · rcases le_total s (((3707 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h12 | h12 + · exact cell22_10 s h11 h12 + · rcases le_total s (((3769 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h13 | h13 + · exact cell22_11 s h12 h13 + · rcases le_total s (((3800 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h14 | h14 + · exact cell22_12 s h13 h14 + · rcases le_total s (((3831 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h15 | h15 + · exact cell22_13 s h14 h15 + · rcases le_total s (((3862 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h16 | h16 + · exact cell22_14 s h15 h16 + · rcases le_total s (((3877 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h17 | h17 + · exact cell22_15 s h16 h17 + · rcases le_total s (((3893 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h18 | h18 + · exact cell22_16 s h17 h18 + · rcases le_total s (((3908 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h19 | h19 + · exact cell22_17 s h18 h19 + · rcases le_total s (((3924 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h20 | h20 + · exact cell22_18 s h19 h20 + · rcases le_total s (((3931 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h21 | h21 + · exact cell22_19 s h20 h21 + · rcases le_total s (((3939 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h22 | h22 + · exact cell22_20 s h21 h22 + · rcases le_total s (((3943 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h23 | h23 + · exact cell22_21 s h22 h23 + · rcases le_total s (((3947 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h24 | h24 + · exact cell22_22 s h23 h24 + · rcases le_total s (((3949 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h25 | h25 + · exact cell22_23 s h24 h25 + · rcases le_total s (((3951 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h26 | h26 + · exact cell22_24 s h25 h26 + · rcases le_total s (((3953 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h27 | h27 + · exact cell22_25 s h26 h27 + · rcases le_total s (((3954 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h28 | h28 + · exact cell22_26 s h27 h28 + · exact cell22_27 s h28 h1 + +/-- t >= 141/4096 (s <= 3955/4096): the invoice F of EVERY native at the floor with the argmax caller 2|2 is negative -/ +theorem split22_ceiling (t : ℝ) (ht : (141 : ℝ) / 4096 ≤ t) (ht1 : t ≤ 1) : Finv (1 - t) I22 < 0 := by + apply I22_neg (1 - t) (by linarith) + have : ((3955 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) = 1 - 141 / 4096 := by norm_num + rw [this]; linarith + +/-! ### 7. the control C(8|9) (= #7113 caller, CallerCost.reproduction) at the native floor, k = 17: the root of F(t) lies in (.0204, .0205) + (R3 control .0204110964; exact root needs rpow to 1e-10, not done in kernel) -/ +def I89 : Inv := invoice (caller 6 7) natFloor 17 +theorem I89_F (s : ℝ) : Finv s I89 = FB 8 9 4 s - ((8 + 9 : ℕ) : ℝ) * Nfl s := by + have h := invoice_F s (caller 6 7) natFloor 17 + rw [natFloor_F, FB_eq] at h + show Finv s (invoice (caller 6 7) natFloor 17) = _ + rw [h]; push_cast; ring +/-- F(t = .0204) > 0 (s = 2449/2500) -/ +theorem control_pos : 0 < Finv (((2449 : ℕ) : ℝ) / ((2500 : ℕ) : ℝ)) I89 := + pt_pos I89 2449 2500 100000000 (fun r => if r = 1 then 100000001 else if r = 8 then 766773248 else if r = 9 then 860549711 else if r = 16 then 1512014428 else if r = 24 then 2249339100 else if r = 32 then 2981569375 else if r = 40 then 3710034667 else if r = 48 then 4435513611 else if r = 56 then 5158518488 else if r = 64 then 5879412111 else 0) (fun r => if r = 2 then 197191859 else if r = 9 then 860549708 else if r = 17 then 1604529710 else if r = 25 then 2341111144 else if r = 33 then 3072813876 else if r = 41 then 3800870438 else if r = 49 then 4526015947 else if r = 57 then 5248739375 else if r = 65 then 5969389592 else if r = 73 then 6688228062 else if r = 137 then 12391716458 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) +/-- F(t = .0205) < 0 (s = 1959/2000) -/ +theorem control_neg : Finv (((1959 : ℕ) : ℝ) / ((2000 : ℕ) : ℝ)) I89 < 0 := + cell_neg I89 1959 1959 2000 100000000 (fun r => if r = 2 then 197178194 else if r = 9 then 860360650 else if r = 17 then 1604075180 else if r = 25 then 2340357693 else if r = 33 then 3071739655 else if r = 41 then 3799459223 else if r = 49 then 4524254849 else if r = 57 then 5246617715 else if r = 65 then 5966898261 else if r = 73 then 6685359123 else if r = 137 then 12385621260 else 0) (fun r => if r = 1 then 99999999 else if r = 8 then 766613815 else if r = 9 then 860360647 else if r = 16 then 1511595264 else if r = 24 then 2248624359 else if r = 32 then 2980536218 else if r = 40 then 3708666329 else if r = 48 then 4433796864 else if r = 56 then 5156442418 else if r = 64 then 5876967437 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) _ le_rfl le_rfl +/-- the control brackets the R3 value .0204110964: F(.0204) > 0 > F(.0205) for the exact #7113 caller invoice at the floor native -/ +theorem control_bracket : + 0 < Finv (1 - (204 : ℝ) / 10000) I89 ∧ Finv (1 - (205 : ℝ) / 10000) I89 < 0 := by + constructor + · have h := control_pos + have e : ((2449 : ℕ) : ℝ) / ((2500 : ℕ) : ℝ) = 1 - 204 / 10000 := by norm_num + rwa [e] at h + · have h := control_neg + have e : ((1959 : ℕ) : ℝ) / ((2000 : ℕ) : ℝ) = 1 - 205 / 10000 := by norm_num + rwa [e] at h + + +/-! ### 8. the CORRECTED argmax split 1|1 (k = 2, thin 4, arms of 1 priced by the ledger): F < 0 for t >= 176/4096 = 0.042969 (root .0419448764), 36 rational cells. + (internal notes; the exact root needs rpow to 1e-10, held in NumCert) -/ +def I11 : Inv := invoice (callerG 1 1 4) natFloor 2 +theorem I11_F (s : ℝ) : Finv s I11 = FBc 1 1 4 s - ((1 + 1 : ℕ) : ℝ) * Nfl s := by + have h := invoice_F s (callerG 1 1 4) natFloor 2 + rw [natFloor_F, callerG_F 1 1 4 le_rfl le_rfl] at h + show Finv s (invoice (callerG 1 1 4) natFloor 2) = _ + rw [h]; push_cast; ring +theorem cell11_0 (s : ℝ) (hx : ((0 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((980 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 0 980 4096 100000000000 (fun r => if r = 2 then 118038526172 else if r = 9 then 169164790567 else if r = 17 then 196967474893 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 99999999999 else if r = 9 then 99999999999 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_1 (s : ℝ) (hx : ((980 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((1470 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 980 1470 4096 100000000000 (fun r => if r = 2 then 128243590121 else if r = 9 then 220021419926 else if r = 17 then 276434202378 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 164464184067 else if r = 9 then 169164790564 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_2 (s : ℝ) (hx : ((1470 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((1960 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 1470 1960 4096 100000000000 (fun r => if r = 2 then 139330936607 else if r = 9 then 286167263672 else if r = 17 then 387961861652 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 210914774109 else if r = 9 then 220021419923 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_3 (s : ℝ) (hx : ((1960 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((2450 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 1960 2450 4096 100000000000 (fun r => if r = 2 then 151376843687 else if r = 9 then 372198774216 else if r = 17 then 544485468158 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 270484678412 else if r = 9 then 286167263669 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_4 (s : ℝ) (hx : ((2450 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((2695 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 2450 2695 4096 100000000000 (fun r => if r = 2 then 157784882305 else if r = 9 then 424475308227 else if r = 17 then 645037439188 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 346879262320 else if r = 9 then 372198774213 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_5 (s : ℝ) (hx : ((2695 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((2940 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 2695 2940 4096 100000000000 (fun r => if r = 2 then 164464184070 else if r = 9 then 484094252257 else if r = 17 then 764158682436 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 392822333018 else if r = 9 then 424475308224 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_6 (s : ℝ) (hx : ((2940 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3185 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 2940 3185 4096 100000000000 (fun r => if r = 2 then 171426232010 else if r = 9 then 552086871782 else if r = 17 then 905278448145 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 444850419381 else if r = 9 then 484094252254 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_7 (s : ℝ) (hx : ((3185 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3307 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3185 3307 4096 100000000000 (fun r => if r = 2 then 175002198569 else if r = 9 then 589426533829 else if r = 17 then 984988805396 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 503769462655 else if r = 9 then 552086871779 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_8 (s : ℝ) (hx : ((3307 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3430 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3307 3430 4096 100000000000 (fun r => if r = 2 then 178682995252 else if r = 9 then 629629276888 else if r = 17 then 1072459277781 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 535957699595 else if r = 9 then 589426533826 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_9 (s : ℝ) (hx : ((3430 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3491 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3430 3491 4096 100000000000 (fun r => if r = 2 then 180537047876 else if r = 9 then 650573014604 else if r = 17 then 1118678695528 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 570492148478 else if r = 9 then 629629276885 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_10 (s : ℝ) (hx : ((3491 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3552 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3491 3552 4096 100000000000 (fun r => if r = 2 then 182410338542 else if r = 9 then 672213416478 else if r = 17 then 1166890016018 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 588435695526 else if r = 9 then 650573014601 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_11 (s : ℝ) (hx : ((3552 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3613 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3552 3613 4096 100000000000 (fun r => if r = 2 then 184303066870 else if r = 9 then 694573656069 else if r = 17 then 1217179083616 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 606943616478 else if r = 9 then 672213416475 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_12 (s : ℝ) (hx : ((3613 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3675 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3613 3675 4096 100000000000 (fun r => if r = 2 then 186246949593 else if r = 9 then 718062766164 else if r = 17 then 1270513956070 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 626033662444 else if r = 9 then 694573656066 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_13 (s : ℝ) (hx : ((3675 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3705 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3675 3705 4096 100000000000 (fun r => if r = 2 then 187194885136 else if r = 9 then 729712000715 else if r = 17 then 1297153933706 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 646052044837 else if r = 9 then 718062766161 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_14 (s : ℝ) (hx : ((3705 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3736 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3705 3736 4096 100000000000 (fun r => if r = 2 then 188179487410 else if r = 9 then 741948120277 else if r = 17 then 1325268869852 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 655966912907 else if r = 9 then 729712000712 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_15 (s : ℝ) (hx : ((3736 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3766 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3736 3766 4096 100000000000 (fun r => if r = 2 then 189137258933 else if r = 9 then 753984850330 else if r = 17 then 1353056941668 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 666372158432 else if r = 9 then 741948120274 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_16 (s : ℝ) (hx : ((3766 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3797 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3766 3797 4096 100000000000 (fun r => if r = 2 then 190132077649 else if r = 9 then 766627987305 else if r = 17 then 1382383537787 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 676598876371 else if r = 9 then 753984850327 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_17 (s : ℝ) (hx : ((3797 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3812 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3797 3812 4096 100000000000 (fun r => if r = 2 then 190615318327 else if r = 9 then 772821526227 else if r = 17 then 1396801175565 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 687331395485 else if r = 9 then 766627987302 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_18 (s : ℝ) (hx : ((3812 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3827 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3812 3827 4096 100000000000 (fun r => if r = 2 then 191099787212 else if r = 9 then 779065102357 else if r = 17 then 1411369182812 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 692585501907 else if r = 9 then 772821526224 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_19 (s : ℝ) (hx : ((3827 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3842 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3827 3842 4096 100000000000 (fun r => if r = 2 then 191585487426 else if r = 9 then 785359119943 else if r = 17 then 1426089127815 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 697879771828 else if r = 9 then 779065102354 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_20 (s : ℝ) (hx : ((3842 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3858 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3842 3858 4096 100000000000 (fun r => if r = 2 then 192104928378 else if r = 9 then 792128795609 else if r = 17 then 1441959657406 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 703214512268 else if r = 9 then 785359119940 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_21 (s : ℝ) (hx : ((3858 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3873 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3858 3873 4096 100000000000 (fun r => if r = 2 then 192593183263 else if r = 9 then 798528353945 else if r = 17 then 1456998647283 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 708949858185 else if r = 9 then 792128795606 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_22 (s : ℝ) (hx : ((3873 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3881 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3873 3881 4096 100000000000 (fun r => if r = 2 then 192854093080 else if r = 9 then 801962565455 else if r = 17 then 1465083472409 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 714369220704 else if r = 9 then 798528353942 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_23 (s : ℝ) (hx : ((3881 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3889 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3881 3889 4096 100000000000 (fun r => if r = 2 then 193115356356 else if r = 9 then 805411546396 else if r = 17 then 1473213159894 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 717276466233 else if r = 9 then 801962565452 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_24 (s : ℝ) (hx : ((3889 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3896 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3889 3896 4096 100000000000 (fun r => if r = 2 then 193344252046 else if r = 9 then 808441570194 else if r = 17 then 1480363633263 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 720195543287 else if r = 9 then 805411546393 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_25 (s : ℝ) (hx : ((3896 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3900 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3896 3900 4096 100000000000 (fun r => if r = 2 then 193475171374 else if r = 9 then 810178127625 else if r = 17 then 1484465189525 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 722759479103 else if r = 9 then 808441570191 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_26 (s : ℝ) (hx : ((3900 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3904 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3900 3904 4096 100000000000 (fun r => if r = 2 then 193606179351 else if r = 9 then 811918415234 else if r = 17 then 1488578109728 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 724228681377 else if r = 9 then 810178127622 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_27 (s : ℝ) (hx : ((3904 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3908 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3904 3908 4096 100000000000 (fun r => if r = 2 then 193737276037 else if r = 9 then 813662441034 else if r = 17 then 1492702425356 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 725700870199 else if r = 9 then 811918415231 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_28 (s : ℝ) (hx : ((3908 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3910 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3908 3910 4096 100000000000 (fun r => if r = 2 then 193802857665 else if r = 9 then 814535858265 else if r = 17 then 1494768866317 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 727176051638 else if r = 9 then 813662441031 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_29 (s : ℝ) (hx : ((3910 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3912 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3910 3912 4096 100000000000 (fun r => if r = 2 then 193868461493 else if r = 9 then 815410213056 else if r = 17 then 1496838167982 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 727914766490 else if r = 9 then 814535858262 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_30 (s : ℝ) (hx : ((3912 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3914 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3912 3914 4096 100000000000 (fun r => if r = 2 then 193934087529 else if r = 9 then 816285506414 else if r = 17 then 1498910334309 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 728654231779 else if r = 9 then 815410213053 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_31 (s : ℝ) (hx : ((3914 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3916 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3914 3916 4096 100000000000 (fun r => if r = 2 then 193999735779 else if r = 9 then 817161739346 else if r = 17 then 1500985369266 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 729394448267 else if r = 9 then 816285506411 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_32 (s : ℝ) (hx : ((3916 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3917 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3916 3917 4096 100000000000 (fun r => if r = 2 then 194032568237 else if r = 9 then 817600208467 else if r = 17 then 1502023963721 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 730135416717 else if r = 9 then 817161739343 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_33 (s : ℝ) (hx : ((3917 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3918 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3917 3918 4096 100000000000 (fun r => if r = 2 then 194065406252 else if r = 9 then 818038912861 else if r = 17 then 1503063276823 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 730506183167 else if r = 9 then 817600208464 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_34 (s : ℝ) (hx : ((3918 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3919 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3918 3919 4096 100000000000 (fun r => if r = 2 then 194098249824 else if r = 9 then 818477852652 else if r = 17 then 1504103309069 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 730877137893 else if r = 9 then 818038912858 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem cell11_35 (s : ℝ) (hx : ((3919 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) ≤ s) (hy : s ≤ ((3920 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : + Finv s I11 < 0 := + cell_neg I11 3919 3920 4096 100000000000 (fun r => if r = 2 then 194131098954 else if r = 9 then 818917027968 else if r = 17 then 1505144060957 else 0) (fun r => if r = 1 then 99999999999 else if r = 8 then 731248280993 else if r = 9 then 818477852649 else 0) (by norm_num) (by norm_num) + (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) s hx hy +theorem I11_neg (s : ℝ) (h0 : 0 ≤ s) (h1 : s ≤ ((3920 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) : Finv s I11 < 0 := by + rcases le_total s (((980 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h2 | h2 + · exact cell11_0 s (by rw [Nat.cast_zero, zero_div]; exact h0) h2 + · rcases le_total s (((1470 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h3 | h3 + · exact cell11_1 s h2 h3 + · rcases le_total s (((1960 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h4 | h4 + · exact cell11_2 s h3 h4 + · rcases le_total s (((2450 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h5 | h5 + · exact cell11_3 s h4 h5 + · rcases le_total s (((2695 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h6 | h6 + · exact cell11_4 s h5 h6 + · rcases le_total s (((2940 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h7 | h7 + · exact cell11_5 s h6 h7 + · rcases le_total s (((3185 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h8 | h8 + · exact cell11_6 s h7 h8 + · rcases le_total s (((3307 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h9 | h9 + · exact cell11_7 s h8 h9 + · rcases le_total s (((3430 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h10 | h10 + · exact cell11_8 s h9 h10 + · rcases le_total s (((3491 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h11 | h11 + · exact cell11_9 s h10 h11 + · rcases le_total s (((3552 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h12 | h12 + · exact cell11_10 s h11 h12 + · rcases le_total s (((3613 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h13 | h13 + · exact cell11_11 s h12 h13 + · rcases le_total s (((3675 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h14 | h14 + · exact cell11_12 s h13 h14 + · rcases le_total s (((3705 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h15 | h15 + · exact cell11_13 s h14 h15 + · rcases le_total s (((3736 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h16 | h16 + · exact cell11_14 s h15 h16 + · rcases le_total s (((3766 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h17 | h17 + · exact cell11_15 s h16 h17 + · rcases le_total s (((3797 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h18 | h18 + · exact cell11_16 s h17 h18 + · rcases le_total s (((3812 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h19 | h19 + · exact cell11_17 s h18 h19 + · rcases le_total s (((3827 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h20 | h20 + · exact cell11_18 s h19 h20 + · rcases le_total s (((3842 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h21 | h21 + · exact cell11_19 s h20 h21 + · rcases le_total s (((3858 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h22 | h22 + · exact cell11_20 s h21 h22 + · rcases le_total s (((3873 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h23 | h23 + · exact cell11_21 s h22 h23 + · rcases le_total s (((3881 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h24 | h24 + · exact cell11_22 s h23 h24 + · rcases le_total s (((3889 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h25 | h25 + · exact cell11_23 s h24 h25 + · rcases le_total s (((3896 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h26 | h26 + · exact cell11_24 s h25 h26 + · rcases le_total s (((3900 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h27 | h27 + · exact cell11_25 s h26 h27 + · rcases le_total s (((3904 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h28 | h28 + · exact cell11_26 s h27 h28 + · rcases le_total s (((3908 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h29 | h29 + · exact cell11_27 s h28 h29 + · rcases le_total s (((3910 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h30 | h30 + · exact cell11_28 s h29 h30 + · rcases le_total s (((3912 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h31 | h31 + · exact cell11_29 s h30 h31 + · rcases le_total s (((3914 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h32 | h32 + · exact cell11_30 s h31 h32 + · rcases le_total s (((3916 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h33 | h33 + · exact cell11_31 s h32 h33 + · rcases le_total s (((3917 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h34 | h34 + · exact cell11_32 s h33 h34 + · rcases le_total s (((3918 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h35 | h35 + · exact cell11_33 s h34 h35 + · rcases le_total s (((3919 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ)) with h36 | h36 + · exact cell11_34 s h35 h36 + · exact cell11_35 s h36 h1 + +/-- t >= 176/4096: the invoice F of EVERY native at the floor with the 1|1 caller (thin 4) is negative -/ +theorem split11_ceiling (t : ℝ) (ht : (176 : ℝ) / 4096 ≤ t) (ht1 : t ≤ 1) : Finv (1 - t) I11 < 0 := by + apply I11_neg (1 - t) (by linarith) + have : ((3920 : ℕ) : ℝ) / ((4096 : ℕ) : ℝ) = 1 - 176 / 4096 := by norm_num + rw [this]; linarith + +/-- UNCONDITIONAL-NUMERICS instance of the ceiling theorem: argmax split 2|2, thin >= 4, any native meeting the floor: + F(t) < 0 for t >= 141/4096 (class lemmas hB/hth and the native floor hN stay hypotheses; no NumCert needed). -/ +theorem ceiling_split22 (c : InClass 4) (ha : c.a = 2) (hb : c.b = 2) (n : Inv) + (hN : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s n ≤ -Nfl s) (t : ℝ) (ht : (141 : ℝ) / 4096 ≤ t) (ht1 : t ≤ 1) : + Finv (1 - t) (invoice c.ci n (c.a + c.b)) < 0 := by + have hs0 : (0 : ℝ) ≤ 1 - t := by linarith + have hs1 : 1 - t ≤ 1 := by linarith + rw [invoice_F] + have h1 := c.hB (1 - t) hs0 hs1 + have h2 := hN (1 - t) hs0 hs1 + have h3 : ((c.a + c.b : ℕ) : ℝ) * Finv (1 - t) n ≤ ((c.a + c.b : ℕ) : ℝ) * (-Nfl (1 - t)) := + mul_le_mul_of_nonneg_left h2 (Nat.cast_nonneg _) + have h4 := FBc_th_mono c.a c.b c.hth (1 - t) + have h5 := split22_ceiling t ht ht1 + rw [I22_F] at h5 + rw [ha, hb] at h1 h3 h4 ⊢ + push_cast at h3 ⊢ + norm_num at h3 h5 ⊢ + linarith + +/-- CORRECTED argmax split 1|1 (k = 2, thin >= 4, any native meeting the floor): F(t) < 0 for t >= 176/4096 = .04297 (kernel-checked, 36 cells; + the sharp value .0419448764 is the certified root, NumCert). Class lemmas hB/hth and the native floor hN stay hypotheses. -/ +theorem ceiling_split11 (c : InClass 4) (ha : c.a = 1) (hb : c.b = 1) (n : Inv) + (hN : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s n ≤ -Nfl s) (t : ℝ) (ht : (176 : ℝ) / 4096 ≤ t) (ht1 : t ≤ 1) : + Finv (1 - t) (invoice c.ci n (c.a + c.b)) < 0 := by + have hs0 : (0 : ℝ) ≤ 1 - t := by linarith + have hs1 : 1 - t ≤ 1 := by linarith + rw [invoice_F] + have h1 := c.hB (1 - t) hs0 hs1 + have h2 := hN (1 - t) hs0 hs1 + have h3 : ((c.a + c.b : ℕ) : ℝ) * Finv (1 - t) n ≤ ((c.a + c.b : ℕ) : ℝ) * (-Nfl (1 - t)) := + mul_le_mul_of_nonneg_left h2 (Nat.cast_nonneg _) + have h4 := FBc_th_mono c.a c.b c.hth (1 - t) + have h5 := split11_ceiling t ht ht1 + rw [I11_F] at h5 + rw [ha, hb] at h1 h3 h4 ⊢ + push_cast at h3 ⊢ + norm_num at h3 h5 ⊢ + linarith + +#print axioms invoice_F +#print axioms natFloor_F +#print axioms FB_eq +#print axioms ceiling +#print axioms ceiling4 +#print axioms ceiling3 +#print axioms rp_le_nat +#print axioms rp_ge_nat +#print axioms I22_F +#print axioms split22_ceiling +#print axioms ceiling_split22 +#print axioms callerG_F +#print axioms callerG_S +#print axioms callerG_eq_caller_F +#print axioms split11_ceiling +#print axioms ceiling_split11 +#print axioms I89_F +#print axioms control_bracket + +end JointCeiling diff --git a/research/p104-tree-ceiling/lean/Nov15/JointCeiling.md b/research/p104-tree-ceiling/lean/Nov15/JointCeiling.md new file mode 100644 index 0000000000..9672a4cb33 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/JointCeiling.md @@ -0,0 +1,21 @@ +# JointCeiling.lean: Joint (caller, native) ceiling, CORRECTED +Imports Nov15.CallerCost + Mathlib. About 12 s, 2.9 GB. 18 `#print axioms` all within [propext, Classical.choice, Quot.sound]; no sorry, no native_decide (`decide +kernel` = kernel evaluation only). The rational-cell data are produced by scripts that are not shipped; Lean re-checks every cell. +Convention: F(s) = sum (T-P) r^s, s = 1-t. + +## WITHDRAWN +- **The old statement "kappa <= .0336321541 (thin 4) / .0400007313 (thin 3), argmax 2|2" is WITHDRAWN.** Reason (internal audit): the generating script overcharged every arm of length 1 by 208 one-stage lines (P[8]) -- two lines per port, 104 ports x 2 -- breaking the ledger S = 3408(a+b) - 208. The argmax is 1|1 (k = 2), not 2|2, and the R1 NumCert list built from that script is invalid for arms of 1. +- tbar4 = .0336321541, tbar3 = .0400007313 are removed from the file. + +## Proved (kernel) +- `invoice_F`, `Fh_mono`, `natFloor`, `natFloor_F` (Nfl = 400*8^s + 16 + 88(2-2^s)): unchanged. +- **Correction (a).** `FBc a b th s = FB a b th s + 208*8^s*(#arms of 1)`; `callerG a b th` = ledger-correct caller histogram (a,b >= 1; P[8] = 384 + 16(a+b) - 208 #arms-of-1). `callerG_F`: F(callerG) = FBc for all a,b >= 1. `callerG_S`: **S(callerG a b 4) = 3408(a+b) - 208 for ALL a,b >= 1** (the ledger law; with the floor native S = -3216/call this is 192k - 208 = 176, 368, 560 at 1|1, 1|2, 2|2). `FBc_two`, `callerG_eq_caller_F`: for a,b >= 2 FBc = FB and callerG has the same F as CallerCost.caller (and FB_eq / reproduction of #7113 / S_caller are untouched), so the a,b >= 2 agreement stands. (`FB_eq`, `FB_th_mono` kept.) +- **Ceiling theorems** (`ceiling`, `ceiling4`, `ceiling3`) now run on FBc; tbar4 = .0419448764 (rounded up from the certified root .041944876391), tbar3 = .0681203280 (th3 B-form-A class only). +- **(c) Kernel-checked numerics:** `split22_ceiling` / `ceiling_split22` (2|2, t >= 141/4096, 28 cells; unaffected by the correction) and NEW `split11_ceiling` / `ceiling_split11`: the corrected argmax 1|1, thin >= 4, any floor native: F(t) < 0 for t >= 176/4096 = .04297 (36 rational cells, DEC = 1e11, q = 4096; the sharp root .0419448764 is not reachable by 4096-grid cells, it is in NumCert). `control_bracket` (C(8|9) = #7113 caller, F(.0204) > 0 > F(.0205)) unchanged. + +## Hypotheses (explicit, named) +1. `InClass.hB`: B-form per-split optimality pointwise in F on [0,1] (justified by a tail-swap/join majorization + Karamata argument, phi concave; finite checks 58,873 schedules and 360,844 B layouts; the audit found it sound for B ports). It holds on B ports. **It FAILS on A ports for the true sign-floor masks (centre-drop case, 6,009 / 5,879 failing layouts)**, which is why the ceiling is stated for the built-type class (A = 4 QUERY, B-form masks). `hth`: th >= th0 (4 = A ports use 4 QUERY sign units; 3 unbuilt). `hrho`: rho >= 2 (Theorem H, + t = -1 closure, #7606 findings bundle), recorded only. +2. `hN`: F_nat <= -Nfl on [0,1] (whole-floor note). Not re-proved. +3. `NumCert th0 tbar` (regenerated): for every split a|b (a,b >= 1), 0 <= s <= 1-tbar: FBc a b th0 s - (a+b) Nfl s < 0. Source: an external interval-arithmetic script (1|1 root, 1|b for b = 2..59 by interval cover, tail k >= 61 by U plus 208*8^s with U < 0 and U' < 0, a,b >= 2 splits unchanged since FBc = FB there). Its output: th4 1|1 kbar .041944876391 cert True, 1|b True, tail True; th3 .068120327915. Not in the kernel: ~1,800 pairs of 40-digit interval covers; the tail U >= F Jensen/MVT step (R1) is unaudited (audit conditions). + +## Theorem as restated (paper) +For every rho = 2 nested two-arm caller (arms a,b >= 1, meeting only in hubs, host calls t != -1) with A ports at 4 QUERY sign units and B-form masks, composed with any native at the whole-floor per-call floor: kappa <= .0419448764, peak at 1|1 (k = 2). Conditions: [H-centre] (no line crosses the centre at h <= 4), [H-odd] (a B sign unit costs >= psi(1)), Theorem H + t = -1 closure (quoted), the R1 tail step (hypothesis, in NumCert), hN, and realisability of arms of 1 / k = 2 (no root built; Floor Lemma does not cover an innermost-only arm). Outside the class: trees, multi-centre, shared own roles. The .0681203279 figure (thin-3 masks) is only "scanned, conditional" for the true sign-floor class (audit); the Lean `ceiling3` certifies only the th3 B-form-A class under hB. diff --git a/research/p104-tree-ceiling/lean/Nov15/JunkLB2.lean b/research/p104-tree-ceiling/lean/Nov15/JunkLB2.lean new file mode 100644 index 0000000000..d9d034ea16 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/JunkLB2.lean @@ -0,0 +1,1188 @@ +/- +BIG-JUNKLB2 (internal notes), T1 g9 pricing (class M): charging every move at g9 = h_9, except a Y main's first move + (out of chart 0, never on a pair chain), never exceeds the real I1 cost; the gap for Y_p is + l(d_1) = f(8) - f(d_1) - f(9-d_1) ≥ 0. Hence Σ_{junk pairs} dist_{g9}(A_q → G_p) ≤ public cost. +T3 slot lemma (level 7): |D| ≤ rank{x_p : p ∈ D} + |Z|, with the T2 facts as explicit hypotheses. +T4 departer law, CORRECTED SCOPE (GAPMAP): arrivals = ALL arrivals at c, owned included; + dim π(Arr_c) ≤ #public departers + #owned arrivals + #Y enders. Each departer stop costs ≥ f(2). + The public-only version is false in the same model (`T4_public_only_false`). +(Nov 16): T1 linked to registers (`Net.T1_cost`, `Net.T1_full`: Σ move charges ≤ public +cost under JunkM op semantics); T2 proved from level-k op semantics (`T2_run`: complementarity, +independence, expansion existence) and discharged in T3 (`slot_lemma_T2`, `slot_lemma_run`). +Self-contained: h / gaps / hsum / two_point / Net are copied from Nov15/JunkM.lean. +-/ +import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog +import Mathlib.Analysis.Convex.Slope +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +import Mathlib.LinearAlgebra.StdBasis +import Mathlib.LinearAlgebra.Dimension.OrzechProperty + +open Finset + +set_option linter.unusedSectionVars false +set_option linter.unusedSimpArgs false + +namespace JunkLB2 + +/-! ## Costs (copied from JunkM, I1) -/ + +section Cost + +variable (f : ℝ → ℝ) + +/-- `h_e(a,b) = f(e-a) - f(b-a) - f(e-b)`. -/ +def h (e a b : ℝ) : ℝ := f (e - a) - f (b - a) - f (e - b) + +def gaps : List ℝ → ℝ + | a :: b :: t => f (b - a) + gaps (b :: t) + | _ => 0 + +/-- `Σ h_e(d_i, d_{i+1})` along a dim chain. -/ +def hsum (e : ℝ) : List ℝ → ℝ + | a :: b :: t => h f e a b + hsum e (b :: t) + | _ => 0 + +/-- telescoping with an arbitrary pricing level `e` (the chain need not end at `e`): +`Σ h_e(d_i,d_{i+1}) = f(e - d_0) - f(e - last) - Σ f(gaps)`. -/ +theorem hsum_tele (e : ℝ) : ∀ (d0 : ℝ) (ds : List ℝ), + hsum f e (d0 :: ds) = + f (e - d0) - f (e - (d0 :: ds).getLast (List.cons_ne_nil _ _)) - gaps f (d0 :: ds) + | d0, [] => by simp [hsum, gaps] + | d0, b :: t => by + have ih := hsum_tele e b t + rw [List.getLast_cons (List.cons_ne_nil _ _)] + simp only [hsum, gaps, h] at ih ⊢ + rw [ih]; ring + +end Cost + +/-- `f(r) = r log r`. -/ +noncomputable def fL (r : ℝ) : ℝ := r * Real.log r + +lemma fL_convex : ConvexOn ℝ (Set.Ici (0 : ℝ)) fL := Real.convexOn_mul_log + +/-- two-point majorisation for a convex function on `[0,∞)` (copied from JunkM). -/ +lemma two_point {f : ℝ → ℝ} (cvx : ConvexOn ℝ (Set.Ici (0 : ℝ)) f) {lo hi y z : ℝ} (h0 : 0 ≤ lo) + (hlt : lo < hi) (hy1 : lo ≤ y) (hy2 : y ≤ hi) (hz1 : lo ≤ z) (hz2 : z ≤ hi) + (hs : y + z = lo + hi) : f y + f z ≤ f lo + f hi := by + have hD : 0 < hi - lo := by linarith + have hlo : lo ∈ Set.Ici (0:ℝ) := h0 + have hhi : hi ∈ Set.Ici (0:ℝ) := by simp; linarith + have hy := cvx.2 hlo hhi + (div_nonneg (by linarith) hD.le : (0:ℝ) ≤ (hi - y) / (hi - lo)) + (div_nonneg (by linarith) hD.le : (0:ℝ) ≤ (y - lo) / (hi - lo)) (by field_simp; ring) + have hz := cvx.2 hlo hhi + (div_nonneg (by linarith) hD.le : (0:ℝ) ≤ (hi - z) / (hi - lo)) + (div_nonneg (by linarith) hD.le : (0:ℝ) ≤ (z - lo) / (hi - lo)) (by field_simp; ring) + simp only [smul_eq_mul] at hy hz + have ey : (hi - y) / (hi - lo) * lo + (y - lo) / (hi - lo) * hi = y := by field_simp; ring + have ez : (hi - z) / (hi - lo) * lo + (z - lo) / (hi - lo) * hi = z := by field_simp; ring + rw [ey] at hy; rw [ez] at hz + have e1 : (hi - y) / (hi - lo) + (hi - z) / (hi - lo) = 1 := by field_simp; linarith + have e2 : (y - lo) / (hi - lo) + (z - lo) / (hi - lo) = 1 := by field_simp; linarith + have : f y + f z ≤ ((hi - y) / (hi - lo) + (hi - z) / (hi - lo)) * f lo + + ((y - lo) / (hi - lo) + (z - lo) / (hi - lo)) * f hi := by linarith + rw [e1, e2] at this; linarith + +lemma fL0 : fL 0 = 0 := by simp [fL] +lemma fL1 : fL 1 = 0 := by simp [fL] + +/-- every ascending move strictly below the final dim costs at least `κ = f(2) = 2 log 2`: +`h_e(a,b) ≥ f(2)` when `b - a ≥ 1` and `e - b ≥ 1` (T4's "each departer stop costs ≥ f(2)"). -/ +theorem kappa_le (e a b : ℝ) (hab : 1 ≤ b - a) (hbe : 1 ≤ e - b) : fL 2 ≤ h fL e a b := by + have cvx := fL_convex + set x := b - a; set y := e - b + have hxy : e - a = x + y := by simp only [x, y]; ring + -- f(x) + f(1+y) ≤ f(1) + f(x+y) + have s1 := two_point cvx (lo := 1) (hi := x + y) (y := x) (z := 1 + y) + (by norm_num) (by linarith) hab (by linarith) (by linarith) (by linarith) (by ring) + -- f(y) + f(2) ≤ f(1) + f(1+y) + have s2 := two_point cvx (lo := 1) (hi := 1 + y) (y := y) (z := 2) + (by norm_num) (by linarith) hbe (by linarith) (by norm_num) (by linarith) (by ring) + simp only [h, hxy]; rw [fL1] at s1 s2; linarith + +/-- `g9(a,b) ≥ 0` for `a ≤ b ≤ 9`. -/ +lemma g9_nonneg (a b : ℝ) (hab : a ≤ b) (hb : b ≤ 9) : 0 ≤ h fL 9 a b := by + have := two_point fL_convex (lo := 0) (hi := 9 - a) (y := b - a) (z := 9 - b) + rcases (show a = 9 ∨ a < 9 by + rcases lt_or_eq_of_le (hab.trans hb) with h' | h' <;> [exact Or.inr h'; exact Or.inl h']) with + rfl | ha + · have : b = 9 := le_antisymm hb hab + subst this; simp [h, fL0] + · have := this le_rfl (by linarith) (by linarith) (by linarith) (by linarith) (by linarith) + (by ring) + simp only [h]; rw [fL0] at this; linarith + +/-! ## T1. g9 pricing (class M) -/ + +section T1 + +/-- **T1, Y main.** For `Y_p` with dim chain `0 < d_1 < … < d_k = 8`, the real I1 cost +`Σ h_8` equals the g9 charge on every move but the first, plus `l(d_1) = f(8) - f(d_1) - f(9 - d_1)`. -/ +theorem T1_Y (f : ℝ → ℝ) (hf0 : f 0 = 0) (hf1 : f 1 = 0) (d1 : ℝ) (rest : List ℝ) + (hlast : (d1 :: rest).getLast (List.cons_ne_nil _ _) = 8) : + hsum f 8 (0 :: d1 :: rest) = hsum f 9 (d1 :: rest) + (f 8 - f d1 - f (9 - d1)) := by + have e1 : hsum f 8 (0 :: d1 :: rest) = h f 8 0 d1 + hsum f 8 (d1 :: rest) := rfl + rw [e1, hsum_tele f 8 d1 rest, hsum_tele f 9 d1 rest, hlast] + have a1 : (8:ℝ) - 8 = 0 := by norm_num + have a2 : (9:ℝ) - 8 = 1 := by norm_num + simp only [h, a1, a2, hf0, hf1, sub_zero]; ring + +/-- the T1 slack `l(d) = f(8) - f(d) - f(9-d) ≥ 0` for `1 ≤ d ≤ 8` (and `l(1) = l(8) = 0`). -/ +theorem l_nonneg (d : ℝ) (h1 : 1 ≤ d) (h8 : d ≤ 8) : 0 ≤ fL 8 - fL d - fL (9 - d) := by + have := two_point fL_convex (lo := 1) (hi := 8) (y := d) (z := 9 - d) + (by norm_num) (by norm_num) h1 h8 (by linarith) (by linarith) (by ring) + rw [fL1] at this; linarith + +lemma l_one : fL 8 - fL 1 - fL (9 - 1) = 0 := by norm_num [fL1] + +/-- **T1, per register.** Charged ≤ real for a Y main (`0 :: d_1 :: … :: 8`, first move uncharged); +for a register ending at V (dim 9) the charge is its real cost by definition (`hsum fL 9`). -/ +theorem T1_Y_le (d1 : ℝ) (rest : List ℝ) (h1 : 1 ≤ d1) (h8 : d1 ≤ 8) + (hlast : (d1 :: rest).getLast (List.cons_ne_nil _ _) = 8) : + hsum fL 9 (d1 :: rest) ≤ hsum fL 8 (0 :: d1 :: rest) := by + rw [T1_Y fL fL0 fL1 d1 rest hlast]; linarith [l_nonneg d1 h1 h8] + +/-! ### The path bound with g9 everywhere (copy of JunkM's `Net`, no free moves) -/ + +attribute [local instance] Classical.propDecidable + +variable {C XP YP Mv : Type*} [PartialOrder C] [Fintype XP] [Fintype YP] [Fintype Mv] + +structure Net (C XP YP Mv : Type*) [PartialOrder C] where + inS : XP → C → Prop + inP : YP → C → Prop + monoS : ∀ q s s', s ≤ s' → inS q s → inS q s' + antiP : ∀ p t t', t ≤ t' → inP p t' → inP p t + A : XP → C + G : YP → C + hA : ∀ q, inS q (A q) + hG : ∀ p, inP p (G p) + src : Mv → C + tgt : Mv → C + hlt : ∀ m, src m < tgt m + +namespace Net + +variable (N : Net C XP YP Mv) + +noncomputable def nS (s : C) : ℕ := (univ.filter fun q => N.inS q s).card +noncomputable def mP (t : C) : ℕ := (univ.filter fun p => N.inP p t).card + +def Chain : C → List Mv → C → Prop + | a, [], b => a = b + | a, m :: ms, b => N.src m = a ∧ Chain (N.tgt m) ms b + +lemma chain_bounds : ∀ (a : C) (ℓ : List Mv) (b : C), N.Chain a ℓ b → + ∀ m ∈ ℓ, a ≤ N.src m ∧ N.tgt m ≤ b + | a, [], b, _, m, hm => absurd hm (List.not_mem_nil) + | a, m' :: ms, b, ⟨hs, hc⟩, m, hm => by + have hab : ∀ x ∈ ms, N.tgt m' ≤ N.src x ∧ N.tgt x ≤ b := chain_bounds _ ms b hc + have hend : N.tgt m' ≤ b := by + cases ms with + | nil => exact le_of_eq hc + | cons x xs => exact (le_of_lt (N.hlt x)).trans' ((hab x (by simp)).1) |>.trans (hab x (by simp)).2 + rcases List.mem_cons.mp hm with rfl | hm + · exact ⟨le_of_eq hs.symm, hend⟩ + · have := hab m hm + exact ⟨(le_of_eq hs.symm).trans ((le_of_lt (N.hlt m')).trans this.1), this.2⟩ + +lemma chain_nodup : ∀ (a : C) (ℓ : List Mv) (b : C), N.Chain a ℓ b → ℓ.Nodup + | a, [], b, _ => List.nodup_nil + | a, m :: ms, b, ⟨_, hc⟩ => by + refine List.nodup_cons.mpr ⟨fun hm => ?_, chain_nodup _ ms b hc⟩ + have := (N.chain_bounds _ ms b hc m hm).1 + exact absurd (lt_of_lt_of_le (N.hlt m) this) (lt_irrefl _) + +noncomputable def wt (c : C → C → ℝ) (m : Mv) : ℝ := + c (N.src m) (N.tgt m) / ((N.nS (N.src m) : ℝ) * N.mP (N.tgt m)) + +lemma users_card (P : Finset (YP × XP)) (path : YP × XP → List Mv) + (hpath : ∀ π ∈ P, N.Chain (N.A π.2) (path π) (N.G π.1)) (m : Mv) : + (P.filter fun π => m ∈ path π).card ≤ N.mP (N.tgt m) * N.nS (N.src m) := by + rw [mP, nS, ← card_product] + apply card_le_card + intro π hπ + rw [mem_filter] at hπ + have hb := N.chain_bounds _ _ _ (hpath π hπ.1) m hπ.2 + simp only [mem_product, mem_filter, mem_univ, true_and] + exact ⟨N.antiP π.1 _ _ hb.2 (N.hG π.1), N.monoS π.2 _ _ hb.1 (N.hA π.2)⟩ + +def ChartChain : C → List C → C → Prop + | a, [], b => a = b + | a, t :: ts, b => a < t ∧ ChartChain t ts b + +noncomputable def cw (c : C → C → ℝ) : C → List C → ℝ + | _, [] => 0 + | a, t :: ts => c a t / ((N.nS a : ℝ) * N.mP t) + cw c t ts + +/-- the shortest-path value `dist(a → b)` in the chart graph. -/ +noncomputable def dist (c : C → C → ℝ) (a b : C) : ℝ := + sInf {x | ∃ l, ChartChain a l b ∧ N.cw c a l = x} + +lemma cw_nonneg (c : C → C → ℝ) (hc0 : ∀ s t, 0 ≤ c s t) : ∀ a l, 0 ≤ N.cw c a l + | _, [] => le_rfl + | a, t :: ts => add_nonneg (div_nonneg (hc0 _ _) (by positivity)) (cw_nonneg c hc0 t ts) + +lemma chain_to_chart (c : C → C → ℝ) : ∀ (a : C) (ℓ : List Mv) (b : C), N.Chain a ℓ b → + ChartChain a (ℓ.map N.tgt) b ∧ N.cw c a (ℓ.map N.tgt) = (ℓ.map (N.wt c)).sum + | a, [], b, h => ⟨h, rfl⟩ + | a, m :: ms, b, ⟨hs, hc⟩ => by + obtain ⟨h1, h2⟩ := chain_to_chart c _ ms b hc + refine ⟨⟨hs ▸ N.hlt m, h1⟩, ?_⟩ + simp only [List.map_cons, cw, List.sum_cons, h2, wt, hs] + +lemma dist_le (c : C → C → ℝ) (hc0 : ∀ s t, 0 ≤ c s t) {a b : C} {ℓ : List Mv} + (h : N.Chain a ℓ b) : N.dist c a b ≤ (ℓ.map (N.wt c)).sum := by + obtain ⟨h1, h2⟩ := N.chain_to_chart c a ℓ b h + exact csInf_le ⟨0, fun x ⟨l, _, hx⟩ => hx ▸ N.cw_nonneg c hc0 a l⟩ ⟨_, h1, h2⟩ + +/-- the path bound without free moves: if every USED move is charged `w m ≥ c(src,tgt)`, then +`Σ_pairs dist ≤ Σ_m w m`. -/ +theorem bound0 (c : C → C → ℝ) (w : Mv → ℝ) (P : Finset (YP × XP)) (path : YP × XP → List Mv) + (hpath : ∀ π ∈ P, N.Chain (N.A π.2) (path π) (N.G π.1)) + (hc0 : ∀ s t, 0 ≤ c s t) (hw0 : ∀ m, 0 ≤ w m) + (hpay : ∀ m, (∃ π ∈ P, m ∈ path π) → c (N.src m) (N.tgt m) ≤ w m) : + ∑ π ∈ P, N.dist c (N.A π.2) (N.G π.1) ≤ ∑ m, w m := by + have s1 : ∑ π ∈ P, N.dist c (N.A π.2) (N.G π.1) ≤ ∑ π ∈ P, ((path π).map (N.wt c)).sum := + sum_le_sum fun π hπ => N.dist_le c hc0 (hpath π hπ) + have s2 : ∑ π ∈ P, ((path π).map (N.wt c)).sum + = ∑ m, ((P.filter fun π => m ∈ path π).card : ℝ) * N.wt c m := by + have e1 : ∀ π ∈ P, ((path π).map (N.wt c)).sum + = ∑ m, if m ∈ path π then N.wt c m else 0 := by + intro π hπ + rw [← List.sum_toFinset _ (N.chain_nodup _ _ _ (hpath π hπ)), ← sum_filter] + congr 1; ext m; simp + rw [sum_congr rfl e1, sum_comm] + refine sum_congr rfl fun m _ => ?_ + rw [← sum_filter, sum_const, nsmul_eq_mul] + have s3 : ∀ m, ((P.filter fun π => m ∈ path π).card : ℝ) * N.wt c m ≤ w m := by + intro m + by_cases hu : ∃ π ∈ P, m ∈ path π + · have hcard := N.users_card P path hpath m + obtain ⟨π, hπ, hm⟩ := hu + have hpos : 0 < (P.filter fun π => m ∈ path π).card := + card_pos.mpr ⟨π, mem_filter.mpr ⟨hπ, hm⟩⟩ + have hD : (0 : ℝ) < (N.nS (N.src m) : ℝ) * N.mP (N.tgt m) := by + have : 0 < N.mP (N.tgt m) * N.nS (N.src m) := lt_of_lt_of_le hpos hcard + rw [mul_comm]; exact_mod_cast this + have hle : ((P.filter fun π => m ∈ path π).card : ℝ) ≤ (N.nS (N.src m) : ℝ) * N.mP (N.tgt m) := by + rw [mul_comm]; exact_mod_cast hcard + have : ((P.filter fun π => m ∈ path π).card : ℝ) * N.wt c m ≤ c (N.src m) (N.tgt m) := by + rw [wt, mul_div_assoc', div_le_iff₀ hD] + exact mul_le_mul_of_nonneg_left hle (hc0 _ _) |>.trans_eq' (by ring) + exact this.trans (hpay m ⟨π, hπ, hm⟩) + · have : (P.filter fun π => m ∈ path π) = ∅ := by + ext π; simp only [mem_filter, Finset.notMem_empty, iff_false, not_and] + exact fun hπ hm => hu ⟨π, hπ, hm⟩ + simp [this, hw0 m] + calc _ ≤ _ := s1 + _ = _ := s2 + _ ≤ _ := sum_le_sum fun m _ => s3 m + +/-- **T1 (class M), path form.** Chart `z` (= chart 0) holds no X port (`n(0) = 0`). Every move +not leaving `z` is charged at least `c` (with `c = g9` on dims: `g9_nonneg`, `T1_Y_le`); moves out of +`z` (Y mains' first moves, the uncharged ones) may be charged anything `≥ 0`. Then +`Σ_{junk pairs} dist_c(A_q → G_p) ≤ Σ_m w m`; combined with `Σ_m w m ≤ public cost` (per register: +`T1_Y_le` for Y mains, equality for registers ending at V) this is T1's bound. -/ +theorem T1_bound (c : C → C → ℝ) (w : Mv → ℝ) (P : Finset (YP × XP)) (path : YP × XP → List Mv) + (hpath : ∀ π ∈ P, N.Chain (N.A π.2) (path π) (N.G π.1)) + (hc0 : ∀ s t, 0 ≤ c s t) (hw0 : ∀ m, 0 ≤ w m) (z : C) (hz : ∀ q, ¬ N.inS q z) + (hcharge : ∀ m, N.src m ≠ z → c (N.src m) (N.tgt m) ≤ w m) + (cost : ℝ) (hcost : ∑ m, w m ≤ cost) : + ∑ π ∈ P, N.dist c (N.A π.2) (N.G π.1) ≤ cost := by + refine (N.bound0 c w P path hpath hc0 hw0 fun m ⟨π, hπ, hm⟩ => hcharge m ?_).trans hcost + intro hzm + have := (N.chain_bounds _ _ _ (hpath π hπ) m hm).1 + rw [hzm] at this + exact hz π.2 (N.monoS π.2 _ _ this (N.hA π.2)) + +end Net + +end T1 + +/-! ## T1, linked to registers: total move charges ≤ public cost (JunkM op semantics) -/ + +section T1link + +attribute [local instance] Classical.propDecidable + +variable {C XP YP Mv R : Type*} [PartialOrder C] [Fintype XP] [Fintype YP] [Fintype Mv] [Fintype R] + +namespace Net + +variable (N : Net C XP YP Mv) + +lemma chain_append : ∀ (a : C) (ℓ : List Mv) (b : C) (m : Mv), N.Chain a ℓ b → N.src m = b → + N.Chain a (ℓ ++ [m]) (N.tgt m) + | a, [], b, m, h, hm => by simp only [Chain] at h; subst h; exact ⟨hm, rfl⟩ + | a, m' :: ms, b, m, ⟨hs, hc⟩, hm => ⟨hs, chain_append _ ms b m hc hm⟩ + +/-- register `i`'s moves up to time `n`, in time order: `mv t i` at each `t < n` where its chart +rises (JunkM's `mv t i`). -/ +noncomputable def movesOf (chart : ℕ → R → C) (mv : ℕ → R → Mv) (i : R) (n : ℕ) : List Mv := + ((List.range n).filter (fun t => decide (chart t i < chart (t + 1) i))).map (fun t => mv t i) + +/-- JunkM op semantics (b) charts never decrease, (c) `mv t i` goes `chart t i → chart (t+1) i` when +`i`'s chart rises: then `i`'s moves form a chain from its birth chart to its chart at time `n`. -/ +lemma movesOf_chain (chart : ℕ → R → C) (mv : ℕ → R → Mv) + (hmv : ∀ t i, chart t i < chart (t + 1) i → + N.src (mv t i) = chart t i ∧ N.tgt (mv t i) = chart (t + 1) i) + (hmono : ∀ t i, chart t i ≤ chart (t + 1) i) (i : R) : + ∀ n, N.Chain (chart 0 i) (movesOf chart mv i n) (chart n i) := by + intro n + induction n with + | zero => simp [movesOf, Chain] + | succ n ih => + by_cases hlt : chart n i < chart (n + 1) i + · have e : movesOf chart mv i (n + 1) = movesOf chart mv i n ++ [mv n i] := by + simp [movesOf, List.range_succ, List.filter_append, hlt] + obtain ⟨hs, ht⟩ := hmv n i hlt + rw [e, ← ht]; exact N.chain_append _ _ _ _ ih hs + · have e : movesOf chart mv i (n + 1) = movesOf chart mv i n := by + simp [movesOf, List.range_succ, List.filter_append, hlt] + have heq : chart (n + 1) i = chart n i := + ((hmono n i).lt_or_eq.resolve_left hlt).symm + rw [e, heq]; exact ih + +/-- the move costs along a chain telescope into `hsum` over the chain's dims. -/ +lemma chain_hsum (f : ℝ → ℝ) (e : ℝ) (dim : C → ℝ) : ∀ (a : C) (ℓ : List Mv) (b : C), N.Chain a ℓ b → + (ℓ.map fun m => h f e (dim (N.src m)) (dim (N.tgt m))).sum = + hsum f e (dim a :: ℓ.map fun m => dim (N.tgt m)) + | a, [], b, _ => by simp [hsum] + | a, m :: ms, b, ⟨hs, hc⟩ => by + simp only [List.map_cons, List.sum_cons, hsum] + rw [chain_hsum f e dim _ ms b hc, hs] + +lemma chain_last (dim : C → ℝ) : ∀ (a : C) (ℓ : List Mv) (b : C), N.Chain a ℓ b → + (dim a :: ℓ.map fun m => dim (N.tgt m)).getLast (List.cons_ne_nil _ _) = dim b + | a, [], b, hc => by simp only [Chain] at hc; subst hc; rfl + | a, m :: ms, b, ⟨_, hc⟩ => by + rw [List.map_cons, List.getLast_cons (List.cons_ne_nil _ _)] + exact chain_last dim _ ms b hc + +/-- the T1 edge price `c(s,t) = g9(dim s, dim t)` (clipped at 0, which changes nothing on real moves). -/ +noncomputable def cg (dim : C → ℕ) (s t : C) : ℝ := max (h fL 9 (dim s) (dim t)) 0 + +/-- the T1 move charge: moves out of chart `z` (= chart 0; Y mains' first moves) are uncharged, every +other move is charged `c(src, tgt)`. -/ +noncomputable def wz (dim : C → ℕ) (z : C) (m : Mv) : ℝ := + if N.src m = z then 0 else cg dim (N.src m) (N.tgt m) + +lemma cg_eq (dim : C → ℕ) (hdim : StrictMono dim) (s t : C) (hst : s < t) (ht : dim t ≤ 9) : + cg dim s t = h fL 9 (dim s) (dim t) := by + have h1 : (dim s : ℝ) ≤ dim t := by exact_mod_cast (hdim hst).le + have h2 : (dim t : ℝ) ≤ 9 := by exact_mod_cast ht + exact max_eq_left (g9_nonneg _ _ h1 h2) + +/-- a register ending at V (dim 9): its charges are at most its real cost `Σ h_9`. -/ +lemma reg_le_V (dim : C → ℕ) (hdim : StrictMono dim) (z : C) (a : C) (ℓ : List Mv) (b : C) + (hc : N.Chain a ℓ b) (hb : dim b ≤ 9) : + (ℓ.map (N.wz dim z)).sum ≤ hsum fL 9 ((dim a : ℝ) :: ℓ.map fun m => (dim (N.tgt m) : ℝ)) := by + rw [← N.chain_hsum fL 9 (fun c => (dim c : ℝ)) a ℓ b hc] + apply List.sum_le_sum + intro m hm + have hbd := N.chain_bounds a ℓ b hc m hm + have ht9 : dim (N.tgt m) ≤ 9 := (hdim.monotone hbd.2).trans hb + have hceq := cg_eq dim hdim _ _ (N.hlt m) ht9 + have h1 : (dim (N.src m) : ℝ) ≤ dim (N.tgt m) := by exact_mod_cast (hdim (N.hlt m)).le + have h2 : (dim (N.tgt m) : ℝ) ≤ 9 := by exact_mod_cast ht9 + unfold wz; split_ifs + · exact g9_nonneg _ _ h1 h2 + · exact hceq.le + +/-- a Y main (born at chart `z`, dim 0; ends at `G_p`, dim 8): charges ≤ real cost `Σ h_8` +(the first move is uncharged; `T1_Y_le`). -/ +lemma reg_le_Y (dim : C → ℕ) (hdim : StrictMono dim) (z : C) (hz0 : dim z = 0) (ℓ : List Mv) (b : C) + (hc : N.Chain z ℓ b) (hb : dim b = 8) : + (ℓ.map (N.wz dim z)).sum ≤ hsum fL 8 ((dim z : ℝ) :: ℓ.map fun m => (dim (N.tgt m) : ℝ)) := by + cases ℓ with + | nil => simp only [Chain] at hc; subst hc; omega + | cons m1 rest => + obtain ⟨hs1, hc'⟩ := hc + have hw1 : N.wz dim z m1 = 0 := by simp [wz, hs1] + have hrest : (rest.map (N.wz dim z)) = rest.map fun m => h fL 9 (dim (N.src m)) (dim (N.tgt m)) := by + apply List.map_congr_left + intro m hm + have hbd := N.chain_bounds _ rest b hc' m hm + have hpos : 0 < dim (N.src m) := by + have := hdim (lt_of_lt_of_le (hs1 ▸ N.hlt m1) hbd.1); omega + have hne : N.src m ≠ z := fun e => by rw [e] at hpos; omega + have ht9 : dim (N.tgt m) ≤ 9 := by have := hdim.monotone hbd.2; omega + simp only [wz, hne, if_false] + exact cg_eq dim hdim _ _ (N.hlt m) ht9 + rw [List.map_cons, List.sum_cons, hw1, zero_add, hrest, + N.chain_hsum fL 9 (fun c => (dim c : ℝ)) _ rest b hc', List.map_cons, hz0, Nat.cast_zero] + have hd1 : 0 < dim (N.tgt m1) := by have := hdim (hs1 ▸ N.hlt m1); omega + have hd8 : dim (N.tgt m1) ≤ 8 := by + have := hdim.monotone (show N.tgt m1 ≤ b from by + cases rest with + | nil => exact le_of_eq hc' + | cons x xs => + have hx := N.chain_bounds _ (x :: xs) b hc' x (by simp) + exact (le_of_lt (N.hlt x)).trans' hx.1 |>.trans hx.2) + omega + apply T1_Y_le + · exact_mod_cast hd1 + · exact_mod_cast hd8 + · rw [N.chain_last (fun c => (dim c : ℝ)) _ rest b hc', hb]; norm_num + +lemma list_range_filter_sum (n : ℕ) (p : ℕ → Prop) (g : ℕ → ℝ) : + (((List.range n).filter (fun t => decide (p t))).map g).sum = + ∑ t ∈ Finset.range n, if p t then g t else 0 := by + induction n with + | zero => simp + | succ n ih => + rw [List.range_succ, List.filter_append, List.map_append, List.sum_append, ih, + Finset.sum_range_succ] + by_cases hp : p n <;> simp [hp] + +/-- **T1, Σ_m w_m ≤ public cost, as a theorem.** JunkM op semantics: charts never decrease, +`mv t i` is register `i`'s move `chart t i → chart (t+1) i` when its chart rises, and the moves are +exactly these (each move is `mv t i` for exactly one rising step `t < n`). Charts carry a strictly +monotone dim (`z` = chart 0, dim 0). Model M: a Y main (`Ym`) is born at `z` and ends at dim 8, every +other register ends at V (dim 9). The public cost is `Σ_i h-sum` over each register's dim chain +(I1), with `e = 8` for Y mains and `9` otherwise. -/ +theorem T1_cost (chart : ℕ → R → C) (mv : ℕ → R → Mv) (n : ℕ) + (hmv : ∀ t i, chart t i < chart (t + 1) i → + N.src (mv t i) = chart t i ∧ N.tgt (mv t i) = chart (t + 1) i) + (hmono : ∀ t i, chart t i ≤ chart (t + 1) i) + (hsurj : ∀ m, ∃ t < n, ∃ i, chart t i < chart (t + 1) i ∧ mv t i = m) + (hinj : ∀ t t' i i', chart t i < chart (t + 1) i → chart t' i' < chart (t' + 1) i' → + mv t i = mv t' i' → t = t' ∧ i = i') + (dim : C → ℕ) (hdim : StrictMono dim) (z : C) (hz0 : dim z = 0) (Ym : Finset R) + (hY : ∀ i ∈ Ym, chart 0 i = z ∧ dim (chart n i) = 8) (hV : ∀ i ∉ Ym, dim (chart n i) = 9) : + ∑ m, N.wz dim z m ≤ ∑ i, hsum fL (if i ∈ Ym then 8 else 9) + ((dim (chart 0 i) : ℝ) :: (movesOf chart mv i n).map fun m => (dim (N.tgt m) : ℝ)) := by + have hsplit : ∑ m, N.wz dim z m = ∑ i, ((movesOf chart mv i n).map (N.wz dim z)).sum := by + have e1 : ∀ i, ((movesOf chart mv i n).map (N.wz dim z)).sum = + ∑ t ∈ Finset.range n, if chart t i < chart (t + 1) i then N.wz dim z (mv t i) else 0 := by + intro i; rw [movesOf, List.map_map]; exact list_range_filter_sum n _ _ + simp_rw [e1] + rw [Finset.sum_comm, ← Finset.sum_product (s := Finset.range n) (t := Finset.univ) + (f := fun x : ℕ × R => if chart x.1 x.2 < chart (x.1 + 1) x.2 then N.wz dim z (mv x.1 x.2) else 0), + ← Finset.sum_filter] + symm + refine Finset.sum_bij (fun x _ => mv x.1 x.2) (fun _ _ => Finset.mem_univ _) ?_ ?_ (fun _ _ => rfl) + · rintro ⟨t, i⟩ h1 ⟨t', i'⟩ h2 he + simp only [Finset.mem_filter] at h1 h2 + obtain ⟨rfl, rfl⟩ := hinj t t' i i' h1.2 h2.2 he; rfl + · intro m _ + obtain ⟨t, ht, i, hr, rfl⟩ := hsurj m + exact ⟨(t, i), by simp [ht, hr], rfl⟩ + rw [hsplit] + refine Finset.sum_le_sum fun i _ => ?_ + have hc := N.movesOf_chain chart mv hmv hmono i n + by_cases hi : i ∈ Ym + · obtain ⟨h0, h8⟩ := hY i hi + rw [if_pos hi, h0]; rw [h0] at hc + exact N.reg_le_Y dim hdim z hz0 _ _ hc h8 + · rw [if_neg hi] + exact N.reg_le_V dim hdim z _ _ _ hc (by rw [hV i hi]) + +/-- **T1 (class M), full form.** Under the hypotheses of `T1_cost`, with chart `z` holding no X port +and a move chain `A_q → G_p` for every junk pair (JunkM `hpath_of_junk`): +`Σ_{junk pairs} dist_{g9}(A_q → G_p) ≤ public cost`. -/ +theorem T1_full (chart : ℕ → R → C) (mv : ℕ → R → Mv) (n : ℕ) + (hmv : ∀ t i, chart t i < chart (t + 1) i → + N.src (mv t i) = chart t i ∧ N.tgt (mv t i) = chart (t + 1) i) + (hmono : ∀ t i, chart t i ≤ chart (t + 1) i) + (hsurj : ∀ m, ∃ t < n, ∃ i, chart t i < chart (t + 1) i ∧ mv t i = m) + (hinj : ∀ t t' i i', chart t i < chart (t + 1) i → chart t' i' < chart (t' + 1) i' → + mv t i = mv t' i' → t = t' ∧ i = i') + (dim : C → ℕ) (hdim : StrictMono dim) (z : C) (hz0 : dim z = 0) (Ym : Finset R) + (hY : ∀ i ∈ Ym, chart 0 i = z ∧ dim (chart n i) = 8) (hV : ∀ i ∉ Ym, dim (chart n i) = 9) + (hz : ∀ q, ¬ N.inS q z) + (P : Finset (YP × XP)) (path : YP × XP → List Mv) + (hpath : ∀ π ∈ P, N.Chain (N.A π.2) (path π) (N.G π.1)) : + ∑ π ∈ P, N.dist (cg dim) (N.A π.2) (N.G π.1) ≤ ∑ i, hsum fL (if i ∈ Ym then 8 else 9) + ((dim (chart 0 i) : ℝ) :: (movesOf chart mv i n).map fun m => (dim (N.tgt m) : ℝ)) := + N.T1_bound (cg dim) (N.wz dim z) P path hpath (fun _ _ => le_max_right _ _) + (fun m => by unfold wz; split_ifs; exact le_rfl; exact le_max_right _ _) z hz + (fun m hm => by simp [wz, hm]) _ + (N.T1_cost chart mv n hmv hmono hsurj hinj dim hdim z hz0 Ym hY hV) + +end Net + +end T1link + + + +/-! ## T3. Slot lemma (level 7) -/ + +section T3 + +open Module Submodule + +variable {K V Reg D C : Type*} [Field K] [AddCommGroup V] [Module K V] [FiniteDimensional K V] + [DecidableEq Reg] [Fintype D] + +/-- **T3 slot lemma.** Data at level 7 (all T2 outputs are hypotheses): +* `Cr` = crossers of level 7 with crossing rows `ρ μ`, linearly independent (T2(a)); +* `B0` = registers born at chart 0 with tokens `tok b`; `S0 = span tok(B0)`; +* `W ⊆ Cr ∩ B0` = 0-born registers jumping from chart 0 straight to dim 8/9; their crossing rows lie + in `S0` (chart 0 holds only 0-born tokens); `Z = (B0 ∩ Cr) \ W` (0-born, cross after a paid stop); +* `P` fixes every crossing row and kills the tokens of 0-born registers that never cross + (a projection onto span ρ(Cr) along the stayer tokens; it exists because these are complementary, + T2 proof — see `proj_exists`); +* for `p ∈ D`: `y p = Σ_μ A p μ • ρ μ` (T2(b)), where a non-`W` crosser has `A p μ ≠ 0` only if it + lands at `G p` (a level-7 crosser landing `≤ G_p`, dim 8, lands AT `G_p`), and `G` is injective; +* `y p = x p + e p` with `e p ∈ S0` (Y_p's token) and `0 ≠ x p ∈ X`, `X ⊓ S0 = ⊥` (X content and + 0-born tokens are different coordinates). +Then `|D| ≤ rank{x_p} + |Z|`. No directness of the `Y_p`, `p ∈ D`, is needed. -/ +theorem slot_lemma (Cr B0 W : Finset Reg) (hW : W ⊆ B0 ∩ Cr) + (ρ tok : Reg → V) (P : V →ₗ[K] V) + (hind : ∀ g : Reg → K, ∑ μ ∈ Cr, g μ • ρ μ = 0 → ∀ μ ∈ Cr, g μ = 0) + (hPρ : ∀ μ ∈ Cr, P (ρ μ) = ρ μ) + (hPst : ∀ b ∈ B0, b ∉ Cr → P (tok b) = 0) + (hWS0 : ∀ μ ∈ W, ρ μ ∈ span K (tok '' (B0 : Set Reg))) + (land : Reg → C) (G : D → C) (hG : Function.Injective G) + (y x e : D → V) (A : D → Reg → K) + (hT2b : ∀ p, y p = ∑ μ ∈ Cr, A p μ • ρ μ) + (hsupp : ∀ p, ∀ μ ∈ Cr, μ ∉ W → A p μ ≠ 0 → land μ = G p) + (hy : ∀ p, y p = x p + e p) (he : ∀ p, e p ∈ span K (tok '' (B0 : Set Reg))) + (X : Submodule K V) (hx : ∀ p, x p ∈ X) (hXS : X ⊓ span K (tok '' (B0 : Set Reg)) = ⊥) + (hx0 : ∀ p, x p ≠ 0) : + Fintype.card D ≤ finrank K (span K (Set.range x)) + ((B0 ∩ Cr) \ W).card := by + classical + set S0 := span K (tok '' (B0 : Set Reg)) with hS0 + -- step 1: every y p has a non-W crosser in its expansion + have hyW : ∀ p, ∃ μ ∈ Cr, μ ∉ W ∧ A p μ ≠ 0 := by + intro p; by_contra hcon; push Not at hcon + have hyS : y p ∈ S0 := by + rw [hT2b p] + refine Submodule.sum_mem _ fun μ hμ => ?_ + by_cases hμW : μ ∈ W + · exact Submodule.smul_mem _ _ (hWS0 μ hμW) + · rw [hcon μ hμ hμW, zero_smul]; exact Submodule.zero_mem _ + have hxS : x p ∈ S0 := by + have : x p = y p - e p := by rw [hy p]; abel + rw [this]; exact Submodule.sub_mem _ hyS (he p) + have : x p ∈ X ⊓ S0 := ⟨hx p, hxS⟩ + rw [hXS] at this + exact hx0 p ((Submodule.mem_bot K).mp this) + -- step 2: the family (y_p)_{p ∈ D} ⊔ (ρ_h)_{h ∈ W} is linearly independent + let F : D ⊕ W → V := Sum.elim y (fun h => ρ h) + have hF : LinearIndependent K F := by + rw [Fintype.linearIndependent_iff] + intro g hg + let gW : Reg → K := fun μ => if hμ : μ ∈ W then g (Sum.inr ⟨μ, hμ⟩) else 0 + let coef : Reg → K := fun μ => (∑ p, g (Sum.inl p) * A p μ) + gW μ + have hW' : ∑ h : W, g (Sum.inr h) • ρ h = ∑ μ ∈ Cr, gW μ • ρ μ := by + rw [← Finset.sum_subset (fun μ hμ => (mem_inter.mp (hW hμ)).2) + (fun μ _ hμ => by simp [gW, hμ])] + rw [← Finset.sum_attach W] + refine Finset.sum_congr rfl fun h _ => ?_ + simp [gW, h.2] + have hsum : ∑ μ ∈ Cr, coef μ • ρ μ = 0 := by + rw [← hg, Fintype.sum_sum_type] + simp only [F, Sum.elim_inl, Sum.elim_inr, hT2b, Finset.smul_sum, smul_smul, coef, add_smul, + Finset.sum_add_distrib, Finset.sum_smul] + rw [hW', Finset.sum_comm] + have hc := hind coef hsum + -- non-W crossers: only one p contributes + have hone : ∀ μ ∈ Cr, μ ∉ W → ∀ p, g (Sum.inl p) * A p μ = 0 := by + intro μ hμ hμW p + have h0 : coef μ = 0 := hc μ hμ + simp only [coef, gW, hμW, dite_false, add_zero] at h0 + by_cases hA2 : A p μ = 0 + · simp [hA2] + rw [Finset.sum_eq_single p] at h0 + · exact h0 + · intro p' _ hp' + by_cases hA : A p' μ = 0 + · simp [hA] + exact absurd (hG ((hsupp p' μ hμ hμW hA).symm.trans (hsupp p μ hμ hμW hA2))) hp' + · simp + have hD0 : ∀ p, g (Sum.inl p) = 0 := by + intro p + obtain ⟨μ, hμ, hμW, hA⟩ := hyW p + exact (mul_eq_zero.mp (hone μ hμ hμW p)).resolve_right hA + rintro (p | ⟨μ, hμW⟩) + · exact hD0 p + · have h0 : coef μ = 0 := hc μ (mem_inter.mp (hW hμW)).2 + simp only [coef, gW, hμW, dite_true, hD0, zero_mul, Finset.sum_const_zero, zero_add] at h0 + exact h0 + -- step 3: the family lies in span(P x) ⊔ E + let E : Submodule K V := span K (((B0 ∩ Cr).image fun b => P (tok b) : Finset V) : Set V) + have hPS0 : ∀ v ∈ S0, P v ∈ E := by + have : S0.map P ≤ E := by + rw [hS0, Submodule.map_span, Submodule.span_le] + rintro _ ⟨_, ⟨b, hb, rfl⟩, rfl⟩ + by_cases hbC : b ∈ Cr + · exact Submodule.subset_span (by simp only [coe_image, coe_inter]; exact ⟨b, ⟨hb, hbC⟩, rfl⟩) + · simp only [SetLike.mem_coe]; rw [hPst b hb hbC]; exact Submodule.zero_mem _ + exact fun v hv => this (Submodule.mem_map_of_mem hv) + set Sx := span K (Set.range fun p => P (x p)) + have hrange : Set.range F ⊆ (Sx ⊔ E : Submodule K V) := by + rintro _ ⟨i, rfl⟩ + rcases i with p | ⟨μ, hμW⟩ + · have hPy : P (y p) = y p := by + rw [hT2b p, map_sum] + exact Finset.sum_congr rfl fun μ hμ => by rw [map_smul, hPρ μ hμ] + show y p ∈ Sx ⊔ E + rw [← hPy, hy p, map_add] + exact Submodule.add_mem _ (Submodule.mem_sup_left (Submodule.subset_span ⟨p, rfl⟩)) + (Submodule.mem_sup_right (hPS0 _ (he p))) + · show ρ μ ∈ Sx ⊔ E + rw [← hPρ μ (mem_inter.mp (hW hμW)).2] + exact Submodule.mem_sup_right (hPS0 _ (hWS0 μ hμW)) + -- step 4: count + have h1 : Fintype.card (D ⊕ W) ≤ finrank K (Sx ⊔ E : Submodule K V) := by + rw [← finrank_span_eq_card hF] + exact Submodule.finrank_mono (Submodule.span_le.mpr hrange) + have h2 := Submodule.finrank_add_le_finrank_add_finrank Sx E + have h3 : finrank K Sx ≤ finrank K (span K (Set.range x)) := by + have : Sx = (span K (Set.range x)).map P := by + rw [Submodule.map_span, ← Set.range_comp]; rfl + rw [this]; exact Submodule.finrank_map_le _ _ + have h4 : finrank K E ≤ (B0 ∩ Cr).card := + (finrank_span_finset_le_card _).trans Finset.card_image_le + have h5 : (B0 ∩ Cr).card = W.card + ((B0 ∩ Cr) \ W).card := by + rw [add_comm, Finset.card_sdiff_add_card_eq_card hW] + rw [Fintype.card_sum, Fintype.card_coe] at h1 + omega + +/-- the projection `P` of T3 exists whenever the crossing span and the stayer-token span are +complementary (T2's proof gives exactly this). -/ +theorem proj_exists (R Q : Submodule K V) (hRQ : IsCompl R Q) : + ∃ P : V →ₗ[K] V, (∀ v ∈ R, P v = v) ∧ (∀ v ∈ Q, P v = 0) := by + refine ⟨R.subtype ∘ₗ Submodule.projectionOnto R Q hRQ, fun v hv => ?_, fun v hv => ?_⟩ + · simp [Submodule.projectionOnto_apply_of_mem_left hRQ hv] + · simp [Submodule.projectionOnto_apply_of_mem_right hRQ hv] + +end T3 + +/-! ## T2. Crossing-basis lemma (complementarity), from the level-k op semantics -/ + +section T2 + +open Module Submodule + +/-- dimension count: if `a ⊔ b = ⊤`, `dim a ≤ m`, `dim b ≤ n` and `dim V = m + n`, then `a`, `b` +are complementary and both bounds are equalities. -/ +lemma compl_of_sup {K V : Type*} [Field K] [AddCommGroup V] [Module K V] [FiniteDimensional K V] + (a b : Submodule K V) (m n : ℕ) (hsup : a ⊔ b = ⊤) (ha : finrank K a ≤ m) (hb : finrank K b ≤ n) + (hV : finrank K V = m + n) : IsCompl a b ∧ finrank K a = m ∧ finrank K b = n := by + have h := Submodule.finrank_sup_add_finrank_inf_eq a b + rw [hsup, finrank_top, hV] at h + have h0 : finrank K (a ⊓ b : Submodule K V) = 0 := by omega + refine ⟨⟨disjoint_iff.mpr (Submodule.finrank_eq_zero.mp h0), codisjoint_iff.mpr hsup⟩, by omega, + by omega⟩ + +lemma finrank_span_image_le {K V ι : Type*} [Field K] [AddCommGroup V] [Module K V] + (s : Finset ι) (f : ι → V) : finrank K (span K (f '' (s : Set ι))) ≤ s.card := by + classical + rw [← Finset.coe_image]; exact (finrank_span_finset_le_card _).trans Finset.card_image_le + +variable {K Reg : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] + +/-- ops seen at level `k`: an ADD `row_i += c·row_j` (co-present, so on the same side of level `k`), +or register `i` crossing level `k` (its first move from dim `≤ k` to dim `> k`). Moves that do not +cross level `k` change neither rows nor sides, so they are omitted. -/ +inductive LOp (K Reg : Type*) + | add (i j : Reg) (c : K) + | cross (i : Reg) + +/-- rows (initial-row coordinates), registers above level `k`, crossers so far, crossing rows. -/ +structure LSt (K Reg : Type*) where + row : Reg → Reg → K + ab : Finset Reg + cr : Finset Reg + rho : Reg → Reg → K + +def lstep : LSt K Reg → LOp K Reg → LSt K Reg + | s, .add i j c => ⟨Function.update s.row i (s.row i + c • s.row j), s.ab, s.cr, s.rho⟩ + | s, .cross i => ⟨s.row, insert i s.ab, insert i s.cr, Function.update s.rho i (s.row i)⟩ + +def lrun : LSt K Reg → List (LOp K Reg) → LSt K Reg + | s, [] => s + | s, op :: ops => lrun (lstep s op) ops + +/-- legality: an ADD has `i ≠ j` (an invertible public op) and both registers on the same side of +level `k` (co-presence at one chart); a crossing register is still at dim `≤ k`. -/ +def LLegal : LSt K Reg → List (LOp K Reg) → Prop + | _, [] => True + | s, .add i j c :: ops => (i ≠ j ∧ (i ∈ s.ab ↔ j ∈ s.ab)) ∧ LLegal (lstep s (.add i j c)) ops + | s, .cross i :: ops => i ∉ s.ab ∧ LLegal (lstep s (.cross i)) ops + +/-- time 0: every register holds its own token; `B` = registers born at dim `≤ k`, the rest are +above level `k` already. -/ +def lstart (B : Finset Reg) : LSt K Reg := ⟨fun r => Pi.single r 1, univ \ B, ∅, fun _ => 0⟩ + +/-- the run invariant (for any linear `L` that kills the tokens of registers born above `k`). -/ +structure LInv {W : Type*} [AddCommGroup W] [Module K W] (B : Finset Reg) (L : (Reg → K) →ₗ[K] W) + (s : LSt K Reg) : Prop where + crB : s.cr ⊆ B + ab_iff : ∀ r, r ∈ s.ab ↔ (r ∉ B ∨ r ∈ s.cr) + up : ∀ r ∈ s.ab, L (s.row r) ∈ span K ((fun μ => L (s.rho μ)) '' (s.cr : Set Reg)) + top : span K (Set.range s.row) = ⊤ + +lemma linv_start {W : Type*} [AddCommGroup W] [Module K W] (B : Finset Reg) + (L : (Reg → K) →ₗ[K] W) (hL : ∀ r, r ∉ B → L (Pi.single r 1) = 0) : + LInv B L (lstart (K := K) B) where + crB := by simp [lstart] + ab_iff := by intro r; simp [lstart] + up := by + intro r hr + simp only [lstart, mem_sdiff, mem_univ, true_and] at hr + simp only [lstart]; rw [hL r hr]; exact Submodule.zero_mem _ + top := by + have : Set.range (fun r : Reg => (Pi.single r (1 : K) : Reg → K)) = + Set.range (Pi.basisFun K Reg) := by + congr 1; funext r; simp + simp only [lstart]; rw [this]; exact (Pi.basisFun K Reg).span_eq + +lemma linv_step {W : Type*} [AddCommGroup W] [Module K W] (B : Finset Reg) + (L : (Reg → K) →ₗ[K] W) (s : LSt K Reg) (op : LOp K Reg) (hI : LInv B L s) + (hop : match op with + | .add i j _ => i ≠ j ∧ (i ∈ s.ab ↔ j ∈ s.ab) + | .cross i => i ∉ s.ab) : + LInv B L (lstep s op) := by + cases op with + | add i j c => + obtain ⟨hij, hside⟩ := hop + refine ⟨hI.crB, hI.ab_iff, ?_, ?_⟩ + · intro r hr + simp only [lstep] at hr ⊢ + by_cases hri : r = i + · subst hri + rw [Function.update_self, map_add, map_smul] + exact Submodule.add_mem _ (hI.up r hr) (Submodule.smul_mem _ _ (hI.up j (hside.mp hr))) + · rw [Function.update_of_ne hri]; exact hI.up r hr + · rw [eq_top_iff, ← hI.top, Submodule.span_le] + rintro _ ⟨r, rfl⟩ + simp only [lstep] + set u := Function.update s.row i (s.row i + c • s.row j) with hu + by_cases hri : r = i + · subst hri + have e1 : s.row r = u r - c • u j := by + rw [hu, Function.update_self, Function.update_of_ne (Ne.symm hij)]; abel + rw [e1] + exact Submodule.sub_mem _ (Submodule.subset_span ⟨r, rfl⟩) + (Submodule.smul_mem _ _ (Submodule.subset_span ⟨j, rfl⟩)) + · have : s.row r = u r := by + rw [hu, Function.update_of_ne hri] + rw [this]; exact Submodule.subset_span ⟨r, rfl⟩ + | cross i => + have hiB : i ∈ B := by + by_contra h; exact hop ((hI.ab_iff i).mpr (Or.inl h)) + have hicr : i ∉ s.cr := fun h => hop ((hI.ab_iff i).mpr (Or.inr h)) + have hmono : span K ((fun μ => L (s.rho μ)) '' (s.cr : Set Reg)) ≤ + span K ((fun μ => L (Function.update s.rho i (s.row i) μ)) '' ((insert i s.cr : Finset Reg) : Set Reg)) := by + apply Submodule.span_mono + rintro _ ⟨μ, hμ, rfl⟩ + have hμi : μ ≠ i := fun e => hicr (e ▸ hμ) + refine ⟨μ, by simp [hμ], ?_⟩ + simp [Function.update_of_ne hμi] + refine ⟨?_, ?_, ?_, hI.top⟩ + · simp only [lstep]; exact Finset.insert_subset hiB hI.crB + · intro r; simp only [lstep, mem_insert] + rw [hI.ab_iff r]; tauto + · intro r hr + simp only [lstep, mem_insert] at hr ⊢ + rcases hr with rfl | hr + · apply Submodule.subset_span + exact ⟨r, by simp, by simp⟩ + · exact hmono (hI.up r hr) + +lemma linv_run {W : Type*} [AddCommGroup W] [Module K W] (B : Finset Reg) + (L : (Reg → K) →ₗ[K] W) : ∀ (s : LSt K Reg) (ops : List (LOp K Reg)), + LInv B L s → LLegal s ops → LInv B L (lrun s ops) + | s, [], hI, _ => hI + | s, .add i j c :: ops, hI, ⟨h, hL⟩ => linv_run B L _ ops (linv_step B L s _ hI h) hL + | s, .cross i :: ops, hI, ⟨h, hL⟩ => linv_run B L _ ops (linv_step B L s _ hI h) hL + +/-- restriction to the coordinates of registers born at dim `≤ k`. -/ +def resB (B : Finset Reg) : (Reg → K) →ₗ[K] (B → K) := LinearMap.funLeft K K (Subtype.val) + +lemma resB_single (B : Finset Reg) (r : Reg) (hr : r ∉ B) : resB B (Pi.single r (1 : K)) = 0 := by + funext b + have : (b : Reg) ≠ r := fun e => hr (e ▸ b.2) + simp [resB, LinearMap.funLeft_apply, Pi.single_apply, this] + +/-- **T2 (crossing-basis lemma), from the op semantics.** Run legal level-`k` ops from time 0 +(`B` = registers born at dim `≤ k`). Class-N hypothesis: every stayer (born `≤ k`, never crosses) +ends as its own token. Restrict rows to the coordinates of `B` (`resB`). Then +* `cr ⊆ B`; +* (complementarity) the crossing rows and the stayer tokens span complementary subspaces of `B → K`; +* (T2(a)) the crossing rows are linearly independent; +* (T2(b), existence) every register above level `k` at the end (born above, or crossed) has its + restricted final row in the span of the crossing rows. -/ +theorem T2_run (B : Finset Reg) (ops : List (LOp K Reg)) (hL : LLegal (lstart B) ops) + (hst : ∀ r ∈ B, r ∉ (lrun (lstart B) ops).cr → (lrun (lstart B) ops).row r = Pi.single r 1) : + (lrun (lstart (K := K) B) ops).cr ⊆ B ∧ + IsCompl (span K ((fun μ => resB B ((lrun (lstart B) ops).rho μ)) '' ((lrun (lstart B) ops).cr : Set Reg))) + (span K ((fun b => resB B (Pi.single b (1 : K))) '' ((B \ (lrun (lstart B) ops).cr : Finset Reg) : Set Reg))) ∧ + LinearIndependent K (fun μ : (lrun (lstart (K := K) B) ops).cr => resB B ((lrun (lstart B) ops).rho μ)) ∧ + (∀ r, r ∉ B ∨ r ∈ (lrun (lstart (K := K) B) ops).cr → + resB B ((lrun (lstart B) ops).row r) ∈ + span K ((fun μ => resB B ((lrun (lstart B) ops).rho μ)) '' ((lrun (lstart B) ops).cr : Set Reg))) := by + classical + set s := lrun (lstart (K := K) B) ops + have hI : LInv B (resB B) s := linv_run B (resB B) _ ops (linv_start B _ (resB_single B)) hL + set a := span K ((fun μ => resB B (s.rho μ)) '' (s.cr : Set Reg)) + set b := span K ((fun b => resB B (Pi.single b (1 : K))) '' ((B \ s.cr : Finset Reg) : Set Reg)) + have hsup : a ⊔ b = ⊤ := by + have hsurj : Function.Surjective (resB (K := K) B) := + LinearMap.funLeft_surjective_of_injective _ _ _ Subtype.val_injective + rw [eq_top_iff, ← LinearMap.range_eq_top.mpr hsurj, LinearMap.range_eq_map, ← hI.top, + Submodule.map_span, Submodule.span_le] + rintro _ ⟨_, ⟨r, rfl⟩, rfl⟩ + by_cases hr : r ∈ s.ab + · exact Submodule.mem_sup_left (hI.up r hr) + · have hrB : r ∈ B := by by_contra h; exact hr ((hI.ab_iff r).mpr (Or.inl h)) + have hrc : r ∉ s.cr := fun h => hr ((hI.ab_iff r).mpr (Or.inr h)) + apply Submodule.mem_sup_right + rw [hst r hrB hrc] + exact Submodule.subset_span ⟨r, by simp [hrB, hrc], rfl⟩ + have ha : finrank K a ≤ s.cr.card := finrank_span_image_le _ _ + have hb : finrank K b ≤ (B \ s.cr).card := finrank_span_image_le _ _ + have hV : finrank K (B → K) = s.cr.card + (B \ s.cr).card := by + rw [Module.finrank_fintype_fun_eq_card, Fintype.card_coe, add_comm, + Finset.card_sdiff_add_card_eq_card hI.crB] + obtain ⟨hc, hfa, -⟩ := compl_of_sup a b _ _ hsup ha hb hV + refine ⟨hI.crB, hc, ?_, fun r hr => hI.up r ((hI.ab_iff r).mpr hr)⟩ + rw [linearIndependent_iff_card_eq_finrank_span, Set.finrank] + have : Set.range (fun μ : s.cr => resB B (s.rho μ)) = (fun μ => resB B (s.rho μ)) '' (s.cr : Set Reg) := by + ext v; simp + rw [this, Fintype.card_coe]; exact hfa.symm + +end T2 + +/-! ### T3 with T2 discharged -/ + +section T3T2 + +open Module Submodule + +/-- **T3 with the complementarity discharged.** `slot_lemma` with its T2 hypotheses (independence of +the crossing rows, and the projection `P`) replaced by the T2 data: the crossing rows `ρ(Cr)` and the +stayer tokens `tok(St)` span `V`, `dim V = |Cr| + |St|`, and every 0-born non-crosser is a stayer. +(`T2_run` derives exactly this from the op semantics, with `V = B → K`.) -/ +theorem slot_lemma_T2 {K V Reg D C : Type*} [Field K] [AddCommGroup V] [Module K V] + [FiniteDimensional K V] [DecidableEq Reg] [Fintype D] + (Cr B0 W St : Finset Reg) (hW : W ⊆ B0 ∩ Cr) (ρ tok : Reg → V) + (hsup : span K (ρ '' (Cr : Set Reg)) ⊔ span K (tok '' (St : Set Reg)) = ⊤) + (hdim : finrank K V = Cr.card + St.card) + (hSt : ∀ b ∈ B0, b ∉ Cr → b ∈ St) + (hWS0 : ∀ μ ∈ W, ρ μ ∈ span K (tok '' (B0 : Set Reg))) + (land : Reg → C) (G : D → C) (hG : Function.Injective G) + (y x e : D → V) (A : D → Reg → K) + (hT2b : ∀ p, y p = ∑ μ ∈ Cr, A p μ • ρ μ) + (hsupp : ∀ p, ∀ μ ∈ Cr, μ ∉ W → A p μ ≠ 0 → land μ = G p) + (hy : ∀ p, y p = x p + e p) (he : ∀ p, e p ∈ span K (tok '' (B0 : Set Reg))) + (X : Submodule K V) (hx : ∀ p, x p ∈ X) (hXS : X ⊓ span K (tok '' (B0 : Set Reg)) = ⊥) + (hx0 : ∀ p, x p ≠ 0) : + Fintype.card D ≤ finrank K (span K (Set.range x)) + ((B0 ∩ Cr) \ W).card := by + obtain ⟨hc, hfa, -⟩ := compl_of_sup _ _ _ _ hsup (finrank_span_image_le _ _) + (finrank_span_image_le _ _) hdim + obtain ⟨P, hP1, hP2⟩ := proj_exists _ _ hc + have hli : LinearIndependent K (fun μ : Cr => ρ μ) := by + rw [linearIndependent_iff_card_eq_finrank_span, Set.finrank] + have : Set.range (fun μ : Cr => ρ μ) = ρ '' (Cr : Set Reg) := by ext v; simp + rw [this, Fintype.card_coe]; exact hfa.symm + refine slot_lemma Cr B0 W hW ρ tok P ?_ (fun μ hμ => hP1 _ (subset_span ⟨μ, hμ, rfl⟩)) + (fun b hb hbC => hP2 _ (subset_span ⟨b, hSt b hb hbC, rfl⟩)) hWS0 land G hG y x e A hT2b hsupp + hy he X hx hXS hx0 + intro g hg μ hμ + have := Fintype.linearIndependent_iff.mp hli (fun μ => g μ) + (by rw [Finset.sum_coe_sort Cr (fun μ => g μ • ρ μ)]; exact hg) + exact this ⟨μ, hμ⟩ + +/-- **T3 from the op semantics.** Level-7 run (`T2_run`): `B` = registers born at dim `≤ 7`, `B0 ⊆ B` +the 0-born ones, stayers end as their own tokens (class N). In `V = B → K` with crossing rows +`resB(ρ_μ)` and tokens `resB(e_b)`, the slot bound holds with only T2(b)'s coefficient/support data, +the W/S0 facts and the X/S0 split left as hypotheses. -/ +theorem slot_lemma_run {K Reg D C : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] [Fintype D] + (B B0 W : Finset Reg) (hB0 : B0 ⊆ B) (ops : List (LOp K Reg)) (hL : LLegal (lstart B) ops) + (hst : ∀ r ∈ B, r ∉ (lrun (lstart B) ops).cr → (lrun (lstart B) ops).row r = Pi.single r 1) + (hW : W ⊆ B0 ∩ (lrun (lstart (K := K) B) ops).cr) + (hWS0 : ∀ μ ∈ W, resB B ((lrun (lstart B) ops).rho μ) ∈ + span K ((fun b => resB B (Pi.single b (1 : K))) '' (B0 : Set Reg))) + (land : Reg → C) (G : D → C) (hG : Function.Injective G) + (y x e : D → (B → K)) (A : D → Reg → K) + (hT2b : ∀ p, y p = ∑ μ ∈ (lrun (lstart (K := K) B) ops).cr, + A p μ • resB B ((lrun (lstart B) ops).rho μ)) + (hsupp : ∀ p, ∀ μ ∈ (lrun (lstart (K := K) B) ops).cr, μ ∉ W → A p μ ≠ 0 → land μ = G p) + (hy : ∀ p, y p = x p + e p) + (he : ∀ p, e p ∈ span K ((fun b => resB B (Pi.single b (1 : K))) '' (B0 : Set Reg))) + (X : Submodule K (B → K)) (hx : ∀ p, x p ∈ X) + (hXS : X ⊓ span K ((fun b => resB B (Pi.single b (1 : K))) '' (B0 : Set Reg)) = ⊥) + (hx0 : ∀ p, x p ≠ 0) : + Fintype.card D ≤ finrank K (span K (Set.range x)) + + ((B0 ∩ (lrun (lstart (K := K) B) ops).cr) \ W).card := by + obtain ⟨hcrB, hc, -, -⟩ := T2_run B ops hL hst + set s := lrun (lstart (K := K) B) ops + refine slot_lemma_T2 s.cr B0 W (B \ s.cr) hW (fun μ => resB B (s.rho μ)) + (fun b => resB B (Pi.single b (1 : K))) hc.sup_eq_top ?_ ?_ hWS0 land G hG y x e A hT2b hsupp + hy he X hx hXS hx0 + · rw [Module.finrank_fintype_fun_eq_card, Fintype.card_coe, add_comm, + Finset.card_sdiff_add_card_eq_card hcrB] + · intro b hb hbC; exact Finset.mem_sdiff.mpr ⟨hB0 hb, hbC⟩ + +end T3T2 + + +/-! ## T4. Departer law, corrected scope (all arrivals, owned included) -/ + +section T4 + +open Module Submodule + +variable {K Reg : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] + +/-- events at ONE chart `c`, in time order: a register arrives with a row, a register is born at +`c` (row = its own token), an ADD `row_i += k·row_j`, or a register departs (moves up). -/ +inductive Ev (K Reg : Type*) + | arrive (i : Reg) (v : Reg → K) + | born (b : Reg) + | add (i j : Reg) (k : K) + | depart (i : Reg) + +/-- rows (initial-row coordinates `Reg → K`) and the set of registers present at `c`. -/ +structure St (K Reg : Type*) where + row : Reg → Reg → K + pres : Finset Reg + +def step : St K Reg → Ev K Reg → St K Reg + | s, .arrive i v => ⟨Function.update s.row i v, insert i s.pres⟩ + | s, .born b => ⟨Function.update s.row b (Pi.single b 1), insert b s.pres⟩ + | s, .add i j k => ⟨Function.update s.row i (s.row i + k • s.row j), s.pres⟩ + | s, .depart i => ⟨s.row, s.pres.erase i⟩ + +def run : St K Reg → List (Ev K Reg) → St K Reg + | s, [] => s + | s, ev :: evs => run (step s ev) evs + +/-- an ADD at `c` only reads and writes registers present at `c` (owned ones included: they are +registers like any other and must ARRIVE or be BORN at `c` to be present). -/ +def Legal : St K Reg → List (Ev K Reg) → Prop + | _, [] => True + | s, .add i j k :: evs => (i ∈ s.pres ∧ j ∈ s.pres) ∧ Legal (step s (.add i j k)) evs + | s, ev :: evs => Legal (step s ev) evs + +/-- invariant: every present row lies in `N` as long as all arrival rows and born tokens do. -/ +lemma run_inv (N : Submodule K (Reg → K)) : + ∀ (s : St K Reg) (evs : List (Ev K Reg)), Legal s evs → + (∀ i ∈ s.pres, s.row i ∈ N) → + (∀ i v, Ev.arrive i v ∈ evs → v ∈ N) → (∀ b, Ev.born b ∈ evs → Pi.single b 1 ∈ N) → + ∀ i ∈ (run s evs).pres, (run s evs).row i ∈ N + | s, [], _, hs, _, _ => hs + | s, ev :: evs, hL, hs, harr, hborn => by + have harr' : ∀ i v, Ev.arrive i v ∈ evs → v ∈ N := fun i v h => harr i v (by simp [h]) + have hborn' : ∀ b, Ev.born b ∈ evs → Pi.single b 1 ∈ N := fun b h => hborn b (by simp [h]) + cases ev with + | arrive i v => + refine run_inv N _ evs hL ?_ harr' hborn' + intro r hr + simp only [step, mem_insert] at hr ⊢ + by_cases hri : r = i + · subst hri; simp only [Function.update_self]; exact harr r v (by simp) + · rw [Function.update_of_ne hri]; exact hs r (hr.resolve_left hri) + | born b => + refine run_inv N _ evs hL ?_ harr' hborn' + intro r hr + simp only [step, mem_insert] at hr ⊢ + by_cases hrb : r = b + · subst hrb; simp only [Function.update_self]; exact hborn r (by simp) + · rw [Function.update_of_ne hrb]; exact hs r (hr.resolve_left hrb) + | add i j k => + obtain ⟨⟨hi, hj⟩, hL⟩ := hL + refine run_inv N _ evs hL ?_ harr' hborn' + intro r hr + simp only [step] at hr ⊢ + by_cases hri : r = i + · subst hri; simp only [Function.update_self] + exact N.add_mem (hs r hi) (N.smul_mem k (hs j hj)) + · rw [Function.update_of_ne hri]; exact hs r hr + | depart i => + refine run_inv N _ evs hL ?_ harr' hborn' + intro r hr + simp only [step, mem_erase] at hr ⊢ + exact hs r hr.2 + +/-- the c-born coordinates can be stripped: if `v ∈ span S ⊔ span tok(Born)`, every generator in +`S` vanishes on `Born`, and `v` vanishes on `Born`, then `v ∈ span S`. -/ +lemma strip_born (S : Set (Reg → K)) (Born : Finset Reg) (hS : ∀ u ∈ S, ∀ b ∈ Born, u b = 0) + (v : Reg → K) (hv : v ∈ span K S ⊔ span K ((fun b => Pi.single b (1 : K)) '' (Born : Set Reg))) + (hvB : ∀ b ∈ Born, v b = 0) : v ∈ span K S := by + let L : (Reg → K) →ₗ[K] (Reg → K) := + LinearMap.pi fun r => if r ∈ Born then LinearMap.proj r else 0 + have hL : ∀ u r, L u r = if r ∈ Born then u r else 0 := by + intro u r; by_cases hr : r ∈ Born <;> simp [L, hr] + have hA : span K S ≤ LinearMap.ker L := by + rw [Submodule.span_le]; intro u hu + simp only [SetLike.mem_coe, LinearMap.mem_ker]; funext r + rw [hL]; split_ifs with hr + · exact hS u hu r hr + · rfl + have hT : span K ((fun b => Pi.single b (1 : K)) '' (Born : Set Reg)) ≤ LinearMap.eqLocus L LinearMap.id := by + rw [Submodule.span_le]; rintro _ ⟨b, hb, rfl⟩ + simp only [SetLike.mem_coe, LinearMap.mem_eqLocus, LinearMap.id_coe, id_eq]; funext r + rw [hL]; split_ifs with hr + · rfl + · have : r ≠ b := fun h => hr (h ▸ hb) + simp [Pi.single_apply, this] + obtain ⟨a, ha, t, ht, rfl⟩ := Submodule.mem_sup.mp hv + have hLv : L (a + t) = 0 := by + funext r; rw [hL]; split_ifs with hr + · exact hvB r hr + · rfl + have hLa : L a = 0 := hA ha + have hLt : L t = t := LinearMap.mem_eqLocus.mp (hT ht) + rw [map_add, hLa, zero_add, hLt] at hLv + rw [hLv, add_zero]; exact ha + +/-- **T4 (departer law), corrected scope.** One chart `c ≠ V` with its event list `evs` (legal, from +the empty state). Arrivals `Arr = Pub ∪ Own` (public and OWNED registers arriving at `c`, disjoint), +arrival rows `arrRow`, which carry no `c`-born coordinates; `Born` = registers born at `c`, disjoint +from `Arr`. Class N: a public register still at `c` at the end (an ender), other than a Y main in +`Ey`, has final row = its own token, and `π` kills that token. Then +`dim π(Arr_c) ≤ #public departers + #owned arrivals + #Y enders`. -/ +theorem T4_departer (π : (Reg → K) →ₗ[K] (Reg → K)) (evs : List (Ev K Reg)) + (Pub Own Born Ey : Finset Reg) (arrRow : Reg → Reg → K) + (hL : Legal ⟨fun _ => 0, ∅⟩ evs) + (harr : ∀ i v, Ev.arrive i v ∈ evs → (i ∈ Pub ∪ Own) ∧ v = arrRow i) + (hborn : ∀ b, Ev.born b ∈ evs → b ∈ Born) + (hPO : Disjoint Pub Own) (hAB : Disjoint (Pub ∪ Own) Born) + (hrowB : ∀ i ∈ Pub ∪ Own, ∀ b ∈ Born, arrRow i b = 0) + (hfinal : ∀ h ∈ Pub, h ∈ (run ⟨fun _ => 0, ∅⟩ evs).pres → h ∉ Ey → + (run ⟨fun _ => 0, ∅⟩ evs).row h = Pi.single h 1) + (hπ : ∀ h ∈ Pub, h ∉ Ey → π (Pi.single h 1) = 0) : + finrank K ((span K (arrRow '' ((Pub ∪ Own : Finset Reg) : Set Reg))).map π) ≤ + (Pub.filter fun h => h ∉ (run ⟨fun _ => 0, ∅⟩ evs).pres).card + Own.card + Ey.card := by + classical + set sf := run ⟨fun _ => 0, ∅⟩ evs + set Arr := Pub ∪ Own + set A := span K (arrRow '' (Arr : Set Reg)) + set Etok := (Pub.filter fun h => h ∈ sf.pres) \ Ey + -- enders' tokens lie in A + have hEA : ∀ h ∈ Etok, (Pi.single h (1 : K) : Reg → K) ∈ A := by + intro h hh + simp only [Etok, mem_sdiff, mem_filter] at hh + have hM := run_inv (A ⊔ span K ((fun b => Pi.single b (1 : K)) '' (Born : Set Reg))) + ⟨fun _ => 0, ∅⟩ evs hL (by simp) + (fun i v hv => by + obtain ⟨hi, rfl⟩ := harr i v hv + exact Submodule.mem_sup_left (Submodule.subset_span ⟨i, hi, rfl⟩)) + (fun b hb => Submodule.mem_sup_right (Submodule.subset_span ⟨b, hborn b hb, rfl⟩)) + h hh.1.2 + rw [hfinal h hh.1.1 hh.1.2 hh.2] at hM + refine strip_born _ Born ?_ _ hM ?_ + · rintro _ ⟨i, hi, rfl⟩ b hb; exact hrowB i hi b hb + · intro b hb + have : h ≠ b := fun e => Finset.disjoint_left.mp hAB (mem_union_left _ hh.1.1) (e ▸ hb) + simp [Pi.single_apply, Ne.symm this] + -- rank–nullity on π restricted to A + let f := π.domRestrict A + have hrn := LinearMap.finrank_range_add_finrank_ker f + have hrange : LinearMap.range f = A.map π := LinearMap.range_domRestrict A π + -- Etok tokens are independent inside ker f + have hker : Etok.card ≤ finrank K (LinearMap.ker f) := by + let g : Etok → LinearMap.ker f := fun h => + ⟨⟨Pi.single h.1 1, hEA h.1 h.2⟩, by + have hh := h.2 + simp only [Etok, mem_sdiff, mem_filter] at hh + simp [f, hπ h.1 hh.1.1 hh.2]⟩ + have hli : LinearIndependent K g := by + apply LinearIndependent.of_comp ((LinearMap.ker f).subtype) + apply LinearIndependent.of_comp A.subtype + have e : (⇑A.subtype ∘ ⇑(LinearMap.ker f).subtype ∘ g) = fun h : Etok => Pi.single h.1 (1 : K) := by + funext h; rfl + rw [e] + have hb := (Pi.basisFun K Reg).linearIndependent + have : (fun h : Etok => Pi.single h.1 (1 : K)) = (Pi.basisFun K Reg) ∘ Subtype.val := by + funext h; simp + rw [this]; exact hb.comp _ Subtype.val_injective + simpa using hli.fintype_card_le_finrank + have hAc : finrank K A ≤ Arr.card := by + have : (arrRow '' (Arr : Set Reg)) = ((Arr.image arrRow : Finset (Reg → K)) : Set (Reg → K)) := by + simp + rw [show A = span K (arrRow '' (Arr : Set Reg)) from rfl, this] + exact (finrank_span_finset_le_card _).trans Finset.card_image_le + have hArr : Arr.card = Pub.card + Own.card := Finset.card_union_of_disjoint hPO + have hPub : Pub.card = (Pub.filter fun h => h ∉ sf.pres).card + (Pub.filter fun h => h ∈ sf.pres).card := by + rw [add_comm]; exact (Finset.card_filter_add_card_filter_not _).symm + have hEt : (Pub.filter fun h => h ∈ sf.pres).card ≤ Etok.card + Ey.card := by + calc _ ≤ (Etok ∪ Ey).card := by + apply card_le_card; intro h hh + by_cases hy : h ∈ Ey + · exact mem_union_right _ hy + · exact mem_union_left _ (mem_sdiff.mpr ⟨hh, hy⟩) + _ ≤ _ := card_union_le _ _ + rw [← hrange] + have : finrank K A = finrank K (LinearMap.range f) + finrank K (LinearMap.ker f) := hrn.symm + omega + +/-- T4 for the public arrival span: it sits inside the all-arrivals span, so the same right-hand +side (with the owned-arrival term) bounds it. Without `Own.card` it is false (`T4_public_only_false`). -/ +theorem T4_public (π : (Reg → K) →ₗ[K] (Reg → K)) (Pub Own : Finset Reg) (arrRow : Reg → Reg → K) : + finrank K ((span K (arrRow '' (Pub : Set Reg))).map π) ≤ + finrank K ((span K (arrRow '' ((Pub ∪ Own : Finset Reg) : Set Reg))).map π) := + Submodule.finrank_mono (Submodule.map_mono (Submodule.span_mono + (Set.image_mono (by simp)))) + +/-- each departer's move into `c` is not its final move, so it costs `h_e(a, dim c)` with +`dim c + 1 ≤ e`, which is `≥ κ = f(2)` (`kappa_le`). Re-export for T4. -/ +theorem T4_stop_cost (e a b : ℝ) (hab : 1 ≤ b - a) (hbe : 1 ≤ e - b) : fL 2 ≤ h fL e a b := + kappa_le e a b hab hbe + +/-- the public-arrivals-only version of T4 is FALSE in this model (GAPMAP scope finding: owned +register 1502 ADDs X content into Y main 213 at charts 593–595, 597). Registers `0` = public `h`, +`1` = owned `o`, `2` = X coordinate. `h` arrives with `e_h + e_x`, `o` arrives with `-e_x`, then +`h += o`: `h` ends at `c` as its own token (class N) and π kills it, yet the public arrival span has +`dim π = 1 > 0 = #public departers + #Y enders`. Counting the owned arrival (`T4_departer`) fixes it. -/ +theorem T4_public_only_false : + let π : (Fin 3 → ℚ) →ₗ[ℚ] (Fin 3 → ℚ) := (LinearMap.single ℚ (fun _ => ℚ) 2) ∘ₗ LinearMap.proj 2 + let evs : List (Ev ℚ (Fin 3)) := + [.arrive 0 (Pi.single 0 1 + Pi.single 2 1), .arrive 1 (-Pi.single 2 1), .add 0 1 1] + let sf := run (⟨fun _ => 0, ∅⟩ : St ℚ (Fin 3)) evs + Legal (⟨fun _ => 0, ∅⟩ : St ℚ (Fin 3)) evs ∧ (0 : Fin 3) ∈ sf.pres ∧ + sf.row 0 = Pi.single 0 1 ∧ π (Pi.single 0 1) = 0 ∧ + ¬ finrank ℚ ((span ℚ {(Pi.single 0 1 + Pi.single 2 1 : Fin 3 → ℚ)}).map π) ≤ 0 := by + intro π evs sf + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · simp [evs, Legal, step] + · simp [sf, evs, run, step] + · simp only [sf, evs, run, step] + funext r; fin_cases r <;> simp [Function.update, Pi.single_apply] + · simp [π] + · intro h0 + have hbot := Submodule.finrank_eq_zero.mp (Nat.le_zero.mp h0) + have hmem : π (Pi.single 0 1 + Pi.single 2 1) ∈ + (span ℚ {(Pi.single 0 1 + Pi.single 2 1 : Fin 3 → ℚ)}).map π := + Submodule.mem_map_of_mem (Submodule.mem_span_singleton_self _) + rw [hbot, Submodule.mem_bot] at hmem + have := congrFun hmem 2 + simp [π] at this + +end T4 + +end JunkLB2 + +#print axioms JunkLB2.hsum_tele +#print axioms JunkLB2.kappa_le +#print axioms JunkLB2.g9_nonneg +#print axioms JunkLB2.T1_Y +#print axioms JunkLB2.l_nonneg +#print axioms JunkLB2.T1_Y_le +#print axioms JunkLB2.Net.T1_bound +#print axioms JunkLB2.slot_lemma +#print axioms JunkLB2.proj_exists +#print axioms JunkLB2.run_inv +#print axioms JunkLB2.strip_born +#print axioms JunkLB2.Net.movesOf_chain +#print axioms JunkLB2.Net.chain_hsum +#print axioms JunkLB2.Net.reg_le_V +#print axioms JunkLB2.Net.reg_le_Y +#print axioms JunkLB2.Net.T1_cost +#print axioms JunkLB2.Net.T1_full +#print axioms JunkLB2.compl_of_sup +#print axioms JunkLB2.T2_run +#print axioms JunkLB2.slot_lemma_T2 +#print axioms JunkLB2.slot_lemma_run +#print axioms JunkLB2.T4_departer +#print axioms JunkLB2.T4_public +#print axioms JunkLB2.T4_stop_cost +#print axioms JunkLB2.T4_public_only_false diff --git a/research/p104-tree-ceiling/lean/Nov15/JunkLB2.md b/research/p104-tree-ceiling/lean/Nov15/JunkLB2.md new file mode 100644 index 0000000000..38163ae6b5 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/JunkLB2.md @@ -0,0 +1,60 @@ +# JunkLB2.lean: JunkLB2 T1 (linked), T2, T3, T4 (Lean 4 + Mathlib), no sorry, ~9 s, 2.6 GB RSS +Source: internal notes (T1, T3, T4), with the T4 scope fix from internal notes §2. +Self-contained, namespace JunkLB2. h / gaps / hsum / two_point / Net / chain_append are copied from JunkM.lean. Axioms (all 25 printed): [propext, Classical.choice, Quot.sound]. + +**T1 (g9 pricing, class M).** +- `hsum_tele`: Σ h_e over any chain = f(e−d0) − f(e−last) − Σ f(gaps). The chain need not end at e. +- `T1_Y`: for Y_p with 0 < d1 < … < 8, the real cost Σ h_8(0::d1::…) equals the g9 charge on every move but the first, plus l(d1) = f(8) − f(d1) − f(9−d1). Needs f(0) = f(1) = 0. +- `l_nonneg` (1 ≤ d ≤ 8, by convexity), `l_one`, `T1_Y_le`: charged ≤ real. Direct Y (d1 = 8) is covered and gives 0. Registers ending at V: the charge is the real cost by definition. +- `g9_nonneg`: g9 ≥ 0 for a ≤ b ≤ 9. +- `Net.T1_bound`: Σ_{junk pairs} dist_c(A_q → G_p) ≤ cost. Hypotheses: + - a chain of moves A_q → G_p for each pair (JunkM `hpath_of_junk` now supplies it); + - chart 0 holds no X port; + - every move not leaving chart 0 is charged ≥ c (= g9); + - Σ_m w_m ≤ cost. +- Σ_m w_m ≤ public cost is now a THEOREM , `Net.T1_cost`; `Net.T1_full` chains it with `T1_bound`. + - Op semantics = JunkM's (`path_to_chain`): charts never decrease; `mv t i` is register i's move chart_t(i) → chart_{t+1}(i) when its chart rises. New hypothesis: the moves are EXACTLY these (each move is `mv t i` for one rising step t < n: `hsurj`, `hinj`). + - `movesOf i n` = register i's moves in time order; `movesOf_chain`: they form a chain birth chart → chart at time n. + - `chain_hsum`: Σ h_e over the chain's moves = hsum_e over its dim list (dim : C → ℕ, strictly monotone). + - Charge `wz`: 0 on moves out of chart z (dim 0), else c(s,t) = max(g9,0) (= g9 on every real move, `cg_eq`). + - Model M as hypotheses: Y mains (Ym) are born at z and end at dim 8; every other register ends at dim 9. Public cost := Σ_i hsum_{8 or 9}(i's dim chain) (I1). + - Per register: `reg_le_V` (charge ≤ Σ g9 = cost; 0-born non-Y first moves are charged 0 ≤ g9) and `reg_le_Y` (first move free, rest g9, then `T1_Y_le`). + - Still hypotheses in T1_full: the pair chains (`hpath`, from JunkM `hpath_of_junk`), and chart z holds no X port. + +**T3 (slot lemma), `slot_lemma`.** Conclusion: |D| ≤ rank{x_p : p ∈ D} + |(B0 ∩ Cr) \ W|. Hypotheses, all explicit: +- T2(a): the crossing rows ρ(Cr) are independent. +- T2(b): y_p = Σ A_{pμ} ρ_μ. A non-W crosser has A ≠ 0 only if it lands at G_p, and G is injective. +- W ⊆ B0 ∩ Cr. Crossing rows of W lie in S0 = span tok(B0). +- y_p = x_p + e_p with e_p ∈ S0, 0 ≠ x_p ∈ X, and X ⊓ S0 = 0. +- A linear P that fixes ρ(Cr) and kills the tokens of 0-born non-crossers. `proj_exists` builds P from IsCompl (the complementarity the T2 proof asserts). + +Two findings from the formal proof: +1. The prose step "dim(S0/W) ≤ |Z| after removing stayers" needs this projection. The proof runs in P(S0), and rank{P x_p} ≤ rank{x_p}. +2. Directness of the Y_p in D is never used. D may be any set of Y mains with x_p ≠ 0. Non-direct ones are simply in Z themselves. + +**T2 (crossing-basis lemma), now PROVED from op semantics , `T2_run`.** +- Model at level k: ops are ADD i += c·j (i ≠ j, both on the same side of level k, i.e. co-present) and `cross i` (i's first move from dim ≤ k to > k; its row then is ρ_i). Moves that do not cross k change nothing at this level and are omitted. Time 0: every row is its own token; B = registers born at dim ≤ k. +- Hypothesis (class N): every stayer (in B, never crosses) ends as its own token. +- Conclusions, in V = B → K (rows restricted to B's coordinates, `resB`): + - cr ⊆ B; + - complementarity: span ρ(Cr) and span tok(B \ Cr) are complementary (`IsCompl`); + - T2(a): the crossing rows are linearly independent; + - T2(b), existence: every register above k at the end has its restricted final row in span ρ(Cr). +- Proof (formal): invariants (`LInv`) = above-k rows stay in the span of crossing rows so far; all rows span everything (ADD with i ≠ j is invertible). Then `compl_of_sup`: a ⊔ b = ⊤ with dim a ≤ |Cr|, dim b ≤ |St|, dim V = |Cr| + |St| forces IsCompl and dim a = |Cr|. Stayer-token independence is not needed as input. +- Discharged in T3: `slot_lemma_T2` replaces slot_lemma's independence + projection hypotheses by "ρ(Cr) ∪ tok(St) spans V, dim V = |Cr| + |St|, 0-born non-crossers are stayers". `slot_lemma_run` instantiates it on the run (V = B → K, B0 ⊆ B). +- Still hypotheses in slot_lemma_run: T2(b)'s coefficients A and their support (A_{pμ} ≠ 0 ⇒ μ lands at G_p for non-W μ; the path/landing argument), W's rows in S0, e_p ∈ S0, X ⊓ S0 = 0, x_p ≠ 0. The expansion's existence is proved (T2_run part 4), and with independence A is unique. + +**T4 (departer law), CHOSEN SCOPE: owned arrivals counted.** +- Model: one chart's event list (arrive / born / ADD / depart), with ADDs only between registers present at c. Owned registers are registers too, so to be present at c they must arrive or be born there. +- `run_inv`: every present row lies in span(arrival rows) + span(c-born tokens). This is the prose's first step, and it holds only when ALL arrivals are counted. +- `strip_born`: a row with no c-born coordinates lies in the arrival span. This needs arrival rows to carry no c-born coordinates (a hypothesis). +- `T4_departer`: dim π(Arr_c^all) ≤ #public departers + #owned arrivals + #Y enders. Class-N hypothesis: public enders other than Y end as their own token, and π kills it. +- `T4_public`: the public-arrival span obeys the same bound. +- `T4_stop_cost` / `kappa_le`: a non-final move costs h_e(a,b) ≥ f(2) when b − a ≥ 1 and e − b ≥ 1. +- **Statement found false:** `T4_public_only_false`. The prose T4 (Arr_c = public arrivals, a ≤ d (+1)) fails in the same model, mirroring the gap map's owned-1502 → Y-213 charts. A public h arrives with e_h + e_x and owned o arrives with −e_x. Then h += o, so h ends as its own token. Yet dim π(public span) = 1 > 0. The gap is exactly step one of the prose proof. With no owned arrivals, `T4_departer` gives the prose statement back. + +Still prose / hypotheses: +- "arrivals carry no c-born coordinates" (content only flows upward); +- class-N final rows; +- one arrival per register at c. +- T5 path bound: charging half formalized in Nov15/JunkT5.lean . It is stated with the corrected T4 (owned arrivals) and needs root charts to be terminal. Descent is still prose. diff --git a/research/p104-tree-ceiling/lean/Nov15/NumCertK.lean b/research/p104-tree-ceiling/lean/Nov15/NumCertK.lean new file mode 100644 index 0000000000..1398c28ed5 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/NumCertK.lean @@ -0,0 +1,382 @@ +import Mathlib.Analysis.SpecialFunctions.Log.Deriv +import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +import Mathlib.Analysis.Complex.ExponentialBounds +import Mathlib.Analysis.Calculus.Deriv.MeanValue + +/-! +NUMCERT-K . Kernel-checked interval arithmetic for the numeric crossing hypotheses of the kappa ceilings. +Section 1: rational enclosures of ln r (chain ln(c+2) = ln(c+1) + 2 atanh(1/(2c+3)) with an explicit geometric tail) and of exp (Taylor of x/8, explicit +remainder `Real.exp_bound'`, eighth power), packaged as `pow_lo`/`pow_hi`: r^s in [pLo r a, pHi r b] for s in [a,b]. Kernel only; no native_decide. +-/ + +namespace NumCertK +open Finset + +def SC : ℚ := 10 ^ 30 +def rdn (q : ℚ) : ℚ := ((⌊q * SC⌋ : ℤ) : ℚ) / SC +def rup (q : ℚ) : ℚ := ((⌈q * SC⌉ : ℤ) : ℚ) / SC +theorem SC_pos : (0 : ℚ) < SC := by unfold SC; positivity +theorem rdn_le (q : ℚ) : rdn q ≤ q := by + unfold rdn; rw [div_le_iff₀ SC_pos]; exact Int.floor_le _ +theorem le_rup (q : ℚ) : q ≤ rup q := by + unfold rup; rw [le_div_iff₀ SC_pos]; exact Int.le_ceil _ +theorem rdn_nonneg {q : ℚ} (h : 0 ≤ q) : 0 ≤ rdn q := by + unfold rdn + have : (0 : ℤ) ≤ ⌊q * SC⌋ := Int.floor_nonneg.mpr (mul_nonneg h SC_pos.le) + have h2 : (0 : ℚ) ≤ ((⌊q * SC⌋ : ℤ) : ℚ) := by exact_mod_cast this + exact div_nonneg h2 SC_pos.le +theorem rup_nonneg {q : ℚ} (h : 0 ≤ q) : 0 ≤ rup q := le_trans h (le_rup q) +theorem rdn_mono {p q : ℚ} (h : p ≤ q) : rdn p ≤ rdn q := by + unfold rdn + apply div_le_div_of_nonneg_right _ SC_pos.le + exact_mod_cast Int.floor_mono (mul_le_mul_of_nonneg_right h SC_pos.le) +theorem rup_mono {p q : ℚ} (h : p ≤ q) : rup p ≤ rup q := by + unfold rup + apply div_le_div_of_nonneg_right _ SC_pos.le + exact_mod_cast Int.ceil_mono (mul_le_mul_of_nonneg_right h SC_pos.le) + +/-! ### 1. ln -/ +def aS (a n : ℕ) : ℚ := + ∑ k ∈ range n, 2 * (1 / (2 * (k : ℚ) + 1)) * (1 / (2 * (a : ℚ) + 1)) ^ (2 * k + 1) +def aTail (a n : ℕ) : ℚ := + 2 * (1 / (2 * (a : ℚ) + 1)) ^ (2 * n + 1) / ((2 * (n : ℚ) + 1) * (1 - (1 / (2 * (a : ℚ) + 1)) ^ 2)) + +theorem atanh_bounds (a n : ℕ) (ha : 0 < a) : + ((aS a n : ℚ) : ℝ) ≤ Real.log (1 + (a : ℝ)⁻¹) ∧ + Real.log (1 + (a : ℝ)⁻¹) ≤ ((aS a n : ℚ) : ℝ) + ((aTail a n : ℚ) : ℝ) := by + have haR : (0 : ℝ) < a := by exact_mod_cast ha + have hs := Real.hasSum_log_one_add_inv haR + set y : ℝ := 1 / (2 * (a : ℝ) + 1) with hy + have hy0 : 0 < y := by rw [hy]; positivity + have hy1 : y < 1 := by + rw [hy, div_lt_one (by positivity)]; have : (1:ℝ) ≤ a := by exact_mod_cast ha + linarith + set f : ℕ → ℝ := fun k => 2 * (1 / (2 * (k : ℝ) + 1)) * y ^ (2 * k + 1) with hf + have hS : ((aS a n : ℚ) : ℝ) = ∑ k ∈ range n, f k := by + simp only [aS, hf, hy]; push_cast; rfl + have ht := (hasSum_nat_add_iff' n).mpr hs + rw [hS] + have hfpos : ∀ k, 0 ≤ f k := fun k => by simp only [hf]; positivity + constructor + · have := ht.nonneg (fun k => hfpos (k + n)) + linarith + · set c : ℝ := 2 * (1 / (2 * (n : ℝ) + 1)) * y ^ (2 * n + 1) with hc + have hy2 : y ^ 2 < 1 := by nlinarith + have hg : HasSum (fun k : ℕ => c * (y ^ 2) ^ k) (c * (1 - y ^ 2)⁻¹) := + (hasSum_geometric_of_lt_one (by positivity) hy2).mul_left c + have hle : ∀ k : ℕ, f (k + n) ≤ c * (y ^ 2) ^ k := by + intro k + simp only [hf, hc] + have e : y ^ (2 * (k + n) + 1) = y ^ (2 * n + 1) * (y ^ 2) ^ k := by + rw [← pow_mul]; rw [← pow_add]; congr 1; ring + push_cast + rw [e] + have h1 : 1 / (2 * ((k : ℝ) + n) + 1) ≤ 1 / (2 * (n : ℝ) + 1) := by + apply one_div_le_one_div_of_le (by positivity); nlinarith [(Nat.cast_nonneg k : (0:ℝ) ≤ k)] + have h2 : 0 ≤ y ^ (2 * n + 1) * (y ^ 2) ^ k := by positivity + nlinarith [mul_le_mul_of_nonneg_right h1 h2] + have := hasSum_le hle ht hg + have hT : ((aTail a n : ℚ) : ℝ) = c * (1 - y ^ 2)⁻¹ := by + simp only [aTail, hc, hy]; push_cast + have : (1 - (1 / (2 * (a : ℝ) + 1)) ^ 2) ≠ 0 := by + have := hy2; rw [hy] at this; intro h; linarith + field_simp + rw [hT]; linarith + +def N : ℕ := 36 +def lnLoC : ℕ → ℚ + | 0 => 0 + | c + 1 => lnLoC c + rdn (aS (c + 1) N) +def lnHiC : ℕ → ℚ + | 0 => 0 + | c + 1 => lnHiC c + rup (aS (c + 1) N + aTail (c + 1) N) +/-- bounds for ln r (r >= 1) -/ +def lnLo (r : ℕ) : ℚ := lnLoC (r - 1) +def lnHi (r : ℕ) : ℚ := lnHiC (r - 1) + +theorem aS_nonneg (a n : ℕ) : 0 ≤ aS a n := by + unfold aS; apply Finset.sum_nonneg; intro k _; positivity +theorem aTail_nonneg (a n : ℕ) : 0 ≤ aTail a n := by + unfold aTail + apply div_nonneg (by positivity) + apply mul_nonneg (by positivity) + by_cases h : a = 0 + · subst h; simp + · have : (1:ℚ) ≤ a := by exact_mod_cast Nat.pos_of_ne_zero h + have h1 : 1 / (2 * (a : ℚ) + 1) ≤ 1 := by rw [div_le_one (by positivity)]; linarith + have h0 : 0 ≤ 1 / (2 * (a : ℚ) + 1) := by positivity + nlinarith + +theorem ln_chain (c : ℕ) : + ((lnLoC c : ℚ) : ℝ) ≤ Real.log ((c : ℝ) + 1) ∧ Real.log ((c : ℝ) + 1) ≤ ((lnHiC c : ℚ) : ℝ) := by + induction c with + | zero => simp [lnLoC, lnHiC] + | succ c ih => + obtain ⟨h1, h2⟩ := ih + have hc : (0 : ℝ) < (c : ℝ) + 1 := by positivity + have e : Real.log (((c + 1 : ℕ) : ℝ) + 1) = Real.log ((c : ℝ) + 1) + Real.log (1 + (((c + 1 : ℕ) : ℝ))⁻¹) := by + rw [← Real.log_mul hc.ne' (by positivity)] + congr 1; push_cast; field_simp + obtain ⟨b1, b2⟩ := atanh_bounds (c + 1) N (Nat.succ_pos c) + rw [e] + constructor + · have : ((rdn (aS (c + 1) N) : ℚ) : ℝ) ≤ ((aS (c + 1) N : ℚ) : ℝ) := by exact_mod_cast rdn_le _ + simp only [lnLoC]; push_cast at *; linarith + · have : ((aS (c + 1) N + aTail (c + 1) N : ℚ) : ℝ) ≤ ((rup (aS (c + 1) N + aTail (c + 1) N) : ℚ) : ℝ) := + by exact_mod_cast le_rup _ + simp only [lnHiC]; push_cast at *; linarith + +theorem lnLo_le (r : ℕ) (hr : 1 ≤ r) : ((lnLo r : ℚ) : ℝ) ≤ Real.log r := by + have h := (ln_chain (r - 1)).1 + unfold lnLo + have : ((r - 1 : ℕ) : ℝ) + 1 = r := by rw [Nat.cast_sub hr]; simp + rwa [this] at h +theorem le_lnHi (r : ℕ) (hr : 1 ≤ r) : Real.log r ≤ ((lnHi r : ℚ) : ℝ) := by + have h := (ln_chain (r - 1)).2 + unfold lnHi + have : ((r - 1 : ℕ) : ℝ) + 1 = r := by rw [Nat.cast_sub hr]; simp + rwa [this] at h + +theorem lnLoC_nonneg (c : ℕ) : 0 ≤ lnLoC c := by + induction c with + | zero => simp [lnLoC] + | succ c ih => simp only [lnLoC]; exact add_nonneg ih (rdn_nonneg (aS_nonneg _ _)) +theorem lnHiC_mono : Monotone lnHiC := by + apply monotone_nat_of_le_succ; intro c + simp only [lnHiC] + have := rup_nonneg (add_nonneg (aS_nonneg (c + 1) N) (aTail_nonneg (c + 1) N)) + linarith +theorem lnLo_nonneg (r : ℕ) : 0 ≤ lnLo r := lnLoC_nonneg _ +theorem lnHi_nonneg (r : ℕ) : 0 ≤ lnHi r := by + have : (0:ℚ) ≤ lnHiC 0 := by simp [lnHiC] + exact le_trans this (lnHiC_mono (Nat.zero_le _)) + +theorem lnHi_145 : lnHi 145 ≤ 5 := by unfold lnHi; decide +kernel +theorem lnHi_le_5 (r : ℕ) (hr : r ≤ 145) : lnHi r ≤ 5 := by + refine le_trans ?_ lnHi_145 + exact lnHiC_mono (by omega) + +/-! ### 2. exp -/ +def NE : ℕ := 24 +def eS (y : ℚ) : ℚ := ∑ m ∈ range NE, y ^ m / (Nat.factorial m : ℚ) +def eR (y : ℚ) : ℚ := y ^ NE * ((NE : ℚ) + 1) / ((Nat.factorial NE : ℚ) * NE) +/-- lower / upper enclosure of exp x: (Taylor of x/8)^8 with outward fixed-point rounding -/ +def eLo (x : ℚ) : ℚ := rdn ((rdn (eS (x / 8))) ^ 8) +def eHi (x : ℚ) : ℚ := rup ((rup (eS (x / 8) + eR (x / 8))) ^ 8) + +theorem eLo_le (x : ℚ) (hx : 0 ≤ x) : ((eLo x : ℚ) : ℝ) ≤ Real.exp x := by + have hx0 : (0:ℝ) ≤ x := by exact_mod_cast hx + have hy : (0 : ℝ) ≤ (x : ℝ) / 8 := by positivity + have h1 := Real.sum_le_exp_of_nonneg hy NE + have hS : ((eS (x / 8) : ℚ) : ℝ) = ∑ m ∈ range NE, ((x : ℝ) / 8) ^ m / (Nat.factorial m : ℝ) := by + simp only [eS]; push_cast; rfl + have h0 : 0 ≤ eS (x / 8) := by + unfold eS; apply Finset.sum_nonneg; intro m _; have : 0 ≤ x / 8 := by positivity + positivity + have h2 : ((rdn (eS (x / 8)) : ℚ) : ℝ) ≤ Real.exp ((x : ℝ) / 8) := by + have : ((rdn (eS (x / 8)) : ℚ) : ℝ) ≤ ((eS (x / 8) : ℚ) : ℝ) := by exact_mod_cast rdn_le _ + linarith + have h3 : (0 : ℝ) ≤ ((rdn (eS (x / 8)) : ℚ) : ℝ) := by exact_mod_cast rdn_nonneg h0 + have h4 : (((rdn (eS (x / 8))) ^ 8 : ℚ) : ℝ) ≤ Real.exp x := by + push_cast + calc ((rdn (eS (x / 8)) : ℚ) : ℝ) ^ 8 ≤ (Real.exp ((x : ℝ) / 8)) ^ 8 := pow_le_pow_left₀ h3 h2 8 + _ = Real.exp x := by rw [← Real.exp_nat_mul]; congr 1; push_cast; ring + have h5 : ((rdn ((rdn (eS (x / 8))) ^ 8) : ℚ) : ℝ) ≤ (((rdn (eS (x / 8))) ^ 8 : ℚ) : ℝ) := by + exact_mod_cast rdn_le _ + unfold eLo; linarith + +theorem le_eHi (x : ℚ) (hx : 0 ≤ x) (hx8 : x ≤ 8) : Real.exp x ≤ ((eHi x : ℚ) : ℝ) := by + have hx0 : (0:ℝ) ≤ x := by exact_mod_cast hx + have hx8' : (x:ℝ) ≤ 8 := by exact_mod_cast hx8 + have hy : (0 : ℝ) ≤ (x : ℝ) / 8 := by positivity + have hy1 : (x : ℝ) / 8 ≤ 1 := by linarith + have h1 := Real.exp_bound' hy hy1 (n := NE) (by unfold NE; norm_num) + have hS : ((eS (x / 8) + eR (x / 8) : ℚ) : ℝ) = + (∑ m ∈ range NE, ((x : ℝ) / 8) ^ m / (Nat.factorial m : ℝ)) + + ((x : ℝ) / 8) ^ NE * ((NE : ℝ) + 1) / ((Nat.factorial NE : ℝ) * NE) := by + simp only [eS, eR]; push_cast; rfl + have h2 : Real.exp ((x : ℝ) / 8) ≤ ((rup (eS (x / 8) + eR (x / 8)) : ℚ) : ℝ) := by + have : ((eS (x / 8) + eR (x / 8) : ℚ) : ℝ) ≤ ((rup (eS (x / 8) + eR (x / 8)) : ℚ) : ℝ) := by + exact_mod_cast le_rup _ + linarith + have h3 : Real.exp x ≤ (((rup (eS (x / 8) + eR (x / 8))) ^ 8 : ℚ) : ℝ) := by + push_cast + calc Real.exp x = (Real.exp ((x : ℝ) / 8)) ^ 8 := by rw [← Real.exp_nat_mul]; congr 1; push_cast; ring + _ ≤ _ := pow_le_pow_left₀ (Real.exp_pos _).le h2 8 + have h5 : (((rup (eS (x / 8) + eR (x / 8))) ^ 8 : ℚ) : ℝ) ≤ ((rup ((rup (eS (x / 8) + eR (x / 8))) ^ 8) : ℚ) : ℝ) := by + exact_mod_cast le_rup _ + unfold eHi; linarith + +/-! ### 3. r^s on an interval of exponents -/ +def pLo (r : ℕ) (a : ℚ) : ℚ := eLo (rdn (a * lnLo r)) +def pHi (r : ℕ) (b : ℚ) : ℚ := eHi (rup (b * lnHi r)) + +/-- **rpow bound (lower)**: for 1 <= r, 0 <= a <= s: pLo r a <= r^s. -/ +theorem pow_lo (r : ℕ) (hr : 1 ≤ r) (a : ℚ) (ha : 0 ≤ a) (s : ℝ) (hs : (a : ℝ) ≤ s) : + ((pLo r a : ℚ) : ℝ) ≤ (r : ℝ) ^ s := by + have hr1 : (1 : ℝ) ≤ r := by exact_mod_cast hr + have hrp : (0 : ℝ) < r := by linarith + have ha0 : (0:ℝ) ≤ a := by exact_mod_cast ha + have h1 : (r : ℝ) ^ (a : ℝ) ≤ (r : ℝ) ^ s := Real.rpow_le_rpow_of_exponent_le hr1 hs + have hx0 : 0 ≤ rdn (a * lnLo r) := rdn_nonneg (mul_nonneg ha (lnLo_nonneg r)) + have h2 := eLo_le _ hx0 + have h3 : ((rdn (a * lnLo r) : ℚ) : ℝ) ≤ Real.log r * a := by + have a1 : ((rdn (a * lnLo r) : ℚ) : ℝ) ≤ ((a * lnLo r : ℚ) : ℝ) := by exact_mod_cast rdn_le _ + have a2 := lnLo_le r hr + push_cast at a1 + nlinarith + have e := Real.rpow_def_of_pos hrp (a : ℝ) + unfold pLo + have := Real.exp_le_exp.mpr h3 + linarith + +/-- **rpow bound (upper)**: for 1 <= r <= 145, 0 <= s <= b <= 1: r^s <= pHi r b. -/ +theorem pow_hi (r : ℕ) (hr : 1 ≤ r) (hr2 : r ≤ 145) (b : ℚ) (hb0 : 0 ≤ b) (hb1 : b ≤ 1) (s : ℝ) + (hs : s ≤ (b : ℝ)) : + (r : ℝ) ^ s ≤ ((pHi r b : ℚ) : ℝ) := by + have hr1 : (1 : ℝ) ≤ r := by exact_mod_cast hr + have hrp : (0 : ℝ) < r := by linarith + have h1 : (r : ℝ) ^ s ≤ (r : ℝ) ^ (b : ℝ) := Real.rpow_le_rpow_of_exponent_le hr1 hs + have hx0 : 0 ≤ rup (b * lnHi r) := rup_nonneg (mul_nonneg hb0 (lnHi_nonneg r)) + have h5 := lnHi_le_5 r hr2 + have hx8 : rup (b * lnHi r) ≤ 8 := by + have : b * lnHi r ≤ 5 := by nlinarith [lnHi_nonneg r] + have h6 := rup_mono this + have h7 : rup 5 = 5 := by unfold rup SC; norm_num + linarith + have h2 := le_eHi _ hx0 hx8 + have h3 : Real.log r * b ≤ ((rup (b * lnHi r) : ℚ) : ℝ) := by + have a1 : ((b * lnHi r : ℚ) : ℝ) ≤ ((rup (b * lnHi r) : ℚ) : ℝ) := by exact_mod_cast le_rup _ + have a2 := le_lnHi r hr + have hb : (0:ℝ) ≤ b := by exact_mod_cast hb0 + push_cast at a1 + nlinarith + have e := Real.rpow_def_of_pos hrp (b : ℝ) + unfold pHi + have := Real.exp_le_exp.mpr h3 + linarith + +/-! ### 4. F(s) = sum c_r r^s: enclosures of F and F', monotonicity -/ +abbrev CF := List (ℕ × ℤ) +noncomputable def Fc (cf : CF) (s : ℝ) : ℝ := (cf.map fun p => (p.2 : ℝ) * (p.1 : ℝ) ^ s).sum +noncomputable def dFc (cf : CF) (s : ℝ) : ℝ := (cf.map fun p => (p.2 : ℝ) * (Real.log p.1 * (p.1 : ℝ) ^ s)).sum +def okR (cf : CF) : Prop := ∀ p ∈ cf, 1 ≤ p.1 ∧ p.1 ≤ 145 +instance (cf : CF) : Decidable (okR cf) := by unfold okR; infer_instance +/-- upper bound of F on s in [a,b] -/ +def Fup (cf : CF) (a b : ℚ) : ℚ := + (cf.map fun p => if 0 ≤ p.2 then (p.2 : ℚ) * pHi p.1 b else (p.2 : ℚ) * pLo p.1 a).sum +/-- lower bound of F' on s in [a,b] -/ +def dLo (cf : CF) (a b : ℚ) : ℚ := + (cf.map fun p => if 0 ≤ p.2 then (p.2 : ℚ) * (lnLo p.1 * pLo p.1 a) + else (p.2 : ℚ) * (lnHi p.1 * pHi p.1 b)).sum + +theorem Fc_le (cf : CF) (hok : okR cf) (a b : ℚ) (ha : 0 ≤ a) (hb1 : b ≤ 1) (s : ℝ) + (h1 : (a : ℝ) ≤ s) (h2 : s ≤ (b : ℝ)) : Fc cf s ≤ ((Fup cf a b : ℚ) : ℝ) := by + have ha0 : (0:ℝ) ≤ a := by exact_mod_cast ha + have hb0 : 0 ≤ b := by + have : (0:ℝ) ≤ b := by linarith + exact_mod_cast this + induction cf with + | nil => simp [Fc, Fup] + | cons p l ih => + have hp := hok p (by simp) + have hl : okR l := fun q hq => hok q (by simp [hq]) + have ih := ih hl + simp only [Fc, Fup, List.map_cons, List.sum_cons] at ih ⊢ + rw [Rat.cast_add] + have hlo := pow_lo p.1 hp.1 a ha s h1 + have hhi := pow_hi p.1 hp.1 hp.2 b hb0 hb1 s h2 + split_ifs with hc + · have hc' : (0:ℝ) ≤ p.2 := by exact_mod_cast hc + simp only [Rat.cast_mul, Rat.cast_intCast] + nlinarith [mul_le_mul_of_nonneg_left hhi hc'] + · have hc' : (p.2:ℝ) ≤ 0 := by exact_mod_cast (show p.2 ≤ 0 by omega) + simp only [Rat.cast_mul, Rat.cast_intCast] + nlinarith [mul_le_mul_of_nonpos_left hlo hc'] + +theorem dFc_ge (cf : CF) (hok : okR cf) (a b : ℚ) (ha : 0 ≤ a) (hb1 : b ≤ 1) (s : ℝ) + (h1 : (a : ℝ) ≤ s) (h2 : s ≤ (b : ℝ)) : ((dLo cf a b : ℚ) : ℝ) ≤ dFc cf s := by + have ha0 : (0:ℝ) ≤ a := by exact_mod_cast ha + have hb0 : 0 ≤ b := by + have : (0:ℝ) ≤ b := by linarith + exact_mod_cast this + induction cf with + | nil => simp [dFc, dLo] + | cons p l ih => + have hp := hok p (by simp) + have hl : okR l := fun q hq => hok q (by simp [hq]) + have ih := ih hl + simp only [dFc, dLo, List.map_cons, List.sum_cons] at ih ⊢ + rw [Rat.cast_add] + have hlo := pow_lo p.1 hp.1 a ha s h1 + have hhi := pow_hi p.1 hp.1 hp.2 b hb0 hb1 s h2 + have hr1 : (1:ℝ) ≤ p.1 := by exact_mod_cast hp.1 + have hL0 : 0 ≤ Real.log p.1 := Real.log_nonneg hr1 + have hl1 := lnLo_le p.1 hp.1 + have hl2 := le_lnHi p.1 hp.1 + have hn0 : (0:ℝ) ≤ ((lnLo p.1 : ℚ) : ℝ) := by exact_mod_cast lnLo_nonneg p.1 + have hn1 : (0:ℝ) ≤ ((lnHi p.1 : ℚ) : ℝ) := by exact_mod_cast lnHi_nonneg p.1 + have hq0 : (0:ℝ) ≤ ((pLo p.1 a : ℚ) : ℝ) := by + have : 0 ≤ pLo p.1 a := by + unfold pLo eLo + apply rdn_nonneg; apply pow_nonneg; apply rdn_nonneg + unfold eS; apply Finset.sum_nonneg; intro m _ + have : 0 ≤ rdn (a * lnLo p.1) / 8 := div_nonneg (rdn_nonneg (mul_nonneg ha (lnLo_nonneg _))) (by norm_num) + positivity + exact_mod_cast this + have hrs : (0:ℝ) ≤ (p.1 : ℝ) ^ s := by positivity + split_ifs with hc + · have hc' : (0:ℝ) ≤ p.2 := by exact_mod_cast hc + simp only [Rat.cast_mul, Rat.cast_intCast] + have m1 : ((lnLo p.1 : ℚ) : ℝ) * ((pLo p.1 a : ℚ) : ℝ) ≤ Real.log p.1 * (p.1 : ℝ) ^ s := + mul_le_mul hl1 hlo hq0 hL0 + nlinarith [mul_le_mul_of_nonneg_left m1 hc'] + · have hc' : (p.2:ℝ) ≤ 0 := by exact_mod_cast (show p.2 ≤ 0 by omega) + simp only [Rat.cast_mul, Rat.cast_intCast] + have m1 : Real.log p.1 * (p.1 : ℝ) ^ s ≤ ((lnHi p.1 : ℚ) : ℝ) * ((pHi p.1 b : ℚ) : ℝ) := + mul_le_mul hl2 hhi hrs hn1 + nlinarith [mul_le_mul_of_nonpos_left m1 hc'] + +theorem Fc_hasDerivAt (cf : CF) (hok : okR cf) (s : ℝ) : HasDerivAt (Fc cf) (dFc cf s) s := by + induction cf with + | nil => simp only [Fc, dFc, List.map_nil, List.sum_nil]; exact hasDerivAt_const s (0 : ℝ) + | cons p l ih => + have hp := hok p (by simp) + have hl : okR l := fun q hq => hok q (by simp [hq]) + have ih := ih hl + have hrp : (0:ℝ) < p.1 := by have : (1:ℝ) ≤ p.1 := by exact_mod_cast hp.1 + linarith + have h1 := ((Real.hasStrictDerivAt_const_rpow hrp s).hasDerivAt.const_mul (p.2 : ℝ)).add ih + have e : Fc (p :: l) = fun s => (p.2 : ℝ) * (p.1 : ℝ) ^ s + Fc l s := by + funext s; simp [Fc] + have e2 : dFc (p :: l) s = (p.2 : ℝ) * ((p.1 : ℝ) ^ s * Real.log p.1) + dFc l s := by + simp only [dFc, List.map_cons, List.sum_cons]; ring + rw [e, e2]; exact h1 + +/-- if F' >= dLo > 0 on [a,b] then F(s) <= F(b) on [a,b] -/ +theorem Fc_mono (cf : CF) (hok : okR cf) (a b : ℚ) (ha : 0 ≤ a) (hb1 : b ≤ 1) (hd : 0 < dLo cf a b) + (s : ℝ) (h1 : (a : ℝ) ≤ s) (h2 : s ≤ (b : ℝ)) : Fc cf s ≤ Fc cf b := by + have hab : (a : ℝ) ≤ b := le_trans h1 h2 + have hcont : ContinuousOn (Fc cf) (Set.Icc (a : ℝ) b) := + fun x _ => (Fc_hasDerivAt cf hok x).continuousAt.continuousWithinAt + have hm : StrictMonoOn (Fc cf) (Set.Icc (a : ℝ) b) := by + apply strictMonoOn_of_deriv_pos (convex_Icc _ _) hcont + intro x hx + rw [interior_Icc] at hx + rw [(Fc_hasDerivAt cf hok x).deriv] + have := dFc_ge cf hok a b ha hb1 x hx.1.le hx.2.le + have hd' : (0:ℝ) < ((dLo cf a b : ℚ) : ℝ) := by exact_mod_cast hd + linarith + exact hm.monotoneOn ⟨h1, h2⟩ ⟨hab, le_refl _⟩ h2 + +theorem Fc_neg_piece (cf : CF) (hok : okR cf) (a b : ℚ) (ha : 0 ≤ a) (hb1 : b ≤ 1) (h : Fup cf a b < 0) + (s : ℝ) (h1 : (a : ℝ) ≤ s) (h2 : s ≤ (b : ℝ)) : Fc cf s < 0 := by + have := Fc_le cf hok a b ha hb1 s h1 h2 + have h' : ((Fup cf a b : ℚ) : ℝ) < 0 := by exact_mod_cast h + linarith + +end NumCertK + +#print axioms NumCertK.pow_lo +#print axioms NumCertK.pow_hi +#print axioms NumCertK.Fc_mono diff --git a/research/p104-tree-ceiling/lean/Nov15/NumCertK.md b/research/p104-tree-ceiling/lean/Nov15/NumCertK.md new file mode 100644 index 0000000000..5bd62abfc0 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/NumCertK.md @@ -0,0 +1,17 @@ +# NumCertK.lean + NumCertKData.lean + NumCertK22.lean: kernel-checked interval arithmetic; NumCert22 discharged +No sorry, no native_decide; axioms [propext, Classical.choice, Quot.sound] (all three files). Build order: NumCertK (13 s / 2.9 GB), NumCertKData (32 s / 3.4 GB), FloorK22, NumCertK22 (7 s / 2.9 GB); each with `-o .lake/build/lib/lean/Nov15/.olean`. NumCertK22 is a separate file only because importing FloorK22 + the checks in one run exceeds the 3.5 GB guard. + +## Library (NumCertK.lean, Mathlib only) +- ln: chain ln(c+2) = ln(c+1) + 2 atanh(1/(2c+3)) from `Real.hasSum_log_one_add_inv`, 36 terms, explicit geometric tail (`atanh_bounds`), outward rounding to 1e-30 (`rdn`/`rup`). `lnLo r <= ln r <= lnHi r`, r >= 1; accuracy ~1e-28 for r <= 145. +- exp: (Taylor_24(x/8))^8 with `Real.exp_bound'` remainder, outward rounding (`eLo_le`: 0 <= x; `le_eHi`: 0 <= x <= 8). +- **`pow_lo`**: 1 <= r, 0 <= a <= s => pLo r a <= r^s. **`pow_hi`**: 1 <= r <= 145, s <= b <= 1 => r^s <= pHi r b. (s-form: s = 1 - t, so r^(1-t) in [pLo r (1-t_hi), pHi r (1-t_lo)].) Rational, checked by `decide +kernel`. +- F(s) = sum c_r r^s (`Fc`): `Fc_le` (upper enclosure `Fup` on [a,b]), `dFc_ge` (lower enclosure `dLo` of F'), `Fc_hasDerivAt`, `Fc_mono` (dLo > 0 on [a,b] => F(s) <= F(b)). + +## Crossing for K(S22) (NumCertKData.lean, NumCertK22.lean) +- `cfK`: the 17-call invoice caller(6|7) + 17 x nK22, merged by rank: 24 ranks, c_1 = -42272, c_2 = 6494, ..., c_137 = 208 (`invoice_eq_Fc`, simp + ring: identical to the Finv of FloorK22). +- `cfK_neg`: F(s) < 0 for every s in [0, 9939802595/10^10 = 1 - .0060197405]. Proof: six `Fup` boxes cover [0, .9] (grid 0, .45, .6, .7, .8, .85, .9; F <= -3.3e3 at worst); on [.9, s0] one box gives dLo >= 2.5e4 > 0, so F(s) <= F(s0), and the point enclosure gives Fup(s0, s0) < 0 (true F(s0) = -4.83e-6, relative margin 1e-10 of the 2.8e4-sized terms, so the 1e-28 enclosure is ample). +- **`numCert22 : NumCert22 tbar22`** and **`ceiling22_unconditional`**: kappa <= .0060197405 on class K(S22) with NumCert22 discharged; other hypotheses of `ceiling22` unchanged (ClassK22 rank input, cost-model link `hF`). +- The crossing is TRUE: F(1 - .0060197405) = -4.83e-6 (root .00601974047925), F' = 2.33e5 there. + +## Not done +- JointCeiling's `NumCert th0 tbar`: it quantifies over ALL a, b >= 1 (R1 tail Jensen/MVT step, ~1,800 pairs, unaudited per its docstring); the library applies per (a,b) but the infinite tail is not an interval check. WholeFloor's (kappa <= .0204) was not available. diff --git a/research/p104-tree-ceiling/lean/Nov15/RankLaw.lean b/research/p104-tree-ceiling/lean/Nov15/RankLaw.lean new file mode 100644 index 0000000000..fd4ec249d3 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/RankLaw.lean @@ -0,0 +1,597 @@ +import Nov15.TokenCancel +import Mathlib.LinearAlgebra.Matrix.ToLin +import Mathlib.LinearAlgebra.Determinant +import Mathlib.LinearAlgebra.Matrix.Block +import Mathlib.LinearAlgebra.Matrix.Transvection +import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +import Mathlib.LinearAlgebra.Projection +import Mathlib.LinearAlgebra.Isomorphisms +import Mathlib.LinearAlgebra.Dimension.Constructions +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas + +set_option linter.unusedSectionVars false +namespace RankLaw +open Submodule Module + +section Equiv +variable {K V W : Type*} [Field K] [AddCommGroup V] [Module K V] [AddCommGroup W] [Module K W] + [FiniteDimensional K V] + +/-- Two linear maps out of a finite-dimensional space with the same range differ by an +automorphism of the source. -/ +theorem exists_equiv_comp (f g : V →ₗ[K] W) (h : LinearMap.range f = LinearMap.range g) : + ∃ φ : V ≃ₗ[K] V, f ∘ₗ φ.toLinearMap = g := by + obtain ⟨Qg, hQg⟩ := Submodule.exists_isCompl (LinearMap.ker g) + obtain ⟨Qf, hQf⟩ := Submodule.exists_isCompl (LinearMap.ker f) + have hk : finrank K (LinearMap.ker g) = finrank K (LinearMap.ker f) := by + have h1 := LinearMap.finrank_range_add_finrank_ker f + have h2 := LinearMap.finrank_range_add_finrank_ker g + rw [h] at h1; omega + let e1 : LinearMap.ker g ≃ₗ[K] LinearMap.ker f := LinearEquiv.ofFinrankEq _ _ hk + let e2 : Qg ≃ₗ[K] Qf := + (Submodule.quotientEquivOfIsCompl _ _ hQg).symm ≪≫ₗ g.quotKerEquivRange ≪≫ₗ + (LinearEquiv.ofEq _ _ h.symm) ≪≫ₗ f.quotKerEquivRange.symm ≪≫ₗ + Submodule.quotientEquivOfIsCompl _ _ hQf + let φ : V ≃ₗ[K] V := (Submodule.prodEquivOfIsCompl _ _ hQg).symm ≪≫ₗ (e1.prodCongr e2) ≪≫ₗ + Submodule.prodEquivOfIsCompl _ _ hQf + refine ⟨φ, ?_⟩ + -- key: f (e2 q) = g q + have key : ∀ q : Qg, f (e2 q : V) = g q := by + intro q + set y : Qf := e2 q + have hy : (Submodule.Quotient.mk (y : V) : V ⧸ LinearMap.ker f) = + f.quotKerEquivRange.symm (LinearEquiv.ofEq _ _ h.symm + (g.quotKerEquivRange (Submodule.Quotient.mk (q : V)))) := by + have := Submodule.mk_quotientEquivOfIsCompl_apply hQf + (f.quotKerEquivRange.symm (LinearEquiv.ofEq _ _ h.symm + (g.quotKerEquivRange (Submodule.Quotient.mk (q : V))))) + convert this using 2 + simp [y, e2, Submodule.quotientEquivOfIsCompl_symm_apply] + have := congrArg (fun t => (f.quotKerEquivRange t : W)) hy + simpa using this + apply LinearMap.ext; intro v + obtain ⟨⟨k, q⟩, rfl⟩ := (Submodule.prodEquivOfIsCompl _ _ hQg).surjective v + have hφ : φ ((Submodule.prodEquivOfIsCompl _ _ hQg) (k, q)) = (e1 k : V) + (e2 q : V) := by + simp only [φ, LinearEquiv.trans_apply, LinearEquiv.symm_apply_apply] + rfl + rw [LinearMap.comp_apply, LinearEquiv.coe_coe, hφ, coe_prodEquivOfIsCompl', map_add, map_add] + have hk0 : f (e1 k : V) = 0 := (e1 k).2 + have hg0 : g (k : V) = 0 := k.2 + rw [hk0, hg0, key] +end Equiv + + +section Mix +variable {K G ι : Type*} [Field K] [Fintype G] [DecidableEq G] + +/-- **The V-mix target, as a linear system.** Given the end rows `X` of the registers that end at V +(indexed by `G`) and their target rows `R`, a V mix is an invertible `C` with `C * X = R`. -/ +def VMixM (X R : Matrix G ι K) : Prop := ∃ C : Matrix G G K, IsUnit C.det ∧ C * X = R + +/-- The V-mix system is solvable iff the end rows and the target rows span the same space. -/ +theorem vmixM_iff_span (X R : Matrix G ι K) : + VMixM X R ↔ span K (Set.range X.row) = span K (Set.range R.row) := by + constructor + · rintro ⟨C, hC, hCX⟩ + have hR : ∀ g, R.row g ∈ span K (Set.range X.row) := by + intro g; rw [← hCX] + have : (C * X).row g = Matrix.vecMul (C g) X := rfl + rw [this, ← range_vecMulLinear X]; exact ⟨C g, rfl⟩ + have hX : X = C⁻¹ * R := by rw [← hCX, ← Matrix.mul_assoc, Matrix.nonsing_inv_mul _ hC, Matrix.one_mul] + have hXR : ∀ g, X.row g ∈ span K (Set.range R.row) := by + intro g; rw [hX] + have : (C⁻¹ * R).row g = Matrix.vecMul (C⁻¹ g) R := rfl + rw [this, ← range_vecMulLinear R]; exact ⟨C⁻¹ g, rfl⟩ + apply le_antisymm + · exact span_le.2 (by rintro _ ⟨g, rfl⟩; exact hXR g) + · exact span_le.2 (by rintro _ ⟨g, rfl⟩; exact hR g) + · intro h + have h' : LinearMap.range X.vecMulLinear = LinearMap.range R.vecMulLinear := by + rw [range_vecMulLinear, range_vecMulLinear]; exact h + obtain ⟨φ, hφ⟩ := exists_equiv_comp X.vecMulLinear R.vecMulLinear h' + refine ⟨(LinearMap.toMatrix' φ.toLinearMap).transpose, ?_, ?_⟩ + · rw [Matrix.det_transpose, LinearMap.det_toMatrix'] + exact LinearEquiv.isUnit_det' φ + · ext g j + have e := congrArg (fun F : (G → K) →ₗ[K] (ι → K) => F (Pi.single g 1) j) hφ + simp only [LinearMap.comp_apply, Matrix.vecMulLinear_apply, LinearEquiv.coe_coe] at e + rw [Matrix.single_one_vecMul] at e + have hrow : (fun k => (LinearMap.toMatrix' φ.toLinearMap).transpose g k) = φ (Pi.single g 1) := by + funext k; simp [Matrix.transpose_apply, LinearMap.toMatrix'_apply] + change Matrix.vecMul _ X j = R.row g j + rw [hrow, e] +/-- If the targets are independent, a V mix makes the end rows independent too ("G1 rows are +|G1| independent vectors inside span(G1 targets)"). -/ +theorem vmixM_indep (X R : Matrix G ι K) (h : VMixM X R) (hR : LinearIndependent K R.row) : + LinearIndependent K X.row := by + obtain ⟨C, hC, hCX⟩ := h + have hX : X = C⁻¹ * R := by + rw [← hCX, ← Matrix.mul_assoc, Matrix.nonsing_inv_mul _ hC, Matrix.one_mul] + rw [← Matrix.vecMul_injective_iff] at hR ⊢ + have hCi : Function.Injective (fun v : G → K => Matrix.vecMul v C⁻¹) := + Matrix.vecMul_injective_iff_isUnit.2 ((Matrix.isUnit_iff_isUnit_det _).2 ((Matrix.isUnit_nonsing_inv_det_iff).2 hC)) + intro v w hvw + apply hCi; apply hR + simpa [hX, Matrix.vecMul_vecMul] using hvw + +/-- **Uniqueness.** With independent end rows, the V mix is unique. -/ +theorem vmixM_unique (X R : Matrix G ι K) (hX : LinearIndependent K X.row) + (C C' : Matrix G G K) (h : C * X = R) (h' : C' * X = R) : C = C' := by + rw [← Matrix.vecMul_injective_iff] at hX + ext g h0 + have : Matrix.vecMul (C g) X = Matrix.vecMul (C' g) X := by + have e1 : (C * X).row g = Matrix.vecMul (C g) X := rfl + have e2 : (C' * X).row g = Matrix.vecMul (C' g) X := rfl + rw [← e1, ← e2, h, h'] + exact congrFun (hX this) h0 + +/-- **Token order affects only fill.** `vmixM_iff_span` (and `rank_law`) carry no order hypothesis: +existence of the V mix does not depend on any carrier/token order. An order only shapes `C`: +if the end rows are a block-triangular (w.r.t. the order `b`) invertible recombination of the +targets, the V mix is block-triangular, so it has no fill outside the triangle. -/ +theorem vmixM_fill {α : Type*} [LinearOrder α] (b : G → α) (X R : Matrix G ι K) + (Tg : Matrix G G K) (hT : Tg.BlockTriangular b) (hdet : IsUnit Tg.det) (hX : X = Tg * R) : + ∃ C : Matrix G G K, IsUnit C.det ∧ C * X = R ∧ C.BlockTriangular b := by + letI := Matrix.invertibleOfIsUnitDet Tg hdet + refine ⟨Tg⁻¹, (Matrix.isUnit_nonsing_inv_det_iff).2 hdet, ?_, + Matrix.blockTriangular_inv_of_blockTriangular hT⟩ + rw [hX, ← Matrix.mul_assoc, Matrix.nonsing_inv_mul _ hdet, Matrix.one_mul] + +/-- **Realisability by V-hub ops.** Every V mix factors into transvections (ADD i += c·j between +two V-enders), a diagonal with nonzero entries (SCALEs), and transvections. -/ +theorem vmix_ops (Cm : Matrix G G K) (hC : IsUnit Cm.det) : + ∃ (L L' : List (Matrix.TransvectionStruct G K)) (D : G → K), (∀ g, D g ≠ 0) ∧ + Cm = (L.map Matrix.TransvectionStruct.toMatrix).prod * Matrix.diagonal D * + (L'.map Matrix.TransvectionStruct.toMatrix).prod := by + obtain ⟨L, L', D, hM⟩ := Matrix.Pivot.exists_list_transvec_mul_diagonal_mul_list_transvec Cm + refine ⟨L, L', D, fun g hg => ?_, hM⟩ + have hdet : Cm.det = ∏ g, D g := by + rw [hM, Matrix.det_mul, Matrix.det_mul, Matrix.TransvectionStruct.det_toMatrix_prod, + Matrix.TransvectionStruct.det_toMatrix_prod, Matrix.det_diagonal]; simp + rw [hdet] at hC + exact hC.ne_zero (Finset.prod_eq_zero (Finset.mem_univ g) hg) + +end Mix + +section Run +open TokenCancel +variable {K Reg C : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] [DecidableEq C] + +/-- Span of the rows of a state. -/ +abbrev Sp (s : St K Reg C) : Submodule K (Reg → K) := span K (Set.range s.row) + +/-- Rows of the other registers. -/ +abbrev Oth (s : St K Reg C) (i : Reg) : Submodule K (Reg → K) := span K (s.row '' {r | r ≠ i}) + +theorem span_range_update (f : Reg → Reg → K) (i : Reg) (v : Reg → K) : + span K (Set.range (Function.update f i v)) = span K (f '' {r | r ≠ i}) ⊔ K ∙ v := by + have : Set.range (Function.update f i v) = f '' {r | r ≠ i} ∪ {v} := by + ext x; constructor + · rintro ⟨r, rfl⟩ + by_cases hr : r = i + · subst hr; simp + · left; exact ⟨r, hr, by simp [Function.update_of_ne hr]⟩ + · rintro (⟨r, hr, rfl⟩ | hx) + · exact ⟨r, by simp [Function.update_of_ne (show r ≠ i from hr)]⟩ + · rw [Set.mem_singleton_iff] at hx; exact ⟨i, by simp [hx]⟩ + rw [this, span_union] + +theorem span_range_eq (f : Reg → Reg → K) (i : Reg) : + span K (Set.range f) = span K (f '' {r | r ≠ i}) ⊔ K ∙ f i := by + conv_lhs => rw [show f = Function.update f i (f i) by simp] + exact span_range_update f i (f i) + +theorem sup_singleton_add (S : Submodule K (Reg → K)) (x w : Reg → K) (hw : w ∈ S) : + S ⊔ K ∙ (x + w) = S ⊔ K ∙ x := by + apply le_antisymm + · refine sup_le le_sup_left ((span_singleton_le_iff_mem _ _).2 ?_) + exact add_mem (mem_sup_right (mem_span_singleton_self x)) (mem_sup_left hw) + · refine sup_le le_sup_left ((span_singleton_le_iff_mem _ _).2 ?_) + have h := sub_mem (mem_sup_right (mem_span_singleton_self (x + w)) : x + w ∈ S ⊔ K ∙ (x + w)) + (mem_sup_left hw : w ∈ S ⊔ K ∙ (x + w)) + simpa using h + +/-- A loss of rank: CLEAR or COPY (onto a different source) of a row that is not in the span of +the other rows at that instant. -/ +def Lossy (s : St K Reg C) : Ev K Reg C → Prop + | .clear i _ => s.row i ∉ Oth s i + | .copy i j _ => i ≠ j ∧ s.row i ∉ Oth s i + | _ => False + +/-- A loss somewhere along the run. -/ +def Loss : St K Reg C → List (Ev K Reg C) → Prop + | _, [] => False + | s, e :: es => Lossy s e ∨ Loss (step s e) es + +/-- Every SCALE factor is nonzero (a SCALE by 0 is a CLEAR). -/ +def NZ : Ev K Reg C → Prop + | .scale _ u _ => u ≠ 0 + | _ => True + +/-- Tokens: registers present at the start plus registers born so far. -/ +def tokStep (T : Finset Reg) : Ev K Reg C → Finset Reg + | .born i _ => insert i T + | _ => T + +def tokRun (T : Finset Reg) : List (Ev K Reg C) → Finset Reg + | [] => T + | e :: es => tokRun (tokStep T e) es + +/-- Token span. -/ +abbrev TS (T : Finset Reg) : Submodule K (Reg → K) := + span K ((fun r => (Pi.single r (1 : K) : Reg → K)) '' (T : Set Reg)) + +theorem finrank_TS (T : Finset Reg) : finrank K (TS (K := K) T) = T.card := by + let b : T → Reg → K := fun r => Pi.single (r : Reg) (1 : K) + have hb : LinearIndependent K b := by + have := (Pi.basisFun K Reg).linearIndependent.comp (Subtype.val : T → Reg) Subtype.val_injective + convert this using 1; funext r; simp [b, Pi.basisFun_apply] + have hr : Set.range b = (fun r => (Pi.single r (1 : K) : Reg → K)) '' (T : Set Reg) := by + ext x; simp [b] + have := finrank_span_eq_card hb + rw [hr] at this + rw [this, Fintype.card_coe] + +variable (z V : C) + +/-- Bookkeeping invariant: absent registers have row 0; tokens are present registers. -/ +def Good (s : St K Reg C) (T : Finset Reg) : Prop := + (∀ r, s.loc r = none → s.row r = 0) ∧ (∀ r ∈ T, s.loc r ≠ none) + +theorem good_step (s : St K Reg C) (T : Finset Reg) (e : Ev K Reg C) + (hL : LegalEv z V s e) (hG : Good s T) : Good (step s e) (tokStep T e) := by + obtain ⟨h1, h2⟩ := hG + cases e with + | born i c => + refine ⟨fun r hr => ?_, fun r hr => ?_⟩ + · by_cases hri : r = i + · subst hri; simp [step] at hr + · simp only [step, Function.update_of_ne hri] at hr ⊢; exact h1 r hr + · by_cases hri : r = i + · subst hri; simp [step] + · simp only [tokStep, Finset.mem_insert, hri, false_or] at hr + simp only [step, Function.update_of_ne hri]; exact h2 r hr + | init i c => + refine ⟨fun r hr => ?_, fun r hr => ?_⟩ + · by_cases hri : r = i + · subst hri; simp [step] + · simp only [step, Function.update_of_ne hri] at hr ⊢; exact h1 r hr + · by_cases hri : r = i + · subst hri; simp [step] + · simp only [step, Function.update_of_ne hri]; exact h2 r hr + | move i c => + refine ⟨fun r hr => ?_, fun r hr => ?_⟩ + · by_cases hri : r = i + · subst hri; simp [step] at hr + · simp only [step, Function.update_of_ne hri] at hr ⊢; exact h1 r hr + · by_cases hri : r = i + · subst hri; simp [step] + · simp only [step, Function.update_of_ne hri]; exact h2 r hr + | add i j a c => + obtain ⟨-, hi, -⟩ := hL + refine ⟨fun r hr => ?_, h2⟩ + by_cases hri : r = i + · subst hri; simp [step, hi] at hr + · simp only [step, Function.update_of_ne hri] at hr ⊢; exact h1 r hr + | scale i u c => + have hi : s.loc i = some c := hL + refine ⟨fun r hr => ?_, h2⟩ + by_cases hri : r = i + · subst hri; simp only [step] at hr; rw [hi] at hr; exact absurd hr (by simp) + · simp only [step, Function.update_of_ne hri] at hr ⊢; exact h1 r hr + | clear i c => + refine ⟨fun r hr => ?_, h2⟩ + by_cases hri : r = i + · subst hri; simp [step] + · simp only [step, Function.update_of_ne hri] at hr ⊢; exact h1 r hr + | copy i j c => + obtain ⟨hi, -⟩ := hL + refine ⟨fun r hr => ?_, h2⟩ + by_cases hri : r = i + · subst hri; simp [step, hi] at hr + · simp only [step, Function.update_of_ne hri] at hr ⊢; exact h1 r hr + +theorem Sp_eq_oth (s : St K Reg C) (i : Reg) : Sp s = Oth s i ⊔ K ∙ s.row i := + span_range_eq s.row i + +theorem Sp_update (s : St K Reg C) (i : Reg) (v : Reg → K) (l : Reg → Option C) : + Sp (⟨Function.update s.row i v, l⟩ : St K Reg C) = Oth s i ⊔ K ∙ v := + span_range_update s.row i v + +theorem mem_oth (s : St K Reg C) {i j : Reg} (h : j ≠ i) : s.row j ∈ Oth s i := + subset_span ⟨j, h, rfl⟩ + +/-- **Only CLEAR (and COPY) can lose rank.** Every non-birth op keeps the row span inside the +old one. -/ +theorem Sp_step_le (s : St K Reg C) (T : Finset Reg) (e : Ev K Reg C) (hb : ∀ i c, e ≠ .born i c) + (hL : LegalEv z V s e) (hG : Good s T) : Sp (step s e) ≤ Sp s := by + cases e with + | born i c => exact absurd rfl (hb i c) + | init i c => + have h0 : s.row i = 0 := hG.1 i hL + simp only [step]; rw [Sp_update, Sp_eq_oth s i, h0] + | move i c => exact le_rfl + | add i j a c => + simp only [step]; rw [Sp_update, Sp_eq_oth s i, + sup_singleton_add _ _ _ (smul_mem _ _ (mem_oth s (Ne.symm hL.1)))] + | scale i u c => + simp only [step]; rw [Sp_update, Sp_eq_oth s i] + exact sup_le_sup_left ((span_singleton_le_iff_mem _ _).2 + (smul_mem _ _ (mem_span_singleton_self _))) _ + | clear i c => + simp only [step]; rw [Sp_update, Sp_eq_oth s i, span_singleton_eq_bot.2 rfl, sup_bot_eq] + exact le_sup_left + | copy i j c => + simp only [step]; rw [Sp_update, Sp_eq_oth s i] + by_cases hij : j = i + · subst hij; exact le_rfl + · exact sup_le le_sup_left (le_trans ((span_singleton_le_iff_mem _ _).2 (mem_oth s hij)) + le_sup_left) + +theorem TS_insert (T : Finset Reg) (i : Reg) : + TS (K := K) (insert i T) = TS (K := K) T ⊔ K ∙ (Pi.single i (1 : K) : Reg → K) := by + simp only [TS, Finset.coe_insert, Set.image_insert_eq, span_insert]; exact sup_comm _ _ + +/-- A non-lossy step keeps the row span equal to the token span (SCALE factors nonzero). -/ +theorem Sp_step_noloss (s : St K Reg C) (T : Finset Reg) (e : Ev K Reg C) + (hL : LegalEv z V s e) (hN : NZ e) (hG : Good s T) (hS : Sp s = TS T) (hl : ¬ Lossy s e) : + Sp (step s e) = TS (tokStep T e) := by + cases e with + | born i c => + have h0 : s.row i = 0 := hG.1 i hL + have : Sp s = Oth s i := by rw [Sp_eq_oth s i, h0, span_singleton_eq_bot.2 rfl, sup_bot_eq] + simp only [step, tokStep]; rw [Sp_update, TS_insert, ← hS, this] + | init i c => + have h0 : s.row i = 0 := hG.1 i hL + simp only [step, tokStep]; rw [Sp_update, ← hS, Sp_eq_oth s i, h0] + | move i c => exact hS + | add i j a c => + simp only [step, tokStep]; rw [Sp_update, ← hS, Sp_eq_oth s i, + sup_singleton_add _ _ _ (smul_mem _ _ (mem_oth s (Ne.symm hL.1)))] + | scale i u c => + simp only [step, tokStep]; rw [Sp_update, ← hS, Sp_eq_oth s i, + span_singleton_smul_eq (IsUnit.mk0 _ hN)] + | clear i c => + have hm : s.row i ∈ Oth s i := not_not.1 hl + simp only [step, tokStep]; rw [Sp_update, ← hS, Sp_eq_oth s i, span_singleton_eq_bot.2 rfl, + sup_bot_eq, sup_eq_left.2 ((span_singleton_le_iff_mem _ _).2 hm)] + | copy i j c => + simp only [step, tokStep] + by_cases hij : j = i + · subst hij; simpa using hS + · have hm : s.row i ∈ Oth s i := by + by_contra h; exact hl ⟨Ne.symm hij, h⟩ + rw [Sp_update, ← hS, Sp_eq_oth s i, sup_eq_left.2 ((span_singleton_le_iff_mem _ _).2 hm), + sup_eq_left.2 ((span_singleton_le_iff_mem _ _).2 (mem_oth s hij))] + +open Classical in +/-- Rank bookkeeping for one step: rank + tokens never gains, and a lossy step loses one. -/ +theorem rank_step (s : St K Reg C) (T : Finset Reg) (e : Ev K Reg C) + (hL : LegalEv z V s e) (hG : Good s T) : + finrank K (Sp (step s e)) + T.card + (if Lossy s e then 1 else 0) ≤ + finrank K (Sp s) + (tokStep T e).card := by + classical + by_cases hb : ∃ i c, e = .born i c + · obtain ⟨i, c, rfl⟩ := hb + have hloc : s.loc i = none := hL + have h0 : s.row i = 0 := hG.1 i hloc + have hiT : i ∉ T := fun h => hG.2 i h hloc + have hl : ¬ Lossy s (.born i c : Ev K Reg C) := id + simp only [hl, if_false, add_zero, tokStep, Finset.card_insert_of_notMem hiT] + have hS : Sp s = Oth s i := by rw [Sp_eq_oth s i, h0, span_singleton_eq_bot.2 rfl, sup_bot_eq] + have hE : Sp (step s (.born i c)) = Oth s i ⊔ K ∙ (Pi.single i (1:K) : Reg → K) := by + simp only [step]; rw [Sp_update] + have e1 := congrArg (fun S : Submodule K (Reg → K) => finrank K S) hE + have e2 := congrArg (fun S : Submodule K (Reg → K) => finrank K S) hS + have := Submodule.finrank_add_le_finrank_add_finrank (Oth s i) (K ∙ (Pi.single i (1:K) : Reg → K)) + have hv : (Pi.single i (1:K) : Reg → K) ≠ 0 := fun h => by simpa using congrFun h i + have h1 := finrank_span_singleton (K := K) hv + omega + · push Not at hb + have hle := Sp_step_le z V s T e hb hL hG + have hT : tokStep T e = T := by cases e <;> simp_all [tokStep] + rw [hT] + by_cases hl : Lossy s e + · simp only [hl, if_true] + have hlt : Sp (step s e) < Sp s := by + refine lt_of_le_of_ne hle (fun heq => ?_) + cases e with + | clear i c => + apply hl + have : s.row i ∈ Sp s := subset_span ⟨i, rfl⟩ + rw [← heq] at this; simp only [step] at this + rw [Sp_update, span_singleton_eq_bot.2 rfl, sup_bot_eq] at this; exact this + | copy i j c => + apply hl.2 + have : s.row i ∈ Sp s := subset_span ⟨i, rfl⟩ + rw [← heq] at this; simp only [step] at this + rwa [Sp_update, sup_eq_left.2 ((span_singleton_le_iff_mem _ _).2 (mem_oth s hl.1.symm))] + at this + | _ => exact hl.elim + have := Submodule.finrank_lt_finrank_of_lt hlt + omega + · simp only [hl, if_false] + have := Submodule.finrank_mono hle + omega + +/-- No loss along a legal run (SCALE factors nonzero): the final row span is the token span. -/ +theorem span_run (s : St K Reg C) (T : Finset Reg) (evs : List (Ev K Reg C)) + (hL : Legal z V s evs) (hN : ∀ e ∈ evs, NZ e) (hG : Good s T) (hS : Sp s = TS T) + (hl : ¬ Loss s evs) : Sp (run s evs) = TS (tokRun T evs) := by + induction evs generalizing s T with + | nil => exact hS + | cons e es ih => + simp only [Loss, not_or] at hl + exact ih (step s e) (tokStep T e) hL.2 (fun e' he' => hN e' (List.mem_cons_of_mem _ he')) + (good_step z V s T e hL.1 hG) + (Sp_step_noloss z V s T e hL.1 (hN e List.mem_cons_self) hG hS hl.1) hl.2 + +/-- Rank bookkeeping along a legal run: any slack m is kept, and a loss adds one more unit. -/ +theorem rank_run (s : St K Reg C) (T : Finset Reg) (evs : List (Ev K Reg C)) + (hL : Legal z V s evs) (hG : Good s T) (m : ℕ) (hm : finrank K (Sp s) + m ≤ T.card) : + finrank K (Sp (run s evs)) + m ≤ (tokRun T evs).card ∧ + (Loss s evs → finrank K (Sp (run s evs)) + m + 1 ≤ (tokRun T evs).card) := by + induction evs generalizing s T m with + | nil => exact ⟨hm, fun h => h.elim⟩ + | cons e es ih => + simp only [run, tokRun] + have hst := rank_step z V s T e hL.1 hG + have hG' := good_step z V s T e hL.1 hG + by_cases hl : Lossy s e + · simp only [hl, if_true] at hst + have := (ih (step s e) (tokStep T e) hL.2 hG' (m + 1) (by omega)).1 + exact ⟨le_trans (Nat.le_succ _) this, fun _ => this⟩ + · simp only [hl, if_false, add_zero] at hst + have := ih (step s e) (tokStep T e) hL.2 hG' m (by omega) + refine ⟨this.1, fun hlo => ?_⟩ + simp only [Loss, hl, false_or] at hlo + exact this.2 hlo + +/-- **Rank is lost exactly at lossy CLEAR/COPY.** For a legal run from a state whose rows span its +tokens (all SCALE factors nonzero), the final row span equals the final token span iff the run +contains no lossy event. -/ +theorem full_rank_iff_noloss (s : St K Reg C) (T : Finset Reg) (evs : List (Ev K Reg C)) + (hL : Legal z V s evs) (hN : ∀ e ∈ evs, NZ e) (hG : Good s T) (hS : Sp s = TS T) : + Sp (run s evs) = TS (tokRun T evs) ↔ ¬ Loss s evs := by + refine ⟨fun h hl => ?_, span_run z V s T evs hL hN hG hS⟩ + have h0 : finrank K (Sp s) + 0 ≤ T.card := by + rw [hS, finrank_TS]; simp + have := (rank_run z V s T evs hL hG 0 h0).2 hl + have e := congrArg (fun S : Submodule K (Reg → K) => finrank K S) h + rw [e, finrank_TS] at this + omega + +/-- Cancellation: two subspaces of `U` with the same sum against a complement-to-`U` piece agree. -/ +theorem eq_of_sup_eq {M : Type*} [AddCommGroup M] [Module K M] (A B N U : Submodule K M) + (hA : A ≤ U) (hB : B ≤ U) (hUN : U ⊓ N = ⊥) (h : A ⊔ N = B ⊔ N) : A = B := by + have key : ∀ A B : Submodule K M, A ≤ U → B ≤ U → A ⊔ N = B ⊔ N → A ≤ B := by + intro A B hA hB h x hx + have : x ∈ B ⊔ N := h ▸ mem_sup_left hx + obtain ⟨b, hb, n, hn, rfl⟩ := mem_sup.1 this + have hnU : n ∈ U := by + have := sub_mem (hA hx) (hB hb); simpa using this + have : n ∈ U ⊓ N := ⟨hnU, hn⟩ + rw [hUN, mem_bot] at this; subst this; simpa using hb + exact le_antisymm (key A B hA hB h) (key B A hB hA h.symm) + +theorem span_range_split (f : Reg → Reg → K) (G1 : Finset Reg) : + span K (Set.range f) = span K (f '' (G1 : Set Reg)) ⊔ span K (f '' (G1 : Set Reg)ᶜ) := by + rw [← span_union, ← Set.image_union, Set.union_compl_self, Set.image_univ] + +theorem range_restrict (f : Reg → Reg → K) (G1 : Finset Reg) : + Set.range (Matrix.of fun g : G1 => f g).row = f '' (G1 : Set Reg) := by + ext x; constructor + · rintro ⟨g, rfl⟩; exact ⟨g, g.2, rfl⟩ + · rintro ⟨g, hg, rfl⟩; exact ⟨⟨g, hg⟩, rfl⟩ + +/-- The V mix of a run: an invertible `C` over the registers `G1` that end at V with +`C · X[G1] = Rf[G1]`, where `X` are the end rows of the run (all V-hub ops deleted). -/ +def VMix (X Rf : Reg → Reg → K) (G1 : Finset Reg) : Prop := + VMixM (Matrix.of fun g : G1 => X g) (Matrix.of fun g : G1 => Rf g) + +/-- **RANK law (internal notes).** Run a legal word (V-hub ops deleted, SCALE factors +nonzero) from a state whose rows span its tokens. Let `G1` end at V; assume every other register +already ends at its target (`hNon`), and the target end state has full token rank (`hTgt`). +Let `U` be the "zero-W0" subspace (T_X + tokens): it contains the V targets (`hRU`) and meets the +span of the non-V targets only in 0 (`hUN`). Then a V mix exists iff +(i) no CLEAR/COPY loses rank and (ii) every V-ender row lies in `U`. -/ +theorem rank_law (s : St K Reg C) (T : Finset Reg) (evs : List (Ev K Reg C)) + (hL : Legal z V s evs) (hN : ∀ e ∈ evs, NZ e) (hG : Good s T) (hS : Sp s = TS T) + (Rf : Reg → Reg → K) (G1 : Finset Reg) (U : Submodule K (Reg → K)) + (hNon : ∀ r ∉ G1, (run s evs).row r = Rf r) + (hTgt : span K (Set.range Rf) = TS (tokRun T evs)) + (hRU : ∀ g ∈ G1, Rf g ∈ U) + (hUN : U ⊓ span K (Rf '' (G1 : Set Reg)ᶜ) = ⊥) : + VMix (run s evs).row Rf G1 ↔ ¬ Loss s evs ∧ ∀ g ∈ G1, (run s evs).row g ∈ U := by + set X := (run s evs).row with hXdef + have hNim : X '' (G1 : Set Reg)ᶜ = Rf '' (G1 : Set Reg)ᶜ := + Set.image_congr (fun r hr => hNon r (by simpa using hr)) + have hBU : span K (Rf '' (G1 : Set Reg)) ≤ U := + span_le.2 (by rintro _ ⟨g, hg, rfl⟩; exact hRU g hg) + unfold VMix + rw [vmixM_iff_span, range_restrict, range_restrict] + constructor + · intro hAB + have hfull : Sp (run s evs) = TS (tokRun T evs) := by + rw [← hTgt, Sp, ← hXdef, span_range_split X G1, span_range_split Rf G1, hAB, hNim] + refine ⟨(full_rank_iff_noloss z V s T evs hL hN hG hS).1 hfull, fun g hg => ?_⟩ + exact hBU (hAB ▸ subset_span ⟨g, hg, rfl⟩) + · rintro ⟨hl, hU⟩ + have hfull := span_run z V s T evs hL hN hG hS hl + have hsum : span K (X '' (G1 : Set Reg)) ⊔ span K (Rf '' (G1 : Set Reg)ᶜ) = + span K (Rf '' (G1 : Set Reg)) ⊔ span K (Rf '' (G1 : Set Reg)ᶜ) := by + rw [← hNim, ← span_range_split X G1, hNim, ← span_range_split Rf G1, hTgt]; exact hfull + exact eq_of_sup_eq _ _ _ U (span_le.2 (by rintro _ ⟨g, hg, rfl⟩; exact hU g hg)) hBU hUN hsum + +/-- ADD and SCALE (nonzero) are invertible ops: an inverse op restores the state exactly. -/ +theorem add_inverse (s : St K Reg C) (i j : Reg) (a : K) (c : C) (hij : i ≠ j) : + step (step s (.add i j a c)) (.add i j (-a) c) = s := by + obtain ⟨row, loc⟩ := s + simp only [step, St.mk.injEq, and_true] + funext r; by_cases hr : r = i + · subst hr; simp [Function.update_of_ne (Ne.symm hij)] + · simp [Function.update_of_ne hr] + +theorem scale_inverse (s : St K Reg C) (i : Reg) (u : K) (c : C) (hu : u ≠ 0) : + step (step s (.scale i u c)) (.scale i u⁻¹ c) = s := by + obtain ⟨row, loc⟩ := s + simp only [step, St.mk.injEq, and_true] + funext r; by_cases hr : r = i + · subst hr; simp [smul_smul, inv_mul_cancel₀ hu] + · simp [Function.update_of_ne hr] + +/-- The canonical start: present registers carry their own coordinate, absent ones 0. -/ +def start (l : Reg → Option C) : St K Reg C := + ⟨fun r => if l r = none then 0 else Pi.single r 1, l⟩ + +def startTok (l : Reg → Option C) : Finset Reg := Finset.univ.filter fun r => l r ≠ none + +theorem start_good (l : Reg → Option C) : Good (start (K := K) l) (startTok l) := + ⟨fun r hr => by simp only [start] at hr ⊢; simp [hr], fun r hr => by simpa [start, startTok] using hr⟩ + +theorem start_span (l : Reg → Option C) : Sp (start (K := K) l) = TS (startTok l) := by + apply le_antisymm + · refine span_le.2 ?_ + rintro _ ⟨r, rfl⟩ + by_cases hr : l r = none + · simp [start, hr] + · simp only [start, hr, if_false] + exact subset_span ⟨r, by simpa [startTok] using hr, rfl⟩ + · refine span_le.2 ?_ + rintro _ ⟨r, hr, rfl⟩ + have hr' : l r ≠ none := by simpa [startTok] using hr + exact subset_span ⟨r, by simp [start, hr']⟩ + +/-- **Finding: COPY is not invertible either.** The prose lists CLEAR as the only rank-losing op; +in the op model with COPY (i := j's row), COPY onto a row outside the others' span loses rank. -/ +theorem copy_lossy_example : + Lossy (start (K := ℚ) (C := Unit) (fun _ : Fin 2 => some ())) (.copy 0 1 ()) := by + refine ⟨by decide, fun h => ?_⟩ + have himg : (start (K := ℚ) (C := Unit) (fun _ : Fin 2 => some ())).row '' {r | r ≠ 0} = + {Pi.single 1 1} := by + ext x; simp only [Set.mem_image, Set.mem_ofPred_eq, Set.mem_singleton_iff, start] + constructor + · rintro ⟨r, hr, rfl⟩ + have : r = 1 := by fin_cases r <;> simp_all + subst this; simp + · rintro rfl; exact ⟨1, by decide, by simp⟩ + rw [Oth, himg, mem_span_singleton] at h + obtain ⟨a, ha⟩ := h + have := congrFun ha 0 + simp [start] at this + +end Run + +end RankLaw + +#print axioms RankLaw.rank_law +#print axioms RankLaw.full_rank_iff_noloss +#print axioms RankLaw.vmixM_iff_span +#print axioms RankLaw.vmixM_fill +#print axioms RankLaw.vmix_ops +#print axioms RankLaw.vmixM_unique +#print axioms RankLaw.vmixM_indep +#print axioms RankLaw.copy_lossy_example +#print axioms RankLaw.add_inverse +#print axioms RankLaw.scale_inverse +#print axioms RankLaw.start_span diff --git a/research/p104-tree-ceiling/lean/Nov15/RankLaw.md b/research/p104-tree-ceiling/lean/Nov15/RankLaw.md new file mode 100644 index 0000000000..fbd610a6ce --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/RankLaw.md @@ -0,0 +1,48 @@ +# RankLaw.lean: rebuild's RANK law (RESULT §7, internal log CORE r2). No sorry, ~7 s, 2.2 GB RSS +Source: internal notes §7 and the CORE r2 line in internal log.md. +Axioms: [propext, Classical.choice, Quot.sound]. + +Build (imports the TokenCancel olean): + lake env lean -o .lake/build/lib/lean/Nov15/TokenCancel.olean Nov15/TokenCancel.lean + lake env lean -o .lake/build/lib/lean/Nov15/RankLaw.olean Nov15/RankLaw.lean + +**Model.** TokenCancel's op model and legality (born/init/move/add/scale/clear/copy, co-presence; z, V arbitrary). +- Tokens = registers present at the start plus births so far (`tokRun`). Token span `TS T` = span of the e_r, r ∈ T, with `finrank_TS` = |T|. +- `Good`: absent registers have row 0 and tokens are present. `start l` (own coordinate if present, 0 if absent) satisfies `Good`, and its rows span its tokens (`start_good`, `start_span`). +- `Lossy s e`: a CLEAR of i, or a COPY into i from j ≠ i, while row i ∉ span(other rows) at that instant. `Loss` = some lossy event in the run. `NZ`: SCALE factor ≠ 0. + +**The V-mix target (a linear system).** `VMixM X R` := ∃ C, det C a unit, C·X = R. X = end rows of the V-enders G1 after a run with the V-hub ops deleted, R = their targets. +- `vmixM_iff_span`: solvable iff rowspan X = rowspan R. Built on `exists_equiv_comp`: two maps with equal range differ by an automorphism. +- `vmix_ops`: every such C is a product transvections · diag(D) · transvections with all D ≠ 0, i.e. V-hub ADDs and nonzero SCALEs (Mathlib Pivot). +- `vmixM_indep`: independent targets imply independent end rows. `vmixM_unique`: independent end rows make C unique. + +**Only CLEAR (and COPY) lose rank.** +- `add_inverse` and `scale_inverse` (u ≠ 0): the inverse op restores the state exactly. +- `Sp_step_le`: no non-birth op enlarges the row span. +- `rank_step`, `rank_run`: (row rank) + (slack) never exceeds |tokens|, and a lossy step costs one unit for good. +- `span_run`: with no loss, end row span = token span. +- `full_rank_iff_noloss`: end row span = token span ⟺ no lossy CLEAR/COPY. + +**`rank_law` (the iff).** Assume: +- a legal run with NZ, from a state whose rows span its tokens; +- non-V registers already end on their targets (`hNon`); +- the target end state spans the final tokens (`hTgt`; true when the target is the end of any loss-free legal word with the same births, by `span_run`); +- U ⊇ V targets (`hRU`), and U ∩ span(non-V targets) = 0 (`hUN`). + +Then: V mix exists ⟺ (i) no lossy CLEAR/COPY and (ii) every V-ender end row ∈ U. + +**Token order** (`vmixM_fill` + the shape of `rank_law`). +- Neither existence statement has an order hypothesis, so correctness never depends on the LATE order. +- An order b only shapes C: if X = T·R with T block-triangular for b and invertible, then the V mix C = T⁻¹ is block-triangular. No fill outside the triangle. + +**Findings (prose statements false or underspecified as written).** +1. **"Every op except CLEAR is invertible" is false with COPY.** `copy_lossy_example` (over ℚ, 2 registers): COPY 0←1 is lossy. + - Also SCALE by 0 is a CLEAR. + - Minimal fix: "every op except CLEAR, COPY-over-a-live-row and SCALE 0", or treat COPY as CLEAR + ADD. The law then holds verbatim with Lossy covering COPY. + - #7623 behaviour is unaffected if its words contain no such COPY. Not checked here. +2. **(ii) "zero W0 part" is only the right criterion relative to a U that meets the span of the non-V targets trivially (`hUN`).** Without that, the iff fails. + - Hand example: G1 = {g}, N = {n}, Rf g = e1, Rf n = e2, U = everything, X g = e1 + e2. There is no loss and X g ∈ U, but X g ∉ span{e1}. + - The "only if" of (i) also needs `hTgt`, the target state's full token rank. +3. "The V mix is unique" needs independent end rows. rank X[G1] = |G1| was checked [C] on #7623. + +**Scope.** "Owned" is not used; the law holds for any register. The W0/T_X split enters only through U. diff --git a/research/p104-tree-ceiling/lean/Nov15/RankLawC.lean b/research/p104-tree-ceiling/lean/Nov15/RankLawC.lean new file mode 100644 index 0000000000..5c72771505 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/RankLawC.lean @@ -0,0 +1,167 @@ +/- +RankLaw (c) fix, See RankLawC.md. + +`rank_law` needs U ⊓ span(non-V targets) = ⊥. This file drops that hypothesis: +* `rank_law_gen`: with no U at all, V mix ⟺ no loss ∧ every V-ender row ∈ B ∧ B ⊓ N ≤ A + (B = span V targets, N = span non-V targets, A = span V-ender rows). +* `rank_law_proj`: for any U ⊇ B and any linear π vanishing on B and injective on U ⊓ N, + condition (ii) becomes "row ∈ U and π(row) = 0" (the (U ⊓ N)-component vanishes). +* `rank_law_indep`: if B ⊓ N = ⊥ (independent targets) the third clause disappears. +* `rank_law_of_gen`: the original `rank_law` is the case π = 0. + +Build (imports the RankLaw olean, itself built on TokenCancel): + lake env lean -o .lake/build/lib/lean/Nov15/TokenCancel.olean Nov15/TokenCancel.lean + lake env lean -o .lake/build/lib/lean/Nov15/RankLaw.olean Nov15/RankLaw.lean + lake env lean -o .lake/build/lib/lean/Nov15/RankLawC.olean Nov15/RankLawC.lean +-/ +import Nov15.RankLaw + +set_option linter.unusedSectionVars false + +namespace RankLawC +open Submodule Module TokenCancel RankLaw + +section Lat +variable {K M : Type*} [Field K] [AddCommGroup M] [Module K M] + +/-- Cancellation without a complement: given A ⊔ N = B ⊔ N, A = B iff A ≤ B and B ⊓ N ≤ A. -/ +theorem eq_iff_of_sup_eq (A B N : Submodule K M) (h : A ⊔ N = B ⊔ N) : + A = B ↔ A ≤ B ∧ B ⊓ N ≤ A := by + constructor + · rintro rfl; exact ⟨le_rfl, inf_le_left⟩ + · rintro ⟨hAB, hBN⟩ + refine le_antisymm hAB fun b hb => ?_ + have : b ∈ A ⊔ N := h ▸ mem_sup_left hb + obtain ⟨a, ha, n, hn, rfl⟩ := mem_sup.1 this + have hnB : n ∈ B := by + have := sub_mem hb (hAB ha); simpa using this + exact add_mem ha (hBN ⟨hnB, hn⟩) + +/-- The (U ⊓ N)-component test: if B ≤ U, x ∈ U ⊓ (B ⊔ N), π vanishes on B and is injective on U ⊓ N, +then x ∈ B ⟺ π x = 0. -/ +theorem mem_iff_proj {M' : Type*} [AddCommGroup M'] [Module K M'] (B N U : Submodule K M) + (π : M →ₗ[K] M') (hBU : B ≤ U) (hπB : ∀ b ∈ B, π b = 0) + (hπ : LinearMap.ker π ⊓ (U ⊓ N) = ⊥) (x : M) (hxU : x ∈ U) (hx : x ∈ B ⊔ N) : + x ∈ B ↔ π x = 0 := by + refine ⟨hπB x, fun h0 => ?_⟩ + obtain ⟨b, hb, n, hn, rfl⟩ := mem_sup.1 hx + have hnU : n ∈ U := by + have := sub_mem hxU (hBU hb); simpa using this + have hπn : π n = 0 := by rw [map_add, hπB b hb, zero_add] at h0; exact h0 + have : n ∈ LinearMap.ker π ⊓ (U ⊓ N) := ⟨hπn, hnU, hn⟩ + rw [hπ, mem_bot] at this + subst this; simpa using hb + +end Lat + +section Run +variable {K Reg C : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] [DecidableEq C] +variable (z V : C) + +/-- With no loss (and the RankLaw hypotheses), A ⊔ N = B ⊔ N. -/ +theorem sup_eq_of_noloss (s : St K Reg C) (T : Finset Reg) (evs : List (Ev K Reg C)) + (hL : Legal z V s evs) (hN : ∀ e ∈ evs, NZ e) (hG : Good s T) (hS : Sp s = TS T) + (Rf : Reg → Reg → K) (G1 : Finset Reg) + (hNon : ∀ r ∉ G1, (run s evs).row r = Rf r) + (hTgt : span K (Set.range Rf) = TS (tokRun T evs)) (hl : ¬ Loss s evs) : + span K ((run s evs).row '' (G1 : Set Reg)) ⊔ span K (Rf '' (G1 : Set Reg)ᶜ) = + span K (Rf '' (G1 : Set Reg)) ⊔ span K (Rf '' (G1 : Set Reg)ᶜ) := by + set X := (run s evs).row with hXdef + have hNim : X '' (G1 : Set Reg)ᶜ = Rf '' (G1 : Set Reg)ᶜ := + Set.image_congr (fun r hr => hNon r (by simpa using hr)) + have hfull := span_run z V s T evs hL hN hG hS hl + rw [← hNim, ← span_range_split X G1, hNim, ← span_range_split Rf G1, hTgt]; exact hfull + +/-- **RankLaw, general form (no U).** Same hypotheses as `RankLaw.rank_law` minus `hRU`/`hUN`. +B = span V targets, N = span non-V targets, A = span V-ender end rows. -/ +theorem rank_law_gen (s : St K Reg C) (T : Finset Reg) (evs : List (Ev K Reg C)) + (hL : Legal z V s evs) (hN : ∀ e ∈ evs, NZ e) (hG : Good s T) (hS : Sp s = TS T) + (Rf : Reg → Reg → K) (G1 : Finset Reg) + (hNon : ∀ r ∉ G1, (run s evs).row r = Rf r) + (hTgt : span K (Set.range Rf) = TS (tokRun T evs)) : + VMix (run s evs).row Rf G1 ↔ ¬ Loss s evs ∧ + (∀ g ∈ G1, (run s evs).row g ∈ span K (Rf '' (G1 : Set Reg))) ∧ + span K (Rf '' (G1 : Set Reg)) ⊓ span K (Rf '' (G1 : Set Reg)ᶜ) ≤ + span K ((run s evs).row '' (G1 : Set Reg)) := by + set X := (run s evs).row with hXdef + have hNim : X '' (G1 : Set Reg)ᶜ = Rf '' (G1 : Set Reg)ᶜ := + Set.image_congr (fun r hr => hNon r (by simpa using hr)) + unfold VMix + rw [vmixM_iff_span, range_restrict, range_restrict] + have hAle : (∀ g ∈ G1, X g ∈ span K (Rf '' (G1 : Set Reg))) ↔ + span K (X '' (G1 : Set Reg)) ≤ span K (Rf '' (G1 : Set Reg)) := + ⟨fun h => span_le.2 (by rintro _ ⟨g, hg, rfl⟩; exact h g hg), + fun h g hg => h (subset_span ⟨g, hg, rfl⟩)⟩ + constructor + · intro hAB + have hfull : Sp (run s evs) = TS (tokRun T evs) := by + rw [← hTgt, Sp, ← hXdef, span_range_split X G1, span_range_split Rf G1, hAB, hNim] + refine ⟨(full_rank_iff_noloss z V s T evs hL hN hG hS).1 hfull, hAle.2 hAB.le, ?_⟩ + rw [hAB]; exact inf_le_left + · rintro ⟨hl, hB, hBN⟩ + have hsum := sup_eq_of_noloss z V s T evs hL hN hG hS Rf G1 hNon hTgt hl + exact (eq_iff_of_sup_eq _ _ _ hsum).2 ⟨hAle.1 hB, hBN⟩ + +/-- **Corrected condition (ii) relative to an arbitrary U ⊇ V targets.** π is any linear map that +vanishes on the V targets and is injective on U ⊓ N (it reads the "(U ⊓ N)-component"). -/ +theorem rank_law_proj {M' : Type*} [AddCommGroup M'] [Module K M'] + (s : St K Reg C) (T : Finset Reg) (evs : List (Ev K Reg C)) + (hL : Legal z V s evs) (hN : ∀ e ∈ evs, NZ e) (hG : Good s T) (hS : Sp s = TS T) + (Rf : Reg → Reg → K) (G1 : Finset Reg) (U : Submodule K (Reg → K)) (π : (Reg → K) →ₗ[K] M') + (hNon : ∀ r ∉ G1, (run s evs).row r = Rf r) + (hTgt : span K (Set.range Rf) = TS (tokRun T evs)) + (hRU : ∀ g ∈ G1, Rf g ∈ U) (hπR : ∀ g ∈ G1, π (Rf g) = 0) + (hπ : LinearMap.ker π ⊓ (U ⊓ span K (Rf '' (G1 : Set Reg)ᶜ)) = ⊥) : + VMix (run s evs).row Rf G1 ↔ ¬ Loss s evs ∧ + (∀ g ∈ G1, (run s evs).row g ∈ U ∧ π ((run s evs).row g) = 0) ∧ + span K (Rf '' (G1 : Set Reg)) ⊓ span K (Rf '' (G1 : Set Reg)ᶜ) ≤ + span K ((run s evs).row '' (G1 : Set Reg)) := by + set B := span K (Rf '' (G1 : Set Reg)) + have hBU : B ≤ U := span_le.2 (by rintro _ ⟨g, hg, rfl⟩; exact hRU g hg) + have hπB : ∀ b ∈ B, π b = 0 := by + intro b hb + have : B ≤ LinearMap.ker π := span_le.2 (by rintro _ ⟨g, hg, rfl⟩; exact hπR g hg) + exact this hb + rw [rank_law_gen z V s T evs hL hN hG hS Rf G1 hNon hTgt] + constructor + · rintro ⟨hl, hB, h3⟩ + exact ⟨hl, fun g hg => ⟨hBU (hB g hg), hπB _ (hB g hg)⟩, h3⟩ + · rintro ⟨hl, hU, h3⟩ + have hsum := sup_eq_of_noloss z V s T evs hL hN hG hS Rf G1 hNon hTgt hl + refine ⟨hl, fun g hg => ?_, h3⟩ + have hx : (run s evs).row g ∈ B ⊔ span K (Rf '' (G1 : Set Reg)ᶜ) := + hsum ▸ mem_sup_left (subset_span ⟨g, hg, rfl⟩) + exact (mem_iff_proj B _ U π hBU hπB hπ _ (hU g hg).1 hx).2 (hU g hg).2 + +/-- Independent targets (B ⊓ N = ⊥; true on #7623, whose 1501 public target rows have rank 1501): +the third clause is vacuous, and (ii) is "every V-ender row lies in the span of the V targets". -/ +theorem rank_law_indep (s : St K Reg C) (T : Finset Reg) (evs : List (Ev K Reg C)) + (hL : Legal z V s evs) (hN : ∀ e ∈ evs, NZ e) (hG : Good s T) (hS : Sp s = TS T) + (Rf : Reg → Reg → K) (G1 : Finset Reg) + (hNon : ∀ r ∉ G1, (run s evs).row r = Rf r) + (hTgt : span K (Set.range Rf) = TS (tokRun T evs)) + (hBN : span K (Rf '' (G1 : Set Reg)) ⊓ span K (Rf '' (G1 : Set Reg)ᶜ) = ⊥) : + VMix (run s evs).row Rf G1 ↔ ¬ Loss s evs ∧ + ∀ g ∈ G1, (run s evs).row g ∈ span K (Rf '' (G1 : Set Reg)) := by + rw [rank_law_gen z V s T evs hL hN hG hS Rf G1 hNon hTgt, hBN] + simp + +/-- Consistency: the original `rank_law` (U ⊓ N = ⊥) is `rank_law_proj` with π = 0. -/ +theorem rank_law_of_gen (s : St K Reg C) (T : Finset Reg) (evs : List (Ev K Reg C)) + (hL : Legal z V s evs) (hN : ∀ e ∈ evs, NZ e) (hG : Good s T) (hS : Sp s = TS T) + (Rf : Reg → Reg → K) (G1 : Finset Reg) (U : Submodule K (Reg → K)) + (hNon : ∀ r ∉ G1, (run s evs).row r = Rf r) + (hTgt : span K (Set.range Rf) = TS (tokRun T evs)) + (hRU : ∀ g ∈ G1, Rf g ∈ U) + (hUN : U ⊓ span K (Rf '' (G1 : Set Reg)ᶜ) = ⊥) : + VMix (run s evs).row Rf G1 ↔ ¬ Loss s evs ∧ ∀ g ∈ G1, (run s evs).row g ∈ U := by + have hBU : span K (Rf '' (G1 : Set Reg)) ≤ U := + span_le.2 (by rintro _ ⟨g, hg, rfl⟩; exact hRU g hg) + have hBN : span K (Rf '' (G1 : Set Reg)) ⊓ span K (Rf '' (G1 : Set Reg)ᶜ) = ⊥ := + eq_bot_iff.2 (fun x hx => hUN ▸ ⟨hBU hx.1, hx.2⟩) + rw [rank_law_proj (M' := K) z V s T evs hL hN hG hS Rf G1 U 0 hNon hTgt hRU (by simp) + (by simp [hUN]), hBN] + simp + +end Run +end RankLawC diff --git a/research/p104-tree-ceiling/lean/Nov15/RankLawC.md b/research/p104-tree-ceiling/lean/Nov15/RankLawC.md new file mode 100644 index 0000000000..8559526b12 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/RankLawC.md @@ -0,0 +1,30 @@ +# RankLawC.lean: RankLaw condition (ii) when U meets span(non-V targets). No sorry, ~15 s, < 2.2 GB RSS +Imports the RankLaw olean (header has the build chain). Axioms: [propext, Classical.choice, Quot.sound]. + +Notation (end rows of the run with the V-hub ops deleted): +- X = those end rows; +- A = span X[G1]; +- B = span of the V targets Rf[G1]; +- N = span of the non-V targets. + +Hypotheses are those of `RankLaw.rank_law` (legal, NZ, Good, token span, hNon, hTgt), with no hUN. + +- `eq_iff_of_sup_eq`: if A ⊔ N = B ⊔ N, then A = B ⟺ A ≤ B ∧ B ⊓ N ≤ A. +- `rank_law_gen` (no U at all): V mix ⟺ (i) no lossy CLEAR/COPY ∧ (ii) every X g ∈ B ∧ (iii) B ⊓ N ≤ A. +- **`rank_law_proj` (the corrected (ii) for any U ⊇ B).** Let π be any linear map with π = 0 on the V targets and ker π ⊓ (U ⊓ N) = ⊥ (π reads the (U ⊓ N)-component). + Then V mix ⟺ (i) ∧ (ii') every X g ∈ U **and π(X g) = 0** ∧ (iii). + - So "zero W0 part" must be strengthened to "zero W0 part and zero (U ⊓ N)-component". +- `rank_law_indep`: if B ⊓ N = ⊥, (iii) is vacuous and (ii) reads "X g ∈ span V targets". + - This holds on #7623: the 1501 public target rows have rank 1501 (CopyCheck.md), and owned targets are 0. +- `rank_law_of_gen`: the original `rank_law` is `rank_law_proj` with π = 0. + - When U ⊓ N = ⊥, (iii) is automatic because B ⊓ N ≤ U ⊓ N = ⊥. + +Hand examples (why each extra clause is needed): +- **(ii').** RankLaw finding 2: G1 = {g}, N = {n}, Rf g = e1, Rf n = e2, U = everything, X g = e1 + e2. + - Here X g ∈ U but π(X g) ≠ 0 for π = e2-coordinate, and there is no V mix. +- **(iii).** One token e1; Rf g = Rf n = e1; X n = e1, X g = 0; empty run, so no loss. + - X g ∈ B, but A = 0 ≠ B. + - Only possible with dependent targets. + +**Finding.** RankLaw's prose "(ii) zero W0 part" is false when U ⊓ N ≠ 0, which is the natural case U = T_X + tokens: helper tokens e_h are non-V targets. +- Minimal fix: "(ii) every V-ender row is in U and has zero (U ⊓ N)-component"; with dependent targets, add (iii). diff --git a/research/p104-tree-ceiling/lean/Nov15/RelaySandwich.lean b/research/p104-tree-ceiling/lean/Nov15/RelaySandwich.lean new file mode 100644 index 0000000000..e3ad3667c8 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/RelaySandwich.lean @@ -0,0 +1,157 @@ +/- +RELAY-SANDWICH law (NEWNATIVE R4 sec 3), See RelaySandwich.md. +Abstract: charts form a lattice; resident i of a relay chart c arrives from chart p i and departs to n i +(p i ≤ c ≤ n i, public steps ascend). Pinned: c = ⨆ p = ⨅ n. Then any chart c' that keeps every +resident's route ascending equals c. Bridge to FrameSep.Route (frames = submodules) included. +Also the cost identity for a 0 -> e helper with k evenly spaced stops: e * ln (k+1) (e = 9: 9 ln (k+1)). +-/ +import Nov15.FrameSep +import Nov15.JunkLB2 + +namespace RelaySandwich + +section Lattice +variable {L ι : Type*} [CompleteLattice L] + +/-- c is pinned by residents with arrival charts p and departure charts n. -/ +structure Pinned (p n : ι → L) (c : L) : Prop where + arrive : ∀ i, p i ≤ c + depart : ∀ i, c ≤ n i + join : c = ⨆ i, p i + meet : c = ⨅ i, n i + +/-- Admissible replacement of the stop: every resident's route stays ascending through c'. -/ +def Admissible (p n : ι → L) (c' : L) : Prop := ∀ i, p i ≤ c' ∧ c' ≤ n i + +/-- **RELAY-SANDWICH**: the only admissible stop chart is c itself. -/ +theorem admissible_unique {p n : ι → L} {c : L} (h : Pinned p n c) {c' : L} + (hc : Admissible p n c') : c' = c := by + apply le_antisymm + · rw [h.meet]; exact le_iInf fun i => (hc i).2 + · rw [h.join]; exact iSup_le fun i => (hc i).1 + +theorem admissible_iff {p n : ι → L} {c : L} (h : Pinned p n c) (c' : L) : + Admissible p n c' ↔ c' = c := + ⟨admissible_unique h, fun e => e ▸ fun i => ⟨h.arrive i, h.depart i⟩⟩ + +/-- Collapse onto a neighbour chart (some resident's previous or next chart d) is impossible +when no neighbour chart equals c. -/ +theorem no_neighbour_collapse {p n : ι → L} {c : L} (h : Pinned p n c) + (hp : ∀ i, p i ≠ c) (hn : ∀ i, n i ≠ c) (j : ι) : + ¬ Admissible p n (p j) ∧ ¬ Admissible p n (n j) := + ⟨fun a => hp j (admissible_unique h a), fun a => hn j (admissible_unique h a)⟩ + +/-- Non-degenerate pinned relay needs two residents (indeed no single resident's chart is c). -/ +theorem pinned_nontrivial {p n : ι → L} {c : L} (h : Pinned p n c) + (hp : ∀ i, p i ≠ c) [Nonempty ι] : ¬ Subsingleton ι := by + intro hs + obtain ⟨i⟩ := ‹Nonempty ι› + apply hp i + rw [h.join] + apply le_antisymm + · exact le_iSup p i + · exact iSup_le fun j => by rw [Subsingleton.elim j i] + +/-- The non-equality hypotheses are not redundant (degenerate resident with p = n = c): the +"neighbour" chart p 0 is admissible, but it equals c, so nothing is collapsed. -/ +example : ∃ (p n : Fin 1 → Prop) (c : Prop), Pinned p n c ∧ Admissible p n (p 0) ∧ p 0 = c := + ⟨fun _ => False, fun _ => False, False, + ⟨fun _ => le_rfl, fun _ => le_rfl, by simp, by simp⟩, fun _ => ⟨le_rfl, le_rfl⟩, rfl⟩ + +end Lattice + +section Route +open FrameSep +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] + +/-- Replace the frame at time t+1 by c'. -/ +def restop (R : Route K V) (t : ℕ) (c' : Submodule K V) : ℕ → Submodule K V := + Function.update R.f (t + 1) c' + +/-- If steps t and t+1 are public, the stop-replaced frame sequence has every step ascending +iff c' sits between the frames at t and t+2 (the route-ordering side of a collapse). -/ +theorem restop_valid_iff (R : Route K V) (t : ℕ) (h0 : ¬ R.owned t) (h1 : ¬ R.owned (t + 1)) + (c' : Submodule K V) : + (∀ s, ¬ R.owned s → restop R t c' s ≤ restop R t c' (s + 1)) ↔ + (R.f t ≤ c' ∧ c' ≤ R.f (t + 2)) := by + constructor + · intro h + have a := h t h0 + have b := h (t + 1) h1 + simp only [restop, Function.update_self, Function.update_of_ne (show t ≠ t + 1 by omega), + Function.update_of_ne (show t + 2 ≠ t + 1 by omega)] at a b + exact ⟨a, b⟩ + · rintro ⟨a, b⟩ s hs + by_cases e1 : s = t + · subst e1; simpa [restop] using a + by_cases e2 : s = t + 1 + · subst e2; simpa [restop] using b + have n1 : s ≠ t + 1 := e2 + have n2 : s + 1 ≠ t + 1 := fun h => e1 (by omega) + simpa [restop, Function.update_of_ne n1, Function.update_of_ne n2] using R.pub s hs + +/-- **Frame form.** Residents i with routes R i, each with public steps t i, t i + 1 and +frame c at time t i + 1; pinned by their frames at t i and t i + 2. If every resident's +stop-replaced route (stop chart c') is valid, c' = c. -/ +theorem route_collapse {ι : Type*} (R : ι → Route K V) (t : ι → ℕ) + (h0 : ∀ i, ¬ (R i).owned (t i)) (h1 : ∀ i, ¬ (R i).owned (t i + 1)) + {c : Submodule K V} + (hp : Pinned (fun i => (R i).f (t i)) (fun i => (R i).f (t i + 2)) c) + {c' : Submodule K V} + (hv : ∀ i, ∀ s, ¬ (R i).owned s → restop (R i) (t i) c' s ≤ restop (R i) (t i) c' (s + 1)) : + c' = c := + admissible_unique hp fun i => (restop_valid_iff (R i) (t i) (h0 i) (h1 i) c').1 (hv i) + +end Route + +section Cost +open JunkLB2 + +/-- Cost of a helper going 0 -> e in k+1 equal moves (k stops), per-stay accounting: +D0 = f(e) - Σ f(gap) over the k+1 moves. -/ +noncomputable def stopCost (f : ℝ → ℝ) (e : ℝ) (k : ℕ) : ℝ := + f e - ((List.replicate (k + 1) (f (e / (k + 1)))).sum) + +theorem stopCost_eq (f : ℝ → ℝ) (e : ℝ) (k : ℕ) : + stopCost f e k = f e - (k + 1) * f (e / (k + 1)) := by + simp [stopCost, List.sum_replicate, nsmul_eq_mul] + +/-- For f(r) = r ln r the cost is e ln (k+1). -/ +theorem stopCost_fL (e : ℝ) (k : ℕ) : stopCost fL e k = e * Real.log (k + 1) := by + have hk : (0 : ℝ) < (k : ℝ) + 1 := by positivity + rw [stopCost_eq] + unfold fL + by_cases he : e = 0 + · simp [he] + have hd : e / ((k : ℝ) + 1) ≠ 0 := div_ne_zero he hk.ne' + rw [Real.log_div he hk.ne'] + field_simp + ring + +/-- The 0 -> 9 helper: 9 ln (k+1). -/ +theorem stopCost_nine (k : ℕ) : stopCost fL 9 k = 9 * Real.log (k + 1) := stopCost_fL 9 k + +/-- Integer-gap cases (gap 9/(k+1) integral): k = 0, 2, 8 give 0, 9 ln 3, 9 ln 9 = 18 ln 3. -/ +theorem stopCost_k2 : stopCost fL 9 2 = 9 * Real.log 3 := by + rw [stopCost_nine]; norm_num + +/-- Stops are paid: cost is strictly increasing in k (convexity not needed for f = r ln r). -/ +theorem stopCost_strictMono {k m : ℕ} (h : k < m) : stopCost fL 9 k < stopCost fL 9 m := by + rw [stopCost_nine, stopCost_nine] + have : Real.log ((k : ℝ) + 1) < Real.log ((m : ℝ) + 1) := + Real.log_lt_log (by positivity) (by exact_mod_cast Nat.add_lt_add_right h 1) + linarith + +end Cost + +#print axioms admissible_unique +#print axioms no_neighbour_collapse +#print axioms pinned_nontrivial +#print axioms restop_valid_iff +#print axioms route_collapse +#print axioms stopCost_fL +#print axioms stopCost_nine +#print axioms stopCost_k2 +#print axioms stopCost_strictMono + +end RelaySandwich diff --git a/research/p104-tree-ceiling/lean/Nov15/RelaySandwich.md b/research/p104-tree-ceiling/lean/Nov15/RelaySandwich.md new file mode 100644 index 0000000000..ecd7b9337e --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/RelaySandwich.md @@ -0,0 +1,17 @@ +# RelaySandwich.lean: NEWNATIVE R4 LAW RELAY-SANDWICH + stop-cost identity +Imports Nov15.FrameSep, Nov15.JunkLB2. Kernel-only, 5 s / 2.3 GB, no sorry/native_decide; 9 `#print axioms` all within [propext, Classical.choice, Quot.sound] (the lattice theorems use none). +Build: FrameSep olean was missing; built with `runlean.sh Nov15/FrameSep.lean .lake/build/lib/lean/Nov15/FrameSep.olean`. + +## Results +- `Pinned p n c`: p i ≤ c ≤ n i, c = ⨆ p, c = ⨅ n (any complete lattice, any index type). +- `admissible_unique` / `admissible_iff`: a chart c' keeping every resident ascending (p i ≤ c' ≤ n i) equals c. So no stop can be moved or collapsed to another chart while all residents still meet there. +- `no_neighbour_collapse`: if no p i or n i equals c, no neighbour chart (p j or n j) is admissible. +- `pinned_nontrivial`: under p i ≠ c a pinned relay has at least 2 residents. +- `restop_valid_iff`, `route_collapse`: frame form on FrameSep.Route (submodules). Replacing the frame at t+1 by c' keeps all public steps ascending iff f t ≤ c' ≤ f (t+2); for residents pinned by those frames, c' = c. +- `stopCost_fL`: helper 0 -> e with k stops (k+1 equal moves), D0 = f(e) - Σ f(gap) = e ln(k+1) for f = r ln r; `stopCost_nine`: 9 ln(k+1). `stopCost_strictMono`: strictly increasing in k. k = 2 gives 9 ln 3 (integer gap 3). + +## Scope / statements checked +- R4's law is TRUE as written, with one reading made explicit: "collapse" means a chart change that keeps ALL residents at one common chart (they must meet to relay). If a single resident drops its stop it stops meeting the others; that is partner-changing re-routing, which R4 puts out of scope (its test (c)). +- The non-equality hypothesis is needed only to make neighbour charts distinct from c; uniqueness of an admissible chart holds without it (example in the file: degenerate p = n = c). +- Cost identity: "evenly spaced" gives integer dims only for (k+1) | 9 (k = 0, 2, 8). For other k the identity is the real-gap version (PRICEKIT charges |Δ dim| with integer dims, so it needs integer gaps). Per-stay form: this is FloorD0's chD0 = f(e - d0) - Σ f(|Δ|) specialised to equal gaps; I proved the closed form directly, not via the MChain machinery. +- Not formalised: that the 238/254 families in R4 (c) really satisfy Pinned (computational [C] fact). diff --git a/research/p104-tree-ceiling/lean/Nov15/SwapNull.lean b/research/p104-tree-ceiling/lean/Nov15/SwapNull.lean new file mode 100644 index 0000000000..c106f29bce --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/SwapNull.lean @@ -0,0 +1,732 @@ +/- +SwapNull, See SwapNull.md. +Formalises LAWBUILD M3's law SWAP-NULL (internal notes). + +Part A (op level, TokenCancel's model): the 4-op swap gadget + add h1 h2 (+1); add h2 h1 (-1); add h1 h2 (+1); scale h2 (-1) (3 ADD + SCALE -1, all at chart c) +exchanges the rows of h1 and h2. Tail swap = gadget, then every later event renamed h1<->h2: +the final state is the unswapped final state with the rows of h1, h2 exchanged (`tail_run`). +Head swap = earlier events renamed, then gadget: every final row has its h1/h2 COORDINATES +exchanged (`head_run`). +Part B (hub model, matrix level): only a V mix L (acts on V-ender rows) or a {0}-prefix M (acts on +G0 columns) can undo that; exact statements `tail_iff`, `head_iff`, `undo_one_iff`. +Part C (ladder): per-helper cost f(e-b) - sum f(gaps) (RelaySandwich.stopCost); the swap leaves the +stay multiset unchanged and changes the span terms by a rectangle difference, which is 0 iff the +ends agree or the births agree (`delta_eq`, `delta_zero_end`, `delta_zero_birth`). +Part D: law bundle and a concrete witness. +-/ +import Nov15.TokenCancel +import Nov15.RelaySandwich +import Nov15.SwapWord +import Mathlib.Data.Matrix.Mul +import Mathlib.LinearAlgebra.Matrix.ToLin + +set_option linter.unusedSectionVars false + +namespace SwapNull +open TokenCancel + +/-! ### Part A: the gadget and the two renamings -/ +section Op +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] [DecidableEq C] + +/-- The 4-op swap gadget at chart `c`. -/ +def gadget (h1 h2 : Reg) (c : C) : List (Ev K Reg C) := + [.add h1 h2 1 c, .add h2 h1 (-1) c, .add h1 h2 1 c, .scale h2 (-1) c] + +theorem gadget_legal (h1 h2 : Reg) (hne : h1 ≠ h2) (c : C) (z V : C) (s : St K Reg C) + (a : s.loc h1 = some c) (b : s.loc h2 = some c) : + Legal z V s (gadget h1 h2 c) := by + simp [gadget, Legal, LegalEv, step, hne, hne.symm, a, b] + +/-- Rows and locations read through a register permutation. -/ +def permSt (σ : Equiv.Perm Reg) (s : St K Reg C) : St K Reg C := + ⟨fun r => s.row (σ r), fun r => s.loc (σ r)⟩ + +/-- Rows with their coordinates read through σ. -/ +def cpermSt (σ : Equiv.Perm Reg) (s : St K Reg C) : St K Reg C := + ⟨fun r => fun k => s.row r (σ k), s.loc⟩ + +def ren (σ : Equiv.Perm Reg) : Ev K Reg C → Ev K Reg C + | .born i c => .born (σ i) c + | .init i c => .init (σ i) c + | .move i c => .move (σ i) c + | .add i j a c => .add (σ i) (σ j) a c + | .scale i u c => .scale (σ i) u c + | .clear i c => .clear (σ i) c + | .copy i j c => .copy (σ i) (σ j) c + +theorem gadget_run (h1 h2 : Reg) (hne : h1 ≠ h2) (c : C) (s : St K Reg C) : + (run s (gadget h1 h2 c)).row = (fun r => s.row (Equiv.swap h1 h2 r)) ∧ + (run s (gadget h1 h2 c)).loc = s.loc := by + refine ⟨?_, ?_⟩ + · funext r + by_cases r1 : r = h1 + · subst r1 + simp [gadget, run, step, hne, hne.symm] + · by_cases r2 : r = h2 + · subst r2 + simp [gadget, run, step, hne, hne.symm, Function.update_apply] + · simp [gadget, run, step, r1, r2, Function.update_apply, Equiv.swap_apply_of_ne_of_ne] + · simp [gadget, run, step] + +lemma upd_perm {β : Type*} (σ : Equiv.Perm Reg) (hσ : ∀ r, σ (σ r) = r) (f : Reg → β) + (i : Reg) (v : β) : + (fun r => Function.update f i v (σ r)) = Function.update (fun r => f (σ r)) (σ i) v := by + funext r + simp only [Function.update_apply] + have : σ r = i ↔ r = σ i := ⟨fun h => by rw [← h, hσ], fun h => by rw [h, hσ]⟩ + simp only [this] + +theorem step_permSt (σ : Equiv.Perm Reg) (hσ : ∀ r, σ (σ r) = r) (s : St K Reg C) + (e : Ev K Reg C) (hb : ∀ i c, e = .born i c → σ i = i) : + step (permSt σ s) (ren σ e) = permSt σ (step s e) := by + cases e with + | born i c => + have hi := hb i c rfl + simp only [step, ren, permSt, St.mk.injEq] + rw [upd_perm σ hσ, upd_perm σ hσ, hi] + simp + | init i c => + simp only [step, ren, permSt, St.mk.injEq] + rw [upd_perm σ hσ, upd_perm σ hσ] + simp + | move i c => + simp only [step, ren, permSt, St.mk.injEq] + rw [upd_perm σ hσ] + simp + | add i j a c => + simp only [step, ren, permSt, St.mk.injEq] + rw [upd_perm σ hσ] + simp [hσ] + | scale i u c => + simp only [step, ren, permSt, St.mk.injEq] + rw [upd_perm σ hσ] + simp [hσ] + | clear i c => + simp only [step, ren, permSt, St.mk.injEq] + rw [upd_perm σ hσ] + simp + | copy i j a => + simp only [step, ren, permSt, St.mk.injEq] + rw [upd_perm σ hσ] + simp [hσ] + +theorem run_permSt (σ : Equiv.Perm Reg) (hσ : ∀ r, σ (σ r) = r) (evs : List (Ev K Reg C)) + (hb : ∀ e ∈ evs, ∀ i c, e = .born i c → σ i = i) (s : St K Reg C) : + run (permSt σ s) (evs.map (ren σ)) = permSt σ (run s evs) := by + induction evs generalizing s with + | nil => rfl + | cons e es ih => + simp only [List.map_cons, run] + rw [step_permSt σ hσ s e (hb e (by simp)), ih (fun e' he' => hb e' (by simp [he']))] + +/-- Tail swap: gadget at the shared chart, then every later event renamed h1 <-> h2. +Final rows = unswapped final rows with h1, h2 exchanged; locations unchanged. -/ +theorem tail_run (h1 h2 : Reg) (hne : h1 ≠ h2) (c : C) (s : St K Reg C) + (a : s.loc h1 = some c) (b : s.loc h2 = some c) (evs : List (Ev K Reg C)) + (hb : ∀ e ∈ evs, ∀ i c, e = .born i c → i ≠ h1 ∧ i ≠ h2) : + run s (gadget h1 h2 c ++ evs.map (ren (Equiv.swap h1 h2))) = + permSt (Equiv.swap h1 h2) (run s evs) := by + have hσ : ∀ r, Equiv.swap h1 h2 (Equiv.swap h1 h2 r) = r := fun r => Equiv.swap_apply_self _ _ _ + have hg := gadget_run h1 h2 hne c s + have hs : run s (gadget h1 h2 c) = permSt (Equiv.swap h1 h2) s := by + have hloc : ∀ r, s.loc (Equiv.swap h1 h2 r) = s.loc r := by + intro r + by_cases r1 : r = h1 + · subst r1; simp [a, b] + · by_cases r2 : r = h2 + · subst r2; simp [a, b] + · rw [Equiv.swap_apply_of_ne_of_ne r1 r2] + cases hr : run s (gadget h1 h2 c) with + | mk row loc => + rw [hr] at hg + simp only [permSt, St.mk.injEq] + obtain ⟨hg1, hg2⟩ := hg + simp only at hg1 hg2 + refine ⟨hg1, ?_⟩ + rw [hg2]; funext r; exact (hloc r).symm + rw [SwapWord.run_append, hs] + exact run_permSt _ hσ evs (fun e he i c h => by + obtain ⟨x, y⟩ := hb e he i c h + exact Equiv.swap_apply_of_ne_of_ne x y) s + +/-- Registers and coordinates both read through σ (the state of a run whose events were renamed). -/ +def bothSt (σ : Equiv.Perm Reg) (s : St K Reg C) : St K Reg C := + ⟨fun r k => s.row (σ r) (σ k), fun r => s.loc (σ r)⟩ + +lemma upd_both (σ : Equiv.Perm Reg) (hσ : ∀ r, σ (σ r) = r) (f : Reg → Reg → K) + (i : Reg) (v : Reg → K) : + (fun r k => Function.update f i v (σ r) (σ k)) = + Function.update (fun r k => f (σ r) (σ k)) (σ i) (fun k => v (σ k)) := by + funext r k + have : σ r = i ↔ r = σ i := ⟨fun h => by rw [← h, hσ], fun h => by rw [h, hσ]⟩ + by_cases h : r = σ i + · subst h + simp [Function.update_apply, hσ] + · have h' : ¬ σ r = i := fun x => h (this.1 x) + simp [Function.update_apply, h, h'] + +theorem step_bothSt (σ : Equiv.Perm Reg) (hσ : ∀ r, σ (σ r) = r) (s : St K Reg C) + (e : Ev K Reg C) : + step (bothSt σ s) (ren σ e) = bothSt σ (step s e) := by + cases e with + | born i c => + simp only [step, ren, bothSt, St.mk.injEq] + rw [upd_both σ hσ, upd_perm σ hσ] + have : (fun k => (Pi.single i (1 : K) : Reg → K) (σ k)) = Pi.single (σ i) 1 := by + funext k + have : σ k = i ↔ k = σ i := ⟨fun h => by rw [← h, hσ], fun h => by rw [h, hσ]⟩ + by_cases h : k = σ i + · simp [Pi.single_apply, h, this.2 h, hσ] + · have hn : ¬ σ k = i := fun x => h (this.1 x) + simp [Pi.single_apply, h, hn] + rw [this]; simp + | init i c => + simp only [step, ren, bothSt, St.mk.injEq] + rw [upd_both σ hσ, upd_perm σ hσ]; simp; congr 1 + | move i c => + simp only [step, ren, bothSt, St.mk.injEq] + rw [upd_perm σ hσ]; simp + | add i j a c => + simp only [step, ren, bothSt, St.mk.injEq] + rw [upd_both σ hσ]; simp [hσ]; congr 1 + | scale i u c => + simp only [step, ren, bothSt, St.mk.injEq] + rw [upd_both σ hσ]; simp [hσ]; congr 1 + | clear i c => + simp only [step, ren, bothSt, St.mk.injEq] + rw [upd_both σ hσ]; simp; congr 1 + | copy i j c => + simp only [step, ren, bothSt, St.mk.injEq] + rw [upd_both σ hσ]; simp [hσ] + +theorem run_bothSt (σ : Equiv.Perm Reg) (hσ : ∀ r, σ (σ r) = r) (evs : List (Ev K Reg C)) + (s : St K Reg C) : + run (bothSt σ s) (evs.map (ren σ)) = bothSt σ (run s evs) := by + induction evs generalizing s with + | nil => rfl + | cons e es ih => + simp only [List.map_cons, run] + rw [step_bothSt σ hσ s e, ih] + +theorem step_cpermSt (σ : Equiv.Perm Reg) (s : St K Reg C) + (e : Ev K Reg C) (hσ : ∀ r, σ (σ r) = r) (hb : ∀ i c, e = .born i c → σ i = i) : + step (cpermSt σ s) e = cpermSt σ (step s e) := by + cases e with + | born i c => + have hi := hb i c rfl + simp only [step, cpermSt] + congr 1 + funext r k + by_cases h : r = i + · subst h + have : σ k = r ↔ k = r := ⟨fun h => by rw [← hi, ← h, hσ], fun h => by rw [h, hi]⟩ + by_cases hk : k = r + · simp [Pi.single_apply, hk, hi] + · have hn : ¬ σ k = r := fun x => hk (this.1 x) + simp [Pi.single_apply, hk, hn] + · simp [Function.update_apply, h] + | init i c => + simp only [step, cpermSt] + congr 1 + funext r k; by_cases h : r = i <;> simp [Function.update_apply, h] + | move i c => simp [step, cpermSt] + | add i j a c => + simp only [step, cpermSt] + congr 1 + funext r k; by_cases h : r = i <;> simp [Function.update_apply, h] + | scale i u c => + simp only [step, cpermSt] + congr 1 + funext r k; by_cases h : r = i <;> simp [Function.update_apply, h] + | clear i c => + simp only [step, cpermSt] + congr 1 + funext r k; by_cases h : r = i <;> simp [Function.update_apply, h] + | copy i j c => + simp only [step, cpermSt] + congr 1 + funext r k; by_cases h : r = i <;> simp [Function.update_apply, h] + +theorem run_cpermSt (σ : Equiv.Perm Reg) (hσ : ∀ r, σ (σ r) = r) (evs : List (Ev K Reg C)) + (hb : ∀ e ∈ evs, ∀ i c, e = .born i c → σ i = i) (s : St K Reg C) : + run (cpermSt σ s) evs = cpermSt σ (run s evs) := by + induction evs generalizing s with + | nil => rfl + | cons e es ih => + simp only [run] + rw [step_cpermSt σ s e hσ (hb e (by simp)), ih (fun e' he' => hb e' (by simp [he']))] + +/-- Head swap: earlier events (`pre`) renamed h1 <-> h2, then the gadget at the shared chart, then the +original later events (`post`, no births of h1, h2). If the start state is σ-symmetric, every +final row has its h1/h2 coordinates exchanged; locations are unchanged. -/ +theorem head_run (h1 h2 : Reg) (hne : h1 ≠ h2) (c : C) (s0 : St K Reg C) + (hs0 : bothSt (Equiv.swap h1 h2) s0 = s0) + (pre post : List (Ev K Reg C)) + (a : (run s0 pre).loc h1 = some c) (b : (run s0 pre).loc h2 = some c) + (hb : ∀ e ∈ post, ∀ i c, e = .born i c → i ≠ h1 ∧ i ≠ h2) : + run s0 (pre.map (ren (Equiv.swap h1 h2)) ++ gadget h1 h2 c ++ post) = + cpermSt (Equiv.swap h1 h2) (run s0 (pre ++ post)) := by + have hσ : ∀ r, Equiv.swap h1 h2 (Equiv.swap h1 h2 r) = r := fun r => Equiv.swap_apply_self _ _ _ + set σ := Equiv.swap h1 h2 with hσdef + set t := run s0 pre with ht + have h1' : run s0 (pre.map (ren σ)) = bothSt σ t := by + conv_lhs => rw [← hs0] + exact run_bothSt σ hσ pre s0 + have hg := gadget_run h1 h2 hne c (bothSt σ t) + have hloc : ∀ r, t.loc (σ r) = t.loc r := by + intro r + by_cases r1 : r = h1 + · subst r1; simp [σ, a, b] + · by_cases r2 : r = h2 + · subst r2; simp [σ, a, b] + · rw [Equiv.swap_apply_of_ne_of_ne r1 r2] + have hs : run (bothSt σ t) (gadget h1 h2 c) = cpermSt σ t := by + cases hr : run (bothSt σ t) (gadget h1 h2 c) with + | mk row loc => + rw [hr] at hg + obtain ⟨hg1, hg2⟩ := hg + simp only [bothSt] at hg1 hg2 + simp only [cpermSt, St.mk.injEq] + refine ⟨?_, ?_⟩ + · rw [hg1]; funext r k; exact congrArg (fun x => t.row x (σ k)) (hσ r) + · rw [hg2]; funext r; exact hloc r + rw [SwapWord.run_append, SwapWord.run_append, h1', hs, + run_cpermSt σ hσ post (fun e he i c h => by + obtain ⟨x, y⟩ := hb e he i c h + exact Equiv.swap_apply_of_ne_of_ne x y), SwapWord.run_append s0 pre post] + +end Op + +/-! ### Part B: what the hubs can undo (matrix level; HubSettle's V mix and {0}-prefix) -/ +section Hub +variable {K Reg : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] + +/-- `A` is the identity outside the `S × S` block (a hub op acts only inside its own block). -/ +def Blk (S : Reg → Prop) (A : Matrix Reg Reg K) : Prop := + ∀ i k, ¬ (S i ∧ S k) → A i k = (1 : Matrix Reg Reg K) i k + +/-- F' can be restored to F by a V mix `L` (block on V-enders, acts on rows) and a {0}-prefix `M` +(block on G0 columns, right multiplication). Invertibility is not demanded (strengthens the +only-if directions); the witnesses used for the if directions are permutation matrices. -/ +def Undo (V G0 : Reg → Prop) (F F' : Matrix Reg Reg K) : Prop := + ∃ L M : Matrix Reg Reg K, Blk V L ∧ Blk G0 M ∧ L * F' * M = F + +/-- Tail swap of the final matrix: rows h1,h2 exchanged. -/ +def rowSw (σ : Equiv.Perm Reg) (F : Matrix Reg Reg K) : Matrix Reg Reg K := + Matrix.of fun i k => F (σ i) k +/-- Head swap of the final matrix: coordinates h1,h2 exchanged. -/ +def colSw (σ : Equiv.Perm Reg) (F : Matrix Reg Reg K) : Matrix Reg Reg K := + Matrix.of fun i k => F i (σ k) + +def swapMat (σ : Equiv.Perm Reg) : Matrix Reg Reg K := + Matrix.of fun i k => if k = σ i then 1 else 0 + +lemma blk_one (S : Reg → Prop) : Blk S (1 : Matrix Reg Reg K) := fun _ _ _ => rfl + +lemma swapMat_mul (σ : Equiv.Perm Reg) (A : Matrix Reg Reg K) : swapMat σ * A = rowSw σ A := by + ext i k + simp [Matrix.mul_apply, swapMat, rowSw] + +lemma mul_swapMat (σ : Equiv.Perm Reg) (hσ : ∀ r, σ (σ r) = r) (A : Matrix Reg Reg K) : + A * swapMat σ = colSw σ A := by + ext i k + simp only [Matrix.mul_apply, swapMat, colSw, Matrix.of_apply] + have : ∀ j, (k = σ j) ↔ (j = σ k) := fun j => ⟨fun h => by rw [h, hσ], fun h => by rw [h, hσ]⟩ + simp [this] + +lemma swapMat_blk (h1 h2 : Reg) (S : Reg → Prop) (a : S h1) (b : S h2) : + Blk S (swapMat (Equiv.swap h1 h2) : Matrix Reg Reg K) := by + intro i k hik + simp only [swapMat, Matrix.of_apply, Matrix.one_apply] + have hk1 : ∀ x, S x → ¬ S k → x ≠ k := fun x hx hk h => hk (h ▸ hx) + by_cases i1 : i = h1 + · subst i1 + have hk : ¬ S k := fun h => hik ⟨a, h⟩ + simp [hk1 _ a hk, hk1 _ b hk, (hk1 _ a hk).symm, (hk1 _ b hk).symm] + · by_cases i2 : i = h2 + · subst i2 + have hk : ¬ S k := fun h => hik ⟨b, h⟩ + simp [hk1 _ a hk, hk1 _ b hk, (hk1 _ a hk).symm, (hk1 _ b hk).symm] + · rw [Equiv.swap_apply_of_ne_of_ne i1 i2] + simp [eq_comm] + +lemma blk_row {V : Reg → Prop} {L : Matrix Reg Reg K} (hL : Blk V L) {x : Reg} (hx : ¬ V x) + (Y : Matrix Reg Reg K) : (L * Y) x = Y x := by + funext k + have : ∀ m, L x m = if x = m then 1 else 0 := fun m => by + simpa [Matrix.one_apply] using hL x m (fun h => hx h.1) + simp [Matrix.mul_apply, this] + +lemma mul_blk_col {G0 : Reg → Prop} {M : Matrix Reg Reg K} (hM : Blk G0 M) {a : Reg} + (ha : ¬ G0 a) (Y : Matrix Reg Reg K) (i : Reg) : (Y * M) i a = Y i a := by + have : ∀ j, M j a = if j = a then 1 else 0 := fun j => by + simpa [Matrix.one_apply] using hM j a (fun h => ha h.2) + simp [Matrix.mul_apply, this] + +lemma row_eq {V : Reg → Prop} {F F' L M : Matrix Reg Reg K} (hL : Blk V L) + (h : L * F' * M = F) {x : Reg} (hx : ¬ V x) : (F' * M) x = F x := by + rw [Matrix.mul_assoc] at h + have := blk_row hL hx (F' * M) + rw [h] at this + exact this.symm + +section Swap +variable (h1 h2 : Reg) + +local notation "σ" => Equiv.swap h1 h2 + +lemma swap_inv (r : Reg) : σ (σ r) = r := Equiv.swap_apply_self _ _ _ + +/-- Both helpers end in V: the V mix undoes the tail swap. -/ +theorem tail_if (V G0 : Reg → Prop) (F : Matrix Reg Reg K) (a : V h1) (b : V h2) : + Undo V G0 F (rowSw σ F) := by + refine ⟨swapMat σ, 1, swapMat_blk h1 h2 V a b, blk_one _, ?_⟩ + rw [Matrix.mul_one, swapMat_mul] + ext i k + simp [rowSw, swap_inv] + +/-- Both helpers born in {0}: the {0}-prefix undoes the head swap. -/ +theorem head_if (V G0 : Reg → Prop) (F : Matrix Reg Reg K) (a : G0 h1) (b : G0 h2) : + Undo V G0 F (colSw σ F) := by + refine ⟨1, swapMat σ, blk_one _, swapMat_blk h1 h2 G0 a b, ?_⟩ + rw [Matrix.one_mul, mul_swapMat σ (swap_inv h1 h2)] + ext i k + simp [colSw, swap_inv] + +lemma ab_cases (a : Reg) (ha : a = h1 ∨ a = h2) (hne : h1 ≠ h2) : + (a = h1 ∧ σ a = h2) ∨ (a = h2 ∧ σ a = h1) := by + rcases ha with rfl | rfl + · left; simp + · right; simp + +/-- Tail swap, only-if. `hrig`: the unchanged non-V rows pin every {0}-prefix to the identity +(`rigid_of_span` gives this from a spanning condition). Then a tail swap is undone only if both +helpers end in V. -/ +theorem tail_only_if (V G0 : Reg → Prop) (hne : h1 ≠ h2) (F : Matrix Reg Reg K) + (hF1 : F h1 = Pi.single h1 1) (hF2 : F h2 = Pi.single h2 1) + (hrig : ∀ M : Matrix Reg Reg K, Blk G0 M → + (∀ x, x ≠ h1 → x ≠ h2 → ¬ V x → (F * M) x = F x) → M = 1) : + Undo V G0 F (rowSw σ F) → V h1 ∧ V h2 := by + rintro ⟨L, M, hL, hM, h⟩ + by_contra hn + obtain ⟨a, ha, haV⟩ : ∃ a, (a = h1 ∨ a = h2) ∧ ¬ V a := by + by_cases v1 : V h1 + · exact ⟨h2, Or.inr rfl, fun v2 => hn ⟨v1, v2⟩⟩ + · exact ⟨h1, Or.inl rfl, v1⟩ + have key : ∀ x, ¬ V x → (rowSw σ F * M) x = F x := fun x hx => row_eq hL h hx + have hM1 : M = 1 := by + refine hrig M hM (fun x hx1 hx2 hxV => ?_) + have := key x hxV + have hsx : σ x = x := Equiv.swap_apply_of_ne_of_ne hx1 hx2 + funext k + have := congrFun this k + simpa [rowSw, Matrix.mul_apply, hsx] using this + subst hM1 + have e : F (σ a) = F a := by + have := key a haV + rw [Matrix.mul_one] at this + exact this + rcases ab_cases h1 h2 a ha hne with ⟨rfl, h'⟩ | ⟨rfl, h'⟩ + · rw [h', hF1, hF2] at e + have := congrFun e a + simp [Pi.single_apply, hne.symm] at this + · rw [h', hF1, hF2] at e + have := congrFun e a + simp [Pi.single_apply, hne] at this + +/-- Head swap, only-if: if some non-V row distinguishes the h1 and h2 coordinates, the swap is +undone only if both helpers are born in {0}. -/ +theorem head_only_if (V G0 : Reg → Prop) (hne : h1 ≠ h2) (F : Matrix Reg Reg K) + (hw : ∃ x, ¬ V x ∧ F x h1 ≠ F x h2) : + Undo V G0 F (colSw σ F) → G0 h1 ∧ G0 h2 := by + rintro ⟨L, M, hL, hM, h⟩ + obtain ⟨x, hxV, hxne⟩ := hw + by_contra hn + obtain ⟨a, ha, haG⟩ : ∃ a, (a = h1 ∨ a = h2) ∧ ¬ G0 a := by + by_cases v1 : G0 h1 + · exact ⟨h2, Or.inr rfl, fun v2 => hn ⟨v1, v2⟩⟩ + · exact ⟨h1, Or.inl rfl, v1⟩ + have e := congrFun (row_eq hL h hxV) a + rw [mul_blk_col hM haG] at e + simp only [colSw, Matrix.of_apply] at e + rcases ab_cases h1 h2 a ha hne with ⟨rfl, h'⟩ | ⟨rfl, h'⟩ + · rw [h'] at e; exact hxne e.symm + · rw [h'] at e; exact hxne e + +/-- Identity-final case: the swap matrix is the same for both kinds; it is undone iff both +helpers end in V or both are born in {0}. -/ +theorem undo_one_iff (V G0 : Reg → Prop) (hne : h1 ≠ h2) : + Undo V G0 (1 : Matrix Reg Reg K) (rowSw σ 1) ↔ (V h1 ∧ V h2) ∨ (G0 h1 ∧ G0 h2) := by + constructor + · rintro ⟨L, M, hL, hM, h⟩ + by_cases hv : V h1 ∧ V h2 + · exact Or.inl hv + right + obtain ⟨a, ha, haV⟩ : ∃ a, (a = h1 ∨ a = h2) ∧ ¬ V a := by + by_cases v1 : V h1 + · exact ⟨h2, Or.inr rfl, fun v2 => hv ⟨v1, v2⟩⟩ + · exact ⟨h1, Or.inl rfl, v1⟩ + have e := congrFun (row_eq hL h haV) a + have hMa : M (σ a) a = 1 := by + have : (rowSw σ (1 : Matrix Reg Reg K) * M) a a = M (σ a) a := by + simp [rowSw, Matrix.mul_apply, Matrix.one_apply] + rw [this] at e + simpa using e + have hG : G0 (σ a) ∧ G0 a := by + by_contra hc + have := hM (σ a) a hc + rw [hMa] at this + have hn : σ a ≠ a := by + rcases ab_cases h1 h2 a ha hne with ⟨rfl, h'⟩ | ⟨rfl, h'⟩ + · rw [h']; exact hne.symm + · rw [h']; exact hne + simp [Matrix.one_apply, hn] at this + rcases ab_cases h1 h2 a ha hne with ⟨rfl, h'⟩ | ⟨rfl, h'⟩ + · rw [h'] at hG; exact ⟨hG.2, hG.1⟩ + · rw [h'] at hG; exact hG + · rintro (⟨a, b⟩ | ⟨a, b⟩) + · exact tail_if h1 h2 V G0 1 a b + · have := head_if h1 h2 V G0 (1 : Matrix Reg Reg K) a b + have e : colSw σ (1 : Matrix Reg Reg K) = rowSw σ 1 := by + ext i k + have : (σ i = k) ↔ (i = σ k) := + ⟨fun h => by rw [← h, swap_inv], fun h => by rw [h, swap_inv]⟩ + simp [colSw, rowSw, Matrix.one_apply, this] + rwa [e] at this + +end Swap + +end Hub + +section Rigid +variable {K Reg : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] + +lemma single_vecMul (M : Matrix Reg Reg K) (i : Reg) : + Matrix.vecMul (Pi.single i (1 : K) : Reg → K) M = M i := by + funext j + simp [Matrix.vecMul, dotProduct, Pi.single_apply] + +/-- A spanning condition forces rigidity: if the (unchanged, non-V) rows of F together with the unit +vectors of the non-G0 coordinates span everything, then a G0-block prefix that fixes those rows is 1. -/ +theorem rigid_of_span (G0 : Reg → Prop) (T : Set Reg) (F : Matrix Reg Reg K) + (hspan : Submodule.span K ((fun x => F x) '' T ∪ + Set.range (fun k : {k // ¬ G0 k} => (Pi.single k.1 (1 : K) : Reg → K))) = ⊤) + (M : Matrix Reg Reg K) (hM : Blk G0 M) (hfix : ∀ x ∈ T, (F * M) x = F x) : M = 1 := by + let φ : (Reg → K) →ₗ[K] (Reg → K) := Matrix.vecMulLinear M - LinearMap.id + have hle : Submodule.span K ((fun x => F x) '' T ∪ + Set.range (fun k : {k // ¬ G0 k} => (Pi.single k.1 (1 : K) : Reg → K))) ≤ + LinearMap.ker φ := by + rw [Submodule.span_le] + rintro v (⟨x, hx, rfl⟩ | ⟨k, rfl⟩) + · have := hfix x hx + simp only [SetLike.mem_coe, LinearMap.mem_ker, φ, LinearMap.sub_apply, + Matrix.vecMulLinear_apply, LinearMap.id_apply, sub_eq_zero] + funext j + have := congrFun this j + simpa [Matrix.mul_apply, Matrix.vecMul, dotProduct] using this + · simp only [SetLike.mem_coe, LinearMap.mem_ker, φ, LinearMap.sub_apply, + Matrix.vecMulLinear_apply, LinearMap.id_apply, sub_eq_zero] + rw [single_vecMul] + funext j + have := hM k.1 j (fun h => k.2 h.1) + simp only [Matrix.one_apply] at this + rw [this] + simp [Pi.single_apply, eq_comm] + have hall : ∀ v, φ v = 0 := fun v => hle (by rw [hspan]; trivial) + ext i k + have := congrFun (hall (Pi.single i 1)) k + simp only [φ, LinearMap.sub_apply, Matrix.vecMulLinear_apply, LinearMap.id_apply, + Pi.sub_apply, single_vecMul] at this + simp only [Matrix.one_apply] + simp only [Pi.zero_apply, Pi.single_apply] at this + have h3 := sub_eq_zero.1 this + rw [h3]; simp [eq_comm] + +end Rigid + +section Iff +variable {K Reg : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] (h1 h2 : Reg) +local notation "σ" => Equiv.swap h1 h2 + +/-- (1), tail swap: undone iff both helpers end in V (under rigidity of the {0}-prefix). -/ +theorem tail_iff (V G0 : Reg → Prop) (hne : h1 ≠ h2) (F : Matrix Reg Reg K) + (hF1 : F h1 = Pi.single h1 1) (hF2 : F h2 = Pi.single h2 1) + (hrig : ∀ M : Matrix Reg Reg K, Blk G0 M → + (∀ x, x ≠ h1 → x ≠ h2 → ¬ V x → (F * M) x = F x) → M = 1) : + Undo V G0 F (rowSw σ F) ↔ V h1 ∧ V h2 := + ⟨tail_only_if h1 h2 V G0 hne F hF1 hF2 hrig, fun ⟨a, b⟩ => tail_if h1 h2 V G0 F a b⟩ + +/-- (1), head swap: undone iff both helpers are born in {0} (when some non-V row separates h1, h2). -/ +theorem head_iff (V G0 : Reg → Prop) (hne : h1 ≠ h2) (F : Matrix Reg Reg K) + (hw : ∃ x, ¬ V x ∧ F x h1 ≠ F x h2) : + Undo V G0 F (colSw σ F) ↔ G0 h1 ∧ G0 h2 := + ⟨head_only_if h1 h2 V G0 hne F hw, fun ⟨a, b⟩ => head_if h1 h2 V G0 F a b⟩ + +/-- Tail swap, spanning form of the rigidity hypothesis. -/ +theorem tail_iff_span (V G0 : Reg → Prop) (hne : h1 ≠ h2) (F : Matrix Reg Reg K) + (hF1 : F h1 = Pi.single h1 1) (hF2 : F h2 = Pi.single h2 1) + (hspan : Submodule.span K ((fun x => F x) '' {x | x ≠ h1 ∧ x ≠ h2 ∧ ¬ V x} ∪ + Set.range (fun k : {k // ¬ G0 k} => (Pi.single k.1 (1 : K) : Reg → K))) = ⊤) : + Undo V G0 F (rowSw σ F) ↔ V h1 ∧ V h2 := + tail_iff h1 h2 V G0 hne F hF1 hF2 fun M hM hfix => + rigid_of_span G0 _ F hspan M hM fun x hx => hfix x hx.1 hx.2.1 hx.2.2 + +lemma colSw_one (V : Reg → Prop) : colSw σ (1 : Matrix Reg Reg K) = rowSw σ 1 := by + ext i k + have : (σ i = k) ↔ (i = σ k) := + ⟨fun h => by rw [← h, swap_inv], fun h => by rw [h, swap_inv]⟩ + simp [colSw, rowSw, Matrix.one_apply, this] + +end Iff + +/-! ### Part C: ladder cost -/ +section Ladder +open JunkLB2 RelaySandwich + +/-- A helper's trajectory: birth dim `b`, end dim `e`, stay gaps before (`pre`) and after (`suf`) the +shared chart. -/ +structure Traj where + b : ℝ + e : ℝ + pre : List ℝ + suf : List ℝ + +/-- Per-helper ladder cost: span term minus the sum over stays (RelaySandwich.stopCost's accounting). -/ +noncomputable def Traj.cost (f : ℝ → ℝ) (t : Traj) : ℝ := + f (t.e - t.b) - ((t.pre ++ t.suf).map f).sum + +/-- Both helpers sit at the shared chart (dim `s`) and their gaps add up. -/ +def Traj.Wf (s : ℝ) (t : Traj) : Prop := t.b + t.pre.sum = s ∧ s + t.suf.sum = t.e + +/-- The swap (tail or head: same pair of trajectories, only the names differ). -/ +def Traj.swap (t1 t2 : Traj) : Traj × Traj := + (⟨t1.b, t2.e, t1.pre, t2.suf⟩, ⟨t2.b, t1.e, t2.pre, t1.suf⟩) + +theorem swap_wf (s : ℝ) (t1 t2 : Traj) (a : t1.Wf s) (b : t2.Wf s) : + (Traj.swap t1 t2).1.Wf s ∧ (Traj.swap t1 t2).2.Wf s := + ⟨⟨a.1, b.2⟩, ⟨b.1, a.2⟩⟩ + +/-- The multiset of stays is unchanged. -/ +theorem stays_multiset (t1 t2 : Traj) : + ((↑((Traj.swap t1 t2).1.pre ++ (Traj.swap t1 t2).1.suf ++ + ((Traj.swap t1 t2).2.pre ++ (Traj.swap t1 t2).2.suf)) : Multiset ℝ)) = + ↑(t1.pre ++ t1.suf ++ (t2.pre ++ t2.suf)) := by + simp only [Traj.swap, ← Multiset.coe_add] + abel + +theorem cost_stopCost (f : ℝ → ℝ) (e : ℝ) (k : ℕ) : + Traj.cost f ⟨0, e, List.replicate (k + 1) (e / (k + 1)), []⟩ = stopCost f e k := by + simp [Traj.cost, stopCost, List.map_replicate] + +/-- (2): the ladder change is exactly the rectangle difference of the span terms. -/ +theorem delta_eq (f : ℝ → ℝ) (t1 t2 : Traj) : + (Traj.swap t1 t2).1.cost f + (Traj.swap t1 t2).2.cost f - (t1.cost f + t2.cost f) = + (f (t2.e - t1.b) + f (t1.e - t2.b)) - (f (t1.e - t1.b) + f (t2.e - t2.b)) := by + simp only [Traj.cost, Traj.swap, List.map_append, List.sum_append] + ring + +/-- Both helpers end in V (same dim): ladder change 0. -/ +theorem delta_zero_end (f : ℝ → ℝ) (t1 t2 : Traj) (h : t1.e = t2.e) : + (Traj.swap t1 t2).1.cost f + (Traj.swap t1 t2).2.cost f - (t1.cost f + t2.cost f) = 0 := by + rw [delta_eq, h]; ring + +/-- Both helpers born in {0} (same dim 0): ladder change 0. -/ +theorem delta_zero_birth (f : ℝ → ℝ) (t1 t2 : Traj) (h : t1.b = t2.b) : + (Traj.swap t1 t2).1.cost f + (Traj.swap t1 t2).2.cost f - (t1.cost f + t2.cost f) = 0 := by + rw [delta_eq, h]; ring + +end Ladder + +/-! ### Part D: the law and the converse witness -/ +section Law +open JunkLB2 + +variable {K Reg : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] (h1 h2 : Reg) +local notation "σ" => Equiv.swap h1 h2 + +/-- SWAP-NULL: a legal (hub-undoable) swap has ladder change 0 (ends of V-enders share the dim of V, +{0}-born helpers share dim 0). -/ +theorem swap_null (f : ℝ → ℝ) (V G0 : Reg → Prop) (dV : ℝ) (t1 t2 : Traj) (hne : h1 ≠ h2) + (hV1 : V h1 → t1.e = dV) (hV2 : V h2 → t2.e = dV) + (hG1 : G0 h1 → t1.b = 0) (hG2 : G0 h2 → t2.b = 0) + (hu : Undo V G0 (1 : Matrix Reg Reg K) (rowSw σ 1)) : + (Traj.swap t1 t2).1.cost f + (Traj.swap t1 t2).2.cost f - (t1.cost f + t2.cost f) = 0 := by + rcases (undo_one_iff h1 h2 V G0 hne).1 hu with ⟨a, b⟩ | ⟨a, b⟩ + · exact delta_zero_end f t1 t2 ((hV1 a).trans (hV2 b).symm) + · exact delta_zero_birth f t1 t2 ((hG1 a).trans (hG2 b).symm) + +/-- (3), contrapositive: a nonzero ladder change cannot be hub-undone. -/ +theorem nonzero_not_undoable (f : ℝ → ℝ) (V G0 : Reg → Prop) (dV : ℝ) (t1 t2 : Traj) + (hne : h1 ≠ h2) + (hV1 : V h1 → t1.e = dV) (hV2 : V h2 → t2.e = dV) + (hG1 : G0 h1 → t1.b = 0) (hG2 : G0 h2 → t2.b = 0) + (hd : (Traj.swap t1 t2).1.cost f + (Traj.swap t1 t2).2.cost f - (t1.cost f + t2.cost f) ≠ 0) : + ¬ Undo V G0 (1 : Matrix Reg Reg K) (rowSw σ 1) := + fun hu => hd (swap_null (K := K) h1 h2 f V G0 dV t1 t2 hne hV1 hV2 hG1 hG2 hu) + +/-- The numerical core: 7 ln 7 + 4 ln 4 < 2 ln 2 + 9 ln 9. -/ +theorem witness_num : fL (9 - 5) + fL (7 - 0) - (fL (7 - 5) + fL (9 - 0)) < 0 := by + have h : (7 : ℝ) * Real.log 7 + 6 * Real.log 2 < 18 * Real.log 3 := by + have := Real.log_lt_log (by positivity : (0 : ℝ) < 7 ^ 7 * 2 ^ 6) (by norm_num : (7 : ℝ) ^ 7 * 2 ^ 6 < 3 ^ 18) + rw [Real.log_mul (by positivity) (by positivity), Real.log_pow, Real.log_pow, Real.log_pow] at this + push_cast at this + exact this + have h4 : Real.log 4 = 2 * Real.log 2 := by + rw [show (4 : ℝ) = 2 ^ 2 by norm_num, Real.log_pow]; norm_num + have h9 : Real.log 9 = 2 * Real.log 3 := by + rw [show (9 : ℝ) = 3 ^ 2 by norm_num, Real.log_pow]; norm_num + unfold fL + norm_num + rw [h4, h9] + linarith + +end Law + +/-- Concrete witness (Reg = Fin 2; helper 0 born dim 5, ends dim 7, in neither hub; helper 1 born {0}, +ends in V of dim 9; shared chart dim 6). Its ladder change is strictly negative (f = r ln r, about +-1.995), and the swap, tail or head, cannot be undone by any V mix and {0}-prefix. -/ +theorem converse_witness : + let t1 : Traj := ⟨5, 7, [1], [1]⟩ + let t2 : Traj := ⟨0, 9, [6], [3]⟩ + t1.Wf 6 ∧ t2.Wf 6 ∧ + ((Traj.swap t1 t2).1.cost JunkLB2.fL + (Traj.swap t1 t2).2.cost JunkLB2.fL + - (t1.cost JunkLB2.fL + t2.cost JunkLB2.fL) < 0) ∧ + ¬ Undo (fun r : Fin 2 => r = 1) (fun r : Fin 2 => r = 1) (1 : Matrix (Fin 2) (Fin 2) ℚ) + (rowSw (Equiv.swap 0 1) 1) ∧ + ¬ Undo (fun r : Fin 2 => r = 1) (fun r : Fin 2 => r = 1) (1 : Matrix (Fin 2) (Fin 2) ℚ) + (colSw (Equiv.swap 0 1) 1) := by + intro t1 t2 + have hne : (0 : Fin 2) ≠ 1 := by decide + have hn : ¬ Undo (fun r : Fin 2 => r = 1) (fun r : Fin 2 => r = 1) (1 : Matrix (Fin 2) (Fin 2) ℚ) + (rowSw (Equiv.swap 0 1) 1) := by + rw [undo_one_iff 0 1 _ _ hne]; decide + refine ⟨by norm_num [Traj.Wf, t1], by norm_num [Traj.Wf, t2], ?_, hn, ?_⟩ + · rw [delta_eq] + simpa [t1, t2] using witness_num + · rw [colSw_one 0 1 (fun r : Fin 2 => r = 1)]; exact hn + +/-- Scope of the per-kind iff: with identity finals and both helpers in G0 but not in V, the TAIL +swap IS undone (by the prefix), so "tail swap legal iff both end in V" needs the rigidity hypothesis. -/ +theorem tail_prefix_counterexample : + Undo (fun _ : Fin 2 => False) (fun _ : Fin 2 => True) (1 : Matrix (Fin 2) (Fin 2) ℚ) + (rowSw (Equiv.swap 0 1) 1) ∧ ¬ (False ∧ False) := by + refine ⟨?_, by simp⟩ + rw [undo_one_iff 0 1 _ _ (by decide)]; simp + +#print axioms tail_run +#print axioms head_run +#print axioms gadget_legal +#print axioms tail_iff +#print axioms tail_iff_span +#print axioms head_iff +#print axioms undo_one_iff +#print axioms delta_eq +#print axioms swap_null +#print axioms converse_witness +#print axioms tail_prefix_counterexample +#print axioms stays_multiset +#print axioms cost_stopCost + +end SwapNull diff --git a/research/p104-tree-ceiling/lean/Nov15/SwapNull.md b/research/p104-tree-ceiling/lean/Nov15/SwapNull.md new file mode 100644 index 0000000000..c8950480ee --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/SwapNull.md @@ -0,0 +1,24 @@ +# SwapNull.lean: LAWBUILD M3 law SWAP-NULL. No sorry, 8 s, 2.45 GB RSS +Nov 17. Imports TokenCancel (op model), SwapWord (`run_append`), RelaySandwich (`stopCost`, `fL` via JunkLB2). Axioms: [propext, Classical.choice, Quot.sound]. +Source: (internal notes) HubSettle's V mix and {0}-prefix are modelled as `Blk V` / `Blk G0` matrices (left / right multiplication). + +**Gadget (4 ops, at the shared chart c):** `add h1 h2 (+1); add h2 h1 (-1); add h1 h2 (+1); scale h2 (-1)`. `gadget_run`: rows of h1,h2 exchanged, nothing else changes; `gadget_legal`. +- `tail_run`: gadget, then every later event renamed h1<->h2 => final state = unswapped final with rows h1,h2 exchanged (F' = P F). +- `head_run`: earlier events renamed, gadget, original later events (sigma-symmetric start) => every final row has its h1/h2 coordinates exchanged (F' = F P). + +**(1) legality.** `Undo V G0 F F'` := exists V mix L (identity off V x V) and prefix M (identity off G0 x G0) with L F' M = F. +- `tail_if`/`head_if`: both in V (tail) / both in G0 (head) => undone (L = P, resp. M = P). +- `undo_one_iff` (identity finals, no other hypothesis): undone iff (both V) or (both G0). +- `tail_iff`, `tail_iff_span`: tail swap undone iff both V, GIVEN rigidity of the prefix (the unchanged non-V rows pin M = 1; `rigid_of_span` derives it from a spanning condition). +- `head_iff`: head swap undone iff both G0, GIVEN a non-V row with F x h1 != F x h2. + +**(2) ladder.** `Traj.cost f t = f(e-b) - sum f(gaps)` (`cost_stopCost`: equals RelaySandwich.stopCost on the equal-move ladder). `Traj.swap`: (b1,e2,pre1++suf2), (b2,e1,pre2++suf1). +- `stays_multiset`: the multiset of stays is unchanged; `swap_wf`: swapped trajectories are again consistent. +- `delta_eq`: change = f(e2-b1)+f(e1-b2)-f(e1-b1)-f(e2-b2). +- `delta_zero_end` (e1 = e2, both end in V), `delta_zero_birth` (b1 = b2 = 0), `swap_null`: hub-undoable => ladder change 0. + +**(3) converse.** `nonzero_not_undoable`: nonzero change => not undoable. `converse_witness` (concrete): helper 0 born dim 5 ends 7 (no hub), helper 1 born {0} ends V (dim 9): f = r ln r change = 7 ln 7 + 4 ln 4 - 2 ln 2 - 9 ln 9 ~ -1.995 < 0 (`witness_num`, 7^7 2^6 < 3^18), and neither the tail nor the head swap is undone by any L, M. + +**Finding (M3 wording needs scope).** "tswap legal iff both end in V; hswap iff both born in {0}" is true only with a hypothesis: `tail_prefix_counterexample` (identity finals, both helpers in G0, none in V) is a tail swap undone by the prefix alone. Corrected statement: for identity-final helpers the swap is undone iff (both V) or (both G0) (`undo_one_iff`); the per-kind iff needs prefix rigidity (tail) / a separating non-V row (head). In the real word the non-V rows do pin the prefix (M3's controls XT/XH fail at settle3), but that is an input [C], not a consequence. + +**Scope.** Matrix-level model: L, M are not required invertible (strengthens only-if). The M3 census numbers (8,282 pairs, 7,390 absorbable) are data, not re-proved. Mixed gadget placement (swap back later) is not modelled. diff --git a/research/p104-tree-ceiling/lean/Nov15/SwapWord.lean b/research/p104-tree-ceiling/lean/Nov15/SwapWord.lean new file mode 100644 index 0000000000..49dfdcbae8 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/SwapWord.lean @@ -0,0 +1,181 @@ +/- +SwapWord, See SwapWord.md. + +The SWAPBUILD edit (internal notes, from BIG/TOKENRANK TR2): at a moment when helper h's row +is exactly e_h, inject `j += c·h` (data: c = −1, just before the native's own `h += j`, so the pair is +the swap `j -= h; h += j`). General facts in TokenCancel's op model: +* `run_diff`: the run is affine in the rows; the difference of two runs with equal locations is the + run of the difference with births read as INITs. +* `inject`: the injection changes the final rows ONLY in column h: final' r = final r + δ r • e_h. +* `inject_two`: two injections (457 → 242, 461 → X10) change the final rows only in columns h1, h2. +* `inject_col`: every final row is unchanged on every column k ≠ h, for every register (non-V-enders included). +* `absorb`: the debt is absorbed by the V mix: if e_h lies in the span of the V targets (h ends at V + with target e_h), the non-V-enders end on target, the original V-ender rows lie in that span and + targets are independent, then the edited run has a V mix iff it is loss-free. + +Build (imports the RankLawC olean; see RankLawC.lean for the chain): + lake env lean -o .lake/build/lib/lean/Nov15/RankLawC.olean Nov15/RankLawC.lean + lake env lean Nov15/SwapWord.lean +-/ +import Nov15.RankLawC + +set_option linter.unusedSectionVars false + +namespace SwapWord +open Submodule Module TokenCancel RankLaw + +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] [DecidableEq C] + +/-- Births read as INITs (a birth writes the same e_i in both runs, so the difference row is 0). -/ +def unborn : Ev K Reg C → Ev K Reg C + | .born i c => .init i c + | e => e + +theorem run_append (s : St K Reg C) (p q : List (Ev K Reg C)) : + run s (p ++ q) = run (run s p) q := by + induction p generalizing s with + | nil => rfl + | cons e p ih => exact ih (step s e) + +lemma upd_sub (f g : Reg → Reg → K) (i : Reg) (a b : Reg → K) : + Function.update f i a - Function.update g i b = Function.update (f - g) i (a - b) := by + funext k; by_cases hk : k = i + · subst hk; simp + · simp [Function.update_of_ne hk] + +/-- One step of the difference. -/ +theorem step_diff (s t : St K Reg C) (hl : s.loc = t.loc) (e : Ev K Reg C) : + (step t e).loc = (step s e).loc ∧ + (step t e).row - (step s e).row = (step ⟨t.row - s.row, s.loc⟩ (unborn e)).row := by + cases e with + | born i c => exact ⟨by simp [step, hl], by simp [step, unborn, upd_sub]⟩ + | init i c => exact ⟨by simp [step, hl], by simp [step, unborn, upd_sub]⟩ + | move i c => exact ⟨by simp [step, hl], by simp [step, unborn]⟩ + | add i j a c => + refine ⟨by simp [step, hl], ?_⟩ + simp only [step, unborn, upd_sub, Pi.sub_apply] + congr 1; rw [smul_sub]; abel + | scale i u c => exact ⟨by simp [step, hl], by simp [step, unborn, upd_sub, smul_sub]⟩ + | clear i c => exact ⟨by simp [step, hl], by simp [step, unborn, upd_sub]⟩ + | copy i j c => exact ⟨by simp [step, hl], by simp [step, unborn, upd_sub]⟩ + +/-- **Difference law.** Two runs of the same events from states with equal locations differ by the +run of the difference state (births read as INITs). -/ +theorem run_diff : ∀ (evs : List (Ev K Reg C)) (s t : St K Reg C), s.loc = t.loc → + (run t evs).loc = (run s evs).loc ∧ + (run t evs).row - (run s evs).row = (run ⟨t.row - s.row, s.loc⟩ (evs.map unborn)).row + | [], s, t, hl => ⟨hl.symm, rfl⟩ + | e :: es, s, t, hl => by + obtain ⟨h1, h2⟩ := step_diff s t hl e + have ih := run_diff es (step s e) (step t e) h1.symm + refine ⟨ih.1, ?_⟩ + simp only [run, List.map_cons] + rw [ih.2] + have hst : (⟨(step t e).row - (step s e).row, (step s e).loc⟩ : St K Reg C) = + step ⟨t.row - s.row, s.loc⟩ (unborn e) := by + cases e <;> simp only [step, unborn] at h2 ⊢ <;> rw [h2] + rw [hst] + +/-- With no births, every op keeps all rows inside a fixed subspace P. -/ +theorem rows_in_run (P : Submodule K (Reg → K)) : + ∀ (evs : List (Ev K Reg C)) (d : St K Reg C), (∀ r, d.row r ∈ P) → + ∀ r, (run d (evs.map unborn)).row r ∈ P + | [], d, hd => hd + | e :: es, d, hd => by + simp only [List.map_cons, run] + refine rows_in_run P es _ (fun r => ?_) + by_cases hr : r = (match e with + | .born i _ | .init i _ | .move i _ | .add i _ _ _ | .scale i _ _ | .clear i _ | .copy i _ _ => i) + · cases e <;> simp only [step, unborn] at hr ⊢ <;> subst hr <;> + simp [P.zero_mem, P.add_mem, P.smul_mem, hd] + · cases e <;> simp only [step, unborn] at hr ⊢ <;> simp [Function.update_of_ne hr, hd] + +/-- **Injection law.** If h's row is exactly e_h after the prefix p, injecting `j += c·h` there +changes the final rows only by multiples of e_h. -/ +theorem inject (s : St K Reg C) (p q : List (Ev K Reg C)) (h j : Reg) (c : K) (ch : C) + (hrow : (run s p).row h = Pi.single h 1) : + ∃ δ : Reg → K, ∀ r, (run s (p ++ .add j h c ch :: q)).row r = + (run s (p ++ q)).row r + δ r • (Pi.single h 1 : Reg → K) := by + set s0 := run s p + set t := step s0 (.add j h c ch) + have hl : s0.loc = t.loc := rfl + obtain ⟨-, hd⟩ := run_diff q s0 t hl + have hin : ∀ r, (t.row - s0.row) r ∈ K ∙ (Pi.single h 1 : Reg → K) := by + intro r + by_cases hr : r = j + · subst hr; simp [t, step, hrow, mem_span_singleton] + · simp [t, step, Function.update_of_ne hr] + have hall := rows_in_run (K ∙ (Pi.single h 1 : Reg → K)) q ⟨t.row - s0.row, s0.loc⟩ hin + have : ∀ r, ∃ a : K, a • (Pi.single h 1 : Reg → K) = + (run t q).row r - (run s0 q).row r := by + intro r + have e := congrFun hd r + rw [Pi.sub_apply] at e + rw [e]; exact mem_span_singleton.1 (hall r) + choose δ hδ using this + refine ⟨δ, fun r => ?_⟩ + rw [run_append, run_append] + change (run t q).row r = _ + rw [← sub_add_cancel ((run t q).row r) ((run s0 q).row r), ← hδ r, add_comm] + +/-- Column form: every final row (non-V-enders included) is unchanged on every column k ≠ h. -/ +theorem inject_col (s : St K Reg C) (p q : List (Ev K Reg C)) (h j : Reg) (c : K) (ch : C) + (hrow : (run s p).row h = Pi.single h 1) (r k : Reg) (hk : k ≠ h) : + (run s (p ++ .add j h c ch :: q)).row r k = (run s (p ++ q)).row r k := by + obtain ⟨δ, hδ⟩ := inject s p q h j c ch hrow + rw [hδ r]; simp [hk] + +/-- **Two injections** (the SWAPBUILD "both" word: 457 → 242, then 461 → X10). Hypotheses: h1 = e_h1 +at the first point of the unedited prefix, and h2 = e_h2 at the second point of the once-edited word. -/ +theorem inject_two (s : St K Reg C) (p1 q1 q2 : List (Ev K Reg C)) (h1 j1 h2 j2 : Reg) (c1 c2 : K) + (ch1 ch2 : C) + (hrow1 : (run s p1).row h1 = Pi.single h1 1) + (hrow2 : (run s (p1 ++ .add j1 h1 c1 ch1 :: q1)).row h2 = Pi.single h2 1) : + ∃ δ1 δ2 : Reg → K, ∀ r, + (run s (p1 ++ .add j1 h1 c1 ch1 :: q1 ++ .add j2 h2 c2 ch2 :: q2)).row r = + (run s (p1 ++ q1 ++ q2)).row r + δ1 r • (Pi.single h1 1 : Reg → K) + + δ2 r • (Pi.single h2 1 : Reg → K) := by + obtain ⟨δ2, hδ2⟩ := inject s (p1 ++ .add j1 h1 c1 ch1 :: q1) q2 h2 j2 c2 ch2 hrow2 + obtain ⟨δ1, hδ1⟩ := inject s p1 (q1 ++ q2) h1 j1 c1 ch1 hrow1 + refine ⟨δ1, δ2, fun r => ?_⟩ + rw [hδ2 r] + have e1 : p1 ++ Ev.add j1 h1 c1 ch1 :: q1 ++ q2 = p1 ++ Ev.add j1 h1 c1 ch1 :: (q1 ++ q2) := by simp + rw [e1, hδ1 r, List.append_assoc] + +/-- Two-column form: every final row is unchanged on every column outside {h1, h2}. -/ +theorem inject_two_col (s : St K Reg C) (p1 q1 q2 : List (Ev K Reg C)) (h1 j1 h2 j2 : Reg) + (c1 c2 : K) (ch1 ch2 : C) + (hrow1 : (run s p1).row h1 = Pi.single h1 1) + (hrow2 : (run s (p1 ++ .add j1 h1 c1 ch1 :: q1)).row h2 = Pi.single h2 1) + (r k : Reg) (hk1 : k ≠ h1) (hk2 : k ≠ h2) : + (run s (p1 ++ .add j1 h1 c1 ch1 :: q1 ++ .add j2 h2 c2 ch2 :: q2)).row r k = + (run s (p1 ++ q1 ++ q2)).row r k := by + obtain ⟨δ1, δ2, hδ⟩ := inject_two s p1 q1 q2 h1 j1 h2 j2 c1 c2 ch1 ch2 hrow1 hrow2 + rw [hδ r]; simp [hk1, hk2] + +/-- **The debt is absorbed by the V mix.** Let `evs` be the edited (hub-deleted) word and `X0` the +unedited end rows. Suppose the edited end rows differ from X0 only along e_h (`inject`), the +non-V-enders end on target (the TR2 column condition, data), the unedited V-ender rows lie in +B = span V targets, e_h ∈ B (h ends at V with target e_h) and B ⊓ N = ⊥. Then the edited run has a +V mix iff it is loss-free. -/ +theorem absorb [Fintype Reg] (z V : C) (s : St K Reg C) (T : Finset Reg) (evs : List (Ev K Reg C)) + (hL : Legal z V s evs) (hN : ∀ e ∈ evs, NZ e) (hG : Good s T) (hS : Sp s = TS T) + (Rf : Reg → Reg → K) (G1 : Finset Reg) (h : Reg) (X0 : Reg → Reg → K) (δ : Reg → K) + (hX : ∀ r, (run s evs).row r = X0 r + δ r • (Pi.single h 1 : Reg → K)) + (hNon : ∀ r ∉ G1, (run s evs).row r = Rf r) + (hTgt : span K (Set.range Rf) = TS (tokRun T evs)) + (hX0 : ∀ g ∈ G1, X0 g ∈ span K (Rf '' (G1 : Set Reg))) + (he : (Pi.single h 1 : Reg → K) ∈ span K (Rf '' (G1 : Set Reg))) + (hBN : span K (Rf '' (G1 : Set Reg)) ⊓ span K (Rf '' (G1 : Set Reg)ᶜ) = ⊥) : + VMix (run s evs).row Rf G1 ↔ ¬ Loss s evs := by + rw [RankLawC.rank_law_indep z V s T evs hL hN hG hS Rf G1 hNon hTgt hBN] + refine ⟨And.left, fun hl => ⟨hl, fun g hg => ?_⟩⟩ + rw [hX g]; exact add_mem (hX0 g hg) (smul_mem _ _ he) + +end SwapWord + +#print axioms SwapWord.absorb +#print axioms SwapWord.inject_two_col +#print axioms SwapWord.inject_col +#print axioms RankLawC.rank_law_proj +#print axioms RankLawC.rank_law_of_gen diff --git a/research/p104-tree-ceiling/lean/Nov15/SwapWord.md b/research/p104-tree-ceiling/lean/Nov15/SwapWord.md new file mode 100644 index 0000000000..e4c791cf91 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/SwapWord.md @@ -0,0 +1,37 @@ +# SwapWord.lean: the SWAPBUILD two-swap edit (h457 → 242, h461 → X10). No sorry, ~5 s, 2.1 GB RSS +Imports the RankLawC olean. Axioms: [propext, Classical.choice, Quot.sound]. +Source: internal notes (not included). + +**The edit (data).** After rebirth (h = e_h at its first chart), the edit injects `j += −1·h` just before the native's own `h += j`. Together they are the swap. +- 457 → 242 at index 11392 of the hub-deleted mid program; 461 → X10 at index 11498. +- h = e_h holds at both points; the second is checked in the once-edited word (Nov15/swapword_data.py). + +**General lemmas** (TokenCancel's op model, any field): +- `run_diff`: two runs of the same events from states with equal locations differ by the run of the difference state, with births read as INITs. +- `rows_in_run`: with no births, all rows stay in any subspace P that contains them initially. +- **`inject`**: if h's row is e_h after prefix p, injecting `add j h c` changes every final row by δ r • e_h only. + - `inject_col`: every row, non-V-enders included, is unchanged on every column k ≠ h. +- `inject_two`, `inject_two_col`: the same for two injections (h1 = e_h1 in the unedited prefix, h2 = e_h2 in the once-edited one). The change is δ1 e_h1 + δ2 e_h2. +- **`absorb`** (the debt is absorbed by the V mix). Hypotheses: + - the edited rows = X0 + δ e_h; + - non-V-enders on target (TR2); + - X0[G1] ⊆ B; + - e_h ∈ B; + - B ⊓ N = ⊥. + + Then: V mix for the edited run ⟺ edited run is loss-free (via RankLawC.rank_law_indep). + +**Data (exact, swapword_data.py).** +- Debt support is exactly column {h}. +- Non-V-enders changed: 157/160/210/219 for 457 (column 457: −1/2 → 0) and 120/179/192/207 for 461 (column 461: +1 → 0). +- Every non-G0 mismatch vs native Rf on non-V-enders: 4 → 0. +- V-enders absorb the debt; 457 and 461 are themselves V-enders with Rf h = e_h, so e_h ∈ B. +- Loss-freeness/joint feasibility is the JointG + exact replay data (SWAPBUILD: final rows == native rows). + +**Scope.** +- `absorb` is stated for rows after the z-prefix. HubSettle's [X_n | X_0·M] acts only on G0 columns, and after rebirth h ∉ G0, so the e_h debt commutes with it. + +**Finding (prose false as written).** "The swap preserves every non-V-ender row exactly" is false against the unswapped (rebirth-only) word: it changes 4 non-V-ender rows per swap. +- True form: the swap changes final rows only in column e_h (`inject_col`). On non-V-enders the change is exactly the TR2 canceller, which zeroes their column h (now non-G0 after rebirth, so the z-hub can no longer clean it). +- Minimal fix: "preserves every row off column h; on non-V-enders it cancels column h (TR2), and the remaining e_h debt sits on V-enders, absorbed by the V mix because e_h ∈ span V targets (h is a V-ender)". +- Without e_h ∈ B and with B ⊓ N = ⊥, a nonzero V-ender debt can never be absorbed. diff --git a/research/p104-tree-ceiling/lean/Nov15/TokenCancel.lean b/research/p104-tree-ceiling/lean/Nov15/TokenCancel.lean new file mode 100644 index 0000000000..5686668ec3 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/TokenCancel.lean @@ -0,0 +1,452 @@ +/- +BIG-TOKENCANCEL T1 (hub blindness) and T2 (difference lemma), Source: internal notes See TokenCancel.md. + +Op model: registers `Reg`, charts `C` with two hubs `z` (= {0}) and `V`; rows in initial-row +coordinates `Reg → K`. Events carry their chart. Legal = co-presence plus the two [C] facts of +T1(a)/(b): no MOVE enters z and no MOVE leaves V. +-/ +import Mathlib.LinearAlgebra.Span.Basic +import Mathlib.LinearAlgebra.Pi +import Mathlib.Tactic.Abel +import Mathlib.Algebra.BigOperators.Fin + +set_option linter.unusedSectionVars false + +namespace TokenCancel + +inductive Ev (K Reg C : Type*) + | born (i : Reg) (c : C) + | init (i : Reg) (c : C) + | move (i : Reg) (c : C) + | add (i j : Reg) (a : K) (c : C) + | scale (i : Reg) (u : K) (c : C) + | clear (i : Reg) (c : C) + | copy (i j : Reg) (c : C) + +structure St (K Reg C : Type*) where + row : Reg → Reg → K + loc : Reg → Option C + +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] [DecidableEq C] + +def step (s : St K Reg C) : Ev K Reg C → St K Reg C + | .born i c => ⟨Function.update s.row i (Pi.single i 1), Function.update s.loc i (some c)⟩ + | .init i c => ⟨Function.update s.row i 0, Function.update s.loc i (some c)⟩ + | .move i c => ⟨s.row, Function.update s.loc i (some c)⟩ + | .add i j a _ => ⟨Function.update s.row i (s.row i + a • s.row j), s.loc⟩ + | .scale i u _ => ⟨Function.update s.row i (u • s.row i), s.loc⟩ + | .clear i _ => ⟨Function.update s.row i 0, s.loc⟩ + | .copy i j _ => ⟨Function.update s.row i (s.row j), s.loc⟩ + +def run (s : St K Reg C) : List (Ev K Reg C) → St K Reg C + | [] => s + | e :: es => run (step s e) es + +variable (z V : C) + +/-- Legality: co-presence at the event's chart; births/INITs of absent registers; +MOVEs never enter `z` and never leave `V` (T1(a), T1(b), checked [C] on #7623). -/ +def LegalEv (s : St K Reg C) : Ev K Reg C → Prop + | .born i _ => s.loc i = none + | .init i _ => s.loc i = none + | .move i c => ∃ c0, s.loc i = some c0 ∧ c0 ≠ V ∧ c ≠ z + | .add i j _ c => i ≠ j ∧ s.loc i = some c ∧ s.loc j = some c + | .scale i _ c => s.loc i = some c + | .clear i c => s.loc i = some c + | .copy i j c => s.loc i = some c ∧ s.loc j = some c + +def Legal : St K Reg C → List (Ev K Reg C) → Prop + | _, [] => True + | s, e :: es => LegalEv z V s e ∧ Legal (step s e) es + +/-- An op (not a birth/INIT/MOVE) at a hub. -/ +def hubOp : Ev K Reg C → Prop + | .add _ _ _ c | .scale _ _ c | .clear _ c | .copy _ _ c => c = z ∨ c = V + | _ => False + +instance (e : Ev K Reg C) : Decidable (hubOp z V e) := by + cases e <;> simp only [hubOp] <;> infer_instance + +variable (h : Reg) + +/-- The interior coefficient program: tracks the e_h-coefficient, ignoring every hub op. -/ +def sig (σ : Reg → K) : Ev K Reg C → Reg → K + | .born i _ => Function.update σ i (if i = h then 1 else 0) + | .init i _ => Function.update σ i 0 + | .move _ _ => σ + | .add i j a c => if c = z ∨ c = V then σ else Function.update σ i (σ i + a * σ j) + | .scale i u c => if c = z ∨ c = V then σ else Function.update σ i (u * σ i) + | .clear i c => if c = z ∨ c = V then σ else Function.update σ i 0 + | .copy i j c => if c = z ∨ c = V then σ else Function.update σ i (σ j) + +def sigRun (σ : Reg → K) : List (Ev K Reg C) → Reg → K + | [] => σ + | e :: es => sigRun (sig z V h σ e) es + +/-- The program is blind to hub ops: it equals the program run on the interior subsequence. -/ +theorem sigRun_filter (σ : Reg → K) (evs : List (Ev K Reg C)) : + sigRun z V h σ evs = sigRun z V h σ (evs.filter fun e => ¬ hubOp z V e) := by + induction evs generalizing σ with + | nil => rfl + | cons e es ih => + by_cases he : hubOp z V e + · have : sig z V h σ e = σ := by + cases e <;> simp_all [hubOp, sig] + simp [sigRun, he, this, ih] + · simp [sigRun, he, ih] + +/-- Invariant: rows not at V carry the program's e_h-coefficient; rows at z carry 0. -/ +def Inv (s : St K Reg C) (σ : Reg → K) : Prop := + (∀ r, s.loc r ≠ some V → s.row r h = σ r) ∧ (∀ r, s.loc r = some z → s.row r h = 0) + +lemma inv_update (s : St K Reg C) (σ σ' : Reg → K) (i : Reg) (nr : Reg → K) + (hI : Inv z V h s σ) (hσ : ∀ r, r ≠ i → σ' r = σ r) + (hnew : s.loc i ≠ some V → nr h = σ' i) (hz : s.loc i = some z → nr h = 0) : + Inv z V h ⟨Function.update s.row i nr, s.loc⟩ σ' := by + refine ⟨fun r hr => ?_, fun r hr => ?_⟩ + · by_cases hri : r = i + · subst hri; simpa using hnew hr + · simp only [Function.update_of_ne hri]; rw [hσ r hri]; exact hI.1 r hr + · by_cases hri : r = i + · subst hri; simpa using hz hr + · simp only [Function.update_of_ne hri]; exact hI.2 r hr + +theorem inv_step (s : St K Reg C) (σ : Reg → K) (e : Ev K Reg C) + (hI : Inv z V h s σ) (hL : LegalEv z V s e) (hb : ∀ c, e = .born h c → c ≠ z) : + Inv z V h (step s e) (sig z V h σ e) := by + have hI1 := hI.1 + have hI2 := hI.2 + -- coefficient of a register present at chart c + have atz : ∀ i c, s.loc i = some c → c = z → s.row i h = 0 := fun i c hi hc => + hI2 i (hc ▸ hi) + have notV : ∀ i c, s.loc i = some c → c ≠ V → s.row i h = σ i := fun i c hi hc => + hI1 i (by rw [hi]; simpa using hc) + cases e with + | born i c => + refine ⟨fun r _ => ?_, fun r hr => ?_⟩ + · by_cases hri : r = i + · subst hri; simp [step, sig, Pi.single_apply, eq_comm] + · simp only [step, sig, Function.update_of_ne hri] at * + exact hI1 r (by simpa [step, Function.update_of_ne hri] using ‹_›) + · by_cases hri : r = i + · subst hri + simp only [step, Function.update_self, Option.some.injEq] at hr + have : r ≠ h := fun hrh => hb c (by rw [hrh]) hr + simp [step, this.symm] + · simp only [step, Function.update_of_ne hri] at hr ⊢; exact hI2 r hr + | init i c => + refine ⟨fun r hr => ?_, fun r hr => ?_⟩ + · by_cases hri : r = i + · subst hri; simp [step, sig] + · simp only [step, sig, Function.update_of_ne hri] at hr ⊢; exact hI1 r hr + · by_cases hri : r = i + · subst hri; simp [step] + · simp only [step, Function.update_of_ne hri] at hr ⊢; exact hI2 r hr + | move i c => + obtain ⟨c0, hc0, hc0V, hcz⟩ := hL + refine ⟨fun r hr => ?_, fun r hr => ?_⟩ + · by_cases hri : r = i + · subst hri; exact hI1 r (by rw [hc0]; simpa using hc0V) + · simp only [step, sig, Function.update_of_ne hri] at hr ⊢; exact hI1 r hr + · by_cases hri : r = i + · subst hri; simp [step] at hr; exact absurd hr hcz + · simp only [step, Function.update_of_ne hri] at hr ⊢; exact hI2 r hr + | add i j a c => + obtain ⟨hij, hi, hj⟩ := hL + by_cases hc : c = z ∨ c = V + · have hs : sig z V h σ (.add i j a c) = σ := by simp [sig, hc] + rw [hs] + apply inv_update z V h s σ σ i _ hI (fun _ _ => rfl) + · intro hiV + have hcV : c ≠ V := fun h' => hiV (h' ▸ hi) + have hcz : c = z := hc.resolve_right hcV + simp [atz i c hi hcz, atz j c hj hcz, ← notV i c hi hcV] + · intro hiz + have hcz : c = z := by rw [hi] at hiz; exact Option.some.inj hiz + simp [atz i c hi hcz, atz j c hj hcz] + · push Not at hc + have hs : sig z V h σ (.add i j a c) = Function.update σ i (σ i + a * σ j) := by + simp [sig, hc] + rw [hs] + apply inv_update z V h s σ _ i _ hI (fun r hr => Function.update_of_ne hr _ _) + · intro _; simp [notV i c hi hc.2, notV j c hj hc.2] + · intro hiz; rw [hi] at hiz; exact absurd (Option.some.inj hiz) hc.1 + | scale i u c => + have hi : s.loc i = some c := hL + by_cases hc : c = z ∨ c = V + · have hs : sig z V h σ (.scale i u c) = σ := by simp [sig, hc] + rw [hs] + apply inv_update z V h s σ σ i _ hI (fun _ _ => rfl) + · intro hiV + have hcV : c ≠ V := fun h' => hiV (h' ▸ hi) + have hcz : c = z := hc.resolve_right hcV + simp [atz i c hi hcz, ← notV i c hi hcV] + · intro hiz + have hcz : c = z := by rw [hi] at hiz; exact Option.some.inj hiz + simp [atz i c hi hcz] + · push Not at hc + have hs : sig z V h σ (.scale i u c) = Function.update σ i (u * σ i) := by + simp [sig, hc] + rw [hs] + apply inv_update z V h s σ _ i _ hI (fun r hr => Function.update_of_ne hr _ _) + · intro _; simp [notV i c hi hc.2] + · intro hiz; rw [hi] at hiz; exact absurd (Option.some.inj hiz) hc.1 + | clear i c => + have hi : s.loc i = some c := hL + by_cases hc : c = z ∨ c = V + · have hs : sig z V h σ (.clear i c) = σ := by simp [sig, hc] + rw [hs] + apply inv_update z V h s σ σ i _ hI (fun _ _ => rfl) + · intro hiV + have hcV : c ≠ V := fun h' => hiV (h' ▸ hi) + have hcz : c = z := hc.resolve_right hcV + simp [← notV i c hi hcV, atz i c hi hcz] + · intro _; simp + · push Not at hc + have hs : sig z V h σ (.clear i c) = Function.update σ i 0 := by simp [sig, hc] + rw [hs] + apply inv_update z V h s σ _ i _ hI (fun r hr => Function.update_of_ne hr _ _) + · intro _; simp + · intro _; simp + | copy i j c => + obtain ⟨hi, hj⟩ := hL + by_cases hc : c = z ∨ c = V + · have hs : sig z V h σ (.copy i j c) = σ := by simp [sig, hc] + rw [hs] + apply inv_update z V h s σ σ i _ hI (fun _ _ => rfl) + · intro hiV + have hcV : c ≠ V := fun h' => hiV (h' ▸ hi) + have hcz : c = z := hc.resolve_right hcV + simp [atz j c hj hcz, ← notV i c hi hcV, atz i c hi hcz] + · intro hiz + have hcz : c = z := by rw [hi] at hiz; exact Option.some.inj hiz + simp [atz j c hj hcz] + · push Not at hc + have hs : sig z V h σ (.copy i j c) = Function.update σ i (σ j) := by simp [sig, hc] + rw [hs] + apply inv_update z V h s σ _ i _ hI (fun r hr => Function.update_of_ne hr _ _) + · intro _; simp [notV j c hj hc.2] + · intro hiz; rw [hi] at hiz; exact absurd (Option.some.inj hiz) hc.1 + +def start : St K Reg C := ⟨fun _ => 0, fun _ => none⟩ + +theorem inv_run : ∀ (s : St K Reg C) (σ : Reg → K) (evs : List (Ev K Reg C)), + Inv z V h s σ → Legal z V s evs → (∀ c, Ev.born h c ∈ evs → c ≠ z) → + Inv z V h (run s evs) (sigRun z V h σ evs) + | _, _, [], hI, _, _ => hI + | s, σ, e :: es, hI, ⟨hL, hLs⟩, hb => + inv_run (step s e) (sig z V h σ e) es + (inv_step z V h s σ e hI hL (fun c he => hb c (by simp [he]))) + hLs (fun c hc => hb c (by simp [hc])) + +/-- **T1 (hub blindness).** In a legal run from the empty state in which `h` is not born at the +hub z (h off-hub born), every register r not at V at the end has e_h-coefficient equal to the +interior program's value: hub ops never enter it. -/ +theorem T1_hub_blind (evs : List (Ev K Reg C)) (hL : Legal z V start evs) + (hb : ∀ c, Ev.born h c ∈ evs → c ≠ z) (r : Reg) (hr : (run start evs).loc r ≠ some V) : + (run start evs).row r h = sigRun z V h (fun _ => 0) (evs.filter fun e => ¬ hubOp z V e) r := by + have hI : Inv z V h (start : St K Reg C) (fun _ => 0) := + ⟨fun _ _ => rfl, fun r hr => by simp [start] at hr⟩ + rw [(inv_run z V h start _ evs hI hL hb).1 r hr, sigRun_filter] + +/-- **T1, two-run form.** Two legal runs with the same interior subsequence give every register +that is not at V at the end of both the same e_h-coefficient. -/ +theorem T1_two_runs (evs evs' : List (Ev K Reg C)) + (hL : Legal z V start evs) (hL' : Legal z V start evs') + (hb : ∀ c, Ev.born h c ∈ evs → c ≠ z) (hb' : ∀ c, Ev.born h c ∈ evs' → c ≠ z) + (hfil : evs.filter (fun e => ¬ hubOp z V e) = evs'.filter (fun e => ¬ hubOp z V e)) + (r : Reg) (hr : (run start evs).loc r ≠ some V) (hr' : (run start evs').loc r ≠ some V) : + (run start evs).row r h = (run start evs').row r h := by + rw [T1_hub_blind z V h evs hL hb r hr, T1_hub_blind z V h evs' hL' hb' r hr', hfil] + +/-! ## T2 difference lemma (direct carrier) + +y's row evolves only by: `addK a r` (y += a·row_k, with row_k's e_k-coefficient 1), `addO w` +(y += w with w's e_k-coefficient 0) and `scale u` (prose leaves SCALE of y unstated; it is allowed). +`recv` tracks the net receipt from k, `A` the accumulated e_k-coefficient. -/ + +inductive YOp (K Reg : Type*) + | addK (a : K) (r : Reg → K) + | addO (w : Reg → K) + | scale (u : K) + +/-- (y, receipt from k, effective coefficient sum). -/ +def yStep : (Reg → K) × (Reg → K) × K → YOp K Reg → (Reg → K) × (Reg → K) × K + | (y, R, A), .addK a r => (y + a • r, R + a • r, A + a) + | (y, R, A), .addO w => (y + w, R, A) + | (y, R, A), .scale u => (u • y, u • R, u * A) + +def yRun (st : (Reg → K) × (Reg → K) × K) : List (YOp K Reg) → (Reg → K) × (Reg → K) × K + | [] => st + | o :: os => yRun (yStep st o) os + +/-- Invariant of the y-replay: y's e_k-coefficient equals the accumulated coefficient A, and +R − A·r1 stays in any submodule N containing every (row_k at a contact) − r1. -/ +theorem T2_inv (k : Reg) (r1 : Reg → K) (N : Submodule K (Reg → K)) : + ∀ (ops : List (YOp K Reg)) (y R : Reg → K) (A : K), + (∀ a r, YOp.addK a r ∈ ops → r k = 1 ∧ r - r1 ∈ N) → (∀ w, YOp.addO w ∈ ops → w k = 0) → + y k = A → R - A • r1 ∈ N → + (yRun (y, R, A) ops).1 k = (yRun (y, R, A) ops).2.2 ∧ + (yRun (y, R, A) ops).2.1 - (yRun (y, R, A) ops).2.2 • r1 ∈ N + | [], _, _, _, _, _, hy, hR => ⟨hy, hR⟩ + | o :: os, y, R, A, hK, hO, hy, hR => by + have hK' : ∀ a r, YOp.addK a r ∈ os → r k = 1 ∧ r - r1 ∈ N := + fun a r h => hK a r (List.mem_cons_of_mem _ h) + have hO' : ∀ w, YOp.addO w ∈ os → w k = 0 := fun w h => hO w (List.mem_cons_of_mem _ h) + cases o with + | addK a r => + obtain ⟨hrk, hrN⟩ := hK a r List.mem_cons_self + apply T2_inv k r1 N os (y + a • r) (R + a • r) (A + a) hK' hO' + · simp [hy, hrk] + · have : R + a • r - (A + a) • r1 = (R - A • r1) + a • (r - r1) := by + rw [add_smul, smul_sub]; abel + rw [this]; exact N.add_mem hR (N.smul_mem a hrN) + | addO w => + have hwk := hO w List.mem_cons_self + apply T2_inv k r1 N os (y + w) R A hK' hO' + · simp [hy, hwk] + · exact hR + | scale u => + apply T2_inv k r1 N os (u • y) (u • R) (u * A) hK' hO' + · simp [hy] + · have : u • R - (u * A) • r1 = u • (R - A • r1) := by rw [smul_sub, mul_smul] + rw [this]; exact N.smul_mem u hR + +/-- **T2 (difference lemma, direct carrier).** y starts with e_k-coefficient 0 and its row changes +only through `ops`: contacts y += a·row_k(t) (row_k(t) has e_k-coefficient 1), additions of rows +free of e_k, and SCALEs of y. If y's final e_k-coefficient is 0 (its SPEC final row has no helper +coordinate; T1: no hub op can fix it), then +* the effective coefficients sum to 0, and +* the net receipt from k lies in span{row_k(t_i) − row_k(t_1)}: what k carried into its first + contact with y never reaches y net (any reference row r1, in particular row_k at the first contact). -/ +theorem T2_difference (k : Reg) (r1 : Reg → K) (ops : List (YOp K Reg)) (y0 : Reg → K) + (hy0 : y0 k = 0) + (hK : ∀ a r, YOp.addK a r ∈ ops → r k = 1) (hO : ∀ w, YOp.addO w ∈ ops → w k = 0) + (hfin : (yRun (y0, 0, 0) ops).1 k = 0) : + (yRun (y0, 0, 0) ops).2.2 = 0 ∧ + (yRun (y0, 0, 0) ops).2.1 ∈ + Submodule.span K {x | ∃ a r, YOp.addK a r ∈ ops ∧ x = r - r1} := by + set N := Submodule.span K {x | ∃ a r, YOp.addK a r ∈ ops ∧ x = r - r1} + have := T2_inv k r1 N ops y0 0 0 + (fun a r h => ⟨hK a r h, Submodule.subset_span ⟨a, r, h, rfl⟩⟩) hO hy0 (by simp) + have hA : (yRun (y0, 0, 0) ops).2.2 = 0 := by rw [← this.1, hfin] + refine ⟨hA, ?_⟩ + have h2 := this.2 + rwa [hA, zero_smul, sub_zero] at h2 + +/-- The receipt bookkeeping is faithful: the final row is y0 scaled, plus the receipt from k, plus +the other additions (scaled by later SCALEs). Here only the e_k-coordinate part matters, so we +record the coefficient identity: final e_k-coefficient = (Π scales)·y0_k + A. With y0_k = 0 this is A. -/ +theorem T2_coeff (k : Reg) : ∀ (ops : List (YOp K Reg)) (y R : Reg → K) (A : K), + (∀ a r, YOp.addK a r ∈ ops → r k = 1) → (∀ w, YOp.addO w ∈ ops → w k = 0) → + y k = A → (yRun (y, R, A) ops).1 k = (yRun (y, R, A) ops).2.2 := by + intro ops y R A hK hO hy + exact (T2_inv k 0 ⊤ ops y R A (fun a r h => ⟨hK a r h, Submodule.mem_top⟩) hO hy + Submodule.mem_top).1 + +/-! ## T2, corrected Σ statement + +The literal "Σ a_i = 0" is false once y is SCALEd between contacts (`T2_literal_false`). The +correct statement uses EFFECTIVE coefficients: contact i contributes a_i · Π(scales of y after it). +`scl ops` = product of all SCALE factors of y in `ops`; `contacts ops` = (effective coefficient, +row_k at the contact) for each contact, in order. -/ + +/-- product of the SCALE factors of y in `ops`. -/ +def scl : List (YOp K Reg) → K + | [] => 1 + | .scale u :: os => u * scl os + | .addK _ _ :: os => scl os + | .addO _ :: os => scl os + +/-- contacts with their effective coefficients a_i · Π(later scales). -/ +def contacts : List (YOp K Reg) → List (K × (Reg → K)) + | [] => [] + | .addK a r :: os => (a * scl os, r) :: contacts os + | .addO _ :: os => contacts os + | .scale _ :: os => contacts os + +/-- Closed form of the coefficient and receipt trackers. -/ +theorem yRun_closed : ∀ (ops : List (YOp K Reg)) (y R : Reg → K) (A : K), + (yRun (y, R, A) ops).2.2 = scl ops * A + ((contacts ops).map Prod.fst).sum ∧ + (yRun (y, R, A) ops).2.1 = scl ops • R + ((contacts ops).map (fun p => p.1 • p.2)).sum + | [], y, R, A => by simp [yRun, scl, contacts] + | o :: os, y, R, A => by + cases o with + | addK a r => + obtain ⟨h1, h2⟩ := yRun_closed os (y + a • r) (R + a • r) (A + a) + simp only [yRun, yStep, scl, contacts, List.map_cons, List.sum_cons] + refine ⟨by rw [h1]; ring, ?_⟩ + rw [h2, smul_add, smul_smul, mul_comm (scl os) a]; abel + | addO w => + obtain ⟨h1, h2⟩ := yRun_closed os (y + w) R A + simpa only [yRun, yStep, scl, contacts] using ⟨h1, h2⟩ + | scale u => + obtain ⟨h1, h2⟩ := yRun_closed os (u • y) (u • R) (u * A) + simp only [yRun, yStep, scl, contacts] + refine ⟨by rw [h1]; ring, ?_⟩ + rw [h2, smul_smul, mul_comm (scl os) u] + +/-- **T2, corrected.** Hypotheses as in `T2_difference`. Then +* Σ (effective coefficients a_i · Π later scales of y) = 0; +* the net receipt from k is Σ eff_i · row_k(t_i) = Σ eff_i · (row_k(t_i) − r1) for ANY r1, in + particular r1 = row_k(t_1): content k carried into its first contact never reaches y net. -/ +theorem T2_corrected (k : Reg) (ops : List (YOp K Reg)) (y0 : Reg → K) + (hy0 : y0 k = 0) + (hK : ∀ a r, YOp.addK a r ∈ ops → r k = 1) (hO : ∀ w, YOp.addO w ∈ ops → w k = 0) + (hfin : (yRun (y0, 0, 0) ops).1 k = 0) (r1 : Reg → K) : + ((contacts ops).map Prod.fst).sum = 0 ∧ + (yRun (y0, 0, 0) ops).2.1 = ((contacts ops).map (fun p => p.1 • p.2)).sum ∧ + (yRun (y0, 0, 0) ops).2.1 = ((contacts ops).map (fun p => p.1 • (p.2 - r1))).sum := by + obtain ⟨h1, h2⟩ := yRun_closed ops y0 0 0 + have hA := (T2_difference k r1 ops y0 hy0 hK hO hfin).1 + rw [h1, mul_zero, zero_add] at hA + have hrec : (yRun (y0, 0, 0) ops).2.1 = ((contacts ops).map (fun p => p.1 • p.2)).sum := by + rw [h2, smul_zero, zero_add] + refine ⟨hA, hrec, ?_⟩ + have hsplit : ∀ l : List (K × (Reg → K)), + (l.map (fun p => p.1 • (p.2 - r1))).sum + = (l.map (fun p => p.1 • p.2)).sum - (l.map Prod.fst).sum • r1 := by + intro l; induction l with + | nil => simp + | cons p l ih => + simp only [List.map_cons, List.sum_cons]; rw [ih, add_smul, smul_sub]; abel + rw [hsplit, hA, zero_smul, sub_zero, hrec] + +/-- Without SCALEs of y the effective coefficients are the literal a_i, so the prose "Σ a_i = 0" +holds verbatim. -/ +theorem contacts_noscale : ∀ (ops : List (YOp K Reg)), (∀ u, YOp.scale u ∉ ops) → + (contacts ops).map Prod.fst = ops.filterMap (fun o => match o with + | .addK a _ => some a | _ => none) + | [], _ => rfl + | o :: os, h => by + have h' : ∀ u, YOp.scale u ∉ os := fun u hu => h u (List.mem_cons_of_mem _ hu) + have hs : scl os = 1 := by + clear h; induction os with + | nil => rfl + | cons o' os' ih => + cases o' with + | scale u => exact absurd List.mem_cons_self (h' u) + | addK a r => exact ih (fun u hu => h' u (List.mem_cons_of_mem _ hu)) + | addO w => exact ih (fun u hu => h' u (List.mem_cons_of_mem _ hu)) + cases o with + | addK a r => simp [contacts, hs, contacts_noscale os h'] + | addO w => simpa [contacts] using contacts_noscale os h' + | scale u => exact absurd List.mem_cons_self (h u) + +/-- The finding, formal: y += k, y *= 2, y += (−2)·k. Final e_k-coefficient 0, literal Σ a = −1, +effective Σ = 1·2 + (−2) = 0. Over ℚ with one register. -/ +theorem T2_literal_false : + let ek : Unit → ℚ := fun _ => 1 + let ops : List (YOp ℚ Unit) := [.addK 1 ek, .scale 2, .addK (-2) ek] + (yRun ((0 : Unit → ℚ), 0, 0) ops).1 () = 0 ∧ (1 : ℚ) + (-2) ≠ 0 ∧ + ((contacts ops).map Prod.fst).sum = 0 := by + refine ⟨?_, by norm_num, ?_⟩ <;> simp [yRun, yStep, contacts, scl] + +end TokenCancel + +#print axioms TokenCancel.T1_hub_blind +#print axioms TokenCancel.T1_two_runs +#print axioms TokenCancel.T2_difference +#print axioms TokenCancel.T2_corrected +#print axioms TokenCancel.contacts_noscale +#print axioms TokenCancel.T2_literal_false diff --git a/research/p104-tree-ceiling/lean/Nov15/TokenCancel.md b/research/p104-tree-ceiling/lean/Nov15/TokenCancel.md new file mode 100644 index 0000000000..06a05563e7 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/TokenCancel.md @@ -0,0 +1,36 @@ +# TokenCancel.lean: BIG-TOKENCANCEL T1 (hub blindness) + T2 (difference lemma). No sorry, ~6 s, 1.7 GB RSS +Source: internal notes (not included). Axioms (3 printed): [propext, Quot.sound]. + +**Model.** +- Registers Reg, charts C, hubs z (= {0}) and V. Rows are in initial-row coordinates. +- Events: born (row e_i), init (row 0), move, add i += a·j (i ≠ j), scale, clear, copy. Each event carries its chart. +- Legal = births/INITs of absent registers and co-presence at the event's chart, plus the two [C] facts of T1(a)/(b): no MOVE enters z, and no MOVE leaves V (0 of 6,257 on #7623). +- `hubOp` = an add/scale/clear/copy at z or V. + +**T1.** +- `sigRun` is the interior coefficient program: it tracks the e_h-coefficient and ignores hub ops. `sigRun_filter` shows it depends only on the non-hub-op subsequence. +- `T1_hub_blind`: in a legal run where h is not born at z (h off-hub born), every register not at V at the end has row[h] = sigRun on the interior subsequence. +- `T1_two_runs`: two legal runs with the same interior subsequence agree on the e_h-coefficient of every register that is off V at the end of both. +- Proof invariant: rows not at V carry the program's value; rows at z carry 0. +- The hypothesis z ≠ V is NOT needed. T1' (the joint-hub D-mix corollary) is plain invertibility and is not formalized. + +**T2.** +- y's row changes only through `addK a r` (contact y += a·row_k, with r_k = 1), `addO w` (w_k = 0) and `scale u` of y. +- `T2_difference`: if y₀_k = 0 and y's final e_k-coefficient is 0, then + - the effective coefficient sum is 0; + - the net receipt from k lies in span{r_i − r1} for ANY reference row r1, in particular row_k at the first contact. So content k carried into the first contact never reaches y net. +- `T2_coeff`: final e_k-coefficient = A. + +**Finding (scope, T2).** The literal "Σ a_i = 0" is FALSE if y is SCALEd between contacts. Example: y += k, y *= 2, y += (−2)·k gives Σ a = −1, yet y_k = 0. +- Minimal fix: use effective coefficients a_i·Π(later scales of y), or require that y is not SCALEd between contacts. +- The conclusion (receipt ∈ span of post-first-contact differences) survives SCALE. +- CLEAR/COPY of y and relays through third registers remain outside scope, as the prose says. + +**T2 corrected .** Same file, axioms [propext, Quot.sound] (the counterexample also uses Classical.choice). +- `contacts ops` lists (a_i · Π(later scales of y), row_k(t_i)) for each contact. +- `yRun_closed` gives the closed forms of the coefficient and receipt trackers. +- `T2_corrected`: under T2's hypotheses, + - Σ effective coefficients = 0; + - the net receipt = Σ eff_i · row_k(t_i) = Σ eff_i · (row_k(t_i) − r1) for ANY r1 (take r1 = row_k(t_1)). +- `contacts_noscale`: without SCALEs of y, eff_i = a_i, so the literal prose "Σ a_i = 0" holds. +- `T2_literal_false`: the finding, formal over ℚ. y += k, y *= 2, y += (−2)k gives final y_k = 0 and Σ a = −1, while effective Σ = 0. diff --git a/research/p104-tree-ceiling/lean/Nov15/WholeFloorCover.lean b/research/p104-tree-ceiling/lean/Nov15/WholeFloorCover.lean new file mode 100644 index 0000000000..7c04dd9336 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/WholeFloorCover.lean @@ -0,0 +1,24 @@ +import Nov15.WholeFloorCoverData +import Nov15.JointCeiling + +/-! WholeFloorCover : the cover F < 0 on [.0204110964, 1] for (caller 6 7) + 17 * natFloor; data in WholeFloorCoverData. -/ +namespace WholeFloorCover +open NumCertK JointCeiling CallerCost + +theorem invoice_eq_Fc (s : ℝ) : Finv s (invoice (caller 6 7) natFloor 17) = Fc cfW s := by + simp only [Finv, Fh, invoice, caller, callerT, callerP, armT, armP, natFloor, scale, Fc, cfW, + List.range_succ, List.range_zero] + norm_num + ring + +/-- **the cover**: F < 0 on [.0204110964, 1] (t = 1 - s) for the floor-native invoice. -/ +theorem cover (t : ℝ) (ht : (204110965 : ℝ) / 10 ^ 10 ≤ t) (ht1 : t ≤ 1) : + Finv (1 - t) (invoice (caller 6 7) natFloor 17) < 0 := by + rw [invoice_eq_Fc] + apply cfW_neg _ (by linarith) + push_cast + linarith + +end WholeFloorCover + +#print axioms WholeFloorCover.cover diff --git a/research/p104-tree-ceiling/lean/Nov15/WholeFloorCoverData.lean b/research/p104-tree-ceiling/lean/Nov15/WholeFloorCoverData.lean new file mode 100644 index 0000000000..8d59602eab --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/WholeFloorCoverData.lean @@ -0,0 +1,47 @@ +import Nov15.WholeFloorCoverData1 + +namespace WholeFloorCover +open NumCertK + +theorem cfW_p6 : Fup cfW (763/1000) (163/200) < 0 := by decide +kernel +theorem cfW_p7 : Fup cfW (163/200) (851/1000) < 0 := by decide +kernel +theorem cfW_p8 : Fup cfW (851/1000) (879/1000) < 0 := by decide +kernel +theorem cfW_p9 : Fup cfW (879/1000) (901/1000) < 0 := by decide +kernel +theorem cfW_p10 : Fup cfW (901/1000) (459/500) < 0 := by decide +kernel +theorem cfW_p11 : Fup cfW (459/500) (93/100) < 0 := by decide +kernel +theorem cfW_d : 0 < dLo cfW (93/100) (9795889035/10^10) := by decide +kernel +theorem cfW_end : Fup cfW (9795889035/10^10) (9795889035/10^10) < 0 := by decide +kernel + +theorem cfW_neg (s : ℝ) (h0 : 0 ≤ s) (hs : s ≤ ((9795889035 / 10 ^ 10 : ℚ) : ℝ)) : Fc cfW s < 0 := by + have o := cfW_ok + by_cases a1 : s ≤ (((73/250) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o 0 (73/250) (le_refl _) (by norm_num) cfW_p1 s (by simpa using h0) a1 + by_cases a2 : s ≤ (((59/125) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o (73/250) (59/125) (by norm_num) (by norm_num) cfW_p2 s (by push_neg at a1; exact a1.le) a2 + by_cases a3 : s ≤ (((301/500) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o (59/125) (301/500) (by norm_num) (by norm_num) cfW_p3 s (by push_neg at a2; exact a2.le) a3 + by_cases a4 : s ≤ (((87/125) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o (301/500) (87/125) (by norm_num) (by norm_num) cfW_p4 s (by push_neg at a3; exact a3.le) a4 + by_cases a5 : s ≤ (((763/1000) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o (87/125) (763/1000) (by norm_num) (by norm_num) cfW_p5 s (by push_neg at a4; exact a4.le) a5 + by_cases a6 : s ≤ (((163/200) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o (763/1000) (163/200) (by norm_num) (by norm_num) cfW_p6 s (by push_neg at a5; exact a5.le) a6 + by_cases a7 : s ≤ (((851/1000) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o (163/200) (851/1000) (by norm_num) (by norm_num) cfW_p7 s (by push_neg at a6; exact a6.le) a7 + by_cases a8 : s ≤ (((879/1000) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o (851/1000) (879/1000) (by norm_num) (by norm_num) cfW_p8 s (by push_neg at a7; exact a7.le) a8 + by_cases a9 : s ≤ (((901/1000) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o (879/1000) (901/1000) (by norm_num) (by norm_num) cfW_p9 s (by push_neg at a8; exact a8.le) a9 + by_cases a10 : s ≤ (((459/500) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o (901/1000) (459/500) (by norm_num) (by norm_num) cfW_p10 s (by push_neg at a9; exact a9.le) a10 + by_cases a11 : s ≤ (((93/100) : ℚ) : ℝ) + · exact Fc_neg_piece cfW o (459/500) (93/100) (by norm_num) (by norm_num) cfW_p11 s (by push_neg at a10; exact a10.le) a11 + have h1 := Fc_mono cfW o (93/100) (9795889035/10^10) (by norm_num) (by norm_num) cfW_d s + (by push_neg at a11; exact a11.le) hs + have h2 := Fc_neg_piece cfW o (9795889035/10^10) (9795889035/10^10) (by norm_num) (by norm_num) cfW_end + ((9795889035/10^10 : ℚ) : ℝ) (le_refl _) (le_refl _) + linarith + +end WholeFloorCover + +#print axioms WholeFloorCover.cfW_neg diff --git a/research/p104-tree-ceiling/lean/Nov15/WholeFloorCoverData1.lean b/research/p104-tree-ceiling/lean/Nov15/WholeFloorCoverData1.lean new file mode 100644 index 0000000000..097aac7ee4 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/WholeFloorCoverData1.lean @@ -0,0 +1,23 @@ +import Nov15.NumCertK + +/-! +WholeFloorCoverData1 : discharges the interval-cover hypothesis of WholeFloorNest.kappa_whole_floor_nested +with kernel interval library (NumCertK): the fixed #7113 caller C(8|9) = caller 6 7 at 17 calls on the +floor native `natFloor` has F(s) < 0 for every s in [0, 1 - .0204110964]. Kernel only; no native_decide. +-/ +namespace WholeFloorCover +open NumCertK + +/-- F of (caller 6 7) + 17 * natFloor, merged by rank. -/ +def cfW : CF := [(1, -3648), (2, 1496), (8, -7456), (9, 384), + (16, -416), (17, 416), (24, -416), (25, 416), (32, -416), (33, 416), (40, -416), (41, 416), (48, -416), + (49, 416), (56, -416), (57, 416), (64, -208), (65, 416), (73, 208), (137, 208)] + +theorem cfW_ok : okR cfW := by decide +kernel +theorem cfW_p1 : Fup cfW 0 (73/250) < 0 := by decide +kernel +theorem cfW_p2 : Fup cfW (73/250) (59/125) < 0 := by decide +kernel +theorem cfW_p3 : Fup cfW (59/125) (301/500) < 0 := by decide +kernel +theorem cfW_p4 : Fup cfW (301/500) (87/125) < 0 := by decide +kernel +theorem cfW_p5 : Fup cfW (87/125) (763/1000) < 0 := by decide +kernel + +end WholeFloorCover diff --git a/research/p104-tree-ceiling/lean/Nov15/WordDuality.lean b/research/p104-tree-ceiling/lean/Nov15/WordDuality.lean new file mode 100644 index 0000000000..166ddb4d93 --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/WordDuality.lean @@ -0,0 +1,451 @@ +/- +WordDuality . See WordDuality.md. Source: internal notes + +D = sigma . perp . time-reversal . transpose. +Model: charts `C` with an involution `perp` (dim (perp c) = N - dim c, perp z = V), registers `Reg`, a word = initial chart of every +register + a list of events (MOVE a->b, ADD, SCALE, COPY, INIT, CLEAR). Legality = co-presence + hub rules (no MOVE leaves V, +none enters z) + a move relation R (ascent / owned descent) closed under (a,b) -> (perp b, perp a). + Part 1 legal words go to legal words, boundaries swap (`dual_run`). + Part 2 matrices (ADD / SCALE / MOVE): M(D l) = sigma-relabel of (M l)^T (`Mrec_dual`). + Part 3 invoice: helper (b,e,steps) -> (N-e, N-b, reversed swapped steps); Theorem K invoice (FibreK) unchanged (`dualH_invoice`). + Part 4 P104 boundary data under sigma: X_p, Y_p exchange (`selfdual_boundary`); 2x2 contract blocks (`hosted_block`, `nonhosted_block`). + Part 5 caveat: COPY does not dualise to an ADD at matrix level (`copy_not_add`). +Kernel only. +-/ +import Nov15.FibreK +import Mathlib.Data.Matrix.Basis +import Mathlib.Data.Matrix.Mul + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace WordDuality +open FibreK CallerCost Matrix + +structure Charts (C : Type*) (N : ℕ) where + perp : C → C + perp_perp : ∀ c, perp (perp c) = c + dim : C → ℕ + dim_le : ∀ c, dim c ≤ N + dim_perp : ∀ c, dim (perp c) = N - dim c + z : C + V : C + perp_z : perp z = V + +namespace Charts +variable {C : Type*} {N : ℕ} (X : Charts C N) +theorem perp_V : X.perp X.V = X.z := by rw [← X.perp_z, X.perp_perp] +theorem ne_V_perp {a : C} (h : a ≠ X.V) : X.perp a ≠ X.z := by + intro h'; apply h; rw [← X.perp_perp a, h', X.perp_z] +theorem ne_z_perp {b : C} (h : b ≠ X.z) : X.perp b ≠ X.V := by + intro h'; apply h; rw [← X.perp_perp b, h', X.perp_V] +end Charts + +inductive Ev (K Reg C : Type*) + | move (i : Reg) (a b : C) + | add (i j : Reg) (q : K) (c : C) + | scale (i : Reg) (u : K) (c : C) + | copy (i j : Reg) (c : C) + | init (i : Reg) (c : C) + | clear (i : Reg) (c : C) + +variable {K Reg C : Type*} {N : ℕ} + +section Words +variable [DecidableEq Reg] + +def stepL (ℓ : Reg → C) : Ev K Reg C → (Reg → C) + | .move i _ b => Function.update ℓ i b + | _ => ℓ + +def runL (ℓ : Reg → C) : List (Ev K Reg C) → (Reg → C) + | [] => ℓ + | e :: es => runL (stepL ℓ e) es + +theorem runL_append (ℓ : Reg → C) (l1 l2 : List (Ev K Reg C)) : + runL ℓ (l1 ++ l2) = runL (runL ℓ l1) l2 := by + induction l1 generalizing ℓ with + | nil => rfl + | cons e es ih => simp [runL, ih] + +def LegalEv (X : Charts C N) (R : C → C → Prop) (ℓ : Reg → C) : Ev K Reg C → Prop + | .move i a b => ℓ i = a ∧ a ≠ X.V ∧ b ≠ X.z ∧ R a b + | .add i j _ c => i ≠ j ∧ ℓ i = c ∧ ℓ j = c + | .scale i _ c => ℓ i = c + | .copy i j c => i ≠ j ∧ ℓ i = c ∧ ℓ j = c + | .init i c => ℓ i = c + | .clear i c => ℓ i = c + +def LegalL (X : Charts C N) (R : C → C → Prop) : (Reg → C) → List (Ev K Reg C) → Prop + | _, [] => True + | ℓ, e :: es => LegalEv X R ℓ e ∧ LegalL X R (stepL ℓ e) es + +theorem LegalL_append (X : Charts C N) (R : C → C → Prop) (ℓ : Reg → C) (l1 l2 : List (Ev K Reg C)) : + LegalL X R ℓ (l1 ++ l2) ↔ LegalL X R ℓ l1 ∧ LegalL X R (runL ℓ l1) l2 := by + induction l1 generalizing ℓ with + | nil => simp [LegalL, runL] + | cons e es ih => simp [LegalL, runL, ih, and_assoc] + +variable [One K] + +/-- the dual of one event. COPY becomes ADD (valid on a clean target only; see `copy_not_add`). -/ +def dualEv (X : Charts C N) (σ : Reg ≃ Reg) : Ev K Reg C → Ev K Reg C + | .move i a b => .move (σ i) (X.perp b) (X.perp a) + | .add i j q c => .add (σ j) (σ i) q (X.perp c) + | .scale i u c => .scale (σ i) u (X.perp c) + | .copy i j c => .add (σ j) (σ i) 1 (X.perp c) + | .init i c => .clear (σ i) (X.perp c) + | .clear i c => .init (σ i) (X.perp c) + +/-- time reversal of the dualised events. -/ +def dualList (X : Charts C N) (σ : Reg ≃ Reg) (l : List (Ev K Reg C)) : List (Ev K Reg C) := + (l.map (dualEv X σ)).reverse + +theorem dualList_cons (X : Charts C N) (σ : Reg ≃ Reg) (e : Ev K Reg C) (l : List (Ev K Reg C)) : + dualList X σ (e :: l) = dualList X σ l ++ [dualEv X σ e] := by + simp [dualList] + +/-- PART 1. A legal word dualises to a legal word; the dual starts at perp of the final charts and ends at perp of the initial +charts (births and ends exchange). -/ +theorem dual_run (X : Charts C N) (R : C → C → Prop) (hR : ∀ a b, R a b → R (X.perp b) (X.perp a)) + (σ : Reg ≃ Reg) : + ∀ (l : List (Ev K Reg C)) (ℓ : Reg → C), LegalL X R ℓ l → + runL (fun r => X.perp (runL ℓ l (σ.symm r))) (dualList X σ l) = (fun r => X.perp (ℓ (σ.symm r))) ∧ + LegalL X R (fun r => X.perp (runL ℓ l (σ.symm r))) (dualList X σ l) := by + intro l + induction l with + | nil => intro ℓ _; exact ⟨rfl, trivial⟩ + | cons e es ih => + intro ℓ h + obtain ⟨he, hes⟩ := h + obtain ⟨A, B⟩ := ih (stepL ℓ e) hes + have hS : (fun r => X.perp (runL ℓ (e :: es) (σ.symm r))) = + (fun r => X.perp (runL (stepL ℓ e) es (σ.symm r))) := rfl + rw [hS, dualList_cons, runL_append, LegalL_append, A] + -- the last event + cases e with + | move i a b => + obtain ⟨h1, h2, h3, h4⟩ := he + subst h1 + refine ⟨?_, B, ?_⟩ + · simp only [runL, dualEv, stepL] + funext r + by_cases hr : r = σ i + · subst hr; simp + · have : σ.symm r ≠ i := by + intro h; apply hr; rw [← h]; simp + simp [Function.update_of_ne hr, Function.update_of_ne this] + · exact ⟨⟨by simp [stepL], X.ne_z_perp h3, X.ne_V_perp h2, hR _ _ h4⟩, trivial⟩ + | add i j q c => + obtain ⟨h1, h2, h3⟩ := he + refine ⟨?_, B, ?_⟩ + · simp [runL, dualEv, stepL] + · simp [LegalL, LegalEv, runL, dualEv, stepL, A, h2, h3] + exact fun h => h1 h.symm + | scale i u c => + refine ⟨?_, B, ?_⟩ + · simp [runL, dualEv, stepL] + · simp [LegalL, LegalEv, runL, dualEv, stepL, A]; simp [LegalEv] at he; simp [he] + | copy i j c => + obtain ⟨h1, h2, h3⟩ := he + refine ⟨?_, B, ?_⟩ + · simp [runL, dualEv, stepL] + · simp [LegalL, LegalEv, runL, dualEv, stepL, A, h2, h3] + exact fun h => h1 h.symm + | init i c => + refine ⟨?_, B, ?_⟩ + · simp [runL, dualEv, stepL] + · simp [LegalL, LegalEv, runL, dualEv, stepL, A]; simp [LegalEv] at he; simp [he] + | clear i c => + refine ⟨?_, B, ?_⟩ + · simp [runL, dualEv, stepL] + · simp [LegalL, LegalEv, runL, dualEv, stepL, A]; simp [LegalEv] at he; simp [he] + +/-- ascent and descent both survive: (a,b) ascending (dim a ≤ dim b) gives (perp b, perp a) ascending. -/ +theorem ascent_dual (X : Charts C N) : ∀ a b, X.dim a ≤ X.dim b → X.dim (X.perp b) ≤ X.dim (X.perp a) := by + intro a b h; rw [X.dim_perp, X.dim_perp]; have := X.dim_le a; have := X.dim_le b; omega + +theorem descent_dual (X : Charts C N) : ∀ a b, X.dim b ≤ X.dim a → X.dim (X.perp b) ≥ X.dim (X.perp a) := by + intro a b h; rw [X.dim_perp, X.dim_perp]; have := X.dim_le a; have := X.dim_le b; omega + +/-! ### words, boundaries -/ + +structure Word (K Reg C : Type*) where + init0 : Reg → C + evs : List (Ev K Reg C) + +def Word.fin (w : Word K Reg C) : Reg → C := runL w.init0 w.evs + +def dualWord (X : Charts C N) (σ : Reg ≃ Reg) (w : Word K Reg C) : Word K Reg C := + ⟨fun r => X.perp (w.fin (σ.symm r)), dualList X σ w.evs⟩ + +theorem dual_legal (X : Charts C N) (R : C → C → Prop) (hR : ∀ a b, R a b → R (X.perp b) (X.perp a)) + (σ : Reg ≃ Reg) (w : Word K Reg C) (h : LegalL X R w.init0 w.evs) : + LegalL X R (dualWord X σ w).init0 (dualWord X σ w).evs := (dual_run X R hR σ w.evs w.init0 h).2 + +/-- births of the dual are perp of the ends; ends of the dual are perp of the births. -/ +theorem dual_boundary (X : Charts C N) (R : C → C → Prop) (hR : ∀ a b, R a b → R (X.perp b) (X.perp a)) + (σ : Reg ≃ Reg) (w : Word K Reg C) (h : LegalL X R w.init0 w.evs) (r : Reg) : + (dualWord X σ w).init0 (σ r) = X.perp (w.fin r) ∧ (dualWord X σ w).fin (σ r) = X.perp (w.init0 r) := by + constructor + · simp [dualWord] + · have := congrFun (dual_run X R hR σ w.evs w.init0 h).1 (σ r) + simpa [Word.fin, dualWord] using this + +theorem dual_dim_boundary (X : Charts C N) (R : C → C → Prop) (hR : ∀ a b, R a b → R (X.perp b) (X.perp a)) + (σ : Reg ≃ Reg) (w : Word K Reg C) (h : LegalL X R w.init0 w.evs) (r : Reg) : + X.dim ((dualWord X σ w).init0 (σ r)) = N - X.dim (w.fin r) ∧ + X.dim ((dualWord X σ w).fin (σ r)) = N - X.dim (w.init0 r) := by + obtain ⟨a, b⟩ := dual_boundary X R hR σ w h r + rw [a, b, X.dim_perp, X.dim_perp]; exact ⟨rfl, rfl⟩ + +end Words + +/-! ### Part 2: matrices -/ +section Mat +variable [Fintype Reg] [DecidableEq Reg] [CommRing K] + +def evMat : Ev K Reg C → Matrix Reg Reg K + | .add i j q _ => 1 + Matrix.single i j q + | .scale i u _ => Matrix.diagonal (Function.update (1 : Reg → K) i u) + | _ => 1 + +/-- events with a matrix semantics (MOVE only changes location). -/ +def Lin : Ev K Reg C → Prop + | .move .. => True + | .add .. => True + | .scale .. => True + | _ => False + +/-- total matrix of a word in initial-row coordinates: later events multiply on the left. -/ +def Mrec : List (Ev K Reg C) → Matrix Reg Reg K + | [] => 1 + | e :: es => Mrec es * evMat e + +theorem Mrec_append (l1 l2 : List (Ev K Reg C)) : Mrec (l1 ++ l2) = Mrec l2 * Mrec l1 := by + induction l1 with + | nil => simp [Mrec] + | cons e es ih => simp [Mrec, ih, Matrix.mul_assoc] + +theorem evMat_dual (X : Charts C N) (σ : Reg ≃ Reg) (e : Ev K Reg C) (he : Lin e) : + evMat (dualEv X σ e) = (evMat e)ᵀ.submatrix σ.symm σ.symm := by + cases e with + | move i a b => simp [evMat, dualEv] + | add i j q c => + ext a b + simp [evMat, dualEv, Matrix.single_apply, Matrix.one_apply, Matrix.transpose_apply, Matrix.submatrix_apply, Equiv.eq_symm_apply] + | scale i u c => + ext a b + simp [evMat, dualEv, Matrix.diagonal_apply, Function.update_apply, Equiv.symm_apply_eq] + | copy _ _ _ => exact absurd he (by simp [Lin]) + | init _ _ => exact absurd he (by simp [Lin]) + | clear _ _ => exact absurd he (by simp [Lin]) + +/-- PART 2. M(D l) is the sigma-relabel of the transpose of M(l). -/ +theorem Mrec_dual (X : Charts C N) (σ : Reg ≃ Reg) : + ∀ l : List (Ev K Reg C), (∀ e ∈ l, Lin e) → Mrec (dualList X σ l) = (Mrec l)ᵀ.submatrix σ.symm σ.symm := by + intro l + induction l with + | nil => intro _; simp [dualList, Mrec] + | cons e es ih => + intro h + have he := h e (by simp) + have hes := ih (fun x hx => h x (by simp [hx])) + rw [dualList_cons, Mrec_append, hes] + simp only [Mrec, Matrix.one_mul, Matrix.transpose_mul] + rw [evMat_dual X σ e he, Matrix.submatrix_mul_equiv] + +end Mat + +/-! ### Part 3: the Theorem-K invoice is unchanged -/ +section Invoice +variable [DecidableEq Reg] + +/-- the MOVE steps (source dim, target dim) of register `r`. -/ +def regSteps (X : Charts C N) (r : Reg) (l : List (Ev K Reg C)) : List (ℕ × ℕ) := + l.filterMap fun e => match e with + | .move i a b => if i = r then some (X.dim a, X.dim b) else none + | _ => none + +def swapN (N : ℕ) (s : ℕ × ℕ) : ℕ × ℕ := (N - s.2, N - s.1) + +/-- register `r` as a FibreK helper: birth dim, end dim, steps. -/ +def helperOf (X : Charts C N) (w : Word K Reg C) (r : Reg) : Helper := + ⟨X.dim (w.init0 r), X.dim (w.fin r), regSteps X r w.evs⟩ + +/-- a helper b -> e becomes (N-e) -> (N-b), with reversed swapped steps. -/ +def dualH (N : ℕ) (h : Helper) : Helper := ⟨N - h.e, N - h.b, (h.steps.map (swapN N)).reverse⟩ + +variable [One K] + +theorem regSteps_dual (X : Charts C N) (σ : Reg ≃ Reg) (r : Reg) : + ∀ l : List (Ev K Reg C), regSteps X (σ r) (dualList X σ l) = ((regSteps X r l).map (swapN N)).reverse := by + intro l + induction l with + | nil => simp [dualList, regSteps] + | cons e es ih => + rw [dualList_cons] + have : regSteps X (σ r) (dualList X σ es ++ [dualEv X σ e]) = + regSteps X (σ r) (dualList X σ es) ++ regSteps X (σ r) [dualEv X σ e] := by + simp [regSteps, List.filterMap_append] + rw [this, ih] + cases e with + | move i a b => + by_cases h : i = r + · subst h; simp [regSteps, dualEv, swapN, X.dim_perp] + · simp [regSteps, dualEv, h] + | add i j q c => simp [regSteps, dualEv] + | scale i u c => simp [regSteps, dualEv] + | copy i j c => simp [regSteps, dualEv] + | init i c => simp [regSteps, dualEv] + | clear i c => simp [regSteps, dualEv] + +/-- PART 3a. The dual word's register `sigma r` is the dual helper of `r` (b,e) -> (N-e, N-b). -/ +theorem helperOf_dual (X : Charts C N) (R : C → C → Prop) (hR : ∀ a b, R a b → R (X.perp b) (X.perp a)) + (σ : Reg ≃ Reg) (w : Word K Reg C) (h : LegalL X R w.init0 w.evs) (r : Reg) : + helperOf X (dualWord X σ w) (σ r) = dualH N (helperOf X w r) := by + obtain ⟨b1, b2⟩ := dual_dim_boundary X R hR σ w h r + simp only [helperOf, dualH, dualWord, b1, b2] + simp only [dualWord] at b1 b2 + rw [b1, b2] + simp [regSteps_dual X σ r] + +theorem gap_swapN (N : ℕ) (s : ℕ × ℕ) (h1 : s.1 ≤ N) (h2 : s.2 ≤ N) : gap (swapN N s) = gap s := by + simp only [gap, swapN]; omega + +/-- PART 3b. Dualising a helper list leaves FibreK's invoice (Theorem K) unchanged: +births/ends (b,e) -> (N-e,N-b) keep the climb, every MOVE keeps its |Δdim|. -/ +theorem dualH_invoice (E : Inv) (tb : Table) (H : List Helper) + (hN : ∀ h ∈ H, h.b ≤ h.e ∧ h.e ≤ N ∧ ∀ s ∈ h.steps, s.1 ≤ N ∧ s.2 ≤ N) (t : ℝ) : + Fi (nativeInv E tb (H.map (dualH N))) t = Fi (nativeInv E tb H) t := by + rw [K_word, K_word] + unfold FK + have hP : PiW (H.map (dualH N)) = PiW H := by + unfold PiW + congr 1 + rw [List.map_map] + apply List.map_congr_left + intro h hh + obtain ⟨a, b, _⟩ := hN h hh + simp only [Function.comp, dualH]; omega + have hS : (((Ssum (H.map (dualH N))).map fun s => Fh (tb.tP (gap s)) t).sum) = + ((Ssum H).map fun s => Fh (tb.tP (gap s)) t).sum := by + simp only [Ssum, Multiset.map_coe, Multiset.sum_coe] + rw [sum_flatMap_map, sum_flatMap_map, List.map_map] + congr 1 + apply List.map_congr_left + intro h hh + obtain ⟨_, _, c⟩ := hN h hh + simp only [Function.comp, dualH, List.map_reverse, List.sum_reverse, List.map_map] + congr 1 + apply List.map_congr_left + intro s hs + obtain ⟨c1, c2⟩ := c s hs + simp only [Function.comp, gap_swapN N s c1 c2] + rw [hP, hS] + +theorem dualH_root (c E : Inv) (tb : Table) (H : List Helper) (L : ℕ) + (hN : ∀ h ∈ H, h.b ≤ h.e ∧ h.e ≤ N ∧ ∀ s ∈ h.steps, s.1 ≤ N ∧ s.2 ≤ N) (κ : ℝ) : + IsRoot (Fi (invoice c (nativeInv E tb (H.map (dualH N))) L)) κ ↔ + IsRoot (Fi (invoice c (nativeInv E tb H) L)) κ := by + unfold IsRoot + rw [Fi_invoice, Fi_invoice, dualH_invoice E tb H hN κ] + +/-- PART 3c, word level: the helpers of `D w` (registers `sigma r`) have the same invoice as those of `w`. +Hypothesis: the listed registers climb (birth dim <= end dim), as helpers do. -/ +theorem word_invoice (X : Charts C N) (R : C → C → Prop) (hR : ∀ a b, R a b → R (X.perp b) (X.perp a)) + (σ : Reg ≃ Reg) (w : Word K Reg C) (h : LegalL X R w.init0 w.evs) (rs : List Reg) + (hc : ∀ r ∈ rs, X.dim (w.init0 r) ≤ X.dim (w.fin r)) (E : Inv) (tb : Table) (t : ℝ) : + Fi (nativeInv E tb ((rs.map σ).map (helperOf X (dualWord X σ w)))) t = + Fi (nativeInv E tb (rs.map (helperOf X w))) t := by + have : (rs.map σ).map (helperOf X (dualWord X σ w)) = (rs.map (helperOf X w)).map (dualH N) := by + rw [List.map_map, List.map_map] + apply List.map_congr_left + intro r _ + exact helperOf_dual X R hR σ w h r + rw [this] + apply dualH_invoice + intro h' hh' + obtain ⟨r, hr, rfl⟩ := List.mem_map.mp hh' + refine ⟨hc r hr, X.dim_le _, ?_⟩ + intro s hs + simp only [helperOf, regSteps, List.mem_filterMap] at hs + obtain ⟨e, _, he⟩ := hs + cases e <;> simp at he + obtain ⟨_, rfl⟩ := he + exact ⟨X.dim_le _, X.dim_le _⟩ + +end Invoice + +/-! ### Part 4: P104 boundary data -/ +section P104 +variable [DecidableEq Reg] [One K] {ι : Type*} + +/-- hypotheses (from DU1 section 1): X_p runs

-> V, Y_p runs {0} -> p^perp, sigma swaps X_p, Y_p, perp

= p^perp. +The dual word has the same register boundaries (g = id): the problem is self-dual. -/ +theorem selfdual_boundary (X : Charts C N) (R : C → C → Prop) (hR : ∀ a b, R a b → R (X.perp b) (X.perp a)) + (σ : Reg ≃ Reg) (w : Word K Reg C) (h : LegalL X R w.init0 w.evs) + (Xr Yr : ι → Reg) (line hyp : ι → C) + (hσX : ∀ p, σ (Xr p) = Yr p) (hσY : ∀ p, σ (Yr p) = Xr p) (hperp : ∀ p, X.perp (line p) = hyp p) + (hX : ∀ p, w.init0 (Xr p) = line p ∧ w.fin (Xr p) = X.V) + (hY : ∀ p, w.init0 (Yr p) = X.z ∧ w.fin (Yr p) = hyp p) (p : ι) : + ((dualWord X σ w).init0 (Xr p) = line p ∧ (dualWord X σ w).fin (Xr p) = X.V) ∧ + ((dualWord X σ w).init0 (Yr p) = X.z ∧ (dualWord X σ w).fin (Yr p) = hyp p) := by + have hl : ∀ p, X.perp (hyp p) = line p := fun p => by rw [← hperp, X.perp_perp] + obtain ⟨a1, a2⟩ := dual_boundary X R hR σ w h (Yr p) + obtain ⟨b1, b2⟩ := dual_boundary X R hR σ w h (Xr p) + rw [hσY] at a1 a2 + rw [hσX] at b1 b2 + refine ⟨⟨?_, ?_⟩, ⟨?_, ?_⟩⟩ + · rw [a1, (hY p).2, hl] + · rw [a2, (hY p).1, X.perp_z] + · rw [b1, (hX p).2, X.perp_V] + · rw [b2, (hX p).1, hperp] + +end P104 + +/-! ### contract blocks (from DU1.md; the non-hosted block is reconstructed from the card's dual [[1/2,-1],[1/2,1]]) -/ +section Blocks +def sw : Equiv.Perm (Fin 2) := Equiv.swap 0 1 + +/-- hosted block [[1,0],[1,1]] is invariant under transpose + sigma. -/ +theorem hosted_block : + (!![1, 0; 1, 1] : Matrix (Fin 2) (Fin 2) ℚ)ᵀ.submatrix sw.symm sw.symm = !![1, 0; 1, 1] := by + ext i j; fin_cases i <;> fin_cases j <;> simp [sw, Equiv.swap_apply_def] + +/-- non-hosted block F = [[1,-1],[1/2,1/2]]: D(F) = [[1/2,-1],[1/2,1]] and diag(1,1/2) D(F) diag(2,1) = F +(one SCALE 2 and one SCALE 1/2, unpriced). -/ +theorem nonhosted_block : + (!![1, -1; 1/2, 1/2] : Matrix (Fin 2) (Fin 2) ℚ)ᵀ.submatrix sw.symm sw.symm = !![1/2, -1; 1/2, 1] ∧ + Matrix.diagonal ![1, 1/2] * (!![1/2, -1; 1/2, 1] : Matrix (Fin 2) (Fin 2) ℚ) * Matrix.diagonal ![2, 1] = + !![1, -1; 1/2, 1/2] := by + constructor + · ext i j; fin_cases i <;> fin_cases j <;> simp [sw, Equiv.swap_apply_def] + · ext i j; fin_cases i <;> fin_cases j <;> simp [Matrix.mul_apply, Fin.sum_univ_two] <;> norm_num + +end Blocks + +/-! ### Part 5: caveat, COPY does not dualise to an ADD at matrix level -/ +section Caveat +/-- COPY 0 <- 1 on two registers has matrix [[0,1],[0,1]]; its transpose is [[0,0],[1,1]], which is not an ADD matrix +1 + q e_ab (a != b: every ADD matrix has diagonal 1). DU1's "COPY becomes ADD" holds only for a clean target. -/ +theorem copy_not_add (a b : Fin 2) (hab : a ≠ b) (q : ℚ) : + (!![0, 1; 0, 1] : Matrix (Fin 2) (Fin 2) ℚ)ᵀ ≠ 1 + Matrix.single a b q := by + intro h + have := congrFun (congrFun h 0) 0 + simp [Matrix.single_apply] at this + by_cases h0 : a = 0 ∧ b = 0 + · exact hab (h0.1.trans h0.2.symm) + · simp [h0] at this + +end Caveat + +end WordDuality + +#print axioms WordDuality.dual_run +#print axioms WordDuality.Mrec_dual +#print axioms WordDuality.dualH_invoice +#print axioms WordDuality.word_invoice +#print axioms WordDuality.selfdual_boundary +#print axioms WordDuality.nonhosted_block +#print axioms WordDuality.copy_not_add diff --git a/research/p104-tree-ceiling/lean/Nov15/WordDuality.md b/research/p104-tree-ceiling/lean/Nov15/WordDuality.md new file mode 100644 index 0000000000..4459df8d1c --- /dev/null +++ b/research/p104-tree-ceiling/lean/Nov15/WordDuality.md @@ -0,0 +1,12 @@ +# WordDuality : DU1's D = sigma . perp . reversal . transpose in Lean + +`Nov15/WordDuality.lean`, kernel only: no `sorry`, no `native_decide`; axioms within `[propext, Classical.choice, Quot.sound]`. Builds in 11 s / 2.9 GB. Reuses `FibreK` (Table, Helper, nativeInv, K_word, FK) and `CallerCost`. +Model (problem data as hypotheses): `Charts C N` = charts with an involution `perp`, `dim (perp c) = N - dim c`, hubs z, V, `perp z = V` (P104: N = 9). Registers `Reg`, a word = initial chart of each register + a list of events (MOVE a→b, ADD, SCALE, COPY, INIT, CLEAR). Legal = co-presence at the event chart, no MOVE leaves V, none enters z (T1), and a move relation R (public ascent / owned descent) with R a b → R (perp b) (perp a). +1. `dual_run`, `dual_legal`: if w is legal then D w (events reversed, MOVE a→b ↦ perp b→perp a, ADD r += q s @U ↦ ADD s += q r @U^perp, SCALE kept, INIT ↔ CLEAR, COPY ↦ ADD) is legal, starts at perp of w's final charts and ends at perp of w's initial charts (`dual_boundary`; dims: `dual_dim_boundary`). Hub rules swap (z ↔ V), ascent stays ascent (`ascent_dual`) and descent stays descent (`descent_dual`). +2. `Mrec_dual`: for words of MOVE/ADD/SCALE, the product matrix of D l is the σ-relabelled transpose of that of l (K a commutative ring). +3. Invoice: `helperOf_dual`: register σ r of D w is the dual helper (b,e,steps) ↦ (N−e, N−b, reversed swapped steps) of r. `dualH_invoice`: FibreK's Theorem-K invoice Fi(nativeInv E tb H) is unchanged (hypotheses b ≤ e ≤ N, step dims ≤ N), `dualH_root`: same roots of the caller invoice (κ-neutral), `word_invoice` at word level (listed registers climb). Births/ends (b,e) ↦ (N−e,N−b), climb e−b and every MOVE |Δdim| preserved. +4. `selfdual_boundary`: with σ swapping X_p ↔ Y_p, X_p: ⟨p⟩ → V, Y_p: {0} → p^perp, perp ⟨p⟩ = p^perp: D w has exactly the same register boundaries (g = id). `hosted_block`: [[1,0],[1,1]] is invariant under transpose + swap; `nonhosted_block`: with F = [[1,−1],[1/2,1/2]] (reconstructed from DU1's dual [[1/2,−1],[1/2,1]]), D(F) = [[1/2,−1],[1/2,1]] and diag(1,1/2)·D(F)·diag(2,1) = F. + +## Correction to DU1 wording (stated at once) +DU1: "COPY becomes ADD". As matrices this is false: `copy_not_add` (COPY 0←1 has matrix [[0,1],[0,1]], whose transpose [[0,0],[1,1]] is not 1 + q·e_ab for any a ≠ b, ADD matrices have diagonal 1). The dual of a COPY is an ADD only on a clean target (the usual INIT-then-COPY use) and must carry the dual of the target's INIT (a CLEAR). `dualEv` sends COPY ↦ ADD for legality only; matrix semantics (`Mrec_dual`) is restricted to MOVE/ADD/SCALE. +Not formalised: the P104 chart/physical check (DU1 caveat 2), the 271 missing perp frames, and the palindromic construction W = D(A).A. diff --git a/research/p104-tree-ceiling/lean/lake-manifest.json b/research/p104-tree-ceiling/lean/lake-manifest.json new file mode 100644 index 0000000000..e4290db056 --- /dev/null +++ b/research/p104-tree-ceiling/lean/lake-manifest.json @@ -0,0 +1,117 @@ +{ + "version": "1.2.0", + "packagesDir": ".lake/packages", + "packages": [ + { + "url": "https://github.com/leanprover-community/mathlib4.git", + "type": "git", + "subDir": null, + "scope": "", + "rev": "55b7917b472489c7c56a0fa6393af05cfd536599", + "name": "mathlib", + "manifestFile": "lake-manifest.json", + "inputRev": "55b7917b472489c7c56a0fa6393af05cfd536599", + "inherited": false, + "configFile": "lakefile.lean" + }, + { + "url": "https://github.com/leanprover-community/plausible", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "b1c4a69a7e247ab7df20460212001673d74f08c0", + "name": "plausible", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/LeanSearchClient", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "0498c7c070c143a3bf7379f4d99a2c63bb9d9715", + "name": "LeanSearchClient", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/import-graph", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "18a90119a5d316358fde6c86e0ca24e59212e32c", + "name": "importGraph", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/ProofWidgets4", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "b1436dc749e722c9920036b52cdc43b3451d0b69", + "name": "proofwidgets", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.lean" + }, + { + "url": "https://github.com/leanprover-community/aesop", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "57d3325be72a842920813bcb40f96a6f7393c185", + "name": "aesop", + "manifestFile": "lake-manifest.json", + "inputRev": "master", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/quote4", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "ee41917ae11d38479fb8fb24745f7ca4bf0a784d", + "name": "Qq", + "manifestFile": "lake-manifest.json", + "inputRev": "master", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/batteries", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "2c810760f0a0c4536b397dbe30ca9b2f2f467366", + "name": "batteries", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover/lean4-cli", + "type": "git", + "subDir": null, + "scope": "leanprover", + "rev": "da07ca808b6718cb2aed14dba154e5a08b8f8ecf", + "name": "Cli", + "manifestFile": "lake-manifest.json", + "inputRev": "v4.33.0-rc1", + "inherited": true, + "configFile": "lakefile.toml" + } + ], + "name": "Nov16Core", + "lakeDir": ".lake", + "fixedToolchain": false +} diff --git a/research/p104-tree-ceiling/lean/lakefile.toml b/research/p104-tree-ceiling/lean/lakefile.toml new file mode 100644 index 0000000000..a5692331ac --- /dev/null +++ b/research/p104-tree-ceiling/lean/lakefile.toml @@ -0,0 +1,12 @@ +name = "NativeCeiling" +defaultTargets = ["Nov15"] + +[[require]] +name = "mathlib" +git = "https://github.com/leanprover-community/mathlib4.git" +# pinned to the exact commit used for every check in this package (same as lake-manifest.json) +rev = "55b7917b472489c7c56a0fa6393af05cfd536599" + +[[lean_lib]] +name = "Nov15" +globs = ["Nov15.+"] diff --git a/research/p104-tree-ceiling/lean/lean-toolchain b/research/p104-tree-ceiling/lean/lean-toolchain new file mode 100644 index 0000000000..fd85b262bf --- /dev/null +++ b/research/p104-tree-ceiling/lean/lean-toolchain @@ -0,0 +1 @@ +leanprover/lean4:v4.33.0-rc1