From d9db97d5075fa6dd28002f54fd139f94f98935e8 Mon Sep 17 00:00:00 2001 From: DreamingOfClouds <173691639+DreamingOfClouds@users.noreply.github.com> Date: Tue, 17 Nov 2026 17:52:17 -0600 Subject: [PATCH 1/2] =?UTF-8?q?P104=20Lean=20package=203=20(combined):=20c?= =?UTF-8?q?eilings,=20word=20structure,=20duality,=20spec-break=20lemmas?= =?UTF-8?q?=20(no=20=CE=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kernel-only Lean (propext, Classical.choice, Quot.sound; no sorry, no native_decide) with named hypotheses. DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. Co-Authored-By: Claude Opus 5.5 --- research/p104-lean-premises/.gitignore | 1 + research/p104-lean-premises/CHECK.txt | 194 + research/p104-lean-premises/FALSE.md | 38 + research/p104-lean-premises/LICENSE | 201 + research/p104-lean-premises/NOTICE.md | 5 + research/p104-lean-premises/PREMISES.md | 52 + research/p104-lean-premises/PROVED.md | 135 + research/p104-lean-premises/PR_BODY.md | 24 + research/p104-lean-premises/README.md | 56 + research/p104-lean-premises/SHIPPED.txt | 15 + .../lean/Nov15/Annihilator.lean | 271 + .../lean/Nov15/Annihilator.md | 30 + .../lean/Nov15/BFormOpt.lean | 664 + .../p104-lean-premises/lean/Nov15/BFormOpt.md | 25 + .../lean/Nov15/CallerBorrow.lean | 1112 + .../lean/Nov15/CallerBorrow.md | 20 + .../lean/Nov15/CallerCost.lean | 279 + .../lean/Nov15/CallerCost.md | 18 + .../lean/Nov15/CensusComplete.lean | 182 + .../lean/Nov15/CensusComplete.md | 34 + .../lean/Nov15/CensusData.lean | 23 + .../lean/Nov15/ClearCert.lean | 455 + .../lean/Nov15/ClearCert.md | 20 + .../lean/Nov15/CongestionI3.lean | 377 + .../lean/Nov15/CongestionI3.md | 21 + .../lean/Nov15/CongestionI3Cfg.lean | 73 + .../lean/Nov15/CongestionI3Data.lean | 26 + .../lean/Nov15/CongestionI3Mu.lean | 10 + .../lean/Nov15/CongestionI3NumA.lean | 47 + .../lean/Nov15/CongestionI3NumC1.lean | 23 + .../lean/Nov15/CongestionI3NumC2.lean | 13 + .../lean/Nov15/CongestionI3NumC3.lean | 17 + .../lean/Nov15/CongestionI3NumC4.lean | 59 + .../lean/Nov15/Delivery.lean | 319 + .../p104-lean-premises/lean/Nov15/Delivery.md | 20 + .../lean/Nov15/DescentPrice.lean | 113 + .../lean/Nov15/DescentPrice.md | 18 + .../lean/Nov15/DesignLaws.lean | 436 + .../lean/Nov15/DesignLaws.md | 12 + .../lean/Nov15/ExportLaw.lean | 702 + .../p104-lean-premises/lean/Nov15/FibreK.lean | 537 + .../p104-lean-premises/lean/Nov15/FibreK.md | 51 + .../p104-lean-premises/lean/Nov15/Floor.lean | 385 + .../lean/Nov15/FloorCert.lean | 154 + .../lean/Nov15/FloorCert.md | 65 + .../lean/Nov15/FloorCertCheck.lean | 27 + .../lean/Nov15/FloorCertData.lean | 18948 ++++++++++++++++ .../lean/Nov15/FloorCertDefs.lean | 30 + .../lean/Nov15/FloorD0.lean | 445 + .../p104-lean-premises/lean/Nov15/FloorD0.md | 47 + .../lean/Nov15/FloorEndToEnd.lean | 1619 ++ .../lean/Nov15/FloorGlue.lean | 231 + .../lean/Nov15/FloorK22.lean | 337 + .../p104-lean-premises/lean/Nov15/FloorK22.md | 23 + .../lean/Nov15/FloorK22Data.lean | 44 + .../lean/Nov15/FrameSep.lean | 165 + .../p104-lean-premises/lean/Nov15/FrameSep.md | 13 + .../lean/Nov15/HubSettle.lean | 351 + .../lean/Nov15/HubSettle.md | 42 + .../lean/Nov15/JointCeiling.lean | 809 + .../lean/Nov15/JointCeiling.md | 21 + .../lean/Nov15/JunkLB2.lean | 1188 + .../p104-lean-premises/lean/Nov15/JunkLB2.md | 60 + .../p104-lean-premises/lean/Nov15/LemmaW.lean | 145 + .../p104-lean-premises/lean/Nov15/LemmaW.md | 13 + .../lean/Nov15/NativeColumns.lean | 172 + .../lean/Nov15/NativeColumns.md | 46 + .../lean/Nov15/NumCertK.lean | 382 + .../p104-lean-premises/lean/Nov15/NumCertK.md | 17 + .../lean/Nov15/NumCertK22.lean | 47 + .../lean/Nov15/NumCertKData.lean | 50 + .../lean/Nov15/OwnedAscent.lean | 281 + .../lean/Nov15/OwnedAscent.md | 24 + .../lean/Nov15/OwnedSkeleton.lean | 173 + .../lean/Nov15/OwnedSkeleton.md | 27 + .../lean/Nov15/OwnedSkeletonData.lean | 453 + .../lean/Nov15/OwnedTree.lean | 239 + .../lean/Nov15/OwnedTree.md | 26 + .../lean/Nov15/OwnedTreeCheck.lean | 35 + .../lean/Nov15/OwnedTreeData.lean | 297 + .../lean/Nov15/PadLift.lean | 228 + .../p104-lean-premises/lean/Nov15/PadLift.md | 15 + .../lean/Nov15/PlaneLaws.lean | 270 + .../lean/Nov15/PlaneLaws.md | 22 + .../p104-lean-premises/lean/Nov15/PsiLaw.lean | 373 + .../p104-lean-premises/lean/Nov15/PsiLaw.md | 18 + .../lean/Nov15/RankLaw.lean | 597 + .../p104-lean-premises/lean/Nov15/RankLaw.md | 48 + .../lean/Nov15/RankLawC.lean | 167 + .../p104-lean-premises/lean/Nov15/RankLawC.md | 30 + .../lean/Nov15/RelaySandwich.lean | 157 + .../p104-lean-premises/lean/Nov15/Shadow.lean | 222 + .../p104-lean-premises/lean/Nov15/Shadow.md | 38 + .../lean/Nov15/SharedCourier.lean | 493 + .../lean/Nov15/SharedCourier.md | 28 + .../lean/Nov15/SmallRoots.lean | 130 + .../lean/Nov15/SmallRoots.md | 17 + .../lean/Nov15/SmallRootsA22Corners.lean | 25 + .../lean/Nov15/SmallRootsData.lean | 32 + .../lean/Nov15/SmallRootsDefs.lean | 92 + .../p104-lean-premises/lean/Nov15/Spec0K0.md | 5 + .../lean/Nov15/Spec0K0Core.lean | 80 + .../lean/Nov15/Spec0K0_ABCEDF_s0.lean | 202 + .../lean/Nov15/Spec0K0_ABCEDF_s1.lean | 162 + .../lean/Nov15/Spec0K0_ABCEDF_s2.lean | 208 + .../lean/Nov15/Spec0K0_ABCEDF_s3.lean | 192 + .../lean/Nov15/Spec0K0_ABCEDF_s4.lean | 162 + .../lean/Nov15/Spec0K0_ABCEDF_s5.lean | 224 + .../lean/Nov15/Spec0K0_ABCEDF_s6.lean | 84 + .../lean/Nov15/Spec0Sym.lean | 401 + .../p104-lean-premises/lean/Nov15/Spec0Sym.md | 8 + .../p104-lean-premises/lean/Nov15/Spec6.lean | 726 + .../p104-lean-premises/lean/Nov15/Spec6.md | 26 + .../p104-lean-premises/lean/Nov15/SpecGC.lean | 893 + .../p104-lean-premises/lean/Nov15/SpecGC.md | 18 + .../lean/Nov15/SpecINV.lean | 925 + .../p104-lean-premises/lean/Nov15/SpecINV.md | 24 + .../lean/Nov15/SpecLemmaU.lean | 470 + .../lean/Nov15/SpecLemmaU.md | 17 + .../lean/Nov15/SpecLemmaU2.lean | 841 + .../lean/Nov15/SpecLemmaU2.md | 15 + .../lean/Nov15/SpecRankP.lean | 239 + .../lean/Nov15/SpecRankP.md | 12 + .../lean/Nov15/SpecRankP2.lean | 273 + .../lean/Nov15/SpecRankP2.md | 13 + .../p104-lean-premises/lean/Nov15/SpecTS.lean | 299 + .../p104-lean-premises/lean/Nov15/SpecTS.md | 17 + .../lean/Nov15/SpecTSUR.lean | 585 + .../p104-lean-premises/lean/Nov15/SpecTSUR.md | 19 + .../lean/Nov15/SwapNull.lean | 732 + .../p104-lean-premises/lean/Nov15/SwapNull.md | 24 + .../lean/Nov15/SwapWord.lean | 181 + .../lean/Nov15/TokenCancel.lean | 452 + .../lean/Nov15/WholeFloor.md | 29 + .../lean/Nov15/WholeFloorCover.lean | 24 + .../lean/Nov15/WholeFloorCoverData.lean | 47 + .../lean/Nov15/WholeFloorCoverData1.lean | 23 + .../lean/Nov15/WholeFloorEnd.lean | 44 + .../lean/Nov15/WholeFloorLogs.lean | 257 + .../lean/Nov15/WholeFloorModel.lean | 406 + .../lean/Nov15/WholeFloorNest.lean | 192 + .../lean/Nov15/WholeFloorPrice.lean | 226 + .../lean/Nov15/WholeFloorSlack.lean | 228 + .../lean/Nov15/WordDuality.lean | 451 + .../lean/Nov15/WordDuality.md | 12 + .../lean/lake-manifest.json | 117 + .../p104-lean-premises/lean/lakefile.toml | 12 + .../p104-lean-premises/lean/lean-toolchain | 1 + 148 files changed, 47759 insertions(+) create mode 100644 research/p104-lean-premises/.gitignore create mode 100644 research/p104-lean-premises/CHECK.txt create mode 100644 research/p104-lean-premises/FALSE.md create mode 100644 research/p104-lean-premises/LICENSE create mode 100644 research/p104-lean-premises/NOTICE.md create mode 100644 research/p104-lean-premises/PREMISES.md create mode 100644 research/p104-lean-premises/PROVED.md create mode 100644 research/p104-lean-premises/PR_BODY.md create mode 100644 research/p104-lean-premises/README.md create mode 100644 research/p104-lean-premises/SHIPPED.txt create mode 100644 research/p104-lean-premises/lean/Nov15/Annihilator.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Annihilator.md create mode 100644 research/p104-lean-premises/lean/Nov15/BFormOpt.lean create mode 100644 research/p104-lean-premises/lean/Nov15/BFormOpt.md create mode 100644 research/p104-lean-premises/lean/Nov15/CallerBorrow.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CallerBorrow.md create mode 100644 research/p104-lean-premises/lean/Nov15/CallerCost.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CallerCost.md create mode 100644 research/p104-lean-premises/lean/Nov15/CensusComplete.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CensusComplete.md create mode 100644 research/p104-lean-premises/lean/Nov15/CensusData.lean create mode 100644 research/p104-lean-premises/lean/Nov15/ClearCert.lean create mode 100644 research/p104-lean-premises/lean/Nov15/ClearCert.md create mode 100644 research/p104-lean-premises/lean/Nov15/CongestionI3.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CongestionI3.md create mode 100644 research/p104-lean-premises/lean/Nov15/CongestionI3Cfg.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CongestionI3Data.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CongestionI3Mu.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CongestionI3NumA.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CongestionI3NumC1.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CongestionI3NumC2.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CongestionI3NumC3.lean create mode 100644 research/p104-lean-premises/lean/Nov15/CongestionI3NumC4.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Delivery.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Delivery.md create mode 100644 research/p104-lean-premises/lean/Nov15/DescentPrice.lean create mode 100644 research/p104-lean-premises/lean/Nov15/DescentPrice.md create mode 100644 research/p104-lean-premises/lean/Nov15/DesignLaws.lean create mode 100644 research/p104-lean-premises/lean/Nov15/DesignLaws.md create mode 100644 research/p104-lean-premises/lean/Nov15/ExportLaw.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FibreK.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FibreK.md create mode 100644 research/p104-lean-premises/lean/Nov15/Floor.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FloorCert.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FloorCert.md create mode 100644 research/p104-lean-premises/lean/Nov15/FloorCertCheck.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FloorCertData.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FloorCertDefs.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FloorD0.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FloorD0.md create mode 100644 research/p104-lean-premises/lean/Nov15/FloorEndToEnd.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FloorGlue.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FloorK22.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FloorK22.md create mode 100644 research/p104-lean-premises/lean/Nov15/FloorK22Data.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FrameSep.lean create mode 100644 research/p104-lean-premises/lean/Nov15/FrameSep.md create mode 100644 research/p104-lean-premises/lean/Nov15/HubSettle.lean create mode 100644 research/p104-lean-premises/lean/Nov15/HubSettle.md create mode 100644 research/p104-lean-premises/lean/Nov15/JointCeiling.lean create mode 100644 research/p104-lean-premises/lean/Nov15/JointCeiling.md create mode 100644 research/p104-lean-premises/lean/Nov15/JunkLB2.lean create mode 100644 research/p104-lean-premises/lean/Nov15/JunkLB2.md create mode 100644 research/p104-lean-premises/lean/Nov15/LemmaW.lean create mode 100644 research/p104-lean-premises/lean/Nov15/LemmaW.md create mode 100644 research/p104-lean-premises/lean/Nov15/NativeColumns.lean create mode 100644 research/p104-lean-premises/lean/Nov15/NativeColumns.md create mode 100644 research/p104-lean-premises/lean/Nov15/NumCertK.lean create mode 100644 research/p104-lean-premises/lean/Nov15/NumCertK.md create mode 100644 research/p104-lean-premises/lean/Nov15/NumCertK22.lean create mode 100644 research/p104-lean-premises/lean/Nov15/NumCertKData.lean create mode 100644 research/p104-lean-premises/lean/Nov15/OwnedAscent.lean create mode 100644 research/p104-lean-premises/lean/Nov15/OwnedAscent.md create mode 100644 research/p104-lean-premises/lean/Nov15/OwnedSkeleton.lean create mode 100644 research/p104-lean-premises/lean/Nov15/OwnedSkeleton.md create mode 100644 research/p104-lean-premises/lean/Nov15/OwnedSkeletonData.lean create mode 100644 research/p104-lean-premises/lean/Nov15/OwnedTree.lean create mode 100644 research/p104-lean-premises/lean/Nov15/OwnedTree.md create mode 100644 research/p104-lean-premises/lean/Nov15/OwnedTreeCheck.lean create mode 100644 research/p104-lean-premises/lean/Nov15/OwnedTreeData.lean create mode 100644 research/p104-lean-premises/lean/Nov15/PadLift.lean create mode 100644 research/p104-lean-premises/lean/Nov15/PadLift.md create mode 100644 research/p104-lean-premises/lean/Nov15/PlaneLaws.lean create mode 100644 research/p104-lean-premises/lean/Nov15/PlaneLaws.md create mode 100644 research/p104-lean-premises/lean/Nov15/PsiLaw.lean create mode 100644 research/p104-lean-premises/lean/Nov15/PsiLaw.md create mode 100644 research/p104-lean-premises/lean/Nov15/RankLaw.lean create mode 100644 research/p104-lean-premises/lean/Nov15/RankLaw.md create mode 100644 research/p104-lean-premises/lean/Nov15/RankLawC.lean create mode 100644 research/p104-lean-premises/lean/Nov15/RankLawC.md create mode 100644 research/p104-lean-premises/lean/Nov15/RelaySandwich.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Shadow.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Shadow.md create mode 100644 research/p104-lean-premises/lean/Nov15/SharedCourier.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SharedCourier.md create mode 100644 research/p104-lean-premises/lean/Nov15/SmallRoots.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SmallRoots.md create mode 100644 research/p104-lean-premises/lean/Nov15/SmallRootsA22Corners.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SmallRootsData.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SmallRootsDefs.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0K0.md create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0K0Core.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s0.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s1.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s2.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s3.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s4.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s5.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s6.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0Sym.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec0Sym.md create mode 100644 research/p104-lean-premises/lean/Nov15/Spec6.lean create mode 100644 research/p104-lean-premises/lean/Nov15/Spec6.md create mode 100644 research/p104-lean-premises/lean/Nov15/SpecGC.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SpecGC.md create mode 100644 research/p104-lean-premises/lean/Nov15/SpecINV.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SpecINV.md create mode 100644 research/p104-lean-premises/lean/Nov15/SpecLemmaU.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SpecLemmaU.md create mode 100644 research/p104-lean-premises/lean/Nov15/SpecLemmaU2.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SpecLemmaU2.md create mode 100644 research/p104-lean-premises/lean/Nov15/SpecRankP.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SpecRankP.md create mode 100644 research/p104-lean-premises/lean/Nov15/SpecRankP2.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SpecRankP2.md create mode 100644 research/p104-lean-premises/lean/Nov15/SpecTS.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SpecTS.md create mode 100644 research/p104-lean-premises/lean/Nov15/SpecTSUR.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SpecTSUR.md create mode 100644 research/p104-lean-premises/lean/Nov15/SwapNull.lean create mode 100644 research/p104-lean-premises/lean/Nov15/SwapNull.md create mode 100644 research/p104-lean-premises/lean/Nov15/SwapWord.lean create mode 100644 research/p104-lean-premises/lean/Nov15/TokenCancel.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WholeFloor.md create mode 100644 research/p104-lean-premises/lean/Nov15/WholeFloorCover.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WholeFloorCoverData.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WholeFloorCoverData1.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WholeFloorEnd.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WholeFloorLogs.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WholeFloorModel.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WholeFloorNest.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WholeFloorPrice.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WholeFloorSlack.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WordDuality.lean create mode 100644 research/p104-lean-premises/lean/Nov15/WordDuality.md create mode 100644 research/p104-lean-premises/lean/lake-manifest.json create mode 100644 research/p104-lean-premises/lean/lakefile.toml create mode 100644 research/p104-lean-premises/lean/lean-toolchain diff --git a/research/p104-lean-premises/.gitignore b/research/p104-lean-premises/.gitignore new file mode 100644 index 0000000000..2b00952692 --- /dev/null +++ b/research/p104-lean-premises/.gitignore @@ -0,0 +1 @@ +.lake diff --git a/research/p104-lean-premises/CHECK.txt b/research/p104-lean-premises/CHECK.txt new file mode 100644 index 0000000000..d3efc97534 --- /dev/null +++ b/research/p104-lean-premises/CHECK.txt @@ -0,0 +1,194 @@ +CHECK.txt (combined Lean-only package: third package plus ceilings, word structure, spec-break kills, small lemmas) +Toolchain leanprover/lean4:v4.33.0-rc1; Mathlib 55b7917b472489c7c56a0fa6393af05cfd536599 (an existing build of that commit, no download). +All 89 .lean modules in lean/Nov15 (the sources as staged, comments scrubbed of internal references) were compiled in this final form. + +METHOD + * Every module was 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. Fresh output directory first on LEAN_PATH (so every module of this package was compiled here), then the pinned Mathlib packages. + * CongestionI3Cfg was killed by the watcher once (peak 3.43 GB) and passed on the re-run under the same guard (75 s, 3.34 GB); CongestionI3 failed only because its import was missing at that moment and passed after. WordDuality and PlaneLaws were built in a second pass, after the main pass. + * Axioms: the `#print axioms` lines inside each file (count and union below). Union over everything: {propext, Classical.choice, Quot.sound}; NO Lean.ofReduceBool, no sorryAx, no `declaration uses sorry` warning in any log. Data-only files print nothing. + * Warnings in the logs are linter notes; no errors in any module. + * The `lake build` route was not run (it would download Mathlib). + +COMPILE TABLE (module, rc, wall, peak RSS, errors, sorry warnings), in build order +Annihilator rc=0 time=7s peakRSS=2045MB errors=0 sorry_warnings=0 +CallerCost rc=0 time=12s peakRSS=2945MB errors=0 sorry_warnings=0 +JointCeiling rc=0 time=11s peakRSS=2998MB errors=0 sorry_warnings=0 +BFormOpt rc=0 time=12s peakRSS=2972MB errors=0 sorry_warnings=0 +SpecTSUR rc=0 time=8s peakRSS=2110MB errors=0 sorry_warnings=0 +CallerBorrow rc=0 time=9s peakRSS=2162MB errors=0 sorry_warnings=0 +TokenCancel rc=0 time=4s peakRSS=1628MB errors=0 sorry_warnings=0 +NativeColumns rc=0 time=3s peakRSS=1729MB errors=0 sorry_warnings=0 +CensusData rc=0 time=6s peakRSS=816MB errors=0 sorry_warnings=0 +CensusComplete rc=0 time=9s peakRSS=2373MB errors=0 sorry_warnings=0 +ClearCert rc=0 time=4s peakRSS=1865MB errors=0 sorry_warnings=0 +CongestionI3Data rc=0 time=2s peakRSS=1326MB errors=0 sorry_warnings=0 +CongestionI3Cfg rc=0 time=75s peakRSS=3338MB errors=0 sorry_warnings=0 +CongestionI3Mu rc=0 time=2s peakRSS=1287MB errors=0 sorry_warnings=0 +NumCertK rc=0 time=12s peakRSS=2954MB errors=0 sorry_warnings=0 +CongestionI3NumA rc=0 time=20s peakRSS=3140MB errors=0 sorry_warnings=0 +CongestionI3NumC1 rc=0 time=20s peakRSS=3112MB errors=0 sorry_warnings=0 +CongestionI3NumC2 rc=0 time=18s peakRSS=3060MB errors=0 sorry_warnings=0 +CongestionI3NumC3 rc=0 time=20s peakRSS=3092MB errors=0 sorry_warnings=0 +CongestionI3NumC4 rc=0 time=11s peakRSS=2919MB errors=0 sorry_warnings=0 +WholeFloorCoverData1 rc=0 time=19s peakRSS=3125MB errors=0 sorry_warnings=0 +WholeFloorCoverData rc=0 time=28s peakRSS=3342MB errors=0 sorry_warnings=0 +WholeFloorCover rc=0 time=7s peakRSS=2906MB errors=0 sorry_warnings=0 +CongestionI3 rc=0 time=19s peakRSS=3024MB errors=0 sorry_warnings=0 +FrameSep rc=0 time=2s peakRSS=1500MB errors=0 sorry_warnings=0 +JunkLB2 rc=0 time=7s peakRSS=2421MB errors=0 sorry_warnings=0 +RelaySandwich rc=0 time=4s peakRSS=2316MB errors=0 sorry_warnings=0 +RankLaw rc=0 time=5s peakRSS=2059MB errors=0 sorry_warnings=0 +RankLawC rc=0 time=3s peakRSS=1988MB errors=0 sorry_warnings=0 +SwapWord rc=0 time=3s peakRSS=1996MB errors=0 sorry_warnings=0 +SwapNull rc=0 time=5s peakRSS=2450MB errors=0 sorry_warnings=0 +FibreK rc=0 time=5s peakRSS=2894MB errors=0 sorry_warnings=0 +Delivery rc=0 time=5s peakRSS=2881MB errors=0 sorry_warnings=0 +DescentPrice rc=0 time=2s peakRSS=1389MB errors=0 sorry_warnings=0 +DesignLaws rc=0 time=4s peakRSS=2029MB errors=0 sorry_warnings=0 +ExportLaw rc=0 time=5s peakRSS=1922MB errors=0 sorry_warnings=0 +Floor rc=0 time=4s peakRSS=1916MB errors=0 sorry_warnings=0 +FloorCertDefs rc=0 time=0s peakRSS=394MB errors=0 sorry_warnings=0 +FloorCertData rc=0 time=71s peakRSS=2288MB errors=0 sorry_warnings=0 +FloorCertCheck rc=0 time=16s peakRSS=2296MB errors=0 sorry_warnings=0 +FloorGlue rc=0 time=9s peakRSS=1909MB errors=0 sorry_warnings=0 +FloorCert rc=0 time=5s peakRSS=2138MB errors=0 sorry_warnings=0 +FloorEndToEnd rc=0 time=9s peakRSS=2070MB errors=0 sorry_warnings=0 +FloorD0 rc=0 time=6s peakRSS=2412MB errors=0 sorry_warnings=0 +FloorK22Data rc=0 time=3s peakRSS=1631MB errors=0 sorry_warnings=0 +FloorK22 rc=0 time=8s peakRSS=2919MB errors=0 sorry_warnings=0 +HubSettle rc=0 time=5s peakRSS=2020MB errors=0 sorry_warnings=0 +LemmaW rc=0 time=3s peakRSS=2008MB errors=0 sorry_warnings=0 +NumCertKData rc=0 time=30s peakRSS=3348MB errors=0 sorry_warnings=0 +NumCertK22 rc=0 time=6s peakRSS=2873MB errors=0 sorry_warnings=0 +OwnedAscent rc=0 time=4s peakRSS=1916MB errors=0 sorry_warnings=0 +OwnedSkeletonData rc=0 time=2s peakRSS=1599MB errors=0 sorry_warnings=0 +OwnedSkeleton rc=0 time=10s peakRSS=3317MB errors=0 sorry_warnings=0 +OwnedTree rc=0 time=4s peakRSS=2015MB errors=0 sorry_warnings=0 +OwnedTreeData rc=0 time=3s peakRSS=652MB errors=0 sorry_warnings=0 +OwnedTreeCheck rc=0 time=10s peakRSS=3083MB errors=0 sorry_warnings=0 +SpecRankP rc=0 time=5s peakRSS=2038MB errors=0 sorry_warnings=0 +PadLift rc=0 time=5s peakRSS=2079MB errors=0 sorry_warnings=0 +PsiLaw rc=0 time=4s peakRSS=2015MB errors=0 sorry_warnings=0 +Shadow rc=0 time=9s peakRSS=2862MB errors=0 sorry_warnings=0 +SharedCourier rc=0 time=6s peakRSS=2927MB errors=0 sorry_warnings=0 +SmallRootsDefs rc=0 time=2s peakRSS=1206MB errors=0 sorry_warnings=0 +SmallRootsData rc=0 time=2s peakRSS=1231MB errors=0 sorry_warnings=0 +SmallRootsA22Corners rc=0 time=18s peakRSS=2560MB errors=0 sorry_warnings=0 +SmallRoots rc=0 time=12s peakRSS=3036MB errors=0 sorry_warnings=0 +Spec0K0Core rc=0 time=2s peakRSS=1350MB errors=0 sorry_warnings=0 +Spec0K0_ABCEDF_s0 rc=0 time=63s peakRSS=2217MB errors=0 sorry_warnings=0 +Spec0K0_ABCEDF_s1 rc=0 time=45s peakRSS=2057MB errors=0 sorry_warnings=0 +Spec0K0_ABCEDF_s2 rc=0 time=73s peakRSS=2576MB errors=0 sorry_warnings=0 +Spec0K0_ABCEDF_s3 rc=0 time=57s peakRSS=2256MB errors=0 sorry_warnings=0 +Spec0K0_ABCEDF_s4 rc=0 time=37s peakRSS=1901MB errors=0 sorry_warnings=0 +Spec0K0_ABCEDF_s5 rc=0 time=96s peakRSS=2834MB errors=0 sorry_warnings=0 +Spec0K0_ABCEDF_s6 rc=0 time=34s peakRSS=2128MB errors=0 sorry_warnings=0 +Spec0Sym rc=0 time=25s peakRSS=3195MB errors=0 sorry_warnings=0 +Spec6 rc=0 time=48s peakRSS=2124MB errors=0 sorry_warnings=0 +SpecTS rc=0 time=5s peakRSS=2026MB errors=0 sorry_warnings=0 +SpecINV rc=0 time=13s peakRSS=2190MB errors=0 sorry_warnings=0 +SpecGC rc=0 time=10s peakRSS=2165MB errors=0 sorry_warnings=0 +SpecLemmaU rc=0 time=9s peakRSS=2066MB errors=0 sorry_warnings=0 +SpecLemmaU2 rc=0 time=16s peakRSS=2167MB errors=0 sorry_warnings=0 +SpecRankP2 rc=0 time=6s peakRSS=2087MB errors=0 sorry_warnings=0 +WholeFloorPrice rc=0 time=9s peakRSS=2885MB errors=0 sorry_warnings=0 +WholeFloorLogs rc=0 time=10s peakRSS=2894MB errors=0 sorry_warnings=0 +WholeFloorEnd rc=0 time=6s peakRSS=2842MB errors=0 sorry_warnings=0 +WholeFloorModel rc=0 time=3s peakRSS=1865MB errors=0 sorry_warnings=0 +WholeFloorNest rc=0 time=6s peakRSS=2895MB errors=0 sorry_warnings=0 +WholeFloorSlack rc=0 time=4s peakRSS=1880MB errors=0 sorry_warnings=0 +WordDuality rc=0 time=9s peakRSS=2902MB errors=0 sorry_warnings=0 +PlaneLaws rc=0 time=17s peakRSS=2466MB errors=0 sorry_warnings=0 + +AXIOM PRINTS PER MODULE +Annihilator: 3 prints; union = {Classical.choice, Quot.sound, propext} +CallerCost: 12 prints; union = {Classical.choice, Quot.sound, propext} +JointCeiling: 18 prints; union = {Classical.choice, Quot.sound, propext} +BFormOpt: 20 prints; union = {Classical.choice, Quot.sound, propext} +SpecTSUR: 6 prints; union = {Classical.choice, Quot.sound, propext} +CallerBorrow: 20 prints; union = {Classical.choice, Quot.sound, propext} +TokenCancel: 6 prints; union = {Classical.choice, Quot.sound, propext} +NativeColumns: 5 prints; union = {Classical.choice, Quot.sound, propext} +CensusData: 0 prints; union = {none} +CensusComplete: 4 prints; union = {Quot.sound, propext} +ClearCert: 13 prints; union = {Classical.choice, Quot.sound, propext} +CongestionI3Data: 0 prints; union = {none} +CongestionI3Cfg: 2 prints; union = {Classical.choice, Quot.sound, propext} +CongestionI3Mu: 0 prints; union = {none} +NumCertK: 3 prints; union = {Classical.choice, Quot.sound, propext} +CongestionI3NumA: 1 prints; union = {Classical.choice, Quot.sound, propext} +CongestionI3NumC1: 0 prints; union = {none} +CongestionI3NumC2: 0 prints; union = {none} +CongestionI3NumC3: 0 prints; union = {none} +CongestionI3NumC4: 2 prints; union = {Classical.choice, Quot.sound, propext} +WholeFloorCoverData1: 0 prints; union = {none} +WholeFloorCoverData: 1 prints; union = {Classical.choice, Quot.sound, propext} +WholeFloorCover: 1 prints; union = {Classical.choice, Quot.sound, propext} +CongestionI3: 8 prints; union = {Classical.choice, Quot.sound, propext} +FrameSep: 7 prints; union = {Classical.choice, Quot.sound, propext} +JunkLB2: 25 prints; union = {Classical.choice, Quot.sound, propext} +RelaySandwich: 9 prints; union = {Classical.choice, Quot.sound, propext} +RankLaw: 11 prints; union = {Classical.choice, Quot.sound, propext} +RankLawC: 0 prints; union = {none} +SwapWord: 5 prints; union = {Classical.choice, Quot.sound, propext} +SwapNull: 13 prints; union = {Classical.choice, Quot.sound, propext} +FibreK: 12 prints; union = {Classical.choice, Quot.sound, propext} +Delivery: 12 prints; union = {Classical.choice, Quot.sound, propext} +DescentPrice: 0 prints; union = {none} +DesignLaws: 11 prints; union = {Classical.choice, Quot.sound, propext} +ExportLaw: 12 prints; union = {Classical.choice, Quot.sound, propext} +Floor: 11 prints; union = {Classical.choice, Quot.sound, propext} +FloorCertDefs: 0 prints; union = {none} +FloorCertData: 0 prints; union = {none} +FloorCertCheck: 4 prints; union = {none} +FloorGlue: 5 prints; union = {Classical.choice, Quot.sound, propext} +FloorCert: 6 prints; union = {Classical.choice, Quot.sound, propext} +FloorEndToEnd: 21 prints; union = {Classical.choice, Quot.sound, propext} +FloorD0: 13 prints; union = {Classical.choice, Quot.sound, propext} +FloorK22Data: 0 prints; union = {none} +FloorK22: 16 prints; union = {Classical.choice, Quot.sound, propext} +HubSettle: 10 prints; union = {Classical.choice, Quot.sound, propext} +LemmaW: 6 prints; union = {Classical.choice, Quot.sound, propext} +NumCertKData: 3 prints; union = {Classical.choice, Quot.sound, propext} +NumCertK22: 2 prints; union = {Classical.choice, Quot.sound, propext} +OwnedAscent: 17 prints; union = {Classical.choice, Quot.sound, propext} +OwnedSkeletonData: 0 prints; union = {none} +OwnedSkeleton: 13 prints; union = {Classical.choice, Quot.sound, propext} +OwnedTree: 4 prints; union = {Classical.choice, Quot.sound, propext} +OwnedTreeData: 0 prints; union = {none} +OwnedTreeCheck: 4 prints; union = {Classical.choice, Quot.sound, propext} +SpecRankP: 4 prints; union = {Classical.choice, Quot.sound, propext} +PadLift: 10 prints; union = {Classical.choice, Quot.sound, propext} +PsiLaw: 11 prints; union = {Classical.choice, Quot.sound, propext} +Shadow: 6 prints; union = {Classical.choice, Quot.sound, propext} +SharedCourier: 6 prints; union = {Classical.choice, Quot.sound, propext} +SmallRootsDefs: 0 prints; union = {none} +SmallRootsData: 0 prints; union = {none} +SmallRootsA22Corners: 0 prints; union = {none} +SmallRoots: 4 prints; union = {Classical.choice, Quot.sound, propext} +Spec0K0Core: 0 prints; union = {none} +Spec0K0_ABCEDF_s0: 0 prints; union = {none} +Spec0K0_ABCEDF_s1: 0 prints; union = {none} +Spec0K0_ABCEDF_s2: 0 prints; union = {none} +Spec0K0_ABCEDF_s3: 0 prints; union = {none} +Spec0K0_ABCEDF_s4: 0 prints; union = {none} +Spec0K0_ABCEDF_s5: 0 prints; union = {none} +Spec0K0_ABCEDF_s6: 2 prints; union = {Classical.choice, Quot.sound, propext} +Spec0Sym: 5 prints; union = {Classical.choice, Quot.sound, propext} +Spec6: 8 prints; union = {Classical.choice, Quot.sound, propext} +SpecTS: 8 prints; union = {Classical.choice, Quot.sound, propext} +SpecINV: 17 prints; union = {Classical.choice, Quot.sound, propext} +SpecGC: 14 prints; union = {Classical.choice, Quot.sound, propext} +SpecLemmaU: 9 prints; union = {Classical.choice, Quot.sound, propext} +SpecLemmaU2: 10 prints; union = {Classical.choice, Quot.sound, propext} +SpecRankP2: 6 prints; union = {Classical.choice, Quot.sound, propext} +WholeFloorPrice: 5 prints; union = {Classical.choice, Quot.sound, propext} +WholeFloorLogs: 0 prints; union = {none} +WholeFloorEnd: 3 prints; union = {Classical.choice, Quot.sound, propext} +WholeFloorModel: 3 prints; union = {Classical.choice, Quot.sound, propext} +WholeFloorNest: 6 prints; union = {Classical.choice, Quot.sound, propext} +WholeFloorSlack: 2 prints; union = {Classical.choice, Quot.sound, propext} +WordDuality: 7 prints; union = {Classical.choice, Quot.sound, propext} +PlaneLaws: 8 prints; union = {Classical.choice, Quot.sound, propext} + +HEADLINE THEOREMS: see the `#print axioms` lines at the end of each file; the ceilings are WholeFloorNest.kappa_whole_floor_nested, FloorK22.ceiling22_unconditional, CongestionI3.ceiling_A, CongestionI3.ceiling_C. diff --git a/research/p104-lean-premises/FALSE.md b/research/p104-lean-premises/FALSE.md new file mode 100644 index 0000000000..3b750e8b1e --- /dev/null +++ b/research/p104-lean-premises/FALSE.md @@ -0,0 +1,38 @@ +# Prose statements refuted, corrected or withdrawn (combined package) + +Each item is a Lean theorem or a documented correction in `lean/Nov15/`. None of the source notes was published. Nothing here is a κ claim. + +1. **CallerCost: "invoice D0 ≥ caller floor + calls · (helper D0 floor)".** FALSE. With the numbers of the caller-floor note (helper floor 9,928.76 per call 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: `CallerCost.naive_composition_false`. Reason: the native's main and owned MOVEs are credits (negative D0, `rest_negative`, about −2,842 per call), and the floor is on the helper D0 only. + Corrected: `composition` (floor on TOTAL native D0 per call) or `composition_helper` (explicit credit cap R on the rest). +2. **Caller-ceiling note, section 3: sign of the stationarity slope.** The derivative in the native cost d of the numerator S'D − SD' is +(kS' − S) = +ρ (`CallerCost.stationarity_slope`), not −ρ. The conclusion (a cheaper native lowers the optimal k) is unchanged (`cheaper_native_lowers_k`). The statement is about the proxy S/D0, not the exact root κ. +3. **ClearCert: "COPY into a zero owned row keeps the rank, so every event except CLEAR keeps the rank".** Right only for a ZERO target: `ClearCert.copy_nonzero_loses_rank` (over ℚ, two public registers: COPY 0 ← 1 drops e₀ from the span). The checker enforces the zero-target condition, so the words are fine; the headline lemma survives (`span_step_le` needs only non-birth). + Also: "lossless is implied by correctness" needs endpoint exactness at the span level over the input space U, not over all registers. +4. **CensusComplete: "every MOVE pair used by #7630 lies in the 981-pair census".** FALSE (`CensusComplete.used_not_subset_census`; witness (0,249); 2,143 of 3,024 used pairs are outside the census). Correct reading: the census covers every pair that differs from #7623's used set (`used_subset_base_or_census`); the rest is inherited from #7623. +5. **JointCeiling: "κ ≤ .0336321541 (thin 4) / .0400007313 (thin 3), argmax 2|2" is WITHDRAWN.** The generating script overcharged every arm of length 1 by 208 one-stage lines (P[8]; two lines per port, 104 ports), which breaks the ledger S = 3408(a+b) − 208. The true argmax is 1|1 (k = 2), not 2|2, and the numeric certificate list built from that script is invalid for arms of 1. + Corrected: `callerG` (ledger-correct histogram) with `callerG_S : S = 3408(a+b) − 208` for all a,b ≥ 1, `FBc`; the ceiling becomes .0419448764 (thin 4); thin 3 becomes .0681203280 (B-form class only). For a,b ≥ 2 nothing changes (`FBc_two`, `callerG_eq_caller_F`). +6. **JointCeiling, hypothesis hB (B-form per-split optimality).** Holds on B ports; FAILS on A ports for the true sign-floor masks (centre-drop case: 6,009 and 5,879 failing layouts). So the ceiling is stated for the built-type class (A ports = 4 QUERY units, B-form masks), not for every caller. +7. **OwnedSkeleton: "the 180 lifetimes fit the allocation" / "one bank per label".** True only with reuse: 180 lifetimes per call on 68 labels (peak 50). The correct reading rests on E1 disjointness plus peak ≤ 68 (`lifetimes_exceed_labels`). +8. **OwnedSkeleton / OwnedTree, E3 read off the flat word.** Not possible: the flat word's lifetimes interleave (2,165 crossing interval pairs; 251 CLEARs while a field on a strictly smaller chart is live). E3's ancestor/descendant clause needs the unit tree, and under atomic calls it is implied by E1 (`execU_id`). +9. **OwnedAscent: floors that "owned registers only descend" rest on** (owned-paid-56, eight-unit relay, reader-497, surplus, H6 notes) do not transfer to the relaxed class (`W1_not_strict`, `W1_relaxed`, `W1_charge`). Not a false statement; the scope those notes already declared, now with a Lean witness. + +10. **JunkLB2, the "public arrivals only" form of T4.** FALSE as written (`JunkLB2.T4_public_only_false`): a public helper h arrives with e_h + e_x and an owned register o arrives with −e_x; then h += o makes h its own token while the public span has dimension 1 > 0. The gap is the first step of the prose proof. Corrected: T4 with owned arrivals counted (`T4_departer` when there are none). +11. **Whole-word floor, "forced stops ≥ 88 at m = 16, argmin m = 16 (monotone)".** FALSE as written: the pricing only allowed owned MOVEs of rank 1..9, but Theorem Y counts all owned MOVEs, and a lateral owned MOVE (distinct charts, equal dimension, rank 0) enters σ_C for free. Counterexample `WholeFloorPrice.cex`, `cex_priced`, `r3_stops_not_forced` (12 rank-9 and 4 rank-1 paid owned MOVEs plus 88 lateral ones, no stops: D0 = −400 f 8 − 12 f 9, below the claimed floor by 88 · 2 ln 2). Corrected: `d0_floor` carries max 0 (88 − lat); the claimed floor (155,730.99; κ ≤ .0204110964) holds for words with no lateral owned MOVE. The verifier's nesting rule makes lateral MOVEs illegal (`WholeFloorNest.nest_rank_pos`, `nest_lat_zero`), which restores the floor for every legal word (`d0_whole_floor_nested`, `kappa_whole_floor_nested`). The cheaper all-words figure without nesting is 153,657.09 / κ ≤ .0207160184. Also a digit note: the root is .02041109645, so .0204110964 is rounded down and the kernel statement uses .0204110965. +12. **Delivery, TWO-STOP: "K-cost ≥ f(d) − max over three-way splits of Σ f, which is ≥ f(3) = 3.30".** FALSE as written. The "max over splits" is f(d) itself (split (d,0,0)), cost 0. Counterexample `Delivery.zero_gap_counterexample`: courier 0 → 8 → 9 → 9, D0 = f(9) − f(8) = 3.139 < f(3) = 3.296 (5 ln 3 < 8 ln 2). Corrected: with three genuine hops (all gaps ≥ 1) D0 ≥ f(d) − f(d−2) ≥ f(3) (`three_hop_cost`, `fL_three_gt`). The value 3.30 is numeric; Lean proves > 3. +13. **DesignLaws, ONE-READ: "a register reads at most one chart per owned lineage".** FALSE with owned ascent allowed (`DesignLaws.one_read_needs_descent`: a legal run in which owned register and reader both go 0 → 1 and read at charts 0 and 1). True with the DESCENT hypothesis on the owned lineage (`one_read`). Corrected: at most one chart per DESCENDING owned lineage. +14. **PsiLaw, the two span/obstruction statements.** (a) "A repair exists iff w lies in the row span" is only necessary: `span_law_not_sufficient` (one end row (1), w = (1): w in the span, stripped row 0, no V settle). Corrected: iff w is in the old span and in the stripped span (`span_strip_iff`). (b) "A relocated op is a pure G0-column operation only if neither register is read in between": reads of the source register are harmless (`add_swap` allows them); the obstruction is reads of the target and writes to the source (`exposed_read_no_prefix`, `move_early`). +15. **Shadow: "the twin has the same invoice T, P".** FALSE literally: the raw T and P histograms each gain the common summand `mains.flatMap (tT (e−b))` (`shadow_T_raw`). What is equal is the net T − P at every rank (`shadow_net`), hence S, F(t), D0 and κ. So the consequence holds for laws that factor through the net invoice, not for laws that read raw T or P counts; the cancellation needs the symmetry hypothesis `Sym`. +16. **FloorK22, the displayed recipe "270,812.82 − 46,300.0 − 2,006.0 + 17 × 1,036.95 = 240,134.84".** The arithmetic of the displayed recipe is 240,134.97 (`FloorK22.recipe_as_written`). Exact: mains −46,300.09, caller 270,812.8175, kept credits −48,306.0933 (17 × 2841.5349), stops +17,628.1191 (17 × 748 × 2 ln 2, not 17 × 1,036.95): total 240,134.843. The floor 240,134.84 is right; only the rounded recipe is off by 0.13. +17. **RankLaw: "every op except CLEAR is invertible" and "(ii) zero W0 part".** The first is false with COPY (`RankLaw.copy_lossy_example`; also SCALE by 0 is a CLEAR); minimal fix: except CLEAR, COPY over a live row and SCALE 0. The second is the right criterion only relative to a U meeting the span of the non-V targets trivially (`hUN`); in general the criterion is the (U ⊓ N)-component (`RankLawC.rank_law_proj`). "The V mix is unique" needs independent end rows. +18. **HubSettle: "M ∈ GL(A) iff the determinants are units of A".** The "if" holds (`solve_inGL`); the "only if" is false (`HubSettle.iff_false_example`: over ℤ ⊂ ℚ, A1 = B = (2) gives M = 1 ∈ GL(ℤ) with det A1 = 2 a non-unit). +19. **FrameSep: "any public that ever reads X_a can never meet Y_a".** True only AFTER the read (`reader_never_meets_Y_after`); the unqualified reading is false (`meet_before_read_possible`). +20. **DescentPrice / FloorD0, signed gaps (scope only).** The identity D0(r) = f(e − d0) − Σ f(gaps) uses signed gaps and equals the priced charge only on ascending registers (all public registers); it would fail for owned descents. Not false at its stated scope (see `FloorD0.md`). +21. **PadLift: "the lifted rank bound holds in every characteristic".** Needs characteristic ≠ 2 (counterexample `pad_rank_char2_fails` over ZMod 2); `pad_sq` and the block form need no assumption. +22. **WordDuality: "COPY becomes ADD under the duality".** FALSE as matrices (`WordDuality.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 (INIT then COPY) and must carry the dual of the target's INIT (a CLEAR); `dualEv` maps COPY to ADD for legality only. + +## Further corrections and statements checked true as written +The column test is exhaustive, not sampled (512 of 512 columns per pair; tool fact). No paper statement found false in NativeColumns. +- **SWAP-NULL as first worded** ("a tail swap is legal iff both helpers end in V; a head swap iff both are born in {0}") is false per kind: `tail_prefix_counterexample` is a tail swap undone by the prefix alone with neither helper in V. Corrected: `undo_one_iff` (either condition), with per-kind iffs needing a pinning/distinguishing hypothesis (`tail_iff_span`, `head_iff`). +- **B-form optimality, L2 constant**: the lemma's constant "−2(k−2)φ(1)" should read "−2kφ(1)" (`BFormOpt.port_total`); conclusions unaffected. + +Checked and found true as written (no counterexample; wording or scope notes only), in the notes of: SpecTSUR/SpecTS, SpecINV, SpecGC, SpecRankP (the general two-reflection claim is recorded there as false in a degenerate stratum; it is not a Lean statement here), SpecRankP2 (stronger than stated), SpecLemmaU, SpecLemmaU2, Spec6, PadLift (char ≠ 2), CallerBorrow (three scope notes), LemmaW (one sharpening), Annihilator, SharedCourier, SmallRoots, CongestionI3 (the sum of I3 and the stop bound is NOT implied, only the max: `sum_not_implied`), DescentPrice, FloorD0. diff --git a/research/p104-lean-premises/LICENSE b/research/p104-lean-premises/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/NOTICE.md b/research/p104-lean-premises/NOTICE.md new file mode 100644 index 0000000000..8382c69d43 --- /dev/null +++ b/research/p104-lean-premises/NOTICE.md @@ -0,0 +1,5 @@ +Apache-2.0 (see `LICENSE`). Prepared by DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. + +The objects of study are other people's work: the premises of PR #7620 (and the #7616 line it builds on) by SYLforge, on which our #7623/#7630 κ is conditional, +and the #7113 caller by rohanarun, whose cost the caller-side files reproduce and bound. This package states and proves facts ABOUT those premises and that caller; it does not replace or endorse them. +The Lean sources are new and continue the first two Lean packages (#7632, #7634); toolchain and Mathlib pin are those of `formal/lean` on main. diff --git a/research/p104-lean-premises/PREMISES.md b/research/p104-lean-premises/PREMISES.md new file mode 100644 index 0000000000..e4461b58d5 --- /dev/null +++ b/research/p104-lean-premises/PREMISES.md @@ -0,0 +1,52 @@ +# Premise narrowing for #7620 (what is now a kernel fact, what is still assumed) + +Context: our #7623/#7630 κ is conditional on the premises of PR #7620 (SYLforge; the premise list builds on #7616). Nothing here is a κ claim, and no premise is discharged in full. +"Fact" means: kernel-checked in this package, for the stated model and extracted data (axioms within propext, Classical.choice, Quot.sound; see CHECK.txt). +Data are extracted by scripts that are not shipped; "extraction fidelity" is by reading in every case below. Each file's `.md` in `lean/Nov15/` has the model and hypotheses. + +## 1. owned_erasure (files ClearCert, OwnedSkeleton, OwnedTree) +Clauses: E1 explicit INIT, erased, no overlapping reuse; E2 one bank per live unit (allocation); E3 field identity / chronology, flat and parent-child; E4 copy/read/erase linear in volume; E5 paid non-reversible erase is permitted; E6 dirty residuals counted via earlier ADD reads. + +| item | status | +|---|---| +| Content half: every CLEAR erases a lossless row | FACT (`ClearCert.every_clear_lossless`: endpoint-exact, birth-free word with rows in U; no legality needed). The certificate checker is sound and complete for it (`checker_sound`, `checker_complete`). Two endpoint-exact words with the same owned events satisfy the erasure predicate together or not at all (`clearform`). | +| E1 on the real owned skeleton of #7630 (180 INIT, 180 CLEAR, 47 owned MOVE) | FACT (`OwnedSkeleton.sk_skel`, by `decide +kernel` on extracted data) | +| E2: 68 labels, peak live 50 ≤ 68, 17 calls x 68 = 1,156 banks, 180 lifetimes reuse the 68 labels | FACT (`peak_skel`, `bank_count`, `lifetimes_exceed_labels`) | +| E3 flat half (MOVE starts at current chart, properly nested; CLEAR at current chart) | FACT (`OwnedSkeleton`) | +| E3 tree half (a clear never acts on a descendant's live storage), every recursion depth and every call-site list | FACT under ATOMIC CALLS and unit-tagged banks (`OwnedTree.e3_tree`, `e3_tree_real` at the 6,250 real MOVE sites). It is implied by E1's "nothing live at the end" for the child (`execU_id`); it is not independent evidence. | +| Caller layer owns no storage; 17 sequential native calls | FACT on the extracted #7113 caller alphabet (`OwnedTreeCheck.caller_alphabet`, `caller_tree`) | +| E4, E5, E6 | ASSUMED. Cost/permission statements; not expressible in the row model. | +| Compiler admission of the retained allocation | ASSUMED | +| Atomic scheduling of child units; "child = same word" self-similarity | ASSUMED (execution-model facts from the contract text, not properties of the word). If "tree" meant a chart hierarchy instead of paid rounds, the flat word would violate the clause 251 times: a reviewer who reads it that way has a real objection. | +| Extraction fidelity (skeleton, call sites, certificates); replay of the 208,738-event word and of the 180 certificates | ASSUMED / not in the kernel | + +## 2. Owned ascent (file OwnedAscent) +Reduced to ADMISSION. + +| item | status | +|---|---| +| Rank cost of a chart change is direction-free (`rc_inv`, `back_cost`); price of a→b equals price of b→a if the compiled rank is |Δdim| (hypothesis) | FACT (in the abstract model) | +| Owned moves are charged like public ones; owned share never negative; an owned ascent costs ≥ 1 | FACT (`cost_split`, `ownedCost_nonneg`, `owned_ascent_charged`) | +| Owned registers earn no credit; ascent only adds to the invoice | FACT (`owned_no_credit`, `invoice_eq`) | +| Relaxed legality differs from strict only on owned ascents; every FloorEndToEnd floor proved on the relaxed class holds for strict words | FACT (`legal_diff`, `public_unchanged`, `AcceptedS.toAccepted`, `hOnce_strict`) | +| Floors that rest on "owned registers only descend" do NOT transfer to the relaxed class | FACT, as a scope statement with a witness (`strict_no_owned_asc`, `W1_*`) | +| Contract admits owned ascent on arbitrary content, factorwise at every width | ASSUMED. The contract text never mentions direction; an earlier P112 precedent supports, does not prove. | +| Compiled rank = |Δdim| for each chart pair | ASSUMED (Clifford compilation not formalised) | +| CLEAR at any frame | rests on premise 1 | + +## 3. native_all_columns (files NativeColumns, CensusComplete, CensusData) +| item | status | +|---|---| +| For an exact-rows word, the word computes the matrix on every column, every tensor power (any K-module) | FACT (`all_columns_of_exact_rows`) | +| Exact final rows ⇔ correct on every unit column | FACT (`exact_rows_iff_columns`) | +| Subset tests are only evidence (`partial_columns_insufficient`); adjoint columns add nothing once forward is exact (`adjoint_iff_forward`); absolute phase needs its own test (`phase_visible`) | FACT | +| The #7630 checker's column test is exhaustive (512 of 512 forward and 512 adjoint exact columns per affected pair), not sampled | tool fact (code read; not re-run) | +| used(#7630) ⊆ used(#7623) ∪ census | FACT (`used_subset_base_or_census`, kernel, extracted data: census 981, #7623 census 964, used 3,024 and 3,021) | +| The census covers every pair #7630 uses | FALSE as stated: `used_not_subset_census` (2,143 of 3,024 used pairs are outside it). The census is a DELTA census. | +| Correct on the census and on #7623's used pairs ⇒ correct on all #7630 used pairs | FACT (`all_used_correct`, for any predicate) | +| Per-pair column checks pass on the 981 census pairs | ASSUMED (checker output) | +| Correctness of #7623's 3,021 used pairs (only 866 lie in the 964-pair census) | ASSUMED: inherited from #7623/#7620. This, not a code fact about #7630, is the real residue of "census completeness". | +| Operator realization (Pauli frame, complex phase, Fourier recipe on 512-dim states); compiler and precision halves; the checker itself | ASSUMED | + +## Other premises +`compiler`, `precision_tape`, `analytic_recovery`: untouched. diff --git a/research/p104-lean-premises/PROVED.md b/research/p104-lean-premises/PROVED.md new file mode 100644 index 0000000000..71b95b20ef --- /dev/null +++ b/research/p104-lean-premises/PROVED.md @@ -0,0 +1,135 @@ +# What is proved (Lean only), part 3 + +Authors: DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. Nothing here is a κ claim. +Every theorem below is kernel-checked in `lean/` (no `sorry`, no `axiom` declaration, no `native_decide`; the word `sorry` occurs only in comments). Every file's axioms are within {propext, Classical.choice, Quot.sound} (CHECK.txt). +"Input" means the Lean statement takes it as a hypothesis or as data; Lean proves nothing about it. Files already in #7632/#7634 are listed in `SHIPPED.txt`. Premise-level status (fact vs assumed) is in `PREMISES.md`. + +## A. Premise narrowing for #7620 + +### ClearCert.lean (imports TokenCancel) +Model: TokenCancel rows over a field K in initial-row coordinates; `Good` = what the #7630 checker enforces besides legality (no birth in the tail, SCALE unit, ADD between distinct registers, COPY/INIT into a zero row). +- `span_step_le`: any non-birth event only shrinks the row span. `span_step_ge`: any Good non-CLEAR event preserves it. `lossless_iff`, `finrank_clear_le` (a CLEAR lowers the rank by at most 1). +- `every_clear_lossless`: hypotheses `rowSpan s ≤ U`, all events non-birth, `FullEnd U s es` (final rows span U); conclusion: every CLEAR acts on a row in the span of the others. No legality hypothesis. +- `checker_sound`: hypotheses `rowSpan s ≤ U`, `U ≤ rowSpan s`, `GoodRun s es`, `Certified s es cs`; conclusion `FullEnd U s es` and every CLEAR lossless. `certOK_lossless`, `lossless_certOK`; `checker_complete`: an endpoint-exact legal word has certificates at all CLEARs. +- `legal_congr`: legality reads only `loc`, never rows. `clearform`: for an arbitrary predicate `Sk` of the owned-event skeleton, two endpoint-exact words with equal owned events satisfy `ErasureOK Sk` together or not at all. +- `copy_nonzero_loses_rank` (counterexample, see FALSE.md); `toy_end`: a 4-register word in the real certificate shape. **Inputs:** `Sk` (arbitrary); the 180 real certificates and the 208,738-event word are NOT replayed (hypothesis `Certified W0 W certs`). + +### OwnedAscent.lean (imports FloorEndToEnd) +- `rc_inv`: the rank of the residual of a chart change is inverse-invariant; `back_cost`; `rc_comp` (subadditive). `cost_split`, `ownedCost_nonneg`, `owned_ascent_charged` (≥ 1, given strictly monotone dim). `owned_no_credit`, `invoice_eq`. +- `legal_of_S`, `AcceptedS.toAccepted`, `public_unchanged`, `legal_diff`: strict legality implies relaxed legality, differing only on owned ascents. `hOnce_strict`: the FloorEndToEnd hOnce bound holds for strict-accepted words (hence every FloorEndToEnd theorem does). +- `strict_no_owned_asc`; `W1_relaxed`, `W1_not_strict`, `W1_charge`: a 2-event word that is relaxed-legal, strict-illegal, charge 1. +- **Inputs:** compiled rank = |Δdim| for each chart pair (hypothesis of `price_symm`), dim and nesting, and the admission of owned ascent by the contract. `rc` is a generic rank-of-(T−1) proxy, not the Pauli/Fourier rank. + +### NativeColumns.lean (imports TokenCancel) +- `all_columns_of_exact_rows`: if `(run s es).row = T`, the word applied to data `x` in ANY K-module gives `T x`. `exact_rows_iff_columns`: exact rows ⇔ correct on every unit column. +- `matrix_ext_cols`, `linear_ext_span`, `partial_columns_insufficient` (2×2 over ℚ), `adjoint_iff_forward`, `phase_visible`, `census_coverage` (logic only). +- **Not modelled:** Pauli frames, complex phase, the Fourier recipe; the checker script. + +### CensusData.lean, CensusComplete.lean (imports NativeColumns) +Data: census 981, #7623 census 964, used(#7630) 3,024 distinct MOVE pairs, used(#7623) 3,021 (generated lists; fidelity by reading). +- `used_subset_base_or_census`: used(#7630) ⊆ used(#7623) ∪ census. `new_in_census`, `leaving_in_census`, `newPairs_facts`, `leavePairs_facts`, `census_extends`. +- `used_not_subset_census` (witness (0,249)): used(#7630) ⊄ census. +- `all_used_correct`: for any predicate `Correct` on pairs, `Correct` on all census pairs and on all pairs used by #7623's word imply `Correct` on all pairs used by #7630. **Inputs:** both hypotheses. + +### OwnedSkeletonData.lean, OwnedSkeleton.lean (imports ClearCert) +Skeleton = time-ordered owned INIT / MOVE / CLEAR events of #7630's word (407 events: 180 + 180 + 47; 68 labels). `Sk := E1 ∧ E2 ∧ E3` as a decidable proposition. +- `sk_skel : Sk skel` (E1, E2, E3 separately too), by `decide +kernel`. Counts: `n_lifetimes` 180, `n_clears` 180, `n_moves` 47, `n_labels` 68, `peak_skel` 50, `bank_count` 17 · 68 = 1,156, `lifetimes_exceed_labels`, `total_lifetimes` 3,060. +- `erasure_ok_on_skel`: for every endpoint-exact, birth-free word with rows in U whose owned events equal `skel`, `ErasureOK Sk owned s es` holds. Negative controls rejected: `c_not_nested`, `c_skel_truncated`, `c_peak`, and others. +- **Inputs:** the extracted skeleton; E3 parent/child, E4-E6, compiler admission (not here). + +### OwnedTreeData.lean, OwnedTree.lean, OwnedTreeCheck.lean +Model: the unit tree comes from the contract's execution model (a child unit is a complete call made at a paid round, atomic from the parent's view, with its own bank tag); the word carries no unit tags. +- `go_frame`: E1 of one unit transports to the tagged run in any context with nothing live at or below the unit. `execU_id`: from `e1run [] skel = some []`, by induction on depth, running a unit returns the context unchanged. +- `e3_tree sites d : execU sites d [] [] = some []` for ALL depths and ALL call-site lists. `e3_tree_real`: at the 6,250 real MOVE sites (`n_sites`). `caller_tree`: the 17 sequential native calls of the #7113 caller each run to completion from the empty state and end empty; `caller_alphabet`: the caller's op alphabet has no owned-storage op. +- `concrete_d1_owned` (root plus the first 4 owned-MOVE sites as children, kernel-evaluated); negative controls `c_child_leak`, `c_child_steals`, `c_clear_with_desc`, `c_caller_leak`, `c_real_child_leak`, with accepting twins. +- **Inputs:** atomic calls, "child = same word", the extracted sites and caller alphabet (from a local copy of the #7113 caller, sha 255d89f3). + +## B. Caller-tied ceiling + +### CallerCost.lean (Mathlib only) +Histograms of (rank, count); S = Σ r·(T−P) (`Sinv`), D0 = Σ (T−P)·r ln r; `invoice c n L = caller + L · native`. Caller family C(a|b): 96 A ports x 4 thin queries, 8 B ports; Lean parameters a' = a−2, b' = b−2. +- `reproduction`: C(8|9) (= `caller 6 7`) equals the #7113 caller invoice term for term as histograms (data lists transcribed from the pricer's output); `caller89_S`, `caller89_D0`; S = 57,728. +- `S_caller : S = 3408(a'+b'+4) − 208`. `S_7630_k17`: with native S = −3312 per call and k = 17, S = 1,424. `D0_caller`, `invoice_S`, `invoice_D0` (exact). +- `single_crossing` (first-order proxy K = S/D0, hypotheses 0 < ρ, k1 ≤ k2, d ≤ d'), `cheaper_native_lowers_k`, `crossing_value`, `stationarity_slope` (+ρ, see FALSE.md). +- `composition`: abstract caller class, `Fc(calls) ≤ Dc` and total native floor `Fn ≤ Dn` give `Fc(k) + k·Fn ≤ invoice D0`. `composition_helper` (explicit credit cap R). `kappa_proxy_le`. `naive_composition_false`, `rest_negative` (FALSE.md item 1). +- **Scope:** proxy S/D0, not the exact root κ of F(t) = 0. + +### JointCeiling.lean (imports CallerCost; Mathlib rpow) +Convention F(s) = Σ (T−P) r^s with s = 1 − t. `invoice_F`, `natFloor_F` (native floor Nfl(s) = 400·8^s + 16 + 88(2 − 2^s)), `FB_eq` (bridge to `CallerCost.caller` for a,b ≥ 2). +- **Correction:** `FBc a b th s = FB a b th s + 208·8^s·(#arms of 1)`; `callerG_F`, `callerG_S : S(callerG a b 4) = 3408(a+b) − 208` for all a,b ≥ 1; `FBc_two`, `callerG_eq_caller_F`. +- **`ceiling`, `ceiling4`, `ceiling3` (conditional):** for `c : InClass th0`, native `n` with `hN : ∀ s ∈ [0,1], F_nat(s) ≤ −Nfl(s)`, and `hnum : NumCert th0 tbar`: `F(1−t)` of the invoice is < 0 for tbar ≤ t ≤ 1. With th0 = 4, tbar = tbar4 = .0419448764 (rounded up from the certified root .041944876391, peak at 1|1, k = 2); th0 = 3: tbar3 = .0681203280, certified only for the th3 B-form-A class under hB. + Named hypotheses: `InClass.hB` (B-form per-split optimality pointwise in F on [0,1]), `hth` (th ≥ th0: A ports use th0 QUERY sign units), `hrho` (ρ ≥ 2, i.e. Theorem H plus the t = −1 closure; recorded only), `hN` (native floor; not re-proved), `NumCert` (a finite list of interval inequalities, ~1,800 pairs of 40-digit covers plus the tail step; NOT in the kernel; the tail step "U ≥ F by Jensen/MVT" is unaudited), plus [H-centre] (no line crosses the centre at h ≤ 4) and [H-odd] (a B sign unit costs ≥ ψ(1)) as conditions on the class, and realisability of arms of 1 / k = 2 (no root built). +- **Fully kernel-checked numerics (no NumCert):** `split22_ceiling`: `F(1−t) < 0` for t ≥ 141/4096 (= .034424) for the invoice `I22` of the 2|2 caller and the floor native (28 rational cells); `split11_ceiling`: t ≥ 176/4096 (= .04297) for `I11` (36 rational cells). The class-level forms `ceiling_split22` (`c.a = c.b = 2`) and `ceiling_split11` (`c.a = c.b = 1`) still take `hB`, `hth` (via `InClass 4`) and `hN` as hypotheses. The sharp root is not reachable on the 4096 grid; it is in NumCert. +- `control_bracket`: for the #7113 caller at the floor native with k = 17, F(.0204) > 0 > F(.0205); `I89_F`. +- **Outside the class:** trees, multi-centre callers, shared own roles. The .0336 / .0400 statement is withdrawn (FALSE.md item 5). + +## C. SwapNull +Included: see section C below. + +## C. SWAP-NULL (SwapNull) +4-op swap gadget at a shared chart (`add h1 h2 +1; add h2 h1 −1; add h1 h2 +1; scale h2 −1`) swaps two helper rows. `undo_one_iff`: with identity finals the swap is hub-undoable iff both helpers end in V or both are born in G0. `stays_multiset`, `delta_eq`, `swap_null`: the stay multiset is unchanged and the cost change is f(e2−b1)+f(e1−b2)−f(e1−b1)−f(e2−b2), zero when ends or births agree. `nonzero_not_undoable`, `converse_witness`: a swap with nonzero cost change cannot be undone by the hubs. + +## D. B-form optimality (BFormOpt) +Pointwise in s, for all arm lengths a, b and parameters h, e: `bill_lb` (any feasible schedule), `CB_closed` (arms of 1 included), `own_abel`, `hub_nonpos`, `bform_optimal` (F ≤ F(B form) on B ports), `port_total` (96 A + 8 B ports reproduce the caller cost). `hB_discharge` / `ceiling_of_ports` discharge JointCeiling's hB for B ports, with A ports of the built type. `A_drop_*`: on A ports the B form is NOT optimal (dropping a last-stage own role gains 1 − ψ(1)), which is why A ports are fixed to the built type. Still hypotheses: H-odd, the native floor, NumCert. + +## E. Fibre structure, first pieces (FibreK) +`K_word`, `K_invoice`, `kappa_depends_only`: with the cost table P0 as an explicit parameter, the invoice F(t) depends only on the ends E, the timed helper step multiset S and the climb multiset Π = {e_h − b_h}. `tail_pairs` / `head_pairs` (proved directly), `tail_F_null`, `head_F_null`: with helpers ending as identity, any hub-undoable pure relabel preserves the (birth, end) multiset, hence Π and F(t). `c3_not_undoable`. NOT covered: relabel combined with an interior gauge, loops, mixed head+tail relabels, and any "native is optimal over its fibre" statement (open). + +# Added in the combined package (ceilings, word structure, spec-break kills, small lemmas) +Each file has a `.md` note in `lean/Nov15/` with the full statement list. Hypotheses are named in the theorems; "input" means Lean takes it as a hypothesis or as data and proves nothing about it. Labels such as R3, R5, RB4, AUDIT5 in the notes refer to internal working notes that are not part of this package. + +## F. Whole-word ceilings (WholeFloor*, NumCertK*, FloorK22*, CongestionI3*) +Convention as in JointCeiling: F(s) = Σ (T−P) r^s, s = 1 − t; "κ ≤ t0" means F(1−t) < 0 for all t in [t0, 1]. + +### WholeFloorModel, WholeFloorSlack (Mathlib only) +Ghosted run state, events (birth, same-chart gate, public MOVE strictly ascending, owned MOVE any chart, owned CLEAR). `reach_inv`, `cs_final` (every row that sits at c at any moment lies in I_c of the end state). `slack_rank`: under hypothesis `Indep` (final rows of stayers plus unit rows of c-born leavers independent) I_c = F_stay ⊕ E_BL ⊕ K_c with dim K_c ≤ σ_c = s_c + o_c; `count_id`, `gens_finrank_le`. **Inputs:** `Indep`; the port lemma (Theorem Y: Σσ ≥ 104 over C ≠ V) is the hypothesis `h_Y`. + +### WholeFloorPrice, WholeFloorLogs, WholeFloorEnd (import JointCeiling, JunkLB2) +`d0_floor` (hyps: helper floor `h_help`, main price `h_main`, owned pricing D0 = −Σ f(k_i) with k_i in 1..9, mass ≤ 112, ≥ 16 paid owned MOVEs, `h_Y`): D0_nat ≥ −400 f 8 − 12 f 9 + 2 ln 2 · max 0 (88 − lat), where lat = number of lateral owned MOVEs. `WholeFloorLogs.key` (kernel, 11 prime-log brackets): D0(#7113 caller C(8|9)) ≥ 270,812.8 and the 17-call figure ≥ 155,730.9. `d0_whole_floor` (lat = 0): 17-call invoice D0 ≥ 155,730.9; `d0_whole_floor_any_lat`: any lat gives ≥ 153,656.9. `F_floor`: s in [0,1] gives F_nat ≤ −NflL lat s (JointCeiling's hN derived for lat = 0). `cex`, `cex_priced`, `r3_stops_not_forced`: the lateral-MOVE counterexample (FALSE.md item 11). `fixed_caller_point`. + +### WholeFloorNest, WholeFloorCover, WholeFloorCoverData(1) (import NumCertK, JointCeiling) +`Geo`/`NestOwn`/`RunL`: the verifier's nesting rule (public MOVE: proper nested ascent; owned: nested either direction) added to the model; `nest_rank_pos` (every legal MOVE has rank ≥ 1), `nest_lat_zero`. `d0_whole_floor_nested`: priced words obeying nesting have 17-call invoice D0 ≥ 155,730.9 (no lat hypothesis). `hN_nested`. +- **`kappa_whole_floor_nested`:** for nested priced words, F(1−t) < 0 on the invoice (caller 6 7) + 17 native for every t in [.0204110965, 1]. **κ ≤ .0204110965 over legal (nested) words.** Hypotheses: `Priced w` (h_Y = Theorem Y, h_help, h_main, owned pricing), `Indep`, and the F-currency pricing link `hF`. The numeric cover is discharged in the kernel (`WholeFloorCover.cover`: 11 negative pieces on [0, .93] and one monotone piece on [.93, .9795889035], `decide +kernel`, split across the Data files for memory); no numeric hypothesis remains. Digit note: the exact root is .02041109645; the kernel statement uses the 10th-digit round-up. +- **Not in the kernel:** Theorem Y itself, `Indep`, the cost-model link `hF`, and the verifier-nesting reading of the SPEC (a statement about the verifier source, recorded in the note). + +### NumCertK, NumCertKData, NumCertK22 (kernel interval arithmetic) +Library: `lnLo ≤ ln ≤ lnHi` (36-term atanh chain, ~1e-28), exp enclosure, `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), `Fc_le`, `dFc_ge`, `Fc_hasDerivAt`, `Fc_mono`. `cfK_neg`: F(s) < 0 on [0, 1 − .0060197405] for the K(S22) invoice histogram (24 ranks). `numCert22 : NumCert22 tbar22`, `ceiling22_unconditional`. + +### FloorK22, FloorK22Data (import FloorD0, JointCeiling) +`ClassK22` = class K(S22): kept data fixed, helpers free and verifier-accepted. `R1Y_row`, `forced_sum` (kernel: Σ over 978 charts of max(0, rk − ab − oa) = 748), `stays_ge_748`, `helperD0_ge_748` (helper D0 ≥ 748 · 2 ln 2 ≥ 1,036.948), `D0_K22` (invoice D0 ≥ 240,134.84; input `CallerD0Input`, the ~70 caller logs), `helperF_le` (F-form native floor derived for every s), `entries_are_registers`, `reentry_two_events`. +- **`ceiling22` / `ceiling22_unconditional`: κ ≤ .0060197405 for class K(S22).** Hypotheses: `ClassK22.rank_ge` (rank of the kept rows at each chart ≥ rk; the 378-coordinate rows are not exported), the cost-model links `hnat`/`hF`, and `CallerD0Input`. `NumCert22` is discharged (NumCertK22). Not formalised: the 845-stop dual (`D0_K22_R6` is conditional on it). + +### CongestionI3, CongestionI3Cfg/Data/Mu/NumA/NumC1–C4 (import WholeFloorCover) +`pair_bound`, `i3_D0_per_call` (0.541495 per pair, |J| ≥ 1936 ⇒ ≥ 1048.33 D0/call). `cfgs_ok`, `cfg_uniq0..7`, `uniqCells_disjoint` (the 8 rank-8 C = 56 configurations, 330 unique cells per chain recomputed from the labels), `mu_sum`, `forced_junk_ge` (|J| ≥ 1936). `f1_floor` (max, not sum: `sum_not_implied`), `Fc_mono`, `nine_chord`, `own56_floor`, `dprice_ge`. +- **`ceiling_A`: κ ≤ .0183952347** on the 8|9 invoice, for the restricted class M_V (every public register except Y mains ends at V, owned code fixed, X_q born at A_q). +- **`ceiling_C`: κ ≤ .0134769139**, same class, with descent mass ≥ 56 (rank-8 decoder, C = 56). +- **Hypotheses (named in the theorems):** `MV` (class M_V); I3 as `I3Path` (path-distance telescoping bound, not formalised); `Rank8C56` (exactly the C = 56 rank-8 decoders on P104 labels; exhaustiveness over the 12,870 subsets and rigidity are quoted, C ≥ 58 is not covered); `hDP` (flag-DP minima, python data, not kernel-checked); `hdist`, `hLc` (per-pair lower bounds, numerical); `Prov`/`I3Cap` (public-provenance direction law, open cases listed in the note); `PlaneSep` (ceiling_A only); `hY` (Theorem Y under nesting). **No known native lies in M_V** (224 of 1,501 public registers end at dim ≤ 7), so these are ceilings for the restricted class, not floors on the native class. + +### Supporting files for the ceilings +`FloorCertDefs/Data/Check`, `FloorCert` (class-K LP certificate: the support sub-LP of 892 rows × 18,868 columns, `len_ok`, `Y_nonneg_ok`, `bDot_ok`, `cols_ok` by `decide +kernel` with no axioms; `lp_floor`, `stops_ge_780`, `cost_ge_780`, `cost_ge_real`: 780 stays, ≥ 1,081.31 D0/call); `DescentPrice` (paid − credit = 2·descent ranks); `FloorD0` (helper D0 ≥ 2 ln 2 · #paid stays, `floor_D0_classK`: ≥ 780·2 ln 2 under ClassK + H2); `JunkLB2` (g9 pricing and the corrected T4 with owned arrivals, `T4_public_only_false`). Their notes list hypotheses. + +## G. Word structure (Shadow, Annihilator, Delivery, DesignLaws, SharedCourier, PsiLaw, WordDuality, PlaneLaws; supporting HubSettle, RankLaw, RankLawC, FrameSep) +- **Shadow** (imports FibreK): the 4-gate birth swap and swap-back are exact swaps (`swapIn_eq`, `swapOut_eq`); `shadow` replaces each main by a single-jump main plus a twin helper; `shadow_net`, `shadow_F`, `shadow_D0`: the NET histogram T − P, hence S, F(t), D0 and κ, are unchanged, under hypothesis `Sym` (P0 symmetry on mains) and the model-membership hypothesis `hM` (replay legality of the twin). The raw T and P counts are not equal (FALSE.md item 15). Not covered: laws that read raw T or P counts, or the gated verifier. +- **Annihilator:** `modular_le`, `step_bound`, `run_bound`, `annihilator`, `sparse_serves_le`: along a nested lineage, served ports ≤ descending owned rank. Model: functionals with support vectors in the start chart, vanishing on a leaf chart. +- **Delivery** (imports TokenCancel, FibreK, Annihilator): `single_contact_null`, `two_contacts_needed`, `const_rows_null`, `two_contacts_suffice` (net delivery needs ≥ 2 contacts with different courier rows); `three_hop_cost`, `ctype_cost`, `fL_three_gt` (three genuine hops cost ≥ f(3)); `zero_gap_counterexample` (FALSE.md item 12); `direct_read_capacity`, `entry_rank_multihop`, `dense_needed`; `never_meet_after_read`, `carrier_before_read`. R = 56 is an input. +- **DesignLaws:** `pcl`, `pcl_orth`, `one_read` (needs the DESCENT hypothesis on the owned lineage; `one_read_needs_descent`), `one_stop_per_dim`, `hyperplane_dedicated`, `rank_feed`, `matrix_rank_le`, `rank_feed_st1` (N = 104, s = 96 ⇒ ≥ 8 ports), `xclose_add`, `xclose_exact`. Not covered: multiplicity, floor numbers. +- **SharedCourier** (imports TokenCancel, FibreK): `shared_row`, `sep_row`, `exact_mod_tokens`, `tc_cleanup`, `legal_tail_iff`. Hypotheses: snapshot row constant during the chain, consumers are never couriers, couriers distinct. +- **PsiLaw** (imports HubSettle): `mapRows_comp`, `psi_two_conditions`, `span_strip_iff`, `span_law_necessary`, `span_law_prefix(_necessary)`, `span_law_not_sufficient`, `unshed_forces_span`, `three_meetings`, `relation_obstruction`, `exposed_read_no_prefix`, `add_swap`, `move_early`. Not formalised: the census counts and the G0-column-operation claim. +- Supporting: `HubSettle` (`solve_inGL`, `iff_false_example`), `RankLaw`/`RankLawC` (`copy_lossy_example`, `rank_law_proj`), `FrameSep` (`X_Y_never_share`, `reader_never_meets_Y_after`, `meet_before_read_possible`). +- **WordDuality** (imports FibreK; model data as hypotheses: charts with an involution ⊥, dim ⊥c = N − dim c, hubs z, V with ⊥z = V): `dual_run`, `dual_legal`, `dual_boundary`, `dual_dim_boundary` (legal words map to legal words; boundaries (b,e) ↦ (N−e, N−b); hub rules swap; ascent stays ascent, descent stays descent); `Mrec_dual` (for MOVE/ADD/SCALE words the matrix is the σ-relabelled transpose); `helperOf_dual`, `dualH_invoice`, `dualH_root`, `word_invoice` (the Theorem-K invoice and the roots of the caller invoice are unchanged; hyps b ≤ e ≤ N, step dims ≤ N); `selfdual_boundary` (P104's X_p/Y_p boundaries are self-dual, g = id); `hosted_block`; `nonhosted_block` (the non-hosted F block is reconstructed as data from the dual block). `copy_not_add`: COPY does not dualise to ADD as matrices (FALSE.md item 22). Not formalised: the P104 chart/physical check, the missing ⊥ frames, the palindromic construction. +- **PlaneLaws** (Mathlib only; Vec n = Fin n → ZMod 2, odd tokens/ports): SPLIT holds for any n (`split_xor`, `split_lemma`, `split_partition`); the claim that t'' is a port holds only on the full odd set when t ≠ t' (`tok_t''`, `t''_eq_one`), not for an arbitrary odd-port set; E7 counts (`e7_split`, 63×62 pairs, kernel `decide`). QUARTER is an exact partition for any n and any subspace B ∋ 1 (`QHyp`, `qhyp_Hs`, `qhyp_unique`, `quarter_partition`, `qtok_junk`, `readers_see_all`). The counts (2^(d−2) quarters × 2^(n−d) tokens each, 4 readers each at n = 7, d = 4) are kernel-checked on E7 only (`e7_block`, `e7_quarter`, `e7_totals`), in a 7-bit-mask encoding whose bridge to `Vec 7` is not proved; the general-n counts are formulas, not formalised. + +## H. Spec-break kills (SpecTS, SpecGC, SpecRankP, SpecRankP2, SpecLemmaU, SpecLemmaU2, Spec6, PadLift, Spec0Sym; supporting SpecTSUR, SpecINV, CallerBorrow, Spec0K0Core) +Setting throughout: reflection jobs 1 − x yᵀ, characteristic ≠ 2 where stated; each file's model hypotheses are stated in its note and are inherited, not re-derived. +- **SpecTSUR / SpecTS:** product formula `pp_eq`, `lemmaTS` / `lemmaTS_model`: product of k jobs = a ±1 diagonal flipping exactly k coordinates ⇒ Gram y_i·x_j = 2δ_ij, rank X = rank Y = k, range(I−D) = span(x_i). `tight_needed` (r = k cannot be dropped). +- **SpecINV / SpecGC:** `inv_word`, `det_refl`; `jobs_commute`, `twin_rule`, `twin_empty`, `split_word`, `K_data`, `gap_le`, `gc_strict`, `gc_h0`, `gc_h1` and the word versions `gc_dead_h0/h1/strict`. +- **SpecRankP / PadLift / SpecRankP2:** `rank_ge`, `rank_ge_four` (hyps: Δ = −1 on S, Δ e1 = e1 with e1 ∉ S, im(P−1) ⊆ V with dim V ≤ 2, det P = 1; `det_needed` shows det P = 1 cannot be dropped); `rank_blockdiag`, `pad_rank` (char ≠ 2; `pad_rank_char2_fails`), `pad_sq`, `lift_kill`, `lift_budget`, `job_dark`; `anc_zero`, `JNJ`, `rhoJ_invol`, `Jrho_invol`, `spec7_dead_U34` (U ∈ {3,4}; hypotheses hΛ, hP: Theorem A and the class reduction; U ≥ 5 not covered). +- **SpecLemmaU / SpecLemmaU2:** `lemmaU`, `lemmaU_mat(_T)`, `sylvester`, `sylvester_step`, `p0_q0_le_two`; `kb`, `key3`, `key4`, `Em1_bound`, `spec0_core_U4`. Open hypothesis: the k = 0 involution step `hk0`. +- **Spec6:** the group-theoretic kill L1–L4, F1 and the case split (`GX`, `job_of_GX`, …), n-free and order-free, char ≠ 2. +- **Spec0Sym + Spec0K0Core:** `Gl_closed`, `cover`, `distinct` (90 orbit representatives of the 720 orders under a group of order 8), `step_F`, `step_T`, `reduction`. Named gaps: wp vs explicit-word bridge, the model definition (`ModelOK`/`Rel`), k = 0 statements only. +- **PARTIAL: Spec0K0_ABCEDF_s0 … s6** (radical certificates, class ABCEDF): of 68 targets, 28 are identically zero (`ring`), 32 are certified by `linear_combination` certificates, **8 are NOT certified** (ω1, ω2, ω5, ω6 and the four (1,4) entries); that is 60 of 68 targets of this one class. Needs CharZero (denominators 2^k). No kill claim is made from these files. +- **CallerBorrow:** BORROW lemmas R/OS/GS in an abstract caller model (`commute_of_line`, `RebaseData.lemmaR`, `not_both`; the GS block identities are checked numerically outside Lean). + +## I. Smaller lemmas +- **LemmaW** (imports CallerBorrow): `pp_window_entry`, `lemmaW_defect` (exact; needs only that the prefix before R commutes with the mask), `lemmaW` / `lemmaW_vec` (also needs A commuting with the mask and 2 ≠ 0), `lemmaW_unique`. +- **SmallRoots** (+ SmallRootsDefs, SmallRootsData, SmallRootsA22Corners): `smallcaller_1_1_A`, `smallcaller_1_1_B`, `smallcaller_2_2_A` (`IsRoot` for the three small-caller roots, N = n + 2 units; one condition per field of the checker, `decide +kernel` on exact rationals with rank certificates), `pair_types`. Data are generated; their fidelity to the source roots rests on reading. diff --git a/research/p104-lean-premises/PR_BODY.md b/research/p104-lean-premises/PR_BODY.md new file mode 100644 index 0000000000..488ff8dcd7 --- /dev/null +++ b/research/p104-lean-premises/PR_BODY.md @@ -0,0 +1,24 @@ +Lean-only package, part 3 (combined). No κ claim. + +Kernel-checked Lean (Lean 4.33.0-rc1, pinned Mathlib; propext, Classical.choice, Quot.sound only; no `sorry`, no `native_decide`) with named hypotheses, in four groups. + +**1. Premise narrowing for #7620** (the premises on which our #7623/#7630 κ is conditional). CLEAR certificates are sound and complete and every CLEAR is lossless (`ClearCert`); owned ascent is priced symmetrically, earns no credit, and relaxed-class floors imply strict-class floors (`OwnedAscent`); exact rows are equivalent to all columns (`NativeColumns`); the 981-pair census is a delta census, with kernel-checked inheritance from #7623 (`CensusComplete`); E1, E2 and E3 (flat and tree, under atomic calls) hold for the real owned skeleton of #7630 (`OwnedSkeleton`, `OwnedTree`). `PREMISES.md` lists per premise what is now a kernel fact and what is still assumed. + +**2. Ceilings.** +- Caller side: cost closed form and the #7113 caller invoice (`CallerCost`); κ ≤ .0419448764 for rho = 2 two-arm callers under named hypotheses, with fully kernel-checked 2|2 (t ≥ 141/4096) and 1|1 (t ≥ 176/4096) bounds (`JointCeiling`). +- Whole word: **κ ≤ .0204110965 over legal (nested) words** (`WholeFloorNest.kappa_whole_floor_nested`). Hypotheses: Theorem Y (`h_Y`), slack-rank independence (`Indep`), the F-currency pricing link (`hF`) and `Priced`; the numeric cover is discharged in the kernel (`WholeFloorCover`, `NumCertK`). The verifier's nesting rule is what rules out lateral owned MOVEs (see FALSE.md item 11). +- **κ ≤ .0060197405 for class K(S22)** (`FloorK22`, `NumCertK22`), hypotheses: the rank input `ClassK22.rank_ge`, the cost-model links, and the caller-log input. +- **κ ≤ .0183952347 and κ ≤ .0134769139 for the restricted class M_V** (`CongestionI3*`), the second with descent mass ≥ 56. Hypotheses: the I3 path bound, the flag-DP minima, rank-8 decoders with C = 56 (exactly), and the public-provenance law. No known native lies in M_V, so these bound the restricted class, not the native class. +- Supporting: the 780-stop class-K LP certificate checked by `decide +kernel` (`FloorCert*`), descent pricing, helper D0 ≥ 2 ln 2 per paid stay (`FloorD0`). + +**3. Word structure.** `Shadow` (the twin has the same net invoice, hence the same S, F, D0, κ), `Annihilator` (served ports ≤ descending owned rank), `Delivery` (net delivery needs two contacts with different courier rows; three genuine hops cost ≥ f(3); direct-read capacity), `DesignLaws`, `SharedCourier`, `PsiLaw`, `WordDuality` (legal words map to legal words, the Theorem-K invoice and roots are unchanged, P104 boundaries are self-dual), `PlaneLaws` (SPLIT for any n; QUARTER an exact partition for any n and block B containing 1; counts kernel-checked on E7 only), with `HubSettle`, `RankLaw`, `RankLawC`, `FrameSep`. + +**4. Spec-break kills and small lemmas.** The rank, Gram and involution lemmas behind the kill arguments (`SpecTS`, `SpecGC`, `SpecRankP`, `SpecRankP2`, `SpecLemmaU`, `SpecLemmaU2`, `Spec6`, `PadLift`, `Spec0Sym`, with `SpecTSUR`, `SpecINV`, `CallerBorrow`), `LemmaW`, and `SmallRoots` (kernel checks of three small-caller roots). `Spec0K0_ABCEDF_s0..s6` are PARTIAL: certificates for 60 of 68 targets of one class; 8 targets are not certified. + +`PROVED.md` gives every theorem with its exact hypotheses. `FALSE.md` lists the statements Lean refuted or corrected, among them: the lateral-move floor (a counterexample, repaired by the nesting rule), the three-genuine-hop bound 3.30 (needs genuine hops), ONE-READ (needs descent), two span/obstruction statements, the "same invoice" claim for the twin (only the net is equal), a rounded recipe (off by 0.13), an arm-of-1 overcharge that withdrew an earlier ceiling, a false composition law for caller cost, and "COPY becomes ADD" under the duality (false as matrices). `CHECK.txt` has the compile table and axioms. + +Not wired into any build or verifier (unregistered, like the other Lean packages). Not included: scripts, generators and source data; the generated Lean data files are included and their fidelity rests on reading. + +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-lean-premises/README.md b/research/p104-lean-premises/README.md new file mode 100644 index 0000000000..dc1e6ff692 --- /dev/null +++ b/research/p104-lean-premises/README.md @@ -0,0 +1,56 @@ +# Lean-only release, part 3 (combined): premise narrowing, ceilings, word structure, spec-break kills + +Authors: DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. **No κ claim.** Everything here is a Lean statement with named hypotheses; Lean proves nothing about the extracted data's fidelity, the compiler, or the checker scripts. +This is the third Lean-only package. It follows the floors/bridge package (#7632) and the structural-laws package (#7634) and uses the same toolchain, Mathlib pin and module prefix (`Nov15.`). It is unregistered, like the other Lean packages: it is not wired into any build or verifier of the repository. + +## What is in it +**A. Premise narrowing for #7620.** Our #7623/#7630 κ is conditional on #7620's premises. Six Lean files shrink what is merely assumed: +`ClearCert` (every CLEAR is lossless; checker sound and complete), `OwnedAscent` (owned ascent is priced symmetrically, earns no credit, and relaxed-class floors imply strict-class floors), +`NativeColumns` (exact rows ⇔ all columns), `CensusComplete` (+ `CensusData`: the 981-pair census is a DELTA census; all used pairs are correct if the census and #7623's used pairs are), +`OwnedSkeleton` (+ `OwnedSkeletonData`: E1, E2, E3-flat for the real owned skeleton), `OwnedTree` (+ `OwnedTreeData`, `OwnedTreeCheck`: E3-tree for every depth and call-site set under atomic calls). +`PREMISES.md` lists, premise by premise, what is now a kernel fact and what is still assumed. + +**B. Caller-tied ceiling.** `CallerCost` (caller cost closed form, reproduction of the #7113 caller invoice, single crossing, composition) and `JointCeiling` +(ceiling κ ≤ .0419448764 conditional on named hypotheses; kernel-checked 2|2 bound t ≥ 141/4096 and 1|1 bound t ≥ 176/4096; the earlier .0336 is withdrawn). + +**C. SWAP-NULL law.** `SwapNull.lean`: the swap gadget, hub-undoability iff both helpers end in V or both are born in G0, zero cost change in exactly those cases, and a witness that cost-changing swaps cannot be undone (see PROVED.md §C). + +**D. Whole-word and restricted-class ceilings.** `WholeFloor*` (model, slack rank, pricing, the nesting rule, kernel interval cover) with `NumCertK*` (kernel interval arithmetic), `FloorK22*` (class K(S22)), `CongestionI3*` (the I3 congestion bound and rank-8, C = 56 junk count), with the supporting `FloorCert*` (780-stop LP certificate), `DescentPrice`, `FloorD0`, `JunkLB2`. Results: κ ≤ .0204110965 over legal (nested) words, hypotheses Theorem Y, `Indep`, `hF`, `Priced`; κ ≤ .0060197405 for class K(S22); κ ≤ .0183952347 and .0134769139 for the restricted class M_V, with I3, the flag-DP minima, rank-8 C = 56 and public provenance as hypotheses. The M_V ceilings are not floors on the native class: no known native lies in M_V. + +**E. Word structure.** `Shadow` (twin invoice has the same net), `Annihilator` (served ports ≤ descending owned rank), `Delivery` (two contacts, three-hop cost, direct-read capacity), `DesignLaws` (port/chart laws, rank-feed, XCLOSE), `SharedCourier` (shared-snapshot courier), `PsiLaw` (span law and exposed reads), `WordDuality` (legal words dualise; the invoice and roots are unchanged), `PlaneLaws` (SPLIT for any n, QUARTER exact partition; counts on E7 only), with `HubSettle`, `RankLaw`, `RankLawC`, `FrameSep`. + +**F. Spec-break kills.** `SpecTSUR`, `SpecTS`, `SpecINV`, `SpecGC`, `SpecRankP`, `SpecRankP2`, `SpecLemmaU`, `SpecLemmaU2`, `Spec6`, `PadLift`, `Spec0Sym` (+ `Spec0K0Core`), `CallerBorrow`: rank, Gram and involution lemmas used by the kill arguments, with their model hypotheses stated. `Spec0K0_ABCEDF_s0` to `s6` are PARTIAL: radical certificates for 60 of the 68 targets of one class; 8 targets are not certified. + +**G. Smaller lemmas.** `LemmaW` (borrow lemma W), `SmallRoots` (+ Defs, Data, A22Corners; kernel checks of three small-caller roots). + +Labels such as R3, RB4 and AUDIT5 in the per-file notes refer to internal working notes that are not part of this package. + +| file | content | +|---|---| +| PREMISES.md | per premise: kernel FACT vs still ASSUMED | +| PROVED.md | every theorem with its exact hypotheses | +| FALSE.md | prose statements Lean refuted or corrected | +| CHECK.txt | compile table (one file at a time, 3.5 GB guard) and axioms | +| SHIPPED.txt | files already in #7632/#7634 (byte-identical) | +| PR_BODY.md | draft PR description | +| NOTICE.md, LICENSE | credit and Apache-2.0 | +| lean/ | Lean subproject; sources in `lean/Nov15/`, one `.md` per theorem file | + +## Pins +- Toolchain `leanprover/lean4:v4.33.0-rc1` (`lean/lean-toolchain`). +- Mathlib commit `55b7917b472489c7c56a0fa6393af05cfd536599` (`rev` in `lean/lakefile.toml`; `lean/lake-manifest.json` pins every transitive package). + +## Build +``` +cd lean +lake exe cache get # prebuilt Mathlib oleans for the pinned commit +lake build # library Nov15 (default target; every module in lean/Nov15) +``` +Peak memory per file is at most 3.5 GB (the guard; the chunked data files are split for this) (CHECK.txt). The `lake build` route was not run for CHECK.txt (it downloads Mathlib); CHECK.txt used `lean -o` file by file in dependency order against an existing build of the pinned commit. + +## Data files +`CensusData`, `OwnedSkeletonData`, `OwnedTreeData` are generated Lean (lists extracted from the #7630 word and affected-pair files, and a copy of the #7113 caller). Lean re-checks everything derived from them; the extraction itself (a script) is not shipped and its fidelity rests on reading. +The rational-cell data inside `JointCeiling.lean` is inline; the scripts that produced it are not shipped. + +## Not included +All scripts and generators (the Singular, python and LP tooling that produced the data files and certificates), the source data files (word, certificates, pair lists), and the internal working notes the per-file `.md` notes cite. Generated Lean data files are included; their fidelity to the sources rests on reading. diff --git a/research/p104-lean-premises/SHIPPED.txt b/research/p104-lean-premises/SHIPPED.txt new file mode 100644 index 0000000000..de30d839ff --- /dev/null +++ b/research/p104-lean-premises/SHIPPED.txt @@ -0,0 +1,15 @@ +Files in this package that the first Lean package (PR #7632, floors and bridge) and/or the second (PR #7634) already contain, identical in statements and proofs (only comments were scrubbed of internal references). +They are here only so that this folder builds on its own (import closure of the new files: FloorEndToEnd <- FloorGlue <- ExportLaw, Floor <- TokenCancel). +If you overlay this package onto those trees, skip these. All paths are lean/Nov15/.lean. + +Nov15/TokenCancel.lean +Nov15/ExportLaw.lean +Nov15/Floor.lean +Nov15/FloorGlue.lean +Nov15/FloorEndToEnd.lean + +New in this package (not in #7632 or #7634): +Nov15/ClearCert.lean Nov15/OwnedAscent.lean Nov15/NativeColumns.lean Nov15/CensusData.lean Nov15/CensusComplete.lean +Nov15/OwnedSkeletonData.lean Nov15/OwnedSkeleton.lean Nov15/OwnedTreeData.lean Nov15/OwnedTree.lean Nov15/OwnedTreeCheck.lean +Nov15/CallerCost.lean Nov15/JointCeiling.lean (plus one .md note per theorem file) +SwapWord.lean, RelaySandwich.lean (also shipped in earlier packages) diff --git a/research/p104-lean-premises/lean/Nov15/Annihilator.lean b/research/p104-lean-premises/lean/Nov15/Annihilator.lean new file mode 100644 index 0000000000..170095c9ff --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Annihilator.lean @@ -0,0 +1,271 @@ +/- +Annihilator . See Annihilator.md. internal notes section 1. + +An entry vector's lineage: charts c 0, ..., c n (subspaces of V); step i is a PUBLIC ascent (c i ≤ c (i+1)) or an +OWNED MOVE that is NESTED (either direction; WholeFloorNest / LAT.md). Owned rank paid = sum of the owned +descents (finrank (c i) - finrank (c (i+1))). Ports a carry functionals φ a : V → K, and the entry vector's support +vectors u b lie in the start chart. Each port a has a leaf chart on which φ a vanishes. +THEOREM: rank of the Gram block [φ a (u b)] ≤ owned descending rank. +Corollary: identity Gram block (orthonormal group) on P ⇒ |P| ≤ owned descending rank. +Counterexample: drop nesting (a lateral owned MOVE, rank 0) and the theorem fails. +-/ +import Mathlib.LinearAlgebra.Dual.Lemmas +import Mathlib.LinearAlgebra.Matrix.Rank +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +import Mathlib.Data.ZMod.Basic + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace Annihilator +open Module + +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] [FiniteDimensional K V] + +/-- modular inequality: for A ≤ B, dim(Φ ⊓ B) + dim A ≤ dim(Φ ⊓ A) + dim B. -/ +theorem modular_le (Φ A B : Submodule K (Dual K V)) (hAB : A ≤ B) : + finrank K (Φ ⊓ B : Submodule K (Dual K V)) + finrank K A + ≤ finrank K (Φ ⊓ A : Submodule K (Dual K V)) + finrank K B := by + have h := Submodule.finrank_sup_add_finrank_inf_eq (Φ ⊓ B) A + have h1 : (Φ ⊓ B) ⊓ A = Φ ⊓ A := by + ext x; simp only [Submodule.mem_inf]; constructor + · rintro ⟨⟨a, _⟩, c⟩; exact ⟨a, c⟩ + · rintro ⟨a, c⟩; exact ⟨⟨a, hAB c⟩, c⟩ + have h2 : finrank K ((Φ ⊓ B) ⊔ A : Submodule K (Dual K V)) ≤ finrank K B := by + apply Submodule.finrank_mono + exact sup_le inf_le_right hAB + rw [h1] at h + omega + +/-- the K-set of a chart: functionals of Φ vanishing on c. -/ +def Kc (Φ : Submodule K (Dual K V)) (c : Submodule K V) : Submodule K (Dual K V) := Φ ⊓ c.dualAnnihilator + +theorem finrank_ann (c : Submodule K V) : + finrank K c.dualAnnihilator + finrank K c = finrank K V := by + have := Subspace.finrank_add_finrank_dualAnnihilator_eq c + omega + +/-- one step: finrank K(D) ≤ finrank (K(C) ⊓ K(D)) + (descent from C to D), for a public ascent or a nested owned MOVE. -/ +theorem step_bound (Φ : Submodule K (Dual K V)) (C D : Submodule K V) (h : D ≤ C ∨ C ≤ D) : + finrank K (Kc Φ D) ≤ finrank K (Kc Φ C ⊓ Kc Φ D : Submodule K (Dual K V)) + (finrank K C - finrank K D) := by + rcases h with hDC | hCD + · have hann : C.dualAnnihilator ≤ D.dualAnnihilator := Submodule.dualAnnihilator_anti hDC + have hm := modular_le Φ C.dualAnnihilator D.dualAnnihilator hann + have e : (Kc Φ C ⊓ Kc Φ D : Submodule K (Dual K V)) = Kc Φ C := by + apply inf_eq_left.mpr + exact inf_le_inf_left _ hann + rw [e] + have a1 := finrank_ann C + have a2 := finrank_ann D + have a3 : finrank K D ≤ finrank K C := Submodule.finrank_mono hDC + unfold Kc + omega + · have hann : D.dualAnnihilator ≤ C.dualAnnihilator := Submodule.dualAnnihilator_anti hCD + have e : (Kc Φ C ⊓ Kc Φ D : Submodule K (Dual K V)) = Kc Φ D := by + apply inf_eq_right.mpr + exact inf_le_inf_left _ hann + rw [e]; omega + +/-- step kinds. -/ +inductive Kind | pub | own + deriving DecidableEq + +/-- a lineage. Step i goes from `c i` to `c (i+1)` for i < n. -/ +structure Lineage (K V : Type*) [Field K] [AddCommGroup V] [Module K V] where + n : ℕ + c : ℕ → Submodule K V + kind : ℕ → Kind + +/-- legality: public steps ascend; owned steps are nested (either direction). -/ +def Lineage.Legal (L : Lineage K V) : Prop := + ∀ i < L.n, match L.kind i with + | Kind.pub => L.c i ≤ L.c (i + 1) + | Kind.own => L.c (i + 1) ≤ L.c i ∨ L.c i ≤ L.c (i + 1) + +/-- owned DESCENDING rank paid: sum over owned steps of (dim c i - dim c (i+1)) (truncated). -/ +noncomputable def Lineage.ownRank (L : Lineage K V) : ℕ := + ∑ i ∈ Finset.range L.n, if L.kind i = Kind.own then finrank K (L.c i) - finrank K (L.c (i + 1)) else 0 + +theorem Lineage.legal_step {L : Lineage K V} (hL : L.Legal) {i : ℕ} (hi : i < L.n) : + L.c (i + 1) ≤ L.c i ∨ L.c i ≤ L.c (i + 1) := by + have := hL i hi + cases hk : L.kind i <;> simp only [hk] at this + · exact Or.inr this + · exact this + +/-- the running sum of K-sets stays within dim K(start) + owned rank so far. -/ +theorem run_bound (Φ : Submodule K (Dual K V)) (L : Lineage K V) (hL : L.Legal) : + ∀ m ≤ L.n, finrank K (((Finset.range (m + 1)).sup fun j => Kc Φ (L.c j) : Submodule K (Dual K V))) + ≤ finrank K (Kc Φ (L.c 0)) + + ∑ i ∈ Finset.range m, if L.kind i = Kind.own then finrank K (L.c i) - finrank K (L.c (i + 1)) else 0 := by + intro m + induction m with + | zero => intro _; rw [Finset.range_one, Finset.sup_singleton]; simp + | succ m ih => + intro hm + have ih := ih (by omega) + set N : Submodule K (Dual K V) := (Finset.range (m + 1)).sup fun j => Kc Φ (L.c j) with hN + have hsucc : ((Finset.range (m + 1 + 1)).sup fun j => Kc Φ (L.c j)) = N ⊔ Kc Φ (L.c (m + 1)) := by + rw [Finset.range_add_one (n := m + 1), Finset.sup_insert, sup_comm] + rw [hsucc] + have hlt : m < L.n := by omega + have hstep := step_bound Φ (L.c m) (L.c (m + 1)) (L.legal_step hL hlt) + have hKN : Kc Φ (L.c m) ≤ N := Finset.le_sup (f := fun j => Kc Φ (L.c j)) (Finset.mem_range.mpr (by omega)) + have hmono : finrank K (Kc Φ (L.c m) ⊓ Kc Φ (L.c (m + 1)) : Submodule K (Dual K V)) + ≤ finrank K (N ⊓ Kc Φ (L.c (m + 1)) : Submodule K (Dual K V)) := + Submodule.finrank_mono (inf_le_inf_right _ hKN) + have hsi := Submodule.finrank_sup_add_finrank_inf_eq N (Kc Φ (L.c (m + 1))) + -- cost of step m + have hcost : (finrank K (L.c m) - finrank K (L.c (m + 1))) ≤ + (if L.kind m = Kind.own then finrank K (L.c m) - finrank K (L.c (m + 1)) else 0) + 0 := by + cases hk : L.kind m + · -- public: c m ≤ c (m+1), so truncated difference is 0 + have := L.legal_step hL hlt + have hl := hL m hlt + simp only [hk] at hl + have := Submodule.finrank_mono hl + simp; omega + · simp + rw [Finset.sum_range_succ] + omega + +/-- a delivery instance: ports `P` (functionals φ), support vectors `u`; the support lies in the start chart, each +port has a leaf chart in the lineage on which its functional vanishes. -/ +structure Delivery (K V : Type*) [Field K] [AddCommGroup V] [Module K V] (P S : Type*) where + L : Lineage K V + φ : P → Dual K V + u : S → V + start : ∀ b, u b ∈ L.c 0 + leafIdx : P → ℕ + leaf_le : ∀ a, leafIdx a ≤ L.n + leaf : ∀ a, ∀ x ∈ L.c (leafIdx a), φ a x = 0 + +/-- the Gram block [φ a (u b)]. -/ +def Delivery.gram {P S : Type*} (D : Delivery K V P S) : Matrix P S K := fun a b => D.φ a (D.u b) + +/-- **ANNIHILATOR lemma.** Gram rank ≤ owned descending rank (any number of hops). -/ +theorem annihilator {P S : Type*} [Fintype P] [Fintype S] (D : Delivery K V P S) (hL : D.L.Legal) : + D.gram.rank ≤ D.L.ownRank := by + classical + set Φ : Submodule K (Dual K V) := Submodule.span K (Set.range D.φ) with hΦ + -- Φ is covered by the running sum of K-sets + have hcover : Φ ≤ (Finset.range (D.L.n + 1)).sup fun j => Kc Φ (D.L.c j) := by + apply Submodule.span_le.mpr + rintro _ ⟨a, rfl⟩ + have hmem : D.φ a ∈ Kc Φ (D.L.c (D.leafIdx a)) := by + refine ⟨Submodule.subset_span ⟨a, rfl⟩, ?_⟩ + exact (Submodule.mem_dualAnnihilator _).mpr (D.leaf a) + have hle : Kc Φ (D.L.c (D.leafIdx a)) ≤ (Finset.range (D.L.n + 1)).sup fun j => Kc Φ (D.L.c j) := + Finset.le_sup (f := fun j => Kc Φ (D.L.c j)) (Finset.mem_range.mpr (by have := D.leaf_le a; omega)) + exact hle hmem + have h1 : finrank K Φ ≤ finrank K (Kc Φ (D.L.c 0)) + D.L.ownRank := by + have := run_bound Φ D.L hL D.L.n le_rfl + have := Submodule.finrank_mono hcover + unfold Lineage.ownRank + omega + -- Gram rank = dim (map E Φ), and dim Φ = dim (map E Φ) + dim (Φ ⊓ ker E) ≥ ... + let E : Dual K V →ₗ[K] (S → K) := LinearMap.pi fun b => (LinearMap.applyₗ (D.u b)) + have hE : ∀ f b, E f b = f (D.u b) := fun f b => rfl + have hset : Set.range D.gram.row = E '' Set.range D.φ := by + ext v; simp only [Set.mem_range, Set.mem_image] + constructor + · rintro ⟨a, rfl⟩; exact ⟨D.φ a, ⟨a, rfl⟩, by ext b; simp [hE, Delivery.gram, Matrix.row]⟩ + · rintro ⟨_, ⟨a, rfl⟩, rfl⟩; exact ⟨a, by ext b; simp [hE, Delivery.gram, Matrix.row]⟩ + have hrank : D.gram.rank = finrank K (Φ.map E : Submodule K (S → K)) := by + rw [Matrix.rank_eq_finrank_span_row, hset, hΦ, Submodule.map_span] + have hnull : finrank K (Φ.map E : Submodule K (S → K)) + finrank K (Φ ⊓ LinearMap.ker E : Submodule K (Dual K V)) + = finrank K Φ := by + have := LinearMap.finrank_range_add_finrank_ker (V := Φ) (E.domRestrict Φ) + have e1 : LinearMap.range (E.domRestrict Φ) = Φ.map E := by + rw [LinearMap.range_domRestrict] + have e2 : finrank K (LinearMap.ker (E.domRestrict Φ)) = finrank K (Φ ⊓ LinearMap.ker E : Submodule K (Dual K V)) := by + have hm : (LinearMap.ker (E.domRestrict Φ)).map Φ.subtype = Φ ⊓ LinearMap.ker E := by + rw [LinearMap.ker_domRestrict, Submodule.map_comap_subtype] + rw [← hm] + exact (Submodule.finrank_map_subtype_eq Φ _).symm + rw [e1, e2] at this; exact this + have hK0 : Kc Φ (D.L.c 0) ≤ Φ ⊓ LinearMap.ker E := by + refine inf_le_inf_left _ ?_ + intro f hf + ext b + exact (Submodule.mem_dualAnnihilator _).mp hf _ (D.start b) + have := Submodule.finrank_mono hK0 + rw [hrank] + omega + +/-! ### Corollary: orthonormal groups (identity Gram block) -/ + +/-- An identity block on ports `P`: support vectors `ι a` with φ a (u (ι a')) = δ. -/ +theorem identity_block_rank {P S : Type*} [Fintype P] [Fintype S] [DecidableEq P] [DecidableEq S] (G : Matrix P S K) + (ι : P → S) (hι : Function.Injective ι) (hG : ∀ a a', G a (ι a') = if a = a' then 1 else 0) : + Fintype.card P ≤ G.rank := by + classical + let Sg : Matrix S P K := fun b a' => if b = ι a' then 1 else 0 + have hprod : G * Sg = 1 := by + ext a a' + rw [Matrix.mul_apply, Finset.sum_eq_single (ι a')] + · simp [Sg, hG, Matrix.one_apply] + · intro b _ hb; simp [Sg, hb] + · simp + have := Matrix.rank_mul_le_left G Sg + rw [hprod, Matrix.rank_one] at this + exact this + +/-- **COROLLARY.** a lineage whose Gram block over its ports is an identity block serves at most +its owned descending rank many ports, with any number of hops. -/ +theorem sparse_serves_le {P S : Type*} [Fintype P] [Fintype S] [DecidableEq P] [DecidableEq S] (D : Delivery K V P S) + (hL : D.L.Legal) (ι : P → S) (hι : Function.Injective ι) + (hG : ∀ a a', D.φ a (D.u (ι a')) = if a = a' then 1 else 0) : + Fintype.card P ≤ D.L.ownRank := + (identity_block_rank D.gram ι hι hG).trans (annihilator D hL) + +/-- Family version: lineages are disjoint in owned MOVEs (each MOVE carries one vector), so their owned +ranks add up to at most the word's total descending owned rank R. Then the ports served by sparse +(identity-block) entries number at most R. -/ +theorem total_sparse_le {ι : Type*} (s : Finset ι) (card : ι → ℕ) (rk : ι → ℕ) (R : ℕ) + (hc : ∀ i ∈ s, card i ≤ rk i) (hR : ∑ i ∈ s, rk i ≤ R) : ∑ i ∈ s, card i ≤ R := + (Finset.sum_le_sum hc).trans hR + +/-! ### The NESTING hypothesis is necessary: a lateral owned MOVE of rank 0 breaks the bound -/ +section Lateral +/-- V = ℚ^2; chart 0 = span e0, chart 1 = span e1 (incomparable): a lateral owned MOVE. -/ +abbrev V2 := Fin 2 → ℚ + +def ch0 : Submodule (ℚ) V2 := Submodule.span (ℚ) {Pi.single 0 1} +def ch1 : Submodule (ℚ) V2 := Submodule.span (ℚ) {Pi.single 1 1} + +/-- the coordinate-0 functional. -/ +def coord0 : Dual (ℚ) V2 := LinearMap.proj 0 + +theorem lateral_counterexample : + -- one owned MOVE ch0 → ch1 pays owned descending rank 0 (dims equal), yet the 1x1 Gram block [coord0 e0] = [1] has rank 1. + finrank (ℚ) ch0 = finrank (ℚ) ch1 ∧ (coord0 (Pi.single 0 1) : ℚ) = 1 + ∧ (∀ x ∈ ch1, coord0 x = 0) ∧ ¬ (ch1 ≤ ch0 ∨ ch0 ≤ ch1) := by + refine ⟨?_, by simp [coord0], ?_, ?_⟩ + · have h0 : (Pi.single 0 1 : V2) ≠ 0 := by intro h; have := congrFun h 0; simp at this + have h1 : (Pi.single 1 1 : V2) ≠ 0 := by intro h; have := congrFun h 1; simp at this + unfold ch0 ch1 + exact (finrank_span_singleton h0).trans (finrank_span_singleton h1).symm + · intro x hx + unfold ch1 at hx + rcases Submodule.mem_span_singleton.mp hx with ⟨a, rfl⟩ + simp [coord0] + · rintro (h | h) + · have := h (Submodule.mem_span_singleton_self (Pi.single 1 1 : V2)) + unfold ch0 at this + rcases Submodule.mem_span_singleton.mp this with ⟨a, ha⟩ + have := congrFun ha 1 + simp at this + · have := h (Submodule.mem_span_singleton_self (Pi.single 0 1 : V2)) + unfold ch1 at this + rcases Submodule.mem_span_singleton.mp this with ⟨a, ha⟩ + have := congrFun ha 0 + simp at this + +end Lateral + +#print axioms annihilator +#print axioms sparse_serves_le +#print axioms lateral_counterexample + +end Annihilator diff --git a/research/p104-lean-premises/lean/Nov15/Annihilator.md b/research/p104-lean-premises/lean/Nov15/Annihilator.md new file mode 100644 index 0000000000..39446d9c46 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Annihilator.md @@ -0,0 +1,30 @@ +# Annihilator : the ANNIHILATOR lemma of delivery D3 in Lean + +`Nov15/Annihilator.lean`, Lean 4.33.0-rc1 + Mathlib, kernel only: no `sorry`, no `native_decide`; all theorems print +`[propext, Classical.choice, Quot.sound]`. Builds in 6 s / 2.0 GB. + +## Model +V finite-dimensional over a field K. A `Lineage`: charts c 0 ... c n (subspaces of V); step i is PUBLIC (c i <= c (i+1)) or an OWNED MOVE that is NESTED +(either direction: WholeFloorNest / LAT.md). `ownRank` = sum over owned steps of the descent dim (c i) - dim (c (i+1)) (truncated), i.e. the +"descending owned rank". A `Delivery`: ports a with functionals phi a (the f_a = (. u_a)), support vectors u b all lying in the START chart, +and for each port a a leaf chart c (leafIdx a) of the lineage on which phi a vanishes. + +## Theorems +* `modular_le`, `step_bound`: for a nested step C -> D, dim K(D) <= dim (K(C) meet K(D)) + (dim C - dim D)^+, where K(c) = span(phi) meet Ann(c). +* `run_bound`: the running sum N_m of all K(c_j), j <= m, has dim N_m <= dim K(c_0) + (owned descents so far). (Plain "dim K(c) grows by <= descent" is not + enough since K shrinks again on ascents; it is the cumulative sum N that carries the induction.) +* **`annihilator`**: rank of the Gram block [phi a (u b)] <= `ownRank`. Proof: Phi = span phi lies in N_n (every port has a leaf), so dim Phi <= dim K(c_0) + ownRank; + and rank Gram = dim (E Phi) = dim Phi - dim(Phi meet ker E) <= dim Phi - dim K(c_0) (K(c_0) lies in ker E since u b in c_0). +* `identity_block_rank`, **`sparse_serves_le`**: if the Gram block over ports P has an identity sub-block (orthonormal group), then |P| <= ownRank, + for any number of hops. `total_sparse_le`: lineages are disjoint in MOVEs (each MOVE carries one vector), so the ports served by identity-block entries total + at most the word's descending owned rank R (hypothesis: sum of the lineages' ranks <= R; R = 56 on S22 is Theorem K + [C d3p], not in this file). + +## Paper statement vs Lean +D3 sec. 1 is TRUE as written under these readings, with two points made explicit: +1. "K(start) = 0 / dim F_w >= Gram rank" holds after restricting the functionals to the start chart; in Lean this appears as + dim Phi - dim K(c_0) >= rank Gram, and the final bound is the same inequality, rank Gram <= sum of descents. +2. The NESTING of owned MOVEs is NECESSARY. `lateral_counterexample` (V = Q^2, ch0 = span e0, ch1 = span e1, equal dim, incomparable): a lateral owned MOVE + ch0 -> ch1 pays owned descending rank 0, the functional coord0 vanishes on ch1 and has coord0(e0) = 1 (Gram block [1] of rank 1), so rank Gram = 1 > 0 = ownRank. + So the lemma, like the whole-floor bound (WholeFloor.md sec. 3-4), depends on the verifier's proper-nesting rule (local.py:66, LAT.md). +Also stated by the card but not formalised: that an orthonormal group NEEDS an identity block (a design requirement; here the identity block is the hypothesis), +and the count 56 / the 9-dimensionality of dense entries (F2^9 structure). diff --git a/research/p104-lean-premises/lean/Nov15/BFormOpt.lean b/research/p104-lean-premises/lean/Nov15/BFormOpt.lean new file mode 100644 index 0000000000..22104e9f90 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/BFormOpt.lean @@ -0,0 +1,664 @@ +/- +B-FORM PER-SPLIT OPTIMALITY . Formalises CALLERFLOOR R2 sec 1 (L1-L4) for B ports, pointwise in s = 1 - t in [0,1]. +Kernel only: no sorry, no native_decide. See BFormOpt.md for the model, the statements, and the corrections. +-/ +import Nov15.JointCeiling +import Mathlib.Analysis.Convex.SpecificFunctions.Pow +import Mathlib.Analysis.MeanInequalitiesPow +open Finset + +namespace BFormOpt +open JointCeiling CallerCost + +/-! ### 0. concavity toolkit (phi(l) = (8l)^s, tau(d) = (8d+1)^s, psi = tau - phi) -/ + +/-- two-point Karamata for x^s: (x, y+d) is more spread than (x+d, y) when x <= y. -/ +lemma spread {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) {x y d : ℝ} (hx : 0 ≤ x) (hxy : x ≤ y) (hd : 0 ≤ d) : + x ^ s + (y + d) ^ s ≤ (x + d) ^ s + y ^ s := by + rcases eq_or_lt_of_le hxy with h | h + · subst h; linarith + have hc := Real.concaveOn_rpow hs0 hs1 + have hL : 0 < y + d - x := by linarith + have hy' : (0:ℝ) ≤ y + d := by linarith + have hab : (y - x) / (y + d - x) + d / (y + d - x) = 1 := by + rw [← add_div, div_eq_one_iff_eq hL.ne']; ring + have hab' : d / (y + d - x) + (y - x) / (y + d - x) = 1 := by linarith + have h1 := hc.2 (Set.mem_Ici.2 hx) (Set.mem_Ici.2 hy') (div_nonneg (by linarith) hL.le) (div_nonneg hd hL.le) hab + have h2 := hc.2 (Set.mem_Ici.2 hx) (Set.mem_Ici.2 hy') (div_nonneg hd hL.le) (div_nonneg (by linarith) hL.le) hab' + simp only [smul_eq_mul] at h1 h2 + have e1 : (y - x) / (y + d - x) * x + d / (y + d - x) * (y + d) = x + d := by + field_simp; ring + have e2 : d / (y + d - x) * x + (y - x) / (y + d - x) * (y + d) = y := by + field_simp; ring + rw [e1] at h1; rw [e2] at h2 + have k1 : (y - x) / (y + d - x) * x ^ s + d / (y + d - x) * x ^ s = x ^ s := by + rw [← add_mul, hab, one_mul] + have k2 : d / (y + d - x) * (y + d) ^ s + (y - x) / (y + d - x) * (y + d) ^ s = (y + d) ^ s := by + rw [← add_mul, hab', one_mul] + linarith [h1, h2] + +/-- phi' : line cost, phi'(0) = 0 (so s = 0 counts lines) -/ +noncomputable def ph (s : ℝ) (l : ℕ) : ℝ := if l = 0 then 0 else ((8 * l : ℕ) : ℝ) ^ s +noncomputable def ta (s : ℝ) (d : ℕ) : ℝ := ((8 * d + 1 : ℕ) : ℝ) ^ s +noncomputable def ps (s : ℝ) (d : ℕ) : ℝ := ta s d - ph s d + +lemma ph_zero (s : ℝ) : ph s 0 = 0 := by simp [ph] +lemma ph_pos' (s : ℝ) {l : ℕ} (h : 1 ≤ l) : ph s l = ((8 * l : ℕ) : ℝ) ^ s := by + unfold ph; rw [if_neg (by omega)] + +/-- increments of phi' -/ +noncomputable def dl (s : ℝ) (j : ℕ) : ℝ := ph s (j + 1) - ph s j + +lemma dl_nonneg {s : ℝ} (hs0 : 0 ≤ s) (j : ℕ) : 0 ≤ dl s j := by + unfold dl + rcases Nat.eq_zero_or_pos j with rfl | hj + · rw [ph_zero, ph_pos' s (by omega)]; simp only [sub_zero]; positivity + · rw [ph_pos' s (by omega), ph_pos' s (by omega)] + have : ((8 * j : ℕ) : ℝ) ≤ ((8 * (j + 1) : ℕ) : ℝ) := by exact_mod_cast (by omega) + have := Real.rpow_le_rpow (by positivity) this hs0 + linarith + +lemma dl_anti {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (j : ℕ) : dl s (j + 1) ≤ dl s j := by + unfold dl + rcases Nat.eq_zero_or_pos j with rfl | hj + · rw [ph_zero, ph_pos' s (by omega), ph_pos' s (by omega)] + have h := Real.rpow_add_le_add_rpow (a := 8) (b := 8) (by norm_num) (by norm_num) hs0 hs1 + norm_num at h ⊢ + linarith + · rw [ph_pos' s (by omega), ph_pos' s (by omega), ph_pos' s (by omega)] + have := spread hs0 hs1 (x := ((8 * j : ℕ) : ℝ)) (y := ((8 * (j + 1) : ℕ) : ℝ)) (d := 8) (by positivity) + (by exact_mod_cast (by omega)) (by norm_num) + have e1 : ((8 * j : ℕ) : ℝ) + 8 = ((8 * (j + 1) : ℕ) : ℝ) := by push_cast; ring + have e2 : ((8 * (j + 1) : ℕ) : ℝ) + 8 = ((8 * (j + 1 + 1) : ℕ) : ℝ) := by push_cast; ring + rw [e1, e2] at this + linarith + +lemma ps_anti {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) {d : ℕ} (hd : 1 ≤ d) : ps s (d + 1) ≤ ps s d := by + unfold ps ta + rw [ph_pos' s (by omega), ph_pos' s hd] + have := spread hs0 hs1 (x := ((8 * d : ℕ) : ℝ)) (y := ((8 * (d + 1) : ℕ) : ℝ)) (d := 1) (by positivity) + (by exact_mod_cast (by omega)) (by norm_num) + have e1 : ((8 * d : ℕ) : ℝ) + 1 = ((8 * d + 1 : ℕ) : ℝ) := by push_cast; ring + have e2 : ((8 * (d + 1) : ℕ) : ℝ) + 1 = ((8 * (d + 1) + 1 : ℕ) : ℝ) := by push_cast; ring + rw [e1, e2] at this + linarith + +lemma ps_le_one {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) {d : ℕ} (hd : 1 ≤ d) : ps s d ≤ ps s 1 := by + induction d, hd using Nat.le_induction with + | base => exact le_rfl + | succ d hd ih => exact (ps_anti hs0 hs1 hd).trans ih + +/-- ps is antitone on [1, oo) -/ +lemma ps_antitone {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) {d d' : ℕ} (hd : 1 ≤ d) (h : d ≤ d') : ps s d' ≤ ps s d := by + induction d', h using Nat.le_induction with + | base => exact le_rfl + | succ d' hd' ih => exact (ps_anti hs0 hs1 (by omega)).trans ih + +/-! ### 1. Abel summation (the Karamata engine) -/ + +/-- if a is nonincreasing (up to index m) and all partial sums of D up to m are >= 0 then sum_{i= a_m * sum_{i= ... -/ +lemma abel_aux (a D : ℕ → ℝ) (m : ℕ) (ha : ∀ i, i < m → a (i + 1) ≤ a i) + (hS : ∀ J, J ≤ m → 0 ≤ ∑ i ∈ range J, D i) : + a m * (∑ i ∈ range m, D i) ≤ ∑ i ∈ range m, a i * D i := by + induction m with + | zero => simp + | succ m ih => + have ih' := ih (fun i hi => ha i (by omega)) (fun J hJ => hS J (by omega)) + have hSm1 := hS (m + 1) le_rfl + have hSm := hS m (by omega) + have h1 := ha m (by omega) + rw [Finset.sum_range_succ] at hSm1 ⊢ + rw [Finset.sum_range_succ] + nlinarith [mul_le_mul_of_nonneg_right h1 hSm1] + +lemma abel_nonneg (a D : ℕ → ℝ) (m : ℕ) (ha : ∀ i, i < m → a (i + 1) ≤ a i) (ha0 : 0 ≤ a m) + (hS : ∀ J, J ≤ m → 0 ≤ ∑ i ∈ range J, D i) : 0 ≤ ∑ i ∈ range m, a i * D i := by + have := abel_aux a D m ha hS + have := mul_nonneg ha0 (hS m le_rfl) + linarith + +/-! ### 2. schedules and the line-bill lower bound (L1, pointwise in s, ALL arm lengths) + A schedule of an arm of length x is a list of lines (start stage, length): a line is one role's idle interval. + Feasibility = exact occupancy n_c at every stage and at most cap_c lines across boundary c|c+1. + We prove: every feasible schedule has bill sum phi(len) >= CB (a closed form of n, cap only), for every s in [0,1]. -/ +abbrev Line := ℕ × ℕ + +def covN (σ : List Line) (c : ℕ) : ℕ := (σ.map fun p => if p.1 ≤ c ∧ c < p.1 + p.2 then 1 else 0).sum +def crossN (σ : List Line) (c : ℕ) : ℕ := (σ.map fun p => if p.1 ≤ c ∧ c + 1 < p.1 + p.2 then 1 else 0).sum +def Valid (x : ℕ) (σ : List Line) : Prop := ∀ p ∈ σ, 1 ≤ p.2 ∧ p.1 + p.2 ≤ x +noncomputable def bill (s : ℝ) (σ : List Line) : ℝ := (σ.map fun p => ph s p.2).sum + +lemma list_swap {M : Type*} [AddCommMonoid M] (σ : List Line) (m : ℕ) (g : Line → ℕ → M) : + (σ.map fun p => ∑ k ∈ range m, g p k).sum = ∑ k ∈ range m, (σ.map fun p => g p k).sum := by + induction σ with + | nil => simp + | cons p σ ih => simp only [List.map_cons, List.sum_cons, ih, Finset.sum_add_distrib] + +lemma len_eq {x : ℕ} {p : Line} (h : p.1 + p.2 ≤ x) : + p.2 = ∑ c ∈ range x, if p.1 ≤ c ∧ c < p.1 + p.2 then 1 else 0 := by + rw [Finset.sum_boole] + have : (range x).filter (fun c => p.1 ≤ c ∧ c < p.1 + p.2) = Ico p.1 (p.1 + p.2) := by + ext c; simp only [Finset.mem_filter, Finset.mem_range, Finset.mem_Ico]; omega + rw [this]; simp + +lemma sum_len_eq {x : ℕ} {σ : List Line} (hv : Valid x σ) : + (σ.map fun p => p.2).sum = ∑ c ∈ range x, covN σ c := by + unfold covN + rw [← list_swap] + congr 1 + apply List.map_congr_left + intro p hp + exact len_eq (hv p hp).2 + +lemma min_eq (l J : ℕ) : min l J = ∑ j ∈ range J, if j + 1 ≤ l then 1 else 0 := by + rw [Finset.sum_boole] + have : (range J).filter (fun j => j + 1 ≤ l) = range (min l J) := by + ext c; simp only [Finset.mem_filter, Finset.mem_range]; omega + rw [this]; simp + +lemma excess_le {x J : ℕ} (hJ : 1 ≤ J) {p : Line} (hp : 1 ≤ p.2 ∧ p.1 + p.2 ≤ x) : + p.2 - min p.2 J ≤ ∑ k ∈ range (x - J), if p.1 ≤ k ∧ k + 1 < p.1 + p.2 then 1 else 0 := by + rw [Finset.sum_boole] + have hsub : Ico p.1 (p.1 + p.2 - J) ⊆ (range (x - J)).filter (fun k => p.1 ≤ k ∧ k + 1 < p.1 + p.2) := by + intro k hk + simp only [Finset.mem_Ico, Finset.mem_filter, Finset.mem_range] at hk ⊢ + omega + have := Finset.card_le_card hsub + simp only [Nat.card_Ico] at this + have h2 : p.2 - min p.2 J = p.1 + p.2 - J - p.1 := by omega + rw [h2]; exact_mod_cast this + +lemma ph_layer {s : ℝ} {x l : ℕ} (h : l ≤ x) : + ph s l = ∑ j ∈ range x, dl s j * (if j + 1 ≤ l then 1 else 0) := by + obtain ⟨r, rfl⟩ : ∃ r, x = l + r := ⟨x - l, by omega⟩ + rw [Finset.sum_range_add] + have h1 : ∑ j ∈ range l, dl s j * (if j + 1 ≤ l then (1:ℝ) else 0) = ∑ j ∈ range l, dl s j := by + apply Finset.sum_congr rfl + intro j hj; rw [Finset.mem_range] at hj; simp [show j + 1 ≤ l by omega] + have h2 : ∑ j ∈ range r, dl s (l + j) * (if l + j + 1 ≤ l then (1:ℝ) else 0) = 0 := by + apply Finset.sum_eq_zero + intro j _; simp + rw [h1, h2, add_zero] + have := Finset.sum_range_sub (fun j => ph s j) l + simp only [dl]; rw [this, ph_zero, sub_zero] + +/-- the closed form lower bound: W_0 = (sum n) - (sum_{k < x-1} cap), W_j = cap (x-1-j) (j >= 1) -/ +noncomputable def Wt (x : ℕ) (n cap : ℕ → ℕ) (j : ℕ) : ℝ := + if j = 0 then (∑ c ∈ range x, (n c : ℝ)) - ∑ k ∈ range (x - 1), (cap k : ℝ) else (cap (x - 1 - j) : ℝ) +noncomputable def CB (s : ℝ) (x : ℕ) (n cap : ℕ → ℕ) : ℝ := ∑ j ∈ range x, dl s j * Wt x n cap j + +lemma Wt_partial {x : ℕ} (n cap : ℕ → ℕ) {J : ℕ} (h1 : 1 ≤ J) (h2 : J ≤ x) : + ∑ i ∈ range J, Wt x n cap i = (∑ c ∈ range x, (n c : ℝ)) - ∑ k ∈ range (x - J), (cap k : ℝ) := by + induction J, h1 using Nat.le_induction with + | base => simp [Wt] + | succ J hJ ih => + rw [Finset.sum_range_succ, ih (by omega)] + have : x - J = (x - (J + 1)) + 1 := by omega + rw [this, Finset.sum_range_succ] + have e : x - (J + 1) = x - 1 - J := by omega + simp only [Wt, if_neg (show J ≠ 0 by omega), e] + ring + +/-- partial-sum domination: sum n <= (sum of min(len,J)) + sum_{k min p.2 J).sum + ∑ k ∈ range (x - J), cap k := by + have h1 : ∑ c ∈ range x, n c = (σ.map fun p => p.2).sum := by + rw [sum_len_eq hv]; apply Finset.sum_congr rfl; intro c hc; rw [hcov c (Finset.mem_range.1 hc)] + have h2 : (σ.map fun p => p.2).sum = (σ.map fun p => min p.2 J).sum + (σ.map fun p => p.2 - min p.2 J).sum := by + rw [← List.sum_map_add]; congr 1; apply List.map_congr_left; intro p _; omega + have h3 : (σ.map fun p => p.2 - min p.2 J).sum ≤ + (σ.map fun p => ∑ k ∈ range (x - J), if p.1 ≤ k ∧ k + 1 < p.1 + p.2 then 1 else 0).sum := by + apply List.sum_le_sum; intro p hp; exact excess_le hJ (hv p hp) + rw [list_swap] at h3 + have h4 : ∑ k ∈ range (x - J), crossN σ k ≤ ∑ k ∈ range (x - J), cap k := by + apply Finset.sum_le_sum; intro k hk; rw [Finset.mem_range] at hk; exact hcross k (by omega) + have h5 : ∑ k ∈ range (x - J), crossN σ k = ∑ k ∈ range (x - J), (σ.map fun p => if p.1 ≤ k ∧ k + 1 < p.1 + p.2 then 1 else 0).sum := rfl + omega + +/-- L1 (schedule lemma, pointwise in s): every feasible schedule pays at least CB. -/ +theorem bill_lb {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) {x : ℕ} {σ : List Line} (hv : Valid x σ) (n cap : ℕ → ℕ) + (hcov : ∀ c, c < x → covN σ c = n c) (hcross : ∀ c, c + 1 < x → crossN σ c ≤ cap c) : + CB s x n cap ≤ bill s σ := by + -- N j = number of lines of length >= j+1 + let N : ℕ → ℕ := fun j => (σ.map fun p => if j + 1 ≤ p.2 then 1 else 0).sum + have hbill : bill s σ = ∑ j ∈ range x, dl s j * (N j : ℝ) := by + unfold bill + have : ∀ p ∈ σ, ph s p.2 = ∑ j ∈ range x, dl s j * (if j + 1 ≤ p.2 then (1:ℝ) else 0) := + fun p hp => ph_layer (by have := hv p hp; omega) + rw [List.map_congr_left this, list_swap] + apply Finset.sum_congr rfl; intro j _ + simp only [N] + rw [Nat.cast_list_sum, ← List.sum_map_mul_left] + congr 1 + rw [List.map_map]; apply List.map_congr_left; intro p _; simp only [Function.comp]; split_ifs <;> simp + have hpart : ∀ J, ∑ i ∈ range J, N i = (σ.map fun p => min p.2 J).sum := by + intro J + simp only [N] + rw [← list_swap]; congr 1; apply List.map_congr_left; intro p _; exact (min_eq _ _).symm + have key : 0 ≤ ∑ j ∈ range x, dl s j * ((N j : ℝ) - Wt x n cap j) := by + apply abel_nonneg (fun j => dl s j) (fun j => (N j : ℝ) - Wt x n cap j) x + · intro i _; exact dl_anti hs0 hs1 i + · exact dl_nonneg hs0 x + · intro J hJ + rcases Nat.eq_zero_or_pos J with rfl | hJ1 + · simp + · have hp : ∑ i ∈ range J, (N i : ℝ) = (((σ.map fun p => min p.2 J).sum : ℕ) : ℝ) := by + rw [← Nat.cast_sum, hpart J] + rw [Finset.sum_sub_distrib, Wt_partial n cap hJ1 hJ, hp] + have := partial_dom hv n cap hcov hcross hJ1 + have : (∑ c ∈ range x, (n c : ℝ)) ≤ ((σ.map fun p => min p.2 J).sum : ℕ) + ∑ k ∈ range (x - J), (cap k : ℝ) := by + exact_mod_cast this + push_cast at this ⊢ + linarith + rw [hbill]; unfold CB + simp only [mul_sub, Finset.sum_sub_distrib] at key + linarith + +/-! ### 3. B-port layouts: closed form of the bill bound, the own-role Abel step, the hub step -/ +def Ecum (e : ℕ → ℕ) (c : ℕ) : ℕ := ∑ i ∈ range (c + 1), e i +/-- occupancy and boundary cap of a B port (m = 2 mains): n_c = h + E_c - 2, cap_c = h + E_c - 4 (Crossing Lemma) -/ +def occ (h : ℕ) (e : ℕ → ℕ) (c : ℕ) : ℕ := h + Ecum e c - 2 +def capc (h : ℕ) (e : ℕ → ℕ) (c : ℕ) : ℕ := h + Ecum e c - 4 + +lemma sum_dl (s : ℝ) (m : ℕ) : ∑ j ∈ range m, dl s j = ph s m := by + have := Finset.sum_range_sub (fun j => ph s j) m + simp only [dl]; rw [this, ph_zero, sub_zero] + +/-- CB for a B arm in closed form: (h-4) phi(x) + 2x phi(1) + sum_c e_c phi(x-c) (all x >= 1, arms of 1 included) -/ +theorem CB_closed (s : ℝ) {y h : ℕ} (hh : 2 ≤ h) (e : ℕ → ℕ) + (hfl : ∀ j, j + 2 ≤ y + 1 → 2 * (j + 1) ≤ Ecum e j) : + CB s (y + 1) (occ h e) (capc h e) = + ((h : ℝ) - 4) * ph s (y + 1) + 2 * ((y + 1 : ℕ) : ℝ) * ph s 1 + ∑ c ∈ range (y + 1), (e c : ℝ) * ph s (y + 1 - c) := by + set q : ℕ → ℝ := fun k => (h : ℝ) + (Ecum e k : ℝ) - 4 with hq + have hocc : ∀ c, ((occ h e c : ℕ) : ℝ) = q c + 2 := by + intro c; simp only [occ, hq]; rw [Nat.cast_sub (by omega)]; push_cast; ring + have hcap : ∀ k, k + 2 ≤ y + 1 → ((capc h e k : ℕ) : ℝ) = q k := by + intro k hk; have := hfl k hk; simp only [capc, hq]; rw [Nat.cast_sub (by omega)]; push_cast; ring + have hW0 : Wt (y + 1) (occ h e) (capc h e) 0 = q y + 2 * ((y + 1 : ℕ) : ℝ) := by + simp only [Wt, if_true, Nat.add_sub_cancel, hocc] + rw [Finset.sum_add_distrib, Finset.sum_range_succ] + have : ∑ k ∈ range y, ((capc h e k : ℕ) : ℝ) = ∑ k ∈ range y, q k := by + apply Finset.sum_congr rfl; intro k hk; rw [Finset.mem_range] at hk; exact hcap k (by omega) + rw [this]; simp; ring + have hWj : ∀ j, j < y → Wt (y + 1) (occ h e) (capc h e) (j + 1) = q (y - (j + 1)) := by + intro j hj + simp only [Wt, if_neg (Nat.succ_ne_zero j), Nat.add_sub_cancel] + rw [hcap _ (by omega)] + have hsum : ∑ j ∈ range (y + 1), dl s j * q (y - j) = + ((h : ℝ) - 4) * ph s (y + 1) + ∑ c ∈ range (y + 1), (e c : ℝ) * ph s (y + 1 - c) := by + have h1 : ∀ j ∈ range (y + 1), dl s j * q (y - j) = dl s j * ((h : ℝ) - 4) + ∑ c ∈ range (y + 1 - j), dl s j * (e c : ℝ) := by + intro j hj + rw [Finset.mem_range] at hj + simp only [hq, Ecum] + have : y - j + 1 = y + 1 - j := by omega + rw [this, ← Finset.mul_sum]; push_cast; ring + rw [Finset.sum_congr rfl h1, Finset.sum_add_distrib, ← Finset.sum_mul, sum_dl, mul_comm] + congr 1 + rw [Finset.sum_comm' (t' := range (y + 1)) (s' := fun c => range (y + 1 - c)) + (by intro j c; simp only [Finset.mem_range]; omega)] + apply Finset.sum_congr rfl; intro c hc + rw [← Finset.sum_mul, sum_dl, mul_comm] + unfold CB + rw [Finset.sum_range_succ'] + have h2 : ∀ j ∈ range y, dl s (j + 1) * Wt (y + 1) (occ h e) (capc h e) (j + 1) = dl s (j + 1) * q (y - (j + 1)) := by + intro j hj; rw [hWj j (Finset.mem_range.1 hj)] + rw [Finset.sum_congr rfl h2, hW0] + rw [Finset.sum_range_succ'] at hsum + have h3 : dl s 0 = ph s 1 := by simp [dl, ph_zero] + simp only [Nat.sub_zero] at hsum + rw [h3] at hsum ⊢ + push_cast + linear_combination hsum + +/-- own-role Abel step: sum_c (e_c - 2) (psi(1) - psi(x-c)) >= 0 given the Floor lemma E_j >= 2(j+1), j <= x-2 -/ +theorem own_abel {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) {y : ℕ} (e : ℕ → ℕ) + (hfl : ∀ j, j + 2 ≤ y + 1 → 2 * (j + 1) ≤ Ecum e j) : + 0 ≤ ∑ c ∈ range (y + 1), ((e c : ℝ) - 2) * (ps s 1 - ps s (y + 1 - c)) := by + rw [Finset.sum_range_succ] + have hz : ps s 1 - ps s (y + 1 - y) = 0 := by simp + rw [hz, mul_zero, add_zero] + have key := abel_nonneg (fun c => ps s 1 - ps s (y + 1 - c)) (fun c => (e c : ℝ) - 2) y + (by + intro i hi + have := ps_anti hs0 hs1 (d := y - i) (by omega) + have e1 : y - i + 1 = y + 1 - i := by omega + have e2 : y - i = y + 1 - (i + 1) := by omega + rw [e1] at this; rw [← e2]; linarith) + (by simp) + (by + intro J hJ + rcases Nat.eq_zero_or_pos J with rfl | hJ1 + · simp + · have := hfl (J - 1) (by omega) + have eJ : J - 1 + 1 = J := by omega + simp only [Ecum, eJ] at this + rw [Finset.sum_sub_distrib] + simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul] + have : (2 * J : ℝ) ≤ ((∑ i ∈ range J, e i : ℕ) : ℝ) := by + have : 2 * J ≤ ∑ i ∈ range J, e i := by nlinarith + exact_mod_cast this + push_cast at this + linarith) + exact le_of_le_of_eq key (Finset.sum_congr rfl (fun c _ => mul_comm _ _)) + +/-- hub step: tau(k) - phi(a) - phi(b) - psi(1) <= 0 (subadditivity of x^s and one two-point Karamata) -/ +theorem hub_nonpos {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) {a b : ℕ} (ha : 1 ≤ a) (hb : 1 ≤ b) : + ta s (a + b) - ph s a - ph s b - ps s 1 ≤ 0 := by + unfold ps ta + rw [ph_pos' s ha, ph_pos' s hb, ph_pos' s (le_refl 1)] + have h1 := Real.rpow_add_le_add_rpow (a := ((8 * a : ℕ) : ℝ)) (b := ((8 * b : ℕ) : ℝ)) (by positivity) (by positivity) hs0 hs1 + have e1 : ((8 * a : ℕ) : ℝ) + ((8 * b : ℕ) : ℝ) = ((8 * (a + b) : ℕ) : ℝ) := by push_cast; ring + rw [e1] at h1 + have h2 := spread hs0 hs1 (x := ((8 * 1 : ℕ) : ℝ)) (y := ((8 * (a + b) : ℕ) : ℝ)) (d := 1) (by positivity) + (by exact_mod_cast (by omega)) (by norm_num) + have e2 : ((8 * (a + b) : ℕ) : ℝ) + 1 = ((8 * (a + b) + 1 : ℕ) : ℝ) := by push_cast; ring + have e3 : ((8 * 1 : ℕ) : ℝ) + 1 = ((8 * 1 + 1 : ℕ) : ℝ) := by push_cast; ring + rw [e2, e3] at h2 + linarith + +/-! ### 4. the B port: model, value, per-split optimality -/ +noncomputable def Hc (s : ℝ) (a b : ℕ) : ℝ := ta s (a + b) - ph s a - ph s b - ps s 1 +noncomputable def Kc (s : ℝ) (a b : ℕ) : ℝ := + 4 * (ph s a + ph s b) - 2 * ((a + b : ℕ) : ℝ) * ph s 1 - (2 - 2 * ((a + b : ℕ) : ℝ)) * ps s 1 +/-- own-role part of the R2 L4 form: sum_c e_c (psi(x-c) - psi(1)) -/ +noncomputable def Own (s : ℝ) (x : ℕ) (e : ℕ → ℕ) : ℝ := ∑ c ∈ range x, (e c : ℝ) * (ps s (x - c) - ps s 1) +/-- R2 L4: F_B-port = h Hc + Kc + Own_L + Own_R (psi(1) unit cost) -/ +noncomputable def G4 (s : ℝ) (a b h : ℕ) (eL eR : ℕ → ℕ) : ℝ := (h : ℝ) * Hc s a b + Kc s a b + Own s a eL + Own s b eR +/-- the B form: h = 2 hubs, e = 2 own roles per stage -/ +noncomputable def Gstar (s : ℝ) (a b : ℕ) : ℝ := G4 s a b 2 (fun _ => 2) (fun _ => 2) + +/-- a B port layout with a feasible line schedule per arm (hubs h, own roles e_c entering at arm stage c) -/ +structure BPort (a b : ℕ) where + h : ℕ + eL : ℕ → ℕ + eR : ℕ → ℕ + σL : List Line + σR : List Line + hh : 2 ≤ h + flL : ∀ j, j + 2 ≤ a → 2 * (j + 1) ≤ Ecum eL j -- Floor lemma, left arm + flR : ∀ j, j + 2 ≤ b → 2 * (j + 1) ≤ Ecum eR j + vL : Valid a σL + vR : Valid b σR + covL : ∀ c, c < a → covN σL c = occ h eL c + covR : ∀ c, c < b → covN σR c = occ h eR c + crL : ∀ c, c + 1 < a → crossN σL c ≤ capc h eL c + crR : ∀ c, c + 1 < b → crossN σR c ≤ capc h eR c + /-- sign units u = n + 2 - 2k (n = h + total own roles) -/ + hfeas : 2 * (a + b) ≤ h + (∑ c ∈ range a, eL c) + (∑ c ∈ range b, eR c) + 2 + /-- total price of the sign units (as a function of s) -/ + ucost : ℝ → ℝ + /-- [H-odd]: each of the u sign units costs at least psi(1) -/ + hodd : ∀ s, 0 ≤ s → s ≤ 1 → + ((h + (∑ c ∈ range a, eL c) + (∑ c ∈ range b, eR c) + 2 - 2 * (a + b) : ℕ) : ℝ) * ps s 1 ≤ ucost s + +/-- the F value of a B port: hub roles + own roles - line bill - sign units, F(s) = sum (T - P) r^s -/ +noncomputable def BPort.F {a b : ℕ} (P : BPort a b) (s : ℝ) : ℝ := + (P.h : ℝ) * ta s (a + b) + ∑ c ∈ range a, (P.eL c : ℝ) * ta s (a - c) + ∑ c ∈ range b, (P.eR c : ℝ) * ta s (b - c) + - bill s P.σL - bill s P.σR - P.ucost s + +lemma own_split (s : ℝ) (x : ℕ) (e : ℕ → ℕ) : + ∑ c ∈ range x, (e c : ℝ) * ta s (x - c) - ∑ c ∈ range x, (e c : ℝ) * ph s (x - c) - ps s 1 * ∑ c ∈ range x, (e c : ℝ) + = Own s x e := by + unfold Own + rw [Finset.mul_sum, ← Finset.sum_sub_distrib, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl; intro c _; simp only [ps]; ring + +/-- (L1 + L2): every B port has F <= G4 (the R2 closed form), pointwise in s -/ +theorem F_le_G4 {a b : ℕ} (ha : 1 ≤ a) (hb : 1 ≤ b) (P : BPort a b) {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : + P.F s ≤ G4 s a b P.h P.eL P.eR := by + obtain ⟨y, rfl⟩ : ∃ y, a = y + 1 := ⟨a - 1, by omega⟩ + obtain ⟨z, rfl⟩ : ∃ z, b = z + 1 := ⟨b - 1, by omega⟩ + have hL := bill_lb hs0 hs1 P.vL (occ P.h P.eL) (capc P.h P.eL) P.covL P.crL + have hR := bill_lb hs0 hs1 P.vR (occ P.h P.eR) (capc P.h P.eR) P.covR P.crR + rw [CB_closed s P.hh P.eL P.flL] at hL + rw [CB_closed s P.hh P.eR P.flR] at hR + have hu := P.hodd s hs0 hs1 + have hcast : ((P.h + (∑ c ∈ range (y + 1), P.eL c) + (∑ c ∈ range (z + 1), P.eR c) + 2 - 2 * (y + 1 + (z + 1)) : ℕ) : ℝ) + = (P.h : ℝ) + (∑ c ∈ range (y + 1), (P.eL c : ℝ)) + (∑ c ∈ range (z + 1), (P.eR c : ℝ)) + 2 - 2 * ((y + 1 + (z + 1) : ℕ) : ℝ) := by + have := P.hfeas + rw [Nat.cast_sub this]; push_cast; ring + rw [hcast] at hu + have oL := own_split s (y + 1) P.eL + have oR := own_split s (z + 1) P.eR + unfold BPort.F G4 Hc Kc + push_cast at hL hR hu ⊢ + nlinarith [hL, hR, hu, oL, oR] + +theorem G4_le_star {a b : ℕ} (ha : 1 ≤ a) (hb : 1 ≤ b) {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) + (h : ℕ) (hh : 2 ≤ h) (eL eR : ℕ → ℕ) + (flL : ∀ j, j + 2 ≤ a → 2 * (j + 1) ≤ Ecum eL j) (flR : ∀ j, j + 2 ≤ b → 2 * (j + 1) ≤ Ecum eR j) : + G4 s a b h eL eR ≤ Gstar s a b := by + have hH := hub_nonpos hs0 hs1 ha hb + have hH' : Hc s a b ≤ 0 := hH + have key : ∀ (x : ℕ) (e : ℕ → ℕ), 1 ≤ x → (∀ j, j + 2 ≤ x → 2 * (j + 1) ≤ Ecum e j) → + Own s x e ≤ Own s x (fun _ => 2) := by + intro x e hx hfl + obtain ⟨y, rfl⟩ : ∃ y, x = y + 1 := ⟨x - 1, by omega⟩ + have := own_abel hs0 hs1 e hfl + unfold Own + have e2 : ∑ c ∈ range (y + 1), (((fun _ => 2 : ℕ → ℕ) c : ℕ) : ℝ) * (ps s (y + 1 - c) - ps s 1) + = ∑ c ∈ range (y + 1), 2 * (ps s (y + 1 - c) - ps s 1) := by + apply Finset.sum_congr rfl; intro c _; simp + rw [e2] + have e3 : ∑ c ∈ range (y + 1), (e c : ℝ) * (ps s (y + 1 - c) - ps s 1) - ∑ c ∈ range (y + 1), 2 * (ps s (y + 1 - c) - ps s 1) + = - ∑ c ∈ range (y + 1), ((e c : ℝ) - 2) * (ps s 1 - ps s (y + 1 - c)) := by + rw [← Finset.sum_sub_distrib, ← Finset.sum_neg_distrib] + apply Finset.sum_congr rfl; intro c _; ring + linarith + have k1 := key a eL ha flL + have k2 := key b eR hb flR + unfold Gstar + unfold G4 + have : ((h : ℝ) - 2) * Hc s a b ≤ 0 := mul_nonpos_of_nonneg_of_nonpos (by + have : (2 : ℝ) ≤ h := by exact_mod_cast hh + linarith) hH' + push_cast + nlinarith [this, k1, k2] + +/-- PER-SPLIT B-FORM OPTIMALITY (B ports, every s in [0,1]): F(layout) <= F(B form) = Gstar. -/ +theorem bform_optimal {a b : ℕ} (ha : 1 ≤ a) (hb : 1 ≤ b) (P : BPort a b) {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : + P.F s ≤ Gstar s a b := + (F_le_G4 ha hb P hs0 hs1).trans (G4_le_star ha hb hs0 hs1 P.h P.hh P.eL P.eR P.flL P.flR) + +/-! ### 5. B form = the closed form FBc used by JointCeiling (bridge), and the discharge of hB -/ +noncomputable def Tsum (s : ℝ) (x : ℕ) : ℝ := ∑ c ∈ range x, ta s (x - c) +noncomputable def Psum (s : ℝ) (x : ℕ) : ℝ := ∑ c ∈ range x, ph s (x - c) +noncomputable def Qsum (s : ℝ) (x : ℕ) : ℝ := ∑ J ∈ range (x - 1), ph s (J + 1) + +lemma Tsum_eq (s : ℝ) (x : ℕ) : Tsum s x = ∑ i ∈ range x, ((8 * i + 9 : ℕ) : ℝ) ^ s := by + unfold Tsum + rw [← Finset.sum_range_reflect] + apply Finset.sum_congr rfl; intro c hc + rw [Finset.mem_range] at hc + have : x - (x - 1 - c) = c + 1 := by omega + rw [this]; unfold ta + have h8 : 8 * (c + 1) + 1 = 8 * c + 9 := by ring + rw [h8] + +lemma Psum_eq (s : ℝ) (x : ℕ) : Psum s x = ∑ i ∈ range x, ph s (i + 1) := by + unfold Psum + rw [← Finset.sum_range_reflect] + apply Finset.sum_congr rfl; intro c hc + rw [Finset.mem_range] at hc + have : x - (x - 1 - c) = c + 1 := by omega + rw [this] + +lemma Psum_Q (s : ℝ) {x : ℕ} (hx : 1 ≤ x) : Psum s x = Qsum s x + ph s x := by + rw [Psum_eq]; unfold Qsum + obtain ⟨y, rfl⟩ : ∃ y, x = y + 1 := ⟨x - 1, by omega⟩ + rw [Finset.sum_range_succ]; simp + +lemma Qsum_eq (s : ℝ) {x : ℕ} (hx : 1 ≤ x) : + Qsum s x = (if 2 ≤ x then (8 : ℝ) ^ s else 0) + ∑ i ∈ range (x - 2), ((8 * i + 16 : ℕ) : ℝ) ^ s := by + unfold Qsum + rcases Nat.lt_or_ge x 2 with h | h + · have : x = 1 := by omega + subst this; simp + · obtain ⟨m, rfl⟩ : ∃ m, x = m + 2 := ⟨x - 2, by omega⟩ + have e1 : m + 2 - 1 = m + 1 := by omega + have e2 : m + 2 - 2 = m := by omega + rw [e1, e2, Finset.sum_range_succ', if_pos h, add_comm] + congr 1 + +lemma Own_two (s : ℝ) (x : ℕ) : + Own s x (fun _ => 2) = 2 * (Tsum s x - Psum s x) - 2 * (x : ℝ) * ps s 1 := by + unfold Own Tsum Psum + have : ∑ c ∈ range x, (((fun _ => 2 : ℕ → ℕ) c : ℕ) : ℝ) * (ps s (x - c) - ps s 1) + = ∑ c ∈ range x, (2 * (ta s (x - c) - ph s (x - c)) - 2 * ps s 1) := by + apply Finset.sum_congr rfl; intro c _; simp only [ps]; push_cast; ring + rw [this, Finset.sum_sub_distrib, ← Finset.mul_sum, Finset.sum_sub_distrib] + simp; ring + +/-- value of an A port in the BUILT type (h = 2, e = 2, m = 4: every line continues to the arm's end; th QUERY units at cost 1) -/ +noncomputable def FAport (s : ℝ) (a b th : ℕ) : ℝ := + 2 * ta s (a + b) + 2 * (Tsum s a + Tsum s b) - 2 * (Qsum s a + Qsum s b) - (th : ℝ) + +/-- BRIDGE: 96 A ports (built type) + 8 B ports (B form) = the JointCeiling closed form FBc, for ALL arms >= 1 -/ +theorem port_total {a b : ℕ} (ha : 1 ≤ a) (hb : 1 ≤ b) (th : ℕ) (s : ℝ) : + 96 * FAport s a b th + 8 * Gstar s a b = FBc a b th s := by + have hph1 : ph s 1 = (8 : ℝ) ^ s := by rw [ph_pos' s (le_refl 1)]; norm_num + have hps1 : ps s 1 = (9 : ℝ) ^ s - (8 : ℝ) ^ s := by + unfold ps ta; rw [hph1]; norm_num + have hind : ∀ x, 1 ≤ x → ((ind x : ℕ) : ℝ) = if 2 ≤ x then 0 else 1 := by + intro x hx; unfold ind + by_cases h : x = 1 + · subst h; simp + · have : 2 ≤ x := by omega + simp [h, this] + have hQa := Qsum_eq s ha + have hQb := Qsum_eq s hb + unfold Gstar G4 Hc Kc FAport FBc FB + rw [Own_two s a, Own_two s b, Psum_Q s ha, Psum_Q s hb, Tsum_eq, Tsum_eq, hQa, hQb, hph1, hps1] + unfold ta + push_cast + rw [hind a ha, hind b hb] + by_cases h2a : 2 ≤ a <;> by_cases h2b : 2 <= b <;> simp only [h2a, h2b, if_true, if_false] <;> ring + +/-- HB DISCHARGED for B ports: a caller whose 96 A ports are in the built type (B-form masks, th QUERY units) and whose 8 B ports are + ARBITRARY layouts of the model (hubs, own roles, any feasible line schedules, [H-odd] units) satisfies JointCeiling's hB. -/ +theorem hB_discharge {a b th : ℕ} (ha : 1 ≤ a) (hb : 1 ≤ b) (Ps : Fin 8 → BPort a b) (ci : Inv) + (hci : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s ci = 96 * FAport s a b th + ∑ i, (Ps i).F s) : + ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s ci ≤ FBc a b th s := by + intro s hs0 hs1 + rw [hci s hs0 hs1, ← port_total ha hb th s] + have : ∑ i, (Ps i).F s ≤ ∑ _i : Fin 8, Gstar s a b := + Finset.sum_le_sum (fun i _ => bform_optimal ha hb (Ps i) hs0 hs1) + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] at this + push_cast at this + linarith + +/-- the class of JointCeiling, with hB supplied by the theorem above instead of a hypothesis -/ +def inClassOfPorts {th0 : ℕ} {a b th : ℕ} (ha : 1 ≤ a) (hb : 1 ≤ b) (rho : ℕ) (hth : th0 ≤ th) (hrho : 2 ≤ rho) + (Ps : Fin 8 → BPort a b) (ci : Inv) + (hci : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s ci = 96 * FAport s a b th + ∑ i, (Ps i).F s) : InClass th0 := + ⟨a, b, th, rho, ci, ha, hb, hth, hrho, hB_discharge ha hb Ps ci hci⟩ + +/-- ceiling at tbar4 with hB discharged (only the native floor, NumCert, [H-odd] inside BPort, and the built-type A ports remain hypotheses) -/ +theorem ceiling_of_ports (hnum : NumCert 4 tbar4) {a b : ℕ} (ha : 1 ≤ a) (hb : 1 ≤ b) (rho : ℕ) (hrho : 2 ≤ rho) + (Ps : Fin 8 → BPort a b) (ci : Inv) + (hci : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s ci = 96 * FAport s a b 4 + ∑ i, (Ps i).F s) + (n : Inv) (hN : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s n ≤ -Nfl s) (s : ℝ) (hs0 : 0 ≤ s) (hs : s ≤ 1 - tbar4) : + Finv s (invoice ci n (a + b)) < 0 := by + have := ceiling (th0 := 4) (tbar := tbar4) hnum + (inClassOfPorts (th0 := 4) ha hb rho le_rfl hrho Ps ci (fun s h0 h1 => hci s h0 h1)) n hN + (by unfold tbar4; norm_num) s hs0 hs + exact this + +/-! ### 6. the A-port failure (remark with a witness) and the neutrality of centre roles on B ports -/ +noncomputable def Fr (s : ℝ) (T P : List ℕ) : ℝ := (T.map fun r => (r : ℝ) ^ s).sum - (P.map fun r => (r : ℝ) ^ s).sum + +/-- rank lists of the 2|2 A port (m = 4, 4 QUERY units): B form, and with ONE own role of rank 9 (d = 1, the arm's last stage) dropped + (the line it would have idled and one QUERY go with it). Source: r2.py `port(2,2,2,[2,2],[2,2],4,2,False)` and `port(2,2,2,[2,1],[2,2],4,2,False)`. -/ +def TA : List ℕ := [33, 33, 17, 17, 9, 9, 17, 17, 9, 9] +def PA : List ℕ := [8, 8, 8, 8, 1, 1, 1, 1] +def TA' : List ℕ := [33, 33, 17, 17, 9, 17, 17, 9, 9] +def PA' : List ℕ := [8, 8, 8, 1, 1, 1] + +theorem FrA_eq (s : ℝ) : Fr s TA PA = FAport s 2 2 4 := by + unfold Fr TA PA FAport Tsum Qsum ta ph + simp [Finset.sum_range_succ] + norm_num + ring + +theorem A_drop_gain (s : ℝ) : Fr s TA' PA' - Fr s TA PA = 1 - ((9 : ℝ) ^ s - (8 : ℝ) ^ s) := by + unfold Fr TA PA TA' PA' + simp + ring + +/-- A ports: dropping the last-stage own role never loses (psi(1) <= 1 = QUERY price), for every s in [0,1] -/ +theorem A_drop_nonneg {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : 0 ≤ Fr s TA' PA' - Fr s TA PA := by + rw [A_drop_gain] + have := Real.rpow_add_le_add_rpow (a := 8) (b := 1) (by norm_num) (by norm_num) hs0 hs1 + norm_num at this ⊢ + linarith + +/-- ... and strictly gains at s = 0 (t = 1): the B form is NOT optimal on A ports -/ +theorem A_drop_strict_zero : Fr 0 TA' PA' - Fr 0 TA PA = 1 := by + rw [A_drop_gain]; norm_num + +/-- ... and at s = 1/2 (t = 1/2) -/ +theorem A_drop_strict_half : 0 < Fr (1 / 2) TA' PA' - Fr (1 / 2) TA PA := by + rw [A_drop_gain, ← Real.sqrt_eq_rpow, ← Real.sqrt_eq_rpow] + have h9 : Real.sqrt 9 = 3 := by + rw [show (9 : ℝ) = 3 ^ 2 by norm_num]; exact Real.sqrt_sq (by norm_num) + have h8 : 2 < Real.sqrt 8 := by + rw [show (2 : ℝ) = Real.sqrt 4 by rw [show (4 : ℝ) = 2 ^ 2 by norm_num]; exact (Real.sqrt_sq (by norm_num)).symm] + exact Real.sqrt_lt_sqrt (by norm_num) (by norm_num) + rw [h9]; linarith + +/-- B ports: the same drop is NEUTRAL (cost psi(1) per unit): the last-stage own role contributes 0 to the R2 L4 form -/ +theorem centre_role_neutral (s : ℝ) (y : ℕ) (e : ℕ → ℕ) (v : ℕ) : + Own s (y + 1) (Function.update e y v) = Own s (y + 1) e := by + unfold Own + rw [Finset.sum_range_succ, Finset.sum_range_succ] + have h0 : ps s (y + 1 - y) - ps s 1 = 0 := by simp + rw [h0, mul_zero, mul_zero, add_zero, add_zero] + apply Finset.sum_congr rfl + intro c hc + rw [Finset.mem_range] at hc + rw [Function.update_of_ne (by omega)] + +/-! ### 7. attainment certificate: the canonical B-form schedule (r2.py `lines`) is feasible, small arms by kernel evaluation -/ +def repl (k : ℕ) (p : Line) : List Line := List.replicate k p +/-- lines starting at arm stage c in the B form (h = 2, e = 2): stage 0: two 1-lines; last stage: four 1-lines; else two 1-lines and two long lines to the end -/ +def latB (x c : ℕ) : List Line := + if c = 0 then repl 2 (0, 1) else if c + 1 = x then repl 4 (c, 1) else repl 2 (c, 1) ++ repl 2 (c, x - c) +def sigB (x : ℕ) : List Line := (List.range x).flatMap (latB x) +instance (x : ℕ) (σ : List Line) : Decidable (Valid x σ) := by unfold Valid; infer_instance + +/-- B-form arm schedule is feasible (occupancy n_c = 2c+2 exactly, crossing <= cap_c = 2c) -- kernel-evaluated for x = 1..8 -/ +theorem sigB_feasible_small : ∀ x ∈ ({1, 2, 3, 4, 5, 6, 7, 8} : Finset ℕ), + Valid x (sigB x) ∧ (∀ c < x, covN (sigB x) c = occ 2 (fun _ => 2) c) ∧ + (∀ c < x, c + 1 < x → crossN (sigB x) c ≤ capc 2 (fun _ => 2) c) := by + decide +kernel + +/-- its bill is the closed form (2x) phi(1) + 2 sum_{J + simp [bill, sigB, latB, repl, List.range_succ, List.replicate, Finset.sum_range_succ] <;> ring + +#print axioms BFormOpt.spread +#print axioms BFormOpt.abel_nonneg +#print axioms BFormOpt.bill_lb +#print axioms BFormOpt.CB_closed +#print axioms BFormOpt.own_abel +#print axioms BFormOpt.hub_nonpos +#print axioms BFormOpt.F_le_G4 +#print axioms BFormOpt.G4_le_star +#print axioms BFormOpt.bform_optimal +#print axioms BFormOpt.port_total +#print axioms BFormOpt.hB_discharge +#print axioms BFormOpt.ceiling_of_ports +#print axioms BFormOpt.A_drop_gain +#print axioms BFormOpt.A_drop_nonneg +#print axioms BFormOpt.A_drop_strict_zero +#print axioms BFormOpt.A_drop_strict_half +#print axioms BFormOpt.centre_role_neutral +#print axioms BFormOpt.sigB_feasible_small +#print axioms BFormOpt.sigB_bill_small +#print axioms BFormOpt.inClassOfPorts diff --git a/research/p104-lean-premises/lean/Nov15/BFormOpt.md b/research/p104-lean-premises/lean/Nov15/BFormOpt.md new file mode 100644 index 0000000000..8e10783f30 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/BFormOpt.md @@ -0,0 +1,25 @@ +# BFormOpt.lean: B-form per-split optimality on B ports, pointwise in F(t), for ALL arm lengths +Nov 17. Imports Nov15.JointCeiling (olean built into .lake/build/lib/lean/Nov15) + Mathlib concavity/rpow lemmas. Build: runlean.sh Nov15/BFormOpt.lean, 19 s, 2.9 GB. 20 `#print axioms` within [propext, Classical.choice, Quot.sound]; no sorry, no native_decide (`decide +kernel` = kernel evaluation only). +Source: (internal notes) sec 1 (L1-L4), AUDIT2.md item 3. Sign convention: F = sum (T-P) r^s, s = 1-t in [0,1]; "optimal" = F maximal (cheapest invoice), the hB direction `F <= FBc`. (The task text says "minimises F"; R2/hB mean the B form has the LARGEST F, i.e. minimal cost.) + +## Model (BPort) = r2.py `port` for a B port (m = 2 mains), no a,b <= 4 / h <= 5 / e <= 4 cap +Per arm of length x: hubs h >= 2, own roles e_c entering at stage c (rank 8(x-c)+1), occupancy n_c = h+E_c-2, boundary cap_c = h+E_c-4, Floor E_j >= 2(j+1) (j <= x-2). A schedule is ANY list of lines (start, len), valid, with exact occupancy n_c and crossing <= cap_c (not only the canonical one). u = n+2-2k sign units each priced >= psi(1) ([H-odd]). F = h tau(k) + sum e tau - bill - unit cost. + +## Proved (all s in [0,1], all a,b >= 1, all h, e) +- `spread`: two-point Karamata for x^s (from Mathlib `Real.concaveOn_rpow`); `dl_nonneg`, `dl_anti` (phi' increments nonincreasing, phi'(0)=0 so s=0 counts lines), `ps_anti` (psi nonincreasing). +- `abel_aux/abel_nonneg`: the Abel/Karamata engine (a antitone, partial sums of D >= 0 => sum a D >= 0). +- **L1 schedule lemma, `bill_lb`**: every feasible schedule has bill >= CB(n,cap). Proof: layer cake bill = sum_j dl_j N_j, N_j = #lines of length > j; partial sums sum_{j= sum n - sum_{k= 1 (arm of 1 included: = n_0 phi(1)). Hence `F_le_G4`: F <= h Hc + Kc + Own_L + Own_R (R2 L4 form). +- **Own-role Abel step, `own_abel`** (R2 "sketch + finite check a,b <= 4"): sum_c (e_c-2)(psi(1)-psi(x-c)) >= 0 from the Floor E_j >= 2(j+1), g(x-1) = 0, g antitone. All x. `centre_role_neutral`: the last-stage (d=1) role contributes exactly 0 (B ports). +- **Hub step, `hub_nonpos`**: tau(k)-phi(a)-phi(b)-psi(1) <= 0 (subadditivity of x^s + one `spread`). +- **`bform_optimal`**: F(any B port layout) <= Gstar = F(B form h=2,e=2), pointwise on [0,1]. **`port_total`**: 96 FAport + 8 Gstar = JointCeiling.FBc a b th, for all arms >= 1, so Gstar is exactly the B-port share of FBc (arm-of-1 correction included). +- **hB discharged for B ports**: `hB_discharge` (caller = 96 built-type A ports + 8 ARBITRARY B-port layouts => `Finv <= FBc`), `inClassOfPorts` (InClass with hB proved), `ceiling_of_ports` (ceiling at tbar4; remaining hypotheses: native floor hN, NumCert 4 tbar4, [H-odd] in BPort, A ports in the built type, h hubs have no centre lines [H-centre]). +- Attainment: `sigB_feasible_small` (kernel eval, x = 1..8: the canonical B-form schedule has exact occupancy 2c+2, crossing <= 2c) and `sigB_bill_small` (x = 1..6: its bill is CB). General x attainment is r2.py `lines()`, not formalised. + +## A ports: B form is NOT optimal (remark + witness) +`TA/PA` = r2.py A port 2|2 B-form ranks (`FrA_eq`: = FAport s 2 2 4); `TA'/PA'` = the layout with one last-stage own role dropped (its line and one QUERY go too). `A_drop_gain`: gain = 1 - psi(1); `A_drop_nonneg` (>= 0 for all s in [0,1]), `A_drop_strict_zero` (= 1 at s=0), `A_drop_strict_half` (> 0 at s=1/2). A QUERY costs 1 > psi(1): centre/own roles are a net loss on A ports. So hB is NOT provable for A ports; it holds for the built type (A masks fixed = B form), which is what `hB_discharge` assumes (`hci`). + +## Corrections to R2 as written +1. **L2 closed form constant is wrong**: "-2(k-2) phi(1)" should be **-2k phi(1)** (R2 is +4 phi(1) too high). Checked numerically (r2.py port at 3|3, 2|5, 4|4, s=.5: port F = .5513 / -2.8222 / -5.2556 matches -2k, R2's formula gives 11.87 / 8.49 / 6.06) and by `port_total` (-2k reproduces FBc exactly). The L4 form (hub term, own term, [psi(d)-psi(1)]) and the conclusion are unaffected. +2. **L4 prices the u sign units at psi(1) each (= [H-odd])**; r2.py's rule (absorb into the SHORTEST 8-multiple lines) charges psi(l) < psi(1) once u exceeds the number of 1-lines (large e at stages <= x-2). There [H-odd] is violated literally, so this formalisation does not cover r2.py's spilled layouts. Numerics: 280,000 random layouts (a,b <= 4, h <= 8, e_c up to 20, s in {0,.05,.3,.7,1}), spill included, 0 violations of F <= F_B (own script). So the claim is plausible there, but the PROOF covers [H-odd] only. Open: spill regime. A proof route is a removal-monotonicity argument ("F_true = min over u-subsets U of the model cost, so removing a role/hub never lowers F"), not done here. +3. Not claimed: L5 A-port counts (6,009/5,879 failing layouts) are r2.py facts; only the minimal witness above is in Lean. Hubs h >= 5 with centre merging, trees, multi-centre remain outside (as in R2 sec 3). diff --git a/research/p104-lean-premises/lean/Nov15/CallerBorrow.lean b/research/p104-lean-premises/lean/Nov15/CallerBorrow.lean new file mode 100644 index 0000000000..0a03b8e308 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/CallerBorrow.lean @@ -0,0 +1,1112 @@ +/- +CALLER BORROWING lemmas : formalisation of the audited lemmas of internal notes R1-R6 +(AUDIT-ER, AUDIT-X, AUDIT-R5 fixes) in an abstract caller model. See CallerBorrow.md. +Model: units T_s = 1 - 2 x_s y_s^T on coordinates `ι` over a field; partial product pp s = T_{s-1} ... T_0; +masks = coordinate sets (`pm m` = diagonal projector); a stage unit lies in a mask when x,y vanish off it; +prefix commutation at a stage = `Commute (pm m) (pp s)`; product -I = `pp n = -1`. +-/ +import Mathlib.LinearAlgebra.Matrix.Rank +import Mathlib.LinearAlgebra.Matrix.SchurComplement +import Mathlib.Tactic.NoncommRing +import Mathlib.Tactic.Abel +import Nov15.SpecTSUR + +open Matrix + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false +set_option linter.unusedSimpArgs false +set_option linter.unusedTactic false + +namespace CallerBorrow + +variable {ι : Type*} [Fintype ι] [DecidableEq ι] {K : Type*} [Field K] + +/-! ## §0. model -/ + +/-- diagonal projector onto a coordinate set (a mask) -/ +def pm (m : ι → Prop) [DecidablePred m] : Matrix ι ι K := diagonal fun i => if m i then 1 else 0 + +/-- unit `1 - 2 x y^T` -/ +def unitM (x y : ι → K) : Matrix ι ι K := 1 - (2 : K) • vecMulVec x y + +/-- partial product `T_{s-1} ... T_0` -/ +def pp (x y : ℕ → ι → K) : ℕ → Matrix ι ι K + | 0 => 1 + | s + 1 => unitM (x s) (y s) * pp x y s + +/-- window product `T_{a+j-1} ... T_a` -/ +def seg (x y : ℕ → ι → K) (a : ℕ) : ℕ → Matrix ι ι K + | 0 => 1 + | j + 1 => unitM (x (a + j)) (y (a + j)) * seg x y a j + +theorem pp_add (x y : ℕ → ι → K) (a j : ℕ) : pp x y (a + j) = seg x y a j * pp x y a := by + induction j with + | zero => simp [seg] + | succ j ih => + rw [← add_assoc, pp, ih, seg, mul_assoc] + +/-- a vector lies in the mask -/ +def InMask (m : ι → Prop) (v : ι → K) : Prop := ∀ i, ¬ m i → v i = 0 + +variable (m : ι → Prop) [DecidablePred m] + +theorem pm_mulVec {v : ι → K} (h : InMask m v) : pm m *ᵥ v = v := by + funext i + simp only [pm, mulVec_diagonal] + by_cases hi : m i + · simp [hi] + · simp [hi, h i hi] + +theorem vecMul_pm {v : ι → K} (h : InMask m v) : v ᵥ* pm m = v := by + funext i + simp only [pm, vecMul_diagonal] + by_cases hi : m i + · simp [hi] + · simp [hi, h i hi] + +theorem commute_pm_unit {x y : ι → K} (hx : InMask m x) (hy : InMask m y) : + Commute (pm m) (unitM x y) := by + unfold unitM + refine (Commute.one_right _).sub_right (Commute.smul_right ?_ _) + show pm m * vecMulVec x y = vecMulVec x y * pm m + have h1 : pm m * vecMulVec x y = vecMulVec x y := by + rw [Matrix.mul_vecMulVec, pm_mulVec m hx] + have h2 : vecMulVec x y * pm m = vecMulVec x y := by + rw [Matrix.vecMulVec_mul, vecMul_pm m hy] + rw [h1, h2] + +/-- isotropy `y . x = 0` makes the unit invertible (inverse `1 + 2 x y^T`). -/ +theorem unitM_isUnit {x y : ι → K} (h : y ⬝ᵥ x = 0) : IsUnit (unitM x y) := by + have hA : vecMulVec x y * vecMulVec x y = 0 := by + rw [Matrix.vecMulVec_mul_vecMulVec, h]; simp + refine ⟨⟨unitM x y, 1 + (2 : K) • vecMulVec x y, ?_, ?_⟩, rfl⟩ + · unfold unitM + simp [sub_mul, mul_add, smul_mul_assoc, mul_smul_comm, hA] + · unfold unitM + simp [sub_mul, mul_sub, add_mul, smul_mul_assoc, mul_smul_comm, hA] + +theorem pm_mulVec_apply (v : ι → K) (i : ι) : + (pm m *ᵥ v) i = if m i then v i else 0 := by + simp [pm, mulVec_diagonal] + +theorem vecMul_pm_apply (v : ι → K) (i : ι) : + (v ᵥ* pm m) i = if m i then v i else 0 := by + simp [pm, vecMul_diagonal, mul_comm] + +theorem pm_mulVec_self (v : ι → K) : + pm m *ᵥ (pm m *ᵥ v) = pm m *ᵥ v := by + apply pm_mulVec; intro i hi; rw [pm_mulVec_apply]; simp [hi] + +theorem vecMul_pm_self (v : ι → K) : + (v ᵥ* pm m) ᵥ* pm m = v ᵥ* pm m := by + apply vecMul_pm; intro i hi; rw [vecMul_pm_apply]; simp [hi] + +/-! ## §1. Lemma E (AUDIT-ER: SOUND) -/ + +theorem commute_seg {x y : ℕ → ι → K} (a : ℕ) (d : ℕ) + (hd : ∀ j, j < d → InMask m (x (a + j)) ∧ InMask m (y (a + j))) : + Commute (pm m) (seg x y a d) := by + induction d with + | zero => simp [seg] + | succ d ih => + rw [seg] + exact (commute_pm_unit m (hd d (by omega)).1 (hd d (by omega)).2).mul_right + (ih fun j hj => hd j (by omega)) + +theorem isUnit_seg {x y : ℕ → ι → K} (hu : ∀ s, IsUnit (unitM (x s) (y s))) (a d : ℕ) : + IsUnit (seg x y a d) := by + induction d with + | zero => simp [seg] + | succ d ih => rw [seg]; exact (hu _).mul ih + +/-- **Lemma E.** If every earlier-window unit `a ≤ j < s` (thins included) lies in `mask(s)` and the +prefix before the stage `s` commutes with `mask(s)`, the cut prefix `pp a` is block-diagonal for `mask(s)`. -/ +theorem lemmaE {x y : ℕ → ι → K} (hu : ∀ s, IsUnit (unitM (x s) (y s))) (a s : ℕ) (has : a ≤ s) + (hwin : ∀ j, a ≤ j → j < s → InMask m (x j) ∧ InMask m (y j)) + (hcomm : Commute (pm m) (pp x y s)) : Commute (pm m) (pp x y a) := by + obtain ⟨d, rfl⟩ := Nat.exists_eq_add_of_le has + have hseg : Commute (pm m) (seg x y a d) := + commute_seg m a d fun j hj => hwin (a + j) (by omega) (by omega) + have hU := isUnit_seg hu a d + rw [pp_add] at hcomm + have h1 : seg x y a d * (pm m * pp x y a) = seg x y a d * (pp x y a * pm m) := by + calc seg x y a d * (pm m * pp x y a) = pm m * (seg x y a d * pp x y a) := by + rw [← mul_assoc, ← hseg.eq, mul_assoc] + _ = (seg x y a d * pp x y a) * pm m := hcomm.eq + _ = _ := by rw [mul_assoc] + exact (hU.mul_right_inj).1 h1 + +/-- **Lemma E, dual.** If every later unit `s ≤ j < a` of the window (stage `s` included) lies in `mask(s)` +and the prefix before `s` commutes with `mask(s)`, then `pp a` commutes with `mask(s)`. -/ +theorem lemmaE_dual {x y : ℕ → ι → K} (s a : ℕ) (has : s ≤ a) + (hwin : ∀ j, s ≤ j → j < a → InMask m (x j) ∧ InMask m (y j)) + (hcomm : Commute (pm m) (pp x y s)) : Commute (pm m) (pp x y a) := by + obtain ⟨d, rfl⟩ := Nat.exists_eq_add_of_le has + rw [pp_add] + exact (commute_seg m s d fun j hj => hwin (s + j) (by omega) (by omega)).mul_right hcomm + +/-! ## §2. Lemma R (re-basing at a cut; AUDIT-ER: SOUND-WITH-FIXES) -/ + +section Rebase +variable (Λ A : ι → Prop) [DecidablePred Λ] [DecidablePred A] + +theorem pm_mul_pm_of_imp (h : ∀ i, A i → Λ i) : pm A * pm Λ = (pm A : Matrix ι ι K) := by + unfold pm + rw [diagonal_mul_diagonal] + congr 1; funext i + by_cases hA : A i + · simp [hA, h i hA] + · simp [hA] + +theorem pm_comm (m : ι → Prop) [DecidablePred m] : Commute (pm m : Matrix ι ι K) (pm Λ) := by + show _ * _ = _ * _ + unfold pm + rw [diagonal_mul_diagonal, diagonal_mul_diagonal] + congr 1; funext i; ring + +/-- TS(5) memberships of a prefix unit: `x[Λ] ∈ V_-`, `y[Λ] ∈ ann V_+`. -/ +def PreUnit (D : Matrix ι ι K) (Λ : ι → Prop) [DecidablePred Λ] (x y : ι → K) : Prop := + D *ᵥ (pm Λ *ᵥ x) = -(pm Λ *ᵥ x) ∧ (y ᵥ* pm Λ) ᵥ* D = -(y ᵥ* pm Λ) + +/-- TS(5) memberships of a suffix unit: `x[Λ] ∈ V_+`, `y[Λ] ∈ ann V_-`. -/ +def SufUnit (D : Matrix ι ι K) (Λ : ι → Prop) [DecidablePred Λ] (x y : ι → K) : Prop := + D *ᵥ (pm Λ *ᵥ x) = pm Λ *ᵥ x ∧ (y ᵥ* pm Λ) ᵥ* D = y ᵥ* pm Λ + +/-! ### conjugation invariants -/ + +theorem inMask_iff (m : ι → Prop) [DecidablePred m] {v : ι → K} : InMask m v ↔ pm m *ᵥ v = v := by + refine ⟨pm_mulVec m, fun h i hi => ?_⟩ + have := congrFun h i + rw [pm_mulVec_apply] at this + simpa [hi] using this.symm + +theorem inMask_iff_vec (m : ι → Prop) [DecidablePred m] {v : ι → K} : InMask m v ↔ v ᵥ* pm m = v := by + refine ⟨vecMul_pm m, fun h i hi => ?_⟩ + have := congrFun h i + rw [vecMul_pm_apply] at this + simpa [hi] using this.symm + +theorem conj_vecMulVec (g G : Matrix ι ι K) (x y : ι → K) : + g * vecMulVec x y * G = vecMulVec (g *ᵥ x) (y ᵥ* G) := by + rw [Matrix.mul_vecMulVec, Matrix.vecMulVec_mul] + +theorem conj_unit {g G : Matrix ι ι K} (hgG : g * G = 1) (x y : ι → K) : + unitM (g *ᵥ x) (y ᵥ* G) = g * unitM x y * G := by + unfold unitM + rw [← conj_vecMulVec] + simp only [mul_sub, sub_mul, mul_one, hgG, mul_smul_comm, smul_mul_assoc] + +theorem conj_pp {g G : Matrix ι ι K} (hgG : g * G = 1) (hGg : G * g = 1) (x y : ℕ → ι → K) (s : ℕ) : + pp (fun t => g *ᵥ x t) (fun t => y t ᵥ* G) s = g * pp x y s * G := by + induction s with + | zero => simp [pp, hgG] + | succ s ih => + rw [pp, ih, pp, conj_unit hgG] + calc g * unitM (x s) (y s) * G * (g * pp x y s * G) + = g * unitM (x s) (y s) * (G * g) * pp x y s * G := by simp only [mul_assoc] + _ = g * (unitM (x s) (y s) * pp x y s) * G := by rw [hGg]; simp only [mul_assoc, mul_one] + +theorem conj_dot {g G : Matrix ι ι K} (hGg : G * g = 1) (y x : ι → K) : + (y ᵥ* G) ⬝ᵥ (g *ᵥ x) = y ⬝ᵥ x := by + rw [dotProduct_mulVec, vecMul_vecMul, hGg, vecMul_one] + +/-- A matrix equal to the identity off `Λ` and commuting with `π_Λ` commutes with every mask that +contains `Λ` or misses it (a line class). -/ +theorem commute_of_line (Λ m : ι → Prop) [DecidablePred Λ] [DecidablePred m] (M : Matrix ι ι K) + (h1 : M * pm Λ = pm Λ * M) (h2 : M * (1 - pm Λ) = 1 - pm Λ) + (hm : (pm m : Matrix ι ι K) * pm Λ = pm Λ ∨ (pm m : Matrix ι ι K) * pm Λ = 0) : Commute (pm m) M := by + have hc : pm m * pm Λ = (pm Λ : Matrix ι ι K) * pm m := (pm_comm Λ m).eq + have e1 : M = M * pm Λ + (1 - pm Λ) := by + rw [← h2]; noncomm_ring + show pm m * M = M * pm m + rcases hm with h | h + · have h' : (pm Λ : Matrix ι ι K) * pm m = pm Λ := by rw [← hc, h] + calc pm m * M = pm m * (M * pm Λ + (1 - pm Λ)) := by rw [← e1] + _ = pm m * (pm Λ * M) + (pm m - pm m * pm Λ) := by rw [← h1]; noncomm_ring + _ = pm Λ * M + (pm m - pm Λ) := by rw [← mul_assoc, h] + _ = M * pm Λ + (pm m - pm Λ) := by rw [h1] + _ = (M * pm Λ + (1 - pm Λ)) * pm m := by + rw [add_mul, mul_assoc, h', sub_mul, one_mul, h'] + _ = M * pm m := by rw [← e1] + · have h' : (pm Λ : Matrix ι ι K) * pm m = 0 := by rw [← hc, h] + calc pm m * M = pm m * (M * pm Λ + (1 - pm Λ)) := by rw [← e1] + _ = pm m * (pm Λ * M) + (pm m - pm m * pm Λ) := by rw [← h1]; noncomm_ring + _ = pm m := by rw [← mul_assoc, h]; simp + _ = (M * pm Λ + (1 - pm Λ)) * pm m := by + rw [add_mul, mul_assoc, h', sub_mul, one_mul, h']; simp + _ = M * pm m := by rw [← e1] + +/-- Data of a re-basing `g = G⁻¹` at a cut: `Λ` is the coordinate set of the E-atom/line class, `D` the +involution `D_Λ` of TS(5), `G` has columns `(basis V_-, basis V_+)` indexed by `(A, Λ \ A)`, `G = 1` off `Λ`. -/ +structure RebaseData (D G g : Matrix ι ι K) : Prop where + hA : ∀ i, A i → Λ i + hgG : g * G = 1 + hGg : G * g = 1 + hGπ : G * pm Λ = pm Λ * G + hGoff : G * (1 - pm Λ) = 1 - pm Λ + hDa : D * G * pm A = -(G * pm A) + hDb : D * G * (pm Λ - pm A) = G * (pm Λ - pm A) + +theorem half_eq {a : ι → K} (h2 : (2 : K) ≠ 0) (h : a + a = 0) : a = 0 := by + have : (2 : K) • a = 0 := by rw [two_smul, h] + rcases smul_eq_zero.1 this with h | h + · exact absurd h h2 + · exact h + +variable {Λ A} {D G g : Matrix ι ι K} (R : RebaseData Λ A D G g) +include R + +theorem RebaseData.hgG' (X : Matrix ι ι K) : g * (G * X) = X := by rw [← mul_assoc, R.hgG, one_mul] +theorem RebaseData.hGg' (X : Matrix ι ι K) : G * (g * X) = X := by rw [← mul_assoc, R.hGg, one_mul] + +theorem RebaseData.hgπ : g * pm Λ = pm Λ * g := by + calc g * pm Λ = g * pm Λ * (G * g) := by rw [R.hGg, mul_one] + _ = g * (pm Λ * G) * g := by simp only [mul_assoc] + _ = g * (G * pm Λ) * g := by rw [R.hGπ] + _ = pm Λ * g := by simp only [mul_assoc]; exact R.hgG' _ + +/-- shared core of the vector statements: `w = G c`, `c = a c + b c`. -/ +theorem RebaseData.vec_split {w : ι → K} (hw : pm Λ *ᵥ w = w) : + G *ᵥ (g *ᵥ w) = w ∧ pm Λ *ᵥ (g *ᵥ w) = g *ᵥ w ∧ + g *ᵥ w = pm A *ᵥ (g *ᵥ w) + (pm Λ - pm A) *ᵥ (g *ᵥ w) := by + set c := g *ᵥ w with hc + have hGc : G *ᵥ c = w := by rw [hc, mulVec_mulVec, R.hGg, one_mulVec] + have hπc : pm Λ *ᵥ c = c := by + rw [hc, mulVec_mulVec, ← R.hgπ, ← mulVec_mulVec, hw] + refine ⟨hGc, hπc, ?_⟩ + rw [sub_mulVec, add_sub_cancel, hπc] + +theorem RebaseData.vec_D {w : ι → K} (hw : pm Λ *ᵥ w = w) : + D *ᵥ w = -(G *ᵥ (pm A *ᵥ (g *ᵥ w))) + G *ᵥ ((pm Λ - pm A) *ᵥ (g *ᵥ w)) := by + obtain ⟨hGc, -, hsplit⟩ := R.vec_split (A := A) hw + set c := g *ᵥ w with hc + have h1 := congrArg (fun M : Matrix ι ι K => M *ᵥ c) R.hDa + have h2 := congrArg (fun M : Matrix ι ι K => M *ᵥ c) R.hDb + simp only [neg_mulVec, ← mulVec_mulVec] at h1 h2 + conv_lhs => rw [← hGc, hsplit, mulVec_add, mulVec_add] + rw [h1, h2] + +/-- vectors in `V_-` (`D w = -w`, supported in Λ) are sent by `g` into the A-coordinates. -/ +theorem RebaseData.vec_pre (h2 : (2 : K) ≠ 0) {w : ι → K} (hw : pm Λ *ᵥ w = w) (hD : D *ᵥ w = -w) : + pm A *ᵥ (g *ᵥ w) = g *ᵥ w := by + obtain ⟨hGc, -, hsplit⟩ := R.vec_split (A := A) hw + have h1 := R.vec_D (A := A) hw + set c := g *ᵥ w with hc + clear_value c + have h3 : G *ᵥ (pm A *ᵥ c) + G *ᵥ ((pm Λ - pm A) *ᵥ c) = w := by + rw [← mulVec_add, ← hsplit, hGc] + rw [hD, ← h3, neg_add] at h1 + have h5 := add_left_cancel h1 + have h6 : G *ᵥ ((pm Λ - pm A) *ᵥ c) = 0 := half_eq h2 (neg_eq_iff_add_eq_zero.1 h5) + have h7 : (pm Λ - pm A) *ᵥ c = 0 := by + calc (pm Λ - pm A) *ᵥ c = g *ᵥ (G *ᵥ ((pm Λ - pm A) *ᵥ c)) := by + rw [mulVec_mulVec, R.hgG, one_mulVec] + _ = 0 := by rw [h6, mulVec_zero] + rw [h7, add_zero] at hsplit + exact hsplit.symm + +/-- vectors in `V_+` (`D w = w`, supported in Λ) are sent by `g` into the complementary coordinates `Λ \ A`. -/ +theorem RebaseData.vec_suf (h2 : (2 : K) ≠ 0) {w : ι → K} (hw : pm Λ *ᵥ w = w) (hD : D *ᵥ w = w) : + pm A *ᵥ (g *ᵥ w) = 0 := by + obtain ⟨hGc, -, hsplit⟩ := R.vec_split (A := A) hw + have h1 := R.vec_D (A := A) hw + set c := g *ᵥ w with hc + clear_value c + have h3 : G *ᵥ (pm A *ᵥ c) + G *ᵥ ((pm Λ - pm A) *ᵥ c) = w := by + rw [← mulVec_add, ← hsplit, hGc] + rw [hD, ← h3] at h1 + have h5 := add_right_cancel h1 + have h6 : G *ᵥ (pm A *ᵥ c) = 0 := half_eq h2 (eq_neg_iff_add_eq_zero.1 h5) + calc pm A *ᵥ c = g *ᵥ (G *ᵥ (pm A *ᵥ c)) := by + rw [mulVec_mulVec, R.hgG, one_mulVec] + _ = 0 := by rw [h6, mulVec_zero] + +theorem RebaseData.row_split {v : ι → K} (hv : v ᵥ* pm Λ = v) : + (v ᵥ* G) ᵥ* pm Λ = v ᵥ* G ∧ + v ᵥ* G = (v ᵥ* G) ᵥ* pm A + (v ᵥ* G) ᵥ* (pm Λ - pm A) := by + have hπ : (v ᵥ* G) ᵥ* pm Λ = v ᵥ* G := by + rw [vecMul_vecMul, R.hGπ, ← vecMul_vecMul, hv] + refine ⟨hπ, ?_⟩ + rw [← vecMul_add, add_sub_cancel, hπ] + +/-- covectors in `ann V_+` (`v D = -v`, supported in Λ): `v G` lies in the A-coordinates. -/ +theorem RebaseData.row_pre (h2 : (2 : K) ≠ 0) {v : ι → K} (hv : v ᵥ* pm Λ = v) (hD : v ᵥ* D = -v) : + (v ᵥ* G) ᵥ* pm A = v ᵥ* G := by + obtain ⟨-, hsplit⟩ := R.row_split (A := A) hv + have e := congrArg (fun M : Matrix ι ι K => v ᵥ* M) R.hDb + simp only [← vecMul_vecMul, hD, neg_vecMul] at e + have h6 : (v ᵥ* G) ᵥ* (pm Λ - pm A) = 0 := half_eq h2 (neg_eq_iff_add_eq_zero.1 e) + rw [h6, add_zero] at hsplit + exact hsplit.symm + +/-- covectors in `ann V_-` (`v D = v`, supported in Λ): `v G` lies in the complementary coordinates. -/ +theorem RebaseData.row_suf (h2 : (2 : K) ≠ 0) {v : ι → K} (hv : v ᵥ* pm Λ = v) (hD : v ᵥ* D = v) : + (v ᵥ* G) ᵥ* pm A = 0 := by + have e := congrArg (fun M : Matrix ι ι K => v ᵥ* M) R.hDa + simp only [← vecMul_vecMul, hD, vecMul_neg] at e + exact half_eq h2 (eq_neg_iff_add_eq_zero.1 e) + +theorem RebaseData.x_on_Λ (x : ι → K) {i : ι} (hΛ : Λ i) : + (g *ᵥ x) i = (g *ᵥ (pm Λ *ᵥ x)) i := by + have : pm Λ *ᵥ (g *ᵥ x) = g *ᵥ (pm Λ *ᵥ x) := by + rw [mulVec_mulVec, mulVec_mulVec, ← R.hgπ] + rw [← this, pm_mulVec_apply]; simp [hΛ] + +theorem RebaseData.y_on_Λ (y : ι → K) {i : ι} (hΛ : Λ i) : + (y ᵥ* G) i = ((y ᵥ* pm Λ) ᵥ* G) i := by + have : (y ᵥ* G) ᵥ* pm Λ = (y ᵥ* pm Λ) ᵥ* G := by + rw [vecMul_vecMul, vecMul_vecMul, R.hGπ] + rw [← this, vecMul_pm_apply]; simp [hΛ] + +/-- confinement of the rebased vectors on Λ, prefix side: touches only the A-coordinates. -/ +theorem RebaseData.pre_conf (h2 : (2 : K) ≠ 0) {x y : ι → K} (hu : PreUnit D Λ x y) : + (∀ i, Λ i → ¬ A i → (g *ᵥ x) i = 0) ∧ (∀ i, Λ i → ¬ A i → (y ᵥ* G) i = 0) := by + constructor + · intro i hΛ hA + have h' := congrFun (R.vec_pre (A := A) h2 (pm_mulVec_self Λ x) hu.1) i + rw [pm_mulVec_apply] at h' + rw [R.x_on_Λ x hΛ, ← h']; simp [hA] + · intro i hΛ hA + have h' := congrFun (R.row_pre (A := A) h2 (vecMul_pm_self Λ y) hu.2) i + rw [vecMul_pm_apply] at h' + rw [R.y_on_Λ y hΛ, ← h']; simp [hA] + +/-- suffix side: touches only the coordinates of Λ outside A. -/ +theorem RebaseData.suf_conf (h2 : (2 : K) ≠ 0) {x y : ι → K} (hu : SufUnit D Λ x y) : + (∀ i, Λ i → A i → (g *ᵥ x) i = 0) ∧ (∀ i, Λ i → A i → (y ᵥ* G) i = 0) := by + constructor + · intro i hΛ hA + have h' := congrFun (R.vec_suf (A := A) h2 (pm_mulVec_self Λ x) hu.1) i + rw [pm_mulVec_apply] at h' + rw [R.x_on_Λ x hΛ]; simpa [hA] using h' + · intro i hΛ hA + have h' := congrFun (R.row_suf (A := A) h2 (vecMul_pm_self Λ y) hu.2) i + rw [vecMul_pm_apply] at h' + rw [R.y_on_Λ y hΛ]; simpa [hA] using h' + +/-- **Lemma R, conclusion.** After re-basing, no role of Λ is touched on both sides of the cut. -/ +theorem RebaseData.not_both (h2 : (2 : K) ≠ 0) {x y x' y' : ι → K} + (hp : PreUnit D Λ x y) (hs : SufUnit D Λ x' y') {i : ι} (hΛ : Λ i) : + ¬ (((g *ᵥ x) i ≠ 0 ∨ (y ᵥ* G) i ≠ 0) ∧ ((g *ᵥ x') i ≠ 0 ∨ (y' ᵥ* G) i ≠ 0)) := by + rintro ⟨h1, h3⟩ + by_cases hA : A i + · have := R.suf_conf (A := A) h2 hs + rcases h3 with h3 | h3 + · exact h3 (this.1 i hΛ hA) + · exact h3 (this.2 i hΛ hA) + · have := R.pre_conf (A := A) h2 hp + rcases h1 with h1 | h1 + · exact h1 (this.1 i hΛ hA) + · exact h1 (this.2 i hΛ hA) + +theorem RebaseData.g_off : g * (1 - pm Λ) = 1 - pm Λ := by + have := congrArg (fun X => g * X) R.hGoff + simpa only [R.hgG'] using this.symm + +theorem RebaseData.commute_g (m : ι → Prop) [DecidablePred m] + (hm : (pm m : Matrix ι ι K) * pm Λ = pm Λ ∨ (pm m : Matrix ι ι K) * pm Λ = 0) : + Commute (pm m) g ∧ Commute (pm m) G := + ⟨commute_of_line Λ m g R.hgπ R.g_off hm, commute_of_line Λ m G R.hGπ R.hGoff hm⟩ + +/-- **Lemma R (packaged).** Conjugating every unit by `g` (`x ↦ g x`, `y ↦ y G`) gives a tuple with +the same unit products up to conjugation, product `-I`, all pairings `y_s . x_t` (isotropy and every `t`), +the same stage masks and prefix commutations (for masks that contain Λ or miss it), and +prefix/suffix units touching complementary coordinates of Λ. -/ +theorem RebaseData.lemmaR (h2 : (2 : K) ≠ 0) (x y : ℕ → ι → K) (n : ℕ) (hprod : pp x y n = -1) : + (∀ s, pp (fun t => g *ᵥ x t) (fun t => y t ᵥ* G) s = g * pp x y s * G) ∧ + pp (fun t => g *ᵥ x t) (fun t => y t ᵥ* G) n = -1 ∧ + (∀ s t, (y s ᵥ* G) ⬝ᵥ (g *ᵥ x t) = y s ⬝ᵥ x t) ∧ + (∀ (m : ι → Prop) [DecidablePred m], ((pm m : Matrix ι ι K) * pm Λ = pm Λ ∨ (pm m : Matrix ι ι K) * pm Λ = 0) → + ∀ s, (InMask m (x s) → InMask m (g *ᵥ x s)) ∧ (InMask m (y s) → InMask m (y s ᵥ* G)) ∧ + (Commute (pm m) (pp x y s) ↔ + Commute (pm m) (pp (fun t => g *ᵥ x t) (fun t => y t ᵥ* G) s))) := by + refine ⟨conj_pp R.hgG R.hGg x y, ?_, fun s t => conj_dot R.hGg _ _, ?_⟩ + · rw [conj_pp R.hgG R.hGg, hprod] + calc g * -1 * G = -(g * G) := by noncomm_ring + _ = -1 := by rw [R.hgG] + · intro m _ hm s + obtain ⟨hg, hG⟩ := R.commute_g m hm + refine ⟨fun h => ?_, fun h => ?_, ?_⟩ + · rw [inMask_iff] at h ⊢ + rw [mulVec_mulVec, hg.eq, ← mulVec_mulVec, h] + · rw [inMask_iff_vec] at h ⊢ + rw [vecMul_vecMul, ← hG.eq, ← vecMul_vecMul, h] + · rw [conj_pp R.hgG R.hGg] + constructor + · intro h; exact (hg.mul_right h).mul_right hG + · intro h + have e : G * (g * pp x y s * G) * g = pp x y s := by + calc G * (g * pp x y s * G) * g = (G * g) * pp x y s * (G * g) := by simp only [mul_assoc] + _ = pp x y s := by rw [R.hGg]; simp + rw [← e] + exact (hG.mul_right h).mul_right hg + +end Rebase + +/-! ## §3. Lemma OS (one-sided shear; AUDIT-R5 hypotheses made explicit) -/ + +theorem half_zero {M : Type*} [AddCommGroup M] [Module K M] (h2 : (2 : K) ≠ 0) {a : M} + (h : a + a = 0) : a = 0 := by + have : (2 : K) • a = 0 := by rw [two_smul, h] + rcases smul_eq_zero.1 this with h | h + · exact absurd h h2 + · exact h + +section OS + +variable {ez ep es π F0 U Kq Lq G g : Matrix ι ι K} + +/-- Block-coordinate data of the cut (z = off B, pre = B_pre, suf = B_suf): `ez,ep,es` orthogonal +idempotents summing to 1, `Kq : suf -> pre`, `Lq : pre -> suf` the off-diagonal parts of +`G = g⁻¹ = [[I,Kq],[Lq,I]]`, `F0` the part of `F_k` off B, `U` a product of units with no pre part, +`π` the projector onto the stage mask `N` (no pre part). `D = G (es - ep) g` is the block `D_B` of +`F_k = F0 ⊕ D_B` (TS(5): `D_B = g⁻¹ J g`, `J = diag(-I_pre, I_suf)`). -/ +structure OSData (ez ep es π F0 U Kq Lq G g : Matrix ι ι K) : Prop where + zz : ez * ez = ez + pp : ep * ep = ep + ss : es * es = es + zp : ez * ep = 0 + pz : ep * ez = 0 + zs : ez * es = 0 + sz : es * ez = 0 + ps : ep * es = 0 + sp : es * ep = 0 + sum : ez + ep + es = 1 + epK : ep * Kq = Kq + Kes : Kq * es = Kq + esL : es * Lq = Lq + Lep : Lq * ep = Lq + hG : G = 1 + Kq + Lq + hgG : g * G = 1 + hGg : G * g = 1 + hF0 : F0 = ez * F0 * ez + epU : ep * U = ep + Uep : U * ep = ep + epπ : ep * π = 0 + πep : π * ep = 0 + +variable (O : OSData ez ep es π F0 U Kq Lq G g) +include O + +theorem OSData.hGg' (X : Matrix ι ι K) : G * (g * X) = X := by rw [← mul_assoc, O.hGg, one_mul] +theorem OSData.hgG' (X : Matrix ι ι K) : g * (G * X) = X := by rw [← mul_assoc, O.hgG, one_mul] + +/-- the block `D_B = G (es - ep) g` -/ +def OSD (es ep G g : Matrix ι ι K) : Matrix ι ι K := G * (es - ep) * g + +/-! derived zero-products -/ +theorem OSData.Kep : Kq * ep = 0 := by rw [← O.Kes, mul_assoc, O.sp, mul_zero] +theorem OSData.esK : es * Kq = 0 := by rw [← O.epK, ← mul_assoc, O.sp, zero_mul] +theorem OSData.Les : Lq * es = 0 := by rw [← O.Lep, mul_assoc, O.ps, mul_zero] +theorem OSData.epL : ep * Lq = 0 := by rw [← O.esL, ← mul_assoc, O.ps, zero_mul] +theorem OSData.Kez : Kq * ez = 0 := by rw [← O.Kes, mul_assoc, O.sz, mul_zero] +theorem OSData.ezK : ez * Kq = 0 := by rw [← O.epK, ← mul_assoc, O.zp, zero_mul] +theorem OSData.Lez : Lq * ez = 0 := by rw [← O.Lep, mul_assoc, O.pz, mul_zero] +theorem OSData.ezL : ez * Lq = 0 := by rw [← O.esL, ← mul_assoc, O.zs, zero_mul] +theorem OSData.LL : Lq * Lq = 0 := by + calc Lq * Lq = Lq * (ep * (es * Lq)) := by rw [O.esL]; nth_rewrite 1 [← O.Lep]; simp only [mul_assoc] + _ = 0 := by rw [← mul_assoc ep es, O.ps]; simp + +theorem OSData.epG : ep * G = ep + Kq := by + rw [O.hG]; simp only [mul_add, mul_one, O.epK, O.epL, add_zero] +theorem OSData.esG : es * G = es + Lq := by + rw [O.hG]; simp only [mul_add, mul_one, O.esK, O.esL, add_zero] +theorem OSData.Gep : G * ep = ep + Lq := by + rw [O.hG]; simp only [add_mul, one_mul, O.Kep, O.Lep, add_zero] +theorem OSData.Ges : G * es = es + Kq := by + rw [O.hG]; simp only [add_mul, one_mul, O.Kes, O.Les, add_zero] +theorem OSData.ezG : ez * G = ez := by + rw [O.hG]; simp only [mul_add, mul_one, O.ezK, O.ezL, add_zero] +theorem OSData.Gez : G * ez = ez := by + rw [O.hG]; simp only [add_mul, one_mul, O.Kez, O.Lez, add_zero] +theorem OSData.gez : g * ez = ez := by + calc g * ez = g * (G * ez) := by rw [O.Gez] + _ = ez := O.hgG' ez +theorem OSData.ezg : ez * g = ez := by + calc ez * g = (ez * G) * g := by rw [O.ezG] + _ = ez := by rw [mul_assoc, O.hGg, mul_one] +theorem OSData.A1 : (ep + Kq) * g = ep := by + rw [← O.epG, mul_assoc, O.hGg, mul_one] +theorem OSData.A2 : (es + Lq) * g = es := by + rw [← O.esG, mul_assoc, O.hGg, mul_one] +theorem OSData.A3 : g * (ep + Lq) = ep := by + rw [← O.Gep, O.hgG'] +theorem OSData.A4 : g * (es + Kq) = es := by + rw [← O.Ges, O.hgG'] + + +theorem OSData.B1 : g * ep = ep * g * ep - Lq * (ep * g * ep) := by + have hA2 : es * (g * ep) + Lq * (ep * g * ep) = 0 := by + have h := congrArg (· * ep) O.A2 + simp only [add_mul, mul_assoc, O.sp] at h + have e : Lq * (g * ep) = Lq * (ep * g * ep) := by + conv_lhs => rw [← O.Lep] + simp only [mul_assoc] + rw [← e]; exact h + have hes : es * (g * ep) = -(Lq * (ep * g * ep)) := eq_neg_of_add_eq_zero_left hA2 + calc g * ep = (ez + ep + es) * (g * ep) := by rw [O.sum, one_mul] + _ = ez * (g * ep) + ep * (g * ep) + es * (g * ep) := by simp only [add_mul] + _ = ep * g * ep - Lq * (ep * g * ep) := by + rw [hes, ← mul_assoc ez g ep, O.ezg, O.zp, ← mul_assoc ep g ep]; abel + +theorem OSData.C2 : (ep * g * ep) * (ep - Kq * Lq) = ep := by + have h4 : ep * g * es + (ep * g * ep) * Kq = 0 := by + have h := congrArg (ep * ·) O.A4 + simp only [mul_add, O.ps] at h + have e : ep * (g * Kq) = (ep * g * ep) * Kq := by + conv_lhs => rw [← O.epK] + simp only [mul_assoc] + rw [← e]; simpa only [mul_assoc] using h + have h3 : ep * g * ep + (ep * g * es) * Lq = ep := by + have h := congrArg (ep * ·) O.A3 + simp only [mul_add, O.pp] at h + have e : ep * (g * Lq) = (ep * g * es) * Lq := by + conv_lhs => rw [← O.esL] + simp only [mul_assoc] + rw [← e]; simpa only [mul_assoc] using h + have h5 : ep * g * es = -((ep * g * ep) * Kq) := eq_neg_of_add_eq_zero_left h4 + have hpp : (ep * g * ep) * ep = ep * g * ep := by rw [mul_assoc, O.pp] + calc (ep * g * ep) * (ep - Kq * Lq) = ep * g * ep + (ep * g * es) * Lq := by + rw [mul_sub, hpp, h5]; simp only [neg_mul, mul_assoc]; abel + _ = ep := h3 + + +theorem OSData.epF0 : ep * F0 = 0 := by + rw [O.hF0]; simp only [← mul_assoc, O.pz, zero_mul] +theorem OSData.F0ep : F0 * ep = 0 := by + rw [O.hF0]; simp only [mul_assoc, O.zp, mul_zero] + +theorem OSData.epD : ep * OSD es ep G g = (Kq - ep) * g := by + have h : (ep + Kq) * (es - ep) = Kq - ep := by + simp only [add_mul, mul_sub, O.ps, O.pp, O.Kes, O.Kep]; abel + unfold OSD + calc ep * (G * (es - ep) * g) = (ep * G) * (es - ep) * g := by simp only [mul_assoc] + _ = (Kq - ep) * g := by rw [O.epG, h] + +theorem OSData.Dep : OSD es ep G g * ep = -((ep + Lq + Lq + Kq * Lq) * (ep * g * ep)) := by + have hg : g * ep = (ep - Lq) * (ep * g * ep) := by + rw [O.B1, sub_mul]; congr 1; simp only [← mul_assoc, O.pp] + have h1 : (es - ep) * (ep - Lq) = -Lq - ep := by + simp only [mul_sub, sub_mul, O.sp, O.esL, O.pp, O.epL]; abel + have h2 : G * (-Lq - ep) = -(ep + Lq + Lq + Kq * Lq) := by + have hGL : G * Lq = Lq + Kq * Lq := by + rw [O.hG]; simp only [add_mul, one_mul, O.LL, add_zero] + rw [mul_sub, mul_neg, hGL, O.Gep]; abel + unfold OSD + calc G * (es - ep) * g * ep = G * ((es - ep) * (g * ep)) := by simp only [mul_assoc] + _ = G * ((es - ep) * ((ep - Lq) * (ep * g * ep))) := by rw [hg] + _ = (G * (-Lq - ep)) * (ep * g * ep) := by rw [← h1]; simp only [mul_assoc] + _ = _ := by rw [h2, neg_mul] + +theorem OSData.Dpi (hKπ : Kq * π = 0) (hgπ : g * π = π) : OSD es ep G g * π = es * π := by + have h : G * es * π = es * π := by rw [O.Ges, add_mul, hKπ, add_zero] + unfold OSD + calc G * (es - ep) * g * π = G * ((es - ep) * π) := by rw [mul_assoc (G * (es - ep)), hgπ, mul_assoc] + _ = G * es * π := by rw [sub_mul, O.epπ, sub_zero, mul_assoc] + _ = es * π := h + + +theorem OSData.UK : U * Kq = Kq := by rw [← O.epK, ← mul_assoc, O.Uep] + +theorem OSData.πK : π * Kq = 0 := by rw [← O.epK, ← mul_assoc, O.πep, zero_mul] + +/-- commutation at the stage forces `K π = 0` (no unforced tilt reaches the stage mask) and `π U L = 0`. -/ +theorem OSData.forced (h2 : (2 : K) ≠ 0) + (H : π * (U * (F0 + OSD es ep G g)) = (U * (F0 + OSD es ep G g)) * π) : + Kq * π = 0 ∧ π * U * Lq = 0 ∧ g * π = π := by + have hE1 : (Kq - ep) * g * π = 0 := by + have h := congrArg (ep * ·) H + have l : ep * (π * (U * (F0 + OSD es ep G g))) = 0 := by rw [← mul_assoc, O.epπ, zero_mul] + have r : ep * ((U * (F0 + OSD es ep G g)) * π) = (Kq - ep) * g * π := by + calc ep * ((U * (F0 + OSD es ep G g)) * π) = (ep * U) * (F0 + OSD es ep G g) * π := by + simp only [mul_assoc] + _ = ep * (F0 + OSD es ep G g) * π := by rw [O.epU] + _ = (Kq - ep) * g * π := by rw [mul_add, O.epF0, zero_add, O.epD] + exact (l.symm.trans (h.trans r)).symm + have hE2 : (ep + Kq) * g * π = 0 := by rw [O.A1, O.epπ] + have e1 : Kq * g * π - ep * g * π = 0 := by + calc Kq * g * π - ep * g * π = (Kq - ep) * g * π := by simp only [sub_mul] + _ = 0 := hE1 + have e2 : ep * g * π + Kq * g * π = 0 := by + calc ep * g * π + Kq * g * π = (ep + Kq) * g * π := by simp only [add_mul] + _ = 0 := hE2 + have hE3 : Kq * g * π = 0 := half_zero h2 (by + calc Kq * g * π + Kq * g * π = (Kq * g * π - ep * g * π) + (ep * g * π + Kq * g * π) := by abel + _ = 0 := by rw [e1, e2, add_zero]) + have hE4 : ep * g * π = 0 := half_zero h2 (by + calc ep * g * π + ep * g * π = (ep * g * π + Kq * g * π) - (Kq * g * π - ep * g * π) := by abel + _ = 0 := by rw [e1, e2, sub_zero]) + have hE5 : g * π = π := by + have hK : Kq * (g * π) = 0 := by rw [← mul_assoc, hE3] + have hL : Lq * (g * π) = 0 := by + calc Lq * (g * π) = Lq * (ep * (g * π)) := by + conv_lhs => rw [← O.Lep] + rw [mul_assoc] + _ = 0 := by rw [← mul_assoc ep g π, hE4, mul_zero] + calc g * π = G * (g * π) - Kq * (g * π) - Lq * (g * π) := by + rw [O.hG]; simp only [add_mul, one_mul]; abel + _ = π := by rw [O.hGg', hK, hL]; simp + have hKπ : Kq * π = 0 := by rw [← hE5]; exact (by rw [← mul_assoc]; exact hE3) + refine ⟨hKπ, ?_, hE5⟩ + -- the (suf, pre) block + have hR0 : π * (U * (F0 + OSD es ep G g)) * ep = 0 := by + calc π * (U * (F0 + OSD es ep G g)) * ep = ((U * (F0 + OSD es ep G g)) * π) * ep := by rw [H] + _ = U * (F0 + OSD es ep G g) * (π * ep) := by simp only [mul_assoc] + _ = 0 := by rw [O.πep, mul_zero] + have hR1 : π * (U * (OSD es ep G g * ep)) = 0 := by + have : π * (U * (F0 + OSD es ep G g)) * ep = π * (U * (OSD es ep G g * ep)) := by + simp only [mul_add, add_mul, mul_assoc, O.F0ep, mul_zero, zero_add] + rw [← this]; exact hR0 + rw [O.Dep] at hR1 + set Δ := ep * g * ep with hΔ + have hR2 : (π * U * Lq * Δ) + (π * U * Lq * Δ) = 0 := by + have e : π * (U * (-((ep + Lq + Lq + Kq * Lq) * Δ))) = -((π * U * Lq * Δ) + (π * U * Lq * Δ)) := by + have a1 : π * U * ep = 0 := by rw [mul_assoc, O.Uep, O.πep] + have a2 : π * U * (Kq * Lq) = 0 := by + calc π * U * (Kq * Lq) = π * (U * Kq) * Lq := by simp only [mul_assoc] + _ = 0 := by rw [O.UK, O.πK, zero_mul] + calc π * (U * (-((ep + Lq + Lq + Kq * Lq) * Δ))) + = -(π * U * ep * Δ + π * U * Lq * Δ + π * U * Lq * Δ + π * U * (Kq * Lq) * Δ) := by + simp only [mul_neg, neg_inj, add_mul, mul_add, mul_assoc] + _ = _ := by rw [a1, a2]; simp + rw [e] at hR1 + have := neg_eq_zero.1 hR1 + exact this + have hR3 : π * U * Lq * Δ = 0 := half_zero h2 hR2 + calc π * U * Lq = π * U * Lq * ep := by rw [mul_assoc (π * U), O.Lep] + _ = (π * U * Lq * Δ) * (ep - Kq * Lq) := by rw [mul_assoc (π * U * Lq), hΔ, O.C2] + _ = 0 := by rw [hR3, zero_mul] + + +theorem OSData.πD (hπUL : π * U * Lq = 0) : π * U * OSD es ep G g = π * U * (es - ep) := by + have a1 : π * U * ep = 0 := by rw [mul_assoc, O.Uep, O.πep] + have hUG : π * U * G = π * U := by + have a2 : π * U * Kq = 0 := by rw [mul_assoc, O.UK, ← O.epK, ← mul_assoc, O.πep, zero_mul] + rw [O.hG]; simp only [mul_add, mul_one, a2, hπUL, add_zero] + have hX : π * U * es * g = π * U * es := by + have hXG : π * U * es * G = π * U * es := by + have b1 : π * U * es * Kq = 0 := by rw [mul_assoc (π * U), O.esK, mul_zero] + have b2 : π * U * es * Lq = 0 := by rw [mul_assoc (π * U), O.esL, hπUL] + rw [O.hG]; simp only [mul_add, mul_one, b1, b2, add_zero] + calc π * U * es * g = π * U * es * G * g := by rw [hXG] + _ = π * U * es := by rw [mul_assoc _ G, O.hGg, mul_one] + unfold OSD + calc π * U * (G * (es - ep) * g) = (π * U * G) * (es - ep) * g := by simp only [mul_assoc] + _ = π * U * es * g - π * U * ep * g := by rw [hUG]; simp only [mul_sub, sub_mul] + _ = π * U * (es - ep) := by rw [hX, a1, zero_mul, mul_sub, a1, sub_zero] + +theorem OSData.conjF : g * (F0 + OSD es ep G g) * G = F0 + (es - ep) := by + have h1 : g * F0 * G = F0 := by + calc g * F0 * G = g * (ez * F0 * ez) * G := by rw [← O.hF0] + _ = (g * ez) * F0 * (ez * G) := by simp only [mul_assoc] + _ = F0 := by rw [O.gez, O.ezG, ← O.hF0] + have h2 : g * OSD es ep G g * G = es - ep := by + unfold OSD + calc g * (G * (es - ep) * g) * G = (g * G) * (es - ep) * (g * G) := by simp only [mul_assoc] + _ = es - ep := by rw [O.hgG]; simp + rw [mul_add, add_mul, h1, h2] + +/-- **Lemma OS.** Hypotheses (AUDIT-R5): the cut block structure `OSData` (all units between the cut and the +stage `N` form `U`, a product of stage units with no pre part, `π` the mask of `N` with no pre part), +the sheared tuple fixes `U` (`g U g⁻¹ = U`, true when the stage vectors of `U` are fixed by `g`, see +`fixed_conj`), and the original commutation `π (U F) = (U F) π`. +Conclusions: the commutation FORCES `K π = 0` and `π U L = 0`, and the sheared partial product +`g (U F) g⁻¹ = U (F0 ⊕ J)` commutes with `π`. -/ +theorem OSData.os (h2 : (2 : K) ≠ 0) (hU' : g * U * G = U) + (H : π * (U * (F0 + OSD es ep G g)) = (U * (F0 + OSD es ep G g)) * π) : + Kq * π = 0 ∧ π * U * Lq = 0 ∧ + g * (U * (F0 + OSD es ep G g)) * G = U * (F0 + (es - ep)) ∧ + π * (U * (F0 + (es - ep))) = (U * (F0 + (es - ep))) * π := by + obtain ⟨hK, hL, hgπ⟩ := O.forced h2 H + have hconj : g * (U * (F0 + OSD es ep G g)) * G = U * (F0 + (es - ep)) := by + calc g * (U * (F0 + OSD es ep G g)) * G + = (g * U * G) * (g * (F0 + OSD es ep G g) * G) := by + have : g * U * (G * g) * (F0 + OSD es ep G g) * G = g * (U * (F0 + OSD es ep G g)) * G := by + rw [O.hGg]; simp only [mul_assoc, mul_one] + rw [← this]; simp only [mul_assoc] + _ = U * (F0 + (es - ep)) := by rw [hU', O.conjF] + refine ⟨hK, hL, hconj, ?_⟩ + have hπD := O.πD hL + have hDπ := O.Dpi hK hgπ + have hJπ : (es - ep) * π = es * π := by rw [sub_mul, O.epπ, sub_zero] + have e1 : π * (U * (es - ep)) = π * (U * OSD es ep G g) := by + rw [← mul_assoc, ← mul_assoc, hπD] + calc π * (U * (F0 + (es - ep))) = π * (U * F0) + π * (U * (es - ep)) := by simp only [mul_add] + _ = π * (U * F0) + π * (U * OSD es ep G g) := by rw [e1] + _ = π * (U * (F0 + OSD es ep G g)) := by simp only [mul_add] + _ = (U * (F0 + OSD es ep G g)) * π := H + _ = U * F0 * π + U * (OSD es ep G g * π) := by simp only [mul_add, add_mul, mul_assoc] + _ = U * F0 * π + U * ((es - ep) * π) := by rw [hDπ, hJπ] + _ = (U * (F0 + (es - ep))) * π := by simp only [mul_add, add_mul, mul_assoc] + + +/-- A stage-unit vector with no pre part lying in `V_+` (`D x_B = x_B`) is fixed by the shear `g` +(R4 (ii)); hypotheses: `ep x = 0` and `D x = es x` (the B-part of `x` is `es x`, `D` kills `ez`). -/ +theorem OSData.fixed_vec (h2 : (2 : K) ≠ 0) {x : ι → K} (hx : ep *ᵥ x = 0) + (hD : OSD es ep G g *ᵥ x = es *ᵥ x) : g *ᵥ x = x := by + have hGc : G *ᵥ (g *ᵥ x) = x := by rw [mulVec_mulVec, O.hGg, one_mulVec] + set c := g *ᵥ x with hc + clear_value c + have hsplit : x = ez *ᵥ x + es *ᵥ x := by + have : (ez + ep + es) *ᵥ x = x := by rw [O.sum, one_mulVec] + rw [add_mulVec, add_mulVec, hx] at this + simpa using this.symm + have hDx : OSD es ep G g *ᵥ x = G *ᵥ ((es - ep) *ᵥ c) := by + unfold OSD; rw [hc]; simp only [← mulVec_mulVec] + have h1 : (es - ep) *ᵥ c = g *ᵥ (es *ᵥ x) := by + have : G *ᵥ ((es - ep) *ᵥ c) = es *ᵥ x := by rw [← hDx, hD] + calc (es - ep) *ᵥ c = g *ᵥ (G *ᵥ ((es - ep) *ᵥ c)) := by + rw [mulVec_mulVec, O.hgG, one_mulVec] + _ = _ := by rw [this] + have e : g *ᵥ (ez *ᵥ x) = ez *ᵥ x := by rw [mulVec_mulVec, O.gez] + have h2' : c = ez *ᵥ x + g *ᵥ (es *ᵥ x) := by + calc c = g *ᵥ x := hc + _ = g *ᵥ (ez *ᵥ x + es *ᵥ x) := by rw [← hsplit] + _ = _ := by rw [mulVec_add, e] + have h2'' : g *ᵥ (es *ᵥ x) = c - ez *ᵥ x := by rw [h2']; abel + rw [h2''] at h1 + have h3 : ep *ᵥ c = 0 := by + have a : ep *ᵥ ((es - ep) *ᵥ c) = -(ep *ᵥ c) := by + rw [mulVec_mulVec, mul_sub, O.ps, O.pp, zero_sub, neg_mulVec] + have b : ep *ᵥ (c - ez *ᵥ x) = ep *ᵥ c := by + rw [mulVec_sub, mulVec_mulVec, O.pz, zero_mulVec, sub_zero] + have := congrArg (fun v => ep *ᵥ v) h1 + simp only [a, b] at this + exact half_zero h2 (neg_eq_iff_add_eq_zero.1 this) + have hesc : es *ᵥ c = c - ez *ᵥ x := by + rw [← h1, sub_mulVec, h3, sub_zero] + have hx2 : x = es *ᵥ c + Kq *ᵥ c + ez *ᵥ x := by + have : x = G *ᵥ (es *ᵥ c + ez *ᵥ x) := by + rw [hesc]; simp only [sub_add_cancel]; exact hGc.symm + rw [mulVec_add, mulVec_mulVec, mulVec_mulVec, O.Ges, O.Gez, add_mulVec] at this + exact this + have hKc : Kq *ᵥ c = 0 := by + have := congrArg (fun v => ep *ᵥ v) hx2 + simp only [hx, mulVec_add, mulVec_mulVec, O.ps, O.epK, O.pz, zero_mulVec] at this + simpa using this.symm + have hfin : x = es *ᵥ c + ez *ᵥ x := by + rw [hKc, add_zero] at hx2; exact hx2 + calc c = es *ᵥ c + ez *ᵥ x := by rw [hesc]; abel + _ = x := hfin.symm + + +/-- covector version of `fixed_vec`: `y ep = 0` and `y D = y es` give `y G = y`. -/ +theorem OSData.fixed_row (h2 : (2 : K) ≠ 0) {y : ι → K} (hy : y ᵥ* ep = 0) + (hD : y ᵥ* OSD es ep G g = y ᵥ* es) : y ᵥ* G = y := by + have hyK : y ᵥ* Kq = 0 := by + have : y ᵥ* Kq = y ᵥ* (ep * Kq) := by rw [O.epK] + rw [this, ← vecMul_vecMul, hy, zero_vecMul] + have hr : y ᵥ* G = y + y ᵥ* Lq := by + rw [O.hG, vecMul_add, vecMul_add, vecMul_one, hyK, add_zero] + have key : y ᵥ* (G * (es - ep)) = y ᵥ* (es + Lq) := by + have e1 : (y ᵥ* OSD es ep G g) ᵥ* G = y ᵥ* (G * (es - ep)) := by + unfold OSD + rw [vecMul_vecMul]; congr 1 + calc G * (es - ep) * g * G = G * (es - ep) * (g * G) := by simp only [mul_assoc] + _ = G * (es - ep) := by rw [O.hgG, mul_one] + rw [← e1, hD, vecMul_vecMul, O.esG] + have hl : y ᵥ* (G * (es - ep)) = y ᵥ* es - y ᵥ* Lq := by + rw [← vecMul_vecMul, hr, vecMul_sub, add_vecMul, add_vecMul, vecMul_vecMul, vecMul_vecMul, O.Les, O.Lep] + simp [hy] + rw [hl, vecMul_add] at key + have h5 : y ᵥ* Lq + y ᵥ* Lq = 0 := by + have h7 : -(y ᵥ* Lq + y ᵥ* Lq) = 0 := by + have := sub_eq_zero.2 key + rw [← this]; abel + exact neg_eq_zero.1 h7 + rw [hr, half_zero h2 h5, add_zero] + + +end OS + +section NearFar +variable {ez ep es π F0 Kq Lq G g : Matrix ι ι K} + +theorem ep_unit {e : Matrix ι ι K} {x y : ι → K} (hx : e *ᵥ x = 0) : e * unitM x y = e := by + unfold unitM + rw [mul_sub, mul_one, mul_smul_comm, Matrix.mul_vecMulVec, hx] + simp + +theorem unit_ep {e : Matrix ι ι K} {x y : ι → K} (hy : y ᵥ* e = 0) : unitM x y * e = e := by + unfold unitM + rw [sub_mul, one_mul, smul_mul_assoc, Matrix.vecMulVec_mul, hy] + simp + +theorem seg_ep {x y : ℕ → ι → K} {e : Matrix ι ι K} (a d : ℕ) + (h : ∀ j, j < d → e *ᵥ x (a + j) = 0 ∧ y (a + j) ᵥ* e = 0) : + e * seg x y a d = e ∧ seg x y a d * e = e := by + induction d with + | zero => simp [seg] + | succ d ih => + obtain ⟨h1, h2⟩ := ih fun j hj => h j (by omega) + obtain ⟨hx, hy⟩ := h d (by omega) + rw [seg] + refine ⟨?_, ?_⟩ + · rw [← mul_assoc, ep_unit hx, h1] + · rw [mul_assoc, h2, unit_ep hy] + +theorem conj_fixed_unit {g G : Matrix ι ι K} (hgG : g * G = 1) {x y : ι → K} + (hx : g *ᵥ x = x) (hy : y ᵥ* G = y) : g * unitM x y * G = unitM x y := by + rw [← conj_unit hgG, hx, hy] + +theorem conj_fixed_seg {g G : Matrix ι ι K} (hgG : g * G = 1) (hGg : G * g = 1) {x y : ℕ → ι → K} + (a d : ℕ) (h : ∀ j, j < d → g *ᵥ x (a + j) = x (a + j) ∧ y (a + j) ᵥ* G = y (a + j)) : + g * seg x y a d * G = seg x y a d := by + induction d with + | zero => simp [seg, hgG] + | succ d ih => + have h1 := ih fun j hj => h j (by omega) + obtain ⟨hx, hy⟩ := h d (by omega) + rw [seg] + calc g * (unitM (x (a + d)) (y (a + d)) * seg x y a d) * G + = (g * unitM (x (a + d)) (y (a + d)) * G) * (g * seg x y a d * G) := by + calc _ = g * unitM (x (a + d)) (y (a + d)) * (G * g) * seg x y a d * G := by + rw [hGg]; simp only [mul_assoc, mul_one] + _ = _ := by simp only [mul_assoc] + _ = _ := by rw [conj_fixed_unit hgG hx hy, h1] + +theorem OSData.withU {ez ep es π F0 U Kq Lq G g : Matrix ι ι K} + (O : OSData ez ep es π F0 U Kq Lq G g) (U' : Matrix ι ι K) (h1 : ep * U' = ep) (h2 : U' * ep = ep) : + OSData ez ep es π F0 U' Kq Lq G g := { O with epU := h1, Uep := h2 } + +/-- **Lemma OS, near side, in the word.** Hypotheses (AUDIT-R5 (2), explicit): the cut prefix is +`pp a = F0 ⊕ D_B`; every unit `a ≤ j < a+d` between the cut and the stage `N = a+d` is a stage with no pre part +(`ep x = 0`, `y ep = 0`) whose B-part lies in `V_+` (`D x = es x`, `y D = y es`); `π` = mask of `N` (no pre part); +and the ORIGINAL prefix commutation at `N`. Conclusions: commutation forces `K π = 0` and `π U L = 0`, and the +sheared prefix `g pp(N) g⁻¹ = U (F0 ⊕ J)` still commutes with `π`. -/ +theorem near_side {ez ep es π F0 U0 Kq Lq G g : Matrix ι ι K} + (O : OSData ez ep es π F0 U0 Kq Lq G g) (h2 : (2 : K) ≠ 0) {x y : ℕ → ι → K} (a d : ℕ) + (hunit : ∀ j, j < d → ep *ᵥ x (a + j) = 0 ∧ y (a + j) ᵥ* ep = 0 ∧ + OSD es ep G g *ᵥ x (a + j) = es *ᵥ x (a + j) ∧ y (a + j) ᵥ* OSD es ep G g = y (a + j) ᵥ* es) + (hF : pp x y a = F0 + OSD es ep G g) + (H : π * pp x y (a + d) = pp x y (a + d) * π) : + Kq * π = 0 ∧ π * seg x y a d * Lq = 0 ∧ + g * pp x y (a + d) * G = seg x y a d * (F0 + (es - ep)) ∧ + π * (g * pp x y (a + d) * G) = (g * pp x y (a + d) * G) * π := by + obtain ⟨h1, h1'⟩ := seg_ep (x := x) (y := y) (e := ep) a d fun j hj => ⟨(hunit j hj).1, (hunit j hj).2.1⟩ + have O' := O.withU (seg x y a d) h1 h1' + have hfix : g * seg x y a d * G = seg x y a d := + conj_fixed_seg O.hgG O.hGg a d fun j hj => + ⟨O.fixed_vec h2 (hunit j hj).1 (hunit j hj).2.2.1, O.fixed_row h2 (hunit j hj).2.1 (hunit j hj).2.2.2⟩ + rw [pp_add, hF] at H + obtain ⟨hK, hL, -, hcomm⟩ := O'.os h2 hfix H + have hconj : g * pp x y (a + d) * G = seg x y a d * (F0 + (es - ep)) := by + rw [pp_add, hF]; exact (O'.os h2 hfix H).2.2.1 + refine ⟨hK, hL, hconj, ?_⟩ + rw [hconj]; exact hcomm + +/-- **Far side.** If the product `Q` of the units from the stage to the word end (all stages, vectors fixed by +`g`) satisfies `Q P = -1`, then the sheared partial product equals the original one: `g P g⁻¹ = P`. -/ +theorem far_side {P Q : Matrix ι ι K} (hgG : g * G = 1) (hGg : G * g = 1) (hQP : Q * P = -1) + (hQ : g * Q * G = Q) (hQu : IsUnit Q) : g * P * G = P := by + have h : Q * (g * P * G) = Q * P := by + calc Q * (g * P * G) = (g * Q * G) * (g * P * G) := by rw [hQ] + _ = g * (Q * P) * G := by + calc (g * Q * G) * (g * P * G) = g * Q * (G * g) * P * G := by simp only [mul_assoc] + _ = _ := by rw [hGg]; simp only [mul_assoc, mul_one] + _ = Q * P := by + rw [hQP] + calc g * -1 * G = -(g * G) := by noncomm_ring + _ = -1 := by rw [hgG] + exact hQu.mul_right_inj.1 h + +end NearFar + +/-! ## §4. singleton atoms are dead (R1/AUDIT-ER: `D = ±1` on a one-role atom) -/ + +/-- On a one-role atom `D = κ` with `κ² = 1` (TS(5)). If some prefix unit touches the role and some suffix +unit touches it, we get a contradiction: no singleton atom is genuinely shared across a cut. -/ +theorem singleton_dead (h2 : (2 : K) ≠ 0) (κ : K) (hκ : κ * κ = 1) (xp yp xs ys : K) + (hxp : κ * xp = -xp) (hyp : yp * κ = -yp) (hxs : κ * xs = xs) (hys : ys * κ = ys) : + ¬ ((xp ≠ 0 ∨ yp ≠ 0) ∧ (xs ≠ 0 ∨ ys ≠ 0)) := by + rintro ⟨hp, hs⟩ + rcases mul_self_eq_one_iff.1 hκ with h | h + · subst h + have a : xp = 0 := by + have : (2 : K) * xp = 0 := by linear_combination hxp + rcases mul_eq_zero.1 this with h | h + · exact absurd h h2 + · exact h + have b : yp = 0 := by + have : (2 : K) * yp = 0 := by linear_combination hyp + rcases mul_eq_zero.1 this with h | h + · exact absurd h h2 + · exact h + rcases hp with h | h <;> contradiction + · subst h + have a : xs = 0 := by + have : (2 : K) * xs = 0 := by linear_combination -hxs + rcases mul_eq_zero.1 this with h | h + · exact absurd h h2 + · exact h + have b : ys = 0 := by + have : (2 : K) * ys = 0 := by linear_combination -hys + rcases mul_eq_zero.1 this with h | h + · exact absurd h h2 + · exact h + rcases hs with h | h <;> contradiction + +/-! ## §5. boundary addendum (BD): the rank-2 twist sits on the common roles, the rest are involutions -/ + +theorem rank_eq_zero_imp {n : Type*} [Fintype n] [DecidableEq n] {M : Matrix n n K} (h : M.rank = 0) : + M = 0 := by + have h0 : LinearMap.range M.mulVecLin = ⊥ := Submodule.finrank_eq_zero.1 h + ext i j + have hm : M *ᵥ Pi.single j 1 ∈ LinearMap.range M.mulVecLin := ⟨_, rfl⟩ + rw [h0, Submodule.mem_bot] at hm + have := congrFun hm i + simpa [Matrix.mulVec_single_one] using this + +section BD +variable {a b : Type*} [Fintype a] [Fintype b] [DecidableEq a] [DecidableEq b] + +/-- **BD, involution blocks.** `D = D_C ⊕ D_R` with `rank(1 - D²) ≤ 2` (cut tightness B2) and the twist block +`rank(1 - D_C²) ≥ 2` forces `D_R² = 1` on the rest (m1\m2, m2\m1, EO). -/ +theorem bd_involution (Dc : Matrix a a K) (Dr : Matrix b b K) + (hB2 : (1 - fromBlocks Dc 0 0 Dr * fromBlocks Dc 0 0 Dr : Matrix (a ⊕ b) (a ⊕ b) K).rank ≤ 2) + (hC : 2 ≤ (1 - Dc * Dc : Matrix a a K).rank) : Dr * Dr = 1 := by + have e : (1 - fromBlocks Dc 0 0 Dr * fromBlocks Dc 0 0 Dr : Matrix (a ⊕ b) (a ⊕ b) K) + = fromBlocks (1 - Dc * Dc) 0 0 (1 - Dr * Dr) := by + rw [fromBlocks_multiply] + ext (i | i) (j | j) <;> simp [Matrix.one_apply, Matrix.sub_apply] + rw [e] at hB2 + have h := SpecTSUR.rank_fromBlocks_diag_ge (1 - Dc * Dc) (1 - Dr * Dr) + have h0 : (1 - Dr * Dr : Matrix b b K).rank = 0 := by omega + exact (sub_eq_zero.1 (rank_eq_zero_imp h0)).symm + +end BD + +/-- **TS(4) twist bound.** If `(1+D)u, (1+D)v` are independent modulo `ker(1-D)` (no nontrivial combination +is killed by `1-D`), then `rank(1 - D²) ≥ 2` (the content of `rank(I+D_bd) - dim ker(I-D_bd) = rank(I-D_bd²) ≥ 2` +once Lemma S supplies the rank-2 block `X_s2[C]`). -/ +theorem twist_rank_two {n : Type*} [Fintype n] [DecidableEq n] (D : Matrix n n K) (u v : n → K) + (hind : ∀ s t : K, (1 - D) *ᵥ (s • ((1 + D) *ᵥ u) + t • ((1 + D) *ᵥ v)) = 0 → s = 0 ∧ t = 0) : + 2 ≤ (1 - D * D).rank := by + have hM : ((1 - D) * (1 + D) : Matrix n n K) = 1 - D * D := by noncomm_ring + have hp : (1 - D * D) *ᵥ u ∈ LinearMap.range (1 - D * D : Matrix n n K).mulVecLin := ⟨u, rfl⟩ + have hq : (1 - D * D) *ᵥ v ∈ LinearMap.range (1 - D * D : Matrix n n K).mulVecLin := ⟨v, rfl⟩ + have hli : LinearIndependent K ![(1 - D * D) *ᵥ u, (1 - D * D) *ᵥ v] := by + rw [LinearIndependent.pair_iff] + intro s t h + apply hind + rw [mulVec_add, mulVec_smul, mulVec_smul, mulVec_mulVec, mulVec_mulVec, hM] + exact h + let f : Fin 2 → LinearMap.range (1 - D * D : Matrix n n K).mulVecLin := ![⟨_, hp⟩, ⟨_, hq⟩] + have hf : LinearIndependent K f := by + have hc : ((LinearMap.range (1 - D * D : Matrix n n K).mulVecLin).subtype ∘ f) = + ![(1 - D * D) *ᵥ u, (1 - D * D) *ᵥ v] := by + funext i; fin_cases i <;> rfl + apply LinearIndependent.of_comp (LinearMap.range (1 - D * D : Matrix n n K).mulVecLin).subtype + rw [hc]; exact hli + have := hf.fintype_card_le_finrank + simpa [Matrix.rank] using this + + +/-! ## §6. shear lemma GS for blocks of any size (R4 §1): the algebra after the block extraction + +Setting (prefix stage `π`, no suf part; `P' = g P g⁻¹ = 1 + N`, `N` supported on z ⊕ pre). Writing the +commutation `[P', gπG] = 0` in blocks (z|pre|suf) gives (R4's "7 block identities") + `N_zp X = π_z N_zp`, `N_zp X K = 0`, `N_pz π_z = X N_pz`, `L X N_pz = 0`, + `N_pp X = X N_pp`, `N_pp X K = 0`, `L X N_pp = 0`, with `X = Δ p`, `Δ = (1 - K L)⁻¹`. +The three lemmas below derive from them, under `[p, K L] = 0`, the conclusions `N_zp p = π_z N_zp`, +`p N_pz = N_pz π_z`, `N_pp p = p N_pp` (i.e. `[N, π] = 0`). The extraction of the block identities themselves +is routine block multiplication (not formalised; checked numerically at (z,pre,suf) = (2,3,2), see the .md). -/ + +section GS +variable {ep Kq Lq Δ p : Matrix ι ι K} + +/-- `Δ` commutes with `p` (from `[p, K L] = 0` and `Δ = (1 - K L)⁻¹` on the pre block). -/ +theorem gs_comm (hΔ1 : Δ * (ep - Kq * Lq) = ep) (hΔ2 : (ep - Kq * Lq) * Δ = ep) + (hepΔ : ep * Δ = Δ) (hΔep : Δ * ep = Δ) (hpep : p * ep = p) (hepp : ep * p = p) + (hpT : p * (Kq * Lq) = (Kq * Lq) * p) : p * Δ = Δ * p := by + have hM : p * (ep - Kq * Lq) = (ep - Kq * Lq) * p := by + rw [mul_sub, sub_mul, hpep, hepp, hpT] + calc p * Δ = ep * (p * Δ) := by rw [← mul_assoc, hepp] + _ = (Δ * (ep - Kq * Lq)) * (p * Δ) := by rw [hΔ1] + _ = Δ * ((ep - Kq * Lq) * p) * Δ := by simp only [mul_assoc] + _ = Δ * (p * (ep - Kq * Lq)) * Δ := by rw [hM] + _ = Δ * p * ((ep - Kq * Lq) * Δ) := by simp only [mul_assoc] + _ = Δ * p := by rw [hΔ2, mul_assoc, hpep] + +variable (hΔ1 : Δ * (ep - Kq * Lq) = ep) (hΔ2 : (ep - Kq * Lq) * Δ = ep) + (hpΔ : p * Δ = Δ * p) (hpep : p * ep = p) (hepp : ep * p = p) (hpp : p * p = p) +include hΔ1 hΔ2 hpΔ hpep hepp hpp + +/-- (z,pre) block. -/ +theorem gs_zp {W πz : Matrix ι ι K} (hπz : πz * πz = πz) (hW : W * Δ * p = πz * W) : + W * p = πz * W := by + have h0 : (W - πz * W) * Δ * p = 0 := by + calc (W - πz * W) * Δ * p = W * Δ * p - πz * (W * Δ * p) := by simp only [sub_mul, mul_assoc] + _ = πz * W - πz * (πz * W) := by rw [hW] + _ = 0 := by rw [← mul_assoc, hπz, sub_self] + have h1 : (W - πz * W) * p = 0 := by + calc (W - πz * W) * p = (W - πz * W) * p * ep := by rw [mul_assoc _ p ep, hpep] + _ = (W - πz * W) * p * (Δ * (ep - Kq * Lq)) := by rw [hΔ1] + _ = ((W - πz * W) * Δ * p) * (ep - Kq * Lq) := by + have : p * Δ = Δ * p := hpΔ + calc _ = (W - πz * W) * (p * Δ) * (ep - Kq * Lq) := by simp only [mul_assoc] + _ = _ := by rw [this]; simp only [mul_assoc] + _ = 0 := by rw [h0, zero_mul] + have h2 : πz * W * p = πz * W := by + rw [← hW]; simp only [mul_assoc, hpp] + calc W * p = (W - πz * W) * p + πz * W * p := by noncomm_ring + _ = πz * W := by rw [h1, h2, zero_add] + +/-- (pre,z) block. -/ +theorem gs_pz {V πz : Matrix ι ι K} (hepV : ep * V = V) (hV : V * πz = Δ * p * V) + (hL : Lq * Δ * p * V = 0) : p * V = V * πz := by + have h1 : Lq * (V * πz) = 0 := by rw [hV]; simpa only [mul_assoc] using hL + calc p * V = (ep - Kq * Lq) * Δ * p * V := by rw [hΔ2, hepp] + _ = (ep - Kq * Lq) * (Δ * p * V) := by simp only [mul_assoc] + _ = (ep - Kq * Lq) * (V * πz) := by rw [hV] + _ = V * πz := by rw [sub_mul, mul_assoc Kq Lq, h1, mul_zero, sub_zero, ← mul_assoc, hepV] + +/-- (pre,pre) block. -/ +theorem gs_pp {S : Matrix ι ι K} (hepS : ep * S = S) (hSep : S * ep = S) + (hS : S * Δ * p = Δ * p * S) (hL : Lq * Δ * p * S = 0) (hK : S * Δ * p * Kq = 0) : + S * p = p * S := by + have h1 : S * Δ * p = p * S := by + have hM : (ep - Kq * Lq) * (S * Δ * p) = p * S := by + calc (ep - Kq * Lq) * (S * Δ * p) = (ep - Kq * Lq) * (Δ * p * S) := by rw [hS] + _ = ((ep - Kq * Lq) * Δ) * p * S := by simp only [mul_assoc] + _ = p * S := by rw [hΔ2, hepp] + have hM2 : (ep - Kq * Lq) * (S * Δ * p) = S * Δ * p := by + have : Lq * (S * Δ * p) = 0 := by + calc Lq * (S * Δ * p) = Lq * (Δ * p * S) := by rw [hS] + _ = 0 := by rw [← hL]; simp only [mul_assoc] + rw [sub_mul, mul_assoc Kq Lq, this, mul_zero, sub_zero]; simp only [← mul_assoc, hepS] + rw [← hM2, hM] + have h2 : p * S * Kq = 0 := by rw [← h1]; exact hK + calc S * p = S * p * ep := by rw [mul_assoc, hpep] + _ = S * p * (Δ * (ep - Kq * Lq)) := by rw [hΔ1] + _ = (S * (p * Δ)) * (ep - Kq * Lq) := by simp only [mul_assoc] + _ = (S * Δ * p) * (ep - Kq * Lq) := by rw [hpΔ]; simp only [mul_assoc] + _ = (p * S) * (ep - Kq * Lq) := by rw [h1] + _ = p * S := by + rw [mul_sub, mul_assoc p S ep, hSep, ← mul_assoc (p * S) Kq Lq, h2, zero_mul, sub_zero] + +end GS + +end CallerBorrow + +#print axioms CallerBorrow.lemmaE +#print axioms CallerBorrow.lemmaE_dual +#print axioms CallerBorrow.RebaseData.lemmaR +#print axioms CallerBorrow.RebaseData.pre_conf +#print axioms CallerBorrow.RebaseData.suf_conf +#print axioms CallerBorrow.RebaseData.not_both +#print axioms CallerBorrow.singleton_dead +#print axioms CallerBorrow.bd_involution +#print axioms CallerBorrow.twist_rank_two +#print axioms CallerBorrow.OSData.forced +#print axioms CallerBorrow.OSData.os +#print axioms CallerBorrow.OSData.fixed_vec +#print axioms CallerBorrow.OSData.fixed_row +#print axioms CallerBorrow.near_side +#print axioms CallerBorrow.far_side +#print axioms CallerBorrow.gs_comm +#print axioms CallerBorrow.gs_zp +#print axioms CallerBorrow.gs_pz +#print axioms CallerBorrow.gs_pp +#print axioms CallerBorrow.unitM_isUnit diff --git a/research/p104-lean-premises/lean/Nov15/CallerBorrow.md b/research/p104-lean-premises/lean/Nov15/CallerBorrow.md new file mode 100644 index 0000000000..f1dcb773db --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/CallerBorrow.md @@ -0,0 +1,20 @@ +# CallerBorrow.lean: BORROW R1-R6 audited lemmas in an abstract caller model +Kernel-only: no sorry, no native_decide; all 20 `#print axioms` lines at the end of the file give [propext, Classical.choice, Quot.sound]. 9 s / 2.1 GB (the memory-guarded build script). Imports Nov15.SpecTSUR (only `rank_fromBlocks_diag_ge`). +Source: internal notes (not included in this package). + +## Verdict: NO paper statement is false as written once the audit fixes are applied; three scope notes sharpen exactly what is proved. +No counterexample was needed. What the formalisation pins down: +1. **Lemma R** needs g to commute with every mask, i.e. each mask contains Lambda or misses it (one line class). `commute_of_line` + `RebaseData.lemmaR`. The conclusion is per cut and per atom (`not_both`): R1's "an earlier window can NEVER genuinely borrow" stays overstated (AUDIT-ER fix 2); only sharing across THIS cut inside THIS atom/line class is removed. +2. **Lemma OS** (R5/R6): AUDIT-R5's hypotheses are exactly what is needed and are sufficient: every unit between cut and stage is a stage with no pre part (`ep x = 0`, `y ep = 0`) whose B-part lies in V_+ (`D x = es x`, `y D = y es`), pi has no pre part. No [p,KL] = 0 is needed (R4's GS condition was too strong, R5 is right). The commutation FORCES `Kq pi = 0` and `pi U Lq = 0` (`OSData.forced`) and the sheared prefix `g pp(N) g^-1 = U (F0 + J)` commutes with pi (`OSData.os`, `near_side`). The "stage vectors fixed by g" input (R4 (ii)) is DERIVED (`fixed_vec`, `fixed_row`), not assumed. +3. **GS (R4 §1) with [p,KL]=0**: the algebra is formal (`gs_comm`, `gs_zp`, `gs_pz`, `gs_pp`), but the extraction of the seven block identities from `[P, pi] = 0` is only done by hand + numerics (gs_check.py: at (z,pre,suf) = (2,3,2), on the FULL solution space of `[G P' g, pi] = 0` with P' of the prefix shape, `[P', pi] = 0` holds whenever `[p,KL] = 0`, and FAILS (commutator ~2-3) for generic K,L with p not commuting). So the hypothesis cannot be dropped in the near-near (non-OS) case; it is consistent with R5 that E4** only lives where BOTH sides of the stage carry non-stage units. + +## Contents (all in namespace CallerBorrow) +- §0 model: `unitM x y = 1 - 2 x y^T`, `pp` (prefix product T_{s-1}..T_0), `seg` (window product), `pm m` (mask projector), `InMask`, `commute_pm_unit` (stage unit in mask commutes with its projector), `unitM_isUnit` (isotropy y.x = 0 => invertible). +- §1 **Lemma E** `lemmaE` (AUDIT-ER: SOUND; hypothesis "every earlier-window unit a<=j= 2 => Dr^2 = 1: the twist sits on the common roles C, the other blocks are involutions, then R applies where the atom is one line class), `twist_rank_two` (TS(4): two vectors of range(1+D) independent mod ker(1-D) => rank(1-D^2) >= 2; Lemma S supplies the hypothesis). Rank-2 of X_s2[C] itself (Lemma S) is a root-model fact, not in the abstract model. +- §3 **Lemma OS**: `OSData` (z|pre|suf idempotents, G = 1+Kq+Lq, F0, U with no pre part, pi with no pre part), `OSD = G (es-ep) g`, helper identities (`B1`: g ep = (ep-Lq) Delta, `C2`: Delta (ep-Kq Lq) = ep with Delta = ep g ep), `forced`, `os`, `fixed_vec`, `fixed_row`, `near_side` (in the word: U = seg a d, hypotheses per unit), `far_side` (if the stage-only product Q from the stage to the word end is g-fixed and Q P = -1 then g P g^-1 = P). +- §6 **GS algebra**: `gs_comm` (p Delta = Delta p from [p,KL] = 0), `gs_zp`, `gs_pz`, `gs_pp` (the three block conclusions N_zp p = pi_z N_zp, p N_pz = N_pz pi_z, N_pp p = p N_pp, i.e. [N,pi] = 0). R4's claim "[p,KL]=0 => same-kappa confined root" is therefore reduced to the (routine, unformalised) block extraction. + +## Status of the BORROW claims after this round +Formal: E, E-dual, R (given the adapted basis), singleton dead, BD involutions + twist bound, OS (near side, with forced Kp = 0 and pi U L = 0), far side, GS algebra. Open (unchanged, not a Lean matter): E1' pure-suffix boundary block, c=3 split piece, leader layout enumeration (R6 pairs) and the per-cut sequential-shear compatibility. diff --git a/research/p104-lean-premises/lean/Nov15/CallerCost.lean b/research/p104-lean-premises/lean/Nov15/CallerCost.lean new file mode 100644 index 0000000000..644e5b918d --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CallerCost.md b/research/p104-lean-premises/lean/Nov15/CallerCost.md new file mode 100644 index 0000000000..da373369e1 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CensusComplete.lean b/research/p104-lean-premises/lean/Nov15/CensusComplete.lean new file mode 100644 index 0000000000..076a09d0ac --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/CensusComplete.lean @@ -0,0 +1,182 @@ +/- +LEAN-PREM5, Nov 17. Census completeness for #7630 (p104-reroutes-on7623), kernel-checked on the +extracted data (Nov15/CensusData.lean, generated by Nov15/censusgen/gen.py). See CensusComplete.md. +Subset checks run on sorted key lists by a linear merge; soundness of each check holds for ANY input +lists (sortedness only affects whether the check returns true, which `decide` verifies). +-/ +import Nov15.NativeColumns +import Nov15.CensusData + +namespace CensusComplete +open CensusData + +abbrev Pr := Nat × Nat + +def key (p : Pr) : Nat := p.1 * 2048 + p.2 +def keys (l : List Pr) : List Nat := l.map key + +def smallB (l : List Pr) : Bool := l.all (fun p => decide (p.1 < 2048 ∧ p.2 < 2048)) + +/-- sorted merge (fuel-bounded) -/ +def mergeK : Nat → List Nat → List Nat → List Nat + | 0, a, b => a ++ b + | _, [], b => b + | _, a, [] => a + | f + 1, x :: xs, y :: ys => if x < y then x :: mergeK f xs (y :: ys) else y :: mergeK f (x :: xs) ys + +/-- subset check by linear merge-walk -/ +def subK : Nat → List Nat → List Nat → Bool + | _, [], _ => true + | _, _ :: _, [] => false + | 0, _, _ => false + | f + 1, x :: xs, y :: ys => if x == y then subK f xs (y :: ys) else if x < y then false else subK f (x :: xs) ys + +theorem mergeK_sound : ∀ (f : Nat) (a b : List Nat) {x : Nat}, x ∈ mergeK f a b → x ∈ a ∨ x ∈ b := by + intro f + induction f with + | zero => intro a b x h; simpa [mergeK] using h + | succ f ih => + intro a b x h + cases a with + | nil => simpa [mergeK] using h + | cons u us => + cases b with + | nil => exact Or.inl (by simpa [mergeK] using h) + | cons v vs => + simp only [mergeK] at h + split at h + · rcases List.mem_cons.mp h with rfl | h + · simp + · rcases ih _ _ h with h | h <;> simp_all + · rcases List.mem_cons.mp h with rfl | h + · simp + · rcases ih _ _ h with h | h <;> simp_all + +theorem subK_sound : ∀ (f : Nat) (a b : List Nat), subK f a b = true → ∀ x ∈ a, x ∈ b := by + intro f + induction f with + | zero => + intro a b h x hx + cases a with + | nil => simp at hx + | cons u us => cases b <;> simp [subK] at h + | succ f ih => + intro a b h x hx + cases a with + | nil => simp at hx + | cons u us => + cases b with + | nil => simp [subK] at h + | cons v vs => + simp only [subK] at h + split at h + · rename_i huv + have huv' : u = v := by simpa using huv + subst huv' + rcases List.mem_cons.mp hx with rfl | hx + · simp + · exact ih _ _ h x hx + · split at h + · simp at h + · have := ih _ _ h x hx + exact List.mem_cons_of_mem _ this + +theorem key_inj {p q : Pr} (hp : p.2 < 2048) (hq : q.2 < 2048) (h : key p = key q) : p = q := by + obtain ⟨a, b⟩ := p; obtain ⟨c, d⟩ := q + simp only [key] at h hp hq ⊢ + have : a = c := by omega + subst this + have : b = d := by omega + subst this; rfl + +theorem small_mem {l : List Pr} (h : smallB l = true) {p : Pr} (hp : p ∈ l) : p.1 < 2048 ∧ p.2 < 2048 := by + simp only [smallB, List.all_eq_true, decide_eq_true_eq] at h + exact h p hp + +theorem mem_keys_iff {m : List Pr} (hm : smallB m = true) {p : Pr} (hp : p.2 < 2048) : + key p ∈ keys m ↔ p ∈ m := by + constructor + · intro h + obtain ⟨q, hq, e⟩ := List.mem_map.mp h + exact (key_inj (small_mem hm hq).2 hp e) ▸ hq + · intro h; exact List.mem_map.mpr ⟨p, h, rfl⟩ + +/-- a Boolean `subK` success gives pair-level inclusion -/ +theorem subset_of_subK {l m : List Pr} (hl : smallB l = true) (hm : smallB m = true) {f : Nat} + (h : subK f (keys l) (keys m) = true) : ∀ p ∈ l, p ∈ m := fun p hp => + (mem_keys_iff hm (small_mem hl hp).2).mp (subK_sound f _ _ h _ (List.mem_map.mpr ⟨p, hp, rfl⟩)) + +theorem small_census : smallB census = true := by decide +kernel +theorem small_census7623 : smallB census7623 = true := by decide +kernel +theorem small_usedW : smallB usedW = true := by decide +kernel +theorem small_usedB : smallB usedB = true := by decide +kernel +theorem small_newPairs : smallB newPairs = true := by decide +kernel + +theorem census_length : census.length = 981 := by decide +kernel +theorem census7623_length : census7623.length = 964 := by decide +kernel +theorem usedW_length : usedW.length = 3024 := by decide +kernel +theorem usedB_length : usedB.length = 3021 := by decide +kernel + +/-- the census only grew: none of #7623's 964 pairs dropped. -/ +theorem census_extends : ∀ p ∈ census7623, p ∈ census := + subset_of_subK small_census7623 small_census (f := 5000) (by decide +kernel) + +/-- Delta-census completeness (the true statement): used(#7630) ⊆ used(#7623) ∪ census. +This is check.py's `move_pairs(W) - move_pairs(B) <= allp`, as a kernel fact on the extracted data. -/ +theorem used_subset_base_or_census : ∀ p ∈ usedW, p ∈ usedB ∨ p ∈ census := by + have h : subK 20000 (keys usedW) (mergeK 20000 (keys usedB) (keys census)) = true := by decide +kernel + intro p hp + have hx := subK_sound _ _ _ h (key p) (List.mem_map.mpr ⟨p, hp, rfl⟩) + have hp2 := (small_mem small_usedW hp).2 + rcases mergeK_sound _ _ _ hx with h1 | h1 + · exact Or.inl ((mem_keys_iff small_usedB hp2).mp h1) + · exact Or.inr ((mem_keys_iff small_census hp2).mp h1) + +theorem new_in_census : ∀ p ∈ usedW, p ∉ usedB → p ∈ census := fun p hp hb => + (used_subset_base_or_census p hp).resolve_left hb + +/-- the pairs that stop being used (leave #7623's word) are also in the census. -/ +theorem leaving_in_census : ∀ p ∈ usedB, p ∉ usedW → p ∈ census := by + have h : subK 20000 (keys usedB) (mergeK 20000 (keys usedW) (keys census)) = true := by decide +kernel + intro p hp hw + have hx := subK_sound _ _ _ h (key p) (List.mem_map.mpr ⟨p, hp, rfl⟩) + have hp2 := (small_mem small_usedB hp).2 + rcases mergeK_sound _ _ _ hx with h1 | h1 + · exact absurd ((mem_keys_iff small_usedW hp2).mp h1) hw + · exact (mem_keys_iff small_census hp2).mp h1 + +/-- the five new MOVE pairs (README: all strictly nested), in the census, used now, not used by #7623. -/ +theorem newPairs_facts : ∀ p ∈ newPairs, p ∈ usedW ∧ p ∉ usedB ∧ p ∈ census := by decide +kernel +theorem leavePairs_facts : ∀ p ∈ leavePairs, p ∈ usedB ∧ p ∉ usedW ∧ p ∈ census := by decide +kernel +theorem newPairs_length : newPairs.length = 5 := by decide +kernel +theorem leavePairs_length : leavePairs.length = 2 := by decide +kernel + +/-- CORRECTION to LEAN-PREM3's premise: the literal "every used MOVE pair lies in the 981-pair +census" is FALSE (witness: the first used pair outside the census; generator count: 2143 of 3024). -/ +def witness : Pr := (0, 249) +theorem witness_used : witness ∈ usedW := by decide +kernel +theorem witness_outside : witness ∉ census := by decide +kernel +theorem used_not_subset_census : ¬ (∀ p ∈ usedW, p ∈ census) := fun h => + witness_outside (h _ witness_used) + +/-- Composition with `NativeColumns.census_coverage`: given the per-pair column checks on the census +(check.py `columns1/2`, hypothesis) and correctness of the pairs #7623's word already used +(inherited, hypothesis), every pair used by #7630's word is correct. -/ +theorem all_used_correct (Correct : Pr → Prop) + (hcensus : ∀ p ∈ census, Correct p) (hbase : ∀ p ∈ usedB, Correct p) : + ∀ p ∈ usedW, Correct p := by + have := NativeColumns.census_coverage + (used := {p | p ∈ usedW}) (census := {p | p ∈ census ∨ p ∈ usedB}) Correct + (fun p hp => (used_subset_base_or_census p hp).symm) (fun p hp => hp.elim (hcensus p) (hbase p)) + exact fun p hp => this p hp + +/-- Without `hbase` only census pairs are covered. -/ +theorem census_only (Correct : Pr → Prop) (hcensus : ∀ p ∈ census, Correct p) : + ∀ p ∈ usedW, p ∈ census → Correct p := fun p _ hp => hcensus p hp + +end CensusComplete + +#print axioms CensusComplete.used_subset_base_or_census +#print axioms CensusComplete.leaving_in_census +#print axioms CensusComplete.used_not_subset_census +#print axioms CensusComplete.all_used_correct diff --git a/research/p104-lean-premises/lean/Nov15/CensusComplete.md b/research/p104-lean-premises/lean/Nov15/CensusComplete.md new file mode 100644 index 0000000000..5a80003a4f --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/CensusComplete.md @@ -0,0 +1,34 @@ +# CensusComplete (Nov 17): census completeness for #7630, kernel-checked + +Files: `Nov15/CensusComplete.lean` (imports NativeColumns + generated `Nov15/CensusData.lean`); +generator script (stdlib, not shipped; reads the #7630 data files: word.json.gz, +base-7623-word.json.gz, affected-pairs-new.json, affected-pairs-7623.json). Kernel-only (`decide +kernel`, no +native_decide, no sorry), axioms [propext, Quot.sound], 9 s / 2.3 GB (CensusData olean 7 s / 0.8 GB). +Data: census 981, census7623 964, used(#7630) 3,024 distinct MOVE (from,to) pairs, used(#7623) 3,021. + +## FINDING (correction to the earlier narrowing item "a") +The premise as first stated (and in NativeColumns's item a) "every MOVE pair used by #7630 lies in the 981-pair census" is FALSE as stated: +`used_not_subset_census` (witness (0,249); generator count 2,143 of 3,024 used pairs are outside the census, +881 inside, 100 census pairs unused). The census is a DELTA census (pairs touched by the edits relative to the +inherited chain), not a census of all adapter calls. check.py itself only asserts +`move_pairs(W) - move_pairs(B) <= allp`. + +## Proved (kernel, on extracted data) +- `used_subset_base_or_census`: used(#7630) ⊆ used(#7623) ∪ census (= check.py's assertion, now a kernel fact). + `new_in_census`: the 5 new pairs are in the census; `leaving_in_census`: the 2 leaving pairs are too; + `newPairs_facts`/`leavePairs_facts` (exactly 5 new, 2 leaving). `census_extends`: all 964 of #7623's pairs stay. +- `all_used_correct`: for any predicate `Correct` on pairs, (Correct on all 981 census pairs) and (Correct on + all pairs used by #7623's word) imply Correct on every pair used by #7630. Composes with + `NativeColumns.census_coverage`; "Correct on a pair" is instantiable by NativeColumns' exact-rows/columns lemmas. +- Lengths/smallness checks tying lists to the package files; subset checks are linear merge-walks whose + soundness is proved for arbitrary lists (sortedness only matters for the check returning true). + +## Still assumed for `native_all_columns` +1. `hcensus`: the per-pair column checks (check.py columns1/2, 512+512 exact columns per pair) pass on the + 981 pairs: tool fact, not re-run. +2. `hbase`: correctness of the 3,021 pairs used by #7623's word, inherited from #7623/#7620 (only 866 of them + even lie in the 964-pair census; the other ~2,155 were never column-tested by THIS package). This is now the + real residue of "census completeness": it is an inheritance premise on #7623, not a code fact about #7630. +3. Operator realization (Pauli frame/complex phase), compiler/precision halves, checker itself (NativeColumns b-d). +Nothing in the package is shown false; the wording "census covers every used pair" should read +"census covers every pair that differs from #7623's used set; the rest is inherited". diff --git a/research/p104-lean-premises/lean/Nov15/CensusData.lean b/research/p104-lean-premises/lean/Nov15/CensusData.lean new file mode 100644 index 0000000000..c3e23d2fc9 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/CensusData.lean @@ -0,0 +1,23 @@ +set_option maxRecDepth 100000 +/- GENERATED by Nov15/censusgen/gen.py from SHIP-WS4/research/p104-reroutes-on7623/data. Do not edit. -/ +namespace CensusData + +/-- the 981-pair affected-pair census (data/affected-pairs-new.json), sorted -/ +def census : List (Nat × Nat) := [(1, 389), (1, 390), (2, 299), (3, 1), (3, 2), (3, 4), (3, 5), (3, 9), (3, 10), (3, 11), (3, 18), (3, 21), (3, 23), (3, 24), (3, 25), (3, 26), (3, 27), (3, 29), (3, 30), (3, 31), (3, 35), (3, 39), (3, 40), (3, 46), (3, 47), (3, 50), (3, 51), (3, 52), (3, 55), (3, 56), (3, 58), (3, 60), (3, 61), (3, 66), (3, 68), (3, 69), (3, 71), (3, 78), (3, 79), (3, 82), (3, 83), (3, 84), (3, 85), (3, 86), (3, 89), (3, 90), (3, 95), (3, 96), (3, 97), (3, 100), (3, 101), (3, 102), (3, 257), (3, 259), (3, 261), (3, 278), (3, 280), (3, 281), (3, 282), (3, 284), (3, 285), (3, 298), (3, 299), (3, 300), (3, 301), (3, 313), (3, 315), (3, 319), (3, 320), (3, 321), (3, 322), (3, 323), (3, 324), (3, 327), (3, 331), (3, 332), (3, 333), (3, 334), (3, 337), (3, 338), (3, 339), (3, 340), (3, 351), (3, 353), (3, 359), (3, 360), (3, 361), (3, 369), (3, 371), (3, 372), (3, 373), (3, 375), (3, 376), (3, 377), (3, 378), (3, 381), (3, 382), (3, 386), (3, 389), (3, 390), (3, 393), (3, 394), (3, 395), (3, 397), (3, 398), (3, 399), (3, 400), (3, 401), (3, 404), (3, 405), (3, 407), (3, 408), (3, 409), (3, 410), (3, 411), (3, 413), (3, 414), (3, 415), (3, 416), (3, 417), (3, 419), (3, 420), (3, 427), (3, 429), (3, 431), (3, 432), (3, 433), (3, 435), (3, 436), (3, 438), (3, 441), (3, 443), (3, 445), (3, 447), (3, 448), (3, 449), (3, 451), (3, 452), (3, 453), (3, 455), (3, 456), (3, 475), (3, 486), (3, 488), (3, 492), (3, 493), (3, 495), (3, 506), (3, 521), (3, 545), (3, 546), (3, 551), (3, 561), (3, 562), (3, 574), (3, 575), (3, 576), (3, 594), (3, 595), (3, 597), (3, 602), (3, 603), (3, 618), (3, 652), (3, 661), (3, 744), (3, 745), (3, 746), (3, 755), (3, 757), (3, 817), (3, 849), (3, 1053), (3, 1083), (4, 447), (4, 448), (5, 443), (7, 251), (9, 635), (9, 665), (10, 270), (10, 277), (11, 275), (18, 334), (21, 370), (23, 301), (24, 429), (24, 438), (24, 849), (25, 255), (26, 390), (27, 408), (27, 411), (29, 315), (30, 351), (31, 371), (31, 372), (35, 316), (39, 484), (40, 480), (40, 487), (42, 501), (46, 369), (47, 486), (50, 331), (51, 333), (51, 334), (52, 313), (55, 407), (56, 410), (58, 274), (60, 446), (61, 428), (66, 272), (68, 405), (69, 409), (69, 410), (70, 386), (71, 314), (76, 386), (78, 404), (78, 407), (79, 353), (82, 427), (83, 295), (83, 296), (84, 274), (85, 276), (85, 277), (86, 260), (89, 445), (90, 441), (90, 448), (93, 310), (95, 332), (95, 344), (96, 313), (97, 485), (100, 356), (101, 369), (101, 373), (101, 376), (102, 372), (128, 127), (129, 127), (131, 127), (133, 127), (134, 127), (137, 127), (139, 127), (140, 127), (141, 127), (142, 127), (143, 127), (145, 127), (147, 127), (149, 127), (152, 127), (153, 127), (155, 127), (156, 127), (158, 127), (162, 127), (163, 127), (165, 127), (167, 127), (172, 127), (174, 127), (176, 127), (178, 127), (181, 127), (183, 127), (184, 127), (186, 127), (188, 127), (190, 127), (192, 127), (194, 127), (196, 127), (200, 127), (201, 127), (202, 127), (204, 127), (206, 127), (207, 127), (209, 127), (210, 127), (212, 127), (214, 127), (215, 127), (218, 127), (221, 127), (225, 127), (227, 127), (229, 127), (238, 127), (245, 127), (246, 127), (251, 264), (255, 261), (257, 553), (257, 682), (259, 127), (259, 723), (260, 719), (260, 906), (261, 730), (261, 736), (264, 743), (270, 285), (272, 281), (274, 283), (274, 284), (275, 287), (276, 282), (277, 280), (277, 286), (278, 564), (278, 633), (280, 826), (280, 838), (280, 951), (280, 965), (281, 827), (281, 839), (281, 952), (281, 966), (282, 537), (282, 846), (282, 959), (282, 973), (283, 525), (283, 834), (283, 960), (283, 974), (284, 850), (284, 979), (284, 993), (284, 1074), (285, 851), (285, 866), (285, 980), (285, 994), (286, 857), (286, 873), (286, 985), (286, 999), (287, 858), (287, 874), (287, 986), (287, 1000), (295, 300), (296, 298), (298, 526), (298, 828), (298, 953), (298, 975), (299, 829), (299, 847), (299, 954), (299, 976), (300, 538), (300, 840), (300, 961), (300, 967), (301, 835), (301, 841), (301, 962), (301, 968), (310, 716), (313, 322), (313, 323), (313, 554), (314, 326), (315, 321), (315, 822), (316, 325), (319, 838), (320, 839), (321, 526), (321, 822), (322, 554), (322, 847), (323, 853), (323, 881), (323, 981), (323, 1007), (324, 1008), (324, 1075), (325, 863), (325, 889), (325, 985), (325, 1013), (326, 864), (326, 890), (326, 986), (326, 1014), (327, 783), (327, 907), (331, 338), (331, 817), (332, 340), (332, 555), (333, 339), (333, 823), (334, 337), (334, 343), (334, 816), (337, 816), (337, 846), (338, 525), (338, 817), (339, 823), (339, 840), (340, 555), (340, 841), (343, 855), (343, 979), (344, 856), (344, 892), (344, 980), (344, 1016), (351, 360), (351, 555), (353, 359), (353, 823), (356, 727), (359, 538), (359, 823), (360, 555), (360, 835), (361, 885), (361, 1009), (362, 1010), (362, 1076), (369, 378), (369, 379), (369, 554), (370, 382), (371, 377), (371, 822), (372, 375), (372, 381), (372, 816), (372, 871), (373, 618), (373, 733), (373, 913), (375, 537), (375, 816), (376, 817), (376, 834), (377, 822), (377, 828), (378, 554), (378, 829), (379, 877), (379, 1001), (379, 1007), (379, 1077), (380, 888), (380, 1008), (381, 871), (381, 893), (382, 872), (382, 894), (382, 994), (382, 1016), (386, 574), (386, 740), (386, 909), (389, 395), (389, 557), (390, 393), (390, 399), (390, 818), (390, 837), (393, 818), (393, 1074), (394, 866), (395, 557), (395, 875), (397, 881), (398, 1075), (399, 837), (399, 891), (400, 892), (401, 922), (401, 1062), (404, 521), (404, 913), (405, 414), (405, 821), (407, 416), (407, 417), (407, 824), (407, 836), (408, 420), (408, 833), (409, 415), (409, 556), (410, 413), (410, 419), (410, 820), (410, 832), (411, 575), (411, 912), (413, 820), (413, 873), (414, 821), (414, 874), (415, 556), (415, 867), (416, 824), (416, 868), (417, 836), (417, 883), (419, 832), (419, 889), (420, 833), (420, 890), (427, 433), (427, 556), (428, 437), (429, 576), (429, 770), (431, 850), (432, 851), (433, 556), (433, 859), (435, 885), (436, 1076), (437, 528), (437, 973), (438, 849), (438, 894), (441, 456), (441, 527), (443, 452), (443, 821), (445, 455), (445, 848), (446, 458), (447, 453), (447, 557), (448, 451), (448, 457), (448, 820), (449, 928), (449, 1065), (451, 820), (451, 857), (452, 821), (452, 858), (453, 557), (453, 612), (455, 848), (455, 1077), (456, 527), (456, 888), (457, 844), (457, 965), (458, 845), (458, 966), (475, 877), (480, 495), (484, 494), (485, 497), (486, 492), (486, 837), (487, 496), (488, 548), (488, 660), (492, 837), (492, 855), (493, 856), (494, 528), (495, 127), (495, 849), (495, 872), (496, 766), (497, 767), (501, 513), (506, 651), (506, 664), (513, 127), (513, 914), (521, 913), (521, 1029), (525, 127), (525, 974), (526, 127), (526, 975), (527, 976), (528, 127), (528, 973), (537, 127), (537, 959), (538, 127), (538, 961), (545, 665), (546, 548), (548, 127), (548, 660), (551, 553), (553, 127), (553, 682), (554, 946), (555, 948), (556, 947), (557, 945), (561, 657), (562, 564), (564, 127), (564, 633), (574, 909), (574, 1035), (575, 912), (575, 1036), (576, 770), (576, 1033), (594, 602), (594, 723), (594, 725), (594, 760), (594, 764), (594, 765), (594, 883), (595, 127), (595, 603), (595, 618), (595, 736), (597, 731), (597, 732), (602, 636), (602, 638), (602, 640), (602, 641), (602, 684), (602, 685), (602, 686), (602, 687), (602, 688), (602, 689), (603, 127), (612, 127), (618, 733), (618, 789), (618, 913), (631, 127), (631, 152), (633, 127), (633, 212), (635, 127), (635, 210), (636, 631), (636, 647), (638, 645), (638, 651), (640, 647), (641, 645), (645, 127), (645, 651), (647, 127), (647, 631), (649, 127), (649, 176), (651, 127), (651, 140), (651, 174), (652, 649), (652, 657), (657, 127), (657, 649), (660, 127), (660, 231), (661, 664), (664, 127), (664, 651), (665, 127), (665, 635), (674, 127), (674, 142), (682, 127), (682, 134), (682, 180), (684, 682), (684, 695), (685, 694), (685, 696), (686, 674), (686, 693), (687, 694), (688, 695), (689, 693), (693, 127), (693, 674), (694, 127), (694, 696), (695, 127), (695, 682), (696, 127), (696, 165), (716, 783), (716, 807), (719, 907), (723, 127), (723, 902), (725, 883), (727, 729), (729, 789), (729, 808), (730, 127), (730, 913), (731, 826), (732, 827), (733, 238), (736, 127), (736, 909), (740, 1062), (740, 1071), (743, 245), (743, 922), (744, 746), (744, 916), (745, 747), (746, 207), (746, 916), (747, 245), (747, 917), (755, 757), (755, 924), (757, 923), (757, 924), (760, 853), (764, 863), (765, 864), (766, 844), (767, 845), (770, 901), (783, 807), (783, 907), (789, 808), (789, 913), (807, 932), (808, 933), (816, 939), (817, 940), (818, 939), (820, 937), (821, 938), (822, 945), (823, 947), (824, 948), (826, 127), (826, 951), (827, 127), (827, 952), (828, 127), (828, 953), (829, 127), (829, 954), (832, 951), (833, 952), (834, 127), (834, 960), (835, 127), (835, 962), (836, 961), (837, 959), (838, 127), (838, 965), (839, 127), (839, 966), (840, 127), (840, 967), (841, 127), (841, 968), (844, 127), (844, 965), (845, 127), (845, 966), (846, 127), (846, 973), (847, 127), (847, 976), (848, 975), (849, 127), (849, 974), (850, 127), (850, 979), (851, 127), (851, 980), (853, 127), (853, 981), (855, 127), (855, 979), (856, 127), (856, 980), (857, 127), (857, 985), (858, 127), (858, 986), (859, 127), (863, 127), (863, 985), (864, 127), (864, 986), (866, 127), (866, 994), (867, 127), (868, 127), (871, 993), (872, 127), (872, 994), (873, 127), (873, 999), (874, 127), (874, 1000), (875, 127), (877, 127), (877, 1001), (881, 127), (881, 1007), (883, 127), (883, 1009), (885, 127), (885, 1009), (888, 127), (888, 1008), (889, 127), (889, 1013), (890, 127), (890, 1014), (891, 127), (892, 127), (892, 1016), (893, 1015), (894, 127), (894, 1016), (901, 246), (902, 127), (906, 127), (907, 127), (907, 177), (909, 127), (912, 127), (913, 127), (913, 147), (914, 245), (916, 127), (917, 245), (922, 195), (922, 245), (923, 127), (924, 127), (928, 186), (932, 128), (933, 152), (937, 137), (938, 184), (939, 184), (939, 212), (940, 192), (945, 200), (945, 210), (946, 194), (947, 210), (947, 214), (948, 194), (948, 200), (951, 127), (951, 156), (951, 162), (952, 127), (952, 139), (952, 143), (953, 127), (953, 156), (954, 127), (954, 139), (959, 127), (959, 145), (959, 178), (960, 127), (960, 221), (961, 127), (961, 163), (961, 178), (962, 127), (962, 221), (965, 127), (965, 149), (965, 206), (966, 127), (966, 218), (966, 227), (967, 127), (967, 206), (968, 127), (968, 218), (973, 127), (973, 158), (973, 229), (974, 127), (974, 147), (974, 172), (975, 127), (975, 147), (975, 158), (976, 127), (976, 172), (976, 229), (979, 127), (979, 129), (979, 153), (980, 127), (980, 133), (980, 181), (981, 127), (981, 181), (985, 127), (985, 183), (985, 196), (986, 127), (986, 155), (986, 204), (993, 127), (993, 188), (993, 209), (994, 127), (994, 201), (994, 215), (999, 127), (999, 131), (1000, 127), (1000, 190), (1001, 127), (1001, 186), (1007, 127), (1007, 176), (1007, 225), (1008, 127), (1008, 141), (1008, 165), (1009, 127), (1009, 165), (1009, 176), (1010, 127), (1010, 225), (1013, 127), (1013, 174), (1014, 127), (1014, 140), (1015, 142), (1016, 127), (1016, 140), (1016, 167), (1029, 1079), (1033, 1041), (1035, 1042), (1036, 1043), (1041, 246), (1042, 127), (1043, 127), (1053, 1083), (1062, 922), (1062, 1071), (1065, 928), (1071, 1082), (1074, 127), (1074, 993), (1075, 127), (1075, 1008), (1076, 127), (1076, 1010), (1077, 127), (1077, 1007), (1079, 127), (1082, 134), (1083, 202)] + +/-- #7623's 964-pair census (data/affected-pairs-7623.json), sorted -/ +def census7623 : List (Nat × Nat) := [(1, 389), (1, 390), (2, 299), (3, 1), (3, 2), (3, 4), (3, 5), (3, 9), (3, 10), (3, 11), (3, 18), (3, 21), (3, 23), (3, 24), (3, 25), (3, 26), (3, 27), (3, 29), (3, 30), (3, 31), (3, 35), (3, 39), (3, 40), (3, 46), (3, 47), (3, 50), (3, 51), (3, 52), (3, 55), (3, 56), (3, 58), (3, 60), (3, 61), (3, 66), (3, 68), (3, 69), (3, 71), (3, 78), (3, 79), (3, 82), (3, 83), (3, 84), (3, 85), (3, 86), (3, 89), (3, 90), (3, 95), (3, 96), (3, 97), (3, 100), (3, 101), (3, 102), (3, 257), (3, 259), (3, 261), (3, 278), (3, 280), (3, 281), (3, 282), (3, 284), (3, 285), (3, 298), (3, 299), (3, 300), (3, 301), (3, 313), (3, 315), (3, 319), (3, 320), (3, 321), (3, 322), (3, 323), (3, 324), (3, 327), (3, 331), (3, 332), (3, 333), (3, 334), (3, 337), (3, 338), (3, 339), (3, 340), (3, 351), (3, 353), (3, 359), (3, 360), (3, 361), (3, 369), (3, 371), (3, 372), (3, 373), (3, 375), (3, 376), (3, 377), (3, 378), (3, 381), (3, 382), (3, 386), (3, 389), (3, 390), (3, 393), (3, 394), (3, 395), (3, 397), (3, 398), (3, 399), (3, 400), (3, 401), (3, 404), (3, 405), (3, 407), (3, 408), (3, 409), (3, 410), (3, 411), (3, 413), (3, 414), (3, 415), (3, 416), (3, 417), (3, 419), (3, 420), (3, 427), (3, 429), (3, 431), (3, 432), (3, 433), (3, 435), (3, 436), (3, 438), (3, 441), (3, 443), (3, 445), (3, 447), (3, 448), (3, 451), (3, 452), (3, 453), (3, 455), (3, 456), (3, 475), (3, 486), (3, 488), (3, 492), (3, 493), (3, 495), (3, 506), (3, 521), (3, 545), (3, 546), (3, 551), (3, 561), (3, 562), (3, 574), (3, 575), (3, 576), (3, 594), (3, 595), (3, 597), (3, 602), (3, 603), (3, 652), (3, 661), (3, 744), (3, 745), (3, 746), (3, 755), (3, 757), (3, 817), (3, 1053), (3, 1083), (4, 447), (4, 448), (5, 443), (7, 251), (9, 635), (9, 665), (10, 270), (10, 277), (11, 275), (18, 334), (21, 370), (23, 301), (24, 429), (24, 438), (24, 849), (25, 255), (26, 390), (27, 408), (27, 411), (29, 315), (30, 351), (31, 371), (31, 372), (35, 316), (39, 484), (40, 487), (42, 501), (46, 369), (47, 486), (50, 331), (51, 333), (51, 334), (52, 313), (55, 407), (56, 410), (58, 274), (60, 446), (61, 428), (66, 272), (68, 405), (69, 409), (69, 410), (70, 386), (71, 314), (76, 386), (78, 404), (78, 407), (79, 353), (82, 427), (83, 295), (83, 296), (84, 274), (85, 276), (85, 277), (86, 260), (89, 445), (90, 441), (90, 448), (93, 310), (95, 332), (95, 344), (96, 313), (97, 485), (100, 356), (101, 369), (101, 373), (101, 376), (102, 372), (128, 127), (129, 127), (131, 127), (133, 127), (134, 127), (137, 127), (139, 127), (140, 127), (141, 127), (142, 127), (143, 127), (145, 127), (147, 127), (149, 127), (152, 127), (153, 127), (155, 127), (156, 127), (158, 127), (162, 127), (163, 127), (165, 127), (167, 127), (172, 127), (174, 127), (176, 127), (178, 127), (181, 127), (183, 127), (184, 127), (186, 127), (188, 127), (190, 127), (192, 127), (194, 127), (196, 127), (200, 127), (201, 127), (202, 127), (204, 127), (206, 127), (207, 127), (209, 127), (210, 127), (212, 127), (214, 127), (215, 127), (218, 127), (221, 127), (225, 127), (227, 127), (229, 127), (238, 127), (245, 127), (246, 127), (251, 264), (255, 261), (257, 553), (257, 682), (259, 127), (259, 723), (260, 719), (260, 906), (261, 730), (261, 736), (264, 743), (270, 285), (272, 281), (274, 283), (274, 284), (275, 287), (276, 282), (277, 280), (277, 286), (278, 564), (278, 633), (280, 826), (280, 838), (280, 951), (280, 965), (281, 827), (281, 839), (281, 952), (281, 966), (282, 537), (282, 846), (282, 959), (282, 973), (283, 525), (283, 834), (283, 960), (283, 974), (284, 850), (284, 979), (284, 993), (284, 1074), (285, 851), (285, 866), (285, 980), (285, 994), (286, 857), (286, 873), (286, 985), (286, 999), (287, 858), (287, 874), (287, 986), (287, 1000), (295, 300), (296, 298), (298, 526), (298, 828), (298, 953), (298, 975), (299, 829), (299, 847), (299, 954), (299, 976), (300, 538), (300, 840), (300, 961), (300, 967), (301, 835), (301, 841), (301, 962), (301, 968), (310, 716), (313, 322), (313, 323), (313, 554), (314, 326), (315, 321), (315, 822), (316, 325), (319, 838), (320, 839), (321, 526), (321, 822), (322, 554), (322, 847), (323, 853), (323, 881), (323, 981), (323, 1007), (324, 1008), (324, 1075), (325, 863), (325, 889), (325, 985), (325, 1013), (326, 864), (326, 890), (326, 986), (326, 1014), (327, 783), (327, 907), (331, 338), (331, 817), (332, 340), (332, 555), (333, 339), (333, 823), (334, 337), (334, 343), (334, 816), (337, 816), (337, 846), (338, 525), (338, 817), (339, 823), (339, 840), (340, 555), (340, 841), (343, 855), (343, 979), (344, 856), (344, 892), (344, 980), (344, 1016), (351, 360), (351, 555), (353, 359), (353, 823), (356, 727), (359, 538), (359, 823), (360, 555), (360, 835), (361, 885), (361, 1009), (362, 1010), (362, 1076), (369, 378), (369, 379), (369, 554), (370, 382), (371, 377), (371, 822), (372, 375), (372, 381), (372, 816), (372, 871), (373, 618), (373, 733), (373, 913), (375, 537), (375, 816), (376, 817), (376, 834), (377, 822), (377, 828), (378, 554), (378, 829), (379, 877), (379, 1001), (379, 1007), (379, 1077), (380, 888), (380, 1008), (381, 871), (381, 893), (382, 872), (382, 894), (382, 994), (382, 1016), (386, 574), (386, 740), (386, 909), (389, 395), (389, 557), (390, 393), (390, 399), (390, 818), (390, 837), (393, 818), (393, 1074), (394, 866), (395, 557), (395, 875), (397, 881), (398, 1075), (399, 837), (399, 891), (400, 892), (401, 922), (401, 1062), (404, 521), (404, 913), (405, 414), (405, 821), (407, 416), (407, 417), (407, 824), (407, 836), (408, 420), (408, 833), (409, 415), (409, 556), (410, 413), (410, 419), (410, 820), (410, 832), (411, 575), (411, 912), (413, 820), (413, 873), (414, 821), (414, 874), (415, 556), (415, 867), (416, 824), (416, 868), (417, 836), (417, 883), (419, 832), (419, 889), (420, 833), (420, 890), (427, 433), (427, 556), (428, 437), (429, 576), (429, 770), (431, 850), (432, 851), (433, 556), (433, 859), (435, 885), (436, 1076), (437, 528), (437, 973), (438, 849), (438, 894), (441, 456), (441, 527), (443, 452), (443, 821), (445, 455), (445, 848), (446, 458), (447, 453), (447, 557), (448, 451), (448, 457), (448, 820), (451, 820), (451, 857), (452, 821), (452, 858), (453, 557), (453, 612), (455, 848), (455, 1077), (456, 527), (456, 888), (457, 844), (457, 965), (458, 845), (458, 966), (475, 877), (484, 494), (485, 497), (486, 492), (486, 837), (487, 496), (488, 548), (488, 660), (492, 837), (492, 855), (493, 856), (494, 528), (495, 872), (496, 766), (497, 767), (501, 513), (506, 651), (506, 664), (513, 127), (513, 914), (521, 913), (521, 1029), (525, 127), (525, 974), (526, 127), (526, 975), (527, 976), (528, 127), (528, 973), (537, 127), (537, 959), (538, 127), (538, 961), (545, 665), (546, 548), (548, 127), (548, 660), (551, 553), (553, 127), (553, 682), (554, 946), (555, 948), (556, 947), (557, 945), (561, 657), (562, 564), (564, 127), (564, 633), (574, 909), (574, 1035), (575, 912), (575, 1036), (576, 770), (576, 1033), (594, 602), (594, 723), (594, 760), (594, 764), (594, 765), (595, 127), (595, 603), (595, 618), (595, 736), (597, 731), (597, 732), (602, 636), (602, 638), (602, 640), (602, 641), (602, 684), (602, 685), (602, 686), (602, 687), (602, 688), (602, 689), (603, 127), (612, 127), (618, 733), (618, 789), (618, 913), (631, 127), (631, 152), (633, 127), (633, 212), (635, 127), (635, 210), (636, 631), (636, 647), (638, 645), (638, 651), (640, 647), (641, 645), (645, 127), (645, 651), (647, 127), (647, 631), (649, 127), (649, 176), (651, 127), (651, 140), (651, 174), (652, 649), (652, 657), (657, 127), (657, 649), (660, 127), (660, 231), (661, 664), (664, 127), (664, 651), (665, 127), (665, 635), (674, 127), (674, 142), (682, 127), (682, 134), (682, 180), (684, 682), (684, 695), (685, 694), (685, 696), (686, 674), (686, 693), (687, 694), (688, 695), (689, 693), (693, 127), (693, 674), (694, 127), (694, 696), (695, 127), (695, 682), (696, 127), (696, 165), (716, 783), (716, 807), (719, 907), (723, 127), (723, 902), (727, 729), (729, 789), (729, 808), (730, 127), (730, 913), (731, 826), (732, 827), (733, 238), (736, 127), (736, 909), (740, 1062), (740, 1071), (743, 245), (743, 922), (744, 746), (744, 916), (745, 747), (746, 207), (746, 916), (747, 245), (747, 917), (755, 757), (755, 924), (757, 923), (757, 924), (760, 853), (764, 863), (765, 864), (766, 844), (767, 845), (770, 901), (783, 807), (783, 907), (789, 808), (789, 913), (807, 932), (808, 933), (816, 939), (817, 940), (818, 939), (820, 937), (821, 938), (822, 945), (823, 947), (824, 948), (826, 127), (826, 951), (827, 127), (827, 952), (828, 127), (828, 953), (829, 127), (829, 954), (832, 951), (833, 952), (834, 127), (834, 960), (835, 127), (835, 962), (836, 961), (837, 959), (838, 127), (838, 965), (839, 127), (839, 966), (840, 127), (840, 967), (841, 127), (841, 968), (844, 127), (844, 965), (845, 127), (845, 966), (846, 127), (846, 973), (847, 127), (847, 976), (848, 975), (849, 974), (850, 127), (850, 979), (851, 127), (851, 980), (853, 127), (853, 981), (855, 127), (855, 979), (856, 127), (856, 980), (857, 127), (857, 985), (858, 127), (858, 986), (859, 127), (863, 127), (863, 985), (864, 127), (864, 986), (866, 127), (866, 994), (867, 127), (868, 127), (871, 993), (872, 127), (872, 994), (873, 127), (873, 999), (874, 127), (874, 1000), (875, 127), (877, 127), (877, 1001), (881, 127), (881, 1007), (883, 127), (885, 127), (885, 1009), (888, 127), (888, 1008), (889, 127), (889, 1013), (890, 127), (890, 1014), (891, 127), (892, 127), (892, 1016), (893, 1015), (894, 127), (894, 1016), (901, 246), (902, 127), (906, 127), (907, 127), (907, 177), (909, 127), (912, 127), (913, 127), (913, 147), (914, 245), (916, 127), (917, 245), (922, 195), (922, 245), (923, 127), (924, 127), (932, 128), (933, 152), (937, 137), (938, 184), (939, 184), (939, 212), (940, 192), (945, 200), (945, 210), (946, 194), (947, 210), (947, 214), (948, 194), (948, 200), (951, 127), (951, 156), (951, 162), (952, 127), (952, 139), (952, 143), (953, 127), (953, 156), (954, 127), (954, 139), (959, 127), (959, 145), (959, 178), (960, 127), (960, 221), (961, 127), (961, 163), (961, 178), (962, 127), (962, 221), (965, 127), (965, 149), (965, 206), (966, 127), (966, 218), (966, 227), (967, 127), (967, 206), (968, 127), (968, 218), (973, 127), (973, 158), (973, 229), (974, 127), (974, 147), (974, 172), (975, 127), (975, 147), (975, 158), (976, 127), (976, 172), (976, 229), (979, 127), (979, 129), (979, 153), (980, 127), (980, 133), (980, 181), (981, 127), (981, 181), (985, 127), (985, 183), (985, 196), (986, 127), (986, 155), (986, 204), (993, 127), (993, 188), (993, 209), (994, 127), (994, 201), (994, 215), (999, 127), (999, 131), (1000, 127), (1000, 190), (1001, 127), (1001, 186), (1007, 127), (1007, 176), (1007, 225), (1008, 127), (1008, 141), (1008, 165), (1009, 127), (1009, 165), (1010, 127), (1010, 225), (1013, 127), (1013, 174), (1014, 127), (1014, 140), (1015, 142), (1016, 127), (1016, 140), (1016, 167), (1029, 1079), (1033, 1041), (1035, 1042), (1036, 1043), (1041, 246), (1042, 127), (1043, 127), (1053, 1083), (1062, 922), (1062, 1071), (1071, 1082), (1074, 127), (1074, 993), (1075, 127), (1075, 1008), (1076, 127), (1076, 1010), (1077, 127), (1077, 1007), (1079, 127), (1082, 134), (1083, 202)] + +/-- distinct (from-chart, to-chart) pairs of MOVE events of #7630's word (data/word.json.gz), sorted -/ +def usedW : List (Nat × Nat) := [(0, 249), (0, 250), (0, 251), (1, 383), (1, 389), (1, 390), (2, 292), (2, 293), (2, 299), (2, 304), (3, 0), (3, 1), (3, 2), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8), (3, 9), (3, 10), (3, 11), (3, 12), (3, 13), (3, 14), (3, 15), (3, 16), (3, 17), (3, 18), (3, 19), (3, 20), (3, 21), (3, 22), (3, 23), (3, 24), (3, 25), (3, 26), (3, 27), (3, 28), (3, 29), (3, 30), (3, 31), (3, 32), (3, 33), (3, 34), (3, 35), (3, 36), (3, 37), (3, 38), (3, 39), (3, 40), (3, 41), (3, 42), (3, 43), (3, 44), (3, 45), (3, 46), (3, 47), (3, 48), (3, 49), (3, 50), (3, 51), (3, 52), (3, 53), (3, 54), (3, 55), (3, 56), (3, 57), (3, 58), (3, 59), (3, 60), (3, 61), (3, 62), (3, 63), (3, 64), (3, 65), (3, 66), (3, 67), (3, 68), (3, 69), (3, 70), (3, 71), (3, 72), (3, 73), (3, 74), (3, 75), (3, 76), (3, 77), (3, 78), (3, 79), (3, 80), (3, 81), (3, 82), (3, 83), (3, 84), (3, 85), (3, 86), (3, 87), (3, 88), (3, 89), (3, 90), (3, 91), (3, 92), (3, 93), (3, 94), (3, 95), (3, 96), (3, 97), (3, 98), (3, 99), (3, 100), (3, 101), (3, 102), (3, 103), (3, 104), (3, 105), (3, 114), (3, 115), (3, 116), (3, 117), (3, 118), (3, 120), (3, 151), (3, 189), (3, 245), (3, 249), (3, 252), (3, 257), (3, 258), (3, 259), (3, 260), (3, 261), (3, 263), (3, 264), (3, 265), (3, 268), (3, 278), (3, 279), (3, 280), (3, 281), (3, 282), (3, 283), (3, 284), (3, 285), (3, 286), (3, 287), (3, 289), (3, 292), (3, 297), (3, 298), (3, 299), (3, 300), (3, 301), (3, 307), (3, 310), (3, 313), (3, 315), (3, 317), (3, 318), (3, 319), (3, 320), (3, 323), (3, 324), (3, 325), (3, 326), (3, 327), (3, 330), (3, 331), (3, 332), (3, 333), (3, 334), (3, 336), (3, 343), (3, 344), (3, 345), (3, 348), (3, 351), (3, 353), (3, 355), (3, 356), (3, 361), (3, 362), (3, 363), (3, 364), (3, 365), (3, 369), (3, 371), (3, 372), (3, 373), (3, 374), (3, 379), (3, 380), (3, 382), (3, 383), (3, 386), (3, 389), (3, 390), (3, 391), (3, 392), (3, 394), (3, 396), (3, 397), (3, 398), (3, 400), (3, 401), (3, 404), (3, 405), (3, 407), (3, 408), (3, 409), (3, 410), (3, 411), (3, 412), (3, 418), (3, 421), (3, 424), (3, 427), (3, 429), (3, 430), (3, 431), (3, 432), (3, 435), (3, 436), (3, 437), (3, 439), (3, 441), (3, 442), (3, 443), (3, 445), (3, 447), (3, 448), (3, 449), (3, 450), (3, 457), (3, 458), (3, 459), (3, 462), (3, 467), (3, 468), (3, 470), (3, 471), (3, 472), (3, 475), (3, 476), (3, 478), (3, 481), (3, 486), (3, 488), (3, 489), (3, 493), (3, 494), (3, 495), (3, 499), (3, 506), (3, 507), (3, 508), (3, 509), (3, 512), (3, 513), (3, 514), (3, 515), (3, 519), (3, 533), (3, 535), (3, 545), (3, 546), (3, 549), (3, 551), (3, 561), (3, 562), (3, 570), (3, 571), (3, 572), (3, 573), (3, 577), (3, 593), (3, 594), (3, 595), (3, 597), (3, 598), (3, 599), (3, 600), (3, 601), (3, 602), (3, 603), (3, 618), (3, 652), (3, 661), (3, 676), (3, 712), (3, 714), (3, 716), (3, 717), (3, 720), (3, 721), (3, 722), (3, 724), (3, 733), (3, 734), (3, 735), (3, 739), (3, 740), (3, 741), (3, 744), (3, 745), (3, 746), (3, 747), (3, 748), (3, 749), (3, 750), (3, 755), (3, 757), (3, 772), (3, 817), (3, 849), (3, 1027), (3, 1031), (3, 1048), (3, 1049), (3, 1050), (3, 1051), (3, 1052), (3, 1053), (3, 1083), (3, 1089), (3, 1091), (4, 439), (4, 447), (4, 448), (5, 442), (5, 443), (5, 444), (6, 383), (6, 384), (6, 385), (7, 251), (7, 256), (7, 258), (8, 425), (8, 429), (8, 434), (8, 435), (9, 293), (9, 294), (9, 306), (9, 635), (9, 661), (9, 665), (9, 676), (10, 270), (10, 277), (10, 279), (11, 273), (11, 275), (11, 278), (12, 307), (12, 308), (12, 309), (13, 478), (13, 479), (13, 480), (14, 459), (14, 460), (14, 461), (15, 479), (15, 486), (15, 489), (16, 308), (16, 315), (16, 318), (17, 331), (17, 332), (17, 720), (17, 722), (17, 1057), (17, 1058), (18, 329), (18, 334), (18, 336), (19, 500), (19, 504), (19, 507), (20, 366), (20, 371), (20, 374), (21, 370), (21, 373), (21, 377), (21, 380), (22, 347), (22, 354), (22, 356), (23, 292), (23, 294), (23, 301), (23, 302), (24, 426), (24, 429), (24, 431), (24, 438), (25, 249), (25, 255), (25, 256), (26, 385), (26, 390), (26, 392), (27, 406), (27, 408), (27, 411), (28, 402), (28, 409), (28, 412), (29, 307), (29, 315), (29, 316), (30, 348), (30, 351), (30, 352), (31, 365), (31, 371), (31, 372), (32, 350), (32, 352), (32, 355), (33, 499), (33, 500), (33, 501), (34, 502), (34, 506), (34, 509), (34, 514), (35, 309), (35, 316), (35, 318), (36, 328), (36, 333), (36, 336), (37, 463), (37, 467), (37, 470), (37, 475), (38, 460), (38, 465), (38, 468), (39, 482), (39, 484), (39, 488), (40, 480), (40, 487), (40, 489), (41, 349), (41, 351), (41, 355), (42, 501), (42, 505), (42, 507), (43, 502), (43, 503), (43, 652), (43, 668), (43, 669), (44, 348), (44, 349), (44, 350), (45, 365), (45, 366), (45, 367), (46, 369), (46, 370), (46, 734), (46, 735), (46, 790), (46, 914), (47, 478), (47, 486), (47, 487), (47, 490), (48, 462), (48, 463), (48, 464), (48, 469), (48, 472), (49, 459), (49, 465), (49, 466), (50, 330), (50, 331), (50, 339), (50, 342), (51, 327), (51, 333), (51, 334), (52, 310), (52, 313), (52, 314), (53, 250), (53, 255), (53, 258), (54, 384), (54, 389), (54, 392), (55, 405), (55, 407), (55, 411), (56, 403), (56, 410), (56, 412), (57, 269), (57, 276), (57, 279), (58, 272), (58, 274), (58, 278), (59, 440), (59, 447), (59, 450), (60, 444), (60, 446), (60, 449), (61, 423), (61, 428), (61, 430), (62, 424), (62, 425), (62, 426), (63, 439), (63, 440), (63, 441), (64, 442), (64, 445), (64, 446), (65, 268), (65, 269), (65, 270), (66, 271), (66, 272), (66, 273), (67, 289), (67, 290), (67, 291), (68, 404), (68, 405), (68, 406), (69, 401), (69, 409), (69, 410), (70, 386), (70, 388), (70, 396), (70, 397), (71, 312), (71, 314), (71, 317), (72, 481), (72, 482), (72, 483), (73, 291), (73, 296), (73, 297), (74, 421), (74, 422), (74, 423), (75, 254), (75, 257), (75, 261), (75, 264), (76, 386), (76, 387), (76, 394), (76, 399), (77, 401), (77, 402), (77, 403), (78, 404), (78, 407), (78, 408), (79, 345), (79, 353), (79, 354), (80, 387), (80, 388), (80, 391), (81, 252), (81, 253), (81, 254), (82, 421), (82, 427), (82, 428), (83, 289), (83, 295), (83, 296), (84, 271), (84, 274), (84, 275), (85, 268), (85, 276), (85, 277), (86, 253), (86, 257), (86, 260), (86, 265), (87, 290), (87, 295), (87, 297), (88, 422), (88, 427), (88, 430), (89, 443), (89, 445), (89, 449), (90, 441), (90, 448), (90, 450), (91, 345), (91, 346), (91, 347), (92, 481), (92, 484), (92, 485), (92, 490), (92, 493), (93, 310), (93, 311), (93, 312), (94, 327), (94, 328), (94, 329), (95, 330), (95, 332), (95, 337), (95, 344), (96, 311), (96, 313), (96, 317), (97, 483), (97, 485), (97, 488), (98, 461), (98, 466), (98, 468), (99, 464), (99, 467), (99, 471), (99, 474), (100, 346), (100, 353), (100, 356), (101, 369), (101, 373), (101, 376), (101, 381), (102, 367), (102, 372), (102, 374), (103, 503), (103, 506), (103, 510), (103, 513), (104, 499), (104, 504), (104, 505), (105, 266), (105, 421), (105, 424), (105, 430), (105, 756), (105, 1051), (114, 814), (114, 815), (114, 816), (114, 817), (114, 818), (114, 819), (114, 820), (114, 821), (115, 554), (115, 555), (115, 556), (115, 557), (115, 593), (115, 822), (115, 823), (115, 824), (115, 825), (116, 826), (116, 827), (116, 828), (116, 829), (116, 830), (116, 831), (116, 832), (116, 833), (117, 127), (117, 222), (117, 534), (117, 537), (117, 538), (117, 539), (117, 540), (117, 594), (117, 834), (117, 835), (117, 836), (117, 837), (118, 838), (118, 839), (118, 840), (118, 841), (118, 842), (118, 843), (118, 844), (118, 845), (120, 207), (120, 612), (120, 850), (120, 851), (120, 852), (120, 853), (120, 854), (120, 855), (120, 856), (128, 127), (129, 127), (130, 127), (131, 127), (132, 127), (133, 127), (134, 127), (135, 127), (136, 127), (137, 127), (138, 127), (139, 127), (140, 127), (141, 127), (142, 127), (143, 127), (144, 127), (145, 127), (146, 127), (147, 127), (148, 127), (149, 127), (150, 127), (151, 127), (152, 127), (153, 127), (154, 127), (155, 127), (156, 127), (157, 127), (158, 127), (159, 127), (160, 127), (161, 127), (162, 127), (163, 127), (164, 127), (165, 127), (166, 127), (167, 127), (168, 127), (169, 127), (170, 127), (171, 127), (172, 127), (173, 127), (174, 127), (175, 127), (176, 127), (177, 127), (178, 127), (179, 127), (180, 127), (181, 127), (182, 127), (183, 127), (184, 127), (185, 127), (186, 127), (187, 127), (188, 127), (189, 127), (190, 127), (191, 127), (192, 127), (193, 127), (194, 127), (195, 127), (196, 127), (197, 127), (198, 127), (199, 127), (200, 127), (201, 127), (202, 127), (203, 127), (204, 127), (205, 127), (206, 127), (207, 127), (208, 127), (209, 127), (210, 127), (211, 127), (212, 127), (213, 127), (214, 127), (215, 127), (216, 127), (217, 127), (218, 127), (219, 127), (220, 127), (221, 127), (222, 127), (223, 127), (224, 127), (225, 127), (226, 127), (227, 127), (228, 127), (229, 127), (230, 127), (231, 127), (232, 127), (232, 267), (232, 517), (233, 127), (234, 127), (234, 233), (234, 267), (234, 477), (234, 518), (235, 127), (235, 267), (235, 518), (237, 127), (237, 238), (237, 267), (237, 477), (237, 517), (238, 127), (240, 127), (240, 241), (240, 394), (240, 518), (241, 127), (242, 127), (242, 245), (242, 477), (242, 517), (243, 127), (243, 431), (243, 517), (244, 127), (244, 477), (244, 518), (245, 127), (246, 127), (249, 622), (249, 628), (249, 639), (249, 645), (250, 260), (250, 266), (251, 262), (251, 264), (252, 127), (252, 619), (252, 684), (253, 262), (253, 263), (254, 259), (254, 266), (255, 261), (255, 263), (256, 259), (256, 265), (257, 550), (257, 553), (257, 636), (257, 682), (258, 550), (258, 680), (258, 687), (258, 693), (259, 127), (259, 534), (259, 723), (259, 1091), (260, 127), (260, 599), (260, 719), (260, 724), (260, 906), (260, 1091), (261, 730), (261, 736), (261, 1091), (262, 737), (262, 1091), (263, 742), (263, 746), (263, 1091), (264, 743), (264, 747), (264, 1091), (265, 751), (265, 757), (265, 1091), (266, 752), (266, 758), (266, 1091), (267, 127), (267, 1091), (268, 561), (268, 624), (268, 630), (268, 656), (269, 281), (269, 287), (270, 283), (270, 285), (271, 621), (271, 697), (272, 281), (272, 286), (273, 282), (273, 285), (274, 283), (274, 284), (275, 280), (275, 287), (276, 282), (276, 284), (277, 280), (277, 286), (278, 551), (278, 561), (278, 564), (278, 633), (278, 679), (279, 553), (279, 677), (279, 700), (279, 706), (280, 288), (280, 826), (280, 838), (280, 951), (280, 965), (281, 288), (281, 827), (281, 839), (281, 952), (281, 966), (282, 288), (282, 537), (282, 846), (282, 959), (282, 973), (283, 288), (283, 525), (283, 834), (283, 960), (283, 974), (284, 288), (284, 850), (284, 979), (284, 993), (284, 1074), (285, 288), (285, 851), (285, 866), (285, 980), (285, 994), (286, 288), (286, 857), (286, 873), (286, 985), (286, 999), (287, 288), (287, 858), (287, 874), (287, 986), (287, 1000), (288, 127), (288, 267), (288, 477), (289, 548), (289, 623), (289, 629), (289, 661), (290, 299), (290, 305), (291, 301), (291, 303), (292, 566), (292, 620), (292, 1032), (293, 300), (293, 303), (294, 298), (294, 305), (295, 300), (295, 302), (296, 298), (296, 304), (297, 551), (297, 566), (297, 671), (297, 681), (298, 306), (298, 526), (298, 828), (298, 953), (298, 975), (299, 306), (299, 829), (299, 847), (299, 954), (299, 976), (300, 306), (300, 538), (300, 840), (300, 961), (300, 967), (301, 306), (301, 835), (301, 841), (301, 962), (301, 968), (302, 306), (302, 712), (303, 306), (303, 713), (304, 306), (304, 714), (305, 306), (305, 715), (306, 127), (306, 267), (306, 517), (306, 518), (307, 570), (307, 716), (307, 901), (307, 904), (308, 320), (308, 326), (309, 322), (309, 324), (310, 716), (310, 717), (310, 902), (310, 903), (311, 320), (311, 325), (312, 321), (312, 324), (313, 322), (313, 323), (313, 554), (314, 319), (314, 326), (315, 321), (315, 323), (315, 822), (316, 319), (316, 325), (317, 533), (317, 570), (317, 1033), (317, 1055), (318, 533), (318, 717), (318, 901), (318, 1056), (319, 232), (319, 814), (319, 838), (320, 232), (320, 815), (320, 839), (321, 232), (321, 526), (321, 822), (322, 232), (322, 554), (322, 847), (323, 232), (323, 853), (323, 881), (323, 981), (323, 1007), (324, 232), (324, 854), (324, 1008), (324, 1075), (325, 232), (325, 863), (325, 889), (325, 985), (325, 1013), (326, 232), (326, 864), (326, 890), (326, 986), (326, 1014), (327, 541), (327, 721), (327, 722), (327, 783), (327, 907), (328, 338), (328, 344), (329, 340), (329, 342), (330, 571), (330, 616), (330, 905), (331, 338), (331, 343), (331, 817), (332, 340), (332, 341), (332, 555), (333, 339), (333, 341), (333, 823), (334, 337), (334, 343), (334, 816), (336, 541), (336, 571), (336, 720), (336, 1034), (337, 234), (337, 816), (337, 846), (338, 234), (338, 525), (338, 817), (339, 234), (339, 823), (339, 840), (340, 234), (340, 555), (340, 841), (341, 234), (341, 725), (342, 234), (342, 726), (343, 234), (343, 855), (343, 891), (343, 979), (344, 234), (344, 856), (344, 892), (344, 980), (344, 1016), (345, 519), (345, 908), (345, 911), (345, 1089), (346, 358), (346, 364), (347, 360), (347, 362), (348, 519), (348, 572), (348, 787), (348, 910), (349, 358), (349, 363), (350, 359), (350, 362), (351, 360), (351, 361), (351, 555), (352, 357), (352, 364), (353, 359), (353, 361), (353, 823), (354, 357), (354, 363), (355, 727), (355, 785), (355, 788), (355, 1089), (356, 572), (356, 727), (356, 908), (356, 1035), (357, 235), (357, 731), (358, 235), (358, 732), (359, 235), (359, 538), (359, 823), (360, 235), (360, 555), (360, 835), (361, 235), (361, 869), (361, 885), (361, 1009), (362, 235), (362, 870), (362, 1010), (362, 1076), (363, 235), (363, 879), (363, 895), (364, 235), (364, 880), (364, 896), (365, 573), (365, 734), (365, 791), (365, 1028), (366, 376), (366, 382), (367, 378), (367, 380), (369, 378), (369, 379), (369, 554), (370, 375), (370, 382), (371, 377), (371, 379), (371, 822), (372, 375), (372, 381), (372, 816), (372, 871), (373, 573), (373, 618), (373, 733), (373, 913), (373, 1036), (374, 733), (374, 735), (374, 912), (374, 1029), (375, 237), (375, 537), (375, 816), (376, 237), (376, 817), (376, 834), (377, 237), (377, 822), (377, 828), (378, 237), (378, 554), (378, 829), (379, 237), (379, 877), (379, 1001), (379, 1007), (379, 1077), (380, 237), (380, 878), (380, 888), (380, 1008), (381, 237), (381, 871), (381, 893), (382, 237), (382, 872), (382, 894), (382, 994), (382, 1016), (383, 207), (383, 740), (383, 741), (383, 918), (384, 394), (384, 400), (385, 396), (385, 398), (386, 574), (386, 740), (386, 909), (386, 916), (386, 917), (387, 395), (387, 398), (388, 393), (388, 400), (389, 395), (389, 397), (389, 557), (390, 393), (390, 399), (390, 818), (390, 837), (391, 127), (391, 614), (391, 739), (391, 916), (392, 207), (392, 574), (392, 739), (392, 1037), (393, 240), (393, 818), (393, 1074), (394, 240), (394, 598), (394, 819), (394, 866), (395, 240), (395, 557), (395, 875), (396, 240), (396, 825), (396, 876), (397, 240), (397, 830), (397, 881), (398, 240), (398, 831), (398, 1075), (399, 240), (399, 837), (399, 891), (400, 240), (400, 540), (400, 892), (401, 575), (401, 745), (401, 919), (401, 922), (401, 1062), (402, 414), (402, 420), (403, 416), (403, 418), (404, 521), (404, 524), (404, 745), (404, 913), (404, 921), (405, 414), (405, 419), (405, 821), (406, 415), (406, 418), (407, 416), (407, 417), (407, 824), (407, 836), (408, 413), (408, 420), (408, 833), (409, 415), (409, 417), (409, 556), (410, 413), (410, 419), (410, 820), (410, 832), (411, 575), (411, 744), (411, 912), (411, 1038), (411, 1061), (412, 521), (412, 744), (412, 919), (412, 1063), (413, 242), (413, 820), (413, 873), (414, 242), (414, 821), (414, 874), (415, 242), (415, 556), (415, 867), (416, 242), (416, 824), (416, 868), (417, 242), (417, 836), (417, 883), (418, 242), (418, 539), (418, 884), (419, 242), (419, 832), (419, 889), (420, 242), (420, 833), (420, 890), (421, 189), (421, 576), (421, 749), (421, 923), (422, 432), (422, 438), (423, 434), (423, 436), (424, 749), (424, 750), (424, 924), (424, 925), (425, 432), (425, 437), (426, 433), (426, 436), (427, 433), (427, 435), (427, 556), (428, 431), (428, 437), (429, 576), (429, 748), (429, 770), (429, 924), (429, 1039), (430, 748), (430, 750), (430, 802), (430, 923), (431, 243), (431, 600), (431, 818), (431, 850), (432, 243), (432, 819), (432, 851), (433, 243), (433, 556), (433, 859), (434, 243), (434, 754), (435, 243), (435, 842), (435, 885), (436, 243), (436, 843), (436, 1076), (437, 243), (437, 528), (437, 893), (437, 973), (438, 243), (438, 849), (438, 894), (439, 535), (439, 756), (439, 927), (439, 1066), (440, 452), (440, 458), (441, 454), (441, 456), (441, 527), (442, 577), (442, 756), (442, 928), (442, 929), (443, 452), (443, 457), (443, 821), (444, 453), (444, 456), (445, 454), (445, 455), (445, 848), (446, 451), (446, 458), (447, 453), (447, 455), (447, 557), (448, 451), (448, 457), (448, 820), (449, 535), (449, 755), (449, 928), (449, 1065), (449, 1067), (450, 577), (450, 755), (450, 927), (450, 1040), (451, 244), (451, 820), (451, 857), (452, 244), (452, 821), (452, 858), (453, 244), (453, 557), (453, 612), (454, 244), (454, 759), (455, 244), (455, 848), (455, 1077), (456, 244), (456, 527), (456, 888), (457, 244), (457, 844), (457, 895), (457, 965), (458, 244), (458, 845), (458, 896), (458, 966), (459, 564), (459, 641), (459, 647), (459, 653), (460, 470), (460, 476), (461, 472), (461, 474), (462, 127), (462, 638), (462, 699), (463, 472), (463, 473), (464, 469), (464, 476), (465, 471), (465, 473), (466, 469), (466, 475), (467, 562), (467, 655), (467, 686), (468, 689), (468, 695), (468, 702), (468, 708), (469, 760), (469, 1090), (470, 601), (470, 761), (470, 1090), (471, 836), (471, 861), (471, 1090), (472, 539), (472, 862), (472, 1090), (473, 762), (473, 1090), (474, 763), (474, 1090), (475, 848), (475, 877), (475, 1090), (476, 527), (476, 878), (476, 1090), (477, 127), (477, 1090), (478, 546), (478, 640), (478, 646), (478, 665), (479, 491), (479, 497), (480, 493), (480, 495), (481, 567), (481, 637), (481, 1095), (482, 491), (482, 496), (483, 492), (483, 495), (484, 493), (484, 494), (485, 490), (485, 497), (486, 492), (486, 494), (486, 837), (487, 490), (487, 496), (488, 545), (488, 548), (488, 660), (488, 685), (489, 569), (489, 668), (489, 688), (489, 694), (490, 498), (490, 764), (491, 498), (491, 765), (492, 498), (492, 837), (492, 855), (493, 498), (493, 540), (493, 856), (494, 498), (494, 528), (494, 871), (495, 127), (495, 498), (495, 849), (495, 872), (496, 498), (496, 766), (497, 498), (497, 767), (498, 127), (498, 517), (498, 518), (499, 545), (499, 562), (499, 657), (499, 664), (500, 509), (500, 515), (501, 511), (501, 513), (502, 511), (502, 512), (503, 508), (503, 515), (504, 510), (504, 512), (505, 508), (505, 514), (506, 546), (506, 651), (506, 664), (506, 698), (507, 567), (507, 672), (507, 701), (507, 707), (508, 516), (508, 768), (508, 769), (509, 516), (509, 770), (509, 771), (510, 516), (510, 772), (511, 516), (511, 773), (512, 516), (512, 524), (512, 790), (513, 127), (513, 516), (513, 791), (513, 914), (513, 919), (514, 516), (514, 776), (514, 777), (515, 516), (515, 536), (515, 778), (516, 127), (516, 246), (516, 477), (516, 517), (516, 518), (517, 127), (517, 243), (518, 127), (518, 240), (519, 235), (519, 520), (519, 1028), (520, 529), (520, 595), (520, 914), (521, 242), (521, 913), (521, 1029), (524, 529), (524, 920), (525, 530), (525, 531), (525, 974), (526, 531), (526, 532), (526, 975), (527, 127), (527, 532), (527, 976), (528, 530), (528, 973), (529, 127), (529, 173), (529, 520), (529, 531), (530, 228), (530, 531), (531, 127), (531, 529), (532, 148), (532, 531), (533, 232), (533, 534), (533, 1057), (534, 117), (534, 541), (534, 905), (535, 244), (535, 536), (535, 1058), (536, 541), (536, 906), (537, 542), (537, 959), (538, 544), (538, 961), (539, 127), (539, 544), (539, 962), (540, 127), (540, 542), (540, 960), (541, 127), (541, 144), (541, 534), (541, 543), (542, 222), (542, 543), (543, 127), (543, 541), (544, 177), (544, 543), (545, 549), (545, 651), (545, 665), (546, 548), (546, 635), (546, 666), (548, 549), (548, 660), (549, 115), (549, 127), (549, 136), (549, 559), (550, 549), (550, 678), (551, 553), (551, 648), (551, 683), (553, 549), (553, 682), (554, 127), (554, 130), (554, 558), (554, 946), (555, 127), (555, 560), (555, 948), (556, 127), (556, 559), (556, 560), (556, 947), (557, 127), (557, 558), (557, 945), (558, 130), (558, 559), (559, 127), (559, 549), (560, 150), (560, 559), (561, 565), (561, 657), (561, 660), (562, 564), (562, 649), (562, 658), (564, 565), (564, 633), (565, 127), (565, 170), (565, 591), (566, 565), (566, 669), (567, 634), (567, 1032), (569, 565), (569, 673), (570, 232), (570, 771), (570, 1039), (571, 234), (571, 777), (571, 1040), (572, 235), (572, 916), (572, 1037), (573, 237), (573, 919), (573, 1038), (574, 240), (574, 909), (574, 1035), (575, 242), (575, 912), (575, 1036), (576, 243), (576, 770), (576, 1033), (577, 244), (577, 776), (577, 1034), (591, 127), (591, 1031), (593, 549), (593, 619), (593, 620), (593, 621), (593, 676), (593, 712), (593, 713), (593, 714), (593, 754), (593, 759), (594, 117), (594, 602), (594, 616), (594, 723), (594, 724), (594, 725), (594, 726), (594, 760), (594, 761), (594, 764), (594, 765), (594, 883), (594, 904), (595, 127), (595, 520), (595, 602), (595, 603), (595, 637), (595, 729), (595, 736), (595, 737), (595, 766), (595, 767), (597, 120), (597, 603), (597, 614), (597, 652), (597, 697), (597, 698), (597, 699), (597, 731), (597, 732), (597, 772), (597, 1031), (598, 391), (598, 394), (598, 396), (598, 397), (598, 399), (599, 252), (599, 260), (599, 261), (599, 264), (599, 265), (600, 424), (600, 431), (600, 434), (600, 435), (600, 438), (601, 462), (601, 470), (601, 471), (601, 474), (601, 475), (602, 636), (602, 638), (602, 640), (602, 641), (602, 684), (602, 685), (602, 686), (602, 687), (602, 688), (602, 689), (603, 127), (603, 762), (603, 763), (612, 127), (612, 981), (612, 984), (614, 741), (614, 795), (616, 721), (616, 906), (618, 733), (618, 913), (619, 622), (619, 625), (620, 624), (620, 626), (621, 623), (621, 627), (622, 626), (622, 634), (623, 208), (623, 625), (624, 627), (624, 632), (625, 630), (625, 633), (626, 629), (626, 635), (627, 628), (627, 631), (628, 208), (628, 635), (629, 632), (629, 633), (630, 631), (630, 634), (631, 127), (631, 128), (631, 152), (632, 127), (632, 193), (632, 211), (633, 127), (633, 192), (633, 212), (634, 127), (634, 130), (634, 150), (635, 127), (635, 194), (635, 210), (636, 631), (636, 639), (636, 647), (637, 641), (637, 643), (638, 640), (638, 645), (638, 651), (639, 643), (639, 650), (640, 647), (640, 648), (640, 649), (641, 175), (641, 631), (641, 645), (643, 646), (643, 651), (645, 648), (645, 651), (646, 175), (646, 649), (647, 631), (647, 650), (648, 127), (648, 202), (648, 213), (649, 127), (649, 141), (649, 176), (650, 127), (650, 199), (650, 219), (651, 127), (651, 140), (651, 174), (652, 649), (652, 653), (652, 657), (652, 773), (653, 655), (653, 659), (655, 633), (655, 656), (656, 658), (656, 660), (657, 649), (657, 659), (658, 127), (658, 138), (658, 185), (659, 127), (659, 164), (659, 226), (660, 127), (660, 160), (660, 231), (661, 660), (661, 664), (661, 667), (664, 651), (664, 666), (665, 635), (665, 667), (666, 127), (666, 166), (666, 224), (667, 127), (667, 161), (667, 230), (668, 650), (668, 1095), (669, 672), (669, 675), (671, 634), (671, 675), (672, 650), (672, 674), (673, 127), (673, 200), (673, 214), (674, 127), (674, 142), (674, 167), (675, 127), (675, 146), (675, 169), (676, 677), (676, 678), (676, 715), (677, 658), (677, 679), (678, 673), (678, 681), (679, 680), (679, 682), (680, 648), (680, 673), (681, 658), (681, 683), (682, 127), (682, 134), (682, 180), (683, 127), (683, 137), (683, 184), (684, 682), (684, 687), (684, 695), (685, 689), (685, 694), (685, 696), (686, 674), (686, 688), (686, 693), (687, 666), (687, 674), (687, 694), (688, 208), (688, 695), (688, 696), (689, 659), (689, 682), (689, 693), (693, 208), (693, 674), (694, 659), (694, 696), (695, 666), (695, 682), (696, 127), (696, 165), (696, 225), (697, 700), (697, 703), (698, 702), (698, 704), (699, 701), (699, 705), (700, 667), (700, 704), (701, 632), (701, 703), (702, 175), (702, 705), (703, 696), (703, 708), (704, 675), (704, 707), (705, 683), (705, 706), (706, 632), (706, 675), (707, 175), (707, 696), (708, 667), (708, 683), (712, 859), (712, 867), (712, 1094), (713, 860), (713, 868), (714, 612), (714, 875), (714, 1094), (715, 852), (715, 876), (716, 232), (716, 719), (716, 783), (716, 807), (717, 232), (717, 769), (717, 802), (719, 906), (719, 907), (720, 234), (720, 723), (720, 1055), (721, 233), (721, 724), (721, 807), (722, 127), (722, 778), (722, 1067), (723, 901), (723, 902), (724, 903), (724, 904), (725, 861), (725, 883), (726, 862), (726, 884), (727, 235), (727, 729), (729, 730), (729, 808), (730, 127), (730, 912), (730, 913), (731, 814), (731, 826), (732, 815), (732, 827), (733, 238), (733, 736), (733, 785), (734, 237), (734, 738), (734, 911), (734, 1069), (735, 237), (735, 920), (735, 1063), (736, 908), (736, 909), (737, 520), (737, 529), (737, 738), (738, 910), (738, 911), (739, 127), (739, 240), (739, 742), (739, 1061), (740, 240), (740, 743), (740, 1062), (740, 1071), (741, 241), (741, 774), (741, 788), (742, 919), (742, 920), (743, 245), (743, 921), (743, 922), (744, 242), (744, 746), (744, 1070), (745, 242), (745, 747), (745, 917), (745, 918), (745, 1071), (746, 207), (746, 916), (747, 245), (747, 917), (747, 918), (748, 243), (748, 751), (748, 1065), (749, 243), (749, 752), (749, 1066), (750, 243), (750, 768), (750, 1056), (751, 927), (751, 928), (752, 929), (752, 930), (754, 824), (754, 860), (755, 244), (755, 757), (755, 1072), (756, 189), (756, 244), (756, 758), (756, 1073), (757, 923), (757, 924), (758, 189), (758, 925), (759, 825), (759, 852), (760, 830), (760, 853), (761, 831), (761, 854), (762, 842), (762, 869), (763, 843), (763, 870), (764, 832), (764, 863), (765, 833), (765, 864), (766, 844), (766, 879), (767, 845), (767, 880), (768, 902), (768, 904), (769, 189), (769, 924), (770, 901), (770, 903), (771, 923), (771, 925), (772, 127), (772, 787), (772, 911), (772, 916), (773, 774), (773, 775), (774, 908), (774, 910), (775, 207), (775, 917), (776, 905), (776, 907), (777, 928), (777, 930), (778, 927), (778, 929), (783, 807), (783, 907), (785, 808), (785, 909), (787, 909), (787, 918), (788, 898), (788, 910), (790, 913), (790, 922), (791, 912), (791, 921), (795, 898), (795, 917), (802, 189), (802, 1078), (807, 127), (807, 213), (807, 932), (808, 127), (808, 202), (808, 933), (814, 127), (814, 211), (814, 937), (814, 941), (815, 127), (815, 193), (815, 938), (815, 942), (816, 127), (816, 193), (816, 939), (816, 943), (817, 127), (817, 940), (817, 944), (818, 127), (818, 185), (818, 939), (818, 944), (819, 127), (819, 940), (819, 943), (820, 127), (820, 937), (820, 942), (821, 127), (821, 938), (821, 941), (822, 127), (822, 945), (822, 949), (823, 127), (823, 130), (823, 947), (823, 950), (824, 127), (824, 948), (824, 950), (825, 127), (825, 946), (825, 949), (826, 179), (826, 951), (826, 955), (827, 220), (827, 952), (827, 956), (828, 220), (828, 953), (828, 957), (829, 954), (829, 958), (830, 127), (830, 223), (830, 953), (830, 958), (831, 127), (831, 954), (831, 957), (832, 127), (832, 951), (832, 956), (833, 127), (833, 952), (833, 955), (834, 960), (834, 963), (835, 962), (835, 964), (836, 127), (836, 961), (836, 964), (837, 127), (837, 959), (837, 963), (838, 157), (838, 965), (838, 969), (839, 171), (839, 966), (839, 970), (840, 171), (840, 967), (840, 971), (841, 968), (841, 972), (842, 127), (842, 168), (842, 967), (842, 972), (843, 127), (843, 968), (843, 971), (844, 965), (844, 970), (845, 966), (845, 969), (846, 173), (846, 973), (846, 977), (847, 976), (847, 978), (848, 127), (848, 228), (848, 975), (848, 978), (849, 127), (849, 974), (849, 977), (850, 979), (850, 983), (851, 203), (851, 980), (852, 127), (852, 197), (852, 982), (853, 197), (853, 981), (854, 127), (854, 982), (854, 984), (855, 203), (855, 979), (856, 980), (856, 983), (857, 205), (857, 985), (857, 989), (858, 195), (858, 986), (858, 990), (859, 127), (859, 195), (859, 987), (859, 991), (860, 127), (860, 988), (860, 992), (861, 127), (861, 182), (861, 987), (861, 992), (862, 127), (862, 988), (862, 991), (863, 985), (863, 990), (864, 986), (864, 989), (866, 994), (866, 997), (867, 127), (867, 995), (867, 998), (868, 127), (868, 135), (868, 996), (869, 127), (869, 135), (869, 995), (870, 127), (870, 996), (870, 998), (871, 127), (871, 993), (871, 997), (872, 151), (872, 994), (873, 191), (873, 999), (873, 1003), (874, 132), (874, 1000), (874, 1004), (875, 127), (875, 132), (875, 1001), (875, 1005), (876, 127), (876, 1002), (876, 1006), (877, 216), (877, 1001), (877, 1006), (878, 127), (878, 1002), (878, 1005), (879, 127), (879, 999), (879, 1004), (880, 127), (880, 1000), (880, 1003), (881, 1007), (881, 1011), (883, 127), (883, 226), (883, 1009), (884, 127), (884, 1010), (884, 1012), (885, 1009), (885, 1012), (888, 1008), (888, 1011), (889, 219), (889, 1013), (889, 1017), (890, 199), (890, 1014), (890, 1018), (891, 127), (891, 174), (891, 199), (891, 1015), (891, 1019), (892, 1016), (892, 1020), (893, 127), (893, 166), (893, 1015), (893, 1020), (894, 1016), (894, 1019), (895, 127), (895, 1013), (895, 1018), (896, 127), (896, 1014), (896, 1017), (898, 127), (898, 1024), (898, 1026), (901, 127), (901, 198), (901, 223), (901, 246), (902, 127), (902, 143), (902, 162), (903, 127), (903, 139), (903, 156), (903, 246), (904, 127), (904, 179), (904, 220), (905, 127), (905, 145), (905, 163), (906, 127), (906, 178), (906, 221), (907, 127), (907, 177), (907, 222), (908, 127), (908, 159), (908, 168), (909, 127), (909, 149), (909, 227), (910, 127), (910, 206), (910, 218), (911, 127), (911, 157), (911, 171), (911, 245), (912, 127), (912, 148), (912, 228), (913, 127), (913, 147), (913, 229), (914, 127), (914, 158), (914, 172), (914, 245), (916, 127), (916, 153), (916, 181), (916, 245), (917, 127), (917, 129), (917, 133), (917, 245), (918, 197), (918, 203), (918, 245), (919, 127), (919, 154), (919, 182), (919, 245), (920, 127), (920, 155), (920, 183), (920, 245), (921, 127), (921, 196), (921, 204), (921, 245), (922, 127), (922, 195), (922, 205), (922, 245), (923, 127), (923, 135), (923, 151), (924, 127), (924, 188), (924, 215), (925, 127), (925, 201), (925, 209), (925, 246), (927, 127), (927, 187), (927, 216), (928, 127), (928, 186), (928, 217), (929, 127), (929, 131), (929, 190), (930, 127), (930, 132), (930, 191), (932, 128), (932, 180), (933, 152), (933, 180), (937, 137), (937, 212), (938, 184), (938, 192), (939, 184), (939, 212), (940, 137), (940, 192), (941, 138), (941, 211), (942, 185), (942, 193), (943, 138), (943, 193), (944, 185), (944, 211), (945, 200), (945, 210), (946, 194), (946, 214), (947, 210), (947, 214), (948, 194), (948, 200), (949, 136), (949, 150), (950, 130), (950, 136), (951, 127), (951, 156), (951, 162), (952, 127), (952, 139), (952, 143), (953, 127), (953, 143), (953, 156), (954, 127), (954, 139), (954, 162), (955, 179), (955, 198), (956, 220), (956, 223), (957, 198), (957, 220), (958, 179), (958, 223), (959, 127), (959, 145), (959, 178), (960, 127), (960, 163), (960, 221), (961, 127), (961, 163), (961, 178), (962, 127), (962, 145), (962, 221), (963, 144), (963, 177), (964, 144), (964, 222), (965, 127), (965, 149), (965, 206), (966, 127), (966, 218), (966, 227), (967, 127), (967, 206), (967, 227), (968, 127), (968, 149), (968, 218), (969, 157), (969, 159), (970, 168), (970, 171), (971, 159), (971, 171), (972, 157), (972, 168), (973, 127), (973, 158), (973, 229), (974, 127), (974, 147), (974, 172), (975, 127), (975, 147), (975, 158), (976, 127), (976, 172), (976, 229), (977, 148), (977, 173), (978, 173), (978, 228), (979, 127), (979, 129), (979, 153), (980, 127), (980, 133), (980, 181), (981, 127), (981, 129), (981, 181), (982, 133), (982, 153), (983, 197), (983, 207), (984, 203), (984, 207), (985, 127), (985, 183), (985, 196), (986, 127), (986, 155), (986, 204), (987, 155), (987, 196), (988, 183), (988, 204), (989, 154), (989, 205), (990, 182), (990, 195), (991, 154), (991, 195), (992, 182), (992, 205), (993, 127), (993, 188), (993, 209), (994, 127), (994, 201), (994, 215), (995, 209), (995, 215), (996, 188), (996, 201), (997, 135), (997, 189), (998, 151), (998, 189), (999, 127), (999, 131), (999, 217), (1000, 127), (1000, 186), (1000, 190), (1001, 127), (1001, 131), (1001, 186), (1002, 190), (1002, 217), (1003, 187), (1003, 191), (1004, 132), (1004, 216), (1005, 132), (1005, 187), (1006, 191), (1006, 216), (1007, 127), (1007, 176), (1007, 225), (1008, 127), (1008, 141), (1008, 165), (1009, 127), (1009, 165), (1009, 176), (1010, 127), (1010, 141), (1010, 225), (1011, 127), (1011, 175), (1011, 226), (1012, 164), (1012, 175), (1013, 127), (1013, 167), (1013, 174), (1014, 127), (1014, 140), (1014, 142), (1015, 142), (1015, 174), (1016, 127), (1016, 140), (1016, 167), (1017, 219), (1017, 224), (1018, 166), (1018, 199), (1019, 199), (1019, 224), (1020, 166), (1020, 219), (1024, 160), (1024, 169), (1026, 161), (1026, 170), (1027, 525), (1027, 526), (1027, 527), (1027, 528), (1027, 846), (1027, 847), (1027, 848), (1027, 849), (1028, 529), (1028, 1069), (1029, 529), (1029, 1079), (1031, 591), (1031, 597), (1031, 898), (1031, 1041), (1031, 1042), (1031, 1043), (1031, 1044), (1031, 1078), (1031, 1079), (1031, 1080), (1032, 569), (1032, 674), (1033, 903), (1033, 1041), (1034, 907), (1034, 1044), (1035, 911), (1035, 1042), (1036, 914), (1036, 1043), (1037, 918), (1037, 1042), (1038, 921), (1038, 1043), (1039, 925), (1039, 1041), (1040, 930), (1040, 1044), (1041, 246), (1041, 591), (1041, 1045), (1041, 1086), (1042, 127), (1042, 591), (1042, 1046), (1042, 1087), (1043, 127), (1043, 1024), (1043, 1046), (1044, 127), (1044, 1045), (1044, 1085), (1045, 161), (1045, 591), (1046, 230), (1046, 591), (1048, 873), (1048, 874), (1048, 875), (1048, 876), (1048, 877), (1048, 878), (1048, 879), (1048, 880), (1049, 881), (1049, 883), (1049, 884), (1049, 885), (1049, 888), (1049, 1011), (1049, 1075), (1049, 1076), (1049, 1077), (1050, 889), (1050, 890), (1050, 891), (1050, 892), (1050, 893), (1050, 894), (1050, 895), (1050, 896), (1051, 866), (1051, 867), (1051, 868), (1051, 869), (1051, 870), (1051, 871), (1051, 872), (1051, 1074), (1052, 857), (1052, 858), (1052, 859), (1052, 860), (1052, 861), (1052, 862), (1052, 863), (1052, 864), (1053, 807), (1053, 808), (1053, 1068), (1053, 1069), (1053, 1070), (1053, 1071), (1053, 1072), (1053, 1073), (1053, 1083), (1055, 902), (1055, 1068), (1056, 904), (1056, 1078), (1057, 905), (1057, 1068), (1058, 906), (1058, 1080), (1061, 920), (1061, 1070), (1062, 922), (1062, 1071), (1063, 922), (1063, 1079), (1065, 928), (1065, 1072), (1066, 930), (1066, 1073), (1067, 929), (1067, 1080), (1068, 127), (1068, 1081), (1068, 1083), (1069, 127), (1069, 1082), (1069, 1084), (1070, 127), (1070, 933), (1070, 1084), (1071, 202), (1071, 245), (1071, 1082), (1072, 127), (1072, 213), (1072, 1081), (1073, 127), (1073, 932), (1073, 1083), (1074, 151), (1074, 993), (1075, 164), (1075, 1008), (1076, 226), (1076, 1010), (1077, 164), (1077, 1007), (1078, 127), (1078, 1085), (1078, 1088), (1079, 127), (1079, 1026), (1079, 1087), (1080, 127), (1080, 1086), (1080, 1088), (1081, 134), (1081, 152), (1082, 128), (1082, 134), (1083, 127), (1083, 202), (1083, 208), (1084, 208), (1084, 213), (1085, 169), (1085, 231), (1086, 146), (1086, 160), (1087, 146), (1087, 231), (1088, 170), (1088, 230), (1089, 127), (1089, 207), (1089, 235), (1089, 775), (1089, 795), (1090, 127), (1090, 470), (1090, 477), (1091, 127), (1091, 245), (1091, 260), (1091, 267), (1094, 127), (1095, 671), (1095, 673)] + +/-- same for #7623's word (data/base-7623-word.json.gz) -/ +def usedB : List (Nat × Nat) := [(0, 249), (0, 250), (0, 251), (1, 383), (1, 389), (1, 390), (2, 292), (2, 293), (2, 299), (2, 304), (3, 0), (3, 1), (3, 2), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8), (3, 9), (3, 10), (3, 11), (3, 12), (3, 13), (3, 14), (3, 15), (3, 16), (3, 17), (3, 18), (3, 19), (3, 20), (3, 21), (3, 22), (3, 23), (3, 24), (3, 25), (3, 26), (3, 27), (3, 28), (3, 29), (3, 30), (3, 31), (3, 32), (3, 33), (3, 34), (3, 35), (3, 36), (3, 37), (3, 38), (3, 39), (3, 40), (3, 41), (3, 42), (3, 43), (3, 44), (3, 45), (3, 46), (3, 47), (3, 48), (3, 49), (3, 50), (3, 51), (3, 52), (3, 53), (3, 54), (3, 55), (3, 56), (3, 57), (3, 58), (3, 59), (3, 60), (3, 61), (3, 62), (3, 63), (3, 64), (3, 65), (3, 66), (3, 67), (3, 68), (3, 69), (3, 70), (3, 71), (3, 72), (3, 73), (3, 74), (3, 75), (3, 76), (3, 77), (3, 78), (3, 79), (3, 80), (3, 81), (3, 82), (3, 83), (3, 84), (3, 85), (3, 86), (3, 87), (3, 88), (3, 89), (3, 90), (3, 91), (3, 92), (3, 93), (3, 94), (3, 95), (3, 96), (3, 97), (3, 98), (3, 99), (3, 100), (3, 101), (3, 102), (3, 103), (3, 104), (3, 105), (3, 114), (3, 115), (3, 116), (3, 117), (3, 118), (3, 120), (3, 151), (3, 189), (3, 245), (3, 249), (3, 252), (3, 257), (3, 258), (3, 259), (3, 260), (3, 261), (3, 263), (3, 264), (3, 265), (3, 268), (3, 278), (3, 279), (3, 280), (3, 281), (3, 282), (3, 283), (3, 284), (3, 285), (3, 286), (3, 287), (3, 289), (3, 292), (3, 297), (3, 298), (3, 299), (3, 300), (3, 301), (3, 307), (3, 310), (3, 313), (3, 315), (3, 317), (3, 318), (3, 319), (3, 320), (3, 323), (3, 324), (3, 325), (3, 326), (3, 327), (3, 330), (3, 331), (3, 332), (3, 333), (3, 334), (3, 336), (3, 343), (3, 344), (3, 345), (3, 348), (3, 351), (3, 353), (3, 355), (3, 356), (3, 361), (3, 362), (3, 363), (3, 364), (3, 365), (3, 369), (3, 371), (3, 372), (3, 373), (3, 374), (3, 379), (3, 380), (3, 382), (3, 383), (3, 386), (3, 389), (3, 390), (3, 391), (3, 392), (3, 394), (3, 396), (3, 397), (3, 398), (3, 400), (3, 401), (3, 404), (3, 405), (3, 407), (3, 408), (3, 409), (3, 410), (3, 411), (3, 412), (3, 418), (3, 421), (3, 424), (3, 427), (3, 429), (3, 430), (3, 431), (3, 432), (3, 435), (3, 436), (3, 437), (3, 439), (3, 441), (3, 442), (3, 443), (3, 445), (3, 447), (3, 448), (3, 449), (3, 450), (3, 457), (3, 458), (3, 459), (3, 462), (3, 467), (3, 468), (3, 470), (3, 471), (3, 472), (3, 475), (3, 476), (3, 478), (3, 481), (3, 486), (3, 488), (3, 489), (3, 493), (3, 494), (3, 495), (3, 499), (3, 506), (3, 507), (3, 508), (3, 509), (3, 512), (3, 513), (3, 514), (3, 515), (3, 519), (3, 533), (3, 535), (3, 545), (3, 546), (3, 549), (3, 551), (3, 561), (3, 562), (3, 570), (3, 571), (3, 572), (3, 573), (3, 577), (3, 593), (3, 594), (3, 595), (3, 597), (3, 598), (3, 599), (3, 600), (3, 601), (3, 602), (3, 603), (3, 652), (3, 661), (3, 676), (3, 712), (3, 714), (3, 716), (3, 717), (3, 720), (3, 721), (3, 722), (3, 724), (3, 733), (3, 734), (3, 735), (3, 739), (3, 740), (3, 741), (3, 744), (3, 745), (3, 746), (3, 747), (3, 748), (3, 749), (3, 750), (3, 755), (3, 757), (3, 772), (3, 817), (3, 1027), (3, 1031), (3, 1048), (3, 1049), (3, 1050), (3, 1051), (3, 1052), (3, 1053), (3, 1083), (3, 1089), (3, 1091), (4, 439), (4, 447), (4, 448), (5, 442), (5, 443), (5, 444), (6, 383), (6, 384), (6, 385), (7, 251), (7, 256), (7, 258), (8, 425), (8, 429), (8, 434), (8, 435), (9, 293), (9, 294), (9, 306), (9, 635), (9, 661), (9, 665), (9, 676), (10, 270), (10, 277), (10, 279), (11, 273), (11, 275), (11, 278), (12, 307), (12, 308), (12, 309), (13, 478), (13, 479), (13, 480), (14, 459), (14, 460), (14, 461), (15, 479), (15, 486), (15, 489), (16, 308), (16, 315), (16, 318), (17, 331), (17, 332), (17, 720), (17, 722), (17, 1057), (17, 1058), (18, 329), (18, 334), (18, 336), (19, 500), (19, 504), (19, 507), (20, 366), (20, 371), (20, 374), (21, 370), (21, 373), (21, 377), (21, 380), (22, 347), (22, 354), (22, 356), (23, 292), (23, 294), (23, 301), (23, 302), (24, 426), (24, 429), (24, 431), (24, 438), (24, 849), (25, 249), (25, 255), (25, 256), (26, 385), (26, 390), (26, 392), (27, 406), (27, 408), (27, 411), (28, 402), (28, 409), (28, 412), (29, 307), (29, 315), (29, 316), (30, 348), (30, 351), (30, 352), (31, 365), (31, 371), (31, 372), (32, 350), (32, 352), (32, 355), (33, 499), (33, 500), (33, 501), (34, 502), (34, 506), (34, 509), (34, 514), (35, 309), (35, 316), (35, 318), (36, 328), (36, 333), (36, 336), (37, 463), (37, 467), (37, 470), (37, 475), (38, 460), (38, 465), (38, 468), (39, 482), (39, 484), (39, 488), (40, 480), (40, 487), (40, 489), (41, 349), (41, 351), (41, 355), (42, 501), (42, 505), (42, 507), (43, 502), (43, 503), (43, 652), (43, 668), (43, 669), (44, 348), (44, 349), (44, 350), (45, 365), (45, 366), (45, 367), (46, 369), (46, 370), (46, 734), (46, 735), (46, 790), (46, 914), (47, 478), (47, 486), (47, 487), (47, 490), (48, 462), (48, 463), (48, 464), (48, 469), (48, 472), (49, 459), (49, 465), (49, 466), (50, 330), (50, 331), (50, 339), (50, 342), (51, 327), (51, 333), (51, 334), (52, 310), (52, 313), (52, 314), (53, 250), (53, 255), (53, 258), (54, 384), (54, 389), (54, 392), (55, 405), (55, 407), (55, 411), (56, 403), (56, 410), (56, 412), (57, 269), (57, 276), (57, 279), (58, 272), (58, 274), (58, 278), (59, 440), (59, 447), (59, 450), (60, 444), (60, 446), (60, 449), (61, 423), (61, 428), (61, 430), (62, 424), (62, 425), (62, 426), (63, 439), (63, 440), (63, 441), (64, 442), (64, 445), (64, 446), (65, 268), (65, 269), (65, 270), (66, 271), (66, 272), (66, 273), (67, 289), (67, 290), (67, 291), (68, 404), (68, 405), (68, 406), (69, 401), (69, 409), (69, 410), (70, 386), (70, 388), (70, 396), (70, 397), (71, 312), (71, 314), (71, 317), (72, 481), (72, 482), (72, 483), (73, 291), (73, 296), (73, 297), (74, 421), (74, 422), (74, 423), (75, 254), (75, 257), (75, 261), (75, 264), (76, 386), (76, 387), (76, 394), (76, 399), (77, 401), (77, 402), (77, 403), (78, 404), (78, 407), (78, 408), (79, 345), (79, 353), (79, 354), (80, 387), (80, 388), (80, 391), (81, 252), (81, 253), (81, 254), (82, 421), (82, 427), (82, 428), (83, 289), (83, 295), (83, 296), (84, 271), (84, 274), (84, 275), (85, 268), (85, 276), (85, 277), (86, 253), (86, 257), (86, 260), (86, 265), (87, 290), (87, 295), (87, 297), (88, 422), (88, 427), (88, 430), (89, 443), (89, 445), (89, 449), (90, 441), (90, 448), (90, 450), (91, 345), (91, 346), (91, 347), (92, 481), (92, 484), (92, 485), (92, 490), (92, 493), (93, 310), (93, 311), (93, 312), (94, 327), (94, 328), (94, 329), (95, 330), (95, 332), (95, 337), (95, 344), (96, 311), (96, 313), (96, 317), (97, 483), (97, 485), (97, 488), (98, 461), (98, 466), (98, 468), (99, 464), (99, 467), (99, 471), (99, 474), (100, 346), (100, 353), (100, 356), (101, 369), (101, 373), (101, 376), (101, 381), (102, 367), (102, 372), (102, 374), (103, 503), (103, 506), (103, 510), (103, 513), (104, 499), (104, 504), (104, 505), (105, 266), (105, 421), (105, 424), (105, 430), (105, 756), (105, 1051), (114, 814), (114, 815), (114, 816), (114, 817), (114, 818), (114, 819), (114, 820), (114, 821), (115, 554), (115, 555), (115, 556), (115, 557), (115, 593), (115, 822), (115, 823), (115, 824), (115, 825), (116, 826), (116, 827), (116, 828), (116, 829), (116, 830), (116, 831), (116, 832), (116, 833), (117, 127), (117, 222), (117, 534), (117, 537), (117, 538), (117, 539), (117, 540), (117, 594), (117, 834), (117, 835), (117, 836), (117, 837), (118, 838), (118, 839), (118, 840), (118, 841), (118, 842), (118, 843), (118, 844), (118, 845), (120, 207), (120, 612), (120, 850), (120, 851), (120, 852), (120, 853), (120, 854), (120, 855), (120, 856), (128, 127), (129, 127), (130, 127), (131, 127), (132, 127), (133, 127), (134, 127), (135, 127), (136, 127), (137, 127), (138, 127), (139, 127), (140, 127), (141, 127), (142, 127), (143, 127), (144, 127), (145, 127), (146, 127), (147, 127), (148, 127), (149, 127), (150, 127), (151, 127), (152, 127), (153, 127), (154, 127), (155, 127), (156, 127), (157, 127), (158, 127), (159, 127), (160, 127), (161, 127), (162, 127), (163, 127), (164, 127), (165, 127), (166, 127), (167, 127), (168, 127), (169, 127), (170, 127), (171, 127), (172, 127), (173, 127), (174, 127), (175, 127), (176, 127), (177, 127), (178, 127), (179, 127), (180, 127), (181, 127), (182, 127), (183, 127), (184, 127), (185, 127), (186, 127), (187, 127), (188, 127), (189, 127), (190, 127), (191, 127), (192, 127), (193, 127), (194, 127), (195, 127), (196, 127), (197, 127), (198, 127), (199, 127), (200, 127), (201, 127), (202, 127), (203, 127), (204, 127), (205, 127), (206, 127), (207, 127), (208, 127), (209, 127), (210, 127), (211, 127), (212, 127), (213, 127), (214, 127), (215, 127), (216, 127), (217, 127), (218, 127), (219, 127), (220, 127), (221, 127), (222, 127), (223, 127), (224, 127), (225, 127), (226, 127), (227, 127), (228, 127), (229, 127), (230, 127), (231, 127), (232, 127), (232, 267), (232, 517), (233, 127), (234, 127), (234, 233), (234, 267), (234, 477), (234, 518), (235, 127), (235, 267), (235, 518), (237, 127), (237, 238), (237, 267), (237, 477), (237, 517), (238, 127), (240, 127), (240, 241), (240, 394), (240, 518), (241, 127), (242, 127), (242, 245), (242, 477), (242, 517), (243, 127), (243, 431), (243, 517), (244, 127), (244, 477), (244, 518), (245, 127), (246, 127), (249, 622), (249, 628), (249, 639), (249, 645), (250, 260), (250, 266), (251, 262), (251, 264), (252, 127), (252, 619), (252, 684), (253, 262), (253, 263), (254, 259), (254, 266), (255, 261), (255, 263), (256, 259), (256, 265), (257, 550), (257, 553), (257, 636), (257, 682), (258, 550), (258, 680), (258, 687), (258, 693), (259, 127), (259, 534), (259, 723), (259, 1091), (260, 127), (260, 599), (260, 719), (260, 724), (260, 906), (260, 1091), (261, 730), (261, 736), (261, 1091), (262, 737), (262, 1091), (263, 742), (263, 746), (263, 1091), (264, 743), (264, 747), (264, 1091), (265, 751), (265, 757), (265, 1091), (266, 752), (266, 758), (266, 1091), (267, 127), (267, 1091), (268, 561), (268, 624), (268, 630), (268, 656), (269, 281), (269, 287), (270, 283), (270, 285), (271, 621), (271, 697), (272, 281), (272, 286), (273, 282), (273, 285), (274, 283), (274, 284), (275, 280), (275, 287), (276, 282), (276, 284), (277, 280), (277, 286), (278, 551), (278, 561), (278, 564), (278, 633), (278, 679), (279, 553), (279, 677), (279, 700), (279, 706), (280, 288), (280, 826), (280, 838), (280, 951), (280, 965), (281, 288), (281, 827), (281, 839), (281, 952), (281, 966), (282, 288), (282, 537), (282, 846), (282, 959), (282, 973), (283, 288), (283, 525), (283, 834), (283, 960), (283, 974), (284, 288), (284, 850), (284, 979), (284, 993), (284, 1074), (285, 288), (285, 851), (285, 866), (285, 980), (285, 994), (286, 288), (286, 857), (286, 873), (286, 985), (286, 999), (287, 288), (287, 858), (287, 874), (287, 986), (287, 1000), (288, 127), (288, 267), (288, 477), (289, 548), (289, 623), (289, 629), (289, 661), (290, 299), (290, 305), (291, 301), (291, 303), (292, 566), (292, 620), (292, 1032), (293, 300), (293, 303), (294, 298), (294, 305), (295, 300), (295, 302), (296, 298), (296, 304), (297, 551), (297, 566), (297, 671), (297, 681), (298, 306), (298, 526), (298, 828), (298, 953), (298, 975), (299, 306), (299, 829), (299, 847), (299, 954), (299, 976), (300, 306), (300, 538), (300, 840), (300, 961), (300, 967), (301, 306), (301, 835), (301, 841), (301, 962), (301, 968), (302, 306), (302, 712), (303, 306), (303, 713), (304, 306), (304, 714), (305, 306), (305, 715), (306, 127), (306, 267), (306, 517), (306, 518), (307, 570), (307, 716), (307, 901), (307, 904), (308, 320), (308, 326), (309, 322), (309, 324), (310, 716), (310, 717), (310, 902), (310, 903), (311, 320), (311, 325), (312, 321), (312, 324), (313, 322), (313, 323), (313, 554), (314, 319), (314, 326), (315, 321), (315, 323), (315, 822), (316, 319), (316, 325), (317, 533), (317, 570), (317, 1033), (317, 1055), (318, 533), (318, 717), (318, 901), (318, 1056), (319, 232), (319, 814), (319, 838), (320, 232), (320, 815), (320, 839), (321, 232), (321, 526), (321, 822), (322, 232), (322, 554), (322, 847), (323, 232), (323, 853), (323, 881), (323, 981), (323, 1007), (324, 232), (324, 854), (324, 1008), (324, 1075), (325, 232), (325, 863), (325, 889), (325, 985), (325, 1013), (326, 232), (326, 864), (326, 890), (326, 986), (326, 1014), (327, 541), (327, 721), (327, 722), (327, 783), (327, 907), (328, 338), (328, 344), (329, 340), (329, 342), (330, 571), (330, 616), (330, 905), (331, 338), (331, 343), (331, 817), (332, 340), (332, 341), (332, 555), (333, 339), (333, 341), (333, 823), (334, 337), (334, 343), (334, 816), (336, 541), (336, 571), (336, 720), (336, 1034), (337, 234), (337, 816), (337, 846), (338, 234), (338, 525), (338, 817), (339, 234), (339, 823), (339, 840), (340, 234), (340, 555), (340, 841), (341, 234), (341, 725), (342, 234), (342, 726), (343, 234), (343, 855), (343, 891), (343, 979), (344, 234), (344, 856), (344, 892), (344, 980), (344, 1016), (345, 519), (345, 908), (345, 911), (345, 1089), (346, 358), (346, 364), (347, 360), (347, 362), (348, 519), (348, 572), (348, 787), (348, 910), (349, 358), (349, 363), (350, 359), (350, 362), (351, 360), (351, 361), (351, 555), (352, 357), (352, 364), (353, 359), (353, 361), (353, 823), (354, 357), (354, 363), (355, 727), (355, 785), (355, 788), (355, 1089), (356, 572), (356, 727), (356, 908), (356, 1035), (357, 235), (357, 731), (358, 235), (358, 732), (359, 235), (359, 538), (359, 823), (360, 235), (360, 555), (360, 835), (361, 235), (361, 869), (361, 885), (361, 1009), (362, 235), (362, 870), (362, 1010), (362, 1076), (363, 235), (363, 879), (363, 895), (364, 235), (364, 880), (364, 896), (365, 573), (365, 734), (365, 791), (365, 1028), (366, 376), (366, 382), (367, 378), (367, 380), (369, 378), (369, 379), (369, 554), (370, 375), (370, 382), (371, 377), (371, 379), (371, 822), (372, 375), (372, 381), (372, 816), (372, 871), (373, 573), (373, 618), (373, 733), (373, 913), (373, 1036), (374, 733), (374, 735), (374, 912), (374, 1029), (375, 237), (375, 537), (375, 816), (376, 237), (376, 817), (376, 834), (377, 237), (377, 822), (377, 828), (378, 237), (378, 554), (378, 829), (379, 237), (379, 877), (379, 1001), (379, 1007), (379, 1077), (380, 237), (380, 878), (380, 888), (380, 1008), (381, 237), (381, 871), (381, 893), (382, 237), (382, 872), (382, 894), (382, 994), (382, 1016), (383, 207), (383, 740), (383, 741), (383, 918), (384, 394), (384, 400), (385, 396), (385, 398), (386, 574), (386, 740), (386, 909), (386, 916), (386, 917), (387, 395), (387, 398), (388, 393), (388, 400), (389, 395), (389, 397), (389, 557), (390, 393), (390, 399), (390, 818), (390, 837), (391, 127), (391, 614), (391, 739), (391, 916), (392, 207), (392, 574), (392, 739), (392, 1037), (393, 240), (393, 818), (393, 1074), (394, 240), (394, 598), (394, 819), (394, 866), (395, 240), (395, 557), (395, 875), (396, 240), (396, 825), (396, 876), (397, 240), (397, 830), (397, 881), (398, 240), (398, 831), (398, 1075), (399, 240), (399, 837), (399, 891), (400, 240), (400, 540), (400, 892), (401, 575), (401, 745), (401, 919), (401, 922), (401, 1062), (402, 414), (402, 420), (403, 416), (403, 418), (404, 521), (404, 524), (404, 745), (404, 913), (404, 921), (405, 414), (405, 419), (405, 821), (406, 415), (406, 418), (407, 416), (407, 417), (407, 824), (407, 836), (408, 413), (408, 420), (408, 833), (409, 415), (409, 417), (409, 556), (410, 413), (410, 419), (410, 820), (410, 832), (411, 575), (411, 744), (411, 912), (411, 1038), (411, 1061), (412, 521), (412, 744), (412, 919), (412, 1063), (413, 242), (413, 820), (413, 873), (414, 242), (414, 821), (414, 874), (415, 242), (415, 556), (415, 867), (416, 242), (416, 824), (416, 868), (417, 242), (417, 836), (417, 883), (418, 242), (418, 539), (418, 884), (419, 242), (419, 832), (419, 889), (420, 242), (420, 833), (420, 890), (421, 189), (421, 576), (421, 749), (421, 923), (422, 432), (422, 438), (423, 434), (423, 436), (424, 749), (424, 750), (424, 924), (424, 925), (425, 432), (425, 437), (426, 433), (426, 436), (427, 433), (427, 435), (427, 556), (428, 431), (428, 437), (429, 576), (429, 748), (429, 770), (429, 924), (429, 1039), (430, 748), (430, 750), (430, 802), (430, 923), (431, 243), (431, 600), (431, 818), (431, 850), (432, 243), (432, 819), (432, 851), (433, 243), (433, 556), (433, 859), (434, 243), (434, 754), (435, 243), (435, 842), (435, 885), (436, 243), (436, 843), (436, 1076), (437, 243), (437, 528), (437, 893), (437, 973), (438, 243), (438, 849), (438, 894), (439, 535), (439, 756), (439, 927), (439, 1066), (440, 452), (440, 458), (441, 454), (441, 456), (441, 527), (442, 577), (442, 756), (442, 928), (442, 929), (443, 452), (443, 457), (443, 821), (444, 453), (444, 456), (445, 454), (445, 455), (445, 848), (446, 451), (446, 458), (447, 453), (447, 455), (447, 557), (448, 451), (448, 457), (448, 820), (449, 535), (449, 755), (449, 1065), (449, 1067), (450, 577), (450, 755), (450, 927), (450, 1040), (451, 244), (451, 820), (451, 857), (452, 244), (452, 821), (452, 858), (453, 244), (453, 557), (453, 612), (454, 244), (454, 759), (455, 244), (455, 848), (455, 1077), (456, 244), (456, 527), (456, 888), (457, 244), (457, 844), (457, 895), (457, 965), (458, 244), (458, 845), (458, 896), (458, 966), (459, 564), (459, 641), (459, 647), (459, 653), (460, 470), (460, 476), (461, 472), (461, 474), (462, 127), (462, 638), (462, 699), (463, 472), (463, 473), (464, 469), (464, 476), (465, 471), (465, 473), (466, 469), (466, 475), (467, 562), (467, 655), (467, 686), (468, 689), (468, 695), (468, 702), (468, 708), (469, 760), (469, 1090), (470, 601), (470, 761), (470, 1090), (471, 836), (471, 861), (471, 1090), (472, 539), (472, 862), (472, 1090), (473, 762), (473, 1090), (474, 763), (474, 1090), (475, 848), (475, 877), (475, 1090), (476, 527), (476, 878), (476, 1090), (477, 127), (477, 1090), (478, 546), (478, 640), (478, 646), (478, 665), (479, 491), (479, 497), (480, 493), (480, 495), (481, 567), (481, 637), (481, 1095), (482, 491), (482, 496), (483, 492), (483, 495), (484, 493), (484, 494), (485, 490), (485, 497), (486, 492), (486, 494), (486, 837), (487, 490), (487, 496), (488, 545), (488, 548), (488, 660), (488, 685), (489, 569), (489, 668), (489, 688), (489, 694), (490, 498), (490, 764), (491, 498), (491, 765), (492, 498), (492, 837), (492, 855), (493, 498), (493, 540), (493, 856), (494, 498), (494, 528), (494, 871), (495, 498), (495, 849), (495, 872), (496, 498), (496, 766), (497, 498), (497, 767), (498, 127), (498, 517), (498, 518), (499, 545), (499, 562), (499, 657), (499, 664), (500, 509), (500, 515), (501, 511), (501, 513), (502, 511), (502, 512), (503, 508), (503, 515), (504, 510), (504, 512), (505, 508), (505, 514), (506, 546), (506, 651), (506, 664), (506, 698), (507, 567), (507, 672), (507, 701), (507, 707), (508, 516), (508, 768), (508, 769), (509, 516), (509, 770), (509, 771), (510, 516), (510, 772), (511, 516), (511, 773), (512, 516), (512, 524), (512, 790), (513, 127), (513, 516), (513, 791), (513, 914), (513, 919), (514, 516), (514, 776), (514, 777), (515, 516), (515, 536), (515, 778), (516, 127), (516, 246), (516, 477), (516, 517), (516, 518), (517, 127), (517, 243), (518, 127), (518, 240), (519, 235), (519, 520), (519, 1028), (520, 529), (520, 595), (520, 914), (521, 242), (521, 913), (521, 1029), (524, 529), (524, 920), (525, 530), (525, 531), (525, 974), (526, 531), (526, 532), (526, 975), (527, 127), (527, 532), (527, 976), (528, 530), (528, 973), (529, 127), (529, 173), (529, 520), (529, 531), (530, 228), (530, 531), (531, 127), (531, 529), (532, 148), (532, 531), (533, 232), (533, 534), (533, 1057), (534, 117), (534, 541), (534, 905), (535, 244), (535, 536), (535, 1058), (536, 541), (536, 906), (537, 542), (537, 959), (538, 544), (538, 961), (539, 127), (539, 544), (539, 962), (540, 127), (540, 542), (540, 960), (541, 127), (541, 144), (541, 534), (541, 543), (542, 222), (542, 543), (543, 127), (543, 541), (544, 177), (544, 543), (545, 549), (545, 651), (545, 665), (546, 548), (546, 635), (546, 666), (548, 549), (548, 660), (549, 115), (549, 127), (549, 136), (549, 559), (550, 549), (550, 678), (551, 553), (551, 648), (551, 683), (553, 549), (553, 682), (554, 127), (554, 130), (554, 558), (554, 946), (555, 127), (555, 560), (555, 948), (556, 127), (556, 559), (556, 560), (556, 947), (557, 127), (557, 558), (557, 945), (558, 130), (558, 559), (559, 127), (559, 549), (560, 150), (560, 559), (561, 565), (561, 657), (561, 660), (562, 564), (562, 649), (562, 658), (564, 565), (564, 633), (565, 127), (565, 170), (565, 591), (566, 565), (566, 669), (567, 634), (567, 1032), (569, 565), (569, 673), (570, 232), (570, 771), (570, 1039), (571, 234), (571, 777), (571, 1040), (572, 235), (572, 916), (572, 1037), (573, 237), (573, 919), (573, 1038), (574, 240), (574, 909), (574, 1035), (575, 242), (575, 912), (575, 1036), (576, 243), (576, 770), (576, 1033), (577, 244), (577, 776), (577, 1034), (591, 127), (591, 1031), (593, 549), (593, 619), (593, 620), (593, 621), (593, 676), (593, 712), (593, 713), (593, 714), (593, 754), (593, 759), (594, 117), (594, 602), (594, 616), (594, 723), (594, 724), (594, 725), (594, 726), (594, 760), (594, 761), (594, 764), (594, 765), (594, 904), (595, 127), (595, 520), (595, 602), (595, 603), (595, 618), (595, 637), (595, 729), (595, 736), (595, 737), (595, 766), (595, 767), (597, 120), (597, 603), (597, 614), (597, 652), (597, 697), (597, 698), (597, 699), (597, 731), (597, 732), (597, 772), (597, 1031), (598, 391), (598, 394), (598, 396), (598, 397), (598, 399), (599, 252), (599, 260), (599, 261), (599, 264), (599, 265), (600, 424), (600, 431), (600, 434), (600, 435), (600, 438), (601, 462), (601, 470), (601, 471), (601, 474), (601, 475), (602, 636), (602, 638), (602, 640), (602, 641), (602, 684), (602, 685), (602, 686), (602, 687), (602, 688), (602, 689), (603, 127), (603, 762), (603, 763), (612, 127), (612, 981), (612, 984), (614, 741), (614, 795), (616, 721), (616, 906), (618, 733), (618, 913), (619, 622), (619, 625), (620, 624), (620, 626), (621, 623), (621, 627), (622, 626), (622, 634), (623, 208), (623, 625), (624, 627), (624, 632), (625, 630), (625, 633), (626, 629), (626, 635), (627, 628), (627, 631), (628, 208), (628, 635), (629, 632), (629, 633), (630, 631), (630, 634), (631, 127), (631, 128), (631, 152), (632, 127), (632, 193), (632, 211), (633, 127), (633, 192), (633, 212), (634, 127), (634, 130), (634, 150), (635, 127), (635, 194), (635, 210), (636, 631), (636, 639), (636, 647), (637, 641), (637, 643), (638, 640), (638, 645), (638, 651), (639, 643), (639, 650), (640, 647), (640, 648), (640, 649), (641, 175), (641, 631), (641, 645), (643, 646), (643, 651), (645, 648), (645, 651), (646, 175), (646, 649), (647, 631), (647, 650), (648, 127), (648, 202), (648, 213), (649, 127), (649, 141), (649, 176), (650, 127), (650, 199), (650, 219), (651, 127), (651, 140), (651, 174), (652, 649), (652, 653), (652, 657), (652, 773), (653, 655), (653, 659), (655, 633), (655, 656), (656, 658), (656, 660), (657, 649), (657, 659), (658, 127), (658, 138), (658, 185), (659, 127), (659, 164), (659, 226), (660, 127), (660, 160), (660, 231), (661, 660), (661, 664), (661, 667), (664, 651), (664, 666), (665, 635), (665, 667), (666, 127), (666, 166), (666, 224), (667, 127), (667, 161), (667, 230), (668, 650), (668, 1095), (669, 672), (669, 675), (671, 634), (671, 675), (672, 650), (672, 674), (673, 127), (673, 200), (673, 214), (674, 127), (674, 142), (674, 167), (675, 127), (675, 146), (675, 169), (676, 677), (676, 678), (676, 715), (677, 658), (677, 679), (678, 673), (678, 681), (679, 680), (679, 682), (680, 648), (680, 673), (681, 658), (681, 683), (682, 127), (682, 134), (682, 180), (683, 127), (683, 137), (683, 184), (684, 682), (684, 687), (684, 695), (685, 689), (685, 694), (685, 696), (686, 674), (686, 688), (686, 693), (687, 666), (687, 674), (687, 694), (688, 208), (688, 695), (688, 696), (689, 659), (689, 682), (689, 693), (693, 208), (693, 674), (694, 659), (694, 696), (695, 666), (695, 682), (696, 127), (696, 165), (696, 225), (697, 700), (697, 703), (698, 702), (698, 704), (699, 701), (699, 705), (700, 667), (700, 704), (701, 632), (701, 703), (702, 175), (702, 705), (703, 696), (703, 708), (704, 675), (704, 707), (705, 683), (705, 706), (706, 632), (706, 675), (707, 175), (707, 696), (708, 667), (708, 683), (712, 859), (712, 867), (712, 1094), (713, 860), (713, 868), (714, 612), (714, 875), (714, 1094), (715, 852), (715, 876), (716, 232), (716, 719), (716, 783), (716, 807), (717, 232), (717, 769), (717, 802), (719, 906), (719, 907), (720, 234), (720, 723), (720, 1055), (721, 233), (721, 724), (721, 807), (722, 127), (722, 778), (722, 1067), (723, 901), (723, 902), (724, 903), (724, 904), (725, 861), (725, 883), (726, 862), (726, 884), (727, 235), (727, 729), (729, 730), (729, 808), (730, 127), (730, 912), (730, 913), (731, 814), (731, 826), (732, 815), (732, 827), (733, 238), (733, 736), (733, 785), (734, 237), (734, 738), (734, 911), (734, 1069), (735, 237), (735, 920), (735, 1063), (736, 908), (736, 909), (737, 520), (737, 529), (737, 738), (738, 910), (738, 911), (739, 127), (739, 240), (739, 742), (739, 1061), (740, 240), (740, 743), (740, 1062), (740, 1071), (741, 241), (741, 774), (741, 788), (742, 919), (742, 920), (743, 245), (743, 921), (743, 922), (744, 242), (744, 746), (744, 1070), (745, 242), (745, 747), (745, 917), (745, 918), (745, 1071), (746, 207), (746, 916), (747, 245), (747, 917), (747, 918), (748, 243), (748, 751), (748, 1065), (749, 243), (749, 752), (749, 1066), (750, 243), (750, 768), (750, 1056), (751, 927), (751, 928), (752, 929), (752, 930), (754, 824), (754, 860), (755, 244), (755, 757), (755, 1072), (756, 189), (756, 244), (756, 758), (756, 1073), (757, 923), (757, 924), (758, 189), (758, 925), (759, 825), (759, 852), (760, 830), (760, 853), (761, 831), (761, 854), (762, 842), (762, 869), (763, 843), (763, 870), (764, 832), (764, 863), (765, 833), (765, 864), (766, 844), (766, 879), (767, 845), (767, 880), (768, 902), (768, 904), (769, 189), (769, 924), (770, 901), (770, 903), (771, 923), (771, 925), (772, 127), (772, 787), (772, 911), (772, 916), (773, 774), (773, 775), (774, 908), (774, 910), (775, 207), (775, 917), (776, 905), (776, 907), (777, 928), (777, 930), (778, 927), (778, 929), (783, 807), (783, 907), (785, 808), (785, 909), (787, 909), (787, 918), (788, 898), (788, 910), (790, 913), (790, 922), (791, 912), (791, 921), (795, 898), (795, 917), (802, 189), (802, 1078), (807, 127), (807, 213), (807, 932), (808, 127), (808, 202), (808, 933), (814, 127), (814, 211), (814, 937), (814, 941), (815, 127), (815, 193), (815, 938), (815, 942), (816, 127), (816, 193), (816, 939), (816, 943), (817, 127), (817, 940), (817, 944), (818, 127), (818, 185), (818, 939), (818, 944), (819, 127), (819, 940), (819, 943), (820, 127), (820, 937), (820, 942), (821, 127), (821, 938), (821, 941), (822, 127), (822, 945), (822, 949), (823, 127), (823, 130), (823, 947), (823, 950), (824, 127), (824, 948), (824, 950), (825, 127), (825, 946), (825, 949), (826, 179), (826, 951), (826, 955), (827, 220), (827, 952), (827, 956), (828, 220), (828, 953), (828, 957), (829, 954), (829, 958), (830, 127), (830, 223), (830, 953), (830, 958), (831, 127), (831, 954), (831, 957), (832, 127), (832, 951), (832, 956), (833, 127), (833, 952), (833, 955), (834, 960), (834, 963), (835, 962), (835, 964), (836, 127), (836, 961), (836, 964), (837, 127), (837, 959), (837, 963), (838, 157), (838, 965), (838, 969), (839, 171), (839, 966), (839, 970), (840, 171), (840, 967), (840, 971), (841, 968), (841, 972), (842, 127), (842, 168), (842, 967), (842, 972), (843, 127), (843, 968), (843, 971), (844, 965), (844, 970), (845, 966), (845, 969), (846, 173), (846, 973), (846, 977), (847, 976), (847, 978), (848, 127), (848, 228), (848, 975), (848, 978), (849, 127), (849, 974), (849, 977), (850, 979), (850, 983), (851, 203), (851, 980), (852, 127), (852, 197), (852, 982), (853, 197), (853, 981), (854, 127), (854, 982), (854, 984), (855, 203), (855, 979), (856, 980), (856, 983), (857, 205), (857, 985), (857, 989), (858, 195), (858, 986), (858, 990), (859, 127), (859, 195), (859, 987), (859, 991), (860, 127), (860, 988), (860, 992), (861, 127), (861, 182), (861, 987), (861, 992), (862, 127), (862, 988), (862, 991), (863, 985), (863, 990), (864, 986), (864, 989), (866, 994), (866, 997), (867, 127), (867, 995), (867, 998), (868, 127), (868, 135), (868, 996), (869, 127), (869, 135), (869, 995), (870, 127), (870, 996), (870, 998), (871, 127), (871, 993), (871, 997), (872, 151), (872, 994), (873, 191), (873, 999), (873, 1003), (874, 132), (874, 1000), (874, 1004), (875, 127), (875, 132), (875, 1001), (875, 1005), (876, 127), (876, 1002), (876, 1006), (877, 216), (877, 1001), (877, 1006), (878, 127), (878, 1002), (878, 1005), (879, 127), (879, 999), (879, 1004), (880, 127), (880, 1000), (880, 1003), (881, 1007), (881, 1011), (883, 127), (883, 226), (883, 1009), (884, 127), (884, 1010), (884, 1012), (885, 1009), (885, 1012), (888, 1008), (888, 1011), (889, 219), (889, 1013), (889, 1017), (890, 199), (890, 1014), (890, 1018), (891, 127), (891, 174), (891, 199), (891, 1015), (891, 1019), (892, 1016), (892, 1020), (893, 127), (893, 166), (893, 1015), (893, 1020), (894, 1016), (894, 1019), (895, 127), (895, 1013), (895, 1018), (896, 127), (896, 1014), (896, 1017), (898, 127), (898, 1024), (898, 1026), (901, 127), (901, 198), (901, 223), (901, 246), (902, 127), (902, 143), (902, 162), (903, 127), (903, 139), (903, 156), (903, 246), (904, 127), (904, 179), (904, 220), (905, 127), (905, 145), (905, 163), (906, 127), (906, 178), (906, 221), (907, 127), (907, 177), (907, 222), (908, 127), (908, 159), (908, 168), (909, 127), (909, 149), (909, 227), (910, 127), (910, 206), (910, 218), (911, 127), (911, 157), (911, 171), (911, 245), (912, 127), (912, 148), (912, 228), (913, 127), (913, 147), (913, 229), (914, 127), (914, 158), (914, 172), (914, 245), (916, 127), (916, 153), (916, 181), (916, 245), (917, 127), (917, 129), (917, 133), (917, 245), (918, 197), (918, 203), (918, 245), (919, 127), (919, 154), (919, 182), (919, 245), (920, 127), (920, 155), (920, 183), (920, 245), (921, 127), (921, 196), (921, 204), (921, 245), (922, 127), (922, 195), (922, 205), (922, 245), (923, 127), (923, 135), (923, 151), (924, 127), (924, 188), (924, 215), (925, 127), (925, 201), (925, 209), (925, 246), (927, 127), (927, 187), (927, 216), (928, 127), (928, 186), (928, 217), (929, 127), (929, 131), (929, 190), (930, 127), (930, 132), (930, 191), (932, 128), (932, 180), (933, 152), (933, 180), (937, 137), (937, 212), (938, 184), (938, 192), (939, 184), (939, 212), (940, 137), (940, 192), (941, 138), (941, 211), (942, 185), (942, 193), (943, 138), (943, 193), (944, 185), (944, 211), (945, 200), (945, 210), (946, 194), (946, 214), (947, 210), (947, 214), (948, 194), (948, 200), (949, 136), (949, 150), (950, 130), (950, 136), (951, 127), (951, 156), (951, 162), (952, 127), (952, 139), (952, 143), (953, 127), (953, 143), (953, 156), (954, 127), (954, 139), (954, 162), (955, 179), (955, 198), (956, 220), (956, 223), (957, 198), (957, 220), (958, 179), (958, 223), (959, 127), (959, 145), (959, 178), (960, 127), (960, 163), (960, 221), (961, 127), (961, 163), (961, 178), (962, 127), (962, 145), (962, 221), (963, 144), (963, 177), (964, 144), (964, 222), (965, 127), (965, 149), (965, 206), (966, 127), (966, 218), (966, 227), (967, 127), (967, 206), (967, 227), (968, 127), (968, 149), (968, 218), (969, 157), (969, 159), (970, 168), (970, 171), (971, 159), (971, 171), (972, 157), (972, 168), (973, 127), (973, 158), (973, 229), (974, 127), (974, 147), (974, 172), (975, 127), (975, 147), (975, 158), (976, 127), (976, 172), (976, 229), (977, 148), (977, 173), (978, 173), (978, 228), (979, 127), (979, 129), (979, 153), (980, 127), (980, 133), (980, 181), (981, 127), (981, 129), (981, 181), (982, 133), (982, 153), (983, 197), (983, 207), (984, 203), (984, 207), (985, 127), (985, 183), (985, 196), (986, 127), (986, 155), (986, 204), (987, 155), (987, 196), (988, 183), (988, 204), (989, 154), (989, 205), (990, 182), (990, 195), (991, 154), (991, 195), (992, 182), (992, 205), (993, 127), (993, 188), (993, 209), (994, 127), (994, 201), (994, 215), (995, 209), (995, 215), (996, 188), (996, 201), (997, 135), (997, 189), (998, 151), (998, 189), (999, 127), (999, 131), (999, 217), (1000, 127), (1000, 186), (1000, 190), (1001, 127), (1001, 131), (1001, 186), (1002, 190), (1002, 217), (1003, 187), (1003, 191), (1004, 132), (1004, 216), (1005, 132), (1005, 187), (1006, 191), (1006, 216), (1007, 127), (1007, 176), (1007, 225), (1008, 127), (1008, 141), (1008, 165), (1009, 127), (1009, 165), (1009, 176), (1010, 127), (1010, 141), (1010, 225), (1011, 127), (1011, 175), (1011, 226), (1012, 164), (1012, 175), (1013, 127), (1013, 167), (1013, 174), (1014, 127), (1014, 140), (1014, 142), (1015, 142), (1015, 174), (1016, 127), (1016, 140), (1016, 167), (1017, 219), (1017, 224), (1018, 166), (1018, 199), (1019, 199), (1019, 224), (1020, 166), (1020, 219), (1024, 160), (1024, 169), (1026, 161), (1026, 170), (1027, 525), (1027, 526), (1027, 527), (1027, 528), (1027, 846), (1027, 847), (1027, 848), (1027, 849), (1028, 529), (1028, 1069), (1029, 529), (1029, 1079), (1031, 591), (1031, 597), (1031, 898), (1031, 1041), (1031, 1042), (1031, 1043), (1031, 1044), (1031, 1078), (1031, 1079), (1031, 1080), (1032, 569), (1032, 674), (1033, 903), (1033, 1041), (1034, 907), (1034, 1044), (1035, 911), (1035, 1042), (1036, 914), (1036, 1043), (1037, 918), (1037, 1042), (1038, 921), (1038, 1043), (1039, 925), (1039, 1041), (1040, 930), (1040, 1044), (1041, 246), (1041, 591), (1041, 1045), (1041, 1086), (1042, 127), (1042, 591), (1042, 1046), (1042, 1087), (1043, 127), (1043, 1024), (1043, 1046), (1044, 127), (1044, 1045), (1044, 1085), (1045, 161), (1045, 591), (1046, 230), (1046, 591), (1048, 873), (1048, 874), (1048, 875), (1048, 876), (1048, 877), (1048, 878), (1048, 879), (1048, 880), (1049, 881), (1049, 883), (1049, 884), (1049, 885), (1049, 888), (1049, 1011), (1049, 1075), (1049, 1076), (1049, 1077), (1050, 889), (1050, 890), (1050, 891), (1050, 892), (1050, 893), (1050, 894), (1050, 895), (1050, 896), (1051, 866), (1051, 867), (1051, 868), (1051, 869), (1051, 870), (1051, 871), (1051, 872), (1051, 1074), (1052, 857), (1052, 858), (1052, 859), (1052, 860), (1052, 861), (1052, 862), (1052, 863), (1052, 864), (1053, 807), (1053, 808), (1053, 1068), (1053, 1069), (1053, 1070), (1053, 1071), (1053, 1072), (1053, 1073), (1053, 1083), (1055, 902), (1055, 1068), (1056, 904), (1056, 1078), (1057, 905), (1057, 1068), (1058, 906), (1058, 1080), (1061, 920), (1061, 1070), (1062, 922), (1062, 1071), (1063, 922), (1063, 1079), (1065, 928), (1065, 1072), (1066, 930), (1066, 1073), (1067, 929), (1067, 1080), (1068, 127), (1068, 1081), (1068, 1083), (1069, 127), (1069, 1082), (1069, 1084), (1070, 127), (1070, 933), (1070, 1084), (1071, 202), (1071, 245), (1071, 1082), (1072, 127), (1072, 213), (1072, 1081), (1073, 127), (1073, 932), (1073, 1083), (1074, 151), (1074, 993), (1075, 164), (1075, 1008), (1076, 226), (1076, 1010), (1077, 164), (1077, 1007), (1078, 127), (1078, 1085), (1078, 1088), (1079, 127), (1079, 1026), (1079, 1087), (1080, 127), (1080, 1086), (1080, 1088), (1081, 134), (1081, 152), (1082, 128), (1082, 134), (1083, 127), (1083, 202), (1083, 208), (1084, 208), (1084, 213), (1085, 169), (1085, 231), (1086, 146), (1086, 160), (1087, 146), (1087, 231), (1088, 170), (1088, 230), (1089, 127), (1089, 207), (1089, 235), (1089, 775), (1089, 795), (1090, 127), (1090, 470), (1090, 477), (1091, 127), (1091, 245), (1091, 260), (1091, 267), (1094, 127), (1095, 671), (1095, 673)] + +/-- pairs used by #7630 but not #7623 (5) -/ +def newPairs : List (Nat × Nat) := [(3, 618), (3, 849), (449, 928), (495, 127), (594, 883)] + +/-- pairs used by #7623 but not #7630 (2) -/ +def leavePairs : List (Nat × Nat) := [(24, 849), (595, 618)] + +end CensusData diff --git a/research/p104-lean-premises/lean/Nov15/ClearCert.lean b/research/p104-lean-premises/lean/Nov15/ClearCert.lean new file mode 100644 index 0000000000..6dcaafa862 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/ClearCert.lean @@ -0,0 +1,455 @@ +/- +LEAN-PREM1, Nov 17. CLEAR certificates on the TokenCancel row model. See ClearCert.md. +Rank lemma (span form), checker soundness+completeness, CLEARFORM same-events theorem, toy instance. +-/ +import Nov15.TokenCancel +import Mathlib.LinearAlgebra.Finsupp.LinearCombination +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace ClearCert +open TokenCancel + +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] [DecidableEq C] + +/-- Span of all current rows (zero rows contribute nothing). -/ +def rowSpan (s : St K Reg C) : Submodule K (Reg → K) := Submodule.span K (Set.range s.row) + +/-- Span of the rows of the registers other than `i`. -/ +def othersSpan (s : St K Reg C) (i : Reg) : Submodule K (Reg → K) := + Submodule.span K (s.row '' {j | j ≠ i}) + +/-- CLEAR of `i` is lossless at `s`: the erased row lies in the span of the other rows. -/ +def Lossless (s : St K Reg C) (i : Reg) : Prop := s.row i ∈ othersSpan s i + +/-- No births in the tail (public inputs are born in the prefix). -/ +def NoBorn : Ev K Reg C → Prop + | .born _ _ => False + | _ => True + +/-- What the checker (check.py) enforces besides legality: no SCALE by 0, ADD between distinct +registers, COPY / INIT into a zero row, no births. CLEAR is unconstrained. -/ +def Good (s : St K Reg C) : Ev K Reg C → Prop + | .born _ _ => False + | .init i _ => s.row i = 0 + | .move _ _ => True + | .add i j _ _ => i ≠ j + | .scale _ u _ => u ≠ 0 + | .clear _ _ => True + | .copy i _ _ => s.row i = 0 + +def GoodRun : St K Reg C → List (Ev K Reg C) → Prop + | _, [] => True + | s, e :: es => Good s e ∧ GoodRun (step s e) es + +lemma run_append (s : St K Reg C) (a b : List (Ev K Reg C)) : + run s (a ++ b) = run (run s a) b := by + induction a generalizing s with + | nil => rfl + | cons e es ih => simp [run, ih] + +lemma row_mem (s : St K Reg C) (j : Reg) : s.row j ∈ rowSpan s := + Submodule.subset_span ⟨j, rfl⟩ + +lemma update_range_le (s : St K Reg C) (i : Reg) (v : Reg → K) (hv : v ∈ rowSpan s) : + Submodule.span K (Set.range (Function.update s.row i v)) ≤ rowSpan s := by + refine Submodule.span_le.mpr ?_ + rintro _ ⟨j, rfl⟩ + by_cases h : j = i + · subst h; simpa using hv + · simpa [Function.update_of_ne h] using row_mem s j + +/-- Every non-birth event can only shrink the span of the rows. -/ +theorem span_step_le (s : St K Reg C) (e : Ev K Reg C) (he : NoBorn e) : + rowSpan (step s e) ≤ rowSpan s := by + cases e with + | born i c => exact he.elim + | init i c => exact update_range_le s i 0 (Submodule.zero_mem _) + | move i c => exact le_rfl + | add i j a c => + exact update_range_le s i _ (Submodule.add_mem _ (row_mem s i) + (Submodule.smul_mem _ _ (row_mem s j))) + | scale i u c => exact update_range_le s i _ (Submodule.smul_mem _ _ (row_mem s i)) + | clear i c => exact update_range_le s i 0 (Submodule.zero_mem _) + | copy i j c => exact update_range_le s i _ (row_mem s j) + +/-- A non-CLEAR "good" event preserves the span of the rows exactly (rank unchanged). -/ +theorem span_step_ge (s : St K Reg C) (e : Ev K Reg C) (hg : Good s e) + (hc : ∀ i c, e ≠ .clear i c) : rowSpan s ≤ rowSpan (step s e) := by + have key : ∀ (i : Reg) (v : Reg → K), s.row i ∈ rowSpan (⟨Function.update s.row i v, s.loc⟩ : St K Reg C) → + rowSpan s ≤ rowSpan (⟨Function.update s.row i v, s.loc⟩ : St K Reg C) := by + intro i v hi + refine Submodule.span_le.mpr ?_ + rintro _ ⟨j, rfl⟩ + by_cases h : j = i + · subst h; exact hi + · exact Submodule.subset_span ⟨j, by simp [Function.update_of_ne h]⟩ + cases e with + | born i c => exact hg.elim + | init i c => + exact key i 0 (by simp [Good] at hg; rw [hg]; exact Submodule.zero_mem _) + | move i c => exact le_rfl + | add i j a c => + apply key + have hne : i ≠ j := hg + have h1 : (⟨Function.update s.row i (s.row i + a • s.row j), s.loc⟩ : St K Reg C).row i + = s.row i + a • s.row j := by simp + have h2 : (⟨Function.update s.row i (s.row i + a • s.row j), s.loc⟩ : St K Reg C).row j + = s.row j := by simp [Function.update_of_ne hne.symm] + have := Submodule.sub_mem (rowSpan (⟨Function.update s.row i (s.row i + a • s.row j), s.loc⟩ : St K Reg C)) + (row_mem ⟨Function.update s.row i (s.row i + a • s.row j), s.loc⟩ i) + (Submodule.smul_mem _ a (row_mem ⟨Function.update s.row i (s.row i + a • s.row j), s.loc⟩ j)) + rw [h1, h2] at this + simpa using this + | scale i u c => + apply key + have hu : u ≠ 0 := hg + have h1 : (⟨Function.update s.row i (u • s.row i), s.loc⟩ : St K Reg C).row i = u • s.row i := by simp + have := Submodule.smul_mem (rowSpan (⟨Function.update s.row i (u • s.row i), s.loc⟩ : St K Reg C)) + u⁻¹ (row_mem ⟨Function.update s.row i (u • s.row i), s.loc⟩ i) + rw [h1, smul_smul, inv_mul_cancel₀ hu, one_smul] at this + exact this + | clear i c => exact absurd rfl (hc i c) + | copy i j c => + exact key i _ (by simp [Good] at hg; rw [hg]; exact Submodule.zero_mem _) + +/-- Span after a CLEAR = span of the other rows. -/ +theorem span_clear_eq (s : St K Reg C) (i : Reg) (c : C) : + rowSpan (step s (.clear i c)) = othersSpan s i := by + apply le_antisymm + · refine Submodule.span_le.mpr ?_ + rintro _ ⟨j, rfl⟩ + by_cases h : j = i + · subst h; simp [step] + · simp only [step, Function.update_of_ne h] + exact Submodule.subset_span ⟨j, h, rfl⟩ + · refine Submodule.span_le.mpr ?_ + rintro _ ⟨j, hj, rfl⟩ + exact Submodule.subset_span ⟨j, by simp [step, Function.update_of_ne hj]⟩ + +/-- A CLEAR is lossless iff it does not change the span of the rows. -/ +theorem lossless_iff (s : St K Reg C) (i : Reg) (c : C) : + Lossless s i ↔ rowSpan (step s (.clear i c)) = rowSpan s := by + rw [span_clear_eq] + constructor + · intro h + apply le_antisymm + · refine Submodule.span_le.mpr ?_ + rintro _ ⟨j, hj, rfl⟩; exact row_mem s j + · refine Submodule.span_le.mpr ?_ + rintro _ ⟨j, rfl⟩ + by_cases hj : j = i + · subst hj; exact h + · exact Submodule.subset_span ⟨j, hj, rfl⟩ + · intro h + have : s.row i ∈ rowSpan s := row_mem s i + rw [← h] at this; exact this + +/-- RANK LEMMA, part 1 (span form): in a birth-free tail the span of the rows only shrinks. -/ +theorem span_run_le (s : St K Reg C) (es : List (Ev K Reg C)) (h : ∀ e ∈ es, NoBorn e) : + rowSpan (run s es) ≤ rowSpan s := by + induction es generalizing s with + | nil => exact le_rfl + | cons e es ih => + exact (ih (step s e) (fun x hx => h x (by simp [hx]))).trans + (span_step_le s e (h e (by simp))) + +/-- Endpoint exactness at the span level, relative to the input space `U` (the span of the public +inputs e_i): the final rows span `U`. For the real words (final public rows = identity, owned rows +zero) this is implied by exactness. -/ +def FullEnd (U : Submodule K (Reg → K)) (s : St K Reg C) (es : List (Ev K Reg C)) : Prop := + U ≤ rowSpan (run s es) + +/-- RANK LEMMA / THEOREM 1: in an endpoint-exact birth-free word, EVERY CLEAR is lossless. -/ +theorem every_clear_lossless (U : Submodule K (Reg → K)) (s : St K Reg C) (es : List (Ev K Reg C)) + (hU : rowSpan s ≤ U) (hnb : ∀ e ∈ es, NoBorn e) (hend : FullEnd U s es) + (pre post : List (Ev K Reg C)) (i : Reg) (c : C) (hsplit : es = pre ++ .clear i c :: post) : + Lossless (run s pre) i := by + subst hsplit + rw [lossless_iff _ _ c] + have hn : ∀ e ∈ post, NoBorn e := fun x hx => hnb x (by simp [hx]) + have hpre : ∀ e ∈ pre, NoBorn e := fun x hx => hnb x (by simp [hx]) + have h1 : U ≤ rowSpan (run (step (run s pre) (.clear i c)) post) := by + have := hend; unfold FullEnd at this + rwa [run_append, run] at this + have h2 := h1.trans (span_run_le _ post hn) + have h3 : rowSpan (run s pre) ≤ U := (span_run_le s pre hpre).trans hU + exact le_antisymm (span_step_le _ _ trivial) (h3.trans h2) + +/-- Rank lemma, dimension form: a CLEAR lowers the rank by at most 1. -/ +theorem finrank_clear_le [Finite Reg] (s : St K Reg C) (i : Reg) (c : C) : + Module.finrank K (rowSpan s) ≤ Module.finrank K (rowSpan (step s (.clear i c))) + 1 := by + have hsup : rowSpan s ≤ rowSpan (step s (.clear i c)) ⊔ Submodule.span K {s.row i} := by + refine Submodule.span_le.mpr ?_ + rintro _ ⟨j, rfl⟩ + by_cases h : j = i + · subst h; exact Submodule.mem_sup_right (Submodule.subset_span rfl) + · exact Submodule.mem_sup_left (Submodule.subset_span ⟨j, by simp [step, Function.update_of_ne h]⟩) + have h1 := Submodule.finrank_mono hsup + have h2 := Submodule.finrank_add_le_finrank_add_finrank (rowSpan (step s (.clear i c))) + (Submodule.span K {s.row i}) + have h3 : Module.finrank K (Submodule.span K {s.row i}) ≤ 1 := le_trans (finrank_span_le_card {s.row i}) (by simp) + omega + + +/-! ## Checker model (verify_certificates, as read in check.py:656-694) -/ + +/-- Dead registers (never born/INITed) carry the zero row. -/ +def DeadZero (s : St K Reg C) : Prop := ∀ j, s.loc j = none → s.row j = 0 + +section legal +variable (z V : C) + +theorem deadZero_step (s : St K Reg C) (e : Ev K Reg C) (hd : DeadZero s) + (hL : LegalEv z V s e) : DeadZero (step s e) := by + intro j hj + cases e with + | born i c => by_cases h : j = i <;> simp_all [step, DeadZero, Function.update_apply] + | init i c => by_cases h : j = i <;> simp_all [step, DeadZero, Function.update_apply] + | move i c => + by_cases h : j = i + · subst h; simp [step] at hj + · simp only [step, Function.update_of_ne h] at hj ⊢; exact hd j hj + | add i j' a c => + by_cases h : j = i + · subst h; simp only [step] at hj; rw [hL.2.1] at hj; simp at hj + · simp only [step, Function.update_of_ne h] at hj ⊢; exact hd j hj + | scale i u c => + by_cases h : j = i + · subst h; simp only [step] at hj; rw [hL] at hj; simp at hj + · simp only [step, Function.update_of_ne h] at hj ⊢; exact hd j hj + | clear i c => + by_cases h : j = i + · subst h; simp [step] + · simp only [step, Function.update_of_ne h] at hj ⊢; exact hd j hj + | copy i j' c => + by_cases h : j = i + · subst h; simp only [step] at hj; rw [hL.1] at hj; simp at hj + · simp only [step, Function.update_of_ne h] at hj ⊢; exact hd j hj + +/-- Chronology / field identity (legality) only reads `loc`, never row contents. -/ +theorem legal_congr (s s' : St K Reg C) (h : s.loc = s'.loc) (es : List (Ev K Reg C)) : + Legal z V s es ↔ Legal z V s' es := by + induction es generalizing s s' with + | nil => simp [Legal] + | cons e es ih => + have hl : LegalEv z V s e ↔ LegalEv z V s' e := by + cases e <;> simp [LegalEv, h] + have hs : (step s e).loc = (step s' e).loc := by cases e <;> simp [step, h] + simp only [Legal, hl, ih _ _ hs] + +end legal + +/-- A certificate at a CLEAR of `i`: finitely supported coefficients on live registers other than `i`, +exact combination of their rows equal to the erased row (check.py:672-678). -/ +def CertOK (s : St K Reg C) (i : Reg) (c : Reg →₀ K) : Prop := + (∀ k ∈ c.support, k ≠ i ∧ s.loc k ≠ none) ∧ + s.row i = Finsupp.linearCombination K s.row c + +/-- Certificates indexed by event position (the JSON `clear_event_index`): every CLEAR has one. -/ +def Certified : St K Reg C → List (Ev K Reg C) → (ℕ → Option (Reg →₀ K)) → Prop + | _, [], _ => True + | s, e :: es, cs => + (match e with + | .clear i _ => ∃ c, cs 0 = some c ∧ CertOK s i c + | _ => True) ∧ Certified (step s e) es (fun n => cs (n + 1)) + +theorem certOK_lossless (s : St K Reg C) (i : Reg) (c : Reg →₀ K) (h : CertOK s i c) : + Lossless s i := by + unfold Lossless othersSpan + rw [h.2] + have : c ∈ Finsupp.supported K K {j | j ≠ i} := by + rw [Finsupp.mem_supported]; intro k hk; exact (h.1 k hk).1 + exact (Finsupp.mem_span_image_iff_linearCombination K).mpr ⟨c, this, rfl⟩ + +theorem lossless_certOK (s : St K Reg C) (hd : DeadZero s) (i : Reg) (h : Lossless s i) : + ∃ c, CertOK s i c := by + have h' : othersSpan s i ≤ Submodule.span K (s.row '' {j | j ≠ i ∧ s.loc j ≠ none}) := by + refine Submodule.span_le.mpr ?_ + rintro _ ⟨j, hj, rfl⟩ + by_cases hl : s.loc j = none + · rw [hd j hl]; exact Submodule.zero_mem _ + · exact Submodule.subset_span ⟨j, ⟨hj, hl⟩, rfl⟩ + obtain ⟨c, hc, hcomb⟩ := (Finsupp.mem_span_image_iff_linearCombination K).mp (h' h) + refine ⟨c, fun k hk => ?_, hcomb.symm⟩ + exact (Finsupp.mem_supported K c).mp hc hk + +theorem goodRun_noBorn (s : St K Reg C) (es : List (Ev K Reg C)) (h : GoodRun s es) : + ∀ e ∈ es, NoBorn e := by + induction es generalizing s with + | nil => simp + | cons e es ih => + intro x hx + rcases List.mem_cons.mp hx with rfl | hx + · cases x <;> simp_all [GoodRun, Good, NoBorn] + · exact ih _ h.2 x hx + +/-- Certified + good steps => the span of the rows never drops (the word is information preserving). -/ +theorem certified_span_ge (es : List (Ev K Reg C)) : + ∀ (s : St K Reg C) (cs : ℕ → Option (Reg →₀ K)), GoodRun s es → Certified s es cs → + rowSpan s ≤ rowSpan (run s es) := by + induction es with + | nil => intro s cs _ _; exact le_rfl + | cons e es ih => + intro s cs hg hc + have h1 : rowSpan s ≤ rowSpan (step s e) := by + by_cases hcl : ∃ i c, e = .clear i c + · obtain ⟨i, c, rfl⟩ := hcl + obtain ⟨c0, -, hok⟩ := hc.1 + exact ((lossless_iff s i c).mp (certOK_lossless s i c0 hok)).ge + · exact span_step_ge s e hg.1 (fun i c h => hcl ⟨i, c, h⟩) + exact h1.trans (ih (step s e) _ hg.2 hc.2) + +/-- THEOREM 2 (checker soundness): if the certificate check passes at every CLEAR of a good birth-free +word started from a full-rank state, the endpoint is full-rank and EVERY CLEAR is lossless. -/ +theorem checker_sound (U : Submodule K (Reg → K)) (s : St K Reg C) (es : List (Ev K Reg C)) + (cs : ℕ → Option (Reg →₀ K)) + (hU : rowSpan s ≤ U) (hfull : U ≤ rowSpan s) (hg : GoodRun s es) (hc : Certified s es cs) : + FullEnd U s es ∧ ∀ pre post i c, es = pre ++ .clear i c :: post → Lossless (run s pre) i := by + have hend : FullEnd U s es := hfull.trans (certified_span_ge es s cs hg hc) + exact ⟨hend, fun pre post i c h => every_clear_lossless U s es hU (goodRun_noBorn s es hg) hend pre post i c h⟩ + +/-- Checker completeness: an endpoint-exact legal birth-free word has certificates at every CLEAR. -/ +theorem checker_complete (U : Submodule K (Reg → K)) (z V : C) (es : List (Ev K Reg C)) : + ∀ (s : St K Reg C), rowSpan s ≤ U → DeadZero s → Legal z V s es → (∀ e ∈ es, NoBorn e) → + FullEnd U s es → + ∃ cs, Certified s es cs := by + induction es with + | nil => intro s _ _ _ _ _; exact ⟨fun _ => none, trivial⟩ + | cons e es ih => + intro s hU hd hl hnb hend + have hU' : rowSpan (step s e) ≤ U := (span_step_le s e (hnb e (by simp))).trans hU + have hd' := deadZero_step z V s e hd hl.1 + have hnb' : ∀ x ∈ es, NoBorn x := fun x hx => hnb x (by simp [hx]) + obtain ⟨cs', hcs'⟩ := ih (step s e) hU' hd' hl.2 hnb' hend + by_cases hcl : ∃ i c, e = .clear i c + · obtain ⟨i, c, rfl⟩ := hcl + have hloss := every_clear_lossless U s (.clear i c :: es) hU hnb hend [] es i c rfl + obtain ⟨c0, hc0⟩ := lossless_certOK s hd i hloss + refine ⟨fun n => match n with | 0 => some c0 | n + 1 => cs' n, ?_, hcs'⟩ + exact ⟨c0, rfl, hc0⟩ + · refine ⟨fun n => match n with | 0 => none | n + 1 => cs' n, ?_, hcs'⟩ + cases e with + | clear i c => exact absurd ⟨i, c, rfl⟩ hcl + | _ => trivial + +/-! ## THEOREM 3: CLEARFORM same-events theorem -/ + +/-- The owned INIT / MOVE / CLEAR events (fields, charts, chronology). -/ +def ownedEv (owned : Reg → Prop) : Ev K Reg C → Prop + | .init i _ => owned i + | .move i _ => owned i + | .clear i _ => owned i + | _ => False + +open Classical in +noncomputable def ownedEvents (owned : Reg → Prop) (es : List (Ev K Reg C)) : List (Ev K Reg C) := + es.filter (fun e => decide (ownedEv owned e)) + +def AllLossless (s : St K Reg C) (es : List (Ev K Reg C)) : Prop := + ∀ pre post i c, es = pre ++ .clear i c :: post → Lossless (run s pre) i + +/-- `owned_erasure` split into (a) the contract clauses E1-E3 (allocation, chronology, volume), +which are a predicate `Sk` of the owned-event skeleton ONLY (assumed, not proved here), and +(b) lossless dirty content, which is the only content-dependent part. -/ +def ErasureOK (Sk : List (Ev K Reg C) → Prop) (owned : Reg → Prop) (s : St K Reg C) + (es : List (Ev K Reg C)) : Prop := + Sk (ownedEvents owned es) ∧ AllLossless s es + +theorem clearform (U : Submodule K (Reg → K)) (Sk : List (Ev K Reg C) → Prop) (owned : Reg → Prop) (s : St K Reg C) + (es es' : List (Ev K Reg C)) + (hU : rowSpan s ≤ U) (hnb : ∀ e ∈ es, NoBorn e) (hnb' : ∀ e ∈ es', NoBorn e) + (hend : FullEnd U s es) (hend' : FullEnd U s es') + (hsame : ownedEvents owned es = ownedEvents owned es') : + AllLossless s es ∧ AllLossless s es' ∧ + (ErasureOK Sk owned s es ↔ ErasureOK Sk owned s es') := by + have h1 : AllLossless s es := fun pre post i c h => every_clear_lossless U s es hU hnb hend pre post i c h + have h2 : AllLossless s es' := fun pre post i c h => every_clear_lossless U s es' hU hnb' hend' pre post i c h + refine ⟨h1, h2, ?_⟩ + unfold ErasureOK + rw [hsame] + exact ⟨fun h => ⟨h.1, h2⟩, fun h => ⟨h.1, h1⟩⟩ + +/-! ## Counterexample: "every non-CLEAR event keeps the rank" is false for COPY into a nonzero row -/ + +/-- Two public registers born with rows e_0, e_1. -/ +def s2 : St ℚ (Fin 2) Unit := ⟨fun i => Pi.single i 1, fun _ => some ()⟩ + +/-- COPY 0 <- 1 onto the NONZERO row of register 0 silently erases it: the span loses e_0. +(PROOF.md section 1(a) is right only for COPY into a zero row, which check.py:119-120 enforces.) -/ +theorem copy_nonzero_loses_rank : + (Pi.single 0 1 : Fin 2 → ℚ) ∈ rowSpan s2 ∧ + (Pi.single 0 1 : Fin 2 → ℚ) ∉ rowSpan (step s2 (.copy 0 1 ())) := by + refine ⟨row_mem s2 0, fun h => ?_⟩ + have hle : rowSpan (step s2 (.copy 0 1 ())) ≤ LinearMap.ker (LinearMap.proj (0 : Fin 2) : (Fin 2 → ℚ) →ₗ[ℚ] ℚ) := by + refine Submodule.span_le.mpr ?_ + rintro _ ⟨j, rfl⟩ + fin_cases j <;> simp [step, s2, Function.update_apply, Pi.single_apply] + have := hle h + simp at this + +/-! ## Toy instance in the real certificate format +Public registers 0,1,2 (rows e_0,e_1,e_2); owned register 3 is INITed, receives +`3 += (-1)*0` and `3 += 1*1`, and is CLEARed with certificate {0 : -1, 1 : 1} +(the 2-term shape of e.g. event 127621: {500 : -1, 1072 : 1}). -/ + +def t0 : St ℚ (Fin 4) Unit := + ⟨fun i => if i = 3 then 0 else Pi.single i 1, fun i => if i = 3 then none else some ()⟩ + +def tw : List (Ev ℚ (Fin 4) Unit) := + [.init 3 (), .add 3 0 (-1) (), .add 3 1 1 (), .clear 3 ()] + +noncomputable def tcert : ℕ → Option (Fin 4 →₀ ℚ) := + fun n => if n = 3 then some (Finsupp.single 0 (-1) + Finsupp.single 1 1) else none + +/-- Input space U = span of the three public inputs. -/ +def tU : Submodule ℚ (Fin 4 → ℚ) := rowSpan t0 + +theorem toy_certified : GoodRun t0 tw ∧ Certified t0 tw tcert := by + refine ⟨?_, ?_⟩ + · simp [GoodRun, Good, tw, step, t0, run, Function.update_apply] + · refine ⟨trivial, trivial, trivial, ⟨Finsupp.single 0 (-1) + Finsupp.single 1 1, + by simp [tcert], ?_, ?_⟩, trivial⟩ + · intro k hk + have := Finsupp.support_add hk + simp at this + rcases this with h | h <;> simp [h, step, t0, Function.update_apply] + · rw [map_add, Finsupp.linearCombination_single, Finsupp.linearCombination_single] + ext k + fin_cases k <;> simp [step, t0, Function.update_apply, Pi.single_apply] + +/-- The toy word is endpoint-exact on the input space and its CLEAR is lossless (via the checker). -/ +theorem toy_end : FullEnd tU t0 tw ∧ + ∀ pre post i c, tw = pre ++ .clear i c :: post → Lossless (run t0 pre) i := + checker_sound tU t0 tw tcert le_rfl le_rfl toy_certified.1 toy_certified.2 + +end ClearCert + +open ClearCert in +#print axioms span_step_le +open ClearCert in +#print axioms span_step_ge +open ClearCert in +#print axioms lossless_iff +open ClearCert in +#print axioms every_clear_lossless +open ClearCert in +#print axioms finrank_clear_le +open ClearCert in +#print axioms certOK_lossless +open ClearCert in +#print axioms lossless_certOK +open ClearCert in +#print axioms checker_sound +open ClearCert in +#print axioms checker_complete +open ClearCert in +#print axioms legal_congr +open ClearCert in +#print axioms clearform +open ClearCert in +#print axioms copy_nonzero_loses_rank +open ClearCert in +#print axioms toy_end diff --git a/research/p104-lean-premises/lean/Nov15/ClearCert.md b/research/p104-lean-premises/lean/Nov15/ClearCert.md new file mode 100644 index 0000000000..ebd78e6fec --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/ClearCert.md @@ -0,0 +1,20 @@ +# ClearCert.lean: CLEAR certificates / CLEARFORM on the TokenCancel row model +Kernel-only, no sorry, no native_decide, 13 `#print axioms` within [propext, Classical.choice, Quot.sound]. 8-9 s, 1.9 GB. Imports Nov15.TokenCancel (St, Ev, step, run, LegalEv, Legal). Source: the CLEARFORM argument and `verify_certificates` of the #7630 checker (read as data). + +## Model +Rows are in initial-row coordinates (`Reg -> K`). `rowSpan s` = span of all rows (zero rows add nothing, a cleared register keeps a zero row). `Lossless s i` = row i is in the span of the other rows. Input space U = span of the public inputs; `FullEnd U s es` = the final rows span U. `Good` = what check.py enforces besides legality: no birth in the tail, SCALE unit, ADD between distinct registers, COPY/INIT into a zero row (check.py:119-120, :112). `DeadZero` = never-born registers have zero rows (preserved under legality). + +## Theorems +1. RANK LEMMA. `span_step_le`: any non-birth event only shrinks the span. `span_step_ge`: any good non-CLEAR event preserves it exactly. `span_clear_eq`/`lossless_iff`: CLEAR of i leaves span(others), so lossless iff span unchanged. `finrank_clear_le`: a CLEAR lowers the rank by <= 1. `every_clear_lossless`: if the initial rows lie in U and the final rows span U (endpoint exact), then EVERY CLEAR is lossless. No Legal hypothesis is needed. +2. CHECKER. `Certified s es cs` = every CLEAR at position n has a finitely supported certificate, keys live and != the cleared field, erased row = exact combination (CertOK, mirrors check.py:672-678; `cs` = the JSON `clear_event_index`). `certOK_lossless`: a passing certificate means lossless. `certified_span_ge` + `checker_sound`: a passing checker on a good, birth-free word started from full span gives a full-span endpoint AND every CLEAR lossless (so the check certifies information preservation, not just the single clear). `checker_complete`: an endpoint-exact legal word has certificates at all CLEARs, so the checker rejects nothing it should accept. +3. CLEARFORM. `legal_congr`: legality (chronology/field identity, clause E3) reads only `loc`, never rows. `clearform`: let `ErasureOK Sk owned s es := Sk(owned INIT/MOVE/CLEAR events) /\ AllLossless`. Two endpoint-exact words with the same owned events are both AllLossless, and satisfy ErasureOK together or not at all, whatever they erase. `Sk` is an ARBITRARY predicate of the owned-event skeleton: it stands for E1-E3 (allocation, chronology, volume) and is assumed, not proved. +4. INSTANCES. `toy_certified`/`toy_end`: a 4-register word in the real certificate shape (2-term cert {0:-1,1:1}, like event 127621 {500:-1,1072:1}), checked in the kernel and fed through `checker_sound`. The 180 real certificates are NOT replayed: that needs the 208,738-event word (too big for the kernel, no native_decide). They enter as the hypothesis `Certified W0 W certs` with W, certs = the #7630 word file and its clear-certificate file; the checker `certificates` mode prints PASS_CERTIFICATES_ON_7623 for it. Fidelity of `Certified` to check.py is by reading, not proved. + +## Paper statement corrected (said at once) +The CLEARFORM note, section 1(a): "COPY into a zero owned row ... rho unchanged" is right only for a ZERO target. `copy_nonzero_loses_rank` (Lean, over Q): in two public registers, COPY 0 <- 1 drops e_0 from the span. check.py enforces the zero-target condition, so the words are fine, but "every event except CLEAR keeps the rank" is false as stated without it. The headline lemma survives (the span never grows; `span_step_le` needs only non-birth). Also "lossless is implied by correctness" needs endpoint exactness at the span level over U, not over all registers: with owned coordinates in the row space the target is U, not the whole space. + +## What is still ASSUMED (and how much of `owned_erasure` this narrows) +- Narrowed: the "dirty content" sub-condition of the clear-form gap (Q1). Content is not a premise: losslessness follows from endpoint exactness, and the certificate check is sound and complete for it. Sk-equal words are interchangeable. +- Still assumed: the erasure SERVICE (E1-E3 allocation/chronology/volume as `Sk`, E4 linear cost, E5 paid non-reversible erase, E6 dirty residuals counted via earlier ADD reads). E4-E6 are not even expressible in the row model. That is roughly the cost/permission half; the Lean work covers the content half only. +- Model scope: INIT after CLEAR of the same name is renamed to a fresh register (TokenCancel has no loc reset on clear); MOVEs and charts are only used through TokenCancel legality (the extra z/V move conditions only strengthen `Legal`). Scalar projection of the arbitrary-array statement is the compiler-proof reduction (assumed). Rows over Q (checker uses exact Fractions). +- Not done: replay of the 180 real certificates, and the cost-invariance (E2/E4) side of CLEARFORM, which would need the cost model. diff --git a/research/p104-lean-premises/lean/Nov15/CongestionI3.lean b/research/p104-lean-premises/lean/Nov15/CongestionI3.lean new file mode 100644 index 0000000000..3088163ca8 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CongestionI3.md b/research/p104-lean-premises/lean/Nov15/CongestionI3.md new file mode 100644 index 0000000000..f4043c17df --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CongestionI3Cfg.lean b/research/p104-lean-premises/lean/Nov15/CongestionI3Cfg.lean new file mode 100644 index 0000000000..4d50ff918d --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CongestionI3Data.lean b/research/p104-lean-premises/lean/Nov15/CongestionI3Data.lean new file mode 100644 index 0000000000..4f0921cc87 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CongestionI3Mu.lean b/research/p104-lean-premises/lean/Nov15/CongestionI3Mu.lean new file mode 100644 index 0000000000..b64a8e7023 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CongestionI3NumA.lean b/research/p104-lean-premises/lean/Nov15/CongestionI3NumA.lean new file mode 100644 index 0000000000..f31be96ce8 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CongestionI3NumC1.lean b/research/p104-lean-premises/lean/Nov15/CongestionI3NumC1.lean new file mode 100644 index 0000000000..2533bd0108 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CongestionI3NumC2.lean b/research/p104-lean-premises/lean/Nov15/CongestionI3NumC2.lean new file mode 100644 index 0000000000..00254cf788 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CongestionI3NumC3.lean b/research/p104-lean-premises/lean/Nov15/CongestionI3NumC3.lean new file mode 100644 index 0000000000..ddb23f0913 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/CongestionI3NumC4.lean b/research/p104-lean-premises/lean/Nov15/CongestionI3NumC4.lean new file mode 100644 index 0000000000..b6b5c40c1d --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/Delivery.lean b/research/p104-lean-premises/lean/Nov15/Delivery.lean new file mode 100644 index 0000000000..fc69c24e8b --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Delivery.lean @@ -0,0 +1,319 @@ +/- +Delivery . See Delivery.md. Structural lemmas of internal notes, D3.md, D5.md. + + 1. TWO-STOP (algebra, from TokenCancel.T2_corrected): a single contact delivers nothing; a courier whose row does not + change between its contacts with t delivers nothing; delivery needs >= 2 contacts with DIFFERENT rows. + (price, from CallerCost.fL = r ln r and FibreK.d0_native): a courier with three genuine hops pays + f(d) - f(d-2) >= f(3); the C-type (1,7,1) route pays exactly f(9) - f(7). A zero-gap hop breaks ">= f(3)". + 2. ENTRY RANK / DIRECT-READ CAPACITY (from Annihilator): single hop A -> L serves <= dim A - dim L ports of an + orthonormal group; any number of hops: <= descending owned rank; the >= N - R remaining ports are not sparse. + 3. TIME-ORDER (charts only ascend): after a register sits at a chart containing u_a it never meets Y_a again; so a + carrier delivering x_b to Y_a picked x_b up strictly BEFORE the read. +Kernel only: no sorry, no native_decide. +-/ +import Nov15.TokenCancel +import Nov15.FibreK +import Nov15.Annihilator +import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog +import Mathlib.Analysis.Complex.ExponentialBounds + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace Delivery +open CallerCost + +/-! ## 1a. TWO-STOP, algebra -/ +section TwoStop +open TokenCancel +variable {K Reg : Type*} [Field K] [DecidableEq Reg] + +/-- a single contact (at most one entry in `contacts`) delivers nothing net. -/ +theorem single_contact_null (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) (hlen : (contacts ops).length ≤ 1) : + (yRun (y0, 0, 0) ops).2.1 = 0 := by + obtain ⟨h1, h2, -⟩ := T2_corrected k ops y0 hy0 hK hO hfin 0 + rw [h2] + rcases hc : contacts ops with _ | ⟨p, _ | ⟨q, l⟩⟩ + · simp + · rw [hc] at h1; simp at h1; simp [h1] + · rw [hc] at hlen; simp at hlen + +/-- delivery needs at least two contacts. -/ +theorem two_contacts_needed (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) (hrec : (yRun (y0, 0, 0) ops).2.1 ≠ 0) : + 2 ≤ (contacts ops).length := by + by_contra h + exact hrec (single_contact_null k ops y0 hy0 hK hO hfin (by omega)) + +/-- a courier whose row (at the contacts) never changes delivers nothing: the rows must DIFFER somewhere. -/ +theorem const_rows_null (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) (hrows : ∀ p ∈ contacts ops, p.2 = r1) : + (yRun (y0, 0, 0) ops).2.1 = 0 := by + obtain ⟨-, -, h3⟩ := T2_corrected k ops y0 hy0 hK hO hfin r1 + rw [h3] + have : ∀ l : List (K × (Reg → K)), (∀ p ∈ l, p.2 = r1) → (l.map fun p => p.1 • (p.2 - r1)).sum = 0 := by + intro l; induction l with + | nil => intro _; simp + | cons p l ih => + intro h + simp only [List.map_cons, List.sum_cons] + rw [h p List.mem_cons_self, ih (fun q hq => h q (List.mem_cons_of_mem _ hq))]; simp + exact this _ hrows + +/-- tightness: two contacts with different rows deliver a nonzero net (over ℚ, k = 0, content v = 1). -/ +theorem two_contacts_suffice : + let r1 : Fin 2 → ℚ := ![1, 0] + let r2 : Fin 2 → ℚ := ![1, 1] + let ops : List (YOp ℚ (Fin 2)) := [.addK 1 r1, .addK (-1) r2] + (yRun ((0 : Fin 2 → ℚ), 0, 0) ops).1 0 = 0 ∧ (yRun ((0 : Fin 2 → ℚ), 0, 0) ops).2.1 ≠ 0 := by + refine ⟨?_, ?_⟩ + · simp [yRun, yStep] + · intro h + have := congrFun h 1 + simp [yRun, yStep] at this +end TwoStop + +/-! ## 1b. TWO-STOP, price: three genuine hops cost f(d) - f(d-2) >= f(3) -/ +section Price +open FibreK + +/-- f x = x log x on ℝ (CallerCost.fL on ℕ). -/ +noncomputable def ff (x : ℝ) : ℝ := x * Real.log x + +theorem fL_eq (n : ℕ) : fL n = ff n := rfl + +/-- convexity: increments of f over a fixed length h grow with the base point. -/ +theorem inc (x y h : ℝ) (hx : 0 ≤ x) (hxy : x ≤ y) (hh : 0 ≤ h) : + ff (x + h) - ff x ≤ ff (y + h) - ff y := by + rcases eq_or_lt_of_le hh with rfl | hpos + · simp + have hD : 0 < y + h - x := by linarith + have hs0 : 0 ≤ h / (y + h - x) := by positivity + have hs1 : h / (y + h - x) ≤ 1 := by rw [div_le_one hD]; linarith + set s := h / (y + h - x) with hs + have hsD : s * (y + h - x) = h := by rw [hs]; field_simp + have c := Real.convexOn_mul_log + have mx : x ∈ Set.Ici (0 : ℝ) := hx + have my : y + h ∈ Set.Ici (0 : ℝ) := by show 0 ≤ y + h; linarith + have h1 := c.2 mx my (by linarith : (0:ℝ) ≤ 1 - s) hs0 (by ring : (1 - s) + s = 1) + have h2 := c.2 mx my hs0 (by linarith : (0:ℝ) ≤ 1 - s) (by ring : s + (1 - s) = 1) + have e1 : (1 - s) • x + s • (y + h) = x + h := by simp only [smul_eq_mul]; nlinarith + have e2 : s • x + (1 - s) • (y + h) = y := by simp only [smul_eq_mul]; nlinarith + rw [e1] at h1 + rw [e2] at h2 + simp only [smul_eq_mul] at h1 h2 + show ff (x + h) - ff x ≤ ff (y + h) - ff y + unfold ff + nlinarith + +theorem ff_one : ff 1 = 0 := by simp [ff] +theorem fL_one : fL 1 = 0 := by simp [fL] +theorem fL_zero : fL 0 = 0 := by simp [fL] + +/-- two positive gaps never beat one gap that is one shorter: f(a+1) + f(b+1) <= f(a+b+1). -/ +theorem two_gaps (a b : ℕ) : fL (a + 1) + fL (b + 1) ≤ fL (a + b + 1) := by + have := inc 1 ((b : ℝ) + 1) (a : ℝ) (by norm_num) (by linarith [(Nat.cast_nonneg b : (0:ℝ) ≤ b)]) + (Nat.cast_nonneg a) + rw [ff_one] at this + simp only [fL_eq] + push_cast + have e1 : ((1 : ℝ) + a) = (a : ℝ) + 1 := by ring + have e2 : (b : ℝ) + 1 + a = (a : ℝ) + b + 1 := by ring + rw [e1, e2] at this + linarith + +theorem three_gaps (a b c : ℕ) : fL (a + 1) + fL (b + 1) + fL (c + 1) ≤ fL (a + b + c + 1) := by + have h1 := two_gaps a b + have h2 := two_gaps (a + b) c + have e : a + b + 1 = a + b + 1 := rfl + have : fL (a + b + 1) + fL (c + 1) ≤ fL (a + b + c + 1) := h2 + linarith + +/-- the increment f(n+3) - f(n+1) is at least f(3) (f(1) = 0). -/ +theorem step2_ge (n : ℕ) : fL 3 ≤ fL (n + 3) - fL (n + 1) := by + have := inc 1 ((n : ℝ) + 1) 2 (by norm_num) (by linarith [(Nat.cast_nonneg n : (0:ℝ) ≤ n)]) (by norm_num) + rw [ff_one] at this + simp only [fL_eq] + push_cast + have e1 : ((1 : ℝ) + 2) = 3 := by norm_num + have e2 : (n : ℝ) + 1 + 2 = (n : ℝ) + 3 := by ring + rw [e1, e2] at this + linarith + +/-- per-helper D0 term of FibreK.d0_native. -/ +noncomputable def courierD0 (h : Helper) : ℝ := fL (h.e - h.b) - (h.steps.map fun s => fL (gap s)).sum + +theorem steps_sum (h : Helper) : (h.steps.map fun s => fL (gap s)).sum = ((h.steps.map gap).map fL).sum := by + rw [List.map_map]; rfl + +/-- **TWO-STOP price.** A courier with >= 2 stops has >= 3 hops (birth -> s1 -> s2 -> end). If all three hops are +genuine (gap >= 1) and the route climbs by their total d = e - b, its D0 is >= f(d) - f(d-2) >= f(3). -/ +theorem three_hop_cost (h : Helper) (a b c : ℕ) (hs : h.steps.map gap = [a + 1, b + 1, c + 1]) + (hd : h.e - h.b = a + b + c + 3) : + fL (a + b + c + 3) - fL (a + b + c + 1) ≤ courierD0 h ∧ fL 3 ≤ courierD0 h := by + have hsum : (h.steps.map fun s => fL (gap s)).sum = fL (a + 1) + fL (b + 1) + fL (c + 1) := by + rw [steps_sum, hs]; simp; ring + have h3 := three_gaps a b c + have h2 := step2_ge (a + b + c) + unfold courierD0 + rw [hsum, hd] + constructor <;> linarith + +/-- the C-type route: gaps (1, n+1, 1) (pickup at dim 1, delivery at dim n+2, ...) pays EXACTLY f(n+3) - f(n+1); +n = 6 is the C-type (0 -> 1 -> 8 -> 9): f(9) - f(7). -/ +theorem ctype_cost (h : Helper) (n : ℕ) (hs : h.steps.map gap = [1, n + 1, 1]) (hd : h.e - h.b = n + 3) : + courierD0 h = fL (n + 3) - fL (n + 1) := by + have hsum : (h.steps.map fun s => fL (gap s)).sum = fL (n + 1) := by + rw [steps_sum, hs]; simp [fL_one] + unfold courierD0 + rw [hsum, hd] + +/-- equality in `three_hop_cost` iff the gaps are (1, d-2, 1) up to order is NOT claimed; but d = 3, gaps (1,1,1): cost = f(3). -/ +theorem unit_hops_cost (h : Helper) (hs : h.steps.map gap = [1, 1, 1]) (hd : h.e - h.b = 3) : + courierD0 h = fL 3 := by + have := ctype_cost h 0 (by simpa using hs) (by simpa using hd) + simpa [fL_one] using this + +/-- f(3) = 3 log 3 > 3 (numerically 3.2958 [C]). -/ +theorem fL_three_gt : 3 < fL 3 := by + have h : (1 : ℝ) < Real.log 3 := by + rw [Real.lt_log_iff_exp_lt (by norm_num)] + have := Real.exp_one_lt_d9 + linarith + simp only [fL]; push_cast; linarith + +/-- **WORDING FIX.** The step "f(d) - max over three-way splits of Σ f >= f(3)" is false once a split may have a ZERO +part (birth or end sitting AT a stop): the courier 0 -> 8 -> 9 -> 9 (gaps 8, 1, 0, d = 9) has D0 = f(9) - f(8) < f(3) +(3.14 < 3.30). With three genuine hops it is `three_hop_cost`. -/ +theorem zero_gap_counterexample : + ∃ h : Helper, h.e - h.b = 9 ∧ h.steps.map gap = [8, 1, 0] ∧ courierD0 h < fL 3 := by + refine ⟨⟨0, 9, [(0, 8), (8, 9), (9, 9)]⟩, by simp, by simp [gap], ?_⟩ + have hsum : (([(0, 8), (8, 9), (9, 9)] : List (ℕ × ℕ)).map fun s => fL (gap s)).sum = fL 8 + fL 1 + fL 0 := by + simp [gap]; ring + unfold courierD0 + show fL (9 - 0) - _ < _ + rw [hsum, fL_one, fL_zero] + have l9 : Real.log 9 = 2 * Real.log 3 := by + rw [show (9 : ℝ) = 3 ^ 2 by norm_num, Real.log_pow]; norm_num + have l8 : Real.log 8 = 3 * Real.log 2 := by + rw [show (8 : ℝ) = 2 ^ 3 by norm_num, Real.log_pow]; norm_num + have key : 5 * Real.log 3 < 8 * Real.log 2 := by + have h1 : Real.log 243 < Real.log 256 := Real.log_lt_log (by norm_num) (by norm_num) + have h243 : Real.log 243 = 5 * Real.log 3 := by + rw [show (243 : ℝ) = 3 ^ 5 by norm_num, Real.log_pow]; norm_num + have h256 : Real.log 256 = 8 * Real.log 2 := by + rw [show (256 : ℝ) = 2 ^ 8 by norm_num, Real.log_pow]; norm_num + linarith + simp only [fL] + push_cast + rw [l9, l8] + linarith +end Price + +/-! ## 2. ENTRY RANK and DIRECT-READ CAPACITY -/ +section Entry +open Annihilator Module +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] [FiniteDimensional K V] + +/-- single owned MOVE A -> L as a lineage. -/ +def oneHop (A L : Submodule K V) : Lineage K V := ⟨1, fun i => if i = 0 then A else L, fun _ => Kind.own⟩ + +theorem oneHop_legal (A L : Submodule K V) (h : L ≤ A) : (oneHop A L).Legal := by + intro i hi + have hn : (oneHop A L).n = 1 := rfl + have : i = 0 := by omega + subst this + show (oneHop A L).c 1 ≤ (oneHop A L).c 0 ∨ _ + left; simpa [oneHop] using h + +theorem oneHop_rank (A L : Submodule K V) : (oneHop A L).ownRank = finrank K A - finrank K L := by + simp [Lineage.ownRank, oneHop] + rfl + +/-- **DIRECT-READ CAPACITY / ENTRY RANK (single hop).** An entry A -> L (L ≤ A) whose group G of ports reads X_b +directly (u_b ∈ A for b ∈ G), whose worlds contain L (φ_a vanishes on L), and whose Gram block is the identity +(orthonormal group) serves |G| <= dim A - dim L. -/ +theorem direct_read_capacity {P : Type*} [Fintype P] [DecidableEq P] (A L : Submodule K V) (hLA : L ≤ A) + (φ : P → Module.Dual K V) (u : P → V) (hu : ∀ b, u b ∈ A) (hφ : ∀ a, ∀ x ∈ L, φ a x = 0) + (hG : ∀ a a', φ a (u a') = if a = a' then 1 else 0) : + Fintype.card P ≤ finrank K A - finrank K L := by + classical + let D : Delivery K V P P := + { L := oneHop A L, φ := φ, u := u, start := hu, leafIdx := fun _ => 1, leaf_le := fun _ => le_rfl, + leaf := fun a x hx => hφ a x (by simpa [oneHop] using hx) } + have := sparse_serves_le D (oneHop_legal A L hLA) id Function.injective_id hG + rwa [oneHop_rank] at this + +/-- **ENTRY RANK, any number of hops** (ANNIHILATOR corollary): the owned descending rank of the lineage bounds the +ports of an orthonormal group, however many hops. -/ +theorem entry_rank_multihop {P S : Type*} [Fintype P] [Fintype S] [DecidableEq P] [DecidableEq S] + (D : Delivery K V P S) (hL : D.L.Legal) (ι : P → S) (hι : Function.Injective ι) + (hG : ∀ a a', D.φ a (D.u (ι a')) = if a = a' then 1 else 0) : + Fintype.card P ≤ D.L.ownRank := sparse_serves_le D hL ι hι hG + +/-- **CAPACITY ceiling.** Entries are disjoint in MOVEs, so the ports served by sparse groups total <= R +(R = word's descending owned rank; R = 56 on S22 by Theorem K + [C d3p], not proved here); the other N - served ports +need dense entries. (D3: N = 104, R = 56 gives >= 48.) -/ +theorem dense_needed {ι : Type*} (s : Finset ι) (card rk : ι → ℕ) (R N : ℕ) + (hc : ∀ i ∈ s, card i ≤ rk i) (hR : ∑ i ∈ s, rk i ≤ R) (hN : ∑ i ∈ s, card i ≤ N) : + N - R ≤ N - ∑ i ∈ s, card i := by + have := total_sparse_le s card rk R hc hR + omega + +theorem numbers_104_56 : 104 - 56 = 48 := by norm_num +end Entry + +/-! ## 3. TIME-ORDER -/ +section TimeOrder +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] + +/-- Setup: public registers' charts only ASCEND (`Monotone`). Y_a lives in worlds on which φ vanishes, and φ u ≠ 0 +(u = u_a, φ = (· u_a); orthonormal: φ u = 1). X_b read by an owned register at time r at a chart containing u. -/ +theorem never_meet_after_read (u : V) (φ : Module.Dual K V) (hφu : φ u ≠ 0) + (cx cy : ℕ → Submodule K V) (hx : Monotone cx) (hy : ∀ t, ∀ v ∈ cy t, φ v = 0) + (r : ℕ) (hr : u ∈ cx r) : ∀ t, r ≤ t → cx t ≠ cy t := by + intro t ht heq + have : u ∈ cx t := hx ht hr + rw [heq] at this + exact hφu (hy t u this) + +/-- **TIME-ORDER.** A carrier (monotone charts `cc`) that picks x_b up from X_b (same chart at time p) and later +(time j ≥ p) meets Y_a (same chart) must have picked up strictly BEFORE the read: p < r. (In fact u ∉ cx p.) -/ +theorem carrier_before_read (u : V) (φ : Module.Dual K V) (hφu : φ u ≠ 0) + (cx cy cc : ℕ → Submodule K V) (hx : Monotone cx) (hc : Monotone cc) (hy : ∀ t, ∀ v ∈ cy t, φ v = 0) + (r : ℕ) (hr : u ∈ cx r) (p j : ℕ) (hpj : p ≤ j) (hpick : cc p = cx p) (hdel : cc j = cy j) : + p < r ∧ u ∉ cx p := by + have hnot : u ∉ cx p := by + intro hu + have h1 : u ∈ cc p := by rw [hpick]; exact hu + have h2 : u ∈ cy j := by rw [← hdel]; exact hc hpj h1 + exact hφu (hy j u h2) + refine ⟨?_, hnot⟩ + by_contra hlt + exact hnot (hx (by omega : r ≤ p) hr) + +/-- Direct meeting is the special case: X_b itself cannot hand x_b to Y_a at or after the read. -/ +theorem direct_after_read_impossible (u : V) (φ : Module.Dual K V) (hφu : φ u ≠ 0) + (cx cy : ℕ → Submodule K V) (hx : Monotone cx) (hy : ∀ t, ∀ v ∈ cy t, φ v = 0) + (r : ℕ) (hr : u ∈ cx r) (t : ℕ) (ht : r ≤ t) : cx t ≠ cy t := + never_meet_after_read u φ hφu cx cy hx hy r hr t ht +end TimeOrder + +end Delivery + +#print axioms Delivery.single_contact_null +#print axioms Delivery.two_contacts_needed +#print axioms Delivery.const_rows_null +#print axioms Delivery.two_contacts_suffice +#print axioms Delivery.three_hop_cost +#print axioms Delivery.ctype_cost +#print axioms Delivery.zero_gap_counterexample +#print axioms Delivery.fL_three_gt +#print axioms Delivery.direct_read_capacity +#print axioms Delivery.entry_rank_multihop +#print axioms Delivery.dense_needed +#print axioms Delivery.carrier_before_read diff --git a/research/p104-lean-premises/lean/Nov15/Delivery.md b/research/p104-lean-premises/lean/Nov15/Delivery.md new file mode 100644 index 0000000000..96a10d39bb --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Delivery.md @@ -0,0 +1,20 @@ +# Delivery : the structural lemmas of delivery D1/D3/D5 in Lean + +`Nov15/Delivery.lean`, Lean 4.33.0-rc1 + Mathlib, kernel only: no `sorry`, no `native_decide`; axioms `[propext, Classical.choice, Quot.sound]` (some only `propext, Quot.sound`). 10 s / 2.9 GB. Reuses TokenCancel (T2_corrected, TokenCancel.lean:394), FibreK (d0_native, FibreK.lean:121; per-helper D0 = f(e-b) - sum f(gap), f = r ln r = CallerCost.fL), Annihilator (annihilator / sparse_serves_le, Annihilator.lean:147/216; its `Lineage.Legal` is the WholeFloorNest nesting rule). (Annihilator.olean was built into .lake/build/lib/lean/Nov15 for the import.) + +## 1. TWO-STOP (D1 sec. 2) +Algebra (`single_contact_null`, `two_contacts_needed`, `const_rows_null`, `two_contacts_suffice`): in T2's setting (t = y starts with e_k-coefficient 0 and ends with 0), a courier with token k delivers net 0 through a single contact, and through any number of contacts whose rows are all equal; delivery of a nonzero net needs >= 2 contacts with DIFFERENT courier rows (so a pickup/shed ADD happens between two meetings with t). Tight: contacts (1, r1), (-1, r2) with r1 = (1,0), r2 = (1,1) deliver (0,-1) (non-vacuity over Q). This is D1's (a)-(d) minus the scale caveat: with SCALEs of t the raw "sum of a = 0" is false (`TokenCancel.T2_literal_false`); the lemmas use effective coefficients. +Price (`three_hop_cost`, `ctype_cost`, `unit_hops_cost`, `fL_three_gt`): >= 2 stops means birth -> s1 -> s2 -> end, three hops. If each hop is genuine (gap >= 1) and the route climbs by the gap total d = e - b, then D0 = f(d) - sum f(g_i) >= f(d) - f(d-2) >= f(3) (proof: convexity of x ln x, `inc`; f(1) = 0; `two_gaps`, `three_gaps`). The C-type (1, 7, 1) route pays EXACTLY f(9) - f(7) (`ctype_cost` with n = 6; 6.154 numeric [C]); (1,1,1) pays f(3) = 3 ln 3 > 3 (3.2958 numeric [C]; Lean proves only > 3). +**WORDING FIX (paper false as written).** D1: "K-cost >= f(d) - max over three-way splits of sum f, which is >= f(3) = 3.30". The first inequality is fine, but the "max over three-way splits" is f(d) (split (d,0,0)) = 0 cost, so "which is >= f(3)" does not follow; it needs three GENUINE hops (all gaps >= 1; birth and end not at a stop chart). Lean counterexample `zero_gap_counterexample`: courier 0 -> 8 -> 9 -> 9 (gaps 8, 1, 0, d = 9), D0 = f(9) - f(8) = 3.139 < f(3) = 3.296 (5 ln 3 < 8 ln 2, i.e. 243 < 256). Corrected: "with three genuine hops D0 >= f(d) - f(d-2) >= f(3); with birth or end on a stop only f(d) - f(d-1) (one genuine hop: 0)". The 3.3 D0 floor per delivery therefore holds for {0}-born V-enders-type couriers, not for any courier whose birth/end chart is a stop. Not formalised: that the courier cannot be born/ended on the pickup/delivery chart in the real word (a verifier fact, not algebra). + +## 2. ENTRY RANK and DIRECT-READ CAPACITY (D1 sec. 2, D3 sec. 1) +* `direct_read_capacity`: single owned MOVE A -> L (L <= A); ports a with u_b in A (direct X reads), phi_a vanishing on L, identity Gram block (orthonormal group) => |G| <= dim A - dim L. TRUE as written (this is D1's "|G| <= dim A - dim L"); via Annihilator with the one-hop lineage `oneHop`. +* `entry_rank_multihop` (= `Annihilator.sparse_serves_le`): any number of hops, |G| <= descending owned rank. D3's correction of D1 ("multi-hop for the 48" mis-scoped) is confirmed. +* `dense_needed`: if sparse groups' ranks total <= R, served ports <= R, so N - R ports (>= 48 for N = 104, R = 56 [R = 56 is Theorem K + C d3p, not proved here]) need dense entries. +* NOT formalised: D1's separate counting statement ENTRY RANK "only 20 owned MOVEs enter any Y world, so <= 20 ports junk-free" (a [C] count 2-6 per port given OWN-Y); the capacity lemma above is the proved content and is stronger in kind (rank, not MOVE count). + +## 3. TIME-ORDER (D1 sec. 2) +`never_meet_after_read`, `direct_after_read_impossible`, `carrier_before_read`. Charts of public registers ascend (`Monotone`); Y_a's worlds are killed by phi = (. u_a) with phi u_a != 0 (orthonormal: 1). If X_b sits at a chart containing u_a at time r (the owned read), then X_b is never at Y_a's chart at any t >= r. A carrier that picks x_b up from X_b at time p and meets Y_a at j >= p has u_a not in X_b's chart at p, hence p < r strictly: it picked up BEFORE the read. D1 TRUE as written; the proof also shows the same for any carrier (not only X_b itself), because carriers ascend too. Hypotheses made explicit: monotone charts of X_b and the carrier; chart equality = co-presence. + +## Not covered +The count 56, the D5 spread census, price of the trie (all [C]); that couriers are {0}-born V-enders; the absolute 3.30 / 6.15 values beyond f(3) > 3 (numerics [C]). diff --git a/research/p104-lean-premises/lean/Nov15/DescentPrice.lean b/research/p104-lean-premises/lean/Nov15/DescentPrice.lean new file mode 100644 index 0000000000..79409ebc8f --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/DescentPrice.lean @@ -0,0 +1,113 @@ +/- +REBUILD-V2 r6 descent price, Source: internal notes §2. +See DescentPrice.md. + +Invoice model (abstract): a register's path is the list of chart dimensions it visits; each MOVE is +paid |Δdim| (both directions). A helper with fixed endpoints S ⊊ F is credited dim F − dim S; an owned +register INITs anywhere for free and is credited nothing. One unit of (paid − credit) costs `w` in S +(w = 17 on P104). +* `paid_eq`: paid = ascent ranks + descent ranks; `tele`: ascents − descents = last − first. +* `helper_identity`: paid − credit = 2·(descent ranks) (the card's identity). +* `owned_identity`: paid − credit = ascents + descents ≥ descents, with equality for a pure descent. +* `helper_price` / `owned_price`: a rank-e descent costs 2e·w (helper) and e·w (owned) in S. +* Data: S 1424 → 1390 for one rank-1 helper descent (w = 17); owned budget Σ ranks 56 ↦ 952. +-/ +import Mathlib.Algebra.Order.Group.Abs +import Mathlib.Algebra.Order.Group.MinMax +import Mathlib.Tactic.Ring +import Mathlib.Tactic.Linarith +import Mathlib.Data.List.Basic + +namespace DescentPrice + +/-- paid ranks of a path of dimensions: Σ |Δ|. -/ +def paid : List ℤ → ℤ + | a :: b :: t => |b - a| + paid (b :: t) + | _ => 0 + +/-- ascent ranks. -/ +def asc : List ℤ → ℤ + | a :: b :: t => max (b - a) 0 + asc (b :: t) + | _ => 0 + +/-- descent ranks. -/ +def desc : List ℤ → ℤ + | a :: b :: t => max (a - b) 0 + desc (b :: t) + | _ => 0 + +lemma abs_split (x : ℤ) : |x| = max x 0 + max (-x) 0 := by + rcases le_total 0 x with h | h + · rw [abs_of_nonneg h, max_eq_left h, max_eq_right (by linarith)]; ring + · rw [abs_of_nonpos h, max_eq_right h, max_eq_left (by linarith)]; ring + +lemma max_sub (x : ℤ) : max x 0 - max (-x) 0 = x := by + rcases le_total 0 x with h | h + · rw [max_eq_left h, max_eq_right (by linarith)]; ring + · rw [max_eq_right h, max_eq_left (by linarith)]; ring + +/-- paid = ascents + descents. -/ +theorem paid_eq : ∀ l : List ℤ, paid l = asc l + desc l + | [] => rfl + | [_] => rfl + | a :: b :: t => by + simp only [paid, asc, desc] + rw [paid_eq (b :: t), abs_split, show a - b = -(b - a) by ring]; ring + +/-- telescoping: ascents − descents = last − first. -/ +theorem tele : ∀ (a : ℤ) (t : List ℤ), asc (a :: t) - desc (a :: t) = (a :: t).getLast (by simp) - a + | a, [] => by simp [asc, desc] + | a, b :: t => by + simp only [asc, desc] + have ih := tele b t + rw [List.getLast_cons (by simp)] + have := max_sub (b - a) + rw [show a - b = -(b - a) by ring] + linarith + +/-- **the card's identity (helper, fixed endpoints).** With credit = dim F − dim S (last − first), +paid − credit = 2·(descent ranks). -/ +theorem helper_identity (a : ℤ) (t : List ℤ) : + paid (a :: t) - ((a :: t).getLast (by simp) - a) = 2 * desc (a :: t) := by + rw [paid_eq, ← tele]; ring + +/-- **owned register** (free INIT, no credit): paid − credit = ascents + descents ≥ descents. -/ +theorem owned_identity (l : List ℤ) : paid l - 0 = asc l + desc l := by rw [paid_eq]; ring + +lemma asc_nonneg : ∀ l : List ℤ, 0 ≤ asc l + | [] => le_rfl + | [_] => le_rfl + | a :: b :: t => by + simp only [asc]; have := asc_nonneg (b :: t); have := le_max_right (b - a) (0:ℤ); linarith + +theorem owned_ge (l : List ℤ) : desc l ≤ paid l := by + rw [paid_eq]; have := asc_nonneg l; linarith + +/-- an owned register can INIT at the top and only descend: then it pays exactly its descents. -/ +theorem owned_pure_descent (l : List ℤ) (h : asc l = 0) : paid l = desc l := by + rw [paid_eq, h, zero_add] + +/-- **S price (invoice model).** S = S₀ − w·(paid − credit). A helper path with fixed endpoints and +descent ranks e costs `2·e·w` in S against the monotone path (descents 0, paid = credit). -/ +theorem helper_price (w S₀ : ℤ) (a : ℤ) (t : List ℤ) (e : ℤ) (he : desc (a :: t) = e) : + S₀ - w * (paid (a :: t) - ((a :: t).getLast (by simp) - a)) = S₀ - 2 * e * w := by + rw [helper_identity, he]; ring + +/-- an owned pure descent of rank e costs `e·w` in S. -/ +theorem owned_price (w S₀ : ℤ) (l : List ℤ) (e : ℤ) (h : asc l = 0) (he : desc l = e) : + S₀ - w * (paid l - 0) = S₀ - e * w := by + rw [sub_zero, owned_pure_descent l h, he]; ring + +/-- example: a helper path 0 → 1 → 0 → 1 → 9 (one rank-1 descent): paid − credit = 2. -/ +example : paid [0, 1, 0, 1, 9] - (9 - 0) = 2 * desc [0, 1, 0, 1, 9] := by decide + +/-! ## Data checks (DESCENT.md §2, §4) -/ + +/-- one rank-1 helper descent on #7623 (w_desc1): S 1424 → 1390 = 1424 − 2·1·17. -/ +example : (1424 : ℤ) - 2 * 1 * 17 = 1390 := by norm_num + +/-- the 24 fixed owned descents of #7623: rank sum 56, S budget 56·17 = 952 (the "56 floor"). -/ +def ownedRanks : List ℤ := [4, 1, 2, 4, 1, 1, 1, 1, 4, 4, 1, 2, 4, 1, 2, 1, 1, 5, 2, 1, 2, 4, 3, 4] + +example : ownedRanks.length = 24 ∧ ownedRanks.sum = 56 ∧ ownedRanks.sum * 17 = 952 := by decide + +end DescentPrice diff --git a/research/p104-lean-premises/lean/Nov15/DescentPrice.md b/research/p104-lean-premises/lean/Nov15/DescentPrice.md new file mode 100644 index 0000000000..07672f9c07 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/DescentPrice.md @@ -0,0 +1,18 @@ +# DescentPrice.lean: rebuild r6 descent price, paid − credit = 2·(descent ranks). No sorry, ~4 s, 1.5 GB RSS +Source: internal notes §2. Self-contained. Axioms: [propext, Classical.choice, Quot.sound]. + +**Invoice model (abstract).** +- A path is the list of chart dimensions a register visits. paid = Σ|Δ|, both directions paid. +- A helper with fixed endpoints S ⊊ F is credited dim F − dim S. An owned register INITs anywhere for free and is credited nothing. +- S = S₀ − w·(paid − credit), with w = 17 on P104. + +**Results.** +- `paid_eq`: paid = ascents + descents. `tele`: ascents − descents = last − first. +- `helper_identity` (the card's identity): paid − credit = 2·(descent ranks). `helper_price`: a rank-e helper descent costs 2e·w in S. +- `owned_identity` / `owned_ge`: for an owned register, paid − credit = ascents + descents ≥ descents. + - `owned_pure_descent` / `owned_price`: INIT at the top and descend, and the price is exactly e·w. +- Data (`decide` / `norm_num`, kernel only): + - 1424 − 2·1·17 = 1390 (w_desc1, one rank-1 helper descent); + - the 24 owned descent ranks of #7623 sum to 56, and 56·17 = 952. + +Nothing false. The κ exchange rates (546.09e, 273.04e D0/call) are first-order [C] and are not formalized. The SPEC/verifier legality reading (§1) is prose. diff --git a/research/p104-lean-premises/lean/Nov15/DesignLaws.lean b/research/p104-lean-premises/lean/Nov15/DesignLaws.lean new file mode 100644 index 0000000000..849d02a9ae --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/DesignLaws.lean @@ -0,0 +1,436 @@ +/- +DesignLaws . See DesignLaws.md. Structural laws of internal notes section 2 / 4: + (1) PCL port content law (2) ONE-READ (3) HYPERPLANE (4) RANK-FEED (5) XCLOSE exactness. +Event model = TokenCancel.St / Ev / step / run / LegalEv (charts := any type, `Submodule K E` for the geometry), +nesting = Annihilator / WholeFloorNest (cited, not needed here). Kernel only: no sorry, no native_decide. +-/ +import Nov15.TokenCancel +import Nov15.Annihilator +import Mathlib.LinearAlgebra.Span.Basic +import Mathlib.LinearAlgebra.Dimension.Finrank +import Mathlib.LinearAlgebra.Dimension.Constructions +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +import Mathlib.LinearAlgebra.Matrix.Rank +import Mathlib.RingTheory.SimpleModule.Basic +import Mathlib.Tactic.LinearCombination + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace DesignLaws +open TokenCancel Module +open scoped Classical + +/-! ## Run bookkeeping -/ +section Run +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] + +theorem run_append (s : St K Reg C) (l1 l2 : List (Ev K Reg C)) : + run s (l1 ++ l2) = run (run s l1) l2 := by + induction l1 generalizing s with + | nil => rfl + | cons e es ih => simp [run, ih] + +theorem legal_append (z V : C) (s : St K Reg C) (l1 l2 : List (Ev K Reg C)) : + Legal z V s (l1 ++ l2) ↔ Legal z V s l1 ∧ Legal z V (run s l1) l2 := by + induction l1 generalizing s with + | nil => simp [Legal, run] + | cons e es ih => simp [Legal, run, ih, and_assoc] + +/-- every MOVE of register `i` satisfies the relation `R old new`. -/ +def MoveRel (R : C → C → Prop) (i : Reg) : St K Reg C → List (Ev K Reg C) → Prop + | _, [] => True + | s, e :: es => (match e with + | .move j c => j = i → ∀ c0, s.loc i = some c0 → R c0 c + | _ => True) ∧ MoveRel R i (step s e) es + +theorem moveRel_append (R : C → C → Prop) (i : Reg) (s : St K Reg C) (l1 l2 : List (Ev K Reg C)) : + MoveRel R i s (l1 ++ l2) ↔ MoveRel R i s l1 ∧ MoveRel R i (run s l1) l2 := by + induction l1 generalizing s with + | nil => simp [MoveRel, run] + | cons e es ih => simp [MoveRel, run, ih, and_assoc] + +/-- a register that is present keeps moving along `R` (reflexive, transitive). -/ +theorem loc_rel (z V : C) (R : C → C → Prop) (hrefl : ∀ a, R a a) (htr : ∀ a b c, R a b → R b c → R a c) + (i : Reg) : ∀ (es : List (Ev K Reg C)) (s : St K Reg C) (a b : C), Legal z V s es → MoveRel R i s es → + s.loc i = some a → (run s es).loc i = some b → R a b := by + intro es + induction es with + | nil => intro s a b _ _ ha hb; simp [run] at hb; rw [ha] at hb; cases hb; exact hrefl _ + | cons e es ih => + intro s a b hL hM ha hb + simp only [Legal] at hL + simp only [MoveRel] at hM + simp only [run] at hb + have hstep : ∃ a', (step s e).loc i = some a' ∧ R a a' := by + cases e with + | born j c => + simp only [LegalEv] at hL + have hne : j ≠ i := by rintro rfl; rw [hL.1] at ha; cases ha + exact ⟨a, by simp [step, Function.update, hne.symm, ha], hrefl _⟩ + | init j c => + simp only [LegalEv] at hL + have hne : j ≠ i := by rintro rfl; rw [hL.1] at ha; cases ha + exact ⟨a, by simp [step, Function.update, hne.symm, ha], hrefl _⟩ + | move j c => + by_cases hji : j = i + · subst hji + exact ⟨c, by simp [step], hM.1 rfl a ha⟩ + · exact ⟨a, by simp [step, Function.update, Ne.symm hji, ha], hrefl _⟩ + | add j k x c => exact ⟨a, by simpa [step] using ha, hrefl _⟩ + | scale j x c => exact ⟨a, by simpa [step] using ha, hrefl _⟩ + | clear j c => exact ⟨a, by simpa [step] using ha, hrefl _⟩ + | copy j k c => exact ⟨a, by simpa [step] using ha, hrefl _⟩ + obtain ⟨a', ha', hr⟩ := hstep + exact htr _ _ _ hr (ih (step s e) a' b hL.2 hM.2 ha' hb) + +end Run + +/-! ## (1) PCL: port content law -/ +section PCL +variable {K E Reg : Type*} [Field K] [AddCommGroup E] [Module K E] [DecidableEq Reg] + +/-- support invariant: a token `b` occurs in a row only at a chart containing its anchor `u b`. -/ +def Supp (u : Reg → E) (s : St K Reg (Submodule K E)) : Prop := + ∀ j b, s.row j b ≠ 0 → ∃ c, s.loc j = some c ∧ u b ∈ c + +/-- Discipline: public births sit at a chart containing their anchor; every MOVE of a PUBLIC register +(`¬ own i`) ascends. -/ +def DiscEv (own : Reg → Prop) (u : Reg → E) (s : St K Reg (Submodule K E)) : Ev K Reg (Submodule K E) → Prop + | .born i c => u i ∈ c + | .move i c => ¬ own i → ∀ c0, s.loc i = some c0 → c0 ≤ c + | _ => True + +def Disc (own : Reg → Prop) (u : Reg → E) : St K Reg (Submodule K E) → List (Ev K Reg (Submodule K E)) → Prop + | _, [] => True + | s, e :: es => DiscEv own u s e ∧ Disc own u (step s e) es + +/-- An OWNED descent: some owned register makes a non-ascending MOVE. -/ +def DescEv (own : Reg → Prop) (s : St K Reg (Submodule K E)) : Ev K Reg (Submodule K E) → Prop + | .move i c => own i ∧ ∃ c0, s.loc i = some c0 ∧ ¬ c0 ≤ c + | _ => False + +def Desc (own : Reg → Prop) : St K Reg (Submodule K E) → List (Ev K Reg (Submodule K E)) → Prop + | _, [] => False + | s, e :: es => DescEv own s e ∨ Desc own (step s e) es + +theorem step_supp (z V : Submodule K E) (own : Reg → Prop) (u : Reg → E) (s : St K Reg (Submodule K E)) + (e : Ev K Reg (Submodule K E)) (hS : Supp u s) (hL : LegalEv z V s e) + (hD : DiscEv own u s e) (hN : ¬ DescEv own s e) : Supp u (step s e) := by + intro j b hb + simp only [DiscEv] at hD + simp only [DescEv] at hN + cases e with + | born i c => + simp only [DiscEv] at hD + by_cases hji : j = i + · subst hji + simp only [step, Function.update_self] at hb + have : b = j := by + by_contra h; apply hb; simp [Pi.single_apply, h] + subst this + exact ⟨c, by simp [step], hD⟩ + · simp only [step, Function.update_of_ne hji] at hb ⊢ + exact hS j b hb + | init i c => + by_cases hji : j = i + · subst hji; simp [step] at hb + · simp only [step, Function.update_of_ne hji] at hb ⊢ + exact hS j b hb + | move i c => + obtain ⟨c', hc', hu⟩ := hS j b hb + by_cases hji : j = i + · subst hji + have hle : c' ≤ c := by + by_cases ho : own j + · by_contra hn; exact hN ⟨ho, c', hc', hn⟩ + · exact hD ho c' hc' + exact ⟨c, by simp [step], hle hu⟩ + · exact ⟨c', by simpa [step, Function.update_of_ne hji] using hc', hu⟩ + | add i k x c => + simp only [LegalEv] at hL + by_cases hji : j = i + · subst hji + simp only [step, Function.update_self, Pi.add_apply, Pi.smul_apply, smul_eq_mul] at hb + refine ⟨c, by simp [step, hL.2.1], ?_⟩ + by_cases h1 : s.row j b = 0 + · have h2 : s.row k b ≠ 0 := by + intro h2; apply hb; simp [h1, h2] + obtain ⟨c2, hc2, hu2⟩ := hS k b h2 + rw [hL.2.2] at hc2; cases hc2; exact hu2 + · obtain ⟨c1, hc1, hu1⟩ := hS j b h1 + rw [hL.2.1] at hc1; cases hc1; exact hu1 + · simp only [step, Function.update_of_ne hji] at hb ⊢ + exact hS j b hb + | scale i x c => + by_cases hji : j = i + · subst hji + simp only [step, Function.update_self, Pi.smul_apply, smul_eq_mul] at hb + have h1 : s.row j b ≠ 0 := fun h => hb (by simp [h]) + obtain ⟨c1, hc1, hu1⟩ := hS j b h1 + exact ⟨c1, by simpa [step] using hc1, hu1⟩ + · simp only [step, Function.update_of_ne hji] at hb ⊢ + exact hS j b hb + | clear i c => + by_cases hji : j = i + · subst hji; simp [step] at hb + · simp only [step, Function.update_of_ne hji] at hb ⊢ + exact hS j b hb + | copy i k c => + simp only [LegalEv] at hL + by_cases hji : j = i + · subst hji + simp only [step, Function.update_self] at hb + obtain ⟨c1, hc1, hu1⟩ := hS k b hb + refine ⟨c, by simp [step, hL.1], ?_⟩ + rw [hL.2] at hc1; cases hc1; exact hu1 + · simp only [step, Function.update_of_ne hji] at hb ⊢ + exact hS j b hb + +theorem supp_run (z V : Submodule K E) (own : Reg → Prop) (u : Reg → E) : + ∀ (es : List (Ev K Reg (Submodule K E))) (s : St K Reg (Submodule K E)), + Supp u s → Legal z V s es → Disc own u s es → ¬ Desc own s es → Supp u (run s es) := by + intro es + induction es with + | nil => intro s hS _ _ _; exact hS + | cons e es ih => + intro s hS hL hD hN + simp only [Legal] at hL + simp only [Disc] at hD + simp only [Desc, not_or] at hN + exact ih (step s e) (step_supp z V own u s e hS hL.1 hD.1 hN.1) hL.2 hD.2 hN.2 + +/-- **PCL (port content law).** Ports `t` carry functionals `φ t` (Φ_t = ker φ t), tokens `b` have anchors `u b`. +If a register `j` ends at a chart inside Φ_t and holds a nonzero coefficient of a token `b` NOT orthogonal to `t` +(`φ t (u b) ≠ 0`; this includes `b = t` when `u t` is non-isotropic), then an OWNED MOVE descended somewhere. -/ +theorem pcl (z V : Submodule K E) (own : Reg → Prop) (u : Reg → E) (φ : Reg → Dual K E) + (es : List (Ev K Reg (Submodule K E))) (s : St K Reg (Submodule K E)) + (h0 : ∀ j b, s.row j b = 0) (hL : Legal z V s es) (hD : Disc own u s es) + (t j b : Reg) (c : Submodule K E) (hc : (run s es).loc j = some c) (hcΦ : c ≤ LinearMap.ker (φ t)) + (hnon : φ t (u b) ≠ 0) (hrow : (run s es).row j b ≠ 0) : Desc own s es := by + by_contra hN + have hS0 : Supp u s := fun j b hb => absurd (h0 j b) hb + obtain ⟨c', hc', hu⟩ := supp_run z V own u es s hS0 hL hD hN j b hrow + rw [hc] at hc'; cases hc' + exact hnon (hcΦ hu) + +/-- Contrapositive form: without an owned descent, every token in a register at a Φ_t chart is orthogonal to `t`. -/ +theorem pcl_orth (z V : Submodule K E) (own : Reg → Prop) (u : Reg → E) (φ : Reg → Dual K E) + (es : List (Ev K Reg (Submodule K E))) (s : St K Reg (Submodule K E)) + (h0 : ∀ j b, s.row j b = 0) (hL : Legal z V s es) (hD : Disc own u s es) (hN : ¬ Desc own s es) + (t j b : Reg) (c : Submodule K E) (hc : (run s es).loc j = some c) (hcΦ : c ≤ LinearMap.ker (φ t)) + (hrow : (run s es).row j b ≠ 0) : φ t (u b) = 0 := by + by_contra h; exact hN (pcl z V own u φ es s h0 hL hD t j b c hc hcΦ h hrow) + +/-- an anchor line can sit inside Φ_t exactly when the token is orthogonal to `t`. -/ +theorem line_le_ker_iff (φt : Dual K E) (x : E) : (K ∙ x) ≤ LinearMap.ker φt ↔ φt x = 0 := by + rw [Submodule.span_singleton_le_iff_mem]; simp + +end PCL + +/-! ## (2) ONE-READ -/ +section OneRead +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] [PartialOrder C] + +/-- ONE-READ. A public register `r` (ascending) and an owned register `o` (DESCENDING lineage) are co-present at the +two read times (after the prefixes `l1` and `l1 ++ l2`). Then the two reads happen at the SAME chart. -/ +theorem one_read (z V : C) (r o : Reg) (s : St K Reg C) (l1 l2 : List (Ev K Reg C)) + (hL : Legal z V s (l1 ++ l2)) + (hr : MoveRel (· ≤ ·) r s (l1 ++ l2)) (ho : MoveRel (fun a b => b ≤ a) o s (l1 ++ l2)) + (c1 c2 : C) + (h1r : (run s l1).loc r = some c1) (h1o : (run s l1).loc o = some c1) + (h2r : (run s (l1 ++ l2)).loc r = some c2) (h2o : (run s (l1 ++ l2)).loc o = some c2) : c1 = c2 := by + rw [legal_append] at hL + rw [moveRel_append] at hr ho + have a1 : c1 ≤ c2 := loc_rel z V (· ≤ ·) (fun a => le_refl a) (fun a b c => le_trans) r l2 _ c1 c2 hL.2 hr.2 h1r + (by rw [← run_append]; exact h2r) + have a2 : c2 ≤ c1 := loc_rel z V (fun a b => b ≤ a) (fun a => le_refl a) (fun a b c h1 h2 => le_trans h2 h1) o l2 _ c1 c2 + hL.2 ho.2 h1o (by rw [← run_append]; exact h2o) + exact le_antisymm a1 a2 + +/-- The DESCENT hypothesis on the owned lineage is necessary: if the owned register may also ASCEND, a public reader +reads it at two different charts (charts := ℕ, ℚ coefficients; legal run, both lineages ascending). -/ +theorem one_read_needs_descent : + ∃ (l1 l2 : List (Ev ℚ (Fin 2) ℕ)), + Legal (K := ℚ) 5 6 (⟨fun _ _ => 0, fun _ => none⟩ : St ℚ (Fin 2) ℕ) (l1 ++ l2) ∧ + MoveRel (· ≤ ·) (0 : Fin 2) (⟨fun _ _ => 0, fun _ => none⟩ : St ℚ (Fin 2) ℕ) (l1 ++ l2) ∧ + MoveRel (· ≤ ·) (1 : Fin 2) (⟨fun _ _ => 0, fun _ => none⟩ : St ℚ (Fin 2) ℕ) (l1 ++ l2) ∧ + (run (⟨fun _ _ => 0, fun _ => none⟩ : St ℚ (Fin 2) ℕ) l1).loc 0 = some 0 ∧ + (run (⟨fun _ _ => 0, fun _ => none⟩ : St ℚ (Fin 2) ℕ) l1).loc 1 = some 0 ∧ + (run (⟨fun _ _ => 0, fun _ => none⟩ : St ℚ (Fin 2) ℕ) (l1 ++ l2)).loc 0 = some 1 ∧ + (run (⟨fun _ _ => 0, fun _ => none⟩ : St ℚ (Fin 2) ℕ) (l1 ++ l2)).loc 1 = some 1 := by + refine ⟨[.born 0 0, .init 1 0, .add 0 1 1 0], [.move 0 1, .move 1 1, .add 0 1 1 1], ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + all_goals simp [Legal, LegalEv, MoveRel, run, step, Function.update] + +end OneRead + +/-! ## (3) HYPERPLANE -/ +section Hyper +variable {K E Reg : Type*} [Field K] [AddCommGroup E] [Module K E] [DecidableEq Reg] + +/-- a nonzero functional has a kernel of codimension 1: Φ_t is a hyperplane (dim 8 when dim E = 9). -/ +theorem finrank_ker_add_one [FiniteDimensional K E] (φ : Dual K E) (hφ : φ ≠ 0) : + finrank K (LinearMap.ker φ) + 1 = finrank K E := by + have hs : Function.Surjective φ := LinearMap.surjective_of_ne_zero hφ + have := LinearMap.finrank_range_add_finrank_ker φ + rw [LinearMap.range_eq_top.mpr hs, finrank_top, Module.finrank_self] at this + omega + +/-- HYPERPLANE (general form): a register whose MOVEs ascend visits at most ONE chart of each dimension `d`. -/ +theorem one_stop_per_dim [FiniteDimensional K E] (z V : Submodule K E) (r : Reg) + (s : St K Reg (Submodule K E)) (l1 l2 : List (Ev K Reg (Submodule K E))) + (hL : Legal z V s (l1 ++ l2)) (hr : MoveRel (· ≤ ·) r s (l1 ++ l2)) + (a b : Submodule K E) (ha : (run s l1).loc r = some a) (hb : (run s (l1 ++ l2)).loc r = some b) + (hd : finrank K a = finrank K b) : a = b := by + rw [legal_append] at hL + rw [moveRel_append] at hr + have hab : a ≤ b := loc_rel z V (· ≤ ·) (fun a => le_refl a) (fun a b c => le_trans) r l2 _ a b hL.2 hr.2 ha + (by rw [← run_append]; exact hb) + exact Submodule.eq_of_le_of_finrank_eq hab hd + +/-- HYPERPLANE (dedicated register): if the hyperplanes Φ_t, Φ_t' are different and of equal dimension, an ascending +register cannot stop at Φ_t and later at Φ_t' (nor, by symmetry, the other order): a delivery at Φ_t uses a +register dedicated to `t`. -/ +theorem hyperplane_dedicated [FiniteDimensional K E] (z V : Submodule K E) (r : Reg) + (s : St K Reg (Submodule K E)) (l1 l2 : List (Ev K Reg (Submodule K E))) + (hL : Legal z V s (l1 ++ l2)) (hr : MoveRel (· ≤ ·) r s (l1 ++ l2)) + (φ φ' : Dual K E) (hne : LinearMap.ker φ ≠ LinearMap.ker φ') (hd : finrank K (LinearMap.ker φ) = finrank K (LinearMap.ker φ')) + (ha : (run s l1).loc r = some (LinearMap.ker φ)) (hb : (run s (l1 ++ l2)).loc r = some (LinearMap.ker φ')) : False := + hne (one_stop_per_dim z V r s l1 l2 hL hr _ _ ha hb hd) + +end Hyper + +/-! ## (4) RANK-FEED -/ +section RankFeed +variable {K P : Type*} [Field K] [Fintype P] [DecidableEq P] + +/-- RANK-FEED (general "≥ N − s"). `O t : P → K` = owned-routed content of port `t` (a vector over tokens), all in the +span `W` of the owned states ever read (`s = finrank W`). Content is exact on `N_t = {t} ∪ non-orth(t)`: +`O t b = δ_{tb}` there (`Orth t b` = tokens `t`, `b` orthogonal). Then at most `s` ports have an exact owned content +(no residue); the other ≥ N − s ports have an orthogonal residue `b ≠ t`, `Orth t b`, `O t b ≠ 0`, to be fed/cancelled. -/ +theorem rank_feed (Orth : P → P → Prop) (W : Submodule K (P → K)) (O : P → P → K) + (hW : ∀ t, O t ∈ W) (hNt : ∀ t b, (b = t ∨ ¬ Orth t b) → O t b = if b = t then 1 else 0) : + Fintype.card P ≤ finrank K W + (Finset.univ.filter fun t => ∃ b, b ≠ t ∧ Orth t b ∧ O t b ≠ 0).card := by + set F := Finset.univ.filter fun t => ∃ b, b ≠ t ∧ Orth t b ∧ O t b ≠ 0 with hF + set Z := Finset.univ.filter fun t => ¬ ∃ b, b ≠ t ∧ Orth t b ∧ O t b ≠ 0 with hZ + have hcard : Z.card + F.card = Fintype.card P := by + rw [hZ, hF, add_comm, Finset.card_filter_add_card_filter_not] + exact Finset.card_univ + have hZO : ∀ t ∈ Z, O t = Pi.single t 1 := by + intro t ht + simp only [hZ, Finset.mem_filter, Finset.mem_univ, true_and, not_exists, not_and] at ht + funext b + by_cases hb : b = t + · subst hb; rw [hNt b b (Or.inl rfl)]; simp + · by_cases ho : Orth t b + · have := ht b hb ho; push Not at this; simp [hb, this] + · rw [hNt t b (Or.inr ho)]; simp [hb] + have hli : LinearIndependent K (fun t : Z => (Pi.single (t : P) (1 : K) : P → K)) := + by + have := (Pi.basisFun K P).linearIndependent.comp (fun t : Z => (t : P)) Subtype.val_injective + convert this using 1 + funext t; simp [Pi.basisFun_apply] + have hle : Submodule.span K (Set.range fun t : Z => (Pi.single (t : P) (1 : K) : P → K)) ≤ W := by + apply Submodule.span_le.mpr + rintro _ ⟨t, rfl⟩ + show (Pi.single (t : P) (1 : K) : P → K) ∈ W + rw [← hZO t t.2]; exact hW t + have := Submodule.finrank_mono hle + rw [finrank_span_eq_card hli] at this + simp only [Fintype.card_coe] at this + omega + +end RankFeed + +section RankFeedExtra +variable {K P : Type*} [Field K] [Fintype P] [DecidableEq P] + +/-- `rank_feed` with the residue set given as any finset `F` with the right membership. -/ +theorem rank_feed' (Orth : P → P → Prop) (W : Submodule K (P → K)) (O : P → P → K) + (hW : ∀ t, O t ∈ W) (hNt : ∀ t b, (b = t ∨ ¬ Orth t b) → O t b = if b = t then 1 else 0) + (F : Finset P) (hF : ∀ t, t ∈ F ↔ ∃ b, b ≠ t ∧ Orth t b ∧ O t b ≠ 0) : + Fintype.card P ≤ finrank K W + F.card := by + have h := rank_feed Orth W O hW hNt + have : (Finset.univ.filter fun t => ∃ b, b ≠ t ∧ Orth t b ∧ O t b ≠ 0) = F := by + ext t; simp [hF] + rwa [this] at h + +/-- `rank (I + J) ≤ s` in matrix form: the matrix with columns `O t` has rank ≤ dim W. -/ +theorem matrix_rank_le (W : Submodule K (P → K)) (O : P → P → K) (hW : ∀ t, O t ∈ W) : + (Matrix.of fun b t => O t b).rank ≤ finrank K W := by + rw [Matrix.rank_eq_finrank_span_cols] + apply Submodule.finrank_mono + apply Submodule.span_le.mpr + rintro _ ⟨t, rfl⟩ + exact hW t + +/-- st1 instance (REBUILDKIT/core/RC5.md gate 1): N = 104 ports, s = 96 read owned-state rank ⇒ ≥ 8 ports with residue. -/ +theorem rank_feed_st1 (Orth : Fin 104 → Fin 104 → Prop) (W : Submodule K (Fin 104 → K)) (O : Fin 104 → Fin 104 → K) + (hW : ∀ t, O t ∈ W) (hNt : ∀ t b, (b = t ∨ ¬ Orth t b) → O t b = if b = t then 1 else 0) + (hs : finrank K W = 96) : + 8 ≤ (Finset.univ.filter fun t => ∃ b, b ≠ t ∧ Orth t b ∧ O t b ≠ 0).card := by + have := rank_feed' Orth W O hW hNt (Finset.univ.filter fun t => ∃ b, b ≠ t ∧ Orth t b ∧ O t b ≠ 0) + (by intro t; simp) + simp only [Fintype.card_fin, hs] at this + omega + +end RankFeedExtra + +/-! ## (5) XCLOSE exactness -/ +section XClose +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] + +/-- **XCLOSE.** Closer `x = X_σ(t)` and `y = Y_t` are both at the dim-8 stop `Φ_t` (legal co-presence). X's row is +`λ e_σ + g` (λ ≠ 0: its own token plus the gathered correction `g`, σ-free). One ADD `y += a x`: the σ-coefficient of Y +becomes `y_σ + aλ` (own token cancelled iff a = -y_σ/λ), every other coordinate receives exactly `a·g` (the delivered +correction), nothing else changes. -/ +theorem xclose_add (s : St K Reg C) (y x σ : Reg) (c : C) (a lam : K) (g : Reg → K) + (hx : s.row x = lam • Pi.single σ (1 : K) + g) (hg : g σ = 0) : + (step s (.add y x a c)).row y σ = s.row y σ + a * lam ∧ + (∀ b, b ≠ σ → (step s (.add y x a c)).row y b = s.row y b + a * g b) ∧ + (∀ j, j ≠ y → (step s (.add y x a c)).row j = s.row j) ∧ + (step s (.add y x a c)).loc = s.loc := by + refine ⟨?_, ?_, ?_, rfl⟩ + · simp [step, hx, hg] + · intro b hb; simp [step, hx, Pi.single_apply, hb] + · intro j hj; simp [step, Function.update_of_ne hj] + +/-- Exactness: if Y's pre-close row is `τ + k · (X's row)` with τ σ-free (X's token is not part of the target), then the +single ADD with `a = -k` yields exactly τ, and `a = -k` is the only coefficient that does (legal when both sit at `c`). -/ +theorem xclose_exact (z V : C) (s : St K Reg C) (y x σ : Reg) (c : C) (hyx : y ≠ x) + (hy : s.loc y = some c) (hxl : s.loc x = some c) (lam : K) (hlam : lam ≠ 0) (g : Reg → K) + (hx : s.row x = lam • Pi.single σ (1 : K) + g) (hg : g σ = 0) + (τ : Reg → K) (hτ : τ σ = 0) (k : K) (hrow : s.row y = τ + k • s.row x) : + LegalEv z V s (.add y x (-k) c) ∧ (step s (.add y x (-k) c)).row y = τ ∧ + ∀ a, (step s (.add y x a c)).row y = τ → a = -k := by + refine ⟨⟨hyx, hy, hxl⟩, ?_, ?_⟩ + · simp [step, hrow] + · intro a ha + have h1 := (xclose_add s y x σ c a lam g hx hg).1 + have h2 : s.row y σ = τ σ + k * lam := by + have := congrFun hrow σ + simp [hx, hg] at this + simpa using this + have h3 : (step s (.add y x a c)).row y σ = τ σ := by rw [ha] + have : (a + k) * lam = 0 := by + rw [h3, h2] at h1 + linear_combination -h1 + rcases mul_eq_zero.mp this with h | h + · linear_combination h + · exact absurd h hlam + +end XClose + +end DesignLaws + +#print axioms DesignLaws.pcl +#print axioms DesignLaws.supp_run +#print axioms DesignLaws.one_read +#print axioms DesignLaws.one_read_needs_descent +#print axioms DesignLaws.one_stop_per_dim +#print axioms DesignLaws.hyperplane_dedicated +#print axioms DesignLaws.finrank_ker_add_one +#print axioms DesignLaws.rank_feed +#print axioms DesignLaws.rank_feed_st1 +#print axioms DesignLaws.matrix_rank_le +#print axioms DesignLaws.xclose_exact diff --git a/research/p104-lean-premises/lean/Nov15/DesignLaws.md b/research/p104-lean-premises/lean/Nov15/DesignLaws.md new file mode 100644 index 0000000000..6e95b89de7 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/DesignLaws.md @@ -0,0 +1,12 @@ +# DesignLaws : DS1's structural laws for the X->Y layer in Lean + +`Nov15/DesignLaws.lean`, Lean 4.33.0-rc1 + Mathlib, kernel only: no `sorry`, no `native_decide`; axioms `[propext, Classical.choice, Quot.sound]` (`one_read`: `[propext, Quot.sound]`). 8 s / 2.0 GB. Reuses TokenCancel (`St/Ev/step/run/LegalEv`, charts := `Submodule K E`), Annihilator (nesting = `Lineage.Legal`, cited; its descending-rank bound is a different count from s below), Delivery (TWO-STOP/TIME-ORDER style: co-presence + ascending charts). Source: internal notes (line numbers = the file's lines), RC5 gate 1: internal notes +Model: ports t have functionals phi t (Phi_t = ker phi t, DS1:7), tokens b have anchors u b; public x_b is born at a chart containing u b; orth(t,b) := phi t (u b) = 0; "non-isotropic" = phi t (u t) != 0. + +1. **PCL** (DS1:8) `pcl`, `pcl_orth`, `supp_run`, `line_le_ker_iff`. TRUE as written (support half). If a register ends at a chart inside Phi_t with a nonzero coefficient of a token b with phi t (u b) != 0 (b = t included), then some OWNED move is non-ascending (`Desc`); equivalently without owned descent every token in such a register is orthogonal to t. Hypotheses: publics born at charts containing their anchor and public MOVEs ascend (`Disc`), owned INIT row 0. Proof: invariant "token b appears in a row only at a chart containing u b" preserved by every event (ADD/COPY need co-presence). `line_le_ker_iff`: <= Phi_t iff orth, so an orthogonal X can sit at the dim-8 stop and a non-orthogonal one cannot. NOT formalised: the second sentence of DS1:8 ("owned-routed content O_t must equal e_t on N_t") is the DEFINITION of O (total content minus orthogonal public feeds); it is an input to RANK-FEED, not proved from the event model. "Descent" here = non-ascending (lateral owned moves count; nested-ness is Annihilator's separate rule). +2. **ONE-READ** (DS1:9) `one_read`. TRUE only with the DESCENT hypothesis on the owned lineage: public reader ascends (`MoveRel (<=)`), owned register descends (`MoveRel (>=)`), co-present at two read times => same chart. **SCOPE FIX:** Annihilator's lineages are nested in EITHER direction; with an owned ascent allowed the claim is false: `one_read_needs_descent` (legal ℚ-run over ℕ-charts: owned and reader both go 0 -> 1, reads at charts 0 and 1). Corrected: "at most one chart per DESCENDING owned lineage (ascending owned moves can be re-read)". +3. **HYPERPLANE** (DS1:9) `one_stop_per_dim`, `hyperplane_dedicated`, `finrank_ker_add_one`. TRUE for registers whose MOVEs ascend (publics): any two charts it occupies of equal dimension coincide (comparable + equal finrank). A nonzero functional has a kernel of dim = dim E - 1 (`finrank_ker_add_one`: 8 when dim E = 9). So a public register cannot stop at two different hyperplanes Phi_t != Phi_t' (either order, by symmetry) = "dedicated to t". Scope: PUBLIC registers (owned ones move non-monotonically and are not covered); "stop" = any chart occupied after a prefix of the run (stronger than "dim-8 op stop"). +4. **RANK-FEED** (DS1:10-12) `rank_feed`, `rank_feed'`, `matrix_rank_le`, `rank_feed_st1`. TRUE, general: O_t : P -> K owned-routed content of port t, all in the span W of read owned states (s = finrank W), exact on N_t (O t b = delta there). Then N <= s + #{t : exists b != t, orth(t,b), O t b != 0}: at most s ports have residue-free owned content; >= N - s ports carry an orthogonal residue to feed/cancel. `matrix_rank_le`: rank(I+J) <= s. Instance `rank_feed_st1`: N = 104, s = 96 => >= 8 (RC5 gate 1: the 8 X-direct ports). Reading note: DS1's proof sketch counts ROWS t outside the spanning columns; the Lean proof counts COLUMNS (ports) with unit content (independent vectors in W). Both counts are valid (transpose); only the column form is formalised and is the one that matches "ports needing feeds". +5. **XCLOSE** (DS1:24) `xclose_add`, `xclose_exact`. TRUE. Closer X_sigma holds row lam e_sigma + g (lam != 0, g sigma-free) at Phi_t beside Y_t. One ADD y += a x: sigma-coordinate becomes y_sigma + a lam (own token cancelled), every other coordinate gets exactly a g (the correction), all other rows and locs unchanged. If Y's pre-close row is tau + k (X's row) with tau sigma-free, the ADD with a = -k is legal and yields exactly tau, and a = -k is the only coefficient that does. (X's clean-up at V = TokenCancel hub blindness.) Does NOT show the content exists: RC5 gate 3 is exactly that pre-close row is not of this form on st1. + +Not covered: MULTIPLICITY, the FLOOR/cost numbers (DS1:14-17), the census counts. diff --git a/research/p104-lean-premises/lean/Nov15/ExportLaw.lean b/research/p104-lean-premises/lean/Nov15/ExportLaw.lean new file mode 100644 index 0000000000..65f4ab4e2b --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/ExportLaw.lean @@ -0,0 +1,702 @@ +/- +BIG-EXPORTLAW (internal notes), E1 reverse span law (any word): every row ever held at F lies in + span(final rows at F) + span(departing / cleared / COPY-overwritten rows). +E2 export law (class N): rank(ρR(F) + ρK_F) + hb ≤ ke + kd + od + oe + (helper departures), + i.e. hp ≥ rank − ke − kd − od − oe. This is STRONGER than the card's E2 (no −clr term): the proof + here goes through the forward span law (T4's direction) plus a stay count, not through E1. +T4* owned arrivals counted: dim π(S_c) + (free non-X births that leave) ≤ public departures + y + oa. +Scope: dropping the owned terms (od, oe) is false (`drop_owned_false`, modelled on chart 1090 / +owned 1510, 1520); dropping od alone or oe alone is false too; dropping clr alone is TRUE (E2 above). +The event model extends JunkLB2's `Ev` (arrive / born / add / depart) with scale, clear and copy. +-/ +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +import Mathlib.LinearAlgebra.StdBasis +import Mathlib.LinearAlgebra.Dimension.OrzechProperty +import Mathlib.LinearAlgebra.Matrix.Notation +import Mathlib.LinearAlgebra.LinearIndependent.Lemmas + +open Finset Module Submodule + +set_option linter.unusedSectionVars false +set_option linter.unusedSimpArgs false + +namespace ExportLaw + +variable {K Reg : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] + +/-! ## The one-chart event model -/ + +/-- events at ONE chart `F`, in time order. `arrive i v`: register `i` arrives with row `v` (an owned +INIT is `arrive o 0`); `born b`: `b` is born at `F` (row = its token); `add i j c`: `row_i += c·row_j`; +`scale i u`: `row_i := u·row_i`; `depart i`; `clear i`: `row_i := 0`; `copy i j`: `row_i := row_j`. -/ +inductive Ev (K Reg : Type*) + | arrive (i : Reg) (v : Reg → K) + | born (b : Reg) + | add (i j : Reg) (c : K) + | scale (i : Reg) (u : K) + | depart (i : Reg) + | clear (i : Reg) + | copy (i j : Reg) + +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 c => ⟨Function.update s.row i (s.row i + c • s.row j), s.pres⟩ + | s, .scale i u => ⟨Function.update s.row i (u • s.row i), s.pres⟩ + | s, .depart i => ⟨s.row, s.pres.erase i⟩ + | s, .clear i => ⟨Function.update s.row i 0, s.pres⟩ + | s, .copy i j => ⟨Function.update s.row i (s.row j), s.pres⟩ + +def run : St K Reg → List (Ev K Reg) → St K Reg + | s, [] => s + | s, ev :: evs => run (step s ev) evs + +/-- legality: arrivals/births of absent registers; ops only on present registers (co-presence); +ADD with `i ≠ j` and SCALE by a unit (invertible ops). -/ +def LegalEv (s : St K Reg) : Ev K Reg → Prop + | .arrive i _ => i ∉ s.pres + | .born b => b ∉ s.pres + | .add i j _ => i ≠ j ∧ i ∈ s.pres ∧ j ∈ s.pres + | .scale i u => u ≠ 0 ∧ i ∈ s.pres + | .depart i => i ∈ s.pres + | .clear i => i ∈ s.pres + | .copy i j => i ∈ s.pres ∧ j ∈ s.pres + +def Legal : St K Reg → List (Ev K Reg) → Prop + | _, [] => True + | s, ev :: evs => LegalEv s ev ∧ Legal (step s ev) evs + +/-- the rows present at a state. -/ +def cur (s : St K Reg) : Set (Reg → K) := s.row '' (s.pres : Set Reg) + +/-- `S_F`: every row ever held at `F` (at every state of the run). -/ +def held : St K Reg → List (Ev K Reg) → Set (Reg → K) + | s, [] => cur s + | s, ev :: evs => cur s ∪ held (step s ev) evs + +/-- the row an event removes from `F`: departing, cleared, or COPY-overwritten. -/ +def remBy (s : St K Reg) : Ev K Reg → List (Reg → K) + | .depart i => [s.row i] + | .clear i => [s.row i] + | .copy i _ => [s.row i] + | _ => [] + +def removed : St K Reg → List (Ev K Reg) → List (Reg → K) + | _, [] => [] + | s, ev :: evs => remBy s ev ++ removed (step s ev) evs + +def start : St K Reg := ⟨fun _ => 0, ∅⟩ + +lemma cur_sub_held : ∀ (s : St K Reg) (evs : List (Ev K Reg)), cur s ⊆ held s evs + | s, [] => le_rfl + | s, _ :: _ => Set.subset_union_left + +lemma final_sub_held : ∀ (s : St K Reg) (evs : List (Ev K Reg)), cur (run s evs) ⊆ held s evs + | s, [] => le_rfl + | s, ev :: evs => (final_sub_held (step s ev) evs).trans Set.subset_union_right + +/-! ## E1. Reverse span law (any word) -/ + +lemma step_back (s : St K Reg) (ev : Ev K Reg) (hev : LegalEv s ev) : + span K (cur s) ≤ span K (cur (step s ev)) ⊔ span K {v | v ∈ remBy s ev} := by + rw [Submodule.span_le] + rintro _ ⟨r, hr, rfl⟩ + simp only [Finset.mem_coe] at hr + have keep : ∀ (t : St K Reg), r ∈ t.pres → t.row r = s.row r → + s.row r ∈ span K (cur t) ⊔ span K {v | v ∈ remBy s ev} := fun t ht he => + Submodule.mem_sup_left (Submodule.subset_span ⟨r, ht, he⟩) + have gone : s.row r ∈ remBy s ev → s.row r ∈ span K (cur (step s ev)) ⊔ span K {v | v ∈ remBy s ev} := + fun h => Submodule.mem_sup_right (Submodule.subset_span h) + cases ev with + | arrive i v => + have hri : r ≠ i := fun e => hev (e ▸ hr) + exact keep _ (by simp [step, hr]) (by simp [step, Function.update_of_ne hri]) + | born b => + have hrb : r ≠ b := fun e => hev (e ▸ hr) + exact keep _ (by simp [step, hr]) (by simp [step, Function.update_of_ne hrb]) + | add i j c => + obtain ⟨hij, hi, hj⟩ := hev + by_cases hri : r = i + · subst hri + have e1 : s.row r = (step s (.add r j c)).row r - c • (step s (.add r j c)).row j := by + simp only [step, Function.update_self, Function.update_of_ne (Ne.symm hij)]; abel + rw [e1] + exact Submodule.mem_sup_left (Submodule.sub_mem _ (Submodule.subset_span ⟨r, hi, rfl⟩) + (Submodule.smul_mem _ _ (Submodule.subset_span ⟨j, hj, rfl⟩))) + · exact keep _ hr (by simp [step, Function.update_of_ne hri]) + | scale i u => + obtain ⟨hu, hi⟩ := hev + by_cases hri : r = i + · subst hri + have e1 : s.row r = u⁻¹ • (step s (.scale r u)).row r := by + simp only [step, Function.update_self, smul_smul, inv_mul_cancel₀ hu, one_smul] + rw [e1] + exact Submodule.mem_sup_left (Submodule.smul_mem _ _ (Submodule.subset_span ⟨r, hi, rfl⟩)) + · exact keep _ hr (by simp [step, Function.update_of_ne hri]) + | depart i => + by_cases hri : r = i + · subst hri; exact gone (by simp [remBy]) + · exact keep _ (by simp [step, hri, hr]) (by simp [step]) + | clear i => + by_cases hri : r = i + · subst hri; exact gone (by simp [remBy]) + · exact keep _ hr (by simp [step, Function.update_of_ne hri]) + | copy i j => + by_cases hri : r = i + · subst hri; exact gone (by simp [remBy]) + · exact keep _ hr (by simp [step, Function.update_of_ne hri]) + +/-- **E1 (reverse span law), any word.** `S_F ⊆ span(final rows at F) + span(removed rows)`, where +the removed rows are the departing, cleared and COPY-overwritten rows. -/ +theorem E1_reverse : ∀ (s : St K Reg) (evs : List (Ev K Reg)), Legal s evs → + span K (held s evs) ≤ span K (cur (run s evs)) ⊔ span K {v | v ∈ removed s evs} + | s, [], _ => by + simp only [held, run]; exact le_sup_left + | s, ev :: evs, ⟨hev, hL⟩ => by + have ih := E1_reverse (step s ev) evs hL + have hrem : span K {v | v ∈ removed (step s ev) evs} ≤ span K {v | v ∈ removed s (ev :: evs)} := + Submodule.span_mono fun v hv => by simp only [removed, List.mem_append, Set.mem_ofPred_eq] at hv ⊢; exact Or.inr hv + have hrem1 : span K {v | v ∈ remBy s ev} ≤ span K {v | v ∈ removed s (ev :: evs)} := + Submodule.span_mono fun v hv => by simp only [removed, List.mem_append, Set.mem_ofPred_eq] at hv ⊢; exact Or.inl hv + have hcur : span K (cur (step s ev)) ≤ span K (held (step s ev) evs) := + Submodule.span_mono (cur_sub_held _ _) + simp only [held, run, Submodule.span_union] + refine sup_le ?_ (ih.trans (sup_le_sup_left hrem _)) + refine (step_back s ev hev).trans (sup_le ?_ (hrem1.trans le_sup_right)) + exact hcur.trans (ih.trans (sup_le_sup_left hrem _)) + +/-! ## Forward span law and the stay count -/ + +/-- the rows that ENTER `F`: arrival rows and birth tokens. -/ +def entRows : List (Ev K Reg) → List (Reg → K) + | [] => [] + | .arrive _ v :: evs => v :: entRows evs + | .born b :: evs => Pi.single b 1 :: entRows evs + | _ :: evs => entRows evs + +/-- number of entries (arrivals + births) of registers in `C`. -/ +def nEnt (C : Finset Reg) : List (Ev K Reg) → ℕ + | [] => 0 + | .arrive i _ :: evs => (if i ∈ C then 1 else 0) + nEnt C evs + | .born b :: evs => (if b ∈ C then 1 else 0) + nEnt C evs + | _ :: evs => nEnt C evs + +/-- number of departures of registers in `C`. -/ +def nDep (C : Finset Reg) : List (Ev K Reg) → ℕ + | [] => 0 + | .depart i :: evs => (if i ∈ C then 1 else 0) + nDep C evs + | _ :: evs => nDep C evs + +/-- number of CLEAR / COPY-overwrite events (the card's `clr`). -/ +def nClr : List (Ev K Reg) → ℕ + | [] => 0 + | .clear _ :: evs => 1 + nClr evs + | .copy _ _ :: evs => 1 + nClr evs + | _ :: evs => nClr evs + +lemma entRows_length : ∀ evs : List (Ev K Reg), (entRows evs).length = nEnt univ evs + | [] => rfl + | .arrive _ _ :: evs => by simp [entRows, nEnt, entRows_length evs, add_comm] + | .born _ :: evs => by simp [entRows, nEnt, entRows_length evs, add_comm] + | .add _ _ _ :: evs => by simp [entRows, nEnt, entRows_length evs] + | .scale _ _ :: evs => by simp [entRows, nEnt, entRows_length evs] + | .depart _ :: evs => by simp [entRows, nEnt, entRows_length evs] + | .clear _ :: evs => by simp [entRows, nEnt, entRows_length evs] + | .copy _ _ :: evs => by simp [entRows, nEnt, entRows_length evs] + +lemma nDep_union (C D : Finset Reg) (hCD : Disjoint C D) : + ∀ evs : List (Ev K Reg), nDep (C ∪ D) evs = nDep C evs + nDep D evs + | [] => rfl + | .depart i :: evs => by + have ih := nDep_union C D hCD evs + simp only [nDep, mem_union, ih] + by_cases hC : i ∈ C + · have hD : i ∉ D := Finset.disjoint_left.mp hCD hC + simp [hC, hD]; omega + · by_cases hD : i ∈ D <;> simp [hC, hD] <;> omega + | .arrive _ _ :: evs => by simp only [nDep]; exact nDep_union C D hCD evs + | .born _ :: evs => by simp only [nDep]; exact nDep_union C D hCD evs + | .add _ _ _ :: evs => by simp only [nDep]; exact nDep_union C D hCD evs + | .scale _ _ :: evs => by simp only [nDep]; exact nDep_union C D hCD evs + | .clear _ :: evs => by simp only [nDep]; exact nDep_union C D hCD evs + | .copy _ _ :: evs => by simp only [nDep]; exact nDep_union C D hCD evs + +/-- **stay count**: every entry at `F` ends in a departure or is still there at the end. -/ +theorem stay_count (C : Finset Reg) : ∀ (s : St K Reg) (evs : List (Ev K Reg)), Legal s evs → + nEnt C evs + (s.pres ∩ C).card = nDep C evs + ((run s evs).pres ∩ C).card + | s, [], _ => by simp [nEnt, nDep, run] + | s, ev :: evs, ⟨hev, hL⟩ => by + have ih := stay_count C (step s ev) evs hL + cases ev with + | arrive i v => + simp only [nEnt, nDep, run] at ih ⊢ + have hp : ((step s (.arrive i v)).pres ∩ C).card = + (s.pres ∩ C).card + (if i ∈ C then 1 else 0) := by + simp only [step] + by_cases hC : i ∈ C + · rw [Finset.insert_inter_of_mem hC, Finset.card_insert_of_notMem + (fun h => hev (Finset.mem_inter.mp h).1)]; simp [hC] + · rw [Finset.insert_inter_of_notMem hC]; simp [hC] + omega + | born b => + simp only [nEnt, nDep, run] at ih ⊢ + have hp : ((step s (.born b)).pres ∩ C).card = + (s.pres ∩ C).card + (if b ∈ C then 1 else 0) := by + simp only [step] + by_cases hC : b ∈ C + · rw [Finset.insert_inter_of_mem hC, Finset.card_insert_of_notMem + (fun h => hev (Finset.mem_inter.mp h).1)]; simp [hC] + · rw [Finset.insert_inter_of_notMem hC]; simp [hC] + omega + | depart i => + simp only [nEnt, nDep, run] at ih ⊢ + have hp : ((step s (.depart i)).pres ∩ C).card + (if i ∈ C then 1 else 0) = + (s.pres ∩ C).card := by + simp only [step] + rw [Finset.erase_inter] + by_cases hC : i ∈ C + · rw [Finset.card_erase_of_mem (Finset.mem_inter.mpr ⟨hev, hC⟩)] + have : 0 < (s.pres ∩ C).card := Finset.card_pos.mpr ⟨i, Finset.mem_inter.mpr ⟨hev, hC⟩⟩ + simp only [hC, if_true]; omega + · rw [Finset.erase_eq_of_notMem (fun h => hC (Finset.mem_inter.mp h).2)]; simp [hC] + omega + | add i j c => simp only [nEnt, nDep, run] at ih ⊢; exact ih + | scale i u => simp only [nEnt, nDep, run] at ih ⊢; exact ih + | clear i => simp only [nEnt, nDep, run] at ih ⊢; exact ih + | copy i j => simp only [nEnt, nDep, run] at ih ⊢; exact ih + +/-- **forward span law** (T4's direction): if every present row and every entering row lies in `N`, +so does every row ever held. Holds for every event, CLEAR and COPY included. -/ +theorem forward_span (N : Submodule K (Reg → K)) : ∀ (s : St K Reg) (evs : List (Ev K Reg)), + Legal s evs → cur s ⊆ N → (∀ v ∈ entRows evs, v ∈ N) → held s evs ⊆ N + | s, [], _, hs, _ => hs + | s, ev :: evs, ⟨hev, hL⟩, hs, hent => by + have hent' : ∀ v ∈ entRows evs, v ∈ N := fun v hv => hent v (by + cases ev <;> simp [entRows, hv]) + refine Set.union_subset hs (forward_span N _ evs hL ?_ hent') + rintro _ ⟨r, hr, rfl⟩ + have old : ∀ q ∈ s.pres, s.row q ∈ N := fun q hq => hs ⟨q, hq, rfl⟩ + cases ev with + | arrive i v => + simp only [step, Finset.coe_insert, Set.mem_insert_iff, Finset.mem_coe] at hr ⊢ + by_cases hri : r = i + · subst hri; simp only [Function.update_self]; exact hent v (by simp [entRows]) + · rw [Function.update_of_ne hri]; exact old r (hr.resolve_left hri) + | born b => + simp only [step, Finset.coe_insert, Set.mem_insert_iff, Finset.mem_coe] at hr ⊢ + by_cases hrb : r = b + · subst hrb; simp only [Function.update_self]; exact hent _ (by simp [entRows]) + · rw [Function.update_of_ne hrb]; exact old r (hr.resolve_left hrb) + | add i j c => + obtain ⟨_, hi, hj⟩ := hev + simp only [step, Finset.mem_coe] at hr ⊢ + by_cases hri : r = i + · subst hri; simp only [Function.update_self] + exact N.add_mem (old r hi) (N.smul_mem c (old j hj)) + · rw [Function.update_of_ne hri]; exact old r hr + | scale i u => + simp only [step, Finset.mem_coe] at hr ⊢ + by_cases hri : r = i + · subst hri; simp only [Function.update_self]; exact N.smul_mem u (old r hr) + · rw [Function.update_of_ne hri]; exact old r hr + | depart i => + simp only [step, Finset.coe_erase, Set.mem_diff, Finset.mem_coe] at hr ⊢ + exact old r hr.1 + | clear i => + simp only [step, Finset.mem_coe] at hr ⊢ + by_cases hri : r = i + · subst hri; simp only [Function.update_self]; exact N.zero_mem + · rw [Function.update_of_ne hri]; exact old r hr + | copy i j => + obtain ⟨_, hj⟩ := hev + simp only [step, Finset.mem_coe] at hr ⊢ + by_cases hri : r = i + · subst hri; simp only [Function.update_self]; exact old j hj + · rw [Function.update_of_ne hri]; exact old r hr + +/-- the registers born at `F`. -/ +def bornSet : List (Ev K Reg) → Finset Reg + | [] => ∅ + | .born b :: evs => insert b (bornSet evs) + | _ :: evs => bornSet evs + +lemma born_held : ∀ (s : St K Reg) (evs : List (Ev K Reg)) (b : Reg), b ∈ bornSet evs → + (Pi.single b 1 : Reg → K) ∈ held s evs + | s, [], b, h => by simp [bornSet] at h + | s, .born b' :: evs, b, h => by + rcases Finset.mem_insert.mp h with rfl | h + · exact Set.mem_union_right _ (cur_sub_held _ evs ⟨b, by simp [step], by simp [step]⟩) + · exact Set.mem_union_right _ (born_held _ evs b h) + | s, .arrive _ _ :: evs, b, h => Set.mem_union_right _ (born_held _ evs b h) + | s, .add _ _ _ :: evs, b, h => Set.mem_union_right _ (born_held _ evs b h) + | s, .scale _ _ :: evs, b, h => Set.mem_union_right _ (born_held _ evs b h) + | s, .depart _ :: evs, b, h => Set.mem_union_right _ (born_held _ evs b h) + | s, .clear _ :: evs, b, h => Set.mem_union_right _ (born_held _ evs b h) + | s, .copy _ _ :: evs, b, h => Set.mem_union_right _ (born_held _ evs b h) + +/-- **forward count.** From the empty state: `dim φ(S_F) + |Tk| ≤ #entries`, for any linear `φ` and +any set `Tk` of registers whose tokens are held at `F` and killed by `φ`. -/ +theorem forward_count (φ : (Reg → K) →ₗ[K] (Reg → K)) (evs : List (Ev K Reg)) + (hL : Legal start evs) (Tk : Finset Reg) + (hTk : ∀ t ∈ Tk, (Pi.single t 1 : Reg → K) ∈ held start evs) + (hφ : ∀ t ∈ Tk, φ (Pi.single t 1) = 0) : + finrank K ((span K (held start evs)).map φ) + Tk.card ≤ nEnt univ evs := by + classical + have eqA : span K {v | v ∈ entRows evs} = + span K ((((entRows evs).toFinset : Finset (Reg → K)) : Set (Reg → K))) := by + congr 1; ext v; simp + have hAc0 : finrank K (span K ((((entRows evs).toFinset : Finset (Reg → K)) : Set (Reg → K)))) ≤ + nEnt univ evs := by + rw [← entRows_length] + exact (finrank_span_finset_le_card _).trans (List.toFinset_card_le _) + have hAc : finrank K (span K {v | v ∈ entRows evs}) ≤ nEnt univ evs := + (Submodule.finrank_mono eqA.le).trans hAc0 + set A := span K {v | v ∈ entRows evs} + have hSA : held start evs ⊆ A := + forward_span A start evs hL (by simp [cur, start]) (fun v hv => Submodule.subset_span hv) + let f := φ.domRestrict A + have hrn := LinearMap.finrank_range_add_finrank_ker f + have hrange : LinearMap.range f = A.map φ := LinearMap.range_domRestrict A φ + have hker : Tk.card ≤ finrank K (LinearMap.ker f) := by + let g : Tk → LinearMap.ker f := fun t => + ⟨⟨Pi.single t.1 1, hSA (hTk t.1 t.2)⟩, by simp [f, hφ t.1 t.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) = (Pi.basisFun K Reg) ∘ Subtype.val := by + funext t; simp [g] + rw [e]; exact (Pi.basisFun K Reg).linearIndependent.comp _ Subtype.val_injective + simpa using hli.fintype_card_le_finrank + have hmono : finrank K ((span K (held start evs)).map φ) ≤ finrank K (A.map φ) := + Submodule.finrank_mono (Submodule.map_mono (Submodule.span_le.mpr hSA)) + rw [← hrange] at hmono + omega + +/-! ## E2. Export law (class N) -/ + +/-- **E2, export law (class N), strong form.** One chart `F ≠ V`, a legal event list from the empty +state. Registers are helpers `H`, kept publics `Kp`, owned `Ow` (a partition). Class N at `F`: a +helper still at `F` at the end ends as its own token. `ρ` kills helper tokens. `R` is any set of rows +held at `F` (e.g. the kept rows at kept events), `K_F` the span of the final rows of kept enders. +`HB` = helpers born at `F` that are gone at the end (free birth stays). Then +`rank(ρR + ρK_F) + |HB| ≤ ke + kd + od + oe + (helper departures)`. +Since helper departures = hp + hb (paid stays + birth stays), this is `hp ≥ rank − ke − kd − od − oe`: +the card's E2 WITHOUT the `− clr` term. -/ +theorem E2_export (ρ : (Reg → K) →ₗ[K] (Reg → K)) (evs : List (Ev K Reg)) (hL : Legal start evs) + (H Kp Ow : Finset Reg) (hKO : Disjoint Kp Ow) (hcov : univ \ H = Kp ∪ Ow) + (hN : ∀ h ∈ H, h ∈ (run start evs).pres → (run start evs).row h = Pi.single h 1) + (hρ : ∀ h ∈ H, ρ (Pi.single h 1) = 0) + (R : Set (Reg → K)) (hR : R ⊆ held start evs) : + finrank K ((span K R).map ρ ⊔ + (span K ((run start evs).row '' (((run start evs).pres ∩ Kp : Finset Reg) : Set Reg))).map ρ : + Submodule K (Reg → K)) + + ((H ∩ bornSet evs) \ (run start evs).pres).card ≤ + ((run start evs).pres ∩ Kp).card + nDep Kp evs + nDep Ow evs + ((run start evs).pres ∩ Ow).card + + nDep H evs := by + classical + have hc := stay_count (K := K) univ start evs hL + have h0 : (start (K := K) (Reg := Reg)).pres = ∅ := rfl + rw [h0] at hc + simp only [Finset.empty_inter, Finset.card_empty, add_zero, Finset.inter_univ] at hc + set sf := run (start (K := K) (Reg := Reg)) evs + set F := sf.pres + set HB := (H ∩ bornSet evs) \ F + set Tk := HB ∪ (F ∩ H) + have hdisj : Disjoint HB (F ∩ H) := by + rw [Finset.disjoint_left]; intro x hx hx' + exact (Finset.mem_sdiff.mp hx).2 (Finset.mem_inter.mp hx').1 + have hTk : ∀ t ∈ Tk, (Pi.single t 1 : Reg → K) ∈ held start evs := by + intro t ht + rcases Finset.mem_union.mp ht with ht | ht + · exact born_held _ evs t (Finset.mem_inter.mp (Finset.mem_sdiff.mp ht).1).2 + · obtain ⟨htF, htH⟩ := Finset.mem_inter.mp ht + exact final_sub_held _ evs ⟨t, htF, hN t htH htF⟩ + have hφ : ∀ t ∈ Tk, ρ (Pi.single t 1) = 0 := by + intro t ht + rcases Finset.mem_union.mp ht with ht | ht + · exact hρ t (Finset.mem_inter.mp (Finset.mem_sdiff.mp ht).1).1 + · exact hρ t (Finset.mem_inter.mp ht).2 + have hfc := forward_count ρ evs hL Tk hTk hφ + rw [Finset.card_union_of_disjoint hdisj] at hfc + -- rank of ρR + ρK_F is at most rank of ρ(S_F) + have hsub : (span K R).map ρ ⊔ (span K (sf.row '' ((F ∩ Kp : Finset Reg) : Set Reg))).map ρ ≤ + (span K (held start evs)).map ρ := by + rw [← Submodule.map_sup] + refine Submodule.map_mono (sup_le (Submodule.span_mono hR) (Submodule.span_le.mpr ?_)) + rintro _ ⟨r, hr, rfl⟩ + exact Submodule.subset_span (final_sub_held _ evs ⟨r, (Finset.mem_inter.mp hr).1, rfl⟩) + have hrk := Submodule.finrank_mono hsub + -- counting + have hdep : nDep (univ : Finset Reg) evs = nDep H evs + nDep Kp evs + nDep Ow evs := by + have e : (univ : Finset Reg) = H ∪ (Kp ∪ Ow) := by + rw [← hcov]; ext x; by_cases hx : x ∈ H <;> simp [hx] + rw [e, nDep_union H _ (by rw [← hcov]; exact Finset.disjoint_sdiff), nDep_union Kp Ow hKO, add_assoc] + have hF : F.card = (F ∩ H).card + (F ∩ Kp).card + (F ∩ Ow).card := by + have e1 := Finset.card_inter_add_card_sdiff F H + have e2 : F \ H = (F ∩ Kp) ∪ (F ∩ Ow) := by + rw [← Finset.inter_union_distrib_left, ← hcov]; ext x; simp + have e3 : Disjoint (F ∩ Kp) (F ∩ Ow) := + Finset.disjoint_of_subset_left Finset.inter_subset_right + (Finset.disjoint_of_subset_right Finset.inter_subset_right hKO) + rw [e2, Finset.card_union_of_disjoint e3] at e1; omega + omega + +/-- **E2 as stated on the card** (with `hp = helper departures − hb`, in ℤ): the `− clr` version +follows from the strong form, since `clr ≥ 0`. -/ +theorem E2_card (ρ : (Reg → K) →ₗ[K] (Reg → K)) (evs : List (Ev K Reg)) (hL : Legal start evs) + (H Kp Ow : Finset Reg) (hKO : Disjoint Kp Ow) (hcov : univ \ H = Kp ∪ Ow) + (hN : ∀ h ∈ H, h ∈ (run start evs).pres → (run start evs).row h = Pi.single h 1) + (hρ : ∀ h ∈ H, ρ (Pi.single h 1) = 0) + (R : Set (Reg → K)) (hR : R ⊆ held start evs) : + ((finrank K ((span K R).map ρ ⊔ + (span K ((run start evs).row '' (((run start evs).pres ∩ Kp : Finset Reg) : Set Reg))).map ρ : + Submodule K (Reg → K)) : ℕ) : ℤ) + - ((run start evs).pres ∩ Kp).card - nDep Kp evs - nDep Ow evs + - ((run start evs).pres ∩ Ow).card - nClr evs ≤ + (nDep H evs : ℤ) - ((H ∩ bornSet evs) \ (run start evs).pres).card := by + have := E2_export ρ evs hL H Kp Ow hKO hcov hN hρ R hR + have h0 : (0 : ℤ) ≤ nClr evs := Int.natCast_nonneg _ + omega + +/-! ## T4*. Owned arrivals counted (class N) -/ + +/-- **T4\*** (class N, owned arrivals counted). One chart `c ≠ V`. `Pub` = public registers, the rest +owned. Class N: a public register still at `c` at the end, other than a Y main in `Ey`, ends as its +own token, and `π` kills that token. `π` kills the tokens of non-X births (`Xs` = live-X registers). +`BNX` = non-X registers born at `c` that are gone at the end (free birth stays). Then +`dim π(S_c) + |BNX| ≤ (public departures) + |Ey| + (owned entries)`. +No "arrivals carry no c-born coordinates" hypothesis: owned registers may descend. -/ +theorem T4_star (π : (Reg → K) →ₗ[K] (Reg → K)) (evs : List (Ev K Reg)) (hL : Legal start evs) + (Pub Ey Xs : Finset Reg) + (hN : ∀ h ∈ Pub, h ∈ (run start evs).pres → h ∉ Ey → (run start evs).row h = Pi.single h 1) + (hπE : ∀ h ∈ Pub, h ∈ (run start evs).pres → h ∉ Ey → π (Pi.single h 1) = 0) + (hπB : ∀ b, b ∉ Xs → π (Pi.single b 1) = 0) : + finrank K ((span K (held start evs)).map π) + + ((bornSet evs \ Xs) \ (run start evs).pres).card ≤ + nDep Pub evs + Ey.card + nEnt (univ \ Pub) evs := by + classical + have hc := stay_count (K := K) univ start evs hL + have hco := stay_count (K := K) (univ \ Pub) start evs hL + have h0 : (start (K := K) (Reg := Reg)).pres = ∅ := rfl + rw [h0] at hc hco + simp only [Finset.empty_inter, Finset.card_empty, add_zero, Finset.inter_univ] at hc hco + set sf := run (start (K := K) (Reg := Reg)) evs + set F := sf.pres + set BNX := (bornSet evs \ Xs) \ F + set PE := (F ∩ Pub) \ Ey + have hdisj : Disjoint BNX PE := by + rw [Finset.disjoint_left]; intro x hx hx' + exact (Finset.mem_sdiff.mp hx).2 (Finset.mem_inter.mp (Finset.mem_sdiff.mp hx').1).1 + have hTk : ∀ t ∈ BNX ∪ PE, (Pi.single t 1 : Reg → K) ∈ held start evs := by + intro t ht + rcases Finset.mem_union.mp ht with ht | ht + · exact born_held _ evs t (Finset.mem_sdiff.mp (Finset.mem_sdiff.mp ht).1).1 + · obtain ⟨htFP, htY⟩ := Finset.mem_sdiff.mp ht + obtain ⟨htF, htP⟩ := Finset.mem_inter.mp htFP + exact final_sub_held _ evs ⟨t, htF, hN t htP htF htY⟩ + have hφ : ∀ t ∈ BNX ∪ PE, π (Pi.single t 1) = 0 := by + intro t ht + rcases Finset.mem_union.mp ht with ht | ht + · exact hπB t (Finset.mem_sdiff.mp (Finset.mem_sdiff.mp ht).1).2 + · obtain ⟨htFP, htY⟩ := Finset.mem_sdiff.mp ht + obtain ⟨htF, htP⟩ := Finset.mem_inter.mp htFP + exact hπE t htP htF htY + have hfc := forward_count π evs hL _ hTk hφ + rw [Finset.card_union_of_disjoint hdisj] at hfc + have hdep : nDep (univ : Finset Reg) evs = nDep Pub evs + nDep (univ \ Pub) evs := by + rw [← nDep_union Pub _ Finset.disjoint_sdiff, Finset.union_sdiff_of_subset (Finset.subset_univ _)] + have hF : F.card = (F ∩ Pub).card + (F ∩ (univ \ Pub)).card := by + have e1 := Finset.card_inter_add_card_sdiff F Pub + have e2 : F \ Pub = F ∩ (univ \ Pub) := by ext x; simp + rw [e2] at e1; omega + have hPE : (F ∩ Pub).card ≤ PE.card + Ey.card := by + calc (F ∩ Pub).card ≤ (PE ∪ Ey).card := by + apply Finset.card_le_card; intro x hx + by_cases hy : x ∈ Ey + · exact Finset.mem_union_right _ hy + · exact Finset.mem_union_left _ (Finset.mem_sdiff.mpr ⟨hx, hy⟩) + _ ≤ _ := Finset.card_union_le _ _ + omega + +/-! ## T4* card form d + y + oa + xb -/ + +/-- departures of a set = sum of single-register departures. -/ +lemma nDep_eq_sum (C : Finset Reg) : ∀ evs : List (Ev K Reg), nDep C evs = ∑ i ∈ C, nDep {i} evs + | [] => by simp [nDep] + | .depart j :: evs => by + simp only [nDep, nDep_eq_sum C evs, Finset.sum_add_distrib, Finset.mem_singleton] + congr 1 + rw [Finset.sum_ite_eq C j] + | .arrive _ _ :: evs => by simp only [nDep]; exact nDep_eq_sum C evs + | .born _ :: evs => by simp only [nDep]; exact nDep_eq_sum C evs + | .add _ _ _ :: evs => by simp only [nDep]; exact nDep_eq_sum C evs + | .scale _ _ :: evs => by simp only [nDep]; exact nDep_eq_sum C evs + | .clear _ :: evs => by simp only [nDep]; exact nDep_eq_sum C evs + | .copy _ _ :: evs => by simp only [nDep]; exact nDep_eq_sum C evs + +/-- **T4\* card form.** Under "each register enters the chart at most once" (`hOnce`; with Legal runs this +is: it leaves at most once and never comes back, i.e. monotone public charts; owned registers are +not restricted): +`dim π(S_c) ≤ d + y + oa + xb`, with `d` = public registers that ARRIVED (were not born at c) and later +depart, `y = |Ey|`, `oa` = owned entries, `xb` = X registers born at c. -/ +theorem T4_card (π : (Reg → K) →ₗ[K] (Reg → K)) (evs : List (Ev K Reg)) (hL : Legal start evs) + (Pub Ey Xs : Finset Reg) + (hN : ∀ h ∈ Pub, h ∈ (run start evs).pres → h ∉ Ey → (run start evs).row h = Pi.single h 1) + (hπE : ∀ h ∈ Pub, h ∈ (run start evs).pres → h ∉ Ey → π (Pi.single h 1) = 0) + (hπB : ∀ b, b ∉ Xs → π (Pi.single b 1) = 0) + (hOnce : ∀ i ∈ Pub, nEnt {i} evs ≤ 1) : + finrank K ((span K (held start evs)).map π) ≤ + ((Pub \ bornSet evs).filter fun i => 0 < nDep {i} evs).card + Ey.card + + nEnt (univ \ Pub) evs + (bornSet evs ∩ Xs).card := by + classical + have hT := T4_star π evs hL Pub Ey Xs hN hπE hπB + set F := (run (start (K := K) (Reg := Reg)) evs).pres + have hi1 : ∀ i, nEnt {i} evs = nDep {i} evs + (F ∩ {i}).card := by + intro i + have := stay_count (K := K) {i} start evs hL + have h0 : (start (K := K) (Reg := Reg)).pres = ∅ := rfl + rw [h0] at this + simpa using this + have hle1 : ∀ i ∈ Pub, nDep {i} evs ≤ 1 := fun i hi => by have := hi1 i; have := hOnce i hi; omega + set Dp := Pub.filter fun i => 0 < nDep {i} evs + have hsum : nDep Pub evs ≤ Dp.card := by + rw [nDep_eq_sum, Finset.card_filter] + exact Finset.sum_le_sum fun i hi => by + have := hle1 i hi + split_ifs with h <;> omega + have hsub : Dp ⊆ ((Pub \ bornSet evs).filter fun i => 0 < nDep {i} evs) ∪ + ((bornSet evs \ Xs) \ F) ∪ (bornSet evs ∩ Xs) := by + intro i hi + obtain ⟨hiP, hid⟩ := Finset.mem_filter.mp hi + by_cases hb : i ∈ bornSet evs + · by_cases hx : i ∈ Xs + · exact Finset.mem_union_right _ (Finset.mem_inter.mpr ⟨hb, hx⟩) + · refine Finset.mem_union_left _ (Finset.mem_union_right _ ?_) + refine Finset.mem_sdiff.mpr ⟨Finset.mem_sdiff.mpr ⟨hb, hx⟩, fun hF => ?_⟩ + have h1 := hi1 i + have h2 := hOnce i hiP + have h3 : (F ∩ {i}).card = 1 := by + rw [Finset.inter_singleton_of_mem hF, Finset.card_singleton] + omega + · exact Finset.mem_union_left _ (Finset.mem_union_left _ + (Finset.mem_filter.mpr ⟨Finset.mem_sdiff.mpr ⟨hiP, hb⟩, hid⟩)) + have hc := (Finset.card_le_card hsub).trans (Finset.card_union_le _ _) + have hc2 := Finset.card_union_le ((Pub \ bornSet evs).filter fun i => 0 < nDep {i} evs) + ((bornSet evs \ Xs) \ F) + omega + +/-! ## Scope: which owned/clear terms can be dropped -/ + +/-- `e_0` and `e_0 + e_2` are independent: rank 2. -/ +lemma rank_two {n : ℕ} (a b : Fin n) (hab : a ≠ b) : + finrank ℚ (span ℚ (Set.range ![(Pi.single a 1 : Fin n → ℚ), Pi.single a 1 + Pi.single b 1])) = 2 := by + have hli : LinearIndependent ℚ ![(Pi.single a 1 : Fin n → ℚ), Pi.single a 1 + Pi.single b 1] := by + rw [LinearIndependent.pair_iff] + intro s t hst + have h1 := congrFun hst a + have h2 := congrFun hst b + simp [Pi.single_apply, hab, Ne.symm hab] at h1 h2 + exact ⟨by linarith, h2⟩ + rw [finrank_span_eq_card hli]; simp + +/-- **Dropping the owned terms is false** (chart 1090 mirror: owned 1510 descends INTO F carrying +content and ends there, owned 1520 picks it up and LEAVES F). Registers: `0` = kept `x`, `1` = owned +`o₁` (1510), `2` = the kept register whose coordinate `o₁` carries (absent from F), `3` = owned `o₂` +(1520). Events: `o₁` arrives with `e₂`; `x` arrives with `e₀`; `x += o₁`; `x` departs; `o₂` INITs +(arrives with 0); `o₂ += o₁`; `o₂` departs; `o₁` stays. No helpers (`ρ = id`, hp = hb = 0), no kept +ender (`K_F = 0`). The kept rows of `x` at kept events, `e₀` and `e₀ + e₂`, have rank 2 > 1 = +ke + kd + hp; with the owned terms (od = oe = 1) the bound 3 holds (`E2_export`). -/ +theorem drop_owned_false : + let evs : List (Ev ℚ (Fin 4)) := [.arrive 1 (Pi.single 2 1), .arrive 0 (Pi.single 0 1), + .add 0 1 1, .depart 0, .arrive 3 0, .add 3 1 1, .depart 3] + let R : Set (Fin 4 → ℚ) := Set.range ![(Pi.single 0 1 : Fin 4 → ℚ), Pi.single 0 1 + Pi.single 2 1] + Legal start evs ∧ R ⊆ held start evs ∧ (run start evs).pres = {1} ∧ + nDep ({0, 2} : Finset (Fin 4)) evs = 1 ∧ nDep ({1, 3} : Finset (Fin 4)) evs = 1 ∧ + finrank ℚ (span ℚ R) = 2 ∧ + ¬ finrank ℚ (span ℚ R) ≤ ((run start evs).pres ∩ {0, 2}).card + nDep ({0, 2} : Finset (Fin 4)) evs + 0 := by + intro evs R + have hrank : finrank ℚ (span ℚ R) = 2 := rank_two 0 2 (by decide) + have hpres : (run start evs).pres = {1} := by + simp [evs, run, step, start] + have hd1 : nDep ({0, 2} : Finset (Fin 4)) evs = 1 := by simp [evs, nDep] + refine ⟨?_, ?_, hpres, hd1, by simp [evs, nDep], hrank, ?_⟩ + · simp [evs, Legal, LegalEv, step, start] + · rintro _ ⟨k, rfl⟩ + fin_cases k + · -- e₀: x's row right after its arrival (third state) + simp only [evs, held] + refine Or.inr (Or.inr (Or.inl ⟨0, by simp [step, start], by simp [step, start]⟩)) + · -- e₀ + e₂: x's row right after `x += o₁` (fourth state) + simp only [evs, held] + refine Or.inr (Or.inr (Or.inr (Or.inl ⟨0, by simp [step, start], ?_⟩))) + simp [step, start, Function.update_of_ne (show (0 : Fin 4) ≠ 1 by decide)] + · rw [hrank, hpres, hd1]; decide + +/-- **Dropping `od` alone is false**: one owned register `o` (= 1) brings `e₂` in, `x += o`, both +leave. Rank 2 > ke + kd + oe + hp = 0 + 1 + 0 + 0; with `od = 1` the bound 2 holds. -/ +theorem drop_od_false : + let evs : List (Ev ℚ (Fin 3)) := [.arrive 1 (Pi.single 2 1), .arrive 0 (Pi.single 0 1), + .add 0 1 1, .depart 0, .depart 1] + let R : Set (Fin 3 → ℚ) := Set.range ![(Pi.single 0 1 : Fin 3 → ℚ), Pi.single 0 1 + Pi.single 2 1] + Legal start evs ∧ R ⊆ held start evs ∧ (run start evs).pres = ∅ ∧ + nDep ({0, 2} : Finset (Fin 3)) evs = 1 ∧ nDep ({1} : Finset (Fin 3)) evs = 1 ∧ + ¬ finrank ℚ (span ℚ R) ≤ 0 + nDep ({0, 2} : Finset (Fin 3)) evs + 0 + 0 := by + intro evs R + have hrank : finrank ℚ (span ℚ R) = 2 := rank_two 0 2 (by decide) + have hd1 : nDep ({0, 2} : Finset (Fin 3)) evs = 1 := by simp [evs, nDep] + refine ⟨?_, ?_, ?_, hd1, by simp [evs, nDep], ?_⟩ + · simp [evs, Legal, LegalEv, step, start] + · rintro _ ⟨k, rfl⟩ + fin_cases k + · simp only [evs, held] + refine Or.inr (Or.inr (Or.inl ⟨0, by simp [step, start], by simp [step, start]⟩)) + · simp only [evs, held] + refine Or.inr (Or.inr (Or.inr (Or.inl ⟨0, by simp [step, start], ?_⟩))) + simp [step, start, Function.update_of_ne (show (0 : Fin 3) ≠ 1 by decide)] + · simp [evs, run, step, start] + · rw [hrank, hd1]; decide + +/-- **Dropping `oe` alone is false**: as `drop_od_false`, but `o` stays at F (ends there). -/ +theorem drop_oe_false : + let evs : List (Ev ℚ (Fin 3)) := [.arrive 1 (Pi.single 2 1), .arrive 0 (Pi.single 0 1), + .add 0 1 1, .depart 0] + let R : Set (Fin 3 → ℚ) := Set.range ![(Pi.single 0 1 : Fin 3 → ℚ), Pi.single 0 1 + Pi.single 2 1] + Legal start evs ∧ R ⊆ held start evs ∧ (run start evs).pres = {1} ∧ + nDep ({0, 2} : Finset (Fin 3)) evs = 1 ∧ nDep ({1} : Finset (Fin 3)) evs = 0 ∧ + ¬ finrank ℚ (span ℚ R) ≤ ((run start evs).pres ∩ {0, 2}).card + + nDep ({0, 2} : Finset (Fin 3)) evs + nDep ({1} : Finset (Fin 3)) evs + 0 := by + intro evs R + have hrank : finrank ℚ (span ℚ R) = 2 := rank_two 0 2 (by decide) + have hpres : (run start evs).pres = {1} := by + simp [evs, run, step, start] + have hd1 : nDep ({0, 2} : Finset (Fin 3)) evs = 1 := by simp [evs, nDep] + have hd2 : nDep ({1} : Finset (Fin 3)) evs = 0 := by simp [evs, nDep] + refine ⟨?_, ?_, hpres, hd1, hd2, ?_⟩ + · simp [evs, Legal, LegalEv, step, start] + · rintro _ ⟨k, rfl⟩ + fin_cases k + · simp only [evs, held] + refine Or.inr (Or.inr (Or.inl ⟨0, by simp [step, start], by simp [step, start]⟩)) + · simp only [evs, held] + refine Or.inr (Or.inr (Or.inr (Or.inl ⟨0, by simp [step, start], ?_⟩))) + simp [step, start, Function.update_of_ne (show (0 : Fin 3) ≠ 1 by decide)] + · rw [hrank, hpres, hd1, hd2]; decide + +end ExportLaw + +#print axioms ExportLaw.E1_reverse +#print axioms ExportLaw.stay_count +#print axioms ExportLaw.forward_span +#print axioms ExportLaw.forward_count +#print axioms ExportLaw.E2_export +#print axioms ExportLaw.E2_card +#print axioms ExportLaw.T4_star +#print axioms ExportLaw.nDep_eq_sum +#print axioms ExportLaw.T4_card +#print axioms ExportLaw.drop_owned_false +#print axioms ExportLaw.drop_od_false +#print axioms ExportLaw.drop_oe_false diff --git a/research/p104-lean-premises/lean/Nov15/FibreK.lean b/research/p104-lean-premises/lean/Nov15/FibreK.lean new file mode 100644 index 0000000000..33e2d3f083 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/FibreK.md b/research/p104-lean-premises/lean/Nov15/FibreK.md new file mode 100644 index 0000000000..eaeb3e7e8e --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/Floor.lean b/research/p104-lean-premises/lean/Nov15/Floor.lean new file mode 100644 index 0000000000..c8b615e92a --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Floor.lean @@ -0,0 +1,385 @@ +/- +Class-K junk floor (780 stops = 1,081.31 D0/call), Sources: internal notes (F1, F2, F3 certificate, F4), + internal notes (R0(a,b,c), R1, R2, R3, R4 certificate). + +Everything is stated per chart / per build over an arbitrary field, with the op-model facts +(the forward span law and the entry count, ExportLaw.forward_span / forward_count / stay_count) +taken as explicit hypotheses. See Floor.md for the statement ↔ prose mapping. +-/ +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +import Mathlib.LinearAlgebra.Dual.Lemmas +import Mathlib.LinearAlgebra.StdBasis +import Mathlib.Order.WellFounded +import Mathlib.Logic.Relation +import Mathlib.Algebra.Order.BigOperators.Group.Finset +import Mathlib.Algebra.Order.Ring.Defs + +open Module Submodule + +set_option linter.unusedSectionVars false + +namespace Floor + +/-! ## 1. Linear-algebra core -/ +section Core +variable {K V W U : Type*} [Field K] [AddCommGroup V] [Module K V] [AddCommGroup W] [Module K W] + [AddCommGroup U] [Module K U] + +/-- `b` is linearly independent modulo `M`. -/ +def IndepMod {ι : Type*} [Fintype ι] (M : Submodule K W) (b : ι → W) : Prop := + ∀ β : ι → K, (∑ i, β i • b i) ∈ M → ∀ i, β i = 0 + +/-- Independence mod `M` adds exactly `|ι|` to the dimension. -/ +theorem finrank_sup_of_indepMod [FiniteDimensional K W] {ι : Type*} [Fintype ι] + (M : Submodule K W) (b : ι → W) (hb : IndepMod M b) : + finrank K (M ⊔ span K (Set.range b) : Submodule K W) = finrank K M + Fintype.card ι := by + have hli : LinearIndependent K b := by + rw [Fintype.linearIndependent_iff] + intro g hg; exact hb g (by rw [hg]; exact M.zero_mem) + have hinf : M ⊓ span K (Set.range b) = ⊥ := by + rw [eq_bot_iff] + rintro x ⟨hxM, hxS⟩ + obtain ⟨β, rfl⟩ := (Submodule.mem_span_range_iff_exists_fun K).1 hxS + have h0 := hb β hxM + simp [h0] + have := Submodule.finrank_sup_add_finrank_inf_eq M (span K (Set.range b)) + rw [hinf, finrank_bot, finrank_span_eq_card hli] at this + omega + +/-- Core stay-count step (FANOUT F2 / RANKSTEINER R0(c) proof): +for `A, T ≤ S` with `T ⊆ ker ρ`, `dim ρ(A) + dim T ≤ dim S`. -/ +theorem finrank_map_add_le [FiniteDimensional K V] (ρ : V →ₗ[K] W) (S A T : Submodule K V) + (hA : A ≤ S) (hT : T ≤ S) (hTk : T ≤ LinearMap.ker ρ) : + finrank K (A.map ρ) + finrank K T ≤ finrank K S := by + have h1 := LinearMap.finrank_range_add_finrank_ker (ρ.domRestrict S) + rw [LinearMap.range_domRestrict] at h1 + have h2 : finrank K (A.map ρ) ≤ finrank K (S.map ρ) := + Submodule.finrank_mono (Submodule.map_mono hA) + have h3 : finrank K T ≤ finrank K (LinearMap.ker (ρ.domRestrict S)) := by + rw [← (Submodule.comapSubtypeEquivOfLe hT).finrank_eq] + apply Submodule.finrank_mono + intro x hx + simp only [Submodule.mem_comap, Submodule.subtype_apply] at hx + simpa [LinearMap.mem_ker] using hTk hx + omega + +/-- Tokens of distinct registers are independent: `dim span{e_i : i ∈ T} = |T|`. -/ +theorem finrank_tokens {ι : Type*} [Fintype ι] [DecidableEq ι] (T : Finset ι) : + finrank K (span K (Set.range fun i : T => (Pi.single (i : ι) (1 : K) : ι → K))) = T.card := by + have hli : LinearIndependent K (fun i : T => (Pi.single (i : ι) (1 : K) : ι → K)) := by + have := (Pi.basisFun K ι).linearIndependent.comp (Subtype.val : T → ι) Subtype.val_injective + simpa [Function.comp_def] using this + rw [finrank_span_eq_card hli, Fintype.card_coe] + +end Core + +/-! ## 2. The stay floor at one chart (F2, R0(c), R1, R3-count) + +Registers `ι`, rows in `ι → K`, `ρ : (ι → K) → W` (deletes helper coordinates). +At a chart c: `S` = span of every row ever at c; `Tok` = registers whose own token is held at c +and killed by ρ (the he helper enders, class N, and the hb helper births). +`hent`: dim S ≤ #entries = hd + he + ka + oa + hb + kb (forward span law + one entry per register, +ExportLaw.forward_count / stay_count / hOnce). -/ +section Stay +variable {K W U : Type*} [Field K] [AddCommGroup W] [Module K W] [AddCommGroup U] [Module K U] + {ι : Type*} [Fintype ι] [DecidableEq ι] + +/-- Generic stay floor: any set `X` of rows held at c has `rank ρ(X) ≤ hd + ka + oa + kb`. -/ +theorem stay_floor (ρ : (ι → K) →ₗ[K] W) (S : Submodule K (ι → K)) (X : Set (ι → K)) + (Tok : Finset ι) (hd he hb ka oa kb : ℕ) + (hX : X ⊆ S) (hTokS : ∀ i ∈ Tok, (Pi.single i 1 : ι → K) ∈ S) + (hTokρ : ∀ i ∈ Tok, ρ (Pi.single i 1) = 0) (hTokc : Tok.card = he + hb) + (hent : finrank K S ≤ hd + he + ka + oa + hb + kb) : + finrank K (span K (ρ '' X)) ≤ hd + ka + oa + kb := by + set T := span K (Set.range fun i : Tok => (Pi.single (i : ι) (1 : K) : ι → K)) + have hT : T ≤ S := by + rw [span_le]; rintro _ ⟨i, rfl⟩; exact hTokS i i.2 + have hTk : T ≤ LinearMap.ker ρ := by + rw [span_le]; rintro _ ⟨i, rfl⟩; exact hTokρ i i.2 + have hA : span K X ≤ S := by rw [span_le]; exact hX + have := finrank_map_add_le ρ S (span K X) T hA hT hTk + rw [Submodule.map_span, finrank_tokens] at this + omega + +/-- **R1 (local rank law)**: hd(c) ≥ rank(ρK_c + ρR(c)) − ka − oa − kb. -/ +theorem R1_local_rank (ρ : (ι → K) →ₗ[K] W) (S : Submodule K (ι → K)) (Kc R : Set (ι → K)) + (Tok : Finset ι) (hd he hb ka oa kb : ℕ) + (hK : Kc ⊆ S) (hR : R ⊆ S) (hTokS : ∀ i ∈ Tok, (Pi.single i 1 : ι → K) ∈ S) + (hTokρ : ∀ i ∈ Tok, ρ (Pi.single i 1) = 0) (hTokc : Tok.card = he + hb) + (hent : finrank K S ≤ hd + he + ka + oa + hb + kb) : + (finrank K (span K (ρ '' Kc) ⊔ span K (ρ '' R) : Submodule K W) : ℤ) - ka - oa - kb ≤ hd := by + have := stay_floor ρ S (Kc ∪ R) Tok hd he hb ka oa kb (Set.union_subset hK hR) hTokS hTokρ + hTokc hent + rw [Set.image_union, span_union] at this + omega + +/-- **F2 / R0(c) (ρ-refined count)**: hd(c) ≥ a_H(c) − slr(c), with +a_H = dim(ρK + ρHelpArr) − dim ρK and slr = ka + oa + kb − rank ρK. -/ +theorem F2_count (ρ : (ι → K) →ₗ[K] W) (S : Submodule K (ι → K)) (Kc H : Set (ι → K)) + (Tok : Finset ι) (hd he hb ka oa kb : ℕ) + (hK : Kc ⊆ S) (hH : H ⊆ S) (hTokS : ∀ i ∈ Tok, (Pi.single i 1 : ι → K) ∈ S) + (hTokρ : ∀ i ∈ Tok, ρ (Pi.single i 1) = 0) (hTokc : Tok.card = he + hb) + (hent : finrank K S ≤ hd + he + ka + oa + hb + kb) : + ((finrank K (span K (ρ '' Kc) ⊔ span K (ρ '' H) : Submodule K W) : ℤ) + - finrank K (span K (ρ '' Kc))) + - ((ka + oa + kb : ℕ) - (finrank K (span K (ρ '' Kc)) : ℤ)) ≤ hd := by + have := R1_local_rank ρ S Kc H Tok hd he hb ka oa kb hK hH hTokS hTokρ hTokc hent + push_cast; omega + +/-- **Hop count / R3 count**: helper arrivals `b` held at c whose ρ-rows are independent +modulo ρK_c + ρR(c) give hd(c) ≥ rank(ρK_c + ρR(c)) − ka − oa − kb + m. +With `R = ∅` this is F3's `#hops(c) ≤ hd(c) + slr(c)`; with type-A hops it is R3's +`hd(c) ≥ needR(c) + #A-hops(c)`. -/ +theorem hop_count [FiniteDimensional K W] {m : Type*} [Fintype m] + (ρ : (ι → K) →ₗ[K] W) (S : Submodule K (ι → K)) (Kc R : Set (ι → K)) (b : m → (ι → K)) + (Tok : Finset ι) (hd he hb ka oa kb : ℕ) + (hK : Kc ⊆ S) (hR : R ⊆ S) (hbS : ∀ j, b j ∈ S) + (hind : IndepMod (span K (ρ '' Kc) ⊔ span K (ρ '' R)) (fun j => ρ (b j))) + (hTokS : ∀ i ∈ Tok, (Pi.single i 1 : ι → K) ∈ S) + (hTokρ : ∀ i ∈ Tok, ρ (Pi.single i 1) = 0) (hTokc : Tok.card = he + hb) + (hent : finrank K S ≤ hd + he + ka + oa + hb + kb) : + (finrank K (span K (ρ '' Kc) ⊔ span K (ρ '' R) : Submodule K W) : ℤ) - ka - oa - kb + + Fintype.card m ≤ hd := by + have hX : Kc ∪ R ∪ Set.range b ⊆ S := by + refine Set.union_subset (Set.union_subset hK hR) ?_ + rintro _ ⟨j, rfl⟩; exact hbS j + have h := stay_floor ρ S _ Tok hd he hb ka oa kb hX hTokS hTokρ hTokc hent + rw [Set.image_union, Set.image_union, span_union, span_union, ← Set.range_comp] at h + have := finrank_sup_of_indepMod _ _ hind + simp only [Function.comp_def] at h + omega + +/-- F3 in FANOUT's π-form: HB_c is a basis of (KA_c + π HelpArr_c)/KA_c with π = π' ∘ ρ. +If π'(ρK_c) ⊆ KA_c, π-independence mod KA_c implies ρ-independence mod ρK_c (the F2 proof's +"apply π" step), so `hop_count` applies. -/ +theorem indepMod_of_proj {m : Type*} [Fintype m] (π' : W →ₗ[K] U) (M : Submodule K W) + (KA : Submodule K U) (hMK : M.map π' ≤ KA) (b : m → W) + (hb : IndepMod KA (fun j => π' (b j))) : IndepMod M b := by + intro β hβ + apply hb β + have : π' (∑ i, β i • b i) ∈ KA := hMK ⟨_, hβ, rfl⟩ + simpa [map_sum, map_smul] using this + +end Stay + +/-! ## 3. F1 descent lemma, R0(b), F4 / R2 single-source commodities + +Charts `C` with a well-founded strict order (chart containment; helper moves strictly ascend). +`P c` = π(S_c) (or ρ(S_c) for R2). `KA c` = the fixed kept part. `HB c` = a fixed set of helper +arrivals at c (a basis of the helper part); `tail b` = the chart b departed from and `vec b` its +(projected) row, which was held at `tail b`. -/ +section Descent +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] + {C : Type*} [PartialOrder C] [WellFoundedLT C] {Hop : Type*} + (KA P : C → Submodule K V) (HB : C → Set Hop) (tail : Hop → C) (vec : Hop → V) + +/-- One descent step c → c' : an element of HB_{c'} with tail c that φ sees. -/ +def Step (φ : V →ₗ[K] K) (c c' : C) : Prop := ∃ b ∈ HB c', tail b = c ∧ φ (vec b) ≠ 0 + +/-- s is a φ-source: φ(KA_s) ≠ 0. -/ +def Source (φ : V →ₗ[K] K) (s : C) : Prop := ∃ w ∈ KA s, φ w ≠ 0 + +variable {KA P HB tail vec} + +lemma exists_hop_of_sup {φ : V →ₗ[K] K} {A : Submodule K V} {X : Set V} {v : V} + (hA : ∀ w ∈ A, φ w = 0) (hv : v ∈ A ⊔ span K X) (hφ : φ v ≠ 0) : ∃ x ∈ X, φ x ≠ 0 := by + by_contra hcon + push Not at hcon + have : A ⊔ span K X ≤ LinearMap.ker φ := + sup_le (fun w hw => hA w hw) (span_le.2 fun x hx => hcon x hx) + exact hφ (this hv) + +lemma step_lt (hvec : ∀ c, ∀ b ∈ HB c, vec b ∈ P (tail b) ∧ tail b < c) + {φ : V →ₗ[K] K} {c c' : C} (h : Step HB tail vec φ c c') : c < c' := by + obtain ⟨b, hb, rfl, -⟩ := h; exact (hvec _ b hb).2 + +lemma rtg_le (hvec : ∀ c, ∀ b ∈ HB c, vec b ∈ P (tail b) ∧ tail b < c) + {φ : V →ₗ[K] K} {c c' : C} (h : Relation.ReflTransGen (Step HB tail vec φ) c c') : c ≤ c' := by + induction h with + | refl => exact le_rfl + | tail _ hs ih => exact ih.trans (step_lt hvec hs).le + +/-- **F1 DESCENT LEMMA.** Hypotheses: `hP` P(c) ⊆ KA_c + span vec(HB_c) (forward span law plus the +choice of HB_c); `hvec` every b ∈ HB_c was held at its tail, which is strictly below c. +If φ kills KA_t and sees some v ∈ P(t), there is a φ-source s and a first hop b ∈ HB_{c₁} with +tail s, φ(vec b) ≠ 0, followed by a chain of φ-visible hops c₁ → … → t; hence s < c₁ ≤ t. -/ +theorem F1_descent (hP : ∀ c, P c ≤ KA c ⊔ span K (vec '' HB c)) + (hvec : ∀ c, ∀ b ∈ HB c, vec b ∈ P (tail b) ∧ tail b < c) + (φ : V →ₗ[K] K) (t : C) (hKt : ∀ w ∈ KA t, φ w = 0) (v : V) (hv : v ∈ P t) (hφv : φ v ≠ 0) : + ∃ s c₁, ∃ b ∈ HB c₁, Source KA φ s ∧ tail b = s ∧ φ (vec b) ≠ 0 ∧ s < c₁ ∧ c₁ ≤ t ∧ + Relation.ReflTransGen (Step HB tail vec φ) c₁ t := by + -- Good c: a source and a first hop ending in a chain to c. + have key : ∀ c, ∀ v ∈ P c, φ v ≠ 0 → Source KA φ c ∨ + ∃ s c₁, ∃ b ∈ HB c₁, Source KA φ s ∧ tail b = s ∧ φ (vec b) ≠ 0 ∧ + Relation.ReflTransGen (Step HB tail vec φ) c₁ c := by + intro c + induction c using WellFoundedLT.induction with + | _ c ih => + intro v hv hφv + by_cases hsrc : Source KA φ c + · exact Or.inl hsrc + · right + have hA : ∀ w ∈ KA c, φ w = 0 := by + intro w hw; by_contra h; exact hsrc ⟨w, hw, h⟩ + obtain ⟨x, ⟨b, hb, rfl⟩, hx⟩ := exists_hop_of_sup hA (hP c hv) hφv + obtain ⟨hbP, hlt⟩ := hvec c b hb + rcases ih (tail b) hlt (vec b) hbP hx with hs | ⟨s, c₁, b₁, hb₁, hs, ht, hφ, hr⟩ + · exact ⟨tail b, c, b, hb, hs, rfl, hx, Relation.ReflTransGen.refl⟩ + · exact ⟨s, c₁, b₁, hb₁, hs, ht, hφ, hr.tail ⟨b, hb, rfl, hx⟩⟩ + rcases key t v hv hφv with hs | ⟨s, c₁, b, hb, hs, ht, hφ, hr⟩ + · obtain ⟨w, hw, hne⟩ := hs; exact absurd (hKt w hw) hne + · refine ⟨s, c₁, b, hb, hs, ht, hφ, ?_, rtg_le hvec hr, hr⟩ + rw [← ht]; exact (hvec c₁ b hb).2 + +/-- **R0(b)**: P(c) ⊆ Σ_{c' ≤ c} KA_{c'} (induction on the chart order). -/ +theorem R0b (hP : ∀ c, P c ≤ KA c ⊔ span K (vec '' HB c)) + (hvec : ∀ c, ∀ b ∈ HB c, vec b ∈ P (tail b) ∧ tail b < c) (c : C) : + P c ≤ ⨆ (c' : C) (_ : c' ≤ c), KA c' := by + induction c using WellFoundedLT.induction with + | _ c ih => + refine (hP c).trans (sup_le ?_ ?_) + · exact le_iSup₂_of_le c le_rfl le_rfl + · rw [span_le] + rintro _ ⟨b, hb, rfl⟩ + obtain ⟨hbP, hlt⟩ := hvec c b hb + have h1 := ih (tail b) hlt hbP + refine (iSup₂_le fun c' hc' => le_iSup₂_of_le (f := fun c' (_ : c' ≤ c) => KA c') c' + (hc'.trans hlt.le) le_rfl) h1 + +/-- Separating functional (FANOUT F4 / RANKSTEINER R2 existence step): if n ∉ W there is φ with +φ(W) = 0 and φ(n) ≠ 0. -/ +theorem exists_sep [FiniteDimensional K V] (W : Submodule K V) (n : V) (hn : n ∉ W) : + ∃ φ : V →ₗ[K] K, φ n ≠ 0 ∧ ∀ w ∈ W, φ w = 0 := by + obtain ⟨f, hf, hW⟩ := Submodule.exists_dual_map_eq_bot_of_notMem hn inferInstance + refine ⟨f, hf, fun w hw => ?_⟩ + have : f w ∈ W.map f := ⟨w, hw, rfl⟩ + rw [hW] at this; simpa using this + +/-- **F4 / R2 single-source commodity.** If φ kills KA_t and every KA_{s'} with s' < t, s' ≠ s, +and sees some v ∈ P(t), then the commodity leaves s by its own first hop: some b ∈ HB_{c₁} with +tail s, φ(vec b) ≠ 0, s < c₁ ≤ t. -/ +theorem F4_single_source (hP : ∀ c, P c ≤ KA c ⊔ span K (vec '' HB c)) + (hvec : ∀ c, ∀ b ∈ HB c, vec b ∈ P (tail b) ∧ tail b < c) + (φ : V →ₗ[K] K) (s t : C) (hKt : ∀ w ∈ KA t, φ w = 0) + (hW : ∀ s', s' < t → s' ≠ s → ∀ w ∈ KA s', φ w = 0) + (v : V) (hv : v ∈ P t) (hφv : φ v ≠ 0) : + ∃ c₁, ∃ b ∈ HB c₁, tail b = s ∧ φ (vec b) ≠ 0 ∧ s < c₁ ∧ c₁ ≤ t := by + obtain ⟨s₀, c₁, b, hb, ⟨w, hw, hne⟩, ht, hφ, hlt, hle, -⟩ := + F1_descent hP hvec φ t hKt v hv hφv + have : s₀ = s := by + by_contra h; exact hne (hW s₀ (lt_of_lt_of_le hlt hle) h w hw) + subst this + exact ⟨c₁, b, hb, ht, hφ, hlt, hle⟩ + +end Descent + +/-! ## 4. R3 triangular independence -/ +section R3 +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] + {C : Type*} [PartialOrder C] {m : Type*} [Fintype m] [DecidableEq m] + +/-- Abstract triangular independence: ψ_i(b_j) ≠ 0 for i ≠ j only if s_i < s_j, ψ_j(b_j) ≠ 0, +every ψ_i kills M. Then the b_j are independent modulo M. -/ +theorem tri_indepMod (s : m → C) (b : m → V) (ψ : m → V →ₗ[K] K) (M : Submodule K V) + (hM : ∀ i, ∀ w ∈ M, ψ i w = 0) (hdiag : ∀ j, ψ j (b j) ≠ 0) + (htri : ∀ i j, i ≠ j → ψ i (b j) ≠ 0 → s i < s j) : IndepMod M b := by + classical + intro β hβ + by_contra hne + push Not at hne + set J := Finset.univ.filter fun j => β j ≠ 0 + have hJ : (J.image s).Nonempty := by + obtain ⟨j, hj⟩ := hne; exact ⟨s j, Finset.mem_image.2 ⟨j, by simp [J, hj], rfl⟩⟩ + obtain ⟨x, hx⟩ := Finset.exists_maximal hJ + obtain ⟨j0, hj0J, rfl⟩ := Finset.mem_image.1 hx.1 + have hj0 : β j0 ≠ 0 := by simpa [J] using hj0J + have h0 := hM j0 _ hβ + rw [map_sum, Finset.sum_eq_single j0] at h0 + · simp only [map_smul, smul_eq_mul] at h0 + exact mul_ne_zero hj0 (hdiag j0) h0 + · intro j _ hjj + simp only [map_smul, smul_eq_mul] + by_cases hbj : β j = 0 + · simp [hbj] + · by_contra hprod + have hψ : ψ j0 (b j) ≠ 0 := right_ne_zero_of_mul hprod + have hlt := htri j0 j (Ne.symm hjj) hψ + have hjmem : s j ∈ J.image s := Finset.mem_image.2 ⟨j, by simp [J, hbj], rfl⟩ + exact hlt.not_ge (hx.2 hjmem hlt.le) + · intro h; exact absurd (Finset.mem_univ _) h + +/-- **R3**: first hops b_j into c from pairwise distinct sources s_j, each with an R2 commodity +(t_j, s_j, ψ_j): ψ_j kills Kρ_{c'} for every c' ≤ t_j, c' ≠ s_j; s_j < c ≤ t_j; ψ_j(b_j) ≠ 0; +b_j ∈ Σ_{c' ≤ s_j} Kρ_{c'} (R0(b)). Then the b_j are independent mod Kρ_c, and mod Kρ_c + ρR(c) +if every ψ_j kills ρR(c) ("type A at c"). -/ +theorem R3_indep (Kρ : C → Submodule K V) (R : Submodule K V) (c : C) (s t : m → C) + (hs : Function.Injective s) (b : m → V) (ψ : m → V →ₗ[K] K) + (hψK : ∀ i c', c' ≤ t i → c' ≠ s i → ∀ w ∈ Kρ c', ψ i w = 0) + (hψR : ∀ i, ∀ w ∈ R, ψ i w = 0) + (hsc : ∀ j, s j < c) (hct : ∀ j, c ≤ t j) (hdiag : ∀ j, ψ j (b j) ≠ 0) + (hb : ∀ j, b j ∈ ⨆ (c' : C) (_ : c' ≤ s j), Kρ c') : + IndepMod (Kρ c ⊔ R) b := by + apply tri_indepMod s b ψ + · intro i w hw + obtain ⟨y, hy, z, hz, rfl⟩ := Submodule.mem_sup.1 hw + rw [map_add, hψK i c (hct i) (hsc i).ne' y hy, hψR i z hz, add_zero] + · exact hdiag + · intro i j hij hψ + by_contra hlt + apply hψ + have hle : (⨆ (c' : C) (_ : c' ≤ s j), Kρ c') ≤ LinearMap.ker (ψ i) := by + refine iSup₂_le fun c' hc' w hw => ?_ + have hne : c' ≠ s i := by + rintro rfl + rcases hc'.lt_or_eq with h | h + · exact hlt h + · exact hij (hs h) + exact hψK i c' ((hc'.trans (hsc j).le).trans (hct i)) hne w hw + exact hle (hb j) + +end R3 + +/-! ## 5. LP weak duality (FANOUT F3 / RANKSTEINER R4 certificate) + +Primal: min cᵀx s.t. A x ≥ b, x ≥ 0. A dual vector y ≥ 0 with yᵀA ≤ c bounds every feasible +objective from below. The LP data and the dual vector are checked in exact Fractions by +lp2.py / rslp.py; here only the generic certificate lemma. -/ +section LP +variable {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] + {r n : Type*} [Fintype r] [Fintype n] + +theorem weak_duality (A : r → n → 𝕜) (b : r → 𝕜) (c : n → 𝕜) (x : n → 𝕜) (y : r → 𝕜) + (hx : ∀ j, 0 ≤ x j) (hAx : ∀ i, b i ≤ ∑ j, A i j * x j) + (hy : ∀ i, 0 ≤ y i) (hyA : ∀ j, ∑ i, y i * A i j ≤ c j) : + ∑ i, y i * b i ≤ ∑ j, c j * x j := by + calc ∑ i, y i * b i ≤ ∑ i, y i * ∑ j, A i j * x j := + Finset.sum_le_sum fun i _ => mul_le_mul_of_nonneg_left (hAx i) (hy i) + _ = ∑ j, (∑ i, y i * A i j) * x j := by + simp only [Finset.mul_sum, Finset.sum_mul] + rw [Finset.sum_comm]; congr 1; ext j; congr 1; ext i; ring + _ ≤ ∑ j, c j * x j := Finset.sum_le_sum fun j _ => mul_le_mul_of_nonneg_right (hyA j) (hx j) + +/-- The floor as used: helper cost ≥ κ·Σ_c hd(c), the native gives a feasible x of objective +≤ Σ_c hd(c), and y is a dual certificate. Then cost ≥ κ · bᵀy. -/ +theorem floor_of_certificate (A : r → n → 𝕜) (b : r → 𝕜) (c : n → 𝕜) (x : n → 𝕜) (y : r → 𝕜) + (hx : ∀ j, 0 ≤ x j) (hAx : ∀ i, b i ≤ ∑ j, A i j * x j) + (hy : ∀ i, 0 ≤ y i) (hyA : ∀ j, ∑ i, y i * A i j ≤ c j) + (κ HD cost : 𝕜) (hκ : 0 ≤ κ) (hobj : ∑ j, c j * x j ≤ HD) (hcost : κ * HD ≤ cost) : + κ * ∑ i, y i * b i ≤ cost := + (mul_le_mul_of_nonneg_left ((weak_duality A b c x y hx hAx hy hyA).trans hobj) hκ).trans hcost + +end LP + +end Floor + +#print axioms Floor.F1_descent +#print axioms Floor.R0b +#print axioms Floor.F4_single_source +#print axioms Floor.F2_count +#print axioms Floor.R1_local_rank +#print axioms Floor.hop_count +#print axioms Floor.indepMod_of_proj +#print axioms Floor.R3_indep +#print axioms Floor.weak_duality +#print axioms Floor.floor_of_certificate +#print axioms Floor.exists_sep diff --git a/research/p104-lean-premises/lean/Nov15/FloorCert.lean b/research/p104-lean-premises/lean/Nov15/FloorCert.lean new file mode 100644 index 0000000000..801d56c026 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorCert.lean @@ -0,0 +1,154 @@ +/- +FloorCert : the RANKSTEINER R4 dual certificate for the class-K junk floor +(780 paid stops = 1,081.31 D0/call), checked in Lean by kernel evaluation (`decide +kernel`, no +`native_decide`, so no `Lean.ofReduceBool`). See FloorCert.md. + +The LP is the support sub-LP of rslp.py's LP (only rows with positive dual: 892 rows, 18,868 +columns, 31,249 nonzeros), exported by Nov15/floorcert/export_cert.py into FloorCertData.lean. +All of A, b, c are integers; the dual is y = Y / 8 with Y integer. + +Build (one at a time): + lake env lean -o .lake/build/lib/lean/Nov15/FloorCertDefs.olean Nov15/FloorCertDefs.lean + lake env lean -o .lake/build/lib/lean/Nov15/FloorCertData.olean Nov15/FloorCertData.lean (90 s, 2.1 GB) + lake env lean -o .lake/build/lib/lean/Nov15/FloorCertCheck.olean Nov15/FloorCertCheck.lean (20 s, 2.3 GB) + lake env lean -o .lake/build/lib/lean/Nov15/FloorCert.olean Nov15/FloorCert.lean +(needs the Floor / FloorGlue / ExportLaw oleans.) +-/ +import Nov15.FloorCertCheck +import Nov15.FloorGlue +import Mathlib.Analysis.SpecialFunctions.Log.Basic + +open Finset + +set_option linter.unusedSectionVars false + +namespace FloorCert + +/-! ## 2. The LP over any ordered field -/ + +section Field +variable {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] + +/-- column j of the exported LP -/ +def col (j : Fin nCols) : Int × List (Nat × Int) := colList.getD j (0, []) + +/-- A i j: the coefficient of column j in row i (sum of the sparse entries with row index i). -/ +def A (i : Fin nRows) (j : Fin nCols) : 𝕜 := + ((col j).2.map fun p => if p.1 = i.val then (p.2 : 𝕜) else 0).sum + +/-- right-hand sides -/ +def b (i : Fin nRows) : 𝕜 := (bList.getD i 0 : 𝕜) + +/-- costs (1 on fresh heads x_m and on y_c, 0 on z / a) -/ +def c (j : Fin nCols) : 𝕜 := ((col j).1 : 𝕜) + +/-- the dual vector y = Y / 8 -/ +def y (i : Fin nRows) : 𝕜 := (Ytree.get i : 𝕜) / (den : 𝕜) + +lemma den_pos : (0 : 𝕜) < (den : 𝕜) := by norm_num [den] + +theorem y_nonneg (i : Fin nRows) : 0 ≤ (y i : 𝕜) := + div_nonneg (by exact_mod_cast Y_nonneg_ok i) den_pos.le + +/-- sparse-column identity: Σ_{i if p.1 = i.val then (p.2 : 𝕜) else 0).sum + = ((colDot Y l : Int) : 𝕜) := by + induction l with + | nil => simp [colDot] + | cons p l ih => + have hp : p.1 < R := hl p (by simp) + have ih' := ih fun q hq => hl q (by simp [hq]) + simp only [List.map_cons, List.sum_cons, mul_add, Finset.sum_add_distrib, ih'] + have h1 : ∑ i : Fin R, (Y i : 𝕜) * (if p.1 = i.val then (p.2 : 𝕜) else 0) + = (Y p.1 : 𝕜) * p.2 := by + rw [Finset.sum_eq_single ⟨p.1, hp⟩] + · simp + · intro i _ hi + have : p.1 ≠ i.val := fun h => hi (Fin.ext h.symm) + simp [this] + · simp + rw [h1] + simp [colDot] + +theorem yA_le (j : Fin nCols) : ∑ i, (y i : 𝕜) * A i j ≤ c j := by + have hmem : col j ∈ colList := by + have hj : (j : Nat) < colList.length := by rw [len_ok.1]; exact j.2 + simp only [col, List.getD_eq_getElem?_getD, List.getElem?_eq_getElem hj, Option.getD_some] + exact List.getElem_mem hj + have hok := List.all_eq_true.1 cols_ok _ hmem + simp only [colOK, Bool.and_eq_true, List.all_eq_true, decide_eq_true_eq] at hok + obtain ⟨hidx, hdot⟩ := hok + have hs := sum_sparse (𝕜 := 𝕜) (R := nRows) Ytree.get (col j).2 hidx + have : ∑ i, (y i : 𝕜) * A i j = ((colDot Ytree.get (col j).2 : Int) : 𝕜) / (den : 𝕜) := by + rw [← hs, div_eq_mul_inv, Finset.sum_mul] + refine Finset.sum_congr rfl fun i _ => ?_ + simp only [y, A]; ring + rw [this, div_le_iff₀ den_pos, c] + have : ((colDot Ytree.get (col j).2 : Int) : 𝕜) ≤ ((den * (col j).1 : Int) : 𝕜) := by + exact_mod_cast hdot + push_cast at this; linarith + +lemma bDot_eq (Y : Nat → Int) (bs : List Int) (i0 : Nat) : + ((bDot Y bs i0 : Int) : 𝕜) = ∑ k ∈ range bs.length, (Y (i0 + k) : 𝕜) * (bs.getD k 0 : 𝕜) := by + induction bs generalizing i0 with + | nil => simp [bDot] + | cons b bs ih => + rw [List.length_cons, Finset.sum_range_succ', bDot] + push_cast + rw [ih (i0 + 1)] + simp [add_comm, add_left_comm] + +theorem yb_eq : ∑ i, (y i : 𝕜) * b i = 780 := by + have h := bDot_eq (𝕜 := 𝕜) Ytree.get bList 0 + rw [bDot_ok, len_ok.2] at h + simp only [zero_add] at h + rw [← Fin.sum_univ_eq_sum_range (fun k => (Ytree.get k : 𝕜) * (bList.getD k 0 : 𝕜))] at h + have : ∑ i, (y i : 𝕜) * b i = (∑ i : Fin nRows, (Ytree.get i : 𝕜) * (bList.getD i 0 : 𝕜)) / den := by + rw [div_eq_mul_inv, Finset.sum_mul]; refine Finset.sum_congr rfl fun i _ => ?_; simp only [y, b]; ring + rw [this, ← h] + have := (den_pos (𝕜 := 𝕜)).ne' + push_cast; field_simp + +/-! ## 3. The class-K floor -/ + +/-- **Class-K floor, LP form.** Any x ≥ 0 satisfying the exported rows (the native-feasibility map +is the documented Python extraction) has objective ≥ 780. -/ +theorem lp_floor (x : Fin nCols → 𝕜) (hx : ∀ j, 0 ≤ x j) (hAx : ∀ i, b i ≤ ∑ j, A i j * x j) : + 780 ≤ ∑ j, c j * x j := by + have := Floor.weak_duality A b c x y hx hAx y_nonneg yA_le + rwa [yb_eq] at this + +/-- **Every class-K build has ≥ 780 paid stops**: a build whose native maps to a feasible x with +objective ≤ #paid stays. -/ +theorem stops_ge_780 {σ : Type*} (x : Fin nCols → 𝕜) (hx : ∀ j, 0 ≤ x j) + (hAx : ∀ i, b i ≤ ∑ j, A i j * x j) (stays : Finset σ) (hobj : ∑ j, c j * x j ≤ stays.card) : + (780 : 𝕜) ≤ stays.card := + (lp_floor x hx hAx).trans hobj + +/-- **Cost form** (FloorGlue.global_floor_of_certificate with the checked certificate): per-stop +cost ≥ κ gives total cost ≥ 780 κ. With 𝕜 = ℝ and κ = 2 ln 2 this is 1,081.31 D0/call. -/ +theorem cost_ge_780 {σ : Type*} (x : Fin nCols → 𝕜) (hx : ∀ j, 0 ≤ x j) + (hAx : ∀ i, b i ≤ ∑ j, A i j * x j) (stays : Finset σ) (cost : σ → 𝕜) (κ : 𝕜) (hκ0 : 0 ≤ κ) + (hκ : ∀ s ∈ stays, κ ≤ cost s) (hobj : ∑ j, c j * x j ≤ stays.card) : + κ * 780 ≤ ∑ s ∈ stays, cost s := by + have := FloorGlue.global_floor_of_certificate A b c x y hx hAx y_nonneg yA_le stays cost κ hκ0 hκ hobj + rwa [yb_eq] at this + +end Field + +/-- the real-valued instance: κ = 2 ln 2 per stop. -/ +theorem cost_ge_real {σ : Type*} (x : Fin nCols → ℝ) (hx : ∀ j, 0 ≤ x j) + (hAx : ∀ i, b i ≤ ∑ j, A i j * x j) (stays : Finset σ) (cost : σ → ℝ) + (hκ : ∀ s ∈ stays, 2 * Real.log 2 ≤ cost s) (hobj : ∑ j, c j * x j ≤ stays.card) : + 2 * Real.log 2 * 780 ≤ ∑ s ∈ stays, cost s := + cost_ge_780 x hx hAx stays cost _ (by positivity) hκ hobj + +end FloorCert + +#print axioms FloorCert.yA_le +#print axioms FloorCert.yb_eq +#print axioms FloorCert.lp_floor +#print axioms FloorCert.stops_ge_780 +#print axioms FloorCert.cost_ge_780 +#print axioms FloorCert.cost_ge_real diff --git a/research/p104-lean-premises/lean/Nov15/FloorCert.md b/research/p104-lean-premises/lean/Nov15/FloorCert.md new file mode 100644 index 0000000000..391d9dc7ac --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorCert.md @@ -0,0 +1,65 @@ +# FloorCert: the class-K LP certificate (780 stops) checked in Lean. No sorry, kernel `decide` only +Files: FloorCertDefs.lean (core only), FloorCertData.lean (generated), FloorCertCheck.lean (kernel checks), FloorCert.lean (bridge + floor). Exporter: floorcert/export_cert.py (py312np); row/column names in floorcert/floorcert_index.txt. +Axioms: the four checks in FloorCertCheck use **no axioms at all**; every theorem in FloorCert uses [propext, Classical.choice, Quot.sound]. No `native_decide`, so no `Lean.ofReduceBool`. + +## Size +- rslp.py's full LP: 5,074 rows × 32,584 columns, 303,183 nonzeros. The exporter re-checks the full certificate exactly in Fractions (y ≥ 0, yᵀA ≤ c, bᵀy = 780) before exporting. +- Exported: the **support sub-LP**, i.e. the rows with positive dual. That is 892 rows (284 commodity u, 512 λ, 51 β, 45 α; every γ dual is 0) × 18,868 columns (the columns meeting a kept row), 31,249 nonzeros. +- Integer data: y = Y/8 with Y ∈ ℤ, kept in a Braun tree for log-depth kernel lookup. +- This is sound as a relaxation. Dropping rows weakens what the native must satisfy. Dropped columns meet no kept row and have cost ≥ 0, so the objective over the kept columns is ≤ the full objective. +- No α/β row is used with an empty sum (exporter flag list empty). +- Cost: Data 90 s / 2.1 GB; Check 20 s / 2.4 GB; FloorCert 8 s / 2.3 GB. A negative control (bᵀy = 781) is rejected by the kernel. + +## Theorems +- FloorCertCheck: `len_ok`, `Y_nonneg_ok`, `bDot_ok` (Σ Y_i b_i = 780·8), `cols_ok` (every column: row indices < 892 and Σ Y_i A_ij ≤ 8 c_j). All by `decide +kernel`. +- FloorCert, over any ordered field 𝕜: + - definitions A, b, c, y; + - `y_nonneg`, `yA_le`, `yb_eq` (bᵀy = 780), via the generic `sum_sparse` / `bDot_eq` bridges; + - `lp_floor`: Floor.weak_duality gives 780 ≤ cᵀx; + - `stops_ge_780`: 780 ≤ #stays when cᵀx ≤ #stays; + - `cost_ge_780`: FloorGlue.global_floor_of_certificate gives cost ≥ 780κ; + - `cost_ge_real`: κ = 2 ln 2, i.e. 1,081.31 D0/call. + +## Native feasibility in Lean (NOTE: the NativeFeas files are NOT part of this package; this section is kept for context only) +Files: NativeFeasData.lean (generated by floorcert/export_native.py), NativeFeasCheck.lean (kernel checks, core only), NativeFeas.lean (bridge). +- The native #7623's point x, by rsnative.py's map: y_c = hd(c) on Nat; each native first hop s -> c (helper move whose rho-row has psi != 0 + for a certified commodity of source s) sets z_{s,c} = 1, and a_{s,c} = 1 when it serves a commodity that is type A at c; a hop into a + non-Nat chart c sets the fresh minimal head s + v, with v the least vector of span c \ span s. That head covers every commodity (t, s) + with c <= t, so one head per (s, c) suffices, and distinct heads are counted once. +- export_native.py checks the FULL LP exactly first (4,915 rslp rows; the 159 alpha/beta rows that export_cert also lists with an empty sum + read y_c >= -slr_c / y_c >= needR_c and hold since hd >= L): 0 violated. Full objective **1,999** = 1,840 (hd on Nat) + 159 distinct fresh + heads. RANKSTEINER's 2,037 counted fresh heads per (s, c) hop (197); both are <= 3,432 paid stops. On the 18,868 support columns x has + 724 nonzeros and cᵀx = **1,964**. +- NativeFeasCheck, by `decide +kernel`: `xlen_ok` (length 18,868), `x_nonneg_ok`, `obj_ok` (cᵀx = 1,964 via a tree accumulator), + `rows_ok` (every b_i <= (A·x)_i; A·x accumulated column by column into a Braun tree, `ITree.upd`). The first two use no axioms; the + last two use [propext]. 41 s, 3.4 GB. +- NativeFeas, over any ordered field: `get_upd` / `get_addEnts` / `get_accum` / `get_costAcc` (accumulator semantics, proved), + `native_nonneg`, `native_feasible` (∀ i, b i <= Σ_j A i j · xN j), `native_obj` (Σ_j c j · xN j = 1964), and + `floor_le_native`: 780 <= cᵀxN <= 3,432, i.e. lp_floor applied to the native's own point. 15 s, 2.3 GB. Axioms [propext, Classical.choice, Quot.sound]. +- Negative controls (scratch file, deleted): x_52 lowered by 1 (x_52 > 0 in a tight row; 381 of the 892 rows are tight) is rejected by + the kernel; cᵀx = 1,965 is rejected. (Lowering x_0 is NOT rejected: that a-column is not needed, so it is not a control.) + +## Extraction: two independent extractions agree +floorcert/indep/: indep_word.py is a fresh exact rho replay of the word written from THEORY.md (no rs*.py, FANOUT/*.py or geom.py +imports or exec). It rebuilds K_c, R(c), ka/oa/kb, paid helper stays and helper hops. exported.py parses FloorCertData.lean + +floorcert_index.txt into named rows. Each script diffs its rows against the exported Lean data. +- indep_R1.py (R1 local rank rows; ranks EXACT over Q, the originals were mod 2^61-1): needR 0 diffs vs rsdata.pkl on all 1,095 charts, + slr 0 diffs vs firsthop_data.pkl, hd 0 diffs (3,432 stops); all **512 exported lambda rows** (y_c >= max(0, needK, needR); needK read + from the gap map/gapmap.csv) match. R1 gain 98, sum L 685, as RANKSTEINER reports. 2 s. +- indep_F4.py (F4/R2 single-source rows): the commodity set searched from scratch (every target t, every source s below t with dim <= 3 and K_s != 0; + (t, s) is a commodity iff R(t) is not inside W_{-s}), ranks mod q = 1,000,003 with numpy in the quotient by the fixed part of W (rsess + used 2^61-1 and divide-and-conquer; non-membership mod q implies it over Q). **2,850 commodities, identical to rsess_d3** (0 / 0 + diffs); R0(b) holds mod q at all 600 targets; all 2,850 psi witnesses re-verified exactly on the independent replay; all 284 exported + u rows are commodities with rhs 1. 58 min, 1 core, 0.2 GB. +- indep_R3.py (R3 hop rows): type A recomputed from the psi witnesses on the independent replay: 5,676 (k, c) pairs, 0 per-commodity diffs. + Rebuilt in the exported names (fresh heads as canonical GF(2) RREF): **all 284 u rows, 51 beta rows and 45 alpha rows** match exactly + (entries and rhs); column costs 0 diffs. So all **892 kept rows** were rebuilt independently. 3 s. +- indep_native.py: the native's x rebuilt from the independent replay: 0 diffs on the 18,868 support columns, cᵀx = 1,964. + +## What stays checked input (documented Python) +- The extraction of the rows from the word: rsdata.py, rsess.py, rslp.py, and export_cert.py's row/column naming. **Now cross-checked**: + a second, independent extraction (floorcert/indep/) gives the same 892 rows. Both implement the same written definitions (THEORY R0-R3, + FANOUT F2), so a wrong definition would not be caught; a coding error in either would be. needK still comes from the gap map/gapmap.csv. +- The native-feasibility map is now in Lean (NativeFeas.lean), given the exported x. The map's soundness (that the native's own + structure forces these values, THEORY R4) is the written argument; the x values were extracted twice and agree. +- From FloorGlue: per-stop cost >= κ, and hd(c) equal to the stay-list fibre. diff --git a/research/p104-lean-premises/lean/Nov15/FloorCertCheck.lean b/research/p104-lean-premises/lean/Nov15/FloorCertCheck.lean new file mode 100644 index 0000000000..53d17c466b --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorCertCheck.lean @@ -0,0 +1,27 @@ +/- +FloorCertCheck : the four integer checks of the class-K certificate, by +kernel evaluation (`decide +kernel`; no `native_decide`, no `Lean.ofReduceBool`). Separate file so +the kernel run does not share memory with Mathlib elaboration. See FloorCert.md. +-/ +import Nov15.FloorCertData + +set_option maxHeartbeats 0 + +namespace FloorCert + +/-! ## 1. The integer checks, by kernel evaluation -/ + +theorem len_ok : colList.length = nCols ∧ bList.length = nRows := by decide +kernel + +theorem Y_nonneg_ok : ∀ i : Fin nRows, 0 ≤ Ytree.get i := by decide +kernel + +theorem bDot_ok : bDot Ytree.get bList 0 = 780 * den := by decide +kernel + +theorem cols_ok : colList.all (colOK nRows Ytree.get den) = true := by decide +kernel + +end FloorCert + +#print axioms FloorCert.len_ok +#print axioms FloorCert.Y_nonneg_ok +#print axioms FloorCert.bDot_ok +#print axioms FloorCert.cols_ok diff --git a/research/p104-lean-premises/lean/Nov15/FloorCertData.lean b/research/p104-lean-premises/lean/Nov15/FloorCertData.lean new file mode 100644 index 0000000000..716a7fa462 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorCertData.lean @@ -0,0 +1,18948 @@ +/- AUTO-GENERATED by Nov15/floorcert/export_cert.py from internal notes + Support sub-LP of the RANKSTEINER R4 LP (rows with positive dual). Do not edit. -/ +import Nov15.FloorCertDefs + +set_option maxHeartbeats 0 + +namespace FloorCert + +def nRows : Nat := 892 +def nCols : Nat := 18868 +def den : Nat := 8 + +/-- scaled dual: y_i = Ytree.get i / den (Braun-tree indexed) -/ +def Ytree : ITree := (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (1) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (2) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (3) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (6) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (2) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (6) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (1) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (3) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (1) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (2) ITree.leaf) (7) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (2) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (3) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (3) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (2) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))) (1) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (6) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (1) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf))) (2) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (2) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (3) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (2) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (6) ITree.leaf) (8) (ITree.node ITree.leaf (2) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (6) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (4) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (6) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (3) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (2) ITree.leaf) (4) ITree.leaf)) (1) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (6) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (4) (ITree.node ITree.leaf (2) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (2) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (6) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (2) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (1) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (3) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (2) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (1) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf))) (2) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (6) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (3) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (2) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (6) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (2) ITree.leaf) (8) (ITree.node ITree.leaf (6) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (2) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (5) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (3) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (3) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (1) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (6) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (6) ITree.leaf) (1) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (6) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (5) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (3) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (7) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (2) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (6) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (1) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (2) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (6) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (6) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (6) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (2) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (4) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (2) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (6) ITree.leaf) (4) ITree.leaf)) (1) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (6) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (2) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (4) (ITree.node ITree.leaf (8) ITree.leaf)) (1) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (7) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (2) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (3) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))) (4) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (4) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (4) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (3) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (4) (ITree.node (ITree.node (ITree.node ITree.leaf (5) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)))) (2) (ITree.node (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (2) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (2) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) (ITree.node ITree.leaf (8) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))) (1) (ITree.node (ITree.node (ITree.node (ITree.node ITree.leaf (4) ITree.leaf) (8) (ITree.node ITree.leaf (4) ITree.leaf)) (4) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf)) (1) (ITree.node (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf) (8) (ITree.node (ITree.node ITree.leaf (8) ITree.leaf) (8) ITree.leaf))))))))) + +/-- right-hand sides b_i -/ +def bList : List Int := [(1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (2), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (2), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (2), (1), (1), (1), (1), (1), (1), (1), (2), (1), (1), (1), (1), (1), (1), (1), (1), (0), (1), (1), (0), (1), (1), (1), (1), (1), (0), (1), (1), (1), (1), (0), (1), (1), (0), (1), (1), (0), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (0), (1), (0), (1), (0), (1), (0), (1), (1), (1), (1), (1), (1), (1), (1), (0), (1), (1), (1), (1), (1), (1), (1), (1), (3), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (0), (1), (0), (1), (1), (1), (1), (1), (1), (1), (1), (0), (1), (1), (1), (0), (1), (1), (1), (1), (0), (1), (1), (4), (2), (1), (0), (1), (1), (1), (0), (1), (1), (0), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (3), (7), (2), (2), (2), (3), (0), (3), (1), (1), (2), (2), (2), (0), (2), (1), (2), (1), (1), (0), (2), (2), (2), (2), (2), (2), (0), (1), (1), (1), (1), (1), (1), (2), (2), (2), (2), (1), (4), (1), (0), (2), (2), (2), (2), (1), (1), (1), (1), (1), (1), (2), (2), (1), (1), (1), (2), (2), (2), (2), (2), (2), (2), (1), (1), (1), (1), (1), (1), (2), (2), (2), (2), (2), (1), (1), (1), (1), (1), (1), (2), (2), (1), (2), (0), (0), (1), (1), (1), (1), (1), (1), (1), (2), (2), (2), (2), (2), (1), (1), (1), (2), (2), (2), (2), (2), (2), (2), (0), (1), (1), (1), (1), (1), (1), (1), (2), (1), (2), (2), (2), (2), (2), (1), (1), (1), (1), (1), (1), (2), (2), (0), (0), (2), (1), (1), (1), (1), (1), (0), (0), (1), (2), (2), (2), (2), (0), (2), (1), (1), (0), (1), (0), (2), (2), (2), (0), (2), (1), (1), (1), (4), (1), (1), (1), (0), (1), (0), (1), (3), (1), (0), (1), (0), (1), (2), (1), (1), (1), (1), (1), (1), (1), (1), (0), (1), (1), (2), (1), (1), (1), (1), (0), (2), (2), (1), (0), (1), (1), (0), (1), (0), (2), (1), (3), (3), (3), (3), (1), (1), (1), (1), (-1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (2), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (2), (1), (2), (0), (1), (1), (1), (1), (1), (2), (1), (1), (1), (1), (1), (1), (1), (1), (2), (1), (1), (2), (2), (1), (1), (2), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (2), (1), (1), (1), (2), (1), (1), (1), (1), (1), (1), (1), (1), (0), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (2), (1), (1), (1), (1), (2), (1), (2), (2), (2), (2), (2), (2), (2), (1), (2), (2), (2), (1), (0), (2), (2), (2), (1), (0), (1), (2), (2), (2), (2), (3), (1), (1), (2), (2), (1), (2), (2), (2), (2), (2), (1), (1), (2), (2), (2), (2), (1), (2), (2), (2), (1), (1), (2), (2), (1), (1), (2), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (2), (1), (1), (1), (0), (1), (1)] + +/-- columns: (cost c_j, sparse entries (row i, A i j)) -/ +def colChunk0 : List (Int × List (Nat × Int)) := [ + (0, [(255, 1), (290, -1)]), + (0, [(255, 1), (299, -1)]), + (0, [(255, 1), (308, -1)]), + (0, [(255, 1), (318, -1)]), + (0, [(255, 1), (354, -1)]), + (0, [(255, 1), (358, -1)]), + (0, [(255, 1), (364, -1)]), + (0, [(255, 1), (379, -1)]), + (0, [(255, 1), (388, -1)]), + (0, [(534, -1)]), + (0, [(538, -1)]), + (0, [(540, -1)]), + (0, [(255, 1), (552, -1)]), + (0, [(255, 1), (553, -1)]), + (0, [(556, -1)]), + (0, [(564, -1)]), + (0, [(570, -1)]), + (0, [(574, -1)]), + (0, [(576, -1)]), + (0, [(581, -1)]), + (0, [(585, -1)]), + (0, [(587, -1)]), + (0, [(598, -1)]), + (0, [(605, -1)]), + (0, [(609, -1)]), + (0, [(616, -1)]), + (0, [(619, -1)]), + (0, [(622, -1)]), + (0, [(624, -1)]), + (0, [(626, -1)]), + (0, [(630, -1)]), + (0, [(634, -1)]), + (0, [(636, -1)]), + (0, [(646, -1)]), + (0, [(255, 1), (714, -1)]), + (0, [(723, -1)]), + (0, [(789, -1)]), + (0, [(797, -1)]), + (0, [(800, -1)]), + (0, [(803, -1)]), + (0, [(819, -1)]), + (0, [(835, -1)]), + (0, [(839, -1)]), + (0, [(841, -1)]), + (0, [(846, -1)]), + (0, [(849, -1)]), + (0, [(851, -1)]), + (0, [(866, -1)]), + (0, [(873, -1)]), + (0, [(880, -1)]), + (0, [(883, -1)]), + (0, [(144, 1), (173, 1), (634, -1)]), + (0, [(268, 1), (616, -1)]), + (0, [(20, 1), (538, -1)]), + (0, [(260, 1), (534, -1)]), + (0, [(85, 1), (155, 1), (540, -1)]), + (0, [(4, 1), (59, 1), (564, -1)]), + (0, [(264, 1), (581, -1)]), + (0, [(50, 1), (174, 1), (587, -1)]), + (0, [(145, 1), (175, 1), (574, -1)]), + (0, [(269, 1), (616, -1)]), + (0, [(5, 1), (619, -1)]), + (0, [(51, 1), (176, 1), (624, -1)]), + (0, [(266, 1), (605, -1)]), + (0, [(556, -1)]), + (0, [(53, 1), (62, 1), (576, -1)]), + (0, [(63, 1), (585, -1)]), + (0, [(282, 1), (570, -1)]), + (0, [(54, 1), (64, 1), (157, 1), (576, -1)]), + (0, [(164, 1), (556, -1)]), + (0, [(283, 1), (570, -1)]), + (0, [(55, 1), (179, 1), (587, -1)]), + (0, [(26, 1), (129, 1), (646, -1)]), + (0, [(65, 1), (564, -1)]), + (0, [(267, 1), (605, -1)]), + (0, [(106, 1), (609, -1)]), + (0, [(261, 1), (534, -1)]), + (0, [(636, -1)]), + (0, [(258, 1), (630, -1)]), + (0, [(66, 1), (120, 1), (636, -1)]), + (0, [(11, 1), (209, 1), (619, -1)]), + (0, [(133, 1), (148, 1), (622, -1)]), + (0, [(43, 1), (219, 1), (626, -1)]), + (0, [(636, -1)]), + (0, [(107, 1), (609, -1)]), + (0, [(598, -1)]), + (0, [(262, 1), (552, -1)]), + (0, [(276, 1), (800, -1)]), + (0, [(279, 1), (803, -1)]), + (0, [(574, -1)]), + (0, [(57, 1), (150, 1), (598, -1)]), + (0, [(12, 1), (619, -1)]), + (0, [(136, 1), (622, -1)]), + (0, [(540, -1)]), + (0, [(538, -1)]), + (0, [(259, 1), (630, -1)]), + (0, [(626, -1)]), + (0, [(151, 1), (183, 1), (634, -1)]), + (0, [(263, 1), (552, -1)]), + (0, [(30, 1), (142, 1), (646, -1)]), + (0, [(265, 1), (581, -1)]), + (0, [(69, 1), (153, 1), (197, 1), (585, -1)]), + (0, [(789, -1)]), + (0, [(161, 1), (797, -1)]), + (0, [(16, 1), (835, -1)]), + (0, [(93, 1), (839, -1)]), + (0, [(841, -1)]), + (0, [(846, -1)]), + (0, [(161, 1), (849, -1)]), + (0, [(32, 1), (851, -1)]), + (0, [(93, 1), (880, -1)]), + (0, [(161, 1), (883, -1)]), + (0, [(172, 1), (789, -1)]), + (0, [(17, 1), (835, -1)]), + (0, [(94, 1), (839, -1)]), + (0, [(172, 1), (841, -1)]), + (0, [(94, 1), (880, -1)]), + (0, [(162, 1), (797, -1)]), + (0, [(846, -1)]), + (0, [(162, 1), (849, -1)]), + (0, [(33, 1), (851, -1)]), + (0, [(162, 1), (883, -1)]), + (0, [(198, 1), (723, -1)]), + (0, [(111, 1), (819, -1)]), + (0, [(198, 1), (846, -1)]), + (0, [(111, 1), (866, -1)]), + (0, [(198, 1), (873, -1)]), + (0, [(277, 1), (800, -1)]), + (0, [(281, 1), (803, -1)]), + (0, [(624, -1)]), + (0, [(34, 1), (143, 1), (646, -1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(58, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(185, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(185, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(58, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(185, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(185, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(58, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(58, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(185, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(185, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(58, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(58, 1), (185, 1)]), + (1, [(18, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (185, 1)]), + (1, [(71, 1)]), + (1, [(58, 1)]), + (1, [(18, 1), (71, 1), (185, 1)]), + (1, [(18, 1), (58, 1)]), + (1, [(71, 1), (185, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(185, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(185, 1)]), + (1, [(18, 1), (58, 1), (71, 1)]), + (1, [(18, 1), (185, 1)]), + (1, [(58, 1), (71, 1)]), + (1, [(18, 1), (58, 1), (71, 1), (185, 1)]), + (1, [(18, 1)]), + (1, [(58, 1), (71, 1), (185, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(19, 1), (154, 1)]), + (1, [(0, 1), (154, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(0, 1)]), + (1, [(19, 1)]), + (1, [(19, 1)]), + (1, [(0, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(0, 1), (19, 1), (154, 1)]), + (1, [(154, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(0, 1), (19, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(255, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(199, 1)]), + (1, [(1, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(144, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(1, 1)]), + (1, [(199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(199, 1)]), + (1, [(1, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(1, 1)]), + (1, [(199, 1)]), + (1, [(144, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(199, 1)]), + (1, [(1, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(1, 1)]), + (1, [(199, 1)]), + (1, [(144, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(199, 1)]), + (1, [(1, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(144, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(1, 1)]), + (1, [(199, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(1, 1)]), + (1, [(199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(173, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(199, 1)]), + (1, [(1, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(1, 1)]), + (1, [(199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(199, 1)]), + (1, [(1, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(1, 1)]), + (1, [(199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(199, 1)]), + (1, [(1, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(1, 1)]), + (1, [(199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(173, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(173, 1)]), + (1, [(1, 1), (173, 1), (199, 1)]), + (1, [(1, 1), (144, 1)]), + (1, [(144, 1), (199, 1)]), + (1, [(173, 1), (199, 1)]), + (1, [(1, 1), (173, 1)]), + (1, [(1, 1), (144, 1), (199, 1)]), + (1, [(144, 1)]), + (1, [(199, 1)]), + (1, [(1, 1)]), + (1, [(1, 1), (144, 1), (173, 1), (199, 1)]), + (1, [(144, 1), (173, 1)]), + (1, [(1, 1), (199, 1)]), + (1, [(1, 1), (144, 1), (173, 1)]), + (1, [(144, 1), (173, 1), (199, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(256, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(268, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]) +] + +def colChunk1 : List (Int × List (Nat × Int)) := [ + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1), (268, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1)]), + (1, [(113, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(35, 1)]), + (1, [(35, 1), (113, 1)]), + (1, [(113, 1), (268, 1)]), + (1, [(35, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(125, 1)]), + (1, [(125, 1)]), + (1, [(96, 1)]), + (1, [(96, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(96, 1), (125, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(228, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(97, 1)]), + (1, [(114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1), (114, 1)]), + (1, [(114, 1)]), + (1, [(97, 1)]), + (1, [(20, 1), (97, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(20, 1), (97, 1), (114, 1)]), + (1, [(97, 1), (114, 1)]), + (1, [(20, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(260, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(85, 1), (155, 1), (260, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(115, 1)]), + (1, [(115, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(85, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(115, 1), (155, 1)]), + (1, [(155, 1)]), + (1, [(155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1), (155, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(85, 1), (115, 1)]), + (1, [(115, 1)]), + (1, [(115, 1), (260, 1)]), + (1, [(85, 1)]), + (1, [(85, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1), (230, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(215, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]) +] + +def colChunk2 : List (Int × List (Nat × Int)) := [ + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(2, 1)]), + (1, [(72, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(72, 1)]), + (1, [(2, 1)]), + (1, [(2, 1), (72, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(36, 1)]), + (1, [(3, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1), (36, 1)]), + (1, [(3, 1)]), + (1, [(36, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(116, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(86, 1), (116, 1), (163, 1)]), + (1, [(163, 1)]), + (1, [(163, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(116, 1)]), + (1, [(86, 1)]), + (1, [(86, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(86, 1), (116, 1)]), + (1, [(126, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(126, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(4, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(200, 1)]), + (1, [(59, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(126, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(200, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(59, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(4, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(59, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(200, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(126, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(59, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(59, 1), (200, 1)]), + (1, [(4, 1)]), + (1, [(4, 1), (59, 1), (126, 1), (200, 1)]), + (1, [(126, 1)]), + (1, [(59, 1)]), + (1, [(4, 1), (200, 1)]), + (1, [(4, 1), (59, 1), (126, 1)]), + (1, [(126, 1), (200, 1)]), + (1, [(59, 1), (126, 1)]), + (1, [(4, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (59, 1)]), + (1, [(200, 1)]), + (1, [(59, 1), (126, 1), (200, 1)]), + (1, [(4, 1), (126, 1)]), + (1, [(4, 1), (59, 1), (200, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(251, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(21, 1)]), + (1, [(37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(21, 1), (37, 1)]), + (1, [(37, 1)]), + (1, [(21, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(21, 1), (37, 1), (156, 1)]), + (1, [(156, 1)]), + (1, [(37, 1), (156, 1)]), + (1, [(21, 1), (156, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]) +] + +def colChunk3 : List (Int × List (Nat × Int)) := [ + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(264, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1), (264, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1), (264, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(50, 1), (98, 1), (174, 1)]), + (1, [(98, 1), (174, 1)]), + (1, [(50, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(50, 1), (98, 1)]), + (1, [(98, 1)]), + (1, [(50, 1), (174, 1)]), + (1, [(174, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(201, 1)]), + (1, [(145, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(145, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(201, 1)]), + (1, [(145, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(145, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(201, 1)]), + (1, [(99, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(175, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(175, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(201, 1)]), + (1, [(99, 1), (145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (145, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(99, 1), (175, 1)]), + (1, [(99, 1), (175, 1), (201, 1)]), + (1, [(145, 1)]), + (1, [(145, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(175, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(175, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(175, 1)]), + (1, [(175, 1), (201, 1)]), + (1, [(99, 1), (145, 1)]), + (1, [(99, 1), (145, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(99, 1), (201, 1)]), + (1, [(99, 1)]), + (1, [(145, 1), (175, 1), (201, 1)]), + (1, [(145, 1), (175, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(186, 1)]), + (1, [(186, 1)]), + (1, [(87, 1), (100, 1), (186, 1)]), + (1, [(87, 1), (100, 1)]), + (1, [(87, 1)]), + (1, [(87, 1), (186, 1)]), + (1, [(100, 1)]), + (1, [(100, 1), (186, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(269, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1)]), + (1, [(51, 1)]), + (1, [(176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1), (269, 1)]), + (1, [(5, 1), (51, 1), (176, 1)]), + (1, [(176, 1)]), + (1, [(51, 1)]), + (1, [(5, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(5, 1), (51, 1)]), + (1, [(51, 1), (176, 1), (269, 1)]), + (1, [(5, 1), (176, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(257, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(233, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]) +] + +def colChunk4 : List (Int × List (Nat × Int)) := [ + (1, [(60, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(187, 1)]), + (1, [(60, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (187, 1)]), + (1, [(60, 1), (177, 1), (187, 1)]), + (1, [(177, 1)]), + (1, [(60, 1)]), + (1, [(187, 1)]), + (1, [(60, 1), (177, 1)]), + (1, [(177, 1), (187, 1)]), + (1, [(146, 1), (178, 1)]), + (1, [(52, 1), (61, 1), (202, 1)]), + (1, [(22, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(146, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (61, 1)]), + (1, [(22, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (146, 1)]), + (1, [(52, 1), (146, 1), (202, 1)]), + (1, [(61, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (146, 1), (202, 1)]), + (1, [(52, 1), (146, 1)]), + (1, [(61, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (146, 1)]), + (1, [(61, 1), (146, 1), (202, 1)]), + (1, [(52, 1), (178, 1)]), + (1, [(22, 1), (61, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1), (202, 1)]), + (1, [(61, 1), (146, 1)]), + (1, [(52, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (178, 1)]), + (1, [(22, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(202, 1)]), + (1, [(22, 1), (52, 1), (61, 1)]), + (1, [(22, 1), (146, 1), (178, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(266, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1)]), + (1, [(61, 1), (146, 1), (202, 1)]), + (1, [(52, 1), (178, 1)]), + (1, [(22, 1), (61, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1), (202, 1)]), + (1, [(61, 1), (146, 1)]), + (1, [(52, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (178, 1)]), + (1, [(22, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(202, 1)]), + (1, [(22, 1), (52, 1), (61, 1)]), + (1, [(22, 1), (146, 1), (178, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(146, 1), (178, 1)]), + (1, [(52, 1), (61, 1), (202, 1)]), + (1, [(22, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(146, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (61, 1)]), + (1, [(22, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (146, 1)]), + (1, [(52, 1), (146, 1), (202, 1)]), + (1, [(61, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (146, 1), (202, 1)]), + (1, [(52, 1), (146, 1)]), + (1, [(61, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1)]), + (1, [(22, 1), (61, 1), (146, 1)]), + (1, [(52, 1), (146, 1), (202, 1)]), + (1, [(61, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (146, 1), (202, 1)]), + (1, [(52, 1), (146, 1)]), + (1, [(61, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(146, 1), (178, 1)]), + (1, [(52, 1), (61, 1), (202, 1)]), + (1, [(22, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(146, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (61, 1)]), + (1, [(22, 1), (202, 1)]), + (1, [(22, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(202, 1)]), + (1, [(22, 1), (52, 1), (61, 1)]), + (1, [(22, 1), (146, 1), (178, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1)]), + (1, [(61, 1), (146, 1), (202, 1)]), + (1, [(52, 1), (178, 1)]), + (1, [(22, 1), (61, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1), (202, 1)]), + (1, [(61, 1), (146, 1)]), + (1, [(52, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (178, 1)]), + (1, [(22, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(202, 1)]), + (1, [(22, 1), (52, 1), (61, 1)]), + (1, [(22, 1), (146, 1), (178, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1)]), + (1, [(61, 1), (146, 1), (202, 1)]), + (1, [(52, 1), (178, 1)]), + (1, [(22, 1), (61, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1), (202, 1)]), + (1, [(61, 1), (146, 1)]), + (1, [(52, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (178, 1)]), + (1, [(22, 1), (61, 1), (146, 1)]), + (1, [(52, 1), (146, 1), (202, 1)]), + (1, [(61, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (146, 1), (202, 1)]), + (1, [(52, 1), (146, 1)]), + (1, [(61, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(146, 1), (178, 1)]), + (1, [(52, 1), (61, 1), (202, 1)]), + (1, [(22, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(146, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (61, 1)]), + (1, [(22, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (146, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (61, 1)]), + (1, [(202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(22, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (178, 1)]), + (1, [(52, 1), (178, 1), (202, 1)]), + (1, [(61, 1), (146, 1)]), + (1, [(22, 1), (52, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (178, 1)]), + (1, [(61, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1)]), + (1, [(22, 1), (52, 1), (178, 1)]), + (1, [(61, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (146, 1)]), + (1, [(22, 1), (61, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1), (202, 1)]), + (1, [(61, 1), (178, 1)]), + (1, [(52, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (146, 1)]), + (1, [(22, 1), (202, 1)]), + (1, [(52, 1), (61, 1)]), + (1, [(146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(22, 1)]), + (1, [(52, 1), (61, 1), (202, 1)]), + (1, [(146, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1)]), + (1, [(61, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (146, 1)]), + (1, [(22, 1), (61, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1), (202, 1)]), + (1, [(61, 1), (178, 1)]), + (1, [(52, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (146, 1)]), + (1, [(22, 1), (202, 1)]), + (1, [(52, 1), (61, 1)]), + (1, [(146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(22, 1)]), + (1, [(52, 1), (61, 1), (202, 1)]), + (1, [(146, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (146, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (61, 1)]), + (1, [(202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(22, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (178, 1)]), + (1, [(52, 1), (178, 1), (202, 1)]), + (1, [(61, 1), (146, 1)]), + (1, [(22, 1), (52, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (178, 1)]), + (1, [(61, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1)]), + (1, [(22, 1), (61, 1), (178, 1)]), + (1, [(52, 1), (178, 1), (202, 1)]), + (1, [(61, 1), (146, 1)]), + (1, [(22, 1), (52, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (178, 1)]), + (1, [(61, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (146, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (61, 1)]), + (1, [(202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(22, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (202, 1)]), + (1, [(52, 1), (61, 1)]), + (1, [(146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(22, 1)]), + (1, [(52, 1), (61, 1), (202, 1)]), + (1, [(146, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1)]), + (1, [(61, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (146, 1)]), + (1, [(22, 1), (61, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1), (202, 1)]), + (1, [(61, 1), (178, 1)]), + (1, [(52, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (146, 1)]), + (1, [(22, 1), (202, 1), (266, 1)]), + (1, [(52, 1), (61, 1)]), + (1, [(146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1)]), + (1, [(22, 1)]), + (1, [(52, 1), (61, 1), (202, 1)]), + (1, [(146, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1)]), + (1, [(61, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (146, 1)]), + (1, [(22, 1), (61, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (178, 1), (202, 1)]), + (1, [(61, 1), (178, 1)]), + (1, [(52, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (146, 1)]), + (1, [(22, 1), (61, 1), (178, 1)]), + (1, [(52, 1), (178, 1), (202, 1)]), + (1, [(61, 1), (146, 1)]), + (1, [(22, 1), (52, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (61, 1), (178, 1), (202, 1)]), + (1, [(52, 1), (178, 1)]), + (1, [(61, 1), (146, 1), (202, 1)]), + (1, [(22, 1), (52, 1), (146, 1)]), + (1, [(22, 1), (52, 1), (61, 1), (202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(22, 1), (146, 1), (178, 1)]), + (1, [(22, 1), (52, 1), (61, 1)]), + (1, [(202, 1)]), + (1, [(52, 1), (61, 1), (146, 1), (178, 1), (266, 1)]), + (1, [(22, 1), (146, 1), (178, 1), (202, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1), (188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(73, 1)]), + (1, [(188, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(6, 1)]), + (1, [(38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(6, 1), (38, 1)]), + (1, [(38, 1)]), + (1, [(6, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1), (203, 1)]), + (1, [(62, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(53, 1), (74, 1)]), + (1, [(62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1)]), + (1, [(53, 1), (62, 1), (203, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(74, 1), (203, 1)]), + (1, [(53, 1), (62, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]) +] + +def colChunk5 : List (Int × List (Nat × Int)) := [ + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1)]), + (1, [(203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(53, 1), (62, 1), (74, 1), (203, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1), (203, 1)]), + (1, [(53, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(62, 1), (74, 1)]), + (1, [(53, 1), (203, 1)]), + (1, [(101, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(23, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(63, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(39, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(63, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(23, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(101, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(39, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(39, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(63, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(23, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(101, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(39, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(101, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(23, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(63, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(63, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(101, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(23, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(39, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(23, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(101, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(63, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(39, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(39, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(23, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(101, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(63, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(39, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(63, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(101, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(23, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(101, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(23, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(63, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(39, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(63, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(23, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(101, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(39, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(39, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(63, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(23, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(101, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(39, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(101, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(23, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(63, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(63, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(101, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(23, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(39, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(23, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(101, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(63, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(39, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(39, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(23, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(101, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(63, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (63, 1)]), + (1, [(39, 1)]), + (1, [(63, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (101, 1)]), + (1, [(23, 1), (39, 1), (63, 1)]), + (1, [(39, 1), (63, 1), (101, 1)]), + (1, [(23, 1), (101, 1)]), + (1, [(23, 1), (63, 1), (101, 1)]), + (1, [(39, 1), (101, 1)]), + (1, [(63, 1)]), + (1, [(23, 1), (39, 1)]), + (1, [(23, 1), (39, 1), (63, 1), (101, 1)]), + (1, [(101, 1)]), + (1, [(39, 1), (63, 1)]), + (1, [(23, 1)]), + (1, [(102, 1), (157, 1)]), + (1, [(54, 1), (64, 1), (157, 1), (204, 1)]), + (1, [(157, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1)]), + (1, [(102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (157, 1)]), + (1, [(157, 1), (204, 1)]), + (1, [(64, 1)]), + (1, [(54, 1), (204, 1)]), + (1, [(64, 1), (102, 1)]), + (1, [(54, 1), (102, 1), (204, 1)]), + (1, [(64, 1), (204, 1)]), + (1, [(54, 1)]), + (1, [(64, 1), (102, 1), (204, 1)]), + (1, [(54, 1), (102, 1)]), + (1, [(54, 1), (157, 1)]), + (1, [(64, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (102, 1), (157, 1)]), + (1, [(64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (157, 1)]), + (1, [(54, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (102, 1), (157, 1)]), + (1, [(102, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1)]), + (1, [(204, 1)]), + (1, [(54, 1), (64, 1)]), + (1, [(102, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (204, 1)]), + (1, [(282, 1)]), + (1, [(54, 1), (64, 1), (204, 1)]), + (1, [(64, 1), (102, 1)]), + (1, [(54, 1), (102, 1), (204, 1)]), + (1, [(64, 1)]), + (1, [(54, 1), (204, 1)]), + (1, [(64, 1), (102, 1), (204, 1)]), + (1, [(54, 1), (102, 1)]), + (1, [(64, 1), (204, 1)]), + (1, [(54, 1)]), + (1, [(54, 1), (64, 1), (157, 1), (204, 1)]), + (1, [(157, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(102, 1), (157, 1)]), + (1, [(54, 1), (64, 1), (157, 1)]), + (1, [(157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1)]), + (1, [(102, 1), (157, 1), (204, 1)]), + (1, [(204, 1)]), + (1, [(54, 1), (64, 1)]), + (1, [(102, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1)]), + (1, [(54, 1), (64, 1), (204, 1)]), + (1, [(102, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (204, 1)]), + (1, [(54, 1), (102, 1), (157, 1)]), + (1, [(64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (157, 1)]), + (1, [(64, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (102, 1), (157, 1)]), + (1, [(54, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (157, 1)]), + (1, [(54, 1), (64, 1), (102, 1)]), + (1, [(102, 1), (204, 1)]), + (1, [(54, 1), (64, 1)]), + (1, [(204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (204, 1)]), + (1, [(102, 1)]), + (1, [(54, 1), (64, 1), (204, 1)]), + (1, [(64, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (157, 1)]), + (1, [(64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (102, 1), (157, 1)]), + (1, [(64, 1), (157, 1)]), + (1, [(54, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (102, 1), (157, 1)]), + (1, [(54, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (204, 1)]), + (1, [(64, 1)]), + (1, [(54, 1), (102, 1), (204, 1)]), + (1, [(64, 1), (102, 1)]), + (1, [(54, 1)]), + (1, [(64, 1), (204, 1)]), + (1, [(54, 1), (102, 1)]), + (1, [(64, 1), (102, 1), (204, 1)]), + (1, [(102, 1), (157, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(157, 1)]), + (1, [(54, 1), (64, 1), (157, 1), (204, 1)]), + (1, [(102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1)]), + (1, [(157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (157, 1)]), + (1, [(64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (102, 1), (157, 1)]), + (1, [(64, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (157, 1)]), + (1, [(64, 1), (102, 1), (157, 1)]), + (1, [(54, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (157, 1)]), + (1, [(54, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (64, 1)]), + (1, [(204, 1)]), + (1, [(54, 1), (64, 1), (102, 1)]), + (1, [(102, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (204, 1)]), + (1, [(102, 1)]), + (1, [(157, 1)]), + (1, [(54, 1), (64, 1), (157, 1), (204, 1)]), + (1, [(102, 1), (157, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (157, 1)]), + (1, [(102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1)]), + (1, [(54, 1), (102, 1), (204, 1)]), + (1, [(64, 1), (102, 1)]), + (1, [(54, 1), (204, 1)]), + (1, [(64, 1)]), + (1, [(54, 1), (102, 1)]), + (1, [(64, 1), (102, 1), (204, 1)]), + (1, [(54, 1)]), + (1, [(64, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(102, 1), (157, 1)]), + (1, [(54, 1), (64, 1), (157, 1), (204, 1)]), + (1, [(157, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1)]), + (1, [(102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (157, 1)]), + (1, [(157, 1), (204, 1)]), + (1, [(64, 1)]), + (1, [(54, 1), (204, 1)]), + (1, [(64, 1), (102, 1)]), + (1, [(54, 1), (102, 1), (204, 1)]), + (1, [(64, 1), (204, 1)]), + (1, [(54, 1)]), + (1, [(64, 1), (102, 1), (204, 1)]), + (1, [(54, 1), (102, 1)]), + (1, [(54, 1), (157, 1)]), + (1, [(64, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (102, 1), (157, 1)]), + (1, [(64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (157, 1)]), + (1, [(54, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (102, 1), (157, 1)]), + (1, [(102, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1)]), + (1, [(204, 1)]), + (1, [(54, 1), (64, 1)]), + (1, [(102, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (204, 1)]), + (1, [(64, 1), (102, 1)]), + (1, [(54, 1), (102, 1), (204, 1)]), + (1, [(64, 1)]), + (1, [(54, 1), (204, 1)]), + (1, [(64, 1), (102, 1), (204, 1)]), + (1, [(54, 1), (102, 1)]), + (1, [(64, 1), (204, 1)]), + (1, [(54, 1)]), + (1, [(54, 1), (64, 1), (157, 1), (204, 1)]), + (1, [(157, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(102, 1), (157, 1)]), + (1, [(54, 1), (64, 1), (157, 1)]), + (1, [(157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1)]), + (1, [(102, 1), (157, 1), (204, 1)]), + (1, [(204, 1)]), + (1, [(54, 1), (64, 1)]), + (1, [(102, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1)]), + (1, [(54, 1), (64, 1), (204, 1)]), + (1, [(102, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (204, 1)]), + (1, [(54, 1), (102, 1), (157, 1)]), + (1, [(64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (157, 1)]), + (1, [(64, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (102, 1), (157, 1)]), + (1, [(54, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (157, 1)]), + (1, [(54, 1), (64, 1), (102, 1)]), + (1, [(102, 1), (204, 1)]), + (1, [(54, 1), (64, 1)]), + (1, [(204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (204, 1)]), + (1, [(102, 1)]), + (1, [(54, 1), (64, 1), (204, 1)]), + (1, [(64, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (157, 1)]), + (1, [(64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (102, 1), (157, 1)]), + (1, [(64, 1), (157, 1)]), + (1, [(54, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (102, 1), (157, 1)]), + (1, [(54, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (204, 1)]), + (1, [(64, 1)]), + (1, [(54, 1), (102, 1), (204, 1)]), + (1, [(64, 1), (102, 1)]), + (1, [(54, 1)]), + (1, [(64, 1), (204, 1)]), + (1, [(54, 1), (102, 1)]), + (1, [(64, 1), (102, 1), (204, 1)]), + (1, [(102, 1), (157, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(157, 1)]), + (1, [(54, 1), (64, 1), (157, 1), (204, 1)]), + (1, [(102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1)]), + (1, [(157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (157, 1)]), + (1, [(64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (102, 1), (157, 1)]), + (1, [(64, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (157, 1)]), + (1, [(64, 1), (102, 1), (157, 1)]), + (1, [(54, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(64, 1), (157, 1)]), + (1, [(54, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (64, 1)]), + (1, [(204, 1)]), + (1, [(54, 1), (64, 1), (102, 1)]), + (1, [(102, 1), (204, 1), (282, 1)]), + (1, [(54, 1), (64, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (204, 1)]), + (1, [(102, 1)]), + (1, [(157, 1)]), + (1, [(54, 1), (64, 1), (157, 1), (204, 1)]), + (1, [(102, 1), (157, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1), (204, 1)]), + (1, [(157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (157, 1), (282, 1)]), + (1, [(102, 1), (157, 1), (204, 1)]), + (1, [(54, 1), (64, 1), (102, 1), (157, 1)]), + (1, [(54, 1), (102, 1), (204, 1)]), + (1, [(64, 1), (102, 1)]), + (1, [(54, 1), (204, 1)]), + (1, [(64, 1)]), + (1, [(54, 1), (102, 1)]), + (1, [(64, 1), (102, 1), (204, 1)]), + (1, [(54, 1)]), + (1, [(64, 1), (204, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(247, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(252, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(205, 1)]), + (1, [(117, 1), (205, 1)]), + (1, [(117, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(164, 1)]), + (1, [(164, 1), (205, 1)]), + (1, [(117, 1), (164, 1)]), + (1, [(117, 1), (164, 1), (205, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(216, 1)]), + (1, [(40, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1), (216, 1)]), + (1, [(40, 1)]), + (1, [(216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(40, 1), (165, 1), (216, 1)]), + (1, [(165, 1)]), + (1, [(40, 1), (165, 1)]), + (1, [(165, 1), (216, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]) +] + +def colChunk6 : List (Int × List (Nat × Int)) := [ + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(238, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(118, 1)]), + (1, [(189, 1)]), + (1, [(118, 1)]), + (1, [(118, 1), (189, 1)]), + (1, [(189, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1), (190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(75, 1)]), + (1, [(190, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(242, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(127, 1)]), + (1, [(191, 1)]), + (1, [(127, 1)]), + (1, [(127, 1), (191, 1)]), + (1, [(191, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(166, 1)]), + (1, [(24, 1), (166, 1)]), + (1, [(24, 1), (103, 1), (166, 1)]), + (1, [(103, 1), (166, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(103, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(24, 1)]), + (1, [(24, 1), (103, 1)]), + (1, [(103, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(283, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1), (283, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1), (283, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1)]), + (1, [(192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(76, 1), (192, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(273, 1)]) +] + +def colChunk7 : List (Int × List (Nat × Int)) := [ + (1, [(273, 1)]), + (1, [(273, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(271, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(253, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(25, 1)]), + (1, [(55, 1)]), + (1, [(179, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(25, 1)]), + (1, [(55, 1)]), + (1, [(179, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(158, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(158, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(158, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(158, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(25, 1)]), + (1, [(55, 1)]), + (1, [(179, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(25, 1)]), + (1, [(55, 1)]), + (1, [(179, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(25, 1)]), + (1, [(55, 1)]), + (1, [(179, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(25, 1)]), + (1, [(55, 1)]), + (1, [(179, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(158, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(158, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(158, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(158, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(25, 1)]), + (1, [(55, 1)]), + (1, [(179, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(25, 1)]), + (1, [(55, 1)]), + (1, [(179, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(55, 1)]), + (1, [(25, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(179, 1)]), + (1, [(55, 1)]), + (1, [(25, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(179, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(158, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(158, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(158, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(158, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(55, 1)]), + (1, [(25, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(179, 1)]), + (1, [(55, 1)]), + (1, [(25, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(179, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(55, 1)]), + (1, [(25, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(179, 1)]), + (1, [(55, 1)]), + (1, [(25, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(179, 1)]), + (1, [(158, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(158, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(158, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(158, 1)]), + (1, [(25, 1), (55, 1), (158, 1)]), + (1, [(25, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (158, 1), (179, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(55, 1), (179, 1)]), + (1, [(25, 1), (179, 1)]), + (1, [(25, 1), (55, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(158, 1), (179, 1)]), + (1, [(25, 1), (55, 1), (158, 1), (179, 1)]), + (1, [(25, 1), (158, 1)]), + (1, [(55, 1), (158, 1)]), + (1, [(55, 1)]), + (1, [(25, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(179, 1)]), + (1, [(55, 1)]), + (1, [(25, 1)]), + (1, [(25, 1), (55, 1), (179, 1)]), + (1, [(179, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(244, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1), (244, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (244, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(77, 1), (128, 1)]), + (1, [(128, 1)]), + (1, [(77, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1), (240, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(240, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1), (240, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(119, 1)]), + (1, [(119, 1)]), + (1, [(104, 1)]), + (1, [(104, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(104, 1), (119, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(129, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(129, 1)]), + (1, [(26, 1), (129, 1)]), + (1, [(26, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(129, 1), (167, 1)]), + (1, [(26, 1), (129, 1), (167, 1)]), + (1, [(26, 1), (167, 1)]), + (1, [(167, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]) +] + +def colChunk8 : List (Int × List (Nat × Int)) := [ + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(217, 1)]), + (1, [(41, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1), (217, 1)]), + (1, [(41, 1)]), + (1, [(217, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(130, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(130, 1)]), + (1, [(65, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(130, 1), (206, 1), (218, 1)]), + (1, [(65, 1), (130, 1)]), + (1, [(206, 1)]), + (1, [(65, 1), (218, 1)]), + (1, [(130, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1)]), + (1, [(65, 1), (206, 1), (218, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(218, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(130, 1)]), + (1, [(65, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1), (130, 1), (218, 1)]), + (1, [(130, 1), (206, 1)]), + (1, [(65, 1)]), + (1, [(206, 1), (218, 1)]), + (1, [(65, 1), (130, 1), (206, 1), (218, 1)]), + (1, [(130, 1)]), + (1, [(65, 1), (206, 1)]), + (1, [(218, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(180, 1)]), + (1, [(147, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(180, 1)]), + (1, [(7, 1), (180, 1)]), + (1, [(7, 1), (147, 1)]), + (1, [(147, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(7, 1)]), + (1, [(7, 1), (147, 1), (180, 1)]), + (1, [(147, 1), (180, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1)]), + (1, [(278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(275, 1), (278, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(234, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(105, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(27, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(27, 1)]), + (1, [(27, 1), (105, 1)]), + (1, [(105, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(105, 1), (159, 1)]), + (1, [(27, 1), (105, 1), (159, 1)]), + (1, [(27, 1), (159, 1)]), + (1, [(159, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(267, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]) +] + +def colChunk9 : List (Int × List (Nat × Int)) := [ + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(78, 1), (267, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1), (78, 1)]), + (1, [(42, 1)]), + (1, [(78, 1)]), + (1, [(42, 1), (267, 1)]), + (1, [(78, 1)]), + (1, [(106, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(207, 1)]), + (1, [(28, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(106, 1)]), + (1, [(28, 1), (106, 1), (207, 1)]), + (1, [(28, 1)]), + (1, [(207, 1)]), + (1, [(106, 1), (207, 1)]), + (1, [(28, 1), (106, 1)]), + (1, [(28, 1), (207, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(229, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(131, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(8, 1)]), + (1, [(8, 1), (131, 1)]), + (1, [(131, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(261, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1), (261, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(9, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(79, 1)]), + (1, [(9, 1), (261, 1)]), + (1, [(9, 1), (79, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(132, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(10, 1)]), + (1, [(10, 1), (132, 1)]), + (1, [(132, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(208, 1)]), + (1, [(66, 1)]), + (1, [(208, 1)]), + (1, [(66, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(258, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1)]), + (1, [(208, 1)]), + (1, [(66, 1)]), + (1, [(208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1)]), + (1, [(208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1)]), + (1, [(208, 1)]), + (1, [(208, 1)]), + (1, [(66, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(208, 1)]), + (1, [(66, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(168, 1), (208, 1), (258, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(208, 1)]), + (1, [(66, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]) +] + +def colChunk10 : List (Int × List (Nat × Int)) := [ + (1, [(66, 1), (208, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(208, 1)]), + (1, [(66, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(66, 1), (120, 1), (258, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1)]), + (1, [(208, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1)]), + (1, [(208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1)]), + (1, [(208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1)]), + (1, [(208, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(208, 1)]), + (1, [(66, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(120, 1), (208, 1)]), + (1, [(66, 1), (120, 1)]), + (1, [(208, 1)]), + (1, [(66, 1)]), + (1, [(120, 1)]), + (1, [(66, 1), (120, 1), (208, 1)]), + (1, [(66, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1)]), + (1, [(120, 1), (168, 1), (208, 1)]), + (1, [(66, 1), (168, 1)]), + (1, [(168, 1), (208, 1)]), + (1, [(66, 1), (120, 1), (168, 1), (208, 1)]), + (1, [(120, 1), (168, 1)]), + (1, [(66, 1), (168, 1), (208, 1)]), + (1, [(168, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(209, 1)]), + (1, [(11, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(11, 1)]), + (1, [(209, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(148, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(209, 1)]), + (1, [(11, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(235, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(11, 1)]), + (1, [(209, 1)]), + (1, [(148, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(209, 1)]), + (1, [(11, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(11, 1)]), + (1, [(209, 1)]), + (1, [(148, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(209, 1)]), + (1, [(11, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(11, 1)]), + (1, [(209, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(148, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(11, 1)]), + (1, [(209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(209, 1)]), + (1, [(11, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(11, 1)]), + (1, [(209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(209, 1)]), + (1, [(11, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(133, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(11, 1)]), + (1, [(209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(209, 1)]), + (1, [(11, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(133, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(11, 1)]), + (1, [(209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(209, 1)]), + (1, [(11, 1)]), + (1, [(11, 1), (133, 1), (148, 1), (209, 1)]), + (1, [(133, 1), (148, 1)]), + (1, [(11, 1), (209, 1)]), + (1, [(11, 1), (133, 1), (148, 1)]), + (1, [(133, 1), (148, 1), (209, 1)]), + (1, [(133, 1)]), + (1, [(11, 1), (133, 1), (209, 1)]), + (1, [(11, 1), (148, 1)]), + (1, [(148, 1), (209, 1)]), + (1, [(133, 1), (209, 1)]), + (1, [(11, 1), (133, 1)]), + (1, [(11, 1), (148, 1), (209, 1)]), + (1, [(148, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(219, 1)]), + (1, [(43, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1), (219, 1)]), + (1, [(43, 1)]), + (1, [(219, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(220, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(134, 1), (220, 1)]), + (1, [(134, 1)]), + (1, [(220, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(80, 1), (107, 1)]), + (1, [(107, 1)]), + (1, [(80, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]) +] + +def colChunk11 : List (Int × List (Nat × Int)) := [ + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(221, 1)]), + (1, [(44, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1), (221, 1)]), + (1, [(44, 1)]), + (1, [(221, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(210, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(121, 1), (210, 1), (262, 1)]), + (1, [(121, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1), (262, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(210, 1)]), + (1, [(262, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(210, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(210, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(210, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(210, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(210, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(210, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(210, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(88, 1), (121, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (121, 1), (181, 1)]), + (1, [(210, 1)]), + (1, [(121, 1), (181, 1)]), + (1, [(121, 1), (181, 1), (210, 1)]), + (1, [(88, 1)]), + (1, [(88, 1), (210, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(88, 1), (121, 1)]), + (1, [(88, 1), (121, 1), (210, 1)]), + (1, [(181, 1)]), + (1, [(181, 1), (210, 1)]), + (1, [(121, 1), (210, 1)]), + (1, [(121, 1)]), + (1, [(88, 1), (181, 1), (210, 1)]), + (1, [(88, 1), (181, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(135, 1)]), + (1, [(135, 1)]), + (1, [(108, 1)]), + (1, [(108, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(108, 1), (135, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(226, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(276, 1), (279, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(279, 1)]), + (1, [(276, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1)]), + (1, [(81, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(81, 1), (182, 1)]), + (1, [(67, 1), (182, 1)]), + (1, [(81, 1)]), + (1, [(67, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(67, 1), (81, 1)]), + (1, [(67, 1), (81, 1), (182, 1)]), + (1, [(182, 1)]), + (1, [(149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1)]), + (1, [(56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (149, 1)]), + (1, [(56, 1), (68, 1), (82, 1)]), + (1, [(45, 1)]), + (1, [(45, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(56, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (82, 1)]), + (1, [(56, 1)]), + (1, [(68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (149, 1)]), + (1, [(68, 1), (82, 1)]), + (1, [(45, 1), (56, 1)]), + (1, [(45, 1), (56, 1), (149, 1)]), + (1, [(68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1)]), + (1, [(68, 1), (82, 1)]), + (1, [(56, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(56, 1)]), + (1, [(45, 1), (68, 1), (82, 1)]), + (1, [(45, 1), (149, 1)]), + (1, [(56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1)]), + (1, [(56, 1), (68, 1), (82, 1)]), + (1, [(149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1)]), + (1, [(45, 1), (56, 1), (82, 1), (149, 1)]), + (1, [(68, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (82, 1)]), + (1, [(68, 1)]), + (1, [(56, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (149, 1)]), + (1, [(56, 1), (82, 1)]), + (1, [(45, 1), (68, 1)]), + (1, [(45, 1), (82, 1), (149, 1)]), + (1, [(56, 1), (68, 1), (149, 1)]), + (1, [(45, 1), (82, 1)]), + (1, [(56, 1), (68, 1)]), + (1, [(82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (149, 1)]), + (1, [(82, 1)]), + (1, [(45, 1), (56, 1), (68, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (149, 1)]), + (1, [(82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1)]), + (1, [(82, 1)]), + (1, [(56, 1), (68, 1), (149, 1)]), + (1, [(45, 1), (82, 1), (149, 1)]), + (1, [(56, 1), (68, 1)]), + (1, [(45, 1), (82, 1)]), + (1, [(45, 1), (68, 1), (149, 1)]), + (1, [(56, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (68, 1)]), + (1, [(56, 1), (82, 1)]), + (1, [(68, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (82, 1), (149, 1)]), + (1, [(68, 1)]), + (1, [(45, 1), (56, 1), (82, 1)]), + (1, [(68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (149, 1)]), + (1, [(68, 1), (82, 1)]), + (1, [(45, 1), (56, 1)]), + (1, [(45, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(56, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (82, 1)]), + (1, [(56, 1)]), + (1, [(56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (149, 1)]), + (1, [(56, 1), (68, 1), (82, 1)]), + (1, [(45, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1)]), + (1, [(149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1)]), + (1, [(45, 1), (149, 1)]), + (1, [(56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1)]), + (1, [(56, 1), (68, 1), (82, 1)]), + (1, [(56, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(56, 1)]), + (1, [(45, 1), (68, 1), (82, 1)]), + (1, [(45, 1), (56, 1), (149, 1)]), + (1, [(68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1)]), + (1, [(68, 1), (82, 1)]), + (1, [(82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (149, 1)]), + (1, [(82, 1)]), + (1, [(45, 1), (56, 1), (68, 1)]), + (1, [(45, 1), (82, 1), (149, 1)]), + (1, [(56, 1), (68, 1), (149, 1)]), + (1, [(45, 1), (82, 1)]), + (1, [(56, 1), (68, 1)]), + (1, [(56, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (149, 1)]), + (1, [(56, 1), (82, 1)]), + (1, [(45, 1), (68, 1)]), + (1, [(45, 1), (56, 1), (82, 1), (149, 1)]), + (1, [(68, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (82, 1)]), + (1, [(68, 1)]), + (1, [(68, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (82, 1), (149, 1)]), + (1, [(68, 1)]), + (1, [(45, 1), (56, 1), (82, 1)]), + (1, [(45, 1), (68, 1), (149, 1)]), + (1, [(56, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (68, 1)]), + (1, [(56, 1), (82, 1)]), + (1, [(56, 1), (68, 1), (149, 1)]), + (1, [(45, 1), (82, 1), (149, 1)]), + (1, [(56, 1), (68, 1)]), + (1, [(45, 1), (82, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (149, 1)]), + (1, [(82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1)]), + (1, [(82, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(149, 1)]), + (1, [(56, 1), (68, 1), (82, 1)]), + (1, [(45, 1)]), + (1, [(56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (82, 1)]), + (1, [(56, 1)]), + (1, [(45, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(56, 1), (149, 1)]), + (1, [(68, 1), (82, 1)]), + (1, [(45, 1), (56, 1)]), + (1, [(68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (149, 1)]), + (1, [(45, 1), (56, 1)]), + (1, [(68, 1), (82, 1)]), + (1, [(45, 1), (56, 1), (149, 1)]), + (1, [(68, 1), (82, 1), (149, 1)]), + (1, [(56, 1)]), + (1, [(45, 1), (68, 1), (82, 1)]), + (1, [(56, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1)]), + (1, [(56, 1), (68, 1), (82, 1)]), + (1, [(45, 1), (149, 1)]), + (1, [(56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1)]), + (1, [(149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (82, 1)]), + (1, [(68, 1)]), + (1, [(45, 1), (56, 1), (82, 1), (149, 1)]), + (1, [(68, 1), (149, 1)]), + (1, [(56, 1), (82, 1)]), + (1, [(45, 1), (68, 1)]), + (1, [(56, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (149, 1)]), + (1, [(45, 1), (82, 1)]), + (1, [(56, 1), (68, 1)]), + (1, [(45, 1), (82, 1), (149, 1)]) +] + +def colChunk12 : List (Int × List (Nat × Int)) := [ + (1, [(56, 1), (68, 1), (149, 1)]), + (1, [(82, 1)]), + (1, [(45, 1), (56, 1), (68, 1)]), + (1, [(82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1)]), + (1, [(82, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (149, 1)]), + (1, [(82, 1), (149, 1)]), + (1, [(56, 1), (68, 1)]), + (1, [(45, 1), (82, 1)]), + (1, [(56, 1), (68, 1), (149, 1)]), + (1, [(45, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (68, 1)]), + (1, [(56, 1), (82, 1)]), + (1, [(45, 1), (68, 1), (149, 1)]), + (1, [(56, 1), (82, 1), (149, 1)]), + (1, [(68, 1)]), + (1, [(45, 1), (56, 1), (82, 1)]), + (1, [(68, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (82, 1), (149, 1)]), + (1, [(68, 1), (82, 1)]), + (1, [(45, 1), (56, 1)]), + (1, [(68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (82, 1)]), + (1, [(56, 1)]), + (1, [(45, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(56, 1), (149, 1)]), + (1, [(56, 1), (68, 1), (82, 1)]), + (1, [(45, 1)]), + (1, [(56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1)]), + (1, [(149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1)]), + (1, [(56, 1), (68, 1), (82, 1)]), + (1, [(45, 1), (149, 1)]), + (1, [(56, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(56, 1)]), + (1, [(45, 1), (68, 1), (82, 1)]), + (1, [(56, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1)]), + (1, [(68, 1), (82, 1)]), + (1, [(45, 1), (56, 1), (149, 1)]), + (1, [(68, 1), (82, 1), (149, 1)]), + (1, [(82, 1)]), + (1, [(45, 1), (56, 1), (68, 1)]), + (1, [(82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (149, 1)]), + (1, [(45, 1), (82, 1)]), + (1, [(56, 1), (68, 1)]), + (1, [(45, 1), (82, 1), (149, 1)]), + (1, [(56, 1), (68, 1), (149, 1)]), + (1, [(56, 1), (82, 1)]), + (1, [(45, 1), (68, 1)]), + (1, [(56, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (68, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (82, 1)]), + (1, [(68, 1)]), + (1, [(45, 1), (56, 1), (82, 1), (149, 1)]), + (1, [(68, 1), (149, 1)]), + (1, [(68, 1)]), + (1, [(45, 1), (56, 1), (82, 1)]), + (1, [(68, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (68, 1)]), + (1, [(56, 1), (82, 1)]), + (1, [(45, 1), (68, 1), (149, 1)]), + (1, [(56, 1), (82, 1), (149, 1)]), + (1, [(56, 1), (68, 1)]), + (1, [(45, 1), (82, 1)]), + (1, [(56, 1), (68, 1), (149, 1)]), + (1, [(45, 1), (82, 1), (149, 1)]), + (1, [(45, 1), (56, 1), (68, 1)]), + (1, [(82, 1)]), + (1, [(45, 1), (56, 1), (68, 1), (149, 1)]), + (1, [(82, 1), (149, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(222, 1)]), + (1, [(46, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1), (222, 1)]), + (1, [(46, 1)]), + (1, [(222, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(231, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(57, 1), (193, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1), (211, 1)]), + (1, [(150, 1)]), + (1, [(57, 1)]), + (1, [(193, 1), (211, 1)]), + (1, [(57, 1), (150, 1)]), + (1, [(150, 1), (193, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(57, 1), (193, 1)]), + (1, [(211, 1)]), + (1, [(57, 1), (150, 1), (193, 1)]), + (1, [(150, 1), (211, 1)]), + (1, [(57, 1), (211, 1)]), + (1, [(193, 1)]), + (1, [(57, 1), (150, 1), (211, 1)]), + (1, [(150, 1), (193, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(249, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(136, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(136, 1)]), + (1, [(12, 1), (136, 1)]), + (1, [(12, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(89, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(137, 1)]), + (1, [(29, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(89, 1), (137, 1)]), + (1, [(29, 1), (89, 1), (137, 1)]), + (1, [(29, 1)]), + (1, [(137, 1)]), + (1, [(29, 1), (137, 1)]), + (1, [(29, 1), (89, 1)]), + (1, [(89, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]) +] + +def colChunk13 : List (Int × List (Nat × Int)) := [ + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(122, 1)]), + (1, [(194, 1)]), + (1, [(122, 1)]), + (1, [(122, 1), (194, 1)]), + (1, [(194, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(195, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(138, 1)]), + (1, [(195, 1)]), + (1, [(138, 1)]), + (1, [(138, 1), (195, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(227, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(250, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1)]), + (1, [(196, 1)]), + (1, [(196, 1)]), + (1, [(90, 1)]), + (1, [(90, 1), (196, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(169, 1)]), + (1, [(169, 1)]), + (1, [(169, 1), (196, 1)]), + (1, [(90, 1), (169, 1)]), + (1, [(90, 1), (169, 1), (196, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(236, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(223, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(123, 1), (223, 1)]), + (1, [(123, 1)]), + (1, [(223, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(259, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1), (259, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (259, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(47, 1)]), + (1, [(47, 1), (139, 1)]), + (1, [(139, 1)]), + (1, [(47, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]) +] + +def colChunk14 : List (Int × List (Nat × Int)) := [ + (1, [(151, 1), (170, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(212, 1)]), + (1, [(151, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(151, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(212, 1)]), + (1, [(151, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(183, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(170, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(170, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(170, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(170, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(170, 1)]), + (1, [(170, 1), (212, 1)]), + (1, [(151, 1), (170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(170, 1), (183, 1), (212, 1)]), + (1, [(170, 1), (183, 1)]), + (1, [(151, 1), (170, 1), (212, 1)]), + (1, [(151, 1), (170, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(183, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(183, 1), (212, 1)]), + (1, [(183, 1)]), + (1, [(151, 1), (212, 1)]), + (1, [(151, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(212, 1)]), + (1, [(151, 1), (183, 1)]), + (1, [(151, 1), (183, 1), (212, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1), (245, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(245, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1), (245, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(140, 1)]), + (1, [(140, 1)]), + (1, [(109, 1)]), + (1, [(109, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(109, 1), (140, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(213, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(152, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(213, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(152, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(213, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(152, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(213, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(152, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(213, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(213, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(213, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(141, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(91, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1)]), + (1, [(141, 1), (213, 1)]), + (1, [(91, 1), (152, 1)]), + (1, [(91, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (213, 1)]), + (1, [(91, 1), (141, 1)]), + (1, [(152, 1), (213, 1)]), + (1, [(152, 1)]), + (1, [(213, 1)]), + (1, [(91, 1), (141, 1), (152, 1), (213, 1)]), + (1, [(91, 1), (141, 1), (152, 1)]), + (1, [(91, 1)]), + (1, [(91, 1), (213, 1)]), + (1, [(141, 1), (152, 1)]), + (1, [(141, 1), (152, 1), (213, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1), (263, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1)]), + (1, [(224, 1), (263, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(263, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(13, 1), (224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(224, 1)]), + (1, [(13, 1)]), + (1, [(13, 1)]), + (1, [(224, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(243, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(246, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(246, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1), (246, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]) +] + +def colChunk15 : List (Int × List (Nat × Int)) := [ + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(110, 1), (171, 1)]), + (1, [(171, 1)]), + (1, [(171, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1)]), + (1, [(30, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (142, 1)]), + (1, [(30, 1), (142, 1)]), + (1, [(30, 1)]), + (1, [(14, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(142, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(142, 1)]), + (1, [(14, 1), (30, 1), (142, 1)]), + (1, [(14, 1), (30, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(239, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (241, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(241, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1), (241, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(83, 1)]), + (1, [(15, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(15, 1), (83, 1)]), + (1, [(15, 1), (92, 1)]), + (1, [(83, 1), (92, 1)]), + (1, [(92, 1)]), + (1, [(15, 1), (83, 1), (92, 1)]), + (1, [(15, 1)]), + (1, [(83, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(225, 1)]), + (1, [(48, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1), (225, 1)]), + (1, [(48, 1)]), + (1, [(225, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(265, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1), (265, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1), (265, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(31, 1)]), + (1, [(84, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1), (160, 1)]), + (1, [(31, 1), (160, 1)]), + (1, [(31, 1), (84, 1), (160, 1)]), + (1, [(160, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(84, 1)]), + (1, [(31, 1)]), + (1, [(31, 1), (84, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]) +] + +def colChunk16 : List (Int × List (Nat × Int)) := [ + (1, [(214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(197, 1)]), + (1, [(69, 1), (214, 1)]), + (1, [(153, 1), (197, 1)]), + (1, [(69, 1), (153, 1), (214, 1)]), + (1, [(214, 1)]), + (1, [(69, 1), (197, 1)]), + (1, [(153, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(69, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1), (197, 1), (214, 1)]), + (1, [(69, 1), (153, 1), (197, 1), (214, 1)]), + (1, [(153, 1)]), + (1, [(69, 1)]), + (1, [(197, 1), (214, 1)]), + (1, [(69, 1), (153, 1)]), + (1, [(153, 1), (197, 1), (214, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(248, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(274, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(254, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(16, 1)]), + (1, [(32, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(16, 1)]), + (1, [(32, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(16, 1)]), + (1, [(32, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(16, 1)]), + (1, [(32, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(32, 1)]), + (1, [(16, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(32, 1)]), + (1, [(16, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(32, 1)]), + (1, [(16, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(32, 1)]), + (1, [(16, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(32, 1)]), + (1, [(16, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(32, 1)]), + (1, [(16, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(32, 1)]), + (1, [(16, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(32, 1)]), + (1, [(16, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(16, 1)]), + (1, [(32, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(93, 1)]), + (1, [(161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1)]), + (1, [(32, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(93, 1)]), + (1, [(161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(16, 1)]), + (1, [(32, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(93, 1)]), + (1, [(16, 1), (161, 1)]), + (1, [(32, 1), (161, 1)]), + (1, [(32, 1), (93, 1), (161, 1)]), + (1, [(16, 1), (93, 1), (161, 1)]), + (1, [(16, 1)]), + (1, [(32, 1)]), + (1, [(32, 1), (93, 1)]), + (1, [(16, 1), (93, 1)]), + (1, [(161, 1)]), + (1, [(16, 1), (32, 1), (161, 1)]), + (1, [(16, 1), (32, 1), (93, 1), (161, 1)]), + (1, [(93, 1), (161, 1)]), + (1, [(16, 1), (32, 1)]), + (1, [(16, 1), (32, 1), (93, 1)]), + (1, [(93, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(17, 1), (94, 1), (172, 1)]), + (1, [(94, 1), (172, 1)]), + (1, [(172, 1)]), + (1, [(17, 1), (172, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(17, 1)]), + (1, [(94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(17, 1), (94, 1)]), + (1, [(94, 1)]), + (1, [(17, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(270, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(280, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(33, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1), (280, 1)]), + (1, [(162, 1)]), + (1, [(162, 1), (280, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(33, 1), (162, 1)]), + (1, [(162, 1)]), + (1, [(280, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(33, 1)]), + (1, [(33, 1), (280, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(272, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]) +] + +def colChunk17 : List (Int × List (Nat × Int)) := [ + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(111, 1)]), + (1, [(198, 1)]), + (1, [(111, 1)]), + (1, [(111, 1), (198, 1)]), + (1, [(198, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(232, 1)]), + (1, [(70, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1), (184, 1)]), + (1, [(70, 1), (112, 1), (184, 1)]), + (1, [(70, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(70, 1), (112, 1)]), + (1, [(112, 1)]), + (1, [(70, 1), (184, 1)]), + (1, [(184, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(277, 1), (281, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(281, 1)]), + (1, [(277, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(49, 1)]), + (1, [(49, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(124, 1)]), + (1, [(49, 1)]), + (1, [(124, 1)]), + (1, [(49, 1), (124, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(237, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(34, 1), (143, 1)]), + (1, [(143, 1)]), + (1, [(95, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1)]), + (1, [(34, 1)]), + (1, [(95, 1), (143, 1)]), + (1, [(34, 1), (95, 1), (143, 1)]), + (1, [(34, 1), (95, 1)]), + (1, [(95, 1)]), + (1, [(143, 1)]), + (1, [(34, 1), (143, 1)]), + (0, [(674, -1)]), + (0, [(18, 1), (393, -1)]), + (0, [(58, 1), (407, -1)]), + (0, [(71, 1), (410, -1)]), + (0, [(424, -1)]), + (0, [(458, -1)]), + (0, [(473, -1)]), + (0, [(185, 1), (484, -1)]), + (0, [(488, -1)]), + (0, [(0, 1), (390, -1)]), + (0, [(19, 1), (393, -1)]), + (0, [(154, 1), (458, -1)]), + (0, [(390, -1)]), + (0, [(393, -1)]), + (0, [(399, -1)]), + (0, [(407, -1)]), + (0, [(410, -1)]), + (0, [(422, -1)]), + (0, [(424, -1)]), + (0, [(426, -1)]), + (0, [(428, -1)]), + (0, [(469, -1)]), + (0, [(473, -1)]), + (0, [(484, -1)]), + (0, [(488, -1)]), + (0, [(491, -1)]), + (0, [(522, -1)]), + (0, [(535, -1)]), + (0, [(549, -1)]), + (0, [(593, -1)]), + (0, [(594, -1)]), + (0, [(617, -1)]), + (0, [(640, -1)]), + (0, [(641, -1)]), + (0, [(648, -1)]), + (0, [(655, -1)]), + (0, [(659, -1)]), + (0, [(661, -1)]), + (0, [(665, -1)]), + (0, [(674, -1)]), + (0, [(676, -1)]), + (0, [(255, 1), (680, -1)]), + (0, [(682, -1)]), + (0, [(693, -1)]), + (0, [(701, -1)]), + (0, [(705, -1)]), + (0, [(708, -1)]), + (0, [(710, -1)]), + (0, [(721, -1)]), + (0, [(747, -1)]), + (0, [(794, -1)]), + (0, [(826, -1)]), + (0, [(831, -1)]), + (0, [(889, -1)]), + (0, [(1, 1), (390, -1)]), + (0, [(428, -1)]), + (0, [(144, 1), (437, -1)]), + (0, [(469, -1)]), + (0, [(173, 1), (473, -1)]), + (0, [(199, 1), (488, -1)]), + (0, [(390, -1)]), + (0, [(422, -1)]), + (0, [(399, -1)]), + (0, [(491, -1)]), + (0, [(256, 1), (680, -1)]), + (0, [(35, 1), (399, -1)]), + (0, [(113, 1), (426, -1)]), + (0, [(268, 1), (710, -1)]), + (0, [(96, 1), (424, -1)]), + (0, [(125, 1), (428, -1)]), + (0, [(20, 1), (393, -1)]), + (0, [(97, 1), (424, -1)]), + (0, [(114, 1), (426, -1)]), + (0, [(469, -1)]), + (0, [(228, 1), (535, -1)]), + (0, [(85, 1), (422, -1)]), + (0, [(424, -1)]), + (0, [(115, 1), (426, -1)]), + (0, [(155, 1), (458, -1)]), + (0, [(260, 1), (693, -1)]), + (0, [(215, 1), (491, -1)]), + (0, [(215, 1), (230, 1), (549, -1)]), + (0, [(422, -1)]), + (0, [(2, 1), (390, -1)]), + (0, [(72, 1), (410, -1)]), + (0, [(428, -1)]), + (0, [(484, -1)]), + (0, [(3, 1), (390, -1)]), + (0, [(36, 1), (399, -1)]), + (0, [(428, -1)]), + (0, [(680, -1)]), + (0, [(86, 1), (422, -1)]), + (0, [(116, 1), (426, -1)]), + (0, [(163, 1), (469, -1)]), + (0, [(4, 1), (390, -1)]), + (0, [(59, 1), (407, -1)]), + (0, [(126, 1), (428, -1)]), + (0, [(473, -1)]), + (0, [(200, 1), (488, -1)]), + (0, [(251, 1), (676, -1)]), + (0, [(21, 1), (393, -1)]), + (0, [(37, 1), (399, -1)]), + (0, [(424, -1)]), + (0, [(156, 1), (458, -1)]), + (0, [(399, -1)]), + (0, [(50, 1), (404, -1)]), + (0, [(98, 1), (424, -1)]), + (0, [(174, 1), (473, -1)]), + (0, [(488, -1)]), + (0, [(264, 1), (705, -1)]), + (0, [(393, -1)]), + (0, [(99, 1), (424, -1)]), + (0, [(145, 1), (437, -1)]), + (0, [(175, 1), (473, -1)]), + (0, [(201, 1), (488, -1)]), + (0, [(831, -1)]), + (0, [(410, -1)]), + (0, [(87, 1), (422, -1)]), + (0, [(100, 1), (424, -1)]), + (0, [(426, -1)]), + (0, [(428, -1)]), + (0, [(469, -1)]), + (0, [(186, 1), (484, -1)]), + (0, [(5, 1), (390, -1)]), + (0, [(51, 1), (404, -1)]), + (0, [(176, 1), (473, -1)]), + (0, [(488, -1)]), + (0, [(269, 1), (710, -1)]), + (0, [(257, 1), (680, -1)]), + (0, [(826, -1)]), + (0, [(831, -1)]), + (0, [(60, 1), (407, -1)]), + (0, [(410, -1)]), + (0, [(177, 1), (473, -1)]), + (0, [(187, 1), (484, -1)]), + (0, [(488, -1)]), + (0, [(233, 1), (594, -1)]), + (0, [(22, 1), (393, -1)]), + (0, [(52, 1), (404, -1)]), + (0, [(61, 1), (407, -1)]), + (0, [(146, 1), (437, -1)]), + (0, [(178, 1), (473, -1)]), + (0, [(202, 1), (488, -1)]), + (0, [(266, 1), (708, -1)]), + (0, [(73, 1), (410, -1)]), + (0, [(188, 1), (484, -1)]), + (0, [(491, -1)]), + (0, [(6, 1), (390, -1)]), + (0, [(38, 1), (399, -1)]), + (0, [(426, -1)]), + (0, [(428, -1)]), + (0, [(469, -1)]), + (0, [(488, -1)]), + (0, [(53, 1), (404, -1)]), + (0, [(62, 1), (407, -1)]), + (0, [(74, 1), (410, -1)]), + (0, [(424, -1)]), + (0, [(458, -1)]), + (0, [(484, -1)]), + (0, [(203, 1), (488, -1)]), + (0, [(23, 1), (393, -1)]), + (0, [(39, 1), (399, -1)]), + (0, [(63, 1), (407, -1)]), + (0, [(101, 1), (424, -1)]), + (0, [(437, -1)]), + (0, [(458, -1)]), + (0, [(484, -1)]), + (0, [(488, -1)]), + (0, [(54, 1), (404, -1)]), + (0, [(64, 1), (407, -1)]), + (0, [(102, 1), (424, -1)]), + (0, [(157, 1), (458, -1)]), + (0, [(204, 1), (488, -1)]), + (0, [(831, -1)]), + (0, [(282, 1), (889, -1)]), + (0, [(247, 1), (665, -1)]), + (0, [(252, 1), (676, -1)]), + (0, [(117, 1), (426, -1)]), + (0, [(164, 1), (469, -1)]), + (0, [(205, 1), (488, -1)]), + (0, [(680, -1)]), + (0, [(40, 1), (399, -1)]), + (0, [(422, -1)]), + (0, [(165, 1), (469, -1)]), + (0, [(216, 1), (491, -1)]), + (0, [(118, 1), (426, -1)]), + (0, [(189, 1), (484, -1)]), + (0, [(238, 1), (641, -1)]), + (0, [(75, 1), (410, -1)]), + (0, [(422, -1)]), + (0, [(426, -1)]), + (0, [(469, -1)]), + (0, [(190, 1), (484, -1)]), + (0, [(127, 1), (428, -1)]), + (0, [(191, 1), (484, -1)]), + (0, [(242, 1), (655, -1)]), + (0, [(24, 1), (393, -1)]), + (0, [(103, 1), (424, -1)]), + (0, [(166, 1), (469, -1)]), + (0, [(24, 1), (659, -1)]), + (0, [(76, 1), (410, -1)]), + (0, [(192, 1), (484, -1)]), + (0, [(831, -1)]) +] + +def colChunk18 : List (Int × List (Nat × Int)) := [ + (0, [(283, 1), (889, -1)]), + (0, [(273, 1), (794, -1)]), + (0, [(253, 1), (676, -1)]), + (0, [(271, 1), (747, -1)]), + (0, [(794, -1)]), + (0, [(399, -1)]), + (0, [(491, -1)]), + (0, [(410, -1)]), + (0, [(491, -1)]), + (0, [(25, 1), (393, -1)]), + (0, [(55, 1), (404, -1)]), + (0, [(158, 1), (458, -1)]), + (0, [(179, 1), (473, -1)]), + (0, [(488, -1)]), + (0, [(491, -1)]), + (0, [(390, -1)]), + (0, [(393, -1)]), + (0, [(77, 1), (410, -1)]), + (0, [(424, -1)]), + (0, [(128, 1), (428, -1)]), + (0, [(469, -1)]), + (0, [(484, -1)]), + (0, [(244, 1), (659, -1)]), + (0, [(390, -1)]), + (0, [(104, 1), (424, -1)]), + (0, [(119, 1), (426, -1)]), + (0, [(484, -1)]), + (0, [(240, 1), (648, -1)]), + (0, [(390, -1)]), + (0, [(26, 1), (393, -1)]), + (0, [(410, -1)]), + (0, [(422, -1)]), + (0, [(424, -1)]), + (0, [(426, -1)]), + (0, [(129, 1), (428, -1)]), + (0, [(458, -1)]), + (0, [(167, 1), (469, -1)]), + (0, [(484, -1)]), + (0, [(41, 1), (399, -1)]), + (0, [(217, 1), (491, -1)]), + (0, [(390, -1)]), + (0, [(399, -1)]), + (0, [(65, 1), (407, -1)]), + (0, [(422, -1)]), + (0, [(130, 1), (428, -1)]), + (0, [(469, -1)]), + (0, [(473, -1)]), + (0, [(206, 1), (488, -1)]), + (0, [(218, 1), (491, -1)]), + (0, [(7, 1), (390, -1)]), + (0, [(404, -1)]), + (0, [(407, -1)]), + (0, [(422, -1)]), + (0, [(426, -1)]), + (0, [(147, 1), (437, -1)]), + (0, [(180, 1), (473, -1)]), + (0, [(488, -1)]), + (0, [(491, -1)]), + (0, [(275, 1), (826, -1)]), + (0, [(278, 1), (831, -1)]), + (0, [(27, 1), (393, -1)]), + (0, [(105, 1), (424, -1)]), + (0, [(159, 1), (458, -1)]), + (0, [(234, 1), (594, -1)]), + (0, [(42, 1), (399, -1)]), + (0, [(78, 1), (410, -1)]), + (0, [(267, 1), (708, -1)]), + (0, [(28, 1), (393, -1)]), + (0, [(106, 1), (424, -1)]), + (0, [(207, 1), (488, -1)]), + (0, [(8, 1), (390, -1)]), + (0, [(131, 1), (428, -1)]), + (0, [(484, -1)]), + (0, [(229, 1), (535, -1)]), + (0, [(9, 1), (390, -1)]), + (0, [(79, 1), (410, -1)]), + (0, [(484, -1)]), + (0, [(261, 1), (693, -1)]), + (0, [(10, 1), (390, -1)]), + (0, [(132, 1), (428, -1)]), + (0, [(404, -1)]), + (0, [(66, 1), (407, -1)]), + (0, [(120, 1), (426, -1)]), + (0, [(168, 1), (469, -1)]), + (0, [(208, 1), (488, -1)]), + (0, [(258, 1), (682, -1)]), + (0, [(11, 1), (390, -1)]), + (0, [(407, -1)]), + (0, [(133, 1), (428, -1)]), + (0, [(148, 1), (437, -1)]), + (0, [(209, 1), (488, -1)]), + (0, [(235, 1), (617, -1)]), + (0, [(422, -1)]), + (0, [(469, -1)]), + (0, [(491, -1)]), + (0, [(43, 1), (399, -1)]), + (0, [(422, -1)]), + (0, [(219, 1), (491, -1)]), + (0, [(399, -1)]), + (0, [(404, -1)]), + (0, [(407, -1)]), + (0, [(426, -1)]), + (0, [(134, 1), (428, -1)]), + (0, [(469, -1)]), + (0, [(488, -1)]), + (0, [(220, 1), (491, -1)]), + (0, [(410, -1)]), + (0, [(428, -1)]), + (0, [(410, -1)]), + (0, [(426, -1)]), + (0, [(458, -1)]), + (0, [(484, -1)]), + (0, [(491, -1)]), + (0, [(393, -1)]), + (0, [(80, 1), (410, -1)]), + (0, [(107, 1), (424, -1)]), + (0, [(484, -1)]), + (0, [(488, -1)]), + (0, [(491, -1)]), + (0, [(44, 1), (399, -1)]), + (0, [(404, -1)]), + (0, [(424, -1)]), + (0, [(437, -1)]), + (0, [(484, -1)]), + (0, [(488, -1)]), + (0, [(221, 1), (491, -1)]), + (0, [(404, -1)]), + (0, [(407, -1)]), + (0, [(88, 1), (422, -1)]), + (0, [(121, 1), (426, -1)]), + (0, [(437, -1)]), + (0, [(181, 1), (473, -1)]), + (0, [(210, 1), (488, -1)]), + (0, [(680, -1)]), + (0, [(262, 1), (701, -1)]), + (0, [(390, -1)]), + (0, [(410, -1)]), + (0, [(422, -1)]), + (0, [(390, -1)]), + (0, [(393, -1)]), + (0, [(108, 1), (424, -1)]), + (0, [(135, 1), (428, -1)]), + (0, [(458, -1)]), + (0, [(399, -1)]), + (0, [(226, 1), (522, -1)]), + (0, [(680, -1)]), + (0, [(276, 1), (826, -1)]), + (0, [(279, 1), (831, -1)]), + (0, [(393, -1)]), + (0, [(67, 1), (407, -1)]), + (0, [(81, 1), (410, -1)]), + (0, [(458, -1)]), + (0, [(182, 1), (473, -1)]), + (0, [(399, -1)]), + (0, [(458, -1)]), + (0, [(393, -1)]), + (0, [(45, 1), (399, -1)]), + (0, [(56, 1), (404, -1)]), + (0, [(68, 1), (407, -1)]), + (0, [(82, 1), (410, -1)]), + (0, [(149, 1), (437, -1)]), + (0, [(473, -1)]), + (0, [(488, -1)]), + (0, [(393, -1)]), + (0, [(46, 1), (399, -1)]), + (0, [(424, -1)]), + (0, [(437, -1)]), + (0, [(473, -1)]), + (0, [(484, -1)]), + (0, [(488, -1)]), + (0, [(222, 1), (491, -1)]), + (0, [(57, 1), (404, -1)]), + (0, [(150, 1), (437, -1)]), + (0, [(193, 1), (484, -1)]), + (0, [(211, 1), (488, -1)]), + (0, [(231, 1), (593, -1)]), + (0, [(249, 1), (674, -1)]), + (0, [(676, -1)]), + (0, [(680, -1)]), + (0, [(12, 1), (390, -1)]), + (0, [(407, -1)]), + (0, [(422, -1)]), + (0, [(426, -1)]), + (0, [(136, 1), (428, -1)]), + (0, [(437, -1)]), + (0, [(469, -1)]), + (0, [(488, -1)]), + (0, [(491, -1)]), + (0, [(390, -1)]), + (0, [(29, 1), (393, -1)]), + (0, [(89, 1), (422, -1)]), + (0, [(424, -1)]), + (0, [(137, 1), (428, -1)]), + (0, [(458, -1)]), + (0, [(469, -1)]), + (0, [(484, -1)]), + (0, [(390, -1)]), + (0, [(410, -1)]), + (0, [(422, -1)]), + (0, [(424, -1)]), + (0, [(122, 1), (426, -1)]), + (0, [(458, -1)]), + (0, [(194, 1), (484, -1)]), + (0, [(390, -1)]), + (0, [(393, -1)]), + (0, [(424, -1)]), + (0, [(426, -1)]), + (0, [(138, 1), (428, -1)]), + (0, [(469, -1)]), + (0, [(195, 1), (484, -1)]), + (0, [(227, 1), (522, -1)]), + (0, [(250, 1), (674, -1)]), + (0, [(676, -1)]), + (0, [(90, 1), (422, -1)]), + (0, [(169, 1), (469, -1)]), + (0, [(196, 1), (484, -1)]), + (0, [(422, -1)]), + (0, [(123, 1), (426, -1)]), + (0, [(469, -1)]), + (0, [(223, 1), (491, -1)]), + (0, [(236, 1), (617, -1)]), + (0, [(47, 1), (399, -1)]), + (0, [(139, 1), (428, -1)]), + (0, [(491, -1)]), + (0, [(259, 1), (682, -1)]), + (0, [(151, 1), (437, -1)]), + (0, [(170, 1), (469, -1)]), + (0, [(183, 1), (473, -1)]), + (0, [(212, 1), (488, -1)]), + (0, [(410, -1)]), + (0, [(109, 1), (424, -1)]), + (0, [(426, -1)]), + (0, [(140, 1), (428, -1)]), + (0, [(458, -1)]), + (0, [(469, -1)]), + (0, [(484, -1)]), + (0, [(245, 1), (661, -1)]), + (0, [(399, -1)]), + (0, [(428, -1)]), + (0, [(426, -1)]), + (0, [(404, -1)]), + (0, [(91, 1), (422, -1)]), + (0, [(426, -1)]), + (0, [(141, 1), (428, -1)]), + (0, [(152, 1), (437, -1)]), + (0, [(469, -1)]), + (0, [(213, 1), (488, -1)]), + (0, [(13, 1), (390, -1)]), + (0, [(224, 1), (491, -1)]), + (0, [(680, -1)]), + (0, [(263, 1), (701, -1)]), + (0, [(110, 1), (424, -1)]), + (0, [(426, -1)]), + (0, [(458, -1)]), + (0, [(171, 1), (469, -1)]), + (0, [(243, 1), (655, -1)]), + (0, [(246, 1), (661, -1)]), + (0, [(14, 1), (390, -1)]), + (0, [(30, 1), (393, -1)]), + (0, [(424, -1)]), + (0, [(142, 1), (428, -1)]), + (0, [(458, -1)]), + (0, [(15, 1), (390, -1)]), + (0, [(83, 1), (410, -1)]), + (0, [(92, 1), (422, -1)]), + (0, [(424, -1)]), + (0, [(469, -1)]), + (0, [(239, 1), (641, -1)]), + (0, [(241, 1), (648, -1)]), + (0, [(48, 1), (399, -1)]), + (0, [(484, -1)]), + (0, [(225, 1), (491, -1)]), + (0, [(831, -1)]), + (0, [(31, 1), (393, -1)]), + (0, [(84, 1), (410, -1)]), + (0, [(160, 1), (458, -1)]), + (0, [(491, -1)]), + (0, [(265, 1), (705, -1)]), + (0, [(69, 1), (407, -1)]), + (0, [(153, 1), (437, -1)]), + (0, [(197, 1), (484, -1)]), + (0, [(214, 1), (488, -1)]), + (0, [(248, 1), (665, -1)]), + (0, [(274, 1), (794, -1)]), + (0, [(254, 1), (676, -1)]), + (0, [(794, -1)]), + (0, [(16, 1), (390, -1)]), + (0, [(32, 1), (393, -1)]), + (0, [(93, 1), (422, -1)]), + (0, [(161, 1), (458, -1)]), + (0, [(469, -1)]), + (0, [(484, -1)]), + (0, [(794, -1)]), + (0, [(17, 1), (390, -1)]), + (0, [(94, 1), (422, -1)]), + (0, [(172, 1), (469, -1)]), + (0, [(33, 1), (393, -1)]), + (0, [(162, 1), (458, -1)]), + (0, [(484, -1)]), + (0, [(270, 1), (721, -1)]), + (0, [(794, -1)]), + (0, [(826, -1)]), + (0, [(280, 1), (831, -1)]), + (0, [(111, 1), (424, -1)]), + (0, [(198, 1), (484, -1)]), + (0, [(272, 1), (747, -1)]), + (0, [(794, -1)]), + (0, [(399, -1)]), + (0, [(70, 1), (407, -1)]), + (0, [(410, -1)]), + (0, [(112, 1), (424, -1)]), + (0, [(184, 1), (473, -1)]), + (0, [(491, -1)]), + (0, [(232, 1), (593, -1)]), + (0, [(277, 1), (826, -1)]), + (0, [(281, 1), (831, -1)]), + (0, [(49, 1), (399, -1)]), + (0, [(404, -1)]), + (0, [(124, 1), (426, -1)]), + (0, [(473, -1)]), + (0, [(34, 1), (393, -1)]), + (0, [(410, -1)]), + (0, [(95, 1), (422, -1)]), + (0, [(143, 1), (428, -1)]), + (0, [(458, -1)]), + (0, [(469, -1)]), + (0, [(237, 1), (640, -1)]), + (1, [(284, 1)]), + (1, [(285, 1)]), + (1, [(286, 1)]), + (1, [(287, 1)]), + (1, [(288, 1)]), + (1, [(289, 1)]), + (1, [(290, 1)]), + (1, [(291, 1)]), + (1, [(292, 1)]), + (1, [(293, 1)]), + (1, [(294, 1)]), + (1, [(295, 1)]), + (1, [(296, 1)]), + (1, [(297, 1)]), + (1, [(298, 1)]), + (1, [(299, 1)]), + (1, [(300, 1)]), + (1, [(301, 1)]), + (1, [(302, 1)]), + (1, [(303, 1)]), + (1, [(304, 1)]), + (1, [(305, 1)]), + (1, [(306, 1)]), + (1, [(307, 1)]), + (1, [(308, 1)]), + (1, [(309, 1)]), + (1, [(310, 1)]), + (1, [(311, 1)]), + (1, [(312, 1)]), + (1, [(313, 1)]), + (1, [(314, 1)]), + (1, [(315, 1)]), + (1, [(316, 1)]), + (1, [(317, 1)]), + (1, [(318, 1)]), + (1, [(319, 1)]), + (1, [(320, 1)]), + (1, [(321, 1)]), + (1, [(322, 1)]), + (1, [(323, 1)]), + (1, [(324, 1)]), + (1, [(325, 1)]), + (1, [(326, 1)]), + (1, [(327, 1)]), + (1, [(328, 1)]), + (1, [(329, 1)]), + (1, [(330, 1)]), + (1, [(331, 1)]), + (1, [(332, 1)]), + (1, [(333, 1)]), + (1, [(334, 1)]), + (1, [(335, 1)]), + (1, [(336, 1)]), + (1, [(337, 1)]), + (1, [(338, 1)]), + (1, [(339, 1)]), + (1, [(340, 1)]), + (1, [(341, 1)]), + (1, [(342, 1)]), + (1, [(343, 1)]), + (1, [(344, 1)]), + (1, [(345, 1)]), + (1, [(346, 1)]), + (1, [(347, 1)]), + (1, [(348, 1)]), + (1, [(349, 1)]), + (1, [(350, 1)]), + (1, [(351, 1)]), + (1, [(352, 1)]), + (1, [(353, 1)]), + (1, [(354, 1)]), + (1, [(355, 1)]), + (1, [(356, 1)]), + (1, [(357, 1)]), + (1, [(358, 1)]), + (1, [(359, 1)]), + (1, [(360, 1)]), + (1, [(361, 1)]), + (1, [(362, 1)]), + (1, [(363, 1)]), + (1, [(364, 1)]), + (1, [(365, 1)]), + (1, [(366, 1)]), + (1, [(367, 1)]), + (1, [(368, 1)]), + (1, [(369, 1)]), + (1, [(370, 1)]), + (1, [(371, 1)]), + (1, [(372, 1)]), + (1, [(373, 1)]), + (1, [(374, 1)]), + (1, [(375, 1)]), + (1, [(376, 1)]), + (1, [(377, 1)]), + (1, [(378, 1)]), + (1, [(379, 1)]), + (1, [(380, 1)]), + (1, [(381, 1)]), + (1, [(382, 1)]), + (1, [(383, 1)]), + (1, [(384, 1)]), + (1, [(385, 1)]), + (1, [(386, 1)]), + (1, [(387, 1)]), + (1, [(388, 1)]), + (1, [(389, 1), (390, 1)]), + (1, [(391, 1)]), + (1, [(392, 1), (393, 1)]), + (1, [(394, 1)]), + (1, [(395, 1)]), + (1, [(396, 1)]), + (1, [(397, 1)]), + (1, [(398, 1), (399, 1)]), + (1, [(400, 1)]), + (1, [(401, 1)]), + (1, [(402, 1)]), + (1, [(403, 1), (404, 1)]), + (1, [(405, 1)]), + (1, [(406, 1), (407, 1)]), + (1, [(408, 1)]), + (1, [(409, 1), (410, 1)]), + (1, [(411, 1)]), + (1, [(412, 1)]), + (1, [(413, 1)]), + (1, [(414, 1)]), + (1, [(415, 1)]), + (1, [(416, 1)]), + (1, [(417, 1)]), + (1, [(418, 1)]), + (1, [(419, 1)]), + (1, [(420, 1)]), + (1, [(421, 1), (422, 1)]), + (1, [(423, 1), (424, 1)]), + (1, [(425, 1), (426, 1)]), + (1, [(427, 1), (428, 1)]), + (1, [(429, 1)]), + (1, [(430, 1)]), + (1, [(431, 1)]), + (1, [(432, 1)]), + (1, [(433, 1)]), + (1, [(434, 1)]), + (1, [(435, 1)]), + (1, [(436, 1), (437, 1)]), + (1, [(438, 1)]), + (1, [(439, 1)]), + (1, [(440, 1)]), + (1, [(441, 1)]), + (1, [(442, 1)]), + (1, [(443, 1)]), + (1, [(444, 1)]), + (1, [(445, 1)]), + (1, [(446, 1)]), + (1, [(447, 1)]), + (1, [(448, 1)]), + (1, [(449, 1)]), + (1, [(450, 1)]), + (1, [(451, 1)]), + (1, [(452, 1)]), + (1, [(453, 1)]), + (1, [(454, 1)]), + (1, [(455, 1)]), + (1, [(456, 1)]), + (1, [(457, 1), (458, 1)]), + (1, [(459, 1)]), + (1, [(460, 1)]), + (1, [(461, 1)]), + (1, [(462, 1)]), + (1, [(463, 1)]), + (1, [(464, 1)]), + (1, [(465, 1)]), + (1, [(466, 1)]), + (1, [(467, 1)]), + (1, [(468, 1), (469, 1)]), + (1, [(470, 1)]), + (1, [(471, 1)]), + (1, [(472, 1), (473, 1)]), + (1, [(474, 1)]), + (1, [(475, 1)]), + (1, [(476, 1)]), + (1, [(477, 1)]), + (1, [(478, 1)]), + (1, [(479, 1)]), + (1, [(480, 1)]), + (1, [(481, 1)]), + (1, [(482, 1)]), + (1, [(483, 1), (484, 1)]), + (1, [(485, 1)]), + (1, [(486, 1)]), + (1, [(487, 1), (488, 1)]), + (1, [(489, 1)]), + (1, [(490, 1), (491, 1)]), + (1, [(492, 1)]), + (1, [(493, 1)]), + (1, [(494, 1)]), + (1, [(495, 1)]), + (1, [(496, 1)]), + (1, [(497, 1)]), + (1, [(498, 1)]), + (1, [(499, 1)]), + (1, [(500, 1)]), + (1, [(501, 1)]), + (1, [(502, 1)]), + (1, [(503, 1)]), + (1, [(504, 1)]), + (1, [(505, 1)]), + (1, [(506, 1)]), + (1, [(507, 1)]), + (1, [(508, 1)]), + (1, [(509, 1)]), + (1, [(510, 1)]), + (1, [(511, 1)]), + (1, [(512, 1)]), + (1, [(513, 1)]), + (1, [(514, 1)]), + (1, [(515, 1)]), + (1, [(516, 1)]), + (1, [(517, 1)]), + (1, [(518, 1)]), + (1, [(519, 1)]), + (1, [(520, 1)]), + (1, [(521, 1)]), + (1, [(522, 1)]), + (1, [(523, 1)]), + (1, [(524, 1)]), + (1, [(525, 1)]), + (1, [(526, 1)]), + (1, [(527, 1)]), + (1, [(528, 1)]), + (1, [(529, 1)]), + (1, [(530, 1)]), + (1, [(531, 1)]), + (1, [(532, 1)]), + (1, [(533, 1), (534, 1)]), + (1, [(535, 1)]), + (1, [(536, 1)]), + (1, [(537, 1), (538, 1)]), + (1, [(539, 1), (540, 1)]), + (1, [(541, 1)]), + (1, [(542, 1)]), + (1, [(543, 1)]), + (1, [(544, 1)]), + (1, [(545, 1)]), + (1, [(546, 1)]), + (1, [(547, 1)]), + (1, [(548, 1)]), + (1, [(549, 1)]), + (1, [(550, 1)]), + (1, [(551, 1)]), + (1, [(552, 1)]), + (1, [(553, 1)]), + (1, [(554, 1)]), + (1, [(555, 1), (556, 1)]), + (1, [(557, 1)]), + (1, [(558, 1)]), + (1, [(559, 1)]), + (1, [(560, 1)]), + (1, [(561, 1)]), + (1, [(562, 1)]), + (1, [(563, 1), (564, 1)]), + (1, [(565, 1)]), + (1, [(566, 1)]), + (1, [(567, 1)]), + (1, [(568, 1)]), + (1, [(569, 1), (570, 1)]), + (1, [(571, 1)]), + (1, [(572, 1)]), + (1, [(573, 1), (574, 1)]), + (1, [(575, 1), (576, 1)]), + (1, [(577, 1)]), + (1, [(578, 1)]), + (1, [(579, 1)]), + (1, [(580, 1), (581, 1)]), + (1, [(582, 1)]), + (1, [(583, 1)]), + (1, [(584, 1), (585, 1)]), + (1, [(586, 1), (587, 1)]), + (1, [(588, 1)]), + (1, [(589, 1)]), + (1, [(590, 1)]), + (1, [(591, 1)]), + (1, [(592, 1)]), + (1, [(593, 1)]), + (1, [(594, 1)]), + (1, [(595, 1)]), + (1, [(596, 1)]), + (1, [(597, 1), (598, 1)]), + (1, [(599, 1)]), + (1, [(600, 1)]), + (1, [(601, 1)]), + (1, [(602, 1)]), + (1, [(603, 1)]), + (1, [(604, 1), (605, 1)]), + (1, [(606, 1)]), + (1, [(607, 1)]), + (1, [(608, 1), (609, 1)]), + (1, [(610, 1)]), + (1, [(611, 1)]), + (1, [(612, 1)]), + (1, [(613, 1)]), + (1, [(614, 1)]), + (1, [(615, 1), (616, 1)]), + (1, [(617, 1)]), + (1, [(618, 1), (619, 1)]), + (1, [(620, 1)]), + (1, [(621, 1), (622, 1)]), + (1, [(623, 1), (624, 1)]), + (1, [(625, 1)]), + (1, [(626, 1)]), + (1, [(627, 1)]), + (1, [(628, 1)]), + (1, [(629, 1), (630, 1)]), + (1, [(631, 1)]), + (1, [(632, 1)]), + (1, [(633, 1), (634, 1)]), + (1, [(635, 1), (636, 1)]), + (1, [(637, 1)]), + (1, [(638, 1)]), + (1, [(639, 1)]), + (1, [(640, 1)]), + (1, [(641, 1)]), + (1, [(642, 1)]), + (1, [(643, 1)]), + (1, [(644, 1)]), + (1, [(645, 1), (646, 1)]), + (1, [(647, 1), (648, 1)]), + (1, [(649, 1)]), + (1, [(650, 1)]), + (1, [(651, 1)]), + (1, [(652, 1)]), + (1, [(653, 1)]), + (1, [(654, 1)]), + (1, [(655, 1)]), + (1, [(656, 1)]), + (1, [(657, 1)]), + (1, [(658, 1), (659, 1)]), + (1, [(660, 1), (661, 1)]), + (1, [(662, 1)]), + (1, [(663, 1)]), + (1, [(664, 1)]), + (1, [(665, 1)]), + (1, [(666, 1)]), + (1, [(667, 1)]), + (1, [(668, 1)]), + (1, [(669, 1)]), + (1, [(670, 1)]), + (1, [(671, 1)]), + (1, [(672, 1)]), + (1, [(673, 1)]), + (1, [(674, 1)]), + (1, [(675, 1)]), + (1, [(676, 1)]), + (1, [(677, 1)]), + (1, [(678, 1)]), + (1, [(679, 1)]), + (1, [(680, 1)]), + (1, [(681, 1), (682, 1)]), + (1, [(683, 1)]), + (1, [(684, 1)]), + (1, [(685, 1)]), + (1, [(686, 1)]), + (1, [(687, 1)]), + (1, [(688, 1)]), + (1, [(689, 1)]), + (1, [(690, 1)]), + (1, [(691, 1)]), + (1, [(692, 1), (693, 1)]), + (1, [(694, 1)]), + (1, [(695, 1)]), + (1, [(696, 1)]), + (1, [(697, 1)]), + (1, [(698, 1)]), + (1, [(699, 1)]), + (1, [(700, 1), (701, 1)]), + (1, [(702, 1)]), + (1, [(703, 1)]), + (1, [(704, 1), (705, 1)]), + (1, [(706, 1)]), + (1, [(707, 1), (708, 1)]), + (1, [(709, 1), (710, 1)]), + (1, [(711, 1)]), + (1, [(712, 1)]), + (1, [(713, 1)]), + (1, [(714, 1)]), + (1, [(715, 1)]), + (1, [(716, 1)]), + (1, [(717, 1)]), + (1, [(718, 1)]), + (1, [(719, 1)]), + (1, [(720, 1)]), + (1, [(721, 1)]), + (1, [(722, 1), (723, 1)]), + (1, [(724, 1)]), + (1, [(725, 1)]), + (1, [(726, 1)]), + (1, [(727, 1)]), + (1, [(728, 1)]), + (1, [(729, 1)]), + (1, [(730, 1)]), + (1, [(731, 1)]), + (1, [(732, 1)]), + (1, [(733, 1)]), + (1, [(734, 1)]), + (1, [(735, 1)]), + (1, [(736, 1)]), + (1, [(737, 1)]), + (1, [(738, 1)]), + (1, [(739, 1)]), + (1, [(740, 1)]), + (1, [(741, 1)]), + (1, [(742, 1)]), + (1, [(743, 1)]), + (1, [(744, 1)]), + (1, [(745, 1)]), + (1, [(746, 1)]), + (1, [(747, 1)]), + (1, [(748, 1)]), + (1, [(749, 1)]), + (1, [(750, 1)]), + (1, [(751, 1)]), + (1, [(752, 1)]), + (1, [(753, 1)]), + (1, [(754, 1)]), + (1, [(755, 1)]), + (1, [(756, 1)]), + (1, [(757, 1)]), + (1, [(758, 1)]), + (1, [(759, 1)]), + (1, [(760, 1)]), + (1, [(761, 1)]), + (1, [(762, 1)]), + (1, [(763, 1)]), + (1, [(764, 1)]), + (1, [(765, 1)]), + (1, [(766, 1)]), + (1, [(767, 1)]), + (1, [(768, 1)]), + (1, [(769, 1)]), + (1, [(770, 1)]), + (1, [(771, 1)]), + (1, [(772, 1)]), + (1, [(773, 1)]), + (1, [(774, 1)]), + (1, [(775, 1)]), + (1, [(776, 1)]), + (1, [(777, 1)]), + (1, [(778, 1)]), + (1, [(779, 1)]), + (1, [(780, 1)]), + (1, [(781, 1)]), + (1, [(782, 1)]), + (1, [(783, 1)]), + (1, [(784, 1)]), + (1, [(785, 1)]), + (1, [(786, 1)]), + (1, [(787, 1)]), + (1, [(788, 1), (789, 1)]), + (1, [(790, 1)]), + (1, [(791, 1)]), + (1, [(792, 1)]), + (1, [(793, 1)]), + (1, [(794, 1)]), + (1, [(795, 1)]), + (1, [(796, 1), (797, 1)]), + (1, [(798, 1)]), + (1, [(799, 1), (800, 1)]), + (1, [(801, 1)]), + (1, [(802, 1), (803, 1)]), + (1, [(804, 1)]), + (1, [(805, 1)]), + (1, [(806, 1)]), + (1, [(807, 1)]), + (1, [(808, 1)]), + (1, [(809, 1)]), + (1, [(810, 1)]), + (1, [(811, 1)]), + (1, [(812, 1)]), + (1, [(813, 1)]), + (1, [(814, 1)]), + (1, [(815, 1)]), + (1, [(816, 1)]), + (1, [(817, 1)]), + (1, [(818, 1), (819, 1)]), + (1, [(820, 1)]), + (1, [(821, 1)]), + (1, [(822, 1)]), + (1, [(823, 1)]), + (1, [(824, 1)]), + (1, [(825, 1), (826, 1)]), + (1, [(827, 1)]), + (1, [(828, 1)]), + (1, [(829, 1)]), + (1, [(830, 1), (831, 1)]), + (1, [(832, 1)]), + (1, [(833, 1)]), + (1, [(834, 1), (835, 1)]), + (1, [(836, 1)]), + (1, [(837, 1)]), + (1, [(838, 1), (839, 1)]), + (1, [(840, 1), (841, 1)]), + (1, [(842, 1)]), + (1, [(843, 1)]), + (1, [(844, 1)]), + (1, [(845, 1), (846, 1)]), + (1, [(847, 1)]), + (1, [(848, 1), (849, 1)]), + (1, [(850, 1), (851, 1)]), + (1, [(852, 1)]), + (1, [(853, 1)]), + (1, [(854, 1)]), + (1, [(855, 1)]), + (1, [(856, 1)]), + (1, [(857, 1)]), + (1, [(858, 1)]), + (1, [(859, 1)]), + (1, [(860, 1)]), + (1, [(861, 1)]), + (1, [(862, 1)]), + (1, [(863, 1)]), + (1, [(864, 1)]), + (1, [(865, 1), (866, 1)]), + (1, [(867, 1)]), + (1, [(868, 1)]), + (1, [(869, 1)]), + (1, [(870, 1)]), + (1, [(871, 1)]), + (1, [(872, 1), (873, 1)]), + (1, [(874, 1)]), + (1, [(875, 1)]), + (1, [(876, 1)]), + (1, [(877, 1)]), + (1, [(878, 1)]), + (1, [(879, 1), (880, 1)]), + (1, [(881, 1)]), + (1, [(882, 1), (883, 1)]), + (1, [(884, 1)]), + (1, [(885, 1)]), + (1, [(886, 1)]), + (1, [(887, 1)]), + (1, [(888, 1), (889, 1)]), + (1, [(890, 1)]), + (1, [(891, 1)]) +] + +def colList : List (Int × List (Nat × Int)) := + colChunk0 ++ colChunk1 ++ colChunk2 ++ colChunk3 ++ colChunk4 ++ colChunk5 ++ colChunk6 ++ colChunk7 ++ colChunk8 ++ colChunk9 ++ colChunk10 ++ colChunk11 ++ colChunk12 ++ colChunk13 ++ colChunk14 ++ colChunk15 ++ colChunk16 ++ colChunk17 ++ colChunk18 + +end FloorCert diff --git a/research/p104-lean-premises/lean/Nov15/FloorCertDefs.lean b/research/p104-lean-premises/lean/Nov15/FloorCertDefs.lean new file mode 100644 index 0000000000..d46b2dbf44 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorCertDefs.lean @@ -0,0 +1,30 @@ +/- +FloorCert definitions . Core Lean only, so the generated data file +Nov15/FloorCertData.lean elaborates cheaply. See FloorCert.md. +-/ + +namespace FloorCert + +/-- Integer Braun tree: index 0 at the root, odd i ↦ left subtree at (i-1)/2, even i > 0 ↦ right +subtree at (i-2)/2. Missing indices read 0. Used for O(log n) kernel lookups of the dual. -/ +inductive ITree where + | leaf : ITree + | node : ITree → Int → ITree → ITree + +def ITree.get : ITree → Nat → Int + | .leaf, _ => 0 + | .node l v r, i => if i = 0 then v else if i % 2 = 1 then l.get (i / 2) else r.get (i / 2 - 1) + +/-- Sparse column dot product Σ_{(i,a) ∈ l} Y(i)·a in ℤ. -/ +def colDot (Y : Nat → Int) (l : List (Nat × Int)) : Int := (l.map fun p => Y p.1 * p.2).sum + +/-- One column check: all row indices < R, and Σ Y(i)·a ≤ den · cost. -/ +def colOK (R : Nat) (Y : Nat → Int) (den : Int) (c : Int × List (Nat × Int)) : Bool := + c.2.all (fun p => decide (p.1 < R)) && decide (colDot Y c.2 ≤ den * c.1) + +/-- Σ_{i < bs.length} Y(i)·b_i, scanning bs from index i0. -/ +def bDot (Y : Nat → Int) : List Int → Nat → Int + | [], _ => 0 + | b :: bs, i => Y i * b + bDot Y bs (i + 1) + +end FloorCert diff --git a/research/p104-lean-premises/lean/Nov15/FloorD0.lean b/research/p104-lean-premises/lean/Nov15/FloorD0.lean new file mode 100644 index 0000000000..e87f29baff --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorD0.lean @@ -0,0 +1,445 @@ +/- +FloorD0 : closes FloorEndToEnd's hypothesis H1 (per-paid-stay cost ≥ κ). +See FloorD0.md. + +Cost model (PRICEKIT pricekit.py `native_from_word` + `Dsum`, wrapped by REBUILDKIT harness `price`): +* a native word is ONE call; the invoice adds its T and P histograms once per J event (L = 17 on #7623); +* helper (public, non-main) r: T[dim final(r) − dim initial(r)]; every MOVE a → b: P[|dim b − dim a|]; +* D0 = Σ_r (T_r − P_r)·f(r) with f(r) = r ln r (`Dsum`, ranks r > 1; f(0) = f(1) = 0 so all ranks agree). +So the invoice's D0 = caller D0 + L · (native D0) (`histD0_invoice`), and "D0/call" of the helper layer +is the word's own helper D0 = Σ_{h ∈ H} [f(dim fin − dim ini) − Σ_{moves of h} f(|Δ dim|)] (`helperD0`). + +Results (f abstract: convex on [0,∞), f 0 = 0; κ_f := f 2 − 2 f 1): +* `stay_ge`: h_e(a,b) = f(e−a) − f(b−a) − f(e−b) ≥ κ_f when b − a ≥ 1, e − b ≥ 1 (GAPMAP §1 charge). +* `chD0_attr`: the GAPMAP attribution identity on any ascending move chain (D0 = Σ_moves h_e); + `attr_final`: the final move is charged 0. +* `chain_D0_ge`: chain of k moves ⇒ D0 ≥ κ_f (k − 1). +* word level: `chain_run` (a public register's MOVE records form a chain ini → final), + `dep_move` (a departure from c in the projection is a MOVE out of c), `fibre_le` (#stays of h ≤ #moves − 1), + `helper_D0_ge` (per helper), `helperD0_ge` : κ_f · #stays ≤ helperD0, for EVERY accepted word. +* `kap_fL` : κ_{r ln r} = 2 ln 2. `floor_D0_classK`: class K + H2 ⇒ helperD0 ≥ 780·2 ln 2 ≥ 1081.309. +* `chD0_id`: with rank weight f = id the same invoice is DescentPrice's (credit − paid = −2·descents). +-/ +import Nov15.FloorEndToEnd +import Nov15.FloorCert +import Nov15.JunkLB2 +import Nov15.DescentPrice +import Mathlib.Analysis.Complex.ExponentialBounds + +open Finset + +set_option linter.unusedSectionVars false + +namespace FloorD0 + +/-! ## 1. The abstract per-stay charge -/ + +section Abstract +variable (f : ℝ → ℝ) + +/-- κ_f = f(2) − 2 f(1): the least charge of a non-final stop. -/ +def kap : ℝ := f 2 - 2 * f 1 + +variable {f} + +/-- **per-stay charge ≥ κ_f** (convexity only). -/ +theorem stay_ge (cvx : ConvexOn ℝ (Set.Ici (0 : ℝ)) f) (e a b : ℝ) (hab : 1 ≤ b - a) + (hbe : 1 ≤ e - b) : kap f ≤ JunkLB2.h f e a b := by + set x := b - a; set y := e - b + have hxy : e - a = x + y := by simp only [x, y]; ring + have s1 := JunkLB2.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) + have s2 := JunkLB2.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 [kap, JunkLB2.h, hxy]; linarith + +theorem kap_nonneg (cvx : ConvexOn ℝ (Set.Ici (0 : ℝ)) f) (hf0 : f 0 = 0) : 0 ≤ kap f := by + have := JunkLB2.two_point cvx (lo := 0) (hi := 2) (y := 1) (z := 1) + le_rfl (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) + simp only [kap]; linarith + +/-- the final move (into the register's last chart) is charged 0. -/ +theorem attr_final (hf0 : f 0 = 0) (a e : ℝ) : JunkLB2.h f e a e = 0 := by + simp [JunkLB2.h, hf0] + +/-- PRICEKIT instance: f(r) = r ln r gives κ = 2 ln 2. -/ +theorem kap_fL : kap JunkLB2.fL = 2 * Real.log 2 := by + simp [kap, JunkLB2.fL] + +end Abstract + +/-! ## 2. Per-call normalisation: the invoice is caller + L · native -/ + +/-- D0 of a (T, P) histogram given as rank lists: Σ_T f − Σ_P f. -/ +noncomputable def histD0 (f : ℝ → ℝ) (T P : List ℕ) : ℝ := + (T.map fun r : ℕ => f (r : ℝ)).sum - (P.map fun r : ℕ => f (r : ℝ)).sum + +/-- PRICEKIT `invoice`: native T and P are added once per call (L = #J events = 17 on #7623). +Hence D0(invoice) = D0(caller) + L · D0(native), and a native quantity quoted "per call" is the +word's own D0 (÷ L undoes the multiplicity exactly). -/ +theorem histD0_invoice (f : ℝ → ℝ) (Tc Pc Tn Pn : List ℕ) (L : ℕ) : + histD0 f (Tc ++ (List.replicate L Tn).flatten) (Pc ++ (List.replicate L Pn).flatten) = + histD0 f Tc Pc + L * histD0 f Tn Pn := by + induction L with + | zero => simp [histD0] + | succ n ih => + simp only [histD0, List.replicate_succ, List.flatten_cons, List.map_append, List.sum_append] at ih ⊢ + push_cast; linarith + +/-! ## 3. Move chains and their D0 -/ + +section Chain +open FloorE2E +variable {K Reg C : Type*} [Field K] [DecidableEq K] [Fintype Reg] [DecidableEq Reg] + [PartialOrder C] [DecidableEq C] + +/-- a list of MOVE records chaining chart a to chart b. -/ +def MChain : C → List (Mv K Reg C) → C → Prop + | a, [], b => a = b + | a, m :: ms, b => m.tail = a ∧ MChain m.head ms b + +variable (f : ℝ → ℝ) (dim : C → ℕ) + +/-- PRICEKIT P-charge of one MOVE: f(|dim head − dim tail|). -/ +noncomputable def mvCost (m : Mv K Reg C) : ℝ := f |(dim m.head : ℝ) - dim m.tail| + +/-- D0 of a register that goes a → b by the moves ms: f(dim b − dim a) − Σ f(|Δ|). -/ +noncomputable def chD0 (a b : C) (ms : List (Mv K Reg C)) : ℝ := + f ((dim b : ℝ) - dim a) - (ms.map (mvCost f dim)).sum + +def Asc (ms : List (Mv K Reg C)) : Prop := ∀ m ∈ ms, dim m.tail < dim m.head + +variable {f dim} + +lemma chain_le : ∀ (a : C) (ms : List (Mv K Reg C)) (b : C), MChain a ms b → Asc dim ms → + dim a ≤ dim b + | a, [], b, hc, _ => by simp only [MChain] at hc; rw [hc] + | a, m :: ms, b, ⟨h1, h2⟩, hA => by + have := chain_le m.head ms b h2 fun x hx => hA x (List.mem_cons_of_mem _ hx) + have := hA m List.mem_cons_self + rw [h1] at this; omega + +lemma chD0_cons (a b : C) (m : Mv K Reg C) (ms : List (Mv K Reg C)) (hm : m.tail = a) + (hlt : dim m.tail < dim m.head) : + chD0 f dim a b (m :: ms) = JunkLB2.h f (dim b) (dim a) (dim m.head) + chD0 f dim m.head b ms := by + have : |(dim m.head : ℝ) - dim m.tail| = (dim m.head : ℝ) - dim a := by + rw [hm] at hlt ⊢ + have : (dim a : ℝ) < dim m.head := by exact_mod_cast hlt + rw [abs_of_pos (by linarith)] + simp only [chD0, List.map_cons, List.sum_cons, mvCost, this, JunkLB2.h]; ring + +/-- **GAPMAP §1 attribution identity**: D0 = Σ_moves h_e(dim tail, dim head), e = dim b. -/ +theorem chD0_attr (hf0 : f 0 = 0) : ∀ (a : C) (ms : List (Mv K Reg C)) (b : C), MChain a ms b → + Asc dim ms → + chD0 f dim a b ms = (ms.map fun m => JunkLB2.h f (dim b) (dim m.tail) (dim m.head)).sum + | a, [], b, hc, _ => by simp only [MChain] at hc; subst hc; simp [chD0, hf0] + | a, m :: ms, b, ⟨h1, h2⟩, hA => by + rw [chD0_cons a b m ms h1 (hA m List.mem_cons_self), + chD0_attr hf0 m.head ms b h2 fun x hx => hA x (List.mem_cons_of_mem _ hx)] + simp [h1] + +/-- **chain floor**: a chain of k = ms.length + 1 moves has D0 ≥ κ_f · (k − 1). Each non-final +move (= the arrival into a chart the register later leaves, i.e. a paid stay) is charged ≥ κ_f. -/ +theorem chain_D0_ge (cvx : ConvexOn ℝ (Set.Ici (0 : ℝ)) f) (hf0 : f 0 = 0) : + ∀ (ms : List (Mv K Reg C)) (a : C) (m : Mv K Reg C) (b : C), MChain a (m :: ms) b → + Asc dim (m :: ms) → kap f * ms.length ≤ chD0 f dim a b (m :: ms) + | [], a, m, b, ⟨h1, h2⟩, hA => by + simp only [MChain] at h2 + rw [chD0_cons a b m [] h1 (hA m List.mem_cons_self)] + subst h2; simp [chD0, hf0, JunkLB2.h] + | m' :: ms, a, m, b, ⟨h1, h2⟩, hA => by + have hA' : Asc dim (m' :: ms) := fun x hx => hA x (List.mem_cons_of_mem _ hx) + have ih := chain_D0_ge cvx hf0 ms m.head m' b h2 hA' + rw [chD0_cons a b m _ h1 (hA m List.mem_cons_self)] + have hlt1 := hA m List.mem_cons_self + rw [h1] at hlt1 + obtain ⟨h3, h4⟩ := h2 + have hlt2 := hA' m' List.mem_cons_self + have hle := chain_le m'.head ms b h4 fun x hx => hA' x (List.mem_cons_of_mem _ hx) + rw [h3] at hlt2 + have hs := stay_ge cvx (dim b) (dim a) (dim m.head) + (by have : (dim a : ℝ) + 1 ≤ dim m.head := by exact_mod_cast hlt1 + linarith) + (by have : (dim m.head : ℝ) + 1 ≤ dim b := by exact_mod_cast (show dim m.head + 1 ≤ dim b by omega) + linarith) + simp only [List.length_cons]; push_cast; linarith + +/-! ### link to DescentPrice: rank weight f = id is DescentPrice's invoice -/ + +def dimList (a : C) (ms : List (Mv K Reg C)) : List ℤ := (dim a : ℤ) :: ms.map fun m => (dim m.head : ℤ) + +lemma dimList_paid : ∀ (a : C) (ms : List (Mv K Reg C)) (b : C), MChain a ms b → + DescentPrice.paid (dimList (dim := dim) a ms) = + (ms.map fun m => |(dim m.head : ℤ) - dim m.tail|).sum + | a, [], b, _ => rfl + | a, m :: ms, b, ⟨h1, h2⟩ => by + have ih := dimList_paid m.head ms b h2 + simp only [dimList, List.map_cons] at ih ⊢ + rw [DescentPrice.paid, ih, h1]; simp + +lemma dimList_last : ∀ (a : C) (ms : List (Mv K Reg C)) (b : C), MChain a ms b → + (dimList (dim := dim) a ms).getLast (by simp [dimList]) = dim b + | a, [], b, hc => by simp only [MChain] at hc; subst hc; rfl + | a, m :: ms, b, ⟨_, h2⟩ => by + have ih := dimList_last m.head ms b h2 + simp only [dimList, List.map_cons] at ih ⊢ + rw [List.getLast_cons (by simp)]; exact ih + +/-- with rank weight f = id (PRICEKIT's S instead of D0) the per-register invoice is DescentPrice's: +credit − paid = −2·(descent ranks). For a helper chain (strict ascent) this is 0. -/ +theorem chD0_id (a b : C) (ms : List (Mv K Reg C)) (hc : MChain a ms b) : + chD0 (fun x => x) dim a b ms = -2 * (DescentPrice.desc (dimList (dim := dim) a ms) : ℝ) := by + have h := DescentPrice.helper_identity (dim a : ℤ) (ms.map fun m => (dim m.head : ℤ)) + have hp := dimList_paid (dim := dim) a ms b hc + have hl := dimList_last (dim := dim) a ms b hc + simp only [dimList] at hp hl + rw [hp, hl] at h + have h' : ((ms.map fun m => |(dim m.head : ℤ) - dim m.tail|).sum : ℝ) - ((dim b : ℝ) - dim a) = + 2 * (DescentPrice.desc (dimList (dim := dim) a ms) : ℝ) := by exact_mod_cast h + have e : (ms.map (mvCost (fun x => x) dim)).sum = + ((ms.map fun m => |(dim m.head : ℤ) - dim m.tail|).sum : ℝ) := by + push_cast [List.map_map] + congr 1; apply List.map_congr_left; intro m _; simp [mvCost] + simp only [chD0, e]; linarith + +end Chain + +/-! ## 4. The word: helper D0 and its per-stay floor -/ + +section Word +open FloorE2E +variable {K Reg C : Type*} [Field K] [DecidableEq K] [Fintype Reg] [DecidableEq Reg] + [PartialOrder C] [DecidableEq C] + +/-- a public register's MOVE records form a chain from its current chart to its final chart. -/ +theorem chain_run (Pub : Finset Reg) (r : Reg) (hr : r ∈ Pub) : + ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)) (a : C), LegalG Pub s w → s.loc r = some a → + ∃ b, (grun s w).loc r = some b ∧ MChain a ((moves s w).filter fun m => m.reg = r) b + | s, [], a, _, ha => ⟨a, ha, by simp [moves, MChain]⟩ + | s, e :: es, a, ⟨he, hL⟩, ha => by + cases e with + | move r' c' => + obtain ⟨a', ha', -, -⟩ := he + by_cases hrr : r' = r + · subst hrr + rw [ha] at ha'; cases ha' + obtain ⟨b, hb, hc⟩ := chain_run Pub r' hr _ es c' hL (by simp [gstep]) + refine ⟨b, hb, ?_⟩ + simp only [moves, mvOf, ha, List.filter_append] + simp [MChain, hc] + · have hloc : (gstep s (.move r' c')).loc r = some a := by + simp [gstep, Ne.symm hrr, ha] + obtain ⟨b, hb, hc⟩ := chain_run Pub r hr _ es a hL hloc + refine ⟨b, hb, ?_⟩ + simp only [moves, mvOf, ha', List.filter_append] + simpa [hrr] using hc + | init o c' => + have hor : r ≠ o := fun h => he.1 (h ▸ hr) + have hloc : (gstep s (.init o c')).loc r = some a := by + simp [gstep, hor, ha] + obtain ⟨b, hb, hc⟩ := chain_run Pub r hr _ es a hL hloc + exact ⟨b, hb, by simpa [moves, mvOf] using hc⟩ + | clear o => + have hor : r ≠ o := fun h => he.1 (h ▸ hr) + have hloc : (gstep s (.clear o)).loc r = some a := by + simp [gstep, hor, ha] + obtain ⟨b, hb, hc⟩ := chain_run Pub r hr _ es a hL hloc + exact ⟨b, hb, by simpa [moves, mvOf] using hc⟩ + | add i j x => + obtain ⟨b, hb, hc⟩ := chain_run Pub r hr _ es a hL (by simpa [gstep] using ha) + exact ⟨b, hb, by simpa [moves, mvOf] using hc⟩ + | scale i u => + obtain ⟨b, hb, hc⟩ := chain_run Pub r hr _ es a hL (by simpa [gstep] using ha) + exact ⟨b, hb, by simpa [moves, mvOf] using hc⟩ + | copy i j x => + obtain ⟨b, hb, hc⟩ := chain_run Pub r hr _ es a hL (by simpa [gstep] using ha) + exact ⟨b, hb, by simpa [moves, mvOf] using hc⟩ + +open ExportLaw in +/-- a departure of a public register r from chart c (in the projection) is a MOVE of r out of c. -/ +theorem dep_move (Pub : Finset Reg) (r : Reg) (hr : r ∈ Pub) (c : C) : + ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), LegalG Pub s w → + 0 < nDep {r} (projFrom c s w) → ∃ m ∈ moves s w, m.reg = r ∧ m.tail = c + | s, [], _, h => by simp [projFrom, nDep] at h + | s, e :: es, ⟨he, hL⟩, h => by + rw [projFrom, nDep_append] at h + by_cases h2 : 0 < nDep {r} (projFrom c (gstep s e) es) + · obtain ⟨m, hm, h3⟩ := dep_move Pub r hr c _ es hL h2 + exact ⟨m, by simp only [moves, List.mem_append]; exact Or.inr hm, h3⟩ + · have h1 : 0 < nDep {r} (pev c s e) := by omega + cases e with + | move r' c' => + by_cases hl : s.loc r' = some c + · by_cases hrr : r' = r + · subst hrr + exact ⟨⟨r', c, c', s.row r'⟩, by simp [moves, mvOf, hl], rfl, rfl⟩ + · exfalso; by_cases h' : c' = c <;> simp [pev, hl, h', nDep, hrr] at h1 + · exfalso; by_cases h' : c' = c <;> simp [pev, hl, h', nDep] at h1 + | clear o => + exfalso + have : o ≠ r := fun h => he.1 (h ▸ hr) + by_cases hl : s.loc o = some c <;> simp [pev, hl, nDep, this] at h1 + | init o c' => exfalso; by_cases h' : c' = c <;> simp [pev, h', nDep] at h1 + | add i j a => exfalso; by_cases hl : s.loc i = some c <;> simp [pev, hl, nDep] at h1 + | scale i u => exfalso; by_cases hl : s.loc i = some c <;> simp [pev, hl, nDep] at h1 + | copy i j a => exfalso; by_cases hl : s.loc i = some c <;> simp [pev, hl, nDep] at h1 + +end Word + +/-! ## 5. Helper D0 of a word and the floor -/ + +section Floor +open FloorE2E +variable {K Reg C : Type*} [Field K] [DecidableEq K] [Fintype Reg] [DecidableEq Reg] + [PartialOrder C] [DecidableEq C] + +/-- dimension of an optional chart (0 for none; never used for public registers). -/ +def locD (dim : C → ℕ) : Option C → ℝ + | some c => dim c + | none => 0 + +/-- **PRICEKIT D0 of one register of the word** (one call): T-term f(dim final − dim initial) minus +the P-terms f(|dim b − dim a|) of its own MOVEs. -/ +noncomputable def regD0 (f : ℝ → ℝ) (dim : C → ℕ) (ini : Reg → Option C) (w : List (GEv K Reg C)) + (r : Reg) : ℝ := + f (locD dim ((grun (s0 ini) w).loc r) - locD dim (ini r)) - + (((moves (s0 ini) w).filter fun m => m.reg = r).map (mvCost f dim)).sum + +/-- **helper D0 per call** = Σ over helpers (public non-mains) of their PRICEKIT D0 (GAPMAP's +"helpers 9,946.29 D0/call" on #7623). -/ +noncomputable def helperD0 (f : ℝ → ℝ) (dim : C → ℕ) (H : Finset Reg) (ini : Reg → Option C) + (w : List (GEv K Reg C)) : ℝ := + ∑ h ∈ H, regD0 f dim ini w h + +variable [Fintype C] {Pub H : Finset Reg} {ini : Reg → Option C} {w : List (GEv K Reg C)} + +open ExportLaw in +/-- every paid stay of helper h is the tail of a MOVE of h other than its first: #stays(h) ≤ #moves(h) − 1. -/ +theorem fibre_le (hA : Accepted Pub H ini w) (h : Reg) (hh : h ∈ H) (a : C) (ha : ini h = some a) : + ((stays H ini w).filter fun p => p.1 = h).card ≤ + ((moves (s0 ini) w).filter fun m => m.reg = h).length - 1 := by + have hP := hA.helpers_pub hh + obtain ⟨b, -, hc⟩ := chain_run Pub h hP (s0 ini) w a hA.legal ha + have key : ∀ p ∈ (stays H ini w).filter (fun p => p.1 = h), + p.2 ≠ a ∧ ∃ m ∈ (moves (s0 ini) w).filter (fun m => m.reg = h), m.tail = p.2 := by + intro p hp + obtain ⟨hs, hp1⟩ := Finset.mem_filter.1 hp + simp only [stays, Finset.mem_filter, Finset.mem_univ, true_and] at hs + obtain ⟨-, hini, hdep⟩ := hs + rw [hp1] at hini hdep + rw [proj, nDep_append, births, nDep_born, zero_add] at hdep + obtain ⟨m, hm, hmr, hmt⟩ := dep_move Pub h hP p.2 (s0 ini) w hA.legal hdep + exact ⟨fun e => hini (by rw [ha, e]), m, List.mem_filter.2 ⟨hm, by simpa using hmr⟩, hmt⟩ + generalize (moves (s0 ini) w).filter (fun m => m.reg = h) = L at hc key + cases L with + | nil => + have : (stays H ini w).filter (fun p => p.1 = h) = ∅ := by + ext p + simp only [Finset.notMem_empty, iff_false] + intro hp + obtain ⟨-, m, hm, -⟩ := key p hp + simp at hm + rw [this]; simp + | cons m0 ms => + have h0 : m0.tail = a := hc.1 + have hsub : (stays H ini w).filter (fun p => p.1 = h) ⊆ (ms.map fun m => (h, m.tail)).toFinset := by + intro p hp + obtain ⟨hne, m, hm, hmt⟩ := key p hp + have hp1 : p.1 = h := (Finset.mem_filter.1 hp).2 + rcases List.mem_cons.1 hm with rfl | hm' + · exact absurd (hmt.symm.trans h0) hne + · rw [List.mem_toFinset, List.mem_map]; exact ⟨m, hm', Prod.ext hp1.symm hmt⟩ + calc _ ≤ (ms.map fun m => (h, m.tail)).toFinset.card := Finset.card_le_card hsub + _ ≤ (ms.map fun m => (h, m.tail)).length := List.toFinset_card_le _ + _ = _ := by simp + +/-- **per helper**: κ_f · #(paid stays of h) ≤ D0(h). Needs only `dim` strictly monotone on the chart +order (for the verifier: a < b iff span a ⊊ span b, so dim a < dim b). -/ +theorem helper_D0_ge (f : ℝ → ℝ) (dim : C → ℕ) (hdim : ∀ a b : C, a < b → dim a < dim b) + (cvx : ConvexOn ℝ (Set.Ici (0 : ℝ)) f) (hf0 : f 0 = 0) + (hA : Accepted Pub H ini w) (h : Reg) (hh : h ∈ H) : + kap f * ((stays H ini w).filter fun p => p.1 = h).card ≤ regD0 f dim ini w h := by + have hP := hA.helpers_pub hh + obtain ⟨a, ha⟩ := Option.ne_none_iff_exists'.1 ((hA.pub_ini h).1 hP) + have hfib := fibre_le hA h hh a ha + obtain ⟨b, hb, hc⟩ := chain_run Pub h hP (s0 ini) w a hA.legal ha + have hasc : Asc dim ((moves (s0 ini) w).filter fun m => m.reg = h) := by + intro m hm + obtain ⟨hm, hmr⟩ := List.mem_filter.1 hm + have hmr' : m.reg = h := by simpa using hmr + exact hdim _ _ ((moves_facts Pub (s0 ini) w hA.legal m hm).2.1 (hmr' ▸ hP)) + have hreg : regD0 f dim ini w h = + chD0 f dim a b ((moves (s0 ini) w).filter fun m => m.reg = h) := by + simp only [regD0, chD0, hb, ha, locD] + have hk := kap_nonneg cvx hf0 + rw [hreg] + generalize (moves (s0 ini) w).filter (fun m => m.reg = h) = L at hfib hc hasc + cases L with + | nil => + simp only [MChain] at hc; subst hc + have : ((stays H ini w).filter fun p => p.1 = h).card = 0 := by simpa using hfib + rw [this]; simp [chD0, hf0] + | cons m ms => + have := chain_D0_ge cvx hf0 ms a m b hc hasc + simp only [List.length_cons, Nat.add_sub_cancel] at hfib + calc kap f * (((stays H ini w).filter fun p => p.1 = h).card : ℝ) + ≤ kap f * ms.length := mul_le_mul_of_nonneg_left (by exact_mod_cast hfib) hk + _ ≤ _ := this + +/-- **H1 closed**: on EVERY accepted word, κ_f · #(paid helper stays) ≤ helper D0. -/ +theorem helperD0_ge (f : ℝ → ℝ) (dim : C → ℕ) (hdim : ∀ a b : C, a < b → dim a < dim b) + (cvx : ConvexOn ℝ (Set.Ici (0 : ℝ)) f) (hf0 : f 0 = 0) (hA : Accepted Pub H ini w) : + kap f * (stays H ini w).card ≤ helperD0 f dim H ini w := by + have hmap : ∀ p ∈ stays H ini w, p.1 ∈ H := by + intro p hp + simp only [stays, Finset.mem_filter, Finset.mem_univ, true_and] at hp + exact hp.1 + rw [Finset.card_eq_sum_card_fiberwise hmap] + push_cast; rw [Finset.mul_sum] + exact Finset.sum_le_sum fun h hh => helper_D0_ge f dim hdim cvx hf0 hA h hh + +/-- the PRICEKIT instance f(r) = r ln r: helper D0 ≥ 2 ln 2 · #stays. -/ +theorem helperD0_ge_fL (dim : C → ℕ) (hdim : ∀ a b : C, a < b → dim a < dim b) + (hA : Accepted Pub H ini w) : + 2 * Real.log 2 * (stays H ini w).card ≤ helperD0 JunkLB2.fL dim H ini w := by + have := helperD0_ge JunkLB2.fL dim hdim JunkLB2.fL_convex JunkLB2.fL0 hA + rwa [kap_fL] at this + +/-- **H2** (the remaining checked input, Python): x(w) restricted to the 18,868 support columns +satisfies the 892 exported rows (each row an instance of λ/α/β/γ/u with D = D₀) and its objective +is ≤ #paid stays (FloorEndToEnd's `objective_le` on the instances). -/ +def H2 (n : ℕ) : Prop := + ∃ x : Fin FloorCert.nCols → ℝ, (∀ j, 0 ≤ x j) ∧ + (∀ i, FloorCert.b i ≤ ∑ j, FloorCert.A i j * x j) ∧ ∑ j, FloorCert.c j * x j ≤ n + +/-- **floor_D0_classK.** Every class-K word has helper D0 ≥ 780 · 2 ln 2 ≥ 1,081.309 D0/call, +with H2 the only hypothesis beyond the model (dim strictly monotone on the chart order). -/ +theorem floor_D0_classK {Kfin : Finset Reg} {D : KData C (Reg → K)} (dim : C → ℕ) + (hdim : ∀ a b : C, a < b → dim a < dim b) (hK : ClassK Pub H Kfin ini w D) + (hH2 : H2 (stays H ini w).card) : + 780 * (2 * Real.log 2) ≤ helperD0 JunkLB2.fL dim H ini w ∧ + (1081.309 : ℝ) ≤ helperD0 JunkLB2.fL dim H ini w := by + obtain ⟨x, hx, hAx, hobj⟩ := hH2 + have h780 := FloorCert.stops_ge_780 (𝕜 := ℝ) x hx hAx (stays H ini w) hobj + have hD := helperD0_ge_fL dim hdim hK.acc + have hl := Real.log_two_gt_d9 + have h1 : 780 * (2 * Real.log 2) ≤ helperD0 JunkLB2.fL dim H ini w := by nlinarith + exact ⟨h1, by linarith⟩ + +end Floor + +end FloorD0 + +#print axioms FloorD0.stay_ge +#print axioms FloorD0.kap_fL +#print axioms FloorD0.histD0_invoice +#print axioms FloorD0.chD0_attr +#print axioms FloorD0.chain_D0_ge +#print axioms FloorD0.chD0_id +#print axioms FloorD0.chain_run +#print axioms FloorD0.dep_move +#print axioms FloorD0.fibre_le +#print axioms FloorD0.helper_D0_ge +#print axioms FloorD0.helperD0_ge +#print axioms FloorD0.helperD0_ge_fL +#print axioms FloorD0.floor_D0_classK diff --git a/research/p104-lean-premises/lean/Nov15/FloorD0.md b/research/p104-lean-premises/lean/Nov15/FloorD0.md new file mode 100644 index 0000000000..e5e0726685 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorD0.md @@ -0,0 +1,47 @@ +# FloorD0.lean: H1 closed. Helper D0 ≥ 2 ln 2 · #paid stays on every accepted word; floor_D0_classK. No sorry, ~6 s, 2.6 GB +Imports Nov15.FloorEndToEnd, Nov15.FloorCert, Nov15.JunkLB2 (h, two_point, fL), Nov15.DescentPrice. +Build: `lake env lean -o .lake/build/lib/lean/Nov15/FloorD0.olean Nov15/FloorD0.lean` (needs the DescentPrice olean). +Axioms: the 13 printed theorems use exactly [propext, Classical.choice, Quot.sound]. No `sorry`, no `native_decide`, no `axiom`. + +## Cost model (read from the price checker pricekit.py, wrapped by rebuild/harness/common.py `price`) +- One native word = one call. `invoice()` adds the word's T and P histograms once per J event (L = 17 on #7623). +- Native word: helper r (public, not a main) gives T[dim final(r) − dim initial(r)]; every MOVE a → b gives P[|dim b − dim a|]. +- D0 = Σ_r (T_r − P_r)·f(r), f(r) = r ln r (`Dsum`; it sums r > 1 only, which is the same since f(0) = f(1) = 0). +- **÷17.** `histD0_invoice`: D0(invoice) = D0(caller) + L·D0(native), exactly. So "D0/call" of the helper layer is the word's own helper D0: + `helperD0 = Σ_{h∈H} [f(dim fin h − dim ini h) − Σ_{MOVEs of h} f(|Δ dim|)]` (`regD0`, `helperD0`). This is the gap map's "helpers 9,946.29 D0/call" quantity, and FloorCert's 1,081.31 is in the same unit. +- Model data beyond FloorEndToEnd: `dim : C → ℕ` with a < b ⇒ dim a < dim b. For the verifier's chart order (a < b iff span a ⊊ span b, frames = bases) this is a fact, not data. +- the price checker's T uses W['final']; `regD0` uses the run's final location. They agree whenever the exit-frame check passes (replay `exit-frames`). +- The official repo has no D0. Its figure of merit is the κ crossing, and the price checker reproduces those crossings bit-exactly (the price checker/RESULT §1). D0 is the lab's first-order unit. + +## Results +- **Abstract f** (convex on [0,∞), f 0 = 0), κ_f := f(2) − 2 f(1): + - `stay_ge`: h_e(a,b) = f(e−a) − f(b−a) − f(e−b) ≥ κ_f whenever b − a ≥ 1 and e − b ≥ 1. This generalises JunkLB2.kappa_le. + - `kap_nonneg`; `attr_final`: h_e(a,e) = 0. + - `chD0_attr`: the gap map §1's attribution identity (D0 = Σ_moves h_e(tail, head), e = final dim) on any ascending MOVE chain. + - `chain_D0_ge`: a chain of k moves has D0 ≥ κ_f (k − 1). Each non-final move is the arrival into a chart the register later leaves (a paid stay), and it is charged ≥ κ_f. + - `kap_fL`: κ_{r ln r} = 2 ln 2. +- **Word**: + - `chain_run`: a public register's MOVE records form a chain from ini to its final chart. + - `dep_move`: a departure of r from c in the projection is a MOVE of r out of c. A public register is never CLEARed. + - `fibre_le`: #stays(h) ≤ #moves(h) − 1. + - `helper_D0_ge`: per helper. + - `helperD0_ge`: **κ_f · #stays ≤ helperD0 on EVERY accepted word** (class K is not needed). + - `helperD0_ge_fL`: the same with 2 ln 2. +- **`floor_D0_classK`**: ClassK + H2 ⇒ helperD0 ≥ 780·2 ln 2 and ≥ 1,081.309 D0/call (via Real.log_two_gt_d9). + - H2 (`def H2`): ∃ x ≥ 0 on the 18,868 support columns satisfying the 892 exported rows, with cᵀx ≤ #stays. This is FloorEndToEnd.md items 2–4: the exported rows are family instances for D₀, so x(w) restricted is feasible, and objective_le applies. + - H2 is the only remaining hypothesis. +- `chD0_id`: with rank weight f = id (S instead of D0), the per-register invoice is DescentPrice's: credit − paid = −2·(descent ranks), via DescentPrice.helper_identity. The same invoice model, reused. + +## Where the attribution holds or fails (per stay type) +- **Helper stays: holds for every type.** It needs only b − a ≥ 1 (l.51: a public MOVE strictly climbs) and e − b ≥ 1 (a paid stay is later left, and the next move climbs). + - Stays at V: none. Nothing is above V, so a helper at V never departs. Arrivals into V are final moves and are charged 0. + - Births: departures from the birth chart are not stays. The first move is charged to the stay it arrives at. +- **Owned registers: the attribution fails, but no paid stay is owned.** An owned MOVE may descend (l.51 allows b < a). Then the signed-gap h_e telescoping (the gap map §1) no longer equals the price checker's |Δ| charge, and h_e can be negative. + - Owned D0 is not in helperD0, and FloorEndToEnd's stays are helper-only, so the floor is unaffected. + - Minimal fix, if owned stays are ever counted: charge an owned register by DescentPrice's paid ≥ descents (`owned_ge`), not by h_e. +- **Mains/hosted:** not in H, so no stays and no D0 are counted. The floor is a helper-layer floor only. + +## Statements found false / imprecise +- The brief's suggested per-stay form "f(e) − f(e−1) ≥ f(1) − f(0) = κ" is vacuous for the price checker's f: r ln r gives f(1) − f(0) = 0. The correct per-stay charge is the gap map's h_e(a,b), and its minimum over b − a ≥ 1, e − b ≥ 1 is f(2) − 2f(1) = 2 ln 2. +- the gap map §1's identity "D0(r) = f(e−d0) − Σf(gaps)" uses signed gaps. It equals the price checker's charge only on ascending registers. That covers all public registers by l.51, which is the scope the gap map states it for, so it is not false. It would be false for owned descents. +- Nothing else found false. FloorEndToEnd.md's H1 is now discharged in aggregate form (κ·#stays ≤ helper D0), which is what FloorCert's floor uses. diff --git a/research/p104-lean-premises/lean/Nov15/FloorEndToEnd.lean b/research/p104-lean-premises/lean/Nov15/FloorEndToEnd.lean new file mode 100644 index 0000000000..e405ac9e74 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorEndToEnd.lean @@ -0,0 +1,1619 @@ +/- +Class-K floor, end to end on the word . See FloorEndToEnd.md. + +A global multi-chart op model with the shipped verifier's legality (independent.py `native()`, incl. +l.51: public MOVEs strictly climb, owned MOVEs nested either way), the class-K definition, and the +three kept LP row families (R1 local rank, R3 hop rows α/β, F4 single-source u rows) as theorems about +the WORD. Floor/FloorGlue's hypotheses hOnce, class N, ρ kills helper tokens, `hent`, hP, hvec, the +memberships in S_c and the hd/fibre identity are DERIVED here. + +Build (oleans of ExportLaw, Floor, FloorGlue must exist): + lake env lean -o .lake/build/lib/lean/Nov15/FloorEndToEnd.olean Nov15/FloorEndToEnd.lean +-/ +import Nov15.FloorGlue + +open Finset Module Submodule + +set_option linter.unusedSectionVars false +set_option linter.unusedSimpArgs false + +namespace FloorE2E + +/-! ## 1. Global model -/ + +/-- Verifier ops (independent.py): INIT (owned, row 0), CLEAR (owned leaves), MOVE, ADD `i += a·j`, +SCALE `i := u·i`, COPY `i := a·j`. Rows are in initial-row coordinates. -/ +inductive GEv (K Reg C : Type*) + | init (o : Reg) (c : C) + | clear (o : Reg) + | move (r : Reg) (c : C) + | add (i j : Reg) (a : K) + | scale (i : Reg) (u : K) + | copy (i j : Reg) (a : K) + +structure GSt (K Reg C : Type*) where + row : Reg → Reg → K + loc : Reg → Option C + +variable {K Reg C : Type*} [Field K] [DecidableEq K] [Fintype Reg] [DecidableEq Reg] + [PartialOrder C] [DecidableEq C] + +def gstep (s : GSt K Reg C) : GEv K Reg C → GSt K Reg C + | .init o c => ⟨Function.update s.row o 0, Function.update s.loc o (some c)⟩ + | .clear o => ⟨s.row, Function.update s.loc o none⟩ + | .move r c => ⟨s.row, Function.update s.loc r (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⟩ + | .copy i j a => ⟨Function.update s.row i (a • s.row j), s.loc⟩ + +def grun : GSt K Reg C → List (GEv K Reg C) → GSt K Reg C + | s, [] => s + | s, e :: es => grun (gstep s e) es + +/-- Legality of one op, as independent.py `native()` checks it (coefficient-size/smoothness checks +dropped: the model is a relaxation). `Pub` = public registers. l.51: a public MOVE goes from +frame a to b with a ⊊ b; an owned MOVE with a ⊊ b or b ⊊ a. -/ +def LegalEvG (Pub : Finset Reg) (s : GSt K Reg C) : GEv K Reg C → Prop + | .init o _ => o ∉ Pub ∧ s.loc o = none + | .clear o => o ∉ Pub ∧ s.loc o ≠ none + | .move r c => ∃ a, s.loc r = some a ∧ (r ∈ Pub → a < c) ∧ (r ∉ Pub → a < c ∨ c < a) + | .add i j _ => i ≠ j ∧ s.loc i ≠ none ∧ s.loc i = s.loc j + | .scale i u => u ≠ 0 ∧ s.loc i ≠ none + | .copy i j a => a ≠ 0 ∧ i ≠ j ∧ s.loc i ≠ none ∧ s.loc i = s.loc j + +def LegalG (Pub : Finset Reg) : GSt K Reg C → List (GEv K Reg C) → Prop + | _, [] => True + | s, e :: es => LegalEvG Pub s e ∧ LegalG Pub (gstep s e) es + +/-- initial state: public registers at their initial frame with their own token; owned absent. -/ +def s0 (ini : Reg → Option C) : GSt K Reg C := ⟨fun r => Pi.single r 1, ini⟩ + +/-! ## 2. Projection to one chart and simulation of ExportLaw's one-chart model -/ + +abbrev LEv (K Reg : Type*) := ExportLaw.Ev K Reg +abbrev LSt (K Reg : Type*) := ExportLaw.St K Reg + +/-- the one-chart events at `c` produced by a global op. -/ +def pev (c : C) (s : GSt K Reg C) : GEv K Reg C → List (LEv K Reg) + | .init o c' => if c' = c then [.arrive o 0] else [] + | .clear o => if s.loc o = some c then [.depart o] else [] + | .move r c' => (if s.loc r = some c then [.depart r] else []) ++ + (if c' = c then [.arrive r (s.row r)] else []) + | .add i j a => if s.loc i = some c then [.add i j a] else [] + | .scale i u => if s.loc i = some c then [.scale i u] else [] + | .copy i j a => if s.loc i = some c then [.copy i j, .scale i a] else [] + +def projFrom (c : C) : GSt K Reg C → List (GEv K Reg C) → List (LEv K Reg) + | _, [] => [] + | s, e :: es => pev c s e ++ projFrom c (gstep s e) es + +/-- the registers born at `c` (public registers whose initial frame is `c`). -/ +def bornAt (c : C) (ini : Reg → Option C) : Finset Reg := univ.filter fun r => ini r = some c + +noncomputable def births (c : C) (ini : Reg → Option C) : List (LEv K Reg) := + (bornAt c ini).toList.map .born + +/-- the event list of chart `c` (ExportLaw's model, from the empty state). -/ +noncomputable def proj (c : C) (ini : Reg → Option C) (w : List (GEv K Reg C)) : List (LEv K Reg) := + births c ini ++ projFrom c (s0 ini) w + +def Sim (c : C) (s : GSt K Reg C) (t : LSt K Reg) : Prop := + (∀ r, r ∈ t.pres ↔ s.loc r = some c) ∧ ∀ r, s.loc r = some c → t.row r = s.row r + +open ExportLaw in +lemma run_append (t : LSt K Reg) (l1 l2 : List (LEv K Reg)) : + run t (l1 ++ l2) = run (run t l1) l2 := by + induction l1 generalizing t with + | nil => rfl + | cons e l ih => exact ih _ + +open ExportLaw in +lemma legal_append (t : LSt K Reg) (l1 l2 : List (LEv K Reg)) : + Legal t (l1 ++ l2) ↔ Legal t l1 ∧ Legal (run t l1) l2 := by + induction l1 generalizing t with + | nil => simp [Legal, run] + | cons e l ih => simp only [List.cons_append, Legal, run, ih, and_assoc] + +open ExportLaw in +lemma held_append_right (t : LSt K Reg) (l1 l2 : List (LEv K Reg)) : + held (run t l1) l2 ⊆ held t (l1 ++ l2) := by + induction l1 generalizing t with + | nil => exact le_rfl + | cons e l ih => exact (ih _).trans Set.subset_union_right + +open ExportLaw in +lemma held_append_left (t : LSt K Reg) (l1 l2 : List (LEv K Reg)) : + held t l1 ⊆ held t (l1 ++ l2) := by + induction l1 generalizing t with + | nil => exact cur_sub_held t l2 + | cons e l ih => exact Set.union_subset_union le_rfl (ih _) + +open ExportLaw in +lemma entRows_append (l1 l2 : List (LEv K Reg)) : + entRows (l1 ++ l2) = entRows l1 ++ entRows l2 := by + induction l1 with + | nil => rfl + | cons e l ih => cases e <;> simp [entRows, ih] + +open ExportLaw in +lemma nEnt_append (S : Finset Reg) (l1 l2 : List (LEv K Reg)) : + nEnt S (l1 ++ l2) = nEnt S l1 + nEnt S l2 := by + induction l1 with + | nil => simp [nEnt] + | cons e l ih => cases e <;> simp [nEnt, ih] <;> omega + +open ExportLaw in +lemma nDep_append (S : Finset Reg) (l1 l2 : List (LEv K Reg)) : + nDep S (l1 ++ l2) = nDep S l1 + nDep S l2 := by + induction l1 with + | nil => simp [nDep] + | cons e l ih => cases e <;> simp [nDep, ih] <;> omega + +open ExportLaw in +lemma bornSet_append (l1 l2 : List (LEv K Reg)) : + bornSet (l1 ++ l2) = bornSet l1 ∪ bornSet l2 := by + induction l1 with + | nil => simp [bornSet] + | cons e l ih => cases e <;> simp [bornSet, ih, Finset.insert_union] + +open ExportLaw in +/-- every entering row is held. -/ +lemma entRows_held : ∀ (t : LSt K Reg) (l : List (LEv K Reg)), ∀ v ∈ entRows l, v ∈ held t l + | t, [], v, h => by simp [entRows] at h + | t, .arrive i u :: l, v, h => by + simp only [entRows, List.mem_cons] at h + rcases h with rfl | h + · exact Set.mem_union_right _ (cur_sub_held _ l ⟨i, by simp [step], by simp [step]⟩) + · exact Set.mem_union_right _ (entRows_held _ l v h) + | t, .born b :: l, v, h => by + simp only [entRows, List.mem_cons] at h + rcases h with rfl | h + · exact Set.mem_union_right _ (cur_sub_held _ l ⟨b, by simp [step], by simp [step]⟩) + · exact Set.mem_union_right _ (entRows_held _ l v h) + | t, .add _ _ _ :: l, v, h => Set.mem_union_right _ (entRows_held _ l v h) + | t, .scale _ _ :: l, v, h => Set.mem_union_right _ (entRows_held _ l v h) + | t, .depart _ :: l, v, h => Set.mem_union_right _ (entRows_held _ l v h) + | t, .clear _ :: l, v, h => Set.mem_union_right _ (entRows_held _ l v h) + | t, .copy _ _ :: l, v, h => Set.mem_union_right _ (entRows_held _ l v h) + +open ExportLaw in +/-- **one-step simulation**: a legal global op projects to a legal one-chart event list, and the +projected state still tracks the registers located at `c`. -/ +theorem step_sim (Pub : Finset Reg) (c : C) (s : GSt K Reg C) (e : GEv K Reg C) (t : LSt K Reg) + (hL : LegalEvG Pub s e) (hS : Sim c s t) : + Legal t (pev c s e) ∧ Sim c (gstep s e) (run t (pev c s e)) := by + obtain ⟨hP, hR⟩ := hS + cases e with + | init o c' => + obtain ⟨-, ho⟩ := hL + by_cases hc : c' = c + · subst hc + refine ⟨?_, ?_, ?_⟩ + · simp only [pev, ↓reduceIte, Legal, LegalEv]; exact ⟨by rw [hP]; simp [ho], trivial⟩ + · intro r; by_cases hr : r = o + · subst hr; simp [pev, run, step, gstep] + · simp [pev, run, step, gstep, hr, hP] + · intro r hr; by_cases hro : r = o + · subst hro; simp [pev, run, step, gstep] + · simp only [gstep, Function.update_of_ne hro] at hr ⊢ + simp [pev, run, step, Function.update_of_ne hro, hR r hr] + · refine ⟨by simp [pev, hc, Legal], ?_, ?_⟩ + · intro r; by_cases hr : r = o + · subst hr; simp [pev, hc, run, gstep, hP, ho, Ne.symm hc] + · simp [pev, hc, run, gstep, hr, hP] + · intro r hr; by_cases hro : r = o + · subst hro; simp [gstep, hc] at hr + · simp only [gstep, Function.update_of_ne hro] at hr ⊢ + simp [pev, hc, run, hR r hr] + | clear o => + by_cases hc : s.loc o = some c + · refine ⟨?_, ?_, ?_⟩ + · simp only [pev, hc, ↓reduceIte, Legal, LegalEv]; exact ⟨by rw [hP]; exact hc, trivial⟩ + · intro r; by_cases hr : r = o + · subst hr; simp [pev, hc, run, step, gstep] + · simp [pev, hc, run, step, gstep, hr, hP] + · intro r hr; by_cases hro : r = o + · subst hro; simp [gstep] at hr + · simp only [gstep, Function.update_of_ne hro] at hr ⊢ + simp [pev, hc, run, step, hR r hr] + · refine ⟨by simp [pev, hc, Legal], ?_, ?_⟩ + · intro r; by_cases hr : r = o + · subst hr; simp [pev, hc, run, gstep, hP] + · simp [pev, hc, run, gstep, hr, hP] + · intro r hr; by_cases hro : r = o + · subst hro; simp [gstep] at hr + · simp only [gstep, Function.update_of_ne hro] at hr ⊢ + simp [pev, hc, run, hR r hr] + | move m c' => + obtain ⟨a, ha, h1, h2⟩ := hL + have hac : a ≠ c' := by + by_cases hm : m ∈ Pub + · exact (h1 hm).ne + · rcases h2 hm with h | h + · exact h.ne + · exact h.ne' + by_cases hc : a = c + · subst hc + have hc' : c' ≠ a := Ne.symm hac + refine ⟨?_, ?_, ?_⟩ + · simp only [pev, ha, hc', ↓reduceIte, List.append_nil, Legal, LegalEv] + exact ⟨by rw [hP]; exact ha, trivial⟩ + · intro r; by_cases hr : r = m + · subst hr; simp [pev, ha, hc', run, step, gstep] + · simp [pev, ha, hc', run, step, gstep, hr, hP] + · intro r hr; by_cases hro : r = m + · subst hro; simp [gstep, hc'] at hr + · simp only [gstep, Function.update_of_ne hro] at hr ⊢ + simp [pev, ha, hc', run, step, hR r hr] + · have hmc : s.loc m ≠ some c := by rw [ha]; simpa using hc + by_cases hc' : c' = c + · subst hc' + refine ⟨?_, ?_, ?_⟩ + · simp only [pev, hmc, ↓reduceIte, List.nil_append, Legal, LegalEv] + exact ⟨by rw [hP]; exact hmc, trivial⟩ + · intro r; by_cases hr : r = m + · subst hr; simp [pev, hmc, run, step, gstep] + · simp [pev, hmc, run, step, gstep, hr, hP] + · intro r hr; by_cases hro : r = m + · subst hro; simp [pev, hmc, run, step, gstep] + · simp only [gstep, Function.update_of_ne hro] at hr ⊢ + simp [pev, hmc, run, step, Function.update_of_ne hro, hR r hr] + · refine ⟨by simp [pev, hmc, hc', Legal], ?_, ?_⟩ + · intro r; by_cases hr : r = m + · subst hr; simp [pev, hmc, hc', run, gstep, hP, Ne.symm hc'] + · simp [pev, hmc, hc', run, gstep, hr, hP] + · intro r hr; by_cases hro : r = m + · subst hro; simp [gstep, hc'] at hr + · simp only [gstep, Function.update_of_ne hro] at hr ⊢ + simp [pev, hmc, hc', run, hR r hr] + | add i j a => + obtain ⟨hij, -, hji⟩ := hL + by_cases hc : s.loc i = some c + · have hjc : s.loc j = some c := hji ▸ hc + refine ⟨?_, ?_, ?_⟩ + · simp only [pev, hc, ↓reduceIte, Legal, LegalEv] + exact ⟨⟨hij, (hP i).2 hc, (hP j).2 hjc⟩, trivial⟩ + · intro r; simp [pev, hc, run, step, gstep, hP] + · intro r hr + simp only [gstep] at hr + by_cases hro : r = i + · subst hro; simp [pev, hc, run, step, gstep, hR r hr, hR j hjc] + · simp [pev, hc, run, step, gstep, Function.update_of_ne hro, hR r hr] + · refine ⟨by simp [pev, hc, Legal], ?_, ?_⟩ + · intro r; simp [pev, hc, run, gstep, hP] + · intro r hr + simp only [gstep] at hr + have hro : r ≠ i := fun h => hc (h ▸ hr) + simp [pev, hc, run, gstep, Function.update_of_ne hro, hR r hr] + | scale i u => + obtain ⟨hu, -⟩ := hL + by_cases hc : s.loc i = some c + · refine ⟨?_, ?_, ?_⟩ + · simp only [pev, hc, ↓reduceIte, Legal, LegalEv] + exact ⟨⟨hu, (hP i).2 hc⟩, trivial⟩ + · intro r; simp [pev, hc, run, step, gstep, hP] + · intro r hr + simp only [gstep] at hr + by_cases hro : r = i + · subst hro; simp [pev, hc, run, step, gstep, hR r hr] + · simp [pev, hc, run, step, gstep, Function.update_of_ne hro, hR r hr] + · refine ⟨by simp [pev, hc, Legal], ?_, ?_⟩ + · intro r; simp [pev, hc, run, gstep, hP] + · intro r hr + simp only [gstep] at hr + have hro : r ≠ i := fun h => hc (h ▸ hr) + simp [pev, hc, run, gstep, Function.update_of_ne hro, hR r hr] + | copy i j a => + obtain ⟨ha, -, -, hji⟩ := hL + by_cases hc : s.loc i = some c + · have hjc : s.loc j = some c := hji ▸ hc + refine ⟨?_, ?_, ?_⟩ + · simp only [pev, hc, ↓reduceIte, Legal, LegalEv] + exact ⟨⟨(hP i).2 hc, (hP j).2 hjc⟩, ⟨ha, by simpa [step] using (hP i).2 hc⟩, trivial⟩ + · intro r; simp [pev, hc, run, step, gstep, hP] + · intro r hr + simp only [gstep] at hr + by_cases hro : r = i + · subst hro; simp [pev, hc, run, step, gstep, hR j hjc] + · simp [pev, hc, run, step, gstep, Function.update_of_ne hro, hR r hr] + · refine ⟨by simp [pev, hc, Legal], ?_, ?_⟩ + · intro r; simp [pev, hc, run, gstep, hP] + · intro r hr + simp only [gstep] at hr + have hro : r ≠ i := fun h => hc (h ▸ hr) + simp [pev, hc, run, gstep, Function.update_of_ne hro, hR r hr] + +open ExportLaw in +theorem proj_sim (Pub : Finset Reg) (c : C) : ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)) + (t : LSt K Reg), LegalG Pub s w → Sim c s t → + Legal t (projFrom c s w) ∧ Sim c (grun s w) (run t (projFrom c s w)) + | s, [], t, _, hS => ⟨by simp [projFrom, Legal], by simpa [projFrom, grun, run] using hS⟩ + | s, e :: es, t, ⟨he, hL⟩, hS => by + obtain ⟨h1, h2⟩ := step_sim Pub c s e t he hS + obtain ⟨h3, h4⟩ := proj_sim Pub c (gstep s e) es _ hL h2 + refine ⟨(legal_append _ _ _).2 ⟨h1, h3⟩, ?_⟩ + simp only [projFrom, grun, run_append]; exact h4 + +open ExportLaw in +lemma births_aux (t : LSt K Reg) : ∀ (l : List Reg), l.Nodup → (∀ r ∈ l, r ∉ t.pres) → + Legal t (l.map .born) ∧ (∀ r, r ∈ (run t (l.map .born)).pres ↔ r ∈ t.pres ∨ r ∈ l) ∧ + ∀ r, (run t (l.map .born)).row r = if r ∈ l then Pi.single r 1 else t.row r + | [], _, _ => by simp [Legal, run] + | b :: l, hnd, hab => by + obtain ⟨hb, hnd'⟩ := List.nodup_cons.1 hnd + have hab' : ∀ r ∈ l, r ∉ (step t (.born b)).pres := by + intro r hr + simp only [step, Finset.mem_insert] + rintro (rfl | h) + · exact hb hr + · exact hab r (List.mem_cons_of_mem _ hr) h + obtain ⟨h1, h2, h3⟩ := births_aux (step t (.born b)) l hnd' hab' + refine ⟨⟨hab b (by simp), h1⟩, ?_, ?_⟩ + · intro r; simp only [List.map_cons, run]; rw [h2]; simp only [step, Finset.mem_insert, + List.mem_cons]; tauto + · intro r; simp only [List.map_cons, run]; rw [h3] + by_cases hr : r ∈ l + · simp [hr] + · by_cases hrb : r = b + · subst hrb; simp [step] + · simp [hr, hrb, step, Function.update_of_ne hrb] + +open ExportLaw in +theorem births_sim (c : C) (ini : Reg → Option C) : + Legal start (births (K := K) c ini) ∧ Sim c (s0 ini) (run start (births (K := K) c ini)) := by + obtain ⟨h1, h2, h3⟩ := births_aux (K := K) (start (K := K) (Reg := Reg)) + (bornAt c ini).toList (Finset.nodup_toList _) (by simp [start]) + unfold births + refine ⟨h1, fun r => ?_, fun r hr => ?_⟩ + · rw [h2]; simp [start, bornAt, s0] + · rw [h3]; simp only [s0] at hr ⊢; simp [bornAt, hr] + +open ExportLaw in +/-- **the chart-`c` list of a legal word is a legal ExportLaw run from the empty state, and its final +state holds exactly the registers ending at `c`, with their global rows.** -/ +theorem proj_legal (Pub : Finset Reg) (c : C) (ini : Reg → Option C) (w : List (GEv K Reg C)) + (hL : LegalG Pub (s0 ini) w) : + Legal start (proj c ini w) ∧ Sim c (grun (s0 ini) w) (run start (proj c ini w)) := by + obtain ⟨h1, h2⟩ := births_sim (K := K) c ini + obtain ⟨h3, h4⟩ := proj_sim Pub c _ w _ hL h2 + exact ⟨(legal_append _ _ _).2 ⟨h1, h3⟩, by rw [proj, run_append]; exact h4⟩ + +/-! ## 3b. Sharpened forward count: zero-row entries (owned INITs) are free + +ExportLaw.forward_count bounds dim S_c by ALL entries; an owned INIT enters with row 0 and adds +nothing to the span. The data (rsdata.py / indep_word.py) counts oa = owned MOVE arrivals only, so the +floor needs this sharper count. -/ + +open ExportLaw in +lemma filter_ne_zero_length (l : List (Reg → K)) : + (l.filter fun v => v ≠ 0).length + l.count 0 = l.length := by + rw [← List.countP_eq_length_filter, List.count_eq_countP, + List.length_eq_countP_add_countP (fun v => decide (v ≠ 0)) (l := l)] + congr 1 + apply List.countP_congr + intro v _ + simp + +open ExportLaw in +theorem forward_count' (φ : (Reg → K) →ₗ[K] (Reg → K)) (evs : List (LEv K Reg)) + (hL : Legal start evs) (Tk : Finset Reg) + (hTk : ∀ t ∈ Tk, (Pi.single t 1 : Reg → K) ∈ held start evs) + (hφ : ∀ t ∈ Tk, φ (Pi.single t 1) = 0) : + finrank K ((span K (held start evs)).map φ) + Tk.card ≤ + nEnt univ evs - (entRows evs).count 0 := by + classical + have hfz := filter_ne_zero_length (entRows evs) + rw [entRows_length] at hfz + set l := (entRows evs).filter fun v => v ≠ 0 + have hlen : l.length = nEnt univ evs - (entRows evs).count 0 := by omega + have hAc : finrank K (span K {v | v ∈ l}) ≤ l.length := by + have eqA : span K {v | v ∈ l} = span K (((l.toFinset : Finset (Reg → K)) : Set (Reg → K))) := by + congr 1; ext v; simp + rw [eqA] + exact (finrank_span_finset_le_card _).trans (List.toFinset_card_le _) + set A := span K {v | v ∈ l} + have hSA : held start evs ⊆ A := by + refine forward_span A start evs hL (by simp [cur, start]) (fun v hv => ?_) + by_cases h0 : v = 0 + · rw [h0]; exact A.zero_mem + · exact Submodule.subset_span (show v ∈ l from List.mem_filter.2 ⟨hv, by simpa using h0⟩) + let f := φ.domRestrict A + have hrn := LinearMap.finrank_range_add_finrank_ker f + have hrange : LinearMap.range f = A.map φ := LinearMap.range_domRestrict A φ + have hker : Tk.card ≤ finrank K (LinearMap.ker f) := by + let g : Tk → LinearMap.ker f := fun t => + ⟨⟨Pi.single t.1 1, hSA (hTk t.1 t.2)⟩, by simp [f, hφ t.1 t.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) = (Pi.basisFun K Reg) ∘ Subtype.val := by + funext t; simp [g] + rw [e]; exact (Pi.basisFun K Reg).linearIndependent.comp _ Subtype.val_injective + simpa using hli.fintype_card_le_finrank + have hmono : finrank K ((span K (held start evs)).map φ) ≤ finrank K (A.map φ) := + Submodule.finrank_mono (Submodule.map_mono (Submodule.span_le.mpr hSA)) + rw [← hrange] at hmono + omega + +open ExportLaw in +/-- FloorGlue.entry_count with oa sharpened to (owned entries − zero-row entries). -/ +theorem entry_count' (evs : List (LEv K Reg)) (hL : Legal start evs) + (H Kp Ow : Finset Reg) (hHK : Disjoint H Kp) (hHO : Disjoint H Ow) (hKO : Disjoint Kp Ow) + (hcov : H ∪ Kp ∪ Ow = univ) (hOnce : ∀ i ∈ Kp, nEnt {i} evs ≤ 1) : + finrank K (span K (held start evs)) ≤ + (nDep H evs - ((H ∩ bornSet evs) \ (run start evs).pres).card) + + ((run start evs).pres ∩ H).card + + ((Kp \ bornSet evs).filter fun i => 0 < nEnt {i} evs).card + + (nEnt Ow evs - (entRows evs).count 0) + + ((H ∩ bornSet evs) \ (run start evs).pres).card + + (Kp ∩ bornSet evs).card := by + classical + obtain ⟨hHB, -⟩ := FloorGlue.entry_count evs hL H Kp Ow hHK hHO hKO hcov hOnce + set F := (run (start (K := K) (Reg := Reg)) evs).pres + set HB := (H ∩ bornSet evs) \ F + have fc := forward_count' (K := K) LinearMap.id evs hL ∅ (by simp) (by simp) + rw [Submodule.map_id, Finset.card_empty, add_zero] at fc + have hsplit : nEnt univ evs = nEnt H evs + nEnt Kp evs + nEnt Ow evs := by + rw [FloorGlue.nEnt_eq_sum, FloorGlue.nEnt_eq_sum H, FloorGlue.nEnt_eq_sum Kp, + FloorGlue.nEnt_eq_sum Ow, ← hcov, + Finset.sum_union (Finset.disjoint_union_left.2 ⟨hHO, hKO⟩), Finset.sum_union hHK] + have hH : nEnt H evs = nDep H evs + (F ∩ H).card := by + have := stay_count (K := K) H start evs hL + have h0 : (start (K := K) (Reg := Reg)).pres = ∅ := rfl + rw [h0] at this; simpa using this + have hKp : nEnt Kp evs ≤ ((Kp \ bornSet evs).filter fun i => 0 < nEnt {i} evs).card + + (Kp ∩ bornSet evs).card := by + rw [FloorGlue.nEnt_eq_sum] + have h1 : ∑ i ∈ Kp, nEnt {i} evs ≤ (Kp.filter fun i => 0 < nEnt {i} evs).card := by + rw [Finset.card_filter] + exact Finset.sum_le_sum fun i hi => by + have := hOnce i hi + split_ifs with h <;> omega + have h2 : (Kp.filter fun i => 0 < nEnt {i} evs) ⊆ + ((Kp \ bornSet evs).filter fun i => 0 < nEnt {i} evs) ∪ (Kp ∩ bornSet evs) := by + intro i hi + obtain ⟨hiK, hpos⟩ := Finset.mem_filter.1 hi + by_cases hb : i ∈ bornSet evs + · exact Finset.mem_union_right _ (Finset.mem_inter.2 ⟨hiK, hb⟩) + · exact Finset.mem_union_left _ (Finset.mem_filter.2 ⟨Finset.mem_sdiff.2 ⟨hiK, hb⟩, hpos⟩) + exact h1.trans ((Finset.card_le_card h2).trans (Finset.card_union_le _ _)) + omega + +open ExportLaw in +/-- FloorGlue.chart_floor with the sharpened oa. -/ +theorem chart_floor' {W : Type*} [AddCommGroup W] [Module K W] (ρ : (Reg → K) →ₗ[K] W) + (evs : List (LEv K Reg)) (hL : Legal start evs) + (H Kp Ow : Finset Reg) (hHK : Disjoint H Kp) (hHO : Disjoint H Ow) (hKO : Disjoint Kp Ow) + (hcov : H ∪ Kp ∪ Ow = univ) (hOnce : ∀ i ∈ Kp, nEnt {i} evs ≤ 1) + (hN : ∀ h ∈ H, h ∈ (run start evs).pres → (run start evs).row h = Pi.single h 1) + (hρ : ∀ h ∈ H, ρ (Pi.single h 1) = 0) + (X : Set (Reg → K)) (hX : X ⊆ held start evs) : + finrank K (span K (ρ '' X)) ≤ + (nDep H evs - ((H ∩ bornSet evs) \ (run start evs).pres).card) + + ((Kp \ bornSet evs).filter fun i => 0 < nEnt {i} evs).card + + (nEnt Ow evs - (entRows evs).count 0) + (Kp ∩ bornSet evs).card := by + classical + set F := (run (start (K := K) (Reg := Reg)) evs).pres + set HB := (H ∩ bornSet evs) \ F + have hent := entry_count' evs hL H Kp Ow hHK hHO hKO hcov hOnce + set Tok := (F ∩ H) ∪ HB + have hdisj : Disjoint (F ∩ H) HB := by + rw [Finset.disjoint_left] + intro x hx hx' + exact (Finset.mem_sdiff.1 hx').2 (Finset.mem_inter.1 hx).1 + have hTokc : Tok.card = (F ∩ H).card + HB.card := Finset.card_union_of_disjoint hdisj + have hTokS : ∀ i ∈ Tok, (Pi.single i 1 : Reg → K) ∈ span K (held start evs) := by + intro i hi + apply Submodule.subset_span + rcases Finset.mem_union.1 hi with h | h + · obtain ⟨hF, hH⟩ := Finset.mem_inter.1 h + have : (run start evs).row i ∈ cur (run start evs) := ⟨i, hF, rfl⟩ + rw [hN i hH hF] at this + exact final_sub_held start evs this + · exact born_held start evs i (Finset.mem_inter.1 (Finset.mem_sdiff.1 h).1).2 + have hTokρ : ∀ i ∈ Tok, ρ (Pi.single i 1) = 0 := by + intro i hi + rcases Finset.mem_union.1 hi with h | h + · exact hρ i (Finset.mem_inter.1 h).2 + · exact hρ i (Finset.mem_inter.1 (Finset.mem_sdiff.1 h).1).1 + exact Floor.stay_floor ρ (span K (held start evs)) X Tok _ _ _ _ _ _ + (hX.trans Submodule.subset_span) hTokS hTokρ hTokc hent + +/-! ## 3. States visited, MOVE records -/ + +def snaps : GSt K Reg C → List (GEv K Reg C) → List (GSt K Reg C) + | s, [] => [s] + | s, e :: es => s :: snaps (gstep s e) es + +open ExportLaw in +/-- every row of a register located at `c` at any visited state is held at `c` (in S_c). -/ +theorem snap_held (Pub : Finset Reg) (c : C) : ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)) + (t : LSt K Reg), LegalG Pub s w → Sim c s t → + ∀ st ∈ snaps s w, ∀ r, st.loc r = some c → st.row r ∈ held t (projFrom c s w) + | s, [], t, _, hS, st, hst, r, hr => by + simp only [snaps, List.mem_singleton] at hst; subst hst + exact ⟨r, Finset.mem_coe.2 ((hS.1 r).2 hr), hS.2 r hr⟩ + | s, e :: es, t, ⟨he, hL⟩, hS, st, hst, r, hr => by + obtain ⟨-, h2⟩ := step_sim Pub c s e t he hS + simp only [snaps, List.mem_cons] at hst + simp only [projFrom] + rcases hst with rfl | hst + · exact cur_sub_held t _ ⟨r, Finset.mem_coe.2 ((hS.1 r).2 hr), hS.2 r hr⟩ + · exact held_append_right _ _ _ (snap_held Pub c _ es _ hL h2 st hst r hr) + +/-- a MOVE record: register, frame left (tail), frame entered (head), row carried. -/ +structure Mv (K Reg C : Type*) where + reg : Reg + tail : C + head : C + row : Reg → K + +def mvOf (s : GSt K Reg C) : GEv K Reg C → List (Mv K Reg C) + | .move r c' => match s.loc r with + | some a => [⟨r, a, c', s.row r⟩] + | none => [] + | _ => [] + +def moves : GSt K Reg C → List (GEv K Reg C) → List (Mv K Reg C) + | _, [] => [] + | s, e :: es => mvOf s e ++ moves (gstep s e) es + +/-- MOVE records come from visited states; public MOVEs strictly climb (l.51). -/ +theorem moves_facts (Pub : Finset Reg) : ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), + LegalG Pub s w → ∀ m ∈ moves s w, (∃ st ∈ snaps s w, st.loc m.reg = some m.tail ∧ + st.row m.reg = m.row) ∧ (m.reg ∈ Pub → m.tail < m.head) ∧ m.tail ≠ m.head + | s, [], _, m, hm => by simp [moves] at hm + | s, e :: es, ⟨he, hL⟩, m, hm => by + simp only [moves, List.mem_append] at hm + rcases hm with hm | hm + · cases e with + | move r c' => + obtain ⟨a, ha, h1, h2⟩ := he + simp only [mvOf, ha, List.mem_singleton] at hm + subst hm + refine ⟨⟨s, by simp [snaps], ha, rfl⟩, h1, ?_⟩ + by_cases hr : r ∈ Pub + · exact (h1 hr).ne + · rcases h2 hr with h | h + · exact h.ne + · exact h.ne' + | init _ _ => simp [mvOf] at hm + | clear _ => simp [mvOf] at hm + | add _ _ _ => simp [mvOf] at hm + | scale _ _ => simp [mvOf] at hm + | copy _ _ _ => simp [mvOf] at hm + · obtain ⟨⟨st, hst, h1, h2⟩, h3, h4⟩ := moves_facts Pub _ es hL m hm + exact ⟨⟨st, by simp [snaps, hst], h1, h2⟩, h3, h4⟩ + +open ExportLaw in +/-- the row a MOVE carries enters its head chart. -/ +theorem moves_arrive : ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), + ∀ m ∈ moves s w, m.row ∈ entRows (projFrom m.head s w) + | s, [], m, hm => by simp [moves] at hm + | s, e :: es, m, hm => by + simp only [moves, List.mem_append] at hm + simp only [projFrom, entRows_append, List.mem_append] + rcases hm with hm | hm + · left + cases e with + | move r c' => + simp only [mvOf] at hm + split at hm + · rename_i a ha + simp only [List.mem_singleton] at hm; subst hm + by_cases h : s.loc r = some c' + · simp [pev, h, entRows] + · simp [pev, h, entRows] + · simp at hm + | init _ _ => simp [mvOf] at hm + | clear _ => simp [mvOf] at hm + | add _ _ _ => simp [mvOf] at hm + | scale _ _ => simp [mvOf] at hm + | copy _ _ _ => simp [mvOf] at hm + · right; exact moves_arrive _ es m hm + +open ExportLaw in +/-- every row entering chart `c` after time 0 is an owned INIT row (0) or a MOVE's row. -/ +theorem entRows_proj (Pub : Finset Reg) (c : C) : ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), + LegalG Pub s w → ∀ v ∈ entRows (projFrom c s w), + v = 0 ∨ ∃ m ∈ moves s w, m.head = c ∧ m.row = v + | s, [], _, v, hv => by simp [projFrom, entRows] at hv + | s, e :: es, ⟨he, hL⟩, v, hv => by + simp only [projFrom, entRows_append, List.mem_append] at hv + rcases hv with hv | hv + · cases e with + | init o c' => + left + by_cases h : c' = c + · simpa [pev, h, entRows] using hv + · simp [pev, h, entRows] at hv + | move r c' => + obtain ⟨a, ha, -, -⟩ := he + right + refine ⟨⟨r, a, c', s.row r⟩, by simp [moves, mvOf, ha], ?_⟩ + by_cases h : c' = c + · subst h + by_cases h' : s.loc r = some c' + · simp [pev, h', entRows] at hv; exact ⟨rfl, hv.symm⟩ + · simp [pev, h', entRows] at hv; exact ⟨rfl, hv.symm⟩ + · by_cases h' : s.loc r = some c + · simp [pev, h', h, entRows] at hv + · simp [pev, h', h, entRows] at hv + | clear o => + by_cases h : s.loc o = some c + · simp [pev, h, entRows] at hv + · simp [pev, h, entRows] at hv + | add i j a => + by_cases h : s.loc i = some c + · simp [pev, h, entRows] at hv + · simp [pev, h, entRows] at hv + | scale i u => + by_cases h : s.loc i = some c + · simp [pev, h, entRows] at hv + · simp [pev, h, entRows] at hv + | copy i j a => + by_cases h : s.loc i = some c + · simp [pev, h, entRows] at hv + · simp [pev, h, entRows] at hv + · rcases entRows_proj Pub c _ es hL v hv with h | ⟨m, hm, h1, h2⟩ + · exact Or.inl h + · exact Or.inr ⟨m, by simp [moves, hm], h1, h2⟩ + +open ExportLaw in +lemma entRows_born (l : List Reg) : ∀ v ∈ entRows (l.map (Ev.born (K := K))), + ∃ r ∈ l, v = Pi.single r 1 := by + induction l with + | nil => simp [entRows] + | cons b l ih => + intro v hv + simp only [List.map_cons, entRows, List.mem_cons] at hv + rcases hv with rfl | hv + · exact ⟨b, by simp, rfl⟩ + · obtain ⟨r, hr, rfl⟩ := ih v hv; exact ⟨r, by simp [hr], rfl⟩ + +open ExportLaw in +lemma nEnt_born (S : Finset Reg) : ∀ (l : List Reg), l.Nodup → + nEnt S (l.map (Ev.born (K := K))) = (l.toFinset ∩ S).card + | [], _ => by simp [nEnt] + | b :: l, hnd => by + obtain ⟨hb, hnd'⟩ := List.nodup_cons.1 hnd + simp only [List.map_cons, nEnt, nEnt_born S l hnd', List.toFinset_cons] + by_cases hbS : b ∈ S + · rw [Finset.insert_inter_of_mem hbS, Finset.card_insert_of_notMem (by simp [hb])] + simp [hbS]; omega + · rw [Finset.insert_inter_of_notMem hbS]; simp [hbS] + +open ExportLaw in +lemma nDep_born (S : Finset Reg) : ∀ (l : List Reg), nDep S (l.map (Ev.born (K := K))) = 0 + | [] => rfl + | b :: l => by simp only [List.map_cons, nDep]; exact nDep_born S l + +open ExportLaw in +lemma bornSet_born : ∀ (l : List Reg), bornSet (l.map (Ev.born (K := K))) = l.toFinset + | [] => rfl + | b :: l => by simp only [List.map_cons, bornSet, bornSet_born l, List.toFinset_cons] + +open ExportLaw in +lemma bornSet_projFrom (c : C) : ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), + bornSet (projFrom c s w) = ∅ + | s, [] => rfl + | s, e :: es => by + rw [projFrom, bornSet_append, bornSet_projFrom c _ es, Finset.union_empty] + cases e with + | init o c' => by_cases h : c' = c <;> simp [pev, h, bornSet] + | clear o => by_cases h : s.loc o = some c <;> simp [pev, h, bornSet] + | move r c' => + by_cases h : s.loc r = some c <;> by_cases h' : c' = c <;> simp [pev, h, h', bornSet] + | add i j a => by_cases h : s.loc i = some c <;> simp [pev, h, bornSet] + | scale i u => by_cases h : s.loc i = some c <;> simp [pev, h, bornSet] + | copy i j a => by_cases h : s.loc i = some c <;> simp [pev, h, bornSet] + +open ExportLaw in +/-- **hOnce from l.51.** A public register enters a chart at most once after time 0, and never +again once it has stood at or above that chart. -/ +theorem once_aux (Pub : Finset Reg) (c : C) (r : Reg) (hr : r ∈ Pub) : + ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)) (a : C), LegalG Pub s w → s.loc r = some a → + (c ≤ a → nEnt {r} (projFrom c s w) = 0) ∧ nEnt {r} (projFrom c s w) ≤ 1 + | s, [], a, _, _ => by simp [projFrom, nEnt] + | s, e :: es, a, ⟨he, hL⟩, ha => by + simp only [projFrom, nEnt_append] + cases e with + | move m c' => + obtain ⟨a', ha', h1, -⟩ := he + by_cases hmr : m = r + · subst hmr + rw [ha] at ha'; cases ha' + have hlt := h1 hr + have hloc : (gstep s (.move m c')).loc m = some c' := by simp [gstep] + obtain ⟨i1, i2⟩ := once_aux Pub c m hr _ es c' hL hloc + by_cases hc : c' = c + · subst hc + have hne : s.loc m ≠ some c' := by rw [ha]; simpa using hlt.ne + have h0 := i1 le_rfl + refine ⟨fun hca => absurd (lt_of_le_of_lt hca hlt) (lt_irrefl _), ?_⟩ + simp [pev, hne, nEnt, h0] + · have hpe : nEnt {m} (pev c s (.move m c')) = 0 := by + by_cases h : s.loc m = some c <;> simp [pev, h, hc, nEnt] + rw [hpe] + exact ⟨fun hca => by simpa using i1 (hca.trans hlt.le), by simpa using i2⟩ + · have hloc : (gstep s (.move m c')).loc r = some a := by + simp [gstep, Function.update_of_ne (Ne.symm hmr), ha] + obtain ⟨i1, i2⟩ := once_aux Pub c r hr _ es a hL hloc + have hpe : nEnt {r} (pev c s (.move m c')) = 0 := by + by_cases h : s.loc m = some c <;> by_cases h' : c' = c <;> + simp [pev, h, h', nEnt, hmr] + rw [hpe]; exact ⟨fun hca => by simpa using i1 hca, by simpa using i2⟩ + | init o c' => + have hor : o ≠ r := fun h => he.1 (h ▸ hr) + have hloc : (gstep s (.init o c')).loc r = some a := by + simp [gstep, Function.update_of_ne (Ne.symm hor), ha] + obtain ⟨i1, i2⟩ := once_aux Pub c r hr _ es a hL hloc + have hpe : nEnt {r} (pev c s (.init o c')) = 0 := by + by_cases h' : c' = c <;> simp [pev, h', nEnt, hor] + rw [hpe]; exact ⟨fun hca => by simpa using i1 hca, by simpa using i2⟩ + | clear o => + have hor : o ≠ r := fun h => he.1 (h ▸ hr) + have hloc : (gstep s (.clear o)).loc r = some a := by + simp [gstep, Function.update_of_ne (Ne.symm hor), ha] + obtain ⟨i1, i2⟩ := once_aux Pub c r hr _ es a hL hloc + have hpe : nEnt {r} (pev c s (.clear o)) = 0 := by + by_cases h : s.loc o = some c <;> simp [pev, h, nEnt] + rw [hpe]; exact ⟨fun hca => by simpa using i1 hca, by simpa using i2⟩ + | add i j x => + obtain ⟨i1, i2⟩ := once_aux Pub c r hr _ es a hL (by simpa [gstep] using ha) + have hpe : nEnt {r} (pev c s (.add i j x)) = 0 := by + by_cases h : s.loc i = some c <;> simp [pev, h, nEnt] + rw [hpe]; exact ⟨fun hca => by simpa using i1 hca, by simpa using i2⟩ + | scale i u => + obtain ⟨i1, i2⟩ := once_aux Pub c r hr _ es a hL (by simpa [gstep] using ha) + have hpe : nEnt {r} (pev c s (.scale i u)) = 0 := by + by_cases h : s.loc i = some c <;> simp [pev, h, nEnt] + rw [hpe]; exact ⟨fun hca => by simpa using i1 hca, by simpa using i2⟩ + | copy i j x => + obtain ⟨i1, i2⟩ := once_aux Pub c r hr _ es a hL (by simpa [gstep] using ha) + have hpe : nEnt {r} (pev c s (.copy i j x)) = 0 := by + by_cases h : s.loc i = some c <;> simp [pev, h, nEnt] + rw [hpe]; exact ⟨fun hca => by simpa using i1 hca, by simpa using i2⟩ + +open ExportLaw in +/-- **hOnce, derived**: every public register enters each chart at most once. -/ +theorem hOnce_proj (Pub : Finset Reg) (c : C) (ini : Reg → Option C) (w : List (GEv K Reg C)) + (hL : LegalG Pub (s0 ini) w) (r : Reg) (hr : r ∈ Pub) (hini : ini r ≠ none) : + nEnt {r} (proj c ini w) ≤ 1 := by + obtain ⟨a, ha⟩ := Option.ne_none_iff_exists'.1 hini + obtain ⟨i1, i2⟩ := once_aux (K := K) Pub c r hr (s0 ini) w a hL ha + rw [proj, nEnt_append, births, nEnt_born _ _ (Finset.nodup_toList _)] + by_cases hrc : ini r = some c + · rw [ha] at hrc; cases hrc + have : ((bornAt c ini).toList.toFinset ∩ {r}).card = 1 := by + rw [Finset.toList_toFinset, Finset.inter_singleton_of_mem (by simp [bornAt, ha])]; rfl + rw [this, i1 le_rfl] + · have : ((bornAt c ini).toList.toFinset ∩ {r}).card = 0 := by + rw [Finset.toList_toFinset, Finset.inter_singleton_of_notMem (by simp [bornAt, hrc])]; rfl + rw [this]; simpa using i2 + +/-! ## 4. ρ, acceptance, class K, chart quantities -/ + +/-- ρ deletes helper coordinates. -/ +def rhoH (H : Finset Reg) : (Reg → K) →ₗ[K] (Reg → K) where + toFun v i := if i ∈ H then 0 else v i + map_add' v u := by ext i; simp only [Pi.add_apply]; split_ifs <;> simp + map_smul' a v := by ext i; simp only [Pi.smul_apply, smul_eq_mul, RingHom.id_apply]; split_ifs <;> simp + +lemma rhoH_single (H : Finset Reg) (h : Reg) (hh : h ∈ H) : rhoH (K := K) H (Pi.single h 1) = 0 := by + ext i + simp only [rhoH, LinearMap.coe_mk, AddHom.coe_mk, Pi.zero_apply] + split_ifs with hi + · rfl + · have : i ≠ h := fun e => hi (e ▸ hh) + simp [Pi.single_apply, this] + +/-- acceptance by the shipped verifier (independent.py), the parts used here: +legality of every op (incl. l.51), public registers = those with an initial frame, helpers are +public, and the final Jacobian check (`bad_inputs == []`) on helper rows: a helper ends as its own +token (target[r] = {r: 1} for every non-main public r). -/ +structure Accepted (Pub H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) : Prop where + legal : LegalG Pub (s0 ini) w + pub_ini : ∀ r, r ∈ Pub ↔ ini r ≠ none + helpers_pub : H ⊆ Pub + helper_final : ∀ h ∈ H, (grun (s0 ini) w).row h = Pi.single h 1 + +section Chart +variable (Pub H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) + +open ExportLaw + +/-- S_c: every row ever held at c. -/ +def heldAt (c : C) : Set (Reg → K) := held start (proj c ini w) + +/-- hd(c): paid helper stays at c (helper departures minus departures of helpers born at c). -/ +noncomputable def hdW (c : C) : ℕ := + nDep H (proj c ini w) - ((H ∩ bornSet (proj c ini w)) \ (run start (proj c ini w)).pres).card +/-- ka(c): kept public registers that arrive at c. -/ +noncomputable def kaW (c : C) : ℕ := + (((Pub \ H) \ bornSet (proj c ini w)).filter fun i => 0 < nEnt {i} (proj c ini w)).card +/-- oa(c): owned entries at c with a nonzero row (INITs, row 0, are free; sharpened count). -/ +noncomputable def oaW (c : C) : ℕ := + nEnt (univ \ Pub) (proj c ini w) - (entRows (proj c ini w)).count 0 +/-- kb(c): kept public registers born at c. -/ +noncomputable def kbW (c : C) : ℕ := ((Pub \ H) ∩ bornSet (proj c ini w)).card + +end Chart + +open ExportLaw in +/-- **Chart floor on the word** (FloorGlue.chart_floor with every hypothesis discharged): +for an accepted word and any rows X held at c, rank ρ(X) ≤ hd + ka + oa + kb. -/ +theorem chart_floor_word {Pub H : Finset Reg} {ini : Reg → Option C} {w : List (GEv K Reg C)} + (hA : Accepted Pub H ini w) (c : C) (X : Set (Reg → K)) (hX : X ⊆ heldAt ini w c) : + finrank K (span K (rhoH H '' X)) ≤ + hdW H ini w c + kaW Pub H ini w c + oaW Pub ini w c + kbW Pub H ini w c := by + classical + obtain ⟨hL, hS⟩ := proj_legal Pub c ini w hA.legal + have hHK : Disjoint H (Pub \ H) := Finset.disjoint_sdiff + have hHO : Disjoint H (univ \ Pub) := Finset.disjoint_left.2 fun x hx hx' => + (Finset.mem_sdiff.1 hx').2 (hA.helpers_pub hx) + have hKO : Disjoint (Pub \ H) (univ \ Pub) := Finset.disjoint_left.2 fun x hx hx' => + (Finset.mem_sdiff.1 hx').2 (Finset.mem_sdiff.1 hx).1 + have hcov : H ∪ (Pub \ H) ∪ (univ \ Pub) = univ := by + ext x; by_cases hx : x ∈ Pub <;> by_cases hy : x ∈ H <;> simp [hx, hy] + have hOnce : ∀ i ∈ Pub \ H, nEnt {i} (proj c ini w) ≤ 1 := fun i hi => + hOnce_proj Pub c ini w hA.legal i (Finset.mem_sdiff.1 hi).1 + ((hA.pub_ini i).1 (Finset.mem_sdiff.1 hi).1) + have hN : ∀ h ∈ H, h ∈ (run start (proj c ini w)).pres → + (run start (proj c ini w)).row h = Pi.single h 1 := fun h hh hp => by + rw [hS.2 h ((hS.1 h).1 hp)]; exact hA.helper_final h hh + have h := chart_floor' (rhoH H) (proj c ini w) hL H (Pub \ H) (univ \ Pub) hHK hHO hKO + hcov hOnce hN (fun h hh => rhoH_single H h hh) X hX + unfold hdW kaW oaW kbW + exact h + +/-! ## 5. Class K -/ + +/-- class-K data: the kept ρ-content of every chart (word-independent in class K). -/ +structure KData (C W : Type*) where + Kρ : C → Set W + Rρ : C → Set W + ka : C → ℕ + oa : C → ℕ + kb : C → ℕ + +section ClassK +variable (Pub H : Finset Reg) (Kfin : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) + +/-- kept arrival content at c: ρ-rows of kept and owned MOVEs into c, kept birth tokens. -/ +def keptArr (c : C) : Set (Reg → K) := + {v | ∃ m ∈ moves (s0 ini) w, m.reg ∉ H ∧ m.head = c ∧ v = rhoH H m.row} ∪ + {v | ∃ r, r ∉ H ∧ ini r = some c ∧ v = rhoH H (Pi.single r 1)} + +/-- token finals of the kept enders `Kfin` at c (the non-Y enders below V in the prose). -/ +def keptFin (c : C) : Set (Reg → K) := + {v | ∃ r ∈ Kfin, (grun (s0 ini) w).loc r = some c ∧ v = rhoH H ((grun (s0 ini) w).row r)} + +/-- ρ-rows of non-helper registers at c at any visited state (kept rows at kept events ⊆ this). -/ +def keptSnap (c : C) : Set (Reg → K) := + {v | ∃ st ∈ snaps (s0 ini) w, ∃ r, r ∉ H ∧ st.loc r = some c ∧ v = rhoH H (st.row r)} + +/-- **Class K relative to data D** (D = the kept data of #7623, read off by rsdata.py / +indep_word.py). An accepted word whose kept ρ-content at every chart is D's: every nonzero kept/owned +arrival ρ-row and kept birth token is in D.Kρ (K1), every element of D.Kρ is such a row or a kept +token final (K2), D's kept rows R(c) occur at c (R), and the kept counts are at most D's (ka, oa, kb; +`classK_of_counts` shows the literal MOVE/birth counts used by the data qualify). Helpers (routes, +frames, ops, rows) are free. -/ +structure ClassK (D : KData C (Reg → K)) : Prop where + acc : Accepted Pub H ini w + kept_K1 : ∀ c, ∀ v ∈ keptArr H ini w c, v ≠ 0 → v ∈ D.Kρ c + kept_K2 : ∀ c, D.Kρ c ⊆ keptArr H ini w c ∪ keptFin H Kfin ini w c + kept_R : ∀ c, D.Rρ c ⊆ keptSnap H ini w c + kept_ka : ∀ c, kaW Pub H ini w c ≤ D.ka c + kept_oa : ∀ c, oaW Pub ini w c ≤ D.oa c + kept_kb : ∀ c, kbW Pub H ini w c ≤ D.kb c + +end ClassK + +variable {Pub H Kfin : Finset Reg} {ini : Reg → Option C} {w : List (GEv K Reg C)} + {D : KData C (Reg → K)} + +open ExportLaw in +lemma born_ent (r : Reg) : ∀ l : List Reg, r ∈ l → + (Pi.single r 1 : Reg → K) ∈ entRows (l.map (Ev.born (K := K))) + | [], hm => by simp at hm + | b :: l, hm => by + simp only [List.map_cons, entRows, List.mem_cons] at hm ⊢ + rcases hm with rfl | hm + · exact Or.inl rfl + · exact Or.inr (born_ent r l hm) + +open ExportLaw in +lemma births_ent (c : C) (r : Reg) (hr : ini r = some c) : + (Pi.single r 1 : Reg → K) ∈ entRows (births (K := K) c ini) := + born_ent r _ (by simp [bornAt, hr]) + +open ExportLaw in +lemma move_held (_hA : Accepted Pub H ini w) (m : Mv K Reg C) (hm : m ∈ moves (s0 ini) w) : + m.row ∈ heldAt ini w m.head := by + apply entRows_held + rw [proj, entRows_append] + exact List.mem_append_right _ (moves_arrive _ w m hm) + +open ExportLaw in +lemma snapRow_held (hA : Accepted Pub H ini w) (c : C) (st : GSt K Reg C) + (hst : st ∈ snaps (s0 ini) w) (r : Reg) (hr : st.loc r = some c) : + st.row r ∈ heldAt ini w c := by + obtain ⟨-, hS⟩ := births_sim (K := K) c ini + exact held_append_right _ _ _ (snap_held Pub c _ w _ hA.legal hS st hst r hr) + +lemma tail_held (hA : Accepted Pub H ini w) (m : Mv K Reg C) (hm : m ∈ moves (s0 ini) w) : + m.row ∈ heldAt ini w m.tail := by + obtain ⟨⟨st, hst, h1, h2⟩, -, -⟩ := moves_facts Pub _ w hA.legal m hm + rw [← h2]; exact snapRow_held hA _ st hst _ h1 + +open ExportLaw in +/-- K_c ⊆ ρ(S_c): every kept ρ-row is the ρ-image of a row held at c. -/ +lemma K_held (hK : ClassK Pub H Kfin ini w D) (c : C) : + ∀ v ∈ D.Kρ c, ∃ u ∈ heldAt ini w c, rhoH H u = v := by + intro v hv + replace hv := hK.kept_K2 c hv + rcases hv with (⟨m, hm, -, rfl, rfl⟩ | ⟨r, -, hr, rfl⟩) | ⟨r, -, hr, rfl⟩ + · exact ⟨m.row, move_held hK.acc m hm, rfl⟩ + · refine ⟨_, entRows_held _ _ _ ?_, rfl⟩ + rw [proj, entRows_append]; exact List.mem_append_left _ (births_ent c r hr) + · obtain ⟨hL, hS⟩ := proj_legal Pub c ini w hK.acc.legal + refine ⟨_, final_sub_held _ _ ⟨r, Finset.mem_coe.2 ((hS.1 r).2 hr), hS.2 r hr⟩, rfl⟩ + +lemma R_held (hK : ClassK Pub H Kfin ini w D) (c : C) : + ∀ v ∈ D.Rρ c, ∃ u ∈ heldAt ini w c, rhoH H u = v := by + intro v hv + obtain ⟨st, hst, r, -, hr, rfl⟩ := hK.kept_R c hv + exact ⟨_, snapRow_held hK.acc c st hst r hr, rfl⟩ + +/-- preimage trick: a set of ρ-rows all realised by held rows is ρ of a set of held rows. -/ +lemma image_pre (c : C) (Y : Set (Reg → K)) + (hY : ∀ v ∈ Y, ∃ u ∈ heldAt ini w c, rhoH H u = v) : + rhoH H '' {u | u ∈ heldAt ini w c ∧ rhoH H u ∈ Y} = Y := by + ext v; constructor + · rintro ⟨u, ⟨-, hu⟩, rfl⟩; exact hu + · intro hv; obtain ⟨u, hu, rfl⟩ := hY v hv; exact ⟨u, ⟨hu, hv⟩, rfl⟩ + +/-! ## 6. The three kept row families as theorems about the word -/ + +/-- **R1 (λ rows), on the word.** For every class-K word and every chart c: +hd(c) ≥ rank(ρK_c + ρR(c)) − ka − oa − kb, with K_c, R(c), ka, oa, kb the class-K data. -/ +theorem R1_row (hK : ClassK Pub H Kfin ini w D) (c : C) : + (finrank K (span K (D.Kρ c) ⊔ span K (D.Rρ c) : Submodule K (Reg → K)) : ℤ) + - D.ka c - D.oa c - D.kb c ≤ hdW H ini w c := by + have hY : ∀ v ∈ D.Kρ c ∪ D.Rρ c, ∃ u ∈ heldAt ini w c, rhoH H u = v := by + rintro v (hv | hv) + · exact K_held hK c v hv + · exact R_held hK c v hv + have h := chart_floor_word hK.acc c {u | u ∈ heldAt ini w c ∧ rhoH H u ∈ D.Kρ c ∪ D.Rρ c} + (fun u hu => hu.1) + rw [image_pre c _ hY, span_union] at h + have := hK.kept_ka c; have := hK.kept_oa c; have := hK.kept_kb c + omega + +/-! Descent data on the word. -/ + +/-- helper MOVEs into c (the arrivals HelpArr_c; all of them, not a basis). -/ +def HBw (H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) (c : C) : + Set (Mv K Reg C) := + {m | m ∈ moves (s0 ini) w ∧ m.reg ∈ H ∧ m.head = c} + +/-- P(c) = ρ(S_c). -/ +def Pw (H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) (c : C) : + Submodule K (Reg → K) := + (span K (heldAt ini w c)).map (rhoH H) + +open ExportLaw in +/-- **hP, derived (R0(a))**: ρ(S_c) ⊆ span ρK_c + span ρ(helper arrival rows at c). -/ +theorem hP_word (hK : ClassK Pub H Kfin ini w D) (c : C) : + Pw H ini w c ≤ span K (D.Kρ c) ⊔ span K ((fun m => rhoH H m.row) '' HBw H ini w c) := by + classical + obtain ⟨hL, -⟩ := proj_legal Pub c ini w hK.acc.legal + set N := (span K (D.Kρ c) ⊔ span K ((fun m => rhoH H m.row) '' HBw H ini w c)).comap (rhoH H) + have hArr : ∀ v ∈ keptArr H ini w c, v ∈ span K (D.Kρ c) := fun v hv => by + by_cases h0 : v = 0 + · rw [h0]; exact zero_mem _ + · exact subset_span (hK.kept_K1 c v hv h0) + have hent : ∀ v ∈ entRows (proj c ini w), v ∈ N := by + intro v hv + rw [proj, entRows_append, List.mem_append] at hv + simp only [N, Submodule.mem_comap] + rcases hv with hv | hv + · unfold births at hv + obtain ⟨r, hr, rfl⟩ := entRows_born _ v hv + have hr' : ini r = some c := by simpa [bornAt] using hr + by_cases hrH : r ∈ H + · rw [rhoH_single H r hrH]; exact zero_mem _ + · exact mem_sup_left (hArr _ (Or.inr ⟨r, hrH, hr', rfl⟩)) + · rcases entRows_proj Pub c _ w hK.acc.legal v hv with rfl | ⟨m, hm, hmc, rfl⟩ + · rw [map_zero]; exact zero_mem _ + · by_cases hmH : m.reg ∈ H + · exact mem_sup_right (subset_span ⟨m, ⟨hm, hmH, hmc⟩, rfl⟩) + · exact mem_sup_left (hArr _ (Or.inl ⟨m, hm, hmH, hmc, rfl⟩)) + have hheld : heldAt ini w c ⊆ N := + forward_span N start _ hL (by simp [cur, start]) hent + rw [Pw, Submodule.map_le_iff_le_comap] + exact span_le.2 hheld + +/-- **hvec, derived**: a helper arrival row was held at its tail, which is strictly below the head +(l.51, helpers are public). -/ +theorem hvec_word (hA : Accepted Pub H ini w) (c : C) : + ∀ m ∈ HBw H ini w c, rhoH H m.row ∈ Pw H ini w m.tail ∧ m.tail < c := by + rintro m ⟨hm, hmH, rfl⟩ + obtain ⟨-, hpub, -⟩ := moves_facts Pub _ w hA.legal m hm + exact ⟨⟨m.row, subset_span (tail_held hA m hm), rfl⟩, hpub (hA.helpers_pub hmH)⟩ + +lemma kills_span {X : Set (Reg → K)} (ψ : (Reg → K) →ₗ[K] K) (h : ∀ x ∈ X, ψ x = 0) : + ∀ x ∈ span K X, ψ x = 0 := fun x hx => + LinearMap.mem_ker.1 ((span_le.2 fun y hy => LinearMap.mem_ker.2 (h y hy) : + span K X ≤ LinearMap.ker ψ) hx) + +/-- **F4 / R2 (u rows), on the word.** A certified single-source commodity (t, s, ψ): ψ kills +ρK_t and every ρK_{s'} with s' < t, s' ≠ s, and sees some kept row n ∈ ρR(t). Then every class-K +word has a helper MOVE out of s itself into some c with s < c ≤ t whose ρ-row ψ sees (its first hop). -/ +theorem F4_row [WellFoundedLT C] (hK : ClassK Pub H Kfin ini w D) (ψ : (Reg → K) →ₗ[K] K) + (s t : C) (hKt : ∀ x ∈ D.Kρ t, ψ x = 0) + (hW : ∀ s', s' < t → s' ≠ s → ∀ x ∈ D.Kρ s', ψ x = 0) + (n : Reg → K) (hn : n ∈ D.Rρ t) (hψn : ψ n ≠ 0) : + ∃ m ∈ moves (s0 ini) w, m.reg ∈ H ∧ m.tail = s ∧ s < m.head ∧ m.head ≤ t ∧ + ψ (rhoH H m.row) ≠ 0 := by + obtain ⟨u, hu, rfl⟩ := R_held hK t n hn + obtain ⟨c₁, m, ⟨hm, hmH, rfl⟩, htail, hψ, hlt, hle⟩ := + Floor.F4_single_source (KA := fun c => span K (D.Kρ c)) (P := Pw H ini w) + (HB := HBw H ini w) (tail := Mv.tail) (vec := fun m => rhoH H m.row) + (hP_word hK) (hvec_word hK.acc) ψ s t (kills_span ψ hKt) + (fun s' h1 h2 => kills_span ψ (hW s' h1 h2)) _ ⟨u, subset_span hu, rfl⟩ hψn + exact ⟨m, hm, hmH, htail, hlt, hle, hψ⟩ + +/-- **R3 (α and β rows), on the word.** Helper MOVEs mv_j into c from pairwise distinct tails, each +serving a certified commodity (t_j, tail_j, ψ_j) with c ≤ t_j: ψ_j kills ρK_{c'} for all c' ≤ t_j, +c' ≠ tail_j, and sees the hop's ρ-row. Let RA ⊆ ρR(c) be killed by every ψ_j. Then +hd(c) ≥ rank(ρK_c + RA) − ka − oa − kb + #hops. +RA = ∅: α row (hd ≥ #hops − slr). RA = ρR(c) (every hop type A at c): β row (hd ≥ needR + #A-hops). -/ +theorem R3_row [WellFoundedLT C] (hK : ClassK Pub H Kfin ini w D) (c : C) {ι : Type*} [Fintype ι] + (mv : ι → Mv K Reg C) (hmv : ∀ j, mv j ∈ HBw H ini w c) + (hinj : Function.Injective fun j => (mv j).tail) (t : ι → C) (ψ : ι → (Reg → K) →ₗ[K] K) + (hψK : ∀ i c', c' ≤ t i → c' ≠ (mv i).tail → ∀ x ∈ D.Kρ c', ψ i x = 0) + (hct : ∀ j, c ≤ t j) (hdiag : ∀ j, ψ j (rhoH H (mv j).row) ≠ 0) + (RA : Set (Reg → K)) (hRA : RA ⊆ D.Rρ c) (hψR : ∀ i, ∀ x ∈ RA, ψ i x = 0) : + (finrank K (span K (D.Kρ c) ⊔ span K RA : Submodule K (Reg → K)) : ℤ) + - D.ka c - D.oa c - D.kb c + Fintype.card ι ≤ hdW H ini w c := by + classical + have hv := hvec_word hK.acc c + have hind : Floor.IndepMod (span K (D.Kρ c) ⊔ span K RA) (fun j => rhoH H (mv j).row) := + Floor.R3_indep (fun c => span K (D.Kρ c)) (span K RA) c (fun j => (mv j).tail) t hinj + (fun j => rhoH H (mv j).row) ψ (fun i c' h1 h2 => kills_span (ψ i) (hψK i c' h1 h2)) + (fun i => kills_span (ψ i) (hψR i)) (fun j => (hv _ (hmv j)).2) hct hdiag + (fun j => Floor.R0b (KA := fun c => span K (D.Kρ c)) (P := Pw H ini w) + (HB := HBw H ini w) (tail := Mv.tail) (vec := fun m => rhoH H m.row) + (hP_word hK) (hvec_word hK.acc) _ (hv _ (hmv j)).1) + have hY : ∀ v ∈ D.Kρ c ∪ RA, ∃ u ∈ heldAt ini w c, rhoH H u = v := by + rintro v (hv | hv) + · exact K_held hK c v hv + · exact R_held hK c v (hRA hv) + have hrow : ∀ j, (mv j).row ∈ heldAt ini w c := fun j => by + obtain ⟨hm, -, hc⟩ := hmv j + rw [← hc]; exact move_held hK.acc _ hm + have hX : {u | u ∈ heldAt ini w c ∧ rhoH H u ∈ D.Kρ c ∪ RA} ∪ Set.range (fun j => (mv j).row) + ⊆ heldAt ini w c := Set.union_subset (fun u hu => hu.1) (by rintro _ ⟨j, rfl⟩; exact hrow j) + have h := chart_floor_word hK.acc c _ hX + rw [Set.image_union, image_pre c _ hY, span_union, span_union, ← Set.range_comp] at h + have := Floor.finrank_sup_of_indepMod _ _ hind + simp only [Function.comp_def] at h + have := hK.kept_ka c; have := hK.kept_oa c; have := hK.kept_kb c + omega + +/-! ## 7. hd(c) is the fibre of the global stay list -/ + +open ExportLaw in +lemma bornSet_proj (c : C) : bornSet (proj (K := K) c ini w) = bornAt c ini := by + rw [proj, bornSet_append, births, bornSet_born, bornSet_projFrom, Finset.union_empty, + Finset.toList_toFinset] + +section Stays +variable [Fintype C] + +/-- the paid helper stays of the word: (helper h, chart c) with h arriving at c (not born there) +and later leaving. Each helper visits each chart at most once (hOnce from l.51), so these are +distinct stays. -/ +noncomputable def stays (H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) : + Finset (Reg × C) := + by classical exact univ.filter fun p => p.1 ∈ H ∧ ini p.1 ≠ some p.2 ∧ + 0 < ExportLaw.nDep {p.1} (proj p.2 ini w) + +open ExportLaw in +/-- **hd/fibre identity, derived**: FloorGlue's per-chart hd(c) (helper departures − hb) is the +number of global stays at c. -/ +theorem hd_fibre (hA : Accepted Pub H ini w) (c : C) : + ((stays H ini w).filter fun p => p.2 = c).card = hdW H ini w c := by + classical + obtain ⟨hL, -⟩ := proj_legal Pub c ini w hA.legal + have hB := bornSet_proj (K := K) (ini := ini) (w := w) c + have hone : ∀ h ∈ H, nEnt {h} (proj c ini w) ≤ 1 := fun h hh => + hOnce_proj Pub c ini w hA.legal h (hA.helpers_pub hh) ((hA.pub_ini h).1 (hA.helpers_pub hh)) + have hst : ∀ h, nEnt {h} (proj c ini w) = nDep {h} (proj c ini w) + + ((run start (proj c ini w)).pres ∩ {h}).card := fun h => FloorGlue.stay_one _ hL h + have hsum : nDep H (proj c ini w) = + (H.filter fun h => 0 < nDep {h} (proj c ini w)).card := by + rw [nDep_eq_sum, Finset.card_filter] + refine Finset.sum_congr rfl fun h hh => ?_ + have := hone h hh; have := hst h + split_ifs with hp <;> omega + have hsplit := Finset.card_filter_add_card_filter_not + (s := H.filter fun h => 0 < nDep {h} (proj c ini w)) (fun h => h ∈ bornAt c ini) + have hb : ((H.filter fun h => 0 < nDep {h} (proj c ini w)).filter fun h => h ∈ bornAt c ini) = + (H ∩ bornSet (proj c ini w)) \ (run start (proj c ini w)).pres := by + ext h + simp only [Finset.mem_filter, Finset.mem_sdiff, Finset.mem_inter, hB] + constructor + · rintro ⟨⟨hh, hp⟩, hb⟩ + refine ⟨⟨hh, hb⟩, fun hF => ?_⟩ + have h1 := hone h hh; have h2 := hst h + have : ((run start (proj c ini w)).pres ∩ {h}).card = 1 := by + rw [Finset.inter_singleton_of_mem hF]; rfl + omega + · rintro ⟨⟨hh, hb⟩, hF⟩ + have h0 := FloorGlue.one_le_nEnt_of_born (K := K) (proj c ini w) h (hB ▸ hb) + have h2 := hst h + have : ((run start (proj c ini w)).pres ∩ {h}).card = 0 := by + rw [Finset.inter_singleton_of_notMem hF]; rfl + exact ⟨⟨hh, by omega⟩, hb⟩ + have hf : ((stays H ini w).filter fun p => p.2 = c).card = + ((H.filter fun h => 0 < nDep {h} (proj c ini w)).filter + fun h => ¬ h ∈ bornAt c ini).card := by + apply Finset.card_nbij' (fun p => p.1) (fun h => (h, c)) + · rintro ⟨h, c'⟩ hp + simp only [stays, Finset.coe_filter, Finset.mem_filter, Finset.mem_univ, true_and, + Set.mem_ofPred_eq] at hp + obtain ⟨⟨hh, hini, hpos⟩, rfl⟩ := hp + simp only [Finset.coe_filter, Finset.mem_filter, bornAt, Finset.mem_univ, true_and, + Set.mem_ofPred_eq] + exact ⟨⟨hh, hpos⟩, hini⟩ + · intro h hp + simp only [Finset.coe_filter, Finset.mem_filter, bornAt, Finset.mem_univ, true_and, + Set.mem_ofPred_eq] at hp + obtain ⟨⟨hh, hpos⟩, hini⟩ := hp + simp only [stays, Finset.coe_filter, Finset.mem_filter, Finset.mem_univ, true_and, + Set.mem_ofPred_eq] + exact ⟨⟨hh, hini, hpos⟩, by simp⟩ + · rintro ⟨h, c'⟩ hp + simp only [stays, Finset.coe_filter, Finset.mem_filter, Set.mem_ofPred_eq] at hp + simp [hp.2] + · intro h _; rfl + unfold hdW + rw [hf] + rw [hb] at hsplit + omega + +/-- Σ_c hd(c) = #stays. -/ +theorem sum_hd (hA : Accepted Pub H ini w) : + ∑ c, hdW H ini w c = (stays H ini w).card := by + classical + rw [Finset.card_eq_sum_card_fiberwise (f := Prod.snd) (t := univ) (fun _ _ => Finset.mem_univ _)] + exact Finset.sum_congr rfl fun c _ => (hd_fibre hA c).symm + +end Stays + +/-! ## 7b. The literal kept counts (as the data defines them) qualify for class K -/ + +section Counts +open ExportLaw + +/-- INITs of registers in S at chart c. -/ +def nInitG (S : Finset Reg) (c : C) : List (GEv K Reg C) → ℕ + | [] => 0 + | .init o c' :: es => (if o ∈ S ∧ c' = c then 1 else 0) + nInitG S c es + | _ :: es => nInitG S c es + +theorem nEnt_projFrom_le (Pub S : Finset Reg) (c : C) : ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), + LegalG Pub s w → nEnt S (projFrom c s w) ≤ + nInitG S c w + (moves s w).countP (fun m => decide (m.reg ∈ S ∧ m.head = c)) + | s, [], _ => by simp [projFrom, nEnt] + | s, e :: es, ⟨he, hL⟩ => by + have ih := nEnt_projFrom_le Pub S c _ es hL + simp only [projFrom, nEnt_append, moves, List.countP_append] + cases e with + | init o c' => + have h1 : nEnt S (pev c s (.init o c')) = if o ∈ S ∧ c' = c then 1 else 0 := by + by_cases h : c' = c <;> by_cases ho : o ∈ S <;> simp [pev, nEnt, h, ho] + simp only [nInitG, mvOf, List.countP_nil]; rw [h1]; split_ifs <;> omega + | move r c' => + obtain ⟨a, ha, -, -⟩ := he + have h1 : nEnt S (pev c s (.move r c')) = if r ∈ S ∧ c' = c then 1 else 0 := by + by_cases h : s.loc r = some c <;> by_cases h' : c' = c <;> by_cases hr : r ∈ S <;> + simp [pev, nEnt, h, h', hr] + have h2 : (mvOf s (.move r c')).countP (fun m => decide (m.reg ∈ S ∧ m.head = c)) = + if r ∈ S ∧ c' = c then 1 else 0 := by + simp only [mvOf, ha]; by_cases h' : c' = c <;> by_cases hr : r ∈ S <;> simp [h', hr] + simp only [nInitG]; rw [h1, h2]; split_ifs <;> omega + | clear o => + have h1 : nEnt S (pev c s (.clear o)) = 0 := by + by_cases h : s.loc o = some c <;> simp [pev, nEnt, h] + simp only [nInitG, mvOf, List.countP_nil]; rw [h1]; omega + | add i j x => + have h1 : nEnt S (pev c s (.add i j x)) = 0 := by + by_cases h : s.loc i = some c <;> simp [pev, nEnt, h] + simp only [nInitG, mvOf, List.countP_nil]; rw [h1]; omega + | scale i u => + have h1 : nEnt S (pev c s (.scale i u)) = 0 := by + by_cases h : s.loc i = some c <;> simp [pev, nEnt, h] + simp only [nInitG, mvOf, List.countP_nil]; rw [h1]; omega + | copy i j x => + have h1 : nEnt S (pev c s (.copy i j x)) = 0 := by + by_cases h : s.loc i = some c <;> simp [pev, nEnt, h] + simp only [nInitG, mvOf, List.countP_nil]; rw [h1]; omega + +theorem nInitG_le_count (S : Finset Reg) (c : C) : ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), + nInitG S c w ≤ (entRows (projFrom c s w)).count 0 + | s, [] => by simp [nInitG] + | s, e :: es => by + have ih := nInitG_le_count S c (gstep s e) es + simp only [projFrom, entRows_append, List.count_append] + cases e with + | init o c' => + simp only [nInitG] + by_cases h : c' = c + · have : (entRows (pev c s (.init o c'))).count 0 = 1 := by simp [pev, h, entRows] + rw [this]; split_ifs <;> omega + · simp only [h, and_false, if_false]; omega + | move _ _ => simp only [nInitG]; omega + | clear _ => simp only [nInitG]; omega + | add _ _ _ => simp only [nInitG]; omega + | scale _ _ => simp only [nInitG]; omega + | copy _ _ _ => simp only [nInitG]; omega + +theorem nInitG_pub (Pub S : Finset Reg) (hS : S ⊆ Pub) (c : C) : + ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), LegalG Pub s w → nInitG S c w = 0 + | s, [], _ => rfl + | s, e :: es, ⟨he, hL⟩ => by + have ih := nInitG_pub Pub S hS c _ es hL + cases e with + | init o c' => + have : o ∉ S := fun h => he.1 (hS h) + simp [nInitG, this, ih] + | move _ _ => simpa [nInitG] using ih + | clear _ => simpa [nInitG] using ih + | add _ _ _ => simpa [nInitG] using ih + | scale _ _ => simpa [nInitG] using ih + | copy _ _ _ => simpa [nInitG] using ih + +/-- the data's ka: kept public MOVE arrivals into c (indep_word.py `nka`). -/ +def kaM (Pub H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) (c : C) : ℕ := + (moves (s0 ini) w).countP fun m => decide (m.reg ∈ Pub \ H ∧ m.head = c) +/-- the data's oa: owned MOVE arrivals into c (indep_word.py `noa`; INITs not counted). -/ +def oaM (Pub : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) (c : C) : ℕ := + (moves (s0 ini) w).countP fun m => decide (m.reg ∈ univ \ Pub ∧ m.head = c) +/-- the data's kb: kept public registers born at c (indep_word.py `nkb`). -/ +def kbM (Pub H : Finset Reg) (ini : Reg → Option C) (c : C) : ℕ := + ((Pub \ H).filter fun r => ini r = some c).card + +lemma nEnt_births_zero (S : Finset Reg) (c : C) (hS : ∀ r ∈ S, ini r ≠ some c) : + nEnt S (births (K := K) c ini) = 0 := by + rw [births, nEnt_born _ _ (Finset.nodup_toList _), Finset.toList_toFinset, Finset.card_eq_zero, + Finset.eq_empty_iff_forall_notMem] + intro r hr + obtain ⟨h1, h2⟩ := Finset.mem_inter.1 hr + exact hS r h2 (by simpa [bornAt] using h1) + +theorem kaW_le (hA : Accepted Pub H ini w) (c : C) : kaW Pub H ini w c ≤ kaM Pub H ini w c := by + classical + unfold kaW + rw [bornSet_proj] + have key : ∀ i ∉ bornAt c ini, nEnt {i} (proj (K := K) c ini w) = + nEnt {i} (projFrom c (s0 ini) w) := by + intro i hi + rw [proj, nEnt_append, nEnt_births_zero {i} c (by + intro r hr; rw [Finset.mem_singleton] at hr; subst hr; simpa [bornAt] using hi), zero_add] + have h1 : (((Pub \ H) \ bornAt c ini).filter fun i => 0 < nEnt {i} (proj c ini w)).card ≤ + ∑ i ∈ (Pub \ H) \ bornAt c ini, nEnt {i} (projFrom c (s0 ini) w) := by + rw [Finset.card_filter] + refine Finset.sum_le_sum fun i hi => ?_ + rw [key i (Finset.mem_sdiff.1 hi).2] + split_ifs <;> omega + have h2 : ∑ i ∈ (Pub \ H) \ bornAt c ini, nEnt {i} (projFrom c (s0 ini) w) ≤ + ∑ i ∈ Pub \ H, nEnt {i} (projFrom c (s0 ini) w) := + Finset.sum_le_sum_of_subset Finset.sdiff_subset + have h3 := nEnt_projFrom_le Pub (Pub \ H) c (s0 ini) w hA.legal + rw [nInitG_pub Pub (Pub \ H) Finset.sdiff_subset c _ w hA.legal, zero_add] at h3 + have h4 := FloorGlue.nEnt_eq_sum (Pub \ H) (projFrom c (s0 ini) w) + unfold kaM + omega + +theorem oaW_le (hA : Accepted Pub H ini w) (c : C) : oaW Pub ini w c ≤ oaM Pub ini w c := by + classical + unfold oaW oaM + rw [proj, nEnt_append, nEnt_births_zero (univ \ Pub) c (by + intro r hr hc + exact (Finset.mem_sdiff.1 hr).2 ((hA.pub_ini r).2 (by rw [hc]; simp))), zero_add, + entRows_append, List.count_append] + have h1 := nEnt_projFrom_le Pub (univ \ Pub) c (s0 ini) w hA.legal + have h2 := nInitG_le_count (univ \ Pub) c (s0 ini) w + omega + +theorem kbW_eq (c : C) : kbW Pub H ini w c = kbM Pub H ini c := by + unfold kbW kbM + rw [bornSet_proj] + congr 1; ext r; simp [bornAt] + +/-- **The literal class K qualifies**: an accepted word whose kept ρ-content and kept rows are D's +(K1, K2, R) and whose kept public MOVE arrivals, owned MOVE arrivals and kept births per chart are +D's counts (the definitions used by rsdata.py / indep_word.py) is in ClassK D. -/ +theorem classK_of_counts {Kfin : Finset Reg} {D : KData C (Reg → K)} (hA : Accepted Pub H ini w) + (hK1 : ∀ c, ∀ v ∈ keptArr H ini w c, v ≠ 0 → v ∈ D.Kρ c) + (hK2 : ∀ c, D.Kρ c ⊆ keptArr H ini w c ∪ keptFin H Kfin ini w c) + (hR : ∀ c, D.Rρ c ⊆ keptSnap H ini w c) + (hka : ∀ c, D.ka c = kaM Pub H ini w c) (hoa : ∀ c, D.oa c = oaM Pub ini w c) + (hkb : ∀ c, D.kb c = kbM Pub H ini c) : ClassK Pub H Kfin ini w D := + ⟨hA, hK1, hK2, hR, fun c => (hka c).symm ▸ kaW_le hA c, fun c => (hoa c).symm ▸ oaW_le hA c, + fun c => (hkb c).symm ▸ (kbW_eq c).le⟩ + +end Counts + +/-! ## 8. The LP point x(word): rows α, β, γ, λ, u and the objective + +LP data as parameters: commodities `Q` (target `tQ`, source `sQ`, functional `ψQ`), the Nat charts, +the type-A relation, and fresh minimal heads `head s c` (an index type `M` of head columns). +Variables: y_c (c ∈ Nat), z_{s,c}, a_{s,c}, x_m. -/ +section LP +variable {Q M : Type*} [Fintype C] [Fintype Q] [Fintype M] + (D : KData C (Reg → K)) (tQ sQ : Q → C) (ψQ : Q → (Reg → K) →ₗ[K] K) + +/-- a certified single-source commodity (RANKSTEINER R2 / FANOUT F4; rsess.py's exact check). -/ +def Certified (k : Q) : Prop := + (∀ x ∈ D.Kρ (tQ k), ψQ k x = 0) ∧ + (∀ s', s' < tQ k → s' ≠ sQ k → ∀ x ∈ D.Kρ s', ψQ k x = 0) ∧ + ∃ n ∈ D.Rρ (tQ k), ψQ k n ≠ 0 + +/-- hop m (a helper MOVE into c) serves commodity k at c. -/ +def Serves (H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) (k : Q) (c : C) + (m : Mv K Reg C) : Prop := + m ∈ HBw H ini w c ∧ m.tail = sQ k ∧ c ≤ tQ k ∧ ψQ k (rhoH H m.row) ≠ 0 + +/-- sources s with a hop s → c serving some commodity of source s that satisfies `Pk`. -/ +noncomputable def srcs (H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) + (Pk : Q → Prop) (c : C) : Finset C := + by classical exact univ.filter fun s => ∃ k m, sQ k = s ∧ Pk k ∧ Serves tQ sQ ψQ H ini w k c m + +variable (NC : Finset C) (TypeA : Q → C → Prop) (head : C → C → M) + +/-- the word's LP point (as in rsnative.py / NativeFeas): y = hd on NC, z/a = first-hop +indicators, x = indicator of a fresh head used by a hop into a non-NC chart. -/ +noncomputable def zv (H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) + (s c : C) : ℕ := + by classical exact if s ∈ srcs tQ sQ ψQ H ini w (fun _ => True) c then 1 else 0 +noncomputable def av (H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) + (s c : C) : ℕ := + by classical exact if s ∈ srcs tQ sQ ψQ H ini w (fun k => TypeA k c) c then 1 else 0 +/-- head m is used by some hop s → c into a non-Nat chart. -/ +def headUsed (H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) (m : M) : Prop := + ∃ s c, c ∉ NC ∧ head s c = m ∧ s ∈ srcs tQ sQ ψQ H ini w (fun _ => True) c + +noncomputable def xv (H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) + (m : M) : ℕ := + by classical exact if headUsed tQ sQ ψQ NC head H ini w m then 1 else 0 + +open scoped Classical in +/-- the u-row term of chart c for commodity k: a_{s,c} if k is type A at c, else z_{s,c}. -/ +noncomputable def uterm (H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) + (k : Q) (c : C) : ℕ := + if TypeA k c then av tQ sQ ψQ TypeA H ini w (sQ k) c else zv tQ sQ ψQ H ini w (sQ k) c + +variable {D tQ sQ ψQ} + +/-- the counting core of α, β and the objective: R3_row on one chosen hop per source. -/ +theorem card_srcs [WellFoundedLT C] (hK : ClassK Pub H Kfin ini w D) + (hcert : ∀ k, Certified D tQ sQ ψQ k) (c : C) (Pk : Q → Prop) + (RA : Set (Reg → K)) (hRA : RA ⊆ D.Rρ c) (hPA : ∀ k, Pk k → ∀ x ∈ RA, ψQ k x = 0) : + (finrank K (span K (D.Kρ c) ⊔ span K RA : Submodule K (Reg → K)) : ℤ) + - D.ka c - D.oa c - D.kb c + (srcs tQ sQ ψQ H ini w Pk c).card ≤ hdW H ini w c := by + classical + set S := srcs tQ sQ ψQ H ini w Pk c + have hS : ∀ s : S, ∃ k m, sQ k = s.1 ∧ Pk k ∧ Serves tQ sQ ψQ H ini w k c m := fun s => by + have := s.2; simp only [S, srcs, Finset.mem_filter, Finset.mem_univ, true_and] at this + exact this + choose kk mm hkk using hS + have h := R3_row hK c (ι := S) (fun j => mm j) (fun j => (hkk j).2.2.1) + (by + intro i j hij + have hi := (hkk i).2.2.2.1; have hj := (hkk j).2.2.2.1 + have := (hkk i).1; have := (hkk j).1 + apply Subtype.ext + simp only at hij + rw [← (hkk i).1, ← (hkk j).1, ← hi, ← hj, hij]) + (fun j => tQ (kk j)) (fun j => ψQ (kk j)) + (by + intro i c' h1 h2 x hx + have htail : (mm i).tail = sQ (kk i) := (hkk i).2.2.2.1 + rw [htail] at h2 + rcases h1.lt_or_eq with h1 | h1 + · exact (hcert (kk i)).2.1 c' h1 h2 x hx + · subst h1; exact (hcert (kk i)).1 x hx) + (fun j => (hkk j).2.2.2.2.1) (fun j => (hkk j).2.2.2.2.2) RA hRA + (fun i => hPA (kk i) (hkk i).2.1) + simpa [Fintype.card_coe] using h + +lemma sum_ind {α : Type*} [Fintype α] (S : Finset α) [DecidablePred (· ∈ S)] : + (∑ a, if a ∈ S then (1 : ℕ) else 0) = S.card := by + classical + rw [Finset.sum_boole]; simp + +/-- **λ row** (y_c ≥ L_c = max(0, needR_c); needK ≤ max(0, needR) on #7623's data). -/ +theorem lam_row (hK : ClassK Pub H Kfin ini w D) (c : C) : + max 0 ((finrank K (span K (D.Kρ c) ⊔ span K (D.Rρ c) : Submodule K (Reg → K)) : ℤ) + - D.ka c - D.oa c - D.kb c) ≤ hdW H ini w c := + max_le (by positivity) (R1_row hK c) + +/-- **α row**: y_c ≥ Σ_s z_{s,c} − slr_c, slr_c = ka + oa + kb − rank ρK_c. -/ +theorem alpha_row [WellFoundedLT C] (hK : ClassK Pub H Kfin ini w D) + (hcert : ∀ k, Certified D tQ sQ ψQ k) (c : C) : + ((∑ s, zv tQ sQ ψQ H ini w s c : ℕ) : ℤ) + - ((D.ka c + D.oa c + D.kb c : ℕ) - (finrank K (span K (D.Kρ c)) : ℤ)) ≤ hdW H ini w c := by + classical + have h := card_srcs hK hcert c (fun _ => True) ∅ (Set.empty_subset _) (by simp) + rw [span_empty, sup_bot_eq] at h + have hz : (∑ s, zv tQ sQ ψQ H ini w s c) = (srcs tQ sQ ψQ H ini w (fun _ => True) c).card := by + rw [← sum_ind]; rfl + rw [hz]; push_cast; omega + +/-- **β row**: y_c ≥ needR_c + Σ_s a_{s,c} (type A: the commodity's ψ kills ρR(c)). -/ +theorem beta_row [WellFoundedLT C] (hK : ClassK Pub H Kfin ini w D) + (hcert : ∀ k, Certified D tQ sQ ψQ k) + (hA : ∀ k c, TypeA k c → ∀ x ∈ D.Rρ c, ψQ k x = 0) (c : C) : + (finrank K (span K (D.Kρ c) ⊔ span K (D.Rρ c) : Submodule K (Reg → K)) : ℤ) + - D.ka c - D.oa c - D.kb c + ((∑ s, av tQ sQ ψQ TypeA H ini w s c : ℕ) : ℤ) + ≤ hdW H ini w c := by + classical + have h := card_srcs hK hcert c (fun k => TypeA k c) (D.Rρ c) le_rfl (fun k hk => hA k c hk) + have ha : (∑ s, av tQ sQ ψQ TypeA H ini w s c) = + (srcs tQ sQ ψQ H ini w (fun k => TypeA k c) c).card := by + rw [← sum_ind]; rfl + rw [ha]; exact h + +/-- **γ row**: z ≥ a. -/ +theorem gamma_row (s c : C) : av tQ sQ ψQ TypeA H ini w s c ≤ zv tQ sQ ψQ H ini w s c := by + classical + unfold av zv + split_ifs with h1 h2 <;> try omega + exfalso; apply h2 + simp only [srcs, Finset.mem_filter, Finset.mem_univ, true_and] at h1 ⊢ + obtain ⟨k, m, h1, -, h3⟩ := h1 + exact ⟨k, m, h1, h3⟩ + +open scoped Classical in +/-- **u row** (F4 covering): for a certified commodity k, the first hop out of sQ k covers it: +Σ_{c ∈ NC, s < c ≤ t} (a_{s,c} if k is type A at c, else z_{s,c}) + Σ_{m ∈ heads k} x_m ≥ 1, +for any head column set containing head(s, c) for every non-NC c with s < c ≤ t. -/ +theorem u_row [WellFoundedLT C] (hK : ClassK Pub H Kfin ini w D) (k : Q) + (hk : Certified D tQ sQ ψQ k) (heads : Finset M) + (hheads : ∀ c, c ∉ NC → sQ k < c → c ≤ tQ k → head (sQ k) c ∈ heads) : + 1 ≤ (∑ c ∈ NC.filter (fun c => sQ k < c ∧ c ≤ tQ k), uterm tQ sQ ψQ TypeA H ini w k c) + + ∑ m ∈ heads, xv tQ sQ ψQ NC head H ini w m := by + classical + obtain ⟨hKt, hW, n, hn, hψn⟩ := hk + obtain ⟨m, hm, hmH, htail, hlt, hle, hψ⟩ := F4_row hK (ψQ k) (sQ k) (tQ k) hKt hW n hn hψn + have hserv : Serves tQ sQ ψQ H ini w k m.head m := ⟨⟨hm, hmH, rfl⟩, htail, hle, hψ⟩ + have hz : sQ k ∈ srcs tQ sQ ψQ H ini w (fun _ => True) m.head := by + simp only [srcs, Finset.mem_filter, Finset.mem_univ, true_and] + exact ⟨k, m, rfl, hserv⟩ + by_cases hN : m.head ∈ NC + · have hmem : m.head ∈ NC.filter (fun c => sQ k < c ∧ c ≤ tQ k) := + Finset.mem_filter.2 ⟨hN, hlt, hle⟩ + have hterm : 1 ≤ uterm tQ sQ ψQ TypeA H ini w k m.head := by + unfold uterm + split_ifs with hA + · unfold av + rw [if_pos] + simp only [srcs, Finset.mem_filter, Finset.mem_univ, true_and] + exact ⟨k, m, rfl, hA, hserv⟩ + · unfold zv; rw [if_pos (by convert hz)] + have := Finset.single_le_sum (f := fun c => uterm tQ sQ ψQ TypeA H ini w k c) + (fun _ _ => Nat.zero_le _) hmem + exact le_add_right (hterm.trans this) + · have hmem := hheads m.head hN hlt hle + have hx : 1 ≤ xv tQ sQ ψQ NC head H ini w (head (sQ k) m.head) := by + unfold xv; rw [if_pos] + exact ⟨sQ k, m.head, hN, rfl, by convert hz⟩ + have := Finset.single_le_sum (f := fun m => xv tQ sQ ψQ NC head H ini w m) + (fun _ _ => Nat.zero_le _) hmem + exact le_add_left (hx.trans this) + +/-- **objective**: Σ_{c ∈ NC} y_c + Σ_m x_m ≤ #paid stays, when every non-NC chart has slr ≤ 0 +(NC ⊇ {L > 0 or slr ≠ 0}). -/ +theorem objective_le [WellFoundedLT C] (hK : ClassK Pub H Kfin ini w D) + (hcert : ∀ k, Certified D tQ sQ ψQ k) + (hNat : ∀ c, c ∉ NC → D.ka c + D.oa c + D.kb c ≤ finrank K (span K (D.Kρ c))) : + ∑ c ∈ NC, hdW H ini w c + ∑ m, xv tQ sQ ψQ NC head H ini w m ≤ (stays H ini w).card := by + classical + -- non-NC chart: #sources ≤ hd + have hnon : ∀ c, c ∉ NC → (srcs tQ sQ ψQ H ini w (fun _ => True) c).card ≤ hdW H ini w c := by + intro c hc + have h := card_srcs hK hcert c (fun _ => True) ∅ (Set.empty_subset _) (by simp) + rw [span_empty, sup_bot_eq] at h + have := hNat c hc + have h' : ((D.ka c + D.oa c + D.kb c : ℕ) : ℤ) ≤ finrank K (span K (D.Kρ c)) := by exact_mod_cast this + push_cast at h' + omega + set Z := fun c => srcs tQ sQ ψQ H ini w (fun _ => True) c + -- heads used ⊆ image of (s, c) pairs with c ∉ NC + set Pairs := (univ : Finset (C × C)).filter fun p => p.2 ∉ NC ∧ p.1 ∈ Z p.2 + have hx : ∑ m, xv tQ sQ ψQ NC head H ini w m ≤ Pairs.card := by + have e : ∑ m, xv tQ sQ ψQ NC head H ini w m = + ((univ : Finset M).filter fun m => headUsed tQ sQ ψQ NC head H ini w m).card := by + rw [Finset.card_filter]; rfl + rw [e] + refine (Finset.card_le_card (t := Pairs.image fun p => head p.1 p.2) ?_).trans + Finset.card_image_le + · intro m hm + obtain ⟨s, c, hc, rfl, hs⟩ := (Finset.mem_filter.1 hm).2 + exact Finset.mem_image.2 ⟨(s, c), Finset.mem_filter.2 ⟨Finset.mem_univ _, hc, hs⟩, rfl⟩ + have hP : Pairs.card = ∑ c ∈ univ.filter (· ∉ NC), (Z c).card := by + rw [Finset.card_eq_sum_card_fiberwise (f := Prod.snd) (t := univ.filter (· ∉ NC)) + (by + intro p hp + simp only [Pairs, Finset.mem_coe, Finset.mem_filter, Finset.mem_univ, true_and] at hp + simp [hp.1])] + refine Finset.sum_congr rfl fun c hc => ?_ + simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hc + apply Finset.card_nbij' (fun p => p.1) (fun s => (s, c)) + · rintro ⟨s, c'⟩ hp + simp only [Pairs, Finset.coe_filter, Finset.mem_filter, Finset.mem_univ, true_and, + Set.mem_ofPred_eq] at hp + obtain ⟨⟨-, hs⟩, rfl⟩ := hp; exact hs + · intro s hs + simp only [Pairs, Finset.coe_filter, Finset.mem_filter, Finset.mem_univ, true_and, + Set.mem_ofPred_eq] + exact ⟨⟨hc, hs⟩, by simp⟩ + · rintro ⟨s, c'⟩ hp + simp only [Pairs, Finset.coe_filter, Finset.mem_filter, Set.mem_ofPred_eq] at hp + simp [hp.2] + · intro s _; rfl + have hsum := Finset.sum_filter_add_sum_filter_not (univ : Finset C) (· ∈ NC) + (fun c => hdW H ini w c) + have hNat' : ∑ c ∈ NC, hdW H ini w c = ∑ c ∈ univ.filter (· ∈ NC), hdW H ini w c := by + congr 1; ext c; simp + have hle : ∑ c ∈ univ.filter (· ∉ NC), (Z c).card ≤ + ∑ c ∈ univ.filter (· ∉ NC), hdW H ini w c := + Finset.sum_le_sum fun c hc => hnon c (Finset.mem_filter.1 hc).2 + rw [← sum_hd hK.acc] + omega + +end LP + + +/-! ## 9. Direct floor on the word (λ rows only, no LP) -/ + +/-- every class-K word pays cost ≥ κ · Σ_c max(0, needR_c), given per-stay cost ≥ κ. -/ +theorem R1_floor_word {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] [Fintype C] + (hK : ClassK Pub H Kfin ini w D) (cost : Reg × C → 𝕜) (κ : 𝕜) (hκ0 : 0 ≤ κ) + (hκ : ∀ p ∈ stays H ini w, κ ≤ cost p) : + κ * ((∑ c, max 0 ((finrank K (span K (D.Kρ c) ⊔ span K (D.Rρ c) : Submodule K (Reg → K)) : ℤ) + - D.ka c - D.oa c - D.kb c) : ℤ) : 𝕜) ≤ ∑ p ∈ stays H ini w, cost p := by + classical + refine FloorGlue.global_floor_direct univ (stays H ini w) Prod.snd (fun _ _ => Finset.mem_univ _) + _ (fun c _ => ?_) cost κ hκ0 hκ + rw [hd_fibre hK.acc c] + exact lam_row hK c + +end FloorE2E + +#print axioms FloorE2E.step_sim +#print axioms FloorE2E.proj_legal +#print axioms FloorE2E.hOnce_proj +#print axioms FloorE2E.forward_count' +#print axioms FloorE2E.chart_floor_word +#print axioms FloorE2E.R1_row +#print axioms FloorE2E.hP_word +#print axioms FloorE2E.hvec_word +#print axioms FloorE2E.F4_row +#print axioms FloorE2E.R3_row +#print axioms FloorE2E.hd_fibre +#print axioms FloorE2E.sum_hd +#print axioms FloorE2E.classK_of_counts +#print axioms FloorE2E.card_srcs +#print axioms FloorE2E.lam_row +#print axioms FloorE2E.alpha_row +#print axioms FloorE2E.beta_row +#print axioms FloorE2E.gamma_row +#print axioms FloorE2E.u_row +#print axioms FloorE2E.objective_le +#print axioms FloorE2E.R1_floor_word diff --git a/research/p104-lean-premises/lean/Nov15/FloorGlue.lean b/research/p104-lean-premises/lean/Nov15/FloorGlue.lean new file mode 100644 index 0000000000..4ab6071c48 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorGlue.lean @@ -0,0 +1,231 @@ +/- +Floor glue, See FloorGlue.md. + +(1) `entry_count`: Floor's hypothesis `hent` (dim S_c ≤ hd + he + ka + oa + hb + kb) DERIVED from + ExportLaw's one-chart op model (forward span law + stay count) and hOnce for kept registers. +(2) `chart_floor`: Floor.stay_floor instantiated on an ExportLaw run, so the per-chart floor + rank ρ(X) ≤ hd + ka + oa + kb has no op-model hypotheses left beyond class N and ρ. +(3) `sum_chart_floors`, `global_floor_direct`, `global_floor_of_certificate`: summing chart floors + over distinct stays, and the LP certificate on top. What stays input: the LP rows A x ≥ b (with + the native-feasibility map x and objective ≤ #paid stays) and the dual vector y. + +Build: this file imports the oleans of Nov15/ExportLaw.lean and Nov15/Floor.lean: + lake env lean -o .lake/build/lib/lean/Nov15/ExportLaw.olean Nov15/ExportLaw.lean + lake env lean -o .lake/build/lib/lean/Nov15/Floor.olean Nov15/Floor.lean + lake env lean Nov15/FloorGlue.lean +-/ +import Nov15.ExportLaw +import Nov15.Floor + +open Finset Module Submodule + +set_option linter.unusedSectionVars false + +namespace FloorGlue + +open ExportLaw + +section Chart +variable {K Reg : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] + +lemma nEnt_eq_sum (C : Finset Reg) : ∀ evs : List (Ev K Reg), nEnt C evs = ∑ i ∈ C, nEnt {i} evs + | [] => by simp [nEnt] + | .arrive j _ :: evs => by + simp only [nEnt, nEnt_eq_sum C evs, Finset.sum_add_distrib, Finset.mem_singleton] + congr 1 + rw [Finset.sum_ite_eq C j] + | .born j :: evs => by + simp only [nEnt, nEnt_eq_sum C evs, Finset.sum_add_distrib, Finset.mem_singleton] + congr 1 + rw [Finset.sum_ite_eq C j] + | .add _ _ _ :: evs => by simp only [nEnt]; exact nEnt_eq_sum C evs + | .scale _ _ :: evs => by simp only [nEnt]; exact nEnt_eq_sum C evs + | .depart _ :: evs => by simp only [nEnt]; exact nEnt_eq_sum C evs + | .clear _ :: evs => by simp only [nEnt]; exact nEnt_eq_sum C evs + | .copy _ _ :: evs => by simp only [nEnt]; exact nEnt_eq_sum C evs + +lemma one_le_nEnt_of_born : ∀ (evs : List (Ev K Reg)) (b : Reg), b ∈ bornSet evs → + 1 ≤ nEnt {b} evs + | [], b, h => by simp [bornSet] at h + | .born b' :: evs, b, h => by + simp only [bornSet, Finset.mem_insert] at h + simp only [nEnt, Finset.mem_singleton] + rcases h with rfl | h + · simp + · have := one_le_nEnt_of_born evs b h; omega + | .arrive _ _ :: evs, b, h => by + simp only [nEnt]; have := one_le_nEnt_of_born evs b h; omega + | .add _ _ _ :: evs, b, h => by simp only [nEnt]; exact one_le_nEnt_of_born evs b h + | .scale _ _ :: evs, b, h => by simp only [nEnt]; exact one_le_nEnt_of_born evs b h + | .depart _ :: evs, b, h => by simp only [nEnt]; exact one_le_nEnt_of_born evs b h + | .clear _ :: evs, b, h => by simp only [nEnt]; exact one_le_nEnt_of_born evs b h + | .copy _ _ :: evs, b, h => by simp only [nEnt]; exact one_le_nEnt_of_born evs b h + +/-- per-register stay count from the empty state. -/ +lemma stay_one (evs : List (Ev K Reg)) (hL : Legal start evs) (i : Reg) : + nEnt {i} evs = nDep {i} evs + ((run start evs).pres ∩ {i}).card := by + have := stay_count (K := K) {i} start evs hL + have h0 : (start (K := K) (Reg := Reg)).pres = ∅ := rfl + rw [h0] at this + simpa using this + +/-- **Entry count (Floor's `hent`), derived.** One chart, a legal run from the empty state, registers +partitioned into helpers `H`, kept `Kp`, owned `Ow`; hOnce for kept registers. With +hb = helpers born at c and gone at the end, he = helper enders, hd = helper departures − hb +(paid stays), ka = kept registers that arrive (not born at c), kb = kept births, oa = owned entries: +`hb ≤ helper departures` and `dim S_c ≤ hd + he + ka + oa + hb + kb`. -/ +theorem entry_count (evs : List (Ev K Reg)) (hL : Legal start evs) + (H Kp Ow : Finset Reg) (hHK : Disjoint H Kp) (hHO : Disjoint H Ow) (hKO : Disjoint Kp Ow) + (hcov : H ∪ Kp ∪ Ow = univ) (hOnce : ∀ i ∈ Kp, nEnt {i} evs ≤ 1) : + ((H ∩ bornSet evs) \ (run start evs).pres).card ≤ nDep H evs ∧ + finrank K (span K (held start evs)) ≤ + (nDep H evs - ((H ∩ bornSet evs) \ (run start evs).pres).card) + + ((run start evs).pres ∩ H).card + + ((Kp \ bornSet evs).filter fun i => 0 < nEnt {i} evs).card + + nEnt Ow evs + + ((H ∩ bornSet evs) \ (run start evs).pres).card + + (Kp ∩ bornSet evs).card := by + classical + set F := (run (start (K := K) (Reg := Reg)) evs).pres + set HB := (H ∩ bornSet evs) \ F + -- dim S_c ≤ #entries + have fc := forward_count (K := K) LinearMap.id evs hL ∅ (by simp) (by simp) + rw [Submodule.map_id, Finset.card_empty, add_zero] at fc + -- #entries split by class + have hsplit : nEnt univ evs = nEnt H evs + nEnt Kp evs + nEnt Ow evs := by + rw [nEnt_eq_sum, nEnt_eq_sum H, nEnt_eq_sum Kp, nEnt_eq_sum Ow, ← hcov, + Finset.sum_union (Finset.disjoint_union_left.2 ⟨hHO, hKO⟩), + Finset.sum_union hHK] + -- helpers: entries = departures + enders + have hH : nEnt H evs = nDep H evs + (F ∩ H).card := by + have := stay_count (K := K) H start evs hL + have h0 : (start (K := K) (Reg := Reg)).pres = ∅ := rfl + rw [h0] at this; simpa using this + -- hb ≤ helper departures + have hHB : HB.card ≤ nDep H evs := by + have hsub : HB ⊆ H := fun x hx => (Finset.mem_inter.1 (Finset.mem_sdiff.1 hx).1).1 + rw [nDep_eq_sum, Finset.card_eq_sum_ones] + calc ∑ _i ∈ HB, 1 ≤ ∑ i ∈ HB, nDep {i} evs := Finset.sum_le_sum fun i hi => by + obtain ⟨hi1, hiF⟩ := Finset.mem_sdiff.1 hi + have h1 := one_le_nEnt_of_born (K := K) evs i (Finset.mem_inter.1 hi1).2 + have h2 : nEnt {i} evs = nDep {i} evs + (F ∩ {i}).card := stay_one evs hL i + have h3 : (F ∩ {i}).card = 0 := by + rw [Finset.card_eq_zero, Finset.inter_singleton_of_notMem hiF] + omega + _ ≤ ∑ i ∈ H, nDep {i} evs := Finset.sum_le_sum_of_subset hsub + -- kept: entries ≤ ka + kb (hOnce) + have hKp : nEnt Kp evs ≤ ((Kp \ bornSet evs).filter fun i => 0 < nEnt {i} evs).card + + (Kp ∩ bornSet evs).card := by + rw [nEnt_eq_sum] + have h1 : ∑ i ∈ Kp, nEnt {i} evs ≤ (Kp.filter fun i => 0 < nEnt {i} evs).card := by + rw [Finset.card_filter] + exact Finset.sum_le_sum fun i hi => by + have := hOnce i hi + split_ifs with h <;> omega + have h2 : (Kp.filter fun i => 0 < nEnt {i} evs) ⊆ + ((Kp \ bornSet evs).filter fun i => 0 < nEnt {i} evs) ∪ (Kp ∩ bornSet evs) := by + intro i hi + obtain ⟨hiK, hpos⟩ := Finset.mem_filter.1 hi + by_cases hb : i ∈ bornSet evs + · exact Finset.mem_union_right _ (Finset.mem_inter.2 ⟨hiK, hb⟩) + · exact Finset.mem_union_left _ (Finset.mem_filter.2 ⟨Finset.mem_sdiff.2 ⟨hiK, hb⟩, hpos⟩) + exact h1.trans ((Finset.card_le_card h2).trans (Finset.card_union_le _ _)) + refine ⟨hHB, ?_⟩ + omega + +/-- **Per-chart floor on an ExportLaw run.** Floor.stay_floor with `hent` discharged by +`entry_count` and Tok = helper enders ∪ (helpers born at c and gone). Class N: a helper still at c +at the end ends as its own token; ρ kills helper tokens. For any rows X held at c: +`rank ρ(X) ≤ hd + ka + oa + kb`, hd = helper departures − hb (paid helper stays). -/ +theorem chart_floor {W : Type*} [AddCommGroup W] [Module K W] (ρ : (Reg → K) →ₗ[K] W) + (evs : List (Ev K Reg)) (hL : Legal start evs) + (H Kp Ow : Finset Reg) (hHK : Disjoint H Kp) (hHO : Disjoint H Ow) (hKO : Disjoint Kp Ow) + (hcov : H ∪ Kp ∪ Ow = univ) (hOnce : ∀ i ∈ Kp, nEnt {i} evs ≤ 1) + (hN : ∀ h ∈ H, h ∈ (run start evs).pres → (run start evs).row h = Pi.single h 1) + (hρ : ∀ h ∈ H, ρ (Pi.single h 1) = 0) + (X : Set (Reg → K)) (hX : X ⊆ held start evs) : + finrank K (span K (ρ '' X)) ≤ + (nDep H evs - ((H ∩ bornSet evs) \ (run start evs).pres).card) + + ((Kp \ bornSet evs).filter fun i => 0 < nEnt {i} evs).card + + nEnt Ow evs + (Kp ∩ bornSet evs).card := by + classical + set F := (run (start (K := K) (Reg := Reg)) evs).pres + set HB := (H ∩ bornSet evs) \ F + obtain ⟨-, hent⟩ := entry_count evs hL H Kp Ow hHK hHO hKO hcov hOnce + set Tok := (F ∩ H) ∪ HB + have hdisj : Disjoint (F ∩ H) HB := by + rw [Finset.disjoint_left] + intro x hx hx' + exact (Finset.mem_sdiff.1 hx').2 (Finset.mem_inter.1 hx).1 + have hTokc : Tok.card = (F ∩ H).card + HB.card := Finset.card_union_of_disjoint hdisj + have hTokS : ∀ i ∈ Tok, (Pi.single i 1 : Reg → K) ∈ span K (held start evs) := by + intro i hi + apply Submodule.subset_span + rcases Finset.mem_union.1 hi with h | h + · obtain ⟨hF, hH⟩ := Finset.mem_inter.1 h + have : (run start evs).row i ∈ cur (run start evs) := ⟨i, hF, rfl⟩ + rw [hN i hH hF] at this + exact final_sub_held start evs this + · exact born_held start evs i (Finset.mem_inter.1 (Finset.mem_sdiff.1 h).1).2 + have hTokρ : ∀ i ∈ Tok, ρ (Pi.single i 1) = 0 := by + intro i hi + rcases Finset.mem_union.1 hi with h | h + · exact hρ i (Finset.mem_inter.1 h).2 + · exact hρ i (Finset.mem_inter.1 (Finset.mem_sdiff.1 h).1).1 + exact Floor.stay_floor ρ (span K (held start evs)) X Tok _ _ _ _ _ _ + (hX.trans Submodule.subset_span) hTokS hTokρ hTokc hent + +end Chart + +/-! ## Summing chart floors over distinct stays; the global floor -/ +section Global +variable {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] + {C σ : Type*} [DecidableEq C] + +/-- Distinct stays: each paid stay sits at exactly one chart (`at`), so hd(c) = #stays at c and +Σ_c hd(c) = #stays. Per-chart floors L(c) ≤ hd(c) sum to a floor on #stays. -/ +theorem sum_chart_floors (charts : Finset C) (stays : Finset σ) (at_ : σ → C) + (hat : ∀ s ∈ stays, at_ s ∈ charts) (L : C → ℤ) + (hL : ∀ c ∈ charts, L c ≤ (stays.filter fun s => at_ s = c).card) : + ∑ c ∈ charts, L c ≤ stays.card := by + rw [Finset.card_eq_sum_card_fiberwise (f := at_) (t := charts) (fun s hs => hat s hs)] + push_cast + exact Finset.sum_le_sum hL + +/-- each paid stay costs ≥ κ ⇒ total cost ≥ κ · #stays. -/ +theorem cost_ge (stays : Finset σ) (cost : σ → 𝕜) (κ : 𝕜) (hκ : ∀ s ∈ stays, κ ≤ cost s) : + κ * stays.card ≤ ∑ s ∈ stays, cost s := by + have := Finset.card_nsmul_le_sum stays cost κ hκ + rwa [nsmul_eq_mul, mul_comm] at this + +/-- **Global floor, direct.** cost ≥ κ · Σ_c L(c) from per-chart floors L(c) ≤ hd(c). -/ +theorem global_floor_direct (charts : Finset C) (stays : Finset σ) (at_ : σ → C) + (hat : ∀ s ∈ stays, at_ s ∈ charts) (L : C → ℤ) + (hL : ∀ c ∈ charts, L c ≤ (stays.filter fun s => at_ s = c).card) + (cost : σ → 𝕜) (κ : 𝕜) (hκ0 : 0 ≤ κ) (hκ : ∀ s ∈ stays, κ ≤ cost s) : + κ * ((∑ c ∈ charts, L c : ℤ) : 𝕜) ≤ ∑ s ∈ stays, cost s := by + have h1 : ((∑ c ∈ charts, L c : ℤ) : 𝕜) ≤ (stays.card : 𝕜) := by + exact_mod_cast sum_chart_floors charts stays at_ hat L hL + exact (mul_le_mul_of_nonneg_left h1 hκ0).trans (cost_ge stays cost κ hκ) + +/-- **Global floor, LP form.** Floor.floor_of_certificate with HD = #paid stays (distinct stays, +cost ≥ κ each). The remaining checked input is the LP data: the rows `A x ≥ b` satisfied by the +native's x (with objective ≤ #stays), and the dual vector y. -/ +theorem global_floor_of_certificate {r n : Type*} [Fintype r] [Fintype n] + (A : r → n → 𝕜) (b : r → 𝕜) (c : n → 𝕜) (x : n → 𝕜) (y : r → 𝕜) + (hx : ∀ j, 0 ≤ x j) (hAx : ∀ i, b i ≤ ∑ j, A i j * x j) + (hy : ∀ i, 0 ≤ y i) (hyA : ∀ j, ∑ i, y i * A i j ≤ c j) + (stays : Finset σ) (cost : σ → 𝕜) (κ : 𝕜) (hκ0 : 0 ≤ κ) (hκ : ∀ s ∈ stays, κ ≤ cost s) + (hobj : ∑ j, c j * x j ≤ stays.card) : + κ * ∑ i, y i * b i ≤ ∑ s ∈ stays, cost s := + Floor.floor_of_certificate A b c x y hx hAx hy hyA κ _ _ hκ0 hobj (cost_ge stays cost κ hκ) + +end Global + +end FloorGlue + +#print axioms FloorGlue.entry_count +#print axioms FloorGlue.chart_floor +#print axioms FloorGlue.sum_chart_floors +#print axioms FloorGlue.global_floor_direct +#print axioms FloorGlue.global_floor_of_certificate diff --git a/research/p104-lean-premises/lean/Nov15/FloorK22.lean b/research/p104-lean-premises/lean/Nov15/FloorK22.lean new file mode 100644 index 0000000000..04d0aa8468 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorK22.lean @@ -0,0 +1,337 @@ +/- +FloorK22 : WHOLEFLOOR R5's class-K(S22) floor (internal notes, AUDIT5.md). +See FloorK22.md. Kernel only: no sorry, no native_decide. +-/ +import Nov15.FloorD0 +import Nov15.JointCeiling +import Nov15.FloorK22Data +import Mathlib.Analysis.Convex.SpecificFunctions.Pow +import Mathlib.Analysis.Complex.ExponentialBounds + +open Finset + +set_option linter.unusedSectionVars false + +namespace FloorK22 +open FloorE2E FloorD0 FloorK22Data + +/-! ## 0. AUDIT5 scope fix: entry EVENTS vs registers -/ + +section Scope +open ExportLaw +variable {K Reg C : Type*} [Field K] [DecidableEq K] [Fintype Reg] [DecidableEq Reg] + [PartialOrder C] [DecidableEq C] + +/-- dim I_C <= births + entries counts entry EVENTS; sigma counts registers. They agree for every +PUBLIC register (helper or kept) of every accepted word, because each public MOVE strictly climbs +(l.51): a public register enters a chart at most once (`hOnce_proj`). This is what "helpers ascend" buys. -/ +theorem entries_are_registers {Pub H : Finset Reg} {ini : Reg → Option C} {w : List (GEv K Reg C)} + (hA : Accepted Pub H ini w) (c : C) (h : Reg) (hh : h ∈ H) : + nEnt {h} (proj c ini w) ≤ 1 := + hOnce_proj Pub c ini w hA.legal h (hA.helpers_pub hh) ((hA.pub_ini h).1 (hA.helpers_pub hh)) + +/-- Without ascent the event count and the register count differ: in the one-chart model (which has no +ascent hypothesis) one register arrives, leaves and arrives again: 2 entry events, 1 register. So +"dim I_C <= births + entries" bounds registers only for ascending registers (owned registers may +descend and re-enter, so for them the bound is by events: `oa` counts events). -/ +theorem reentry_two_events : + nEnt ({0} : Finset (Fin 1)) + [Ev.arrive (K := ℚ) 0 (fun _ => 1), Ev.depart 0, Ev.arrive 0 (fun _ => 1)] = 2 ∧ + Legal (ExportLaw.start (K := ℚ) (Reg := Fin 1)) + [Ev.arrive 0 (fun _ => 1), Ev.depart 0, Ev.arrive 0 (fun _ => 1)] := by + refine ⟨by simp [nEnt], ?_⟩ + simp [Legal, LegalEv, step, ExportLaw.start] + +end Scope + +/-! ## 1. Class K(S22) -/ + +section ClassK22 +variable {K Reg C : Type*} [Field K] [DecidableEq K] [Fintype Reg] [DecidableEq Reg] + [PartialOrder C] [DecidableEq C] [Fintype C] + +/-- |Δ dim| of every MOVE of a non-helper register (mains and owned): PRICEKIT's P-charges of the kept stream. -/ +noncomputable def keptDiffs (dim : C → ℕ) (H : Finset Reg) (ini : Reg → Option C) + (w : List (GEv K Reg C)) : List ℝ := + (((moves (s0 ini) w).filter fun m => decide (m.reg ∉ H)).map + fun m => |(dim m.head : ℝ) - dim m.tail|) + +/-- the kept stream of S22 (1,721 MOVEs = 1,674 main + 47 owned) as a multiset of |Δ dim|: +968 x 1, 366 x 2, 103 x 3, 127 x 4, 147 x 5, 10 x 6 (r5cd_rows.py `PK`). -/ +def keptExp : List ℝ := + List.replicate 968 1 ++ List.replicate 366 2 ++ List.replicate 103 3 ++ + List.replicate 127 4 ++ List.replicate 147 5 ++ List.replicate 10 6 + +theorem keptExp_sum (g : ℝ → ℝ) : (keptExp.map g).sum = + 968 * g 1 + 366 * g 2 + 103 * g 3 + 127 * g 4 + 147 * g 5 + 10 * g 6 := by + simp only [keptExp, List.map_append, List.sum_append, List.map_replicate, List.sum_replicate, + nsmul_eq_mul] + push_cast; ring + +/-- PRICEKIT P-charge of the kept stream. -/ +noncomputable def keptCost (f : ℝ → ℝ) (dim : C → ℕ) (H : Finset Reg) (ini : Reg → Option C) + (w : List (GEv K Reg C)) : ℝ := + (((moves (s0 ini) w).filter fun m => decide (m.reg ∉ H)).map (mvCost f dim)).sum + +theorem keptCost_eq (f : ℝ → ℝ) (dim : C → ℕ) (H : Finset Reg) (ini : Reg → Option C) + (w : List (GEv K Reg C)) : + keptCost f dim H ini w = ((keptDiffs dim H ini w).map f).sum := by + unfold keptCost keptDiffs + rw [List.map_map] + rfl + +/-- **Class K(S22)** (AUDIT5 item 4, made precise). An accepted word `w` of the verifier model such that + * (kept data, `K`) its kept (main + owned) content is S22's: `ClassK` for the kept data D = S22's, with + `Kfin = Pub \ H`: the finals of ALL kept enders (Y-enders included) are kept rows of their chart; so are all + kept/owned arrival rows and kept birth tokens (K1, K2), and the kept rows at kept events (R: every kept + row at c at a visited state); + * (rank/count data, S22's) the per-chart numbers of FloorK22Data: rank rho(kept rows at c) >= rk, kept + registers entering-or-born at c <= ab, owned entries <= oa. The rank statement is the one piece of + checked input that is not kernel-checked here (378-coordinate rational rows; r5cd.py, mod p = 2^31-1 + and independent re-derivation in AUDIT5); the counts are the literal counts of `ClassK`; + * (kept routes, `keptP`) the multiset of |Δ dim| over the kept MOVEs is S22's (kept routes and times fixed); + * helpers are free (routes, frames, ops), subject only to verifier acceptance; "ascending only" is not an + extra restriction: every public MOVE strictly climbs in an accepted word (`moves_facts`). +The chart index `e : C ≃ Fin rows.length` pairs each chart with its row of FloorK22Data. -/ +structure ClassK22 (Pub H Kfin : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) + (dim : C → ℕ) (e : C ≃ Fin rows.length) (D : KData C (Reg → K)) : Prop where + kc : ClassK Pub H Kfin ini w D + kfin_all : Kfin = Pub \ H + rank_ge : ∀ c, (((rows.get (e c)).rk : ℕ) : ℤ) ≤ + (Module.finrank K (Submodule.span K (D.Kρ c) ⊔ Submodule.span K (D.Rρ c) : Submodule K (Reg → K)) : ℤ) + count_le : ∀ c, D.ka c + D.kb c ≤ (rows.get (e c)).ab + oa_le : ∀ c, D.oa c ≤ (rows.get (e c)).oa + keptP : (keptDiffs dim H ini w).Perm keptExp + +variable {Pub H Kfin : Finset Reg} {ini : Reg → Option C} {w : List (GEv K Reg C)} + {dim : C → ℕ} {e : C ≃ Fin rows.length} {D : KData C (Reg → K)} + +/-- **R1 per chart, with the Y finals in the quotient** (= R5 §2): hd(c) >= rk - (ka + kb) - oa + = need_c - kept passers - owned entries, since rk = |Y| + need and ka + kb = |Y| + kp. + It is `R1_row` with Kfin = all kept enders; no new lemma about the word is needed. -/ +theorem R1Y_row (hK : ClassK22 Pub H Kfin ini w dim e D) (c : C) : + (((rows.get (e c)).rk : ℤ) - (rows.get (e c)).ab - (rows.get (e c)).oa) ≤ hdW H ini w c := by + have h := R1_row hK.kc c + have h1 := hK.rank_ge c; have h2 := hK.count_le c; have h3 := hK.oa_le c + omega + +theorem forced_le_hd (hK : ClassK22 Pub H Kfin ini w dim e D) (c : C) : + forced (rows.get (e c)) ≤ hdW H ini w c := by + have := R1Y_row hK c + unfold forced; omega + +/-- **the 748 forced stops, on the word**: every class-K(S22) word has at least 748 paid helper stays. -/ +theorem stays_ge_748 (hK : ClassK22 Pub H Kfin ini w dim e D) : 748 ≤ (stays H ini w).card := by + classical + rw [← sum_hd hK.kc.acc] + calc 748 = (rows.map forced).sum := forced_sum.symm + _ = ∑ i : Fin rows.length, forced (rows.get i) := (sum_fin_get forced rows).symm + _ = ∑ c : C, forced (rows.get (e c)) := (Equiv.sum_comp e fun i => forced (rows.get i)).symm + _ ≤ ∑ c, hdW H ini w c := Finset.sum_le_sum fun c _ => forced_le_hd hK c + +/-- helper D0 floor of class K(S22): >= 748 * 2 ln 2 >= 1036.948 per call. -/ +theorem helperD0_ge_748 (hdim : ∀ a b : C, a < b → dim a < dim b) + (hK : ClassK22 Pub H Kfin ini w dim e D) : + 748 * (2 * Real.log 2) ≤ helperD0 JunkLB2.fL dim H ini w ∧ + (1036.948 : ℝ) ≤ helperD0 JunkLB2.fL dim H ini w := by + have h1 := helperD0_ge_fL dim hdim hK.kc.acc + have h2 : (748 : ℝ) ≤ (stays H ini w).card := by exact_mod_cast stays_ge_748 hK + have hl := Real.log_two_gt_d9 + have h3 : 748 * (2 * Real.log 2) ≤ 2 * Real.log 2 * (stays H ini w).card := by nlinarith + exact ⟨h3.trans h1, by nlinarith⟩ + +/-! ## 2. Kept cost and the composition -/ + +/-- numeric facts: logs of 3 and 5 from the exponential series (kernel arithmetic). -/ +theorem log3_lt : Real.log 3 < 10986123 / 10 ^ 7 := by + rw [Real.log_lt_iff_lt_exp (by norm_num)] + have h := Real.sum_le_exp_of_nonneg (x := (10986123 : ℝ) / 10 ^ 7) (by norm_num) 14 + refine lt_of_lt_of_le ?_ h + simp only [Finset.sum_range_succ, Finset.sum_range_zero, Nat.factorial] + norm_num + +theorem log5_lt : Real.log 5 < 160943792 / 10 ^ 8 := by + rw [Real.log_lt_iff_lt_exp (by norm_num)] + have h := Real.sum_le_exp_of_nonneg (x := (160943792 : ℝ) / 10 ^ 8) (by norm_num) 16 + refine lt_of_lt_of_le ?_ h + simp only [Finset.sum_range_succ, Finset.sum_range_zero, Nat.factorial] + norm_num + +/-- The kept stream's D0 (credit, per call), exact in logs. -/ +theorem keptExp_D0 : + ((keptExp.map JunkLB2.fL).sum) = + 1808 * Real.log 2 + 369 * Real.log 3 + 735 * Real.log 5 := by + have h4 : Real.log 4 = 2 * Real.log 2 := by + rw [show (4 : ℝ) = 2 ^ 2 by norm_num, Real.log_pow]; norm_num + have h6 : Real.log 6 = Real.log 2 + Real.log 3 := by + rw [show (6 : ℝ) = 2 * 3 by norm_num, Real.log_mul (by norm_num) (by norm_num)] + rw [keptExp_sum] + simp only [JunkLB2.fL, h4, h6, Real.log_one] + push_cast + ring + +theorem keptExp_D0_le : ((keptExp.map JunkLB2.fL).sum) ≤ 2841.53492 := by + rw [keptExp_D0] + have h2 := Real.log_two_lt_d9 + have h3 := log3_lt; have h5 := log5_lt + norm_num at h2 h3 h5 ⊢ + linarith + +/-- caller-side numeric input: D0 of the #7113 caller invoice C(8|9) (`CallerCost.reproduction`), exact value +270812.81745340...; evaluating its ~70 logs is the hypothesis `hDc`. -/ +def CallerD0Input : Prop := (270812.8174 : ℝ) ≤ CallerCost.Dinv (CallerCost.caller 6 7) + +/-- **D0 composition for class K(S22).** With the PRICEKIT cost model (native D0 = helper D0 - kept P-charges, +`hnat`) and the numeric input `hDc`: invoice D0 >= caller + 17 (748 * 2 ln 2 - kept cost) >= 240,134.84. -/ +theorem D0_K22 (hdim : ∀ a b : C, a < b → dim a < dim b) + (hK : ClassK22 Pub H Kfin ini w dim e D) (n : CallerCost.Inv) + (hnat : CallerCost.Dinv n = helperD0 JunkLB2.fL dim H ini w - keptCost JunkLB2.fL dim H ini w) + (hDc : CallerD0Input) : + (240134.84 : ℝ) ≤ CallerCost.Dinv (CallerCost.invoice (CallerCost.caller 6 7) n 17) := by + rw [CallerCost.invoice_D0] + have hk : keptCost JunkLB2.fL dim H ini w = ((keptExp.map JunkLB2.fL).sum) := by + rw [keptCost_eq]; exact (hK.keptP.map _).sum_eq + have h1 := (helperD0_ge_748 hdim hK).2 + have h2 := keptExp_D0_le + have h3 := Real.log_two_gt_d9 + have h4 := (helperD0_ge_748 hdim hK).1 + unfold CallerD0Input at hDc + rw [hnat, hk] + push_cast + nlinarith + +/-- general form: any lower bound N on the paid helper stays of a K(S22) word (R5: 748; R6's first-hop LP dual: 845, +NOT formalised here) gives invoice D0 >= 270812.8174 + 17 (N * 2 ln 2 - 2841.53492). -/ +theorem D0_of_stops (N : ℕ) (hdim : ∀ a b : C, a < b → dim a < dim b) + (hK : ClassK22 Pub H Kfin ini w dim e D) (hst : N ≤ (stays H ini w).card) (n : CallerCost.Inv) + (hnat : CallerCost.Dinv n = helperD0 JunkLB2.fL dim H ini w - keptCost JunkLB2.fL dim H ini w) + (hDc : CallerD0Input) : + 270812.8174 + 17 * ((N : ℝ) * (2 * Real.log 2) - 2841.53492) ≤ + CallerCost.Dinv (CallerCost.invoice (CallerCost.caller 6 7) n 17) := by + rw [CallerCost.invoice_D0] + have hk : keptCost JunkLB2.fL dim H ini w = ((keptExp.map JunkLB2.fL).sum) := by + rw [keptCost_eq]; exact (hK.keptP.map _).sum_eq + have h2 := keptExp_D0_le + have h4 := helperD0_ge_fL dim hdim hK.kc.acc + have hN : (N : ℝ) ≤ (stays H ini w).card := by exact_mod_cast hst + have hl := Real.log_two_gt_d9 + unfold CallerD0Input at hDc + rw [hnat, hk] + push_cast + nlinarith + +/-- R6's conditional corollary: if the first-hop LP dual (845 stops; WHOLEFLOOR R6, not formalised) holds for the word, +invoice D0 >= 242,420.84. -/ +theorem D0_K22_R6 (hdim : ∀ a b : C, a < b → dim a < dim b) + (hK : ClassK22 Pub H Kfin ini w dim e D) (hst : 845 ≤ (stays H ini w).card) (n : CallerCost.Inv) + (hnat : CallerCost.Dinv n = helperD0 JunkLB2.fL dim H ini w - keptCost JunkLB2.fL dim H ini w) + (hDc : CallerD0Input) : + (242420.84 : ℝ) ≤ CallerCost.Dinv (CallerCost.invoice (CallerCost.caller 6 7) n 17) := by + have h := D0_of_stops 845 hdim hK hst n hnat hDc + have hl := Real.log_two_gt_d9 + push_cast at h + nlinarith + +/-- the composition as written in R5.md, with its rounded components: 270,812.82 - 46,300.0 - 2,006.0 + 17 * 1,036.95 +is 240,134.97, NOT 240,134.84 (the exact PRICEKIT value is 240,134.843 = 270,812.8175 - 48,306.0933 + 17,628.1191; +mains are -46,300.09 exactly, not -46,300.0). Statement imprecise as written (0.13). -/ +theorem recipe_as_written : (270812.82 - 46300.0 - 2006.0 + 17 * 1036.95 : ℝ) = 240134.97 ∧ + (270812.82 - 46300.0 - 2006.0 + 17 * 1036.95 : ℝ) ≠ 240134.84 := by + constructor <;> norm_num + +/-! ## 3. The kappa ceiling -/ + +open JointCeiling CallerCost in +/-- the per-call native histogram of the K(S22) floor: kept stream + 748 forced stops priced as 0 -> 1 -> 2 helpers +(T[2] += 748, P[1] += 2 * 748), exactly r5k.py. -/ +def nK22 : Inv := ⟨[(2, 748)], [(1, 968), (2, 366), (3, 103), (4, 127), (5, 147), (6, 10), (1, 1496)]⟩ + +open JointCeiling CallerCost in +/-- NUMERIC CERTIFICATE (hypothesis, WHOLEFLOOR r5k.py `cert`): the K(S22) floor invoice has F(s) < 0 on (0, 1 - tbar] +(r5k: F(hi) < 0 at the root's upper end, F decreasing, F < 0 on [.1, 1] in t), tbar = .0060197405 +(root .00601974047925, rounded up). Interval covers with 40-digit Decimals; not kernel-checked. -/ +def NumCert22 (tbar : ℝ) : Prop := + ∀ s : ℝ, 0 < s → s ≤ 1 - tbar → Finv s (invoice (caller 6 7) nK22 17) < 0 + +noncomputable def tbar22 : ℝ := 60197405 / 10 ^ 10 + +/-- helper F-floor, for every exponent s in (0,1]: with f = -x^s (convex, f 0 = 0), FloorD0.helperD0_ge gives +F_helpers(s) <= -(2 - 2^s) * #stays on every accepted word (class K not needed). -/ +theorem helperF_le (dim : C → ℕ) (hdim : ∀ a b : C, a < b → dim a < dim b) + (hA : Accepted Pub H ini w) {s : ℝ} (hs0 : 0 < s) (hs1 : s ≤ 1) : + helperD0 (fun x : ℝ => x ^ s) dim H ini w ≤ -(2 - (2 : ℝ) ^ s) * (stays H ini w).card := by + have cvx : ConvexOn ℝ (Set.Ici (0 : ℝ)) (fun x : ℝ => -(x ^ s)) := + (Real.concaveOn_rpow hs0.le hs1).neg + have h0 : (fun x : ℝ => -(x ^ s)) 0 = 0 := by simp [Real.zero_rpow hs0.ne'] + have h := helperD0_ge (fun x : ℝ => -(x ^ s)) dim hdim cvx h0 hA + have hneg : helperD0 (fun x : ℝ => -(x ^ s)) dim H ini w = + -helperD0 (fun x : ℝ => x ^ s) dim H ini w := by + have key : ∀ l : List (Mv K Reg C), (l.map (mvCost (fun x : ℝ => -(x ^ s)) dim)).sum = + -(l.map (mvCost (fun x : ℝ => x ^ s) dim)).sum := by + intro l; induction l with + | nil => simp + | cons m l ih => simp only [List.map_cons, List.sum_cons, ih, mvCost]; ring + simp only [helperD0, regD0, key, ← Finset.sum_neg_distrib] + refine Finset.sum_congr rfl fun h _ => ?_ + ring + have hk : kap (fun x : ℝ => -(x ^ s)) = -(2 : ℝ) ^ s + 2 := by + simp [kap, Real.one_rpow] + rw [hneg, hk] at h + linarith + +open JointCeiling CallerCost in +/-- **kappa <= .0060197405 on class K(S22)** (conditional on the PRICEKIT cost model link `hF`, the kept rank input in +`ClassK22`, and NumCert22): for every class-K(S22) word with native histogram n, the 17-call invoice +has F(s) < 0 for all 0 < s <= 1 - tbar22, i.e. F(1-t) < 0 for t in [tbar22, 1). -/ +theorem ceiling22 (hdim : ∀ a b : C, a < b → dim a < dim b) + (hK : ClassK22 Pub H Kfin ini w dim e D) (n : Inv) + (hF : ∀ s : ℝ, 0 < s → s ≤ 1 → + Finv s n = helperD0 (fun x : ℝ => x ^ s) dim H ini w - keptCost (fun x : ℝ => x ^ s) dim H ini w) + (hnum : NumCert22 tbar22) {s : ℝ} (hs0 : 0 < s) (hs : s ≤ 1 - tbar22) : + Finv s (invoice (caller 6 7) n 17) < 0 := by + have hs1 : s ≤ 1 := by unfold tbar22 at hs; linarith + have hnum' := hnum s hs0 hs + rw [invoice_F] at hnum' ⊢ + have hn : Finv s n ≤ Finv s nK22 := by + rw [hF s hs0 hs1] + have h1 := helperF_le dim hdim hK.kc.acc hs0 hs1 + have h2 : (748 : ℝ) ≤ (stays H ini w).card := by exact_mod_cast stays_ge_748 hK + have h2s : (2 : ℝ) ^ s ≤ 2 := by + calc (2 : ℝ) ^ s ≤ 2 ^ (1 : ℝ) := Real.rpow_le_rpow_of_exponent_le (by norm_num) hs1 + _ = 2 := by simp + have h3 : -(2 - (2 : ℝ) ^ s) * (stays H ini w).card ≤ -(2 - (2 : ℝ) ^ s) * 748 := by nlinarith + have hk : keptCost (fun x : ℝ => x ^ s) dim H ini w = ((keptExp.map fun x : ℝ => x ^ s).sum) := by + rw [keptCost_eq]; exact (hK.keptP.map _).sum_eq + have hnk : Finv s nK22 = 748 * (2 : ℝ) ^ s - (968 + 366 * (2 : ℝ) ^ s + 103 * (3 : ℝ) ^ s + 127 * (4 : ℝ) ^ s + + 147 * (5 : ℝ) ^ s + 10 * (6 : ℝ) ^ s + 1496) := by + simp [Finv, Fh, nK22, Real.one_rpow] + ring + rw [hk, hnk] + rw [keptExp_sum] + simp only [Real.one_rpow] + nlinarith + have hc : (17 : ℕ) * Finv s n ≤ (17 : ℕ) * Finv s nK22 := by + exact_mod_cast mul_le_mul_of_nonneg_left hn (by norm_num : (0 : ℝ) ≤ 17) + push_cast at hc hnum' ⊢ + linarith + +end ClassK22 + +end FloorK22 + +#print axioms FloorK22.entries_are_registers +#print axioms FloorK22.reentry_two_events +#print axioms FloorK22.R1Y_row +#print axioms FloorK22.stays_ge_748 +#print axioms FloorK22.helperD0_ge_748 +#print axioms FloorK22.keptExp_D0_le +#print axioms FloorK22.D0_K22 +#print axioms FloorK22.recipe_as_written +#print axioms FloorK22.D0_of_stops +#print axioms FloorK22.D0_K22_R6 +#print axioms FloorK22.helperF_le +#print axioms FloorK22.ceiling22 +#print axioms FloorK22Data.forced_sum +#print axioms FloorK22Data.forced_by_dim +#print axioms FloorK22Data.control +#print axioms FloorK22Data.sums diff --git a/research/p104-lean-premises/lean/Nov15/FloorK22.md b/research/p104-lean-premises/lean/Nov15/FloorK22.md new file mode 100644 index 0000000000..9ed1dbe089 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorK22.md @@ -0,0 +1,23 @@ +# FloorK22.lean (+ FloorK22Data.lean): whole-floor R5's class-K(S22) floor, formalised. No sorry, 8 s / 2.9 GB (Data: 6 s / 1.6 GB) +Sources: internal notes, AUDIT5.md, r5cd.py, r5k.py; generator internal notes (+ nums.py). Imports FloorD0, JointCeiling (CallerCost), FloorEndToEnd (R1_row). +Axioms: all FloorK22 theorems [propext, Classical.choice, Quot.sound]; Data certificates [propext] or none. No native_decide. Build: Data first (`-o .lake/build/lib/lean/Nov15/FloorK22Data.olean`). + +## What is a theorem +- `ClassK22` = K(S22) as AUDIT5 item 4 asks: `ClassK` for S22's kept data with `Kfin = Pub \ H` (finals of ALL kept enders, Y-enders included, are kept rows), kept arrival rows/births/snapshots fixed (K1, K2, R), per-chart kept counts and rank (`rank_ge`, `count_le`, `oa_le`), kept (main+owned) routes fixed as the multiset of |Δdim| (`keptP`: 968x1, 366x2, 103x3, 127x4, 147x5, 10x6 = 1,721 MOVEs); helpers free, verifier-accepted. "Ascending only" is not an extra restriction: public MOVEs climb in every accepted word. +- **R1 with Y in the quotient = R1_row with Kfin = all kept enders.** `R1Y_row`: hd(c) >= rk - (ka+kb) - oa. Since rk = |Y| + need and ka+kb = |Y| + kp, this is need_c - kept passers - owned entries (R5's form). It needs no new word lemma; the 748 (vs RANKSTEINER's local 685) comes from putting the Y-ender finals into K. Data check: both forms agree on all 978 charts (`control`). +- `forced_sum` (decide +kernel): sum over 978 charts of max(0, rk-ab-oa) = **748**; `forced_by_dim` = 0/122/150/109/40/29/94/96/108 (dims 0..8); `control`: kp<=ab, |Y|<=rk, need<=sigma on all 978 charts; `sums`: sum ab 2074, oa 47, kp 1274, need 2063. +- `stays_ge_748` (word level): every K22 word has >= 748 paid helper stays (sum_hd + R1Y_row + sum_fin_get + Equiv.sum_comp). `helperD0_ge_748`: helper D0 >= 748 * 2 ln 2 >= 1036.948. +- `D0_K22`: invoice D0 >= 240,134.84 (caller 270,812.8174 [numeric input `CallerD0Input`, exact 270,812.81745] + 17(748*2ln2 - kept cost); kept cost 1808 ln2 + 369 ln3 + 735 ln5 <= 2841.53492 proved: `keptExp_D0`, `log3_lt`, `log5_lt` from exp series). `D0_of_stops N` generalises; `D0_K22_R6` gives 242,420.84 CONDITIONAL on R6's 845-stop dual (not formalised). +- `helperF_le`: for every s in (0,1] and every accepted word, helper F(s) = sum (T-P) r^s <= -(2 - 2^s) * #stays (FloorD0.helperD0_ge with f = -x^s, concavity of x^s). So the F-form native floor is derived, not assumed, for class K22. +- `ceiling22`: for K22 words, F_invoice(s) < 0 for 0 < s <= 1 - tbar22, tbar22 = .0060197405, i.e. kappa <= .0060197405 (F(1-t)<0 for t in [tbar22,1)), given `NumCert22` (interval crossing of the histogram nK22 = kept P + T[2]+=748, P[1]+=1496, caller `caller 6 7`; r5k.py `cert`; hypothesis, as in JointCeiling) and the cost-model link `hF`. +- AUDIT5 scope fix: `entries_are_registers` (every helper enters a chart <= once, from l.51 via hOnce_proj) is why events = registers in dim I_C <= births + entries; `reentry_two_events` is the one-chart counterexample without ascent (1 register, 2 entry events, legal). dim I_C = sigma (registers) only because helpers ascend; owned registers may re-enter, so `oa` counts events. + +## Hypotheses left (named) +1. `ClassK22.rank_ge` (+ K1/K2/R): the rank of the kept rows at each chart is >= rk. The 378-coordinate rows are not exported (as FloorEndToEnd item 2); rank mod p = 2^31-1 in r5cd.py, independently re-derived by AUDIT5. +2. Cost-model links `hnat` (D0) and `hF` (F): the word's native histogram = helper regD0 minus kept MOVE charges (the price checker; FloorD0.md). +3. `CallerD0Input` (numeric: ~70 logs of the #7113 caller) and `NumCert22` (40-digit interval covers). +4. R6's 845: LP dual over the first-hop rows; would need a new FloorCert-style export for S22 (not done). + +## Statements imprecise as written (found) +- R5.md §3 composition "270,812.82 - 46,300.0 - 2,006.0 + 17 x 1,036.95 => 240,134.84" is arithmetically 240,134.97 (`recipe_as_written`). Exact: mains are -46,300.09 (4 x rounding), caller 270,812.8175, kept credits -48,306.0933 (= 17 x 2841.5349), stops +17,628.1191 (17 x 748 x 2ln2, not 17 x 1,036.95 = 17,628.15): total 240,134.843. The floor 240,134.84 is right; the displayed recipe is off by 0.13. +- AUDIT5 Fix A/B reproduced: "timing adds exactly 0" is a statement about this derivation only; events vs registers needs ascent (above). diff --git a/research/p104-lean-premises/lean/Nov15/FloorK22Data.lean b/research/p104-lean-premises/lean/Nov15/FloorK22Data.lean new file mode 100644 index 0000000000..22bce3dc37 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/FloorK22Data.lean @@ -0,0 +1,44 @@ +/- +FloorK22Data : per-chart data of WHOLEFLOOR R5 on S22 (#7636), generated by +internal notes (r5cd.py + a row dump). One row per chart, in frame-id order: +rk = rank rho(kept rows at c) = |Y| + need; ab = ka + kb (kept public registers entering or born at c); +oa = owned entries; sg = sigma = passers + owned entries; kp = kept passers; dm = dim of the chart. +All checks are structural recursion on the row list, evaluated by `decide +kernel`. +-/ +import Mathlib.Algebra.BigOperators.Fin +namespace FloorK22Data +structure Row where + rk : ℕ + ab : ℕ + oa : ℕ + sg : ℕ + kp : ℕ + dm : ℕ + +def rows : List Row := [⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨200,200,0,0,0,0⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨5,4,0,9,2,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨2,1,0,5,0,1⟩,⟨8,5,0,8,3,1⟩,⟨2,1,0,5,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨3,2,0,6,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨2,1,0,5,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨2,1,0,5,0,1⟩,⟨2,1,0,5,0,1⟩,⟨3,2,0,5,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,3,0,1⟩,⟨3,2,0,3,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨4,3,0,7,2,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨7,6,0,10,4,1⟩,⟨3,2,0,4,0,1⟩,⟨2,1,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨4,2,0,4,0,1⟩,⟨2,1,0,5,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨3,2,0,6,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨4,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,3,0,1⟩,⟨4,2,0,4,0,1⟩,⟨3,2,0,5,0,1⟩,⟨3,2,0,4,0,1⟩,⟨4,2,0,6,0,1⟩,⟨3,2,0,4,0,1⟩,⟨3,2,0,6,0,1⟩,⟨3,2,0,4,0,1⟩,⟨4,4,0,4,4,1⟩,⟨0,0,0,5,0,5⟩,⟨1,0,1,6,0,5⟩,⟨0,0,0,5,0,5⟩,⟨3,0,2,9,0,5⟩,⟨0,0,0,5,0,5⟩,⟨2,2,0,4,2,5⟩,⟨200,200,0,0,0,9⟩,⟨6,6,0,4,4,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨5,4,0,4,2,8⟩,⟨5,4,0,4,2,8⟩,⟨3,2,0,6,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,2,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨2,1,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,1,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,2,0,8⟩,⟨5,4,0,4,2,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,5,0,8⟩,⟨3,2,0,4,0,8⟩,⟨4,3,0,4,1,8⟩,⟨3,2,0,2,0,8⟩,⟨2,1,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,2,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨4,3,0,4,2,8⟩,⟨2,1,0,4,0,8⟩,⟨3,2,0,6,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨2,1,0,5,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨5,3,0,10,2,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨5,4,0,4,2,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,1,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,2,0,8⟩,⟨4,4,0,4,2,8⟩,⟨3,2,0,10,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,2,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,6,0,8⟩,⟨3,2,0,5,0,8⟩,⟨4,4,0,4,2,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨4,2,0,11,0,8⟩,⟨5,4,0,9,2,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,6,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨5,4,0,4,2,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,5,0,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,2,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,6,0,8⟩,⟨3,2,0,4,0,8⟩,⟨3,2,0,3,0,8⟩,⟨5,4,0,4,2,8⟩,⟨3,2,0,3,0,8⟩,⟨3,2,0,4,0,8⟩,⟨12,9,0,16,9,4⟩,⟨2,2,0,2,2,5⟩,⟨6,3,0,14,3,4⟩,⟨12,10,0,16,10,4⟩,⟨12,10,0,14,10,4⟩,⟨0,0,0,2,0,5⟩,⟨10,6,2,15,6,4⟩,⟨2,2,0,2,2,5⟩,⟨11,9,0,16,9,4⟩,⟨11,10,2,15,10,4⟩,⟨12,10,0,16,10,4⟩,⟨5,5,0,9,5,8⟩,⟨0,0,0,4,0,8⟩,⟨7,6,0,8,6,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨3,2,0,6,2,2⟩,⟨6,4,0,8,4,2⟩,⟨0,0,0,5,0,3⟩,⟨3,0,2,7,0,3⟩,⟨0,0,0,7,0,3⟩,⟨0,0,0,4,0,3⟩,⟨0,0,0,5,0,3⟩,⟨6,4,0,7,4,3⟩,⟨3,2,0,8,2,3⟩,⟨3,2,0,6,2,3⟩,⟨8,10,1,13,10,8⟩,⟨8,8,0,8,8,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨4,4,0,4,4,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨6,4,0,8,4,2⟩,⟨3,2,0,8,2,2⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,5,4,3⟩,⟨3,2,0,5,2,3⟩,⟨3,2,0,5,2,3⟩,⟨6,6,0,16,6,4⟩,⟨8,8,0,8,8,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨6,6,0,6,6,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨6,4,0,8,4,2⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,4,0,3⟩,⟨4,4,0,4,4,3⟩,⟨0,0,0,4,0,3⟩,⟨3,2,0,4,2,3⟩,⟨7,4,0,14,4,4⟩,⟨8,8,0,8,8,2⟩,⟨2,1,0,4,1,2⟩,⟨2,1,0,4,1,2⟩,⟨7,7,0,7,7,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨5,3,0,7,3,2⟩,⟨6,4,0,8,4,2⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,5,0,3⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨0,0,0,5,0,3⟩,⟨4,3,0,5,3,3⟩,⟨3,2,0,5,2,3⟩,⟨1,1,0,5,1,3⟩,⟨7,6,0,8,6,2⟩,⟨2,1,0,4,1,2⟩,⟨2,1,0,4,1,2⟩,⟨5,5,0,5,5,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨6,4,0,8,4,2⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨0,0,0,4,0,3⟩,⟨2,1,0,4,1,3⟩,⟨3,2,0,6,2,3⟩,⟨1,1,0,5,1,3⟩,⟨8,8,0,8,8,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨8,8,0,8,8,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,5,0,2⟩,⟨0,0,0,4,0,2⟩,⟨1,0,0,5,0,2⟩,⟨0,0,0,4,0,2⟩,⟨6,4,0,8,4,2⟩,⟨6,4,0,8,4,2⟩,⟨0,0,0,4,0,3⟩,⟨0,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,5,4,3⟩,⟨3,2,0,5,2,3⟩,⟨3,2,0,5,2,3⟩,⟨7,6,0,8,6,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨1,0,0,5,0,2⟩,⟨0,0,0,4,0,2⟩,⟨1,0,0,5,0,2⟩,⟨2,0,0,5,0,2⟩,⟨5,3,0,7,3,2⟩,⟨6,4,0,8,4,2⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,5,4,3⟩,⟨3,2,0,4,2,3⟩,⟨3,2,0,5,2,3⟩,⟨7,6,0,7,6,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨9,8,0,9,8,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,4,0,2⟩,⟨1,0,0,4,0,2⟩,⟨1,0,0,4,0,2⟩,⟨3,2,0,6,2,2⟩,⟨3,2,0,8,2,2⟩,⟨1,0,0,4,0,3⟩,⟨3,0,2,7,0,3⟩,⟨1,0,0,4,0,3⟩,⟨0,0,0,8,0,3⟩,⟨0,0,0,6,0,3⟩,⟨5,4,0,5,4,3⟩,⟨0,0,0,5,0,3⟩,⟨3,2,0,5,2,3⟩,⟨8,8,0,8,8,2⟩,⟨2,1,0,4,1,2⟩,⟨2,1,0,4,1,2⟩,⟨8,7,0,8,7,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨5,3,0,8,3,2⟩,⟨6,4,0,8,4,2⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨4,3,0,5,3,3⟩,⟨3,2,0,4,2,3⟩,⟨1,1,0,4,1,3⟩,⟨8,8,0,8,8,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨8,6,0,8,6,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,5,0,2⟩,⟨0,0,0,4,0,2⟩,⟨6,4,0,9,4,2⟩,⟨3,2,0,8,2,2⟩,⟨3,0,2,7,0,3⟩,⟨0,0,0,5,0,3⟩,⟨1,0,0,4,0,3⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,5,4,3⟩,⟨3,2,0,5,2,3⟩,⟨3,2,0,5,2,3⟩,⟨8,8,0,8,8,2⟩,⟨4,2,0,4,2,2⟩,⟨3,2,0,5,2,2⟩,⟨8,8,0,8,8,2⟩,⟨4,2,0,5,2,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,5,0,2⟩,⟨0,0,0,5,0,2⟩,⟨6,4,0,8,4,2⟩,⟨6,4,0,8,4,2⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨0,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨4,3,0,4,3,3⟩,⟨3,2,0,4,2,3⟩,⟨3,2,0,4,2,3⟩,⟨7,6,0,8,6,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨2,1,0,3,1,2⟩,⟨0,0,0,2,0,2⟩,⟨0,0,0,2,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨3,2,0,6,2,2⟩,⟨6,4,0,8,4,2⟩,⟨0,0,0,4,0,3⟩,⟨3,0,2,6,0,3⟩,⟨0,0,0,6,0,3⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,3,0,3⟩,⟨5,4,0,5,4,3⟩,⟨3,2,0,6,2,3⟩,⟨3,2,0,5,2,3⟩,⟨7,8,1,13,8,8⟩,⟨7,6,0,8,6,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨6,6,0,6,6,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,2,0,2⟩,⟨0,0,0,2,0,2⟩,⟨0,0,0,5,0,2⟩,⟨0,0,0,2,0,2⟩,⟨3,2,0,6,2,2⟩,⟨5,3,0,8,3,2⟩,⟨0,0,0,4,0,3⟩,⟨0,0,0,4,0,3⟩,⟨1,0,0,4,0,3⟩,⟨0,0,0,5,0,3⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,5,4,3⟩,⟨3,2,0,3,2,3⟩,⟨3,2,0,3,2,3⟩,⟨8,6,0,14,6,4⟩,⟨8,8,0,8,8,2⟩,⟨4,2,0,4,2,2⟩,⟨4,2,0,4,2,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨0,0,0,4,0,2⟩,⟨3,2,0,6,2,2⟩,⟨5,3,0,8,3,2⟩,⟨0,0,0,6,0,3⟩,⟨0,0,0,6,0,3⟩,⟨0,0,0,4,0,3⟩,⟨0,0,0,4,0,3⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,6,4,3⟩,⟨3,2,0,6,2,3⟩,⟨3,2,0,6,2,3⟩,⟨9,6,0,14,6,4⟩,⟨7,6,1,13,6,8⟩,⟨2,0,1,13,0,8⟩,⟨5,4,0,5,4,3⟩,⟨3,0,2,5,0,6⟩,⟨3,1,0,4,1,3⟩,⟨2,1,0,3,1,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨3,2,0,4,2,6⟩,⟨1,0,0,3,0,6⟩,⟨7,2,2,9,2,7⟩,⟨0,0,0,2,0,7⟩,⟨2,0,1,5,0,8⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,5,0,3⟩,⟨3,0,2,5,0,6⟩,⟨3,2,0,5,2,3⟩,⟨0,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨2,1,0,6,1,6⟩,⟨0,0,0,6,0,6⟩,⟨6,2,2,9,2,7⟩,⟨0,0,0,4,0,7⟩,⟨2,0,1,5,0,8⟩,⟨0,0,0,4,0,7⟩,⟨3,2,0,5,2,3⟩,⟨3,2,0,5,2,3⟩,⟨4,3,0,4,3,6⟩,⟨7,4,2,10,4,7⟩,⟨0,0,0,4,0,3⟩,⟨0,0,0,5,0,3⟩,⟨3,1,0,4,1,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,2,0,7⟩,⟨2,0,1,4,0,8⟩,⟨0,0,0,2,0,7⟩,⟨3,2,0,5,2,3⟩,⟨3,2,0,5,2,3⟩,⟨3,1,0,4,1,6⟩,⟨5,3,0,8,3,7⟩,⟨3,2,0,4,2,3⟩,⟨3,2,0,4,2,3⟩,⟨4,3,0,4,3,6⟩,⟨3,2,0,6,2,3⟩,⟨4,2,0,6,2,3⟩,⟨4,2,0,6,2,3⟩,⟨3,2,0,6,2,3⟩,⟨3,1,0,4,1,3⟩,⟨3,2,0,4,2,3⟩,⟨3,2,0,4,2,3⟩,⟨4,2,0,5,2,3⟩,⟨2,0,1,7,0,8⟩,⟨10,8,1,16,8,1⟩,⟨6,4,1,15,4,1⟩,⟨6,2,1,14,2,1⟩,⟨14,10,1,18,10,1⟩,⟨2,0,1,7,0,1⟩,⟨2,0,1,9,0,1⟩,⟨2,0,1,5,0,1⟩,⟨2,0,1,6,0,1⟩,⟨10,10,0,10,10,2⟩,⟨0,0,0,5,0,2⟩,⟨0,0,0,5,0,6⟩,⟨3,2,0,4,2,3⟩,⟨4,4,0,4,4,3⟩,⟨1,1,0,2,1,3⟩,⟨3,2,0,4,2,3⟩,⟨4,4,0,4,4,3⟩,⟨4,4,0,4,4,3⟩,⟨3,2,0,4,2,4⟩,⟨4,4,0,4,4,4⟩,⟨4,4,0,4,4,4⟩,⟨4,4,0,4,4,5⟩,⟨3,2,0,4,2,5⟩,⟨4,4,0,4,4,5⟩,⟨3,2,0,4,2,6⟩,⟨4,4,0,4,4,6⟩,⟨4,4,0,4,4,6⟩,⟨9,8,0,9,8,7⟩,⟨7,6,0,8,6,7⟩,⟨7,6,0,9,6,7⟩,⟨7,6,0,8,6,7⟩,⟨6,4,0,9,4,7⟩,⟨3,2,0,4,2,3⟩,⟨4,4,0,4,4,3⟩,⟨3,2,0,4,2,3⟩,⟨3,2,0,4,2,4⟩,⟨3,2,0,5,2,4⟩,⟨5,4,0,5,4,4⟩,⟨3,2,0,4,2,5⟩,⟨4,3,0,4,3,6⟩,⟨3,2,0,4,2,6⟩,⟨4,3,0,4,3,6⟩,⟨7,6,0,8,6,7⟩,⟨6,4,0,9,4,7⟩,⟨7,6,0,8,6,7⟩,⟨6,4,0,10,4,7⟩,⟨3,2,0,6,2,2⟩,⟨3,2,0,4,2,4⟩,⟨3,2,0,4,2,5⟩,⟨4,4,0,4,4,6⟩,⟨4,3,0,4,3,6⟩,⟨7,6,0,8,6,7⟩,⟨7,6,0,8,6,7⟩,⟨6,4,0,8,4,7⟩,⟨3,2,0,5,2,3⟩,⟨4,3,0,4,3,6⟩,⟨4,3,0,4,3,6⟩,⟨7,6,0,8,6,7⟩,⟨7,6,0,8,6,7⟩,⟨2,1,0,3,1,3⟩,⟨4,4,0,4,4,5⟩,⟨4,4,0,4,4,6⟩,⟨4,4,0,4,4,6⟩,⟨6,5,0,7,5,7⟩,⟨9,8,0,9,8,7⟩,⟨8,8,0,8,8,7⟩,⟨4,2,0,5,2,2⟩,⟨0,0,0,3,0,4⟩,⟨3,2,0,4,2,5⟩,⟨3,2,0,3,2,5⟩,⟨4,4,0,4,4,6⟩,⟨4,4,0,4,4,6⟩,⟨6,4,0,9,4,7⟩,⟨6,4,0,8,4,7⟩,⟨4,4,0,4,4,3⟩,⟨3,2,0,4,2,3⟩,⟨3,2,0,4,2,3⟩,⟨4,2,0,5,2,4⟩,⟨0,0,0,5,0,4⟩,⟨0,0,0,5,0,4⟩,⟨4,3,0,4,3,6⟩,⟨4,3,0,4,3,6⟩,⟨4,3,0,4,3,6⟩,⟨6,5,0,8,5,7⟩,⟨4,4,0,4,4,3⟩,⟨3,2,0,4,2,3⟩,⟨3,3,0,3,3,3⟩,⟨3,2,0,4,2,4⟩,⟨2,1,0,3,1,4⟩,⟨0,0,0,4,0,4⟩,⟨3,3,0,3,3,5⟩,⟨4,4,0,4,4,5⟩,⟨3,2,0,4,2,5⟩,⟨4,4,0,4,4,6⟩,⟨4,3,0,4,3,6⟩,⟨4,4,0,4,4,6⟩,⟨0,0,0,5,0,4⟩,⟨3,2,0,4,2,4⟩,⟨0,0,0,4,0,4⟩,⟨0,0,0,4,0,4⟩,⟨5,4,0,5,4,3⟩,⟨4,2,0,6,2,3⟩,⟨0,0,0,2,0,6⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,5,4,4⟩,⟨3,2,0,5,2,3⟩,⟨1,0,0,3,0,6⟩,⟨1,0,0,4,0,6⟩,⟨0,0,0,3,0,4⟩,⟨1,1,0,4,1,4⟩,⟨0,0,0,4,0,3⟩,⟨0,0,0,3,0,4⟩,⟨0,0,0,3,0,6⟩,⟨0,0,0,3,0,4⟩,⟨0,0,0,3,0,4⟩,⟨0,0,0,5,0,4⟩,⟨3,2,0,6,2,3⟩,⟨4,2,0,6,2,3⟩,⟨1,0,0,3,0,6⟩,⟨1,0,0,4,0,4⟩,⟨0,0,0,3,0,6⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,5,4,3⟩,⟨3,2,0,5,2,4⟩,⟨0,0,0,3,0,6⟩,⟨3,2,0,3,2,6⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,6,4,3⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,3,0,6⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,5,4,3⟩,⟨0,0,0,6,0,3⟩,⟨0,0,0,3,0,6⟩,⟨0,0,0,3,0,6⟩,⟨0,0,0,3,0,4⟩,⟨0,0,0,5,0,3⟩,⟨5,4,0,6,4,3⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,3,0,6⟩,⟨0,0,0,4,0,4⟩,⟨0,0,0,3,0,4⟩,⟨0,0,0,3,0,4⟩,⟨0,0,0,3,0,4⟩,⟨3,2,0,4,2,4⟩,⟨0,0,0,3,0,4⟩,⟨0,0,0,3,0,4⟩,⟨0,0,0,3,0,4⟩,⟨0,0,0,3,0,4⟩,⟨0,0,0,4,0,6⟩,⟨3,2,0,4,2,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,5,0,4⟩,⟨0,0,0,4,0,4⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,3,0,6⟩,⟨3,2,0,4,2,6⟩,⟨3,2,0,4,2,6⟩,⟨0,0,0,3,0,6⟩,⟨2,2,0,2,2,5⟩,⟨3,2,0,4,2,5⟩,⟨3,2,0,3,2,6⟩,⟨3,2,0,3,2,5⟩,⟨3,2,0,3,2,6⟩,⟨3,2,0,3,2,6⟩,⟨3,2,0,4,2,5⟩,⟨0,0,0,4,0,4⟩,⟨5,4,0,6,4,6⟩,⟨0,0,0,6,0,6⟩,⟨0,0,0,6,0,6⟩,⟨0,0,0,6,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,6,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,3,0,6⟩,⟨0,0,0,6,0,6⟩,⟨4,2,0,5,2,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,5,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,5,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,3,0,6⟩,⟨0,0,0,5,0,6⟩,⟨5,4,0,5,4,6⟩,⟨1,0,0,3,0,6⟩,⟨1,0,0,3,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,3,0,6⟩,⟨0,0,0,5,0,6⟩,⟨2,1,0,4,1,6⟩,⟨1,0,0,4,0,6⟩,⟨3,1,0,3,1,6⟩,⟨0,0,0,5,0,6⟩,⟨1,0,0,3,0,6⟩,⟨2,1,0,5,1,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨0,0,0,5,0,6⟩,⟨4,2,0,4,2,6⟩,⟨0,0,0,5,0,6⟩,⟨2,1,0,4,1,6⟩,⟨1,0,0,3,0,6⟩,⟨1,0,0,3,0,6⟩,⟨1,0,0,4,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,6,0,6⟩,⟨4,2,0,6,2,6⟩,⟨0,0,0,5,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,5,0,6⟩,⟨1,0,0,4,0,6⟩,⟨4,2,0,5,2,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,5,0,6⟩,⟨1,0,0,3,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,5,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨0,0,0,5,0,6⟩,⟨1,0,0,3,0,6⟩,⟨0,0,0,5,0,6⟩,⟨1,0,0,3,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,5,0,6⟩,⟨6,4,0,7,4,7⟩,⟨4,2,0,6,2,7⟩,⟨6,4,0,7,4,7⟩,⟨6,4,0,9,4,7⟩,⟨5,4,0,6,4,7⟩,⟨6,4,0,8,4,7⟩,⟨6,4,0,7,4,7⟩,⟨6,4,0,7,4,7⟩,⟨7,6,0,8,6,7⟩,⟨6,4,0,8,4,7⟩,⟨6,4,0,8,4,7⟩,⟨6,4,0,7,4,7⟩,⟨7,6,0,7,6,7⟩,⟨6,5,0,6,5,7⟩,⟨8,6,0,9,6,7⟩,⟨6,4,0,8,4,7⟩,⟨6,4,0,7,4,7⟩,⟨6,4,0,8,4,7⟩,⟨5,4,0,6,4,7⟩,⟨6,4,0,6,4,7⟩,⟨6,5,0,6,5,7⟩,⟨6,4,0,7,4,7⟩,⟨7,6,0,8,6,7⟩,⟨6,4,0,7,4,7⟩,⟨6,4,0,6,4,7⟩,⟨7,6,0,8,6,7⟩,⟨6,4,0,7,4,7⟩,⟨6,4,0,8,4,7⟩,⟨4,4,0,4,4,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,5,0,7⟩,⟨4,2,0,5,2,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,5,0,7⟩,⟨2,1,0,5,1,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,6,0,7⟩,⟨0,0,0,6,0,7⟩,⟨0,0,0,5,0,7⟩,⟨4,2,0,5,2,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,6,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,5,0,7⟩,⟨4,2,0,5,2,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,6,0,7⟩,⟨4,2,0,6,2,7⟩,⟨0,0,0,5,0,7⟩,⟨2,1,0,4,1,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,6,0,7⟩,⟨0,0,0,6,0,7⟩,⟨0,0,0,4,0,7⟩,⟨4,3,0,4,3,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,6,0,7⟩,⟨0,0,0,4,0,7⟩,⟨4,2,0,4,2,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,5,0,7⟩,⟨4,2,0,4,2,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,6,0,7⟩,⟨0,0,0,6,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,6,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,5,0,5⟩,⟨3,2,0,4,2,5⟩,⟨3,2,0,3,2,5⟩,⟨4,0,2,6,0,5⟩,⟨4,4,0,4,4,4⟩,⟨3,2,0,3,2,5⟩,⟨3,2,0,3,2,5⟩,⟨3,2,0,3,2,5⟩,⟨3,2,0,3,2,5⟩,⟨3,2,0,4,2,5⟩,⟨3,2,0,4,2,5⟩,⟨3,2,0,4,2,5⟩,⟨3,2,0,4,2,5⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,4,0,6⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,2,0,7⟩,⟨0,0,0,5,0,5⟩,⟨0,0,0,5,0,5⟩,⟨0,0,0,6,0,5⟩,⟨0,0,0,5,0,5⟩,⟨0,0,0,5,0,5⟩,⟨0,0,0,4,0,5⟩,⟨2,1,0,3,1,5⟩,⟨3,2,0,4,2,5⟩,⟨2,1,0,3,1,5⟩,⟨3,2,0,3,2,5⟩,⟨2,1,0,3,1,5⟩,⟨2,2,0,2,2,5⟩,⟨3,2,0,4,2,5⟩,⟨1,1,0,3,1,5⟩,⟨4,4,0,4,4,5⟩,⟨3,2,0,4,2,5⟩,⟨0,0,0,5,0,6⟩,⟨4,2,0,6,2,6⟩,⟨0,0,0,6,0,6⟩,⟨5,4,0,6,4,6⟩,⟨0,0,0,6,0,6⟩,⟨5,4,0,6,4,6⟩,⟨1,0,0,3,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨1,0,0,4,0,6⟩,⟨0,0,0,6,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,5,0,6⟩,⟨0,0,0,4,0,7⟩,⟨4,4,0,4,4,7⟩,⟨0,0,0,5,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨0,0,0,4,0,7⟩,⟨3,2,0,6,2,3⟩,⟨9,6,2,10,6,4⟩,⟨9,6,2,16,6,4⟩,⟨0,0,0,1,0,5⟩,⟨3,3,0,3,3,5⟩] + +/-- forced helper stops at one chart: max 0 (rk - ab - oa) (R1 with Y in the quotient) -/ +def forced (r : Row) : ℕ := r.rk - r.ab - r.oa +/-- need = rk - |Y|, |Y| = ab - kp -/ +def need (r : Row) : ℕ := r.rk - (r.ab - r.kp) + +theorem len : rows.length = 978 := by decide +kernel +/-- the 748 forced stops -/ +theorem forced_sum : (rows.map forced).sum = 748 := by decide +kernel +/-- by chart dimension 0..8 -/ +theorem forced_by_dim : (List.range 9).map (fun d => ((rows.filter fun r => r.dm == d).map forced).sum) + = [0, 122, 150, 109, 40, 29, 94, 96, 108] := by decide +kernel +/-- R5's own form: need - kp - oa gives the same 748 -/ +theorem forced_sum_need : (rows.map fun r => need r - r.kp - r.oa).sum = 748 := by decide +kernel +/-- feasibility control (0 violations): kp <= ab, |Y| <= rk, need <= sigma, and the two forms agree chartwise -/ +def ctl (r : Row) : Bool := + decide (r.kp ≤ r.ab ∧ r.ab - r.kp ≤ r.rk ∧ need r ≤ r.sg ∧ forced r = need r - r.kp - r.oa) +theorem control : rows.all ctl = true := by decide +kernel +theorem sums : (rows.map Row.ab).sum = 2074 ∧ (rows.map Row.oa).sum = 47 ∧ (rows.map Row.kp).sum = 1274 + ∧ (rows.map need).sum = 2063 := by decide +kernel + +/-- Fin-indexed sum = list sum -/ +theorem sum_fin_get {α : Type*} (g : α → ℕ) : ∀ L : List α, ∑ i : Fin L.length, g (L.get i) = (L.map g).sum + | [] => by simp + | a :: L => by simp [Fin.sum_univ_succ, sum_fin_get g L] +end FloorK22Data diff --git a/research/p104-lean-premises/lean/Nov15/FrameSep.lean b/research/p104-lean-premises/lean/Nov15/FrameSep.lean new file mode 100644 index 0000000000..abf460717d --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/FrameSep.md b/research/p104-lean-premises/lean/Nov15/FrameSep.md new file mode 100644 index 0000000000..16dbbd840e --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/HubSettle.lean b/research/p104-lean-premises/lean/Nov15/HubSettle.lean new file mode 100644 index 0000000000..8133032794 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/HubSettle.lean @@ -0,0 +1,351 @@ +/- +REBUILD-ALT joint-hub derivation (alt/r2, ROUNDLOG ALT r1/r2), See HubSettle.md. + +Build: imports the olean of RankLaw (which imports 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 Nov15/HubSettle.lean +-/ +import Nov15.RankLaw +import Mathlib.Data.Matrix.ColumnRowPartitioned + +set_option linter.unusedSectionVars false +namespace HubSettle +open Submodule Module Matrix RankLaw + +section Gauge +variable {K N G0 G1 NV ιU : Type*} [Field K] + [Fintype N] [Fintype G0] [Fintype G1] [Fintype NV] [Fintype ιU] + [DecidableEq N] [DecidableEq G0] [DecidableEq G1] [DecidableEq NV] [DecidableEq ιU] + +/-- G0-parts of the V-ender combinations with zero non-G0 part: `{y·B : y·A = 0}`. -/ +def kerPart (A : Matrix G1 N K) (B : Matrix G1 G0 K) : Submodule K (G0 → K) := + (LinearMap.ker A.vecMulLinear).map B.vecMulLinear + +variable (Xn : Matrix G1 N K) (X0 : Matrix G1 G0 K) (Rn : Matrix G1 N K) (R0 : Matrix G1 G0 K) + (Rn0 Fn0 : Matrix NV G0 K) (U0 V0 : Matrix ιU G0 K) + +/-- A {0}-prefix `M` (mixing the G0 initial rows) is valid if the non-V rows land on their targets +(`R_n0 · M = F_n0`) and the V mix then exists for the V-enders' end rows `[X_n | X_0·M]`. -/ +def Valid (M : Matrix G0 G0 K) : Prop := + Rn0 * M = Fn0 ∧ VMixM (fromCols Xn (X0 * M)) (fromCols Rn R0) + +/-- Row span of the V-enders after prefix `M`, as a range. -/ +abbrev P (M : Matrix G0 G0 K) : Submodule K (N ⊕ G0 → K) := + LinearMap.range (fromCols Xn (X0 * M)).vecMulLinear + +abbrev Q : Submodule K (N ⊕ G0 → K) := LinearMap.range (fromCols Rn R0).vecMulLinear + +theorem P_apply (M : Matrix G0 G0 K) (y : G1 → K) : + (fromCols Xn (X0 * M)).vecMulLinear y = Sum.elim (y ᵥ* Xn) ((y ᵥ* X0) ᵥ* M) := by + simp [vecMul_fromCols, vecMul_vecMul] + +theorem valid_iff (M : Matrix G0 G0 K) : + Valid Xn X0 Rn R0 Rn0 Fn0 M ↔ Rn0 * M = Fn0 ∧ P Xn X0 M = Q Rn R0 := by + unfold Valid; rw [vmixM_iff_span, ← range_vecMulLinear, ← range_vecMulLinear] + +/-- Kernel part of `P M`: `(0, v) ∈ P M` iff `v ∈ kerPart Xn X0 · M`. -/ +theorem zero_mem_P (M : Matrix G0 G0 K) (v : G0 → K) : + Sum.elim (0 : N → K) v ∈ P Xn X0 M ↔ v ∈ (kerPart Xn X0).map M.vecMulLinear := by + constructor + · rintro ⟨y, hy⟩ + rw [P_apply] at hy + have h1 : y ᵥ* Xn = 0 := by funext n; have := congrFun hy (Sum.inl n); simpa using this + have h2 : (y ᵥ* X0) ᵥ* M = v := by funext g; have := congrFun hy (Sum.inr g); simpa using this + exact ⟨y ᵥ* X0, ⟨y, h1, rfl⟩, h2⟩ + · rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩ + refine ⟨y, ?_⟩ + rw [P_apply] + have : y ᵥ* Xn = 0 := hy + simp [this] + +theorem zero_mem_Q (v : G0 → K) : Sum.elim (0 : N → K) v ∈ Q Rn R0 ↔ v ∈ kerPart Rn R0 := by + have := zero_mem_P Rn R0 (1 : Matrix G0 G0 K) v + simp only [P, Matrix.mul_one] at this + rw [Q, this] + constructor + · rintro ⟨w, hw, rfl⟩; simpa using hw + · intro hv; exact ⟨v, hv, by simp⟩ + +theorem span_rows_mul (A : Matrix ιU G0 K) (M : Matrix G0 G0 K) : + span K (Set.range (A * M).row) = (span K (Set.range A.row)).map M.vecMulLinear := by + rw [Submodule.map_span, ← Set.range_comp]; rfl + +/-- **Joint-hub gauge (ALT r2).** Suppose some prefix `M⋆` is valid (the native's), the rows of +`R_n0` and `U0` together span the G0 space (`[R_n0; U0]` has full column rank; square +invertible on #7623), `U0` spans the zero-non-G0 part of the V-enders' end rows and `V0` that of +their targets. Then for EVERY invertible `G`, any `M` with `R_n0·M = F_n0` and `U0·M = G·V0` is a +valid prefix. -/ +theorem prefix_valid (Mstar M : Matrix G0 G0 K) (GG : Matrix ιU ιU K) + (hstar : Valid Xn X0 Rn R0 Rn0 Fn0 Mstar) + (hspan : span K (Set.range Rn0.row) ⊔ span K (Set.range U0.row) = ⊤) + (hU0 : span K (Set.range U0.row) = kerPart Xn X0) + (hV0 : span K (Set.range V0.row) = kerPart Rn R0) + (hG : IsUnit GG.det) (hR : Rn0 * M = Fn0) (hUM : U0 * M = GG * V0) : + Valid Xn X0 Rn R0 Rn0 Fn0 M := by + rw [valid_iff] at hstar ⊢ + obtain ⟨hRs, hPQ⟩ := hstar + refine ⟨hR, ?_⟩ + -- the kernel part of P M is span V0 + have hGV : span K (Set.range (GG * V0).row) = span K (Set.range V0.row) := + ((vmixM_iff_span V0 (GG * V0)).1 ⟨GG, hG, rfl⟩).symm + have hkerM : (kerPart Xn X0).map M.vecMulLinear = kerPart Rn R0 := by + rw [← hU0, ← span_rows_mul, hUM, hGV, hV0] + have hkerS : (kerPart Xn X0).map Mstar.vecMulLinear = kerPart Rn R0 := by + ext v; rw [← zero_mem_P, hPQ, zero_mem_Q] + -- D = M - M⋆ sends every vector into kerPart Rn R0 + have hD : ∀ w : G0 → K, w ᵥ* M - w ᵥ* Mstar ∈ kerPart Rn R0 := by + intro w + have hw : w ∈ span K (Set.range Rn0.row) ⊔ span K (Set.range U0.row) := hspan ▸ mem_top + obtain ⟨a, ha, u, hu, rfl⟩ := mem_sup.1 hw + have haD : a ᵥ* M - a ᵥ* Mstar = 0 := by + rw [← range_vecMulLinear] at ha + obtain ⟨t, rfl⟩ := ha + simp only [vecMulLinear_apply, vecMul_vecMul, hR, hRs, sub_self] + have huM : u ᵥ* M ∈ kerPart Rn R0 := by + rw [← hkerM]; rw [hU0] at hu; exact ⟨u, hu, rfl⟩ + have huS : u ᵥ* Mstar ∈ kerPart Rn R0 := by + rw [← hkerS]; rw [hU0] at hu; exact ⟨u, hu, rfl⟩ + have : (a + u) ᵥ* M - (a + u) ᵥ* Mstar = (a ᵥ* M - a ᵥ* Mstar) + (u ᵥ* M - u ᵥ* Mstar) := by + simp only [add_vecMul]; abel + rw [this, haD, zero_add]; exact sub_mem huM huS + -- compare P M with P M⋆ = Q + have hdiff : ∀ y : G1 → K, (fromCols Xn (X0 * M)).vecMulLinear y - + (fromCols Xn (X0 * Mstar)).vecMulLinear y = Sum.elim (0 : N → K) ((y ᵥ* X0) ᵥ* M - (y ᵥ* X0) ᵥ* Mstar) := by + intro y; rw [P_apply, P_apply]; funext x; cases x <;> simp + apply le_antisymm + · rintro _ ⟨y, rfl⟩ + have h1 : (fromCols Xn (X0 * Mstar)).vecMulLinear y ∈ Q Rn R0 := hPQ ▸ ⟨y, rfl⟩ + have h2 := (zero_mem_Q Rn R0 _).2 (hD (y ᵥ* X0)) + rw [← hdiff] at h2 + simpa using add_mem h1 h2 + · rw [← hPQ] + rintro _ ⟨y, rfl⟩ + have h1 : (fromCols Xn (X0 * M)).vecMulLinear y ∈ P Xn X0 M := ⟨y, rfl⟩ + have h2 : Sum.elim (0 : N → K) ((y ᵥ* X0) ᵥ* M - (y ᵥ* X0) ᵥ* Mstar) ∈ P Xn X0 M := by + rw [zero_mem_P, hkerM]; exact hD _ + rw [← hdiff] at h2 + simpa using sub_mem h1 h2 + +/-- **Converse: the gauge is all of it.** Every valid prefix has `U0·M = G·V0` for some `G`; +if `U0`, `V0` have independent rows and `M` is invertible, `G` is invertible. -/ +theorem prefix_gauge (M : Matrix G0 G0 K) (hM : Valid Xn X0 Rn R0 Rn0 Fn0 M) + (hU0 : span K (Set.range U0.row) = kerPart Xn X0) + (hV0 : span K (Set.range V0.row) = kerPart Rn R0) : + ∃ GG : Matrix ιU ιU K, U0 * M = GG * V0 ∧ + (LinearIndependent K U0.row → LinearIndependent K V0.row → IsUnit M.det → IsUnit GG.det) := by + rw [valid_iff] at hM + have hkerM : (kerPart Xn X0).map M.vecMulLinear = kerPart Rn R0 := by + ext v; rw [← zero_mem_P, hM.2, zero_mem_Q] + have hrow : ∀ i, U0 i ᵥ* M ∈ LinearMap.range V0.vecMulLinear := by + intro i + rw [range_vecMulLinear, hV0, ← hkerM, ← hU0] + exact ⟨U0 i, subset_span ⟨i, rfl⟩, rfl⟩ + choose GG hGG using hrow + have hmul : U0 * M = Matrix.of GG * V0 := by + ext i j + have := congrFun (hGG i) j + simp only [vecMulLinear_apply] at this + change (U0 i ᵥ* M) j = (GG i ᵥ* V0) j + rw [this] + refine ⟨Matrix.of GG, hmul, fun hUi hVi hMu => ?_⟩ + rw [← Matrix.vecMul_injective_iff] at hUi hVi + rw [← Matrix.isUnit_iff_isUnit_det, ← Matrix.vecMul_injective_iff_isUnit] + have hMi : Function.Injective (fun v : G0 → K => v ᵥ* M) := + Matrix.vecMul_injective_iff_isUnit.2 ((Matrix.isUnit_iff_isUnit_det _).2 hMu) + intro t t' h + apply hUi; apply hMi + simp only [vecMul_vecMul, hmul] + rw [← vecMul_vecMul, ← vecMul_vecMul] + exact congrArg (fun w => w ᵥ* V0) h + +/-- **The V mix is unique once the prefix is fixed** — provided the V-enders' end rows +`[X_n | X_0·M]` are independent (rank X[G1] = |G1|, checked [C] on #7623: 1052). -/ +theorem vmix_unique (M : Matrix G0 G0 K) + (hind : LinearIndependent K (fromCols Xn (X0 * M)).row) (C C' : Matrix G1 G1 K) + (h : C * fromCols Xn (X0 * M) = fromCols Rn R0) (h' : C' * fromCols Xn (X0 * M) = fromCols Rn R0) : + C = C' := + vmixM_unique _ _ hind C C' h h' + +/-- **Finding (scope of "unique").** Without independent end rows the V mix is not unique: +one V-ender with end row 0 and target 0 admits every nonzero scalar. -/ +theorem vmix_not_unique_example : + Matrix.diagonal (fun _ : Unit => (2 : ℚ)) * 0 = (0 : Matrix Unit Unit ℚ) ∧ + (1 : Matrix Unit Unit ℚ) * 0 = 0 ∧ Matrix.diagonal (fun _ : Unit => (2 : ℚ)) ≠ 1 := by + refine ⟨by simp, by simp, fun h => ?_⟩ + have := congrFun (congrFun h ()) (); simp [Matrix.diagonal] at this + +/-- **The prefix formula.** If the stack `[R_n0; U0]` is square (via `e`) and invertible, then +`M = [R_n0; U0]⁻¹ [F_n0; G·V0]` solves both block equations, and the spanning hypothesis of +`prefix_valid` holds. -/ +theorem prefix_formula (e : G0 ≃ NV ⊕ ιU) (GG : Matrix ιU ιU K) + (hA : IsUnit ((fromRows Rn0 U0).submatrix e id).det) : + let M := ((fromRows Rn0 U0).submatrix e id)⁻¹ * (fromRows Fn0 (GG * V0)).submatrix e id + Rn0 * M = Fn0 ∧ U0 * M = GG * V0 ∧ + span K (Set.range Rn0.row) ⊔ span K (Set.range U0.row) = ⊤ := by + intro M + set A := (fromRows Rn0 U0).submatrix e id + have hAM : A * M = (fromRows Fn0 (GG * V0)).submatrix e id := by + rw [show M = A⁻¹ * (fromRows Fn0 (GG * V0)).submatrix e id from rfl, ← Matrix.mul_assoc, + Matrix.mul_nonsing_inv _ hA, Matrix.one_mul] + have hstack : fromRows Rn0 U0 * M = fromRows Fn0 (GG * V0) := by + ext r j + have := congrFun (congrFun hAM (e.symm r)) j + simp only [A, Matrix.mul_apply, Matrix.submatrix_apply, id, Equiv.apply_symm_apply] at this + rw [Matrix.mul_apply]; exact this + rw [fromRows_mul] at hstack + obtain ⟨h1, h2⟩ := fromRows_inj hstack + refine ⟨h1, h2, eq_top_iff.2 (fun w _ => ?_)⟩ + have hw : w = (w ᵥ* A⁻¹) ᵥ* A := by + rw [vecMul_vecMul, Matrix.nonsing_inv_mul _ hA, vecMul_one] + rw [hw] + have hrows : ∀ g, A g ∈ span K (Set.range Rn0.row) ⊔ span K (Set.range U0.row) := by + intro g + obtain ⟨x, hx⟩ : ∃ x, e g = x := ⟨_, rfl⟩ + have : A g = fromRows Rn0 U0 x := by rw [← hx]; rfl + rw [this] + rcases x with r | u + · exact mem_sup_left (subset_span ⟨r, by funext j; simp [Matrix.row]⟩) + · exact mem_sup_right (subset_span ⟨u, by funext j; simp [Matrix.row]⟩) + have : (w ᵥ* A⁻¹) ᵥ* A ∈ span K (Set.range A.row) := by + rw [← range_vecMulLinear]; exact ⟨_, rfl⟩ + exact (span_le.2 (by rintro _ ⟨g, rfl⟩; exact hrows g)) this + +/-- **Gauge changes the determinant.** `det M_G = det G · det M_I`: the prefix for gauge `G` +differs from the `G = 1` prefix by exactly `det G`. -/ +theorem det_prefix_gauge (e : G0 ≃ NV ⊕ ιU) (GG : Matrix ιU ιU K) : + (((fromRows Rn0 U0).submatrix e id)⁻¹ * (fromRows Fn0 (GG * V0)).submatrix e id).det = + GG.det * (((fromRows Rn0 U0).submatrix e id)⁻¹ * (fromRows Fn0 V0).submatrix e id).det := by + have hB : (fromRows Fn0 (GG * V0)).submatrix e id = + (fromBlocks 1 0 0 GG).submatrix e e * (fromRows Fn0 V0).submatrix e id := by + ext g j + simp only [Matrix.mul_apply, Matrix.submatrix_apply, id] + rw [← Equiv.sum_comp e.symm] + simp only [Equiv.apply_symm_apply, Fintype.sum_sum_type] + rcases e g with r | u + · simp [fromBlocks, Matrix.one_apply] + · simp [fromBlocks, Matrix.mul_apply] + rw [hB, Matrix.det_mul, Matrix.det_mul, Matrix.det_mul, Matrix.det_submatrix_equiv_self, + det_fromBlocks_zero₂₁, Matrix.det_one, one_mul] + ring + +end Gauge +section Prefix +open TokenCancel +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] [DecidableEq C] + +/-- Apply a linear map to every row (a change of initial-row coordinates). -/ +def mapRows (L : (Reg → K) →ₗ[K] (Reg → K)) (s : St K Reg C) : St K Reg C := + ⟨fun r => L (s.row r), s.loc⟩ + +/-- Ops commute with any coordinate change that fixes the birth tokens. -/ +theorem step_mapRows (L : (Reg → K) →ₗ[K] (Reg → K)) (s : St K Reg C) (e : Ev K Reg C) + (hb : ∀ i c, e = .born i c → L (Pi.single i 1) = Pi.single i 1) : + step (mapRows L s) e = mapRows L (step s e) := by + cases e with + | born i c => + simp only [step, mapRows, St.mk.injEq, and_true] + funext r; by_cases hr : r = i + · subst hr; simp [hb r c rfl] + · simp [Function.update_of_ne hr] + | init i c => + simp only [step, mapRows, St.mk.injEq, and_true] + funext r; by_cases hr : r = i + · subst hr; simp + · simp [Function.update_of_ne hr] + | move i c => rfl + | add i j a c => + simp only [step, mapRows, St.mk.injEq, and_true] + funext r; by_cases hr : r = i + · subst hr; simp + · simp [Function.update_of_ne hr] + | scale i u c => + simp only [step, mapRows, St.mk.injEq, and_true] + funext r; by_cases hr : r = i + · subst hr; simp + · simp [Function.update_of_ne hr] + | clear i c => + simp only [step, mapRows, St.mk.injEq, and_true] + funext r; by_cases hr : r = i + · subst hr; simp + · simp [Function.update_of_ne hr] + | copy i j c => + simp only [step, mapRows, St.mk.injEq, and_true] + funext r; by_cases hr : r = i + · subst hr; simp + · simp [Function.update_of_ne hr] + +/-- **The {0}-prefix is a right multiplication on the G0 columns.** Mixing the initial rows of +the {0}-born registers by `L` (any linear map fixing the tokens of the registers born later) and +then running the mid program gives `L` applied to the end rows of the unmixed run. With +`L v = v ᵥ* M` on the G0 columns this is `[X_n | X_0·M]`. -/ +theorem run_mapRows (L : (Reg → K) →ₗ[K] (Reg → K)) (s : St K Reg C) (evs : List (Ev K Reg C)) + (hb : ∀ i c, Ev.born i c ∈ evs → L (Pi.single i 1) = Pi.single i 1) : + run (mapRows L s) evs = mapRows L (run s evs) := by + induction evs generalizing s with + | nil => rfl + | cons e es ih => + simp only [run] + rw [step_mapRows L s e (fun i c he => hb i c (he ▸ List.mem_cons_self))] + exact ih _ (fun i c h => hb i c (List.mem_cons_of_mem _ h)) + +end Prefix + +section Local +/-! ## Localisation `A = ℤ[1/m] ⊆ ℚ` (any domain `A` with an injective map into a field `F`). -/ +variable {A F n : Type*} [CommRing A] [Field F] [Fintype n] [DecidableEq n] (φ : A →+* F) + +/-- `M` lies in `GL_n(A)`: it is the image of an `A`-matrix with unit determinant. -/ +def InGL (M : Matrix n n F) : Prop := ∃ M' : Matrix n n A, IsUnit M'.det ∧ M'.map φ = M + +theorem det_map' (X : Matrix n n A) : (X.map φ).det = φ X.det := by + rw [RingHom.map_det]; rfl + +/-- **Sufficiency.** If `A1`, `B` are `A`-matrices with unit determinants, the solution of +`A1·M = B` over `F` lies in `GL_n(A)`: no non-unit denominators can appear. -/ +theorem solve_inGL (A1 B : Matrix n n A) (h1 : IsUnit A1.det) (h2 : IsUnit B.det) + (M : Matrix n n F) (hM : A1.map φ * M = B.map φ) : InGL φ M := by + refine ⟨A1⁻¹ * B, ?_, ?_⟩ + · rw [Matrix.det_mul, Matrix.det_nonsing_inv, Ring.inverse_of_isUnit h1] + exact (h1.unit⁻¹).isUnit.mul h2 + · have hA1 : IsUnit (A1.map φ).det := by + rw [det_map']; exact h1.map φ + have hsol : A1.map φ * (A1⁻¹ * B).map φ = B.map φ := by + rw [← Matrix.map_mul, ← Matrix.mul_assoc, Matrix.mul_nonsing_inv _ h1, Matrix.one_mul] + have := congrArg (fun X => (A1.map φ)⁻¹ * X) (hsol.trans hM.symm) + simpa [← Matrix.mul_assoc, Matrix.nonsing_inv_mul _ hA1] using this + +/-- **Necessity is only for the ratio.** If `M ∈ GL_n(A)` solves `A1·M = B`, then +`φ(det B) = φ(u)·φ(det A1)` for a unit `u` of `A`; the individual determinants need not be units. -/ +theorem inGL_det_ratio (A1 B : Matrix n n A) (M : Matrix n n F) (hM : A1.map φ * M = B.map φ) + (hG : InGL φ M) : ∃ u : Aˣ, φ B.det = φ u * φ A1.det := by + obtain ⟨M', hu, rfl⟩ := hG + refine ⟨hu.unit, ?_⟩ + have := congrArg Matrix.det hM + rw [Matrix.det_mul, det_map', det_map', det_map'] at this + rw [← this, IsUnit.unit_spec, mul_comm] + +/-- **Finding: the literal "iff" is false.** Over `A = ℤ ⊆ ℚ`: `A1 = B = (2)` gives `M = 1 ∈ GL(ℤ)` +although `det A1 = 2` is not a unit of `ℤ`. -/ +theorem iff_false_example : + let A1 : Matrix Unit Unit ℤ := Matrix.diagonal fun _ => 2 + A1.map (Int.castRingHom ℚ) * 1 = A1.map (Int.castRingHom ℚ) ∧ + InGL (Int.castRingHom ℚ) (1 : Matrix Unit Unit ℚ) ∧ ¬ IsUnit A1.det := by + intro A1 + refine ⟨Matrix.mul_one _, ⟨1, by simp, by simp⟩, ?_⟩ + simp only [A1, Matrix.det_diagonal, Finset.univ_unique, Finset.prod_singleton] + decide + +end Local + +#print axioms HubSettle.prefix_valid +#print axioms HubSettle.prefix_gauge +#print axioms HubSettle.prefix_formula +#print axioms HubSettle.vmix_unique +#print axioms HubSettle.vmix_not_unique_example +#print axioms HubSettle.det_prefix_gauge +#print axioms HubSettle.solve_inGL +#print axioms HubSettle.inGL_det_ratio +#print axioms HubSettle.iff_false_example +#print axioms HubSettle.run_mapRows +end HubSettle diff --git a/research/p104-lean-premises/lean/Nov15/HubSettle.md b/research/p104-lean-premises/lean/Nov15/HubSettle.md new file mode 100644 index 0000000000..65daeac589 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/HubSettle.md @@ -0,0 +1,42 @@ +# HubSettle.lean: rebuild joint-hub derivation (alt/r2; internal log ALT r1/r2). No sorry, ~6 s, 2.1 GB RSS +Imports the RankLaw olean (see header). Axioms: [propext, Classical.choice, Quot.sound]. + +**Setting** (matrix level, any field K). +- V-enders' end rows after the mid program (both hubs deleted): [X_n | X_0], with columns split as non-G0 | G0. Their targets: [R_n | R_0]. +- Non-V rows: G0-parts R_n0 and targets F_n0. Their non-G0 parts are hub-invariant and assumed exact. +- U0 spans `kerPart X_n X_0` = {y·X_0 : y·X_n = 0}; V0 spans `kerPart R_n R_0`. Both are indexed by the same ιU (n = |ιU|; 616 on #7623). +- `Valid M`: R_n0·M = F_n0 and the V mix exists for [X_n | X_0·M] (RankLaw.VMixM). + +**Why a prefix is a right multiplication** (`run_mapRows`). +- In TokenCancel's op model, any linear change L of the initial rows commutes with the whole run, provided L fixes the tokens of later births. +- So a {0}-prefix acting on the {0}-born rows turns the end rows into [X_n | X_0·M]. +- With no MOVE into {0} and none out of V (TokenCancel T1), the deleted hub ops are exactly such a prefix plus a V suffix. That reduction stays the [C]/T1 input. + +**Results.** +- `prefix_valid` (the gauge is GL_n). Assume: + - one valid prefix M⋆ exists (the native's); + - rows(R_n0) + rows(U0) span K^{G0} (square invertible stack on #7623). + + Then for EVERY invertible G, any M with R_n0·M = F_n0 and U0·M = G·V0 is valid. + - Proof: M − M⋆ kills rows(R_n0) and sends rows(U0) into span V0, so it shifts the V-ender span only inside its own kernel part (0 ⊕ span V0). +- `prefix_formula`: if [R_n0; U0] is square (via e) with unit det, then M = [R_n0;U0]⁻¹[F_n0; G·V0] satisfies both block equations and the spanning hypothesis. +- `prefix_gauge` (converse): every valid M has U0·M = G·V0 for some G. G is invertible when U0 and V0 have independent rows and M is invertible. +- `vmix_unique`: once M is fixed, the V mix is unique if [X_n | X_0·M] has independent rows. `vmix_not_unique_example` shows that hypothesis is needed. +- `det_prefix_gauge`: det M_G = det G · det M_1. + +**Localisation A = ℤ[1/m]** (any ring A with φ : A → F). +- `solve_inGL`: if A1 = [R_n0;U0] and B = [F_n0;G·V0] are A-matrices with unit determinants, the F-solution M lies in GL_n(A). +- `inGL_det_ratio`: if M ∈ GL_n(A), then only the RATIO det B / det A1 must be (the image of) a unit. + +Why this rules out the round-1 "non-dyadic" artefact: +- r1 used RREF Q-bases. They are a Q-gauge: U0 and V0 change by Q-invertible H, H', so A1 and B are not A-matrices with unit dets. +- By `det_prefix_gauge` the determinant of M moves by det G (likewise for the U0 base change), and a non-unit det means M ∉ GL(A). That is what r1 saw ("smooth M, det not a unit, factor fails at pivot 1059"). +- With A-unimodular bases (r2: det[R_n0;U0A] and det[F_n0;V0A] are smooth units) and G = I, `solve_inGL` puts M in GL(A). So the failure was a property of the gauge, not of the word, as ALT r2 concluded. + +**Finding (prose false as written).** "M ∈ GL(A) iff the determinants are units of A": the "if" holds (`solve_inGL`), the "only if" is false. +- `iff_false_example`: over ℤ ⊂ ℚ, A1 = B = (2) gives M = 1 ∈ GL(ℤ) with det A1 = 2 a non-unit. +- Minimal fix: "if both determinants are A-units then M ∈ GL(A); conversely M ∈ GL(A) forces only det B / det A1 ∈ A^×". + +**Scope.** +- The existence of one valid prefix (the native's) is an input. Without it the "psi" condition can fail (ALT r2 jsearch: 1,153 such deletions), and no gauge helps. +- "The V mix is unique" needs rank X[G1] = |G1|, checked [C] on #7623. diff --git a/research/p104-lean-premises/lean/Nov15/JointCeiling.lean b/research/p104-lean-premises/lean/Nov15/JointCeiling.lean new file mode 100644 index 0000000000..4989827790 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/JointCeiling.md b/research/p104-lean-premises/lean/Nov15/JointCeiling.md new file mode 100644 index 0000000000..9672a4cb33 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/JunkLB2.lean b/research/p104-lean-premises/lean/Nov15/JunkLB2.lean new file mode 100644 index 0000000000..d9d034ea16 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/JunkLB2.md b/research/p104-lean-premises/lean/Nov15/JunkLB2.md new file mode 100644 index 0000000000..38163ae6b5 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/LemmaW.lean b/research/p104-lean-premises/lean/Nov15/LemmaW.lean new file mode 100644 index 0000000000..3bc119232e --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/LemmaW.lean @@ -0,0 +1,145 @@ +/- +LEMMA W (BORROW R12 §2; ). Caller stage model of CallerBorrow.lean: +units T_s = 1 - 2 x_s y_s^T, prefix `pp s = T_{s-1}...T_0`, mask projector `pm m`. +Thin units u_j = a+j (j simp + | succ k ih => + rw [← add_assoc, pp_succ_entry, ih, Finset.sum_range_succ]; ring + +/-- a matrix commuting with `pm m` has no entry from a masked-in column to a masked-out row. -/ +theorem entry_zero_of_commute {M : Matrix ι ι K} (h : Commute (pm m) M) {r c : ι} + (hr : ¬ m r) (hc : m c) : M r c = 0 := by + have := congrFun (congrFun h.eq r) c + simp only [pm, Matrix.diagonal_mul, Matrix.mul_diagonal, hr, hc, if_true, if_false] at this + simpa using this.symm + +/-- **Lemma W, exact form (no commutation of A needed).** If the prefix before the stage commutes with +`pm m`, then for a role `r ∉ m` and `c ∈ m`: `2 Σ_j x_{a+j}[r] (y_{a+j}^T Q_{j-1})[c] = A[r,c]`. -/ +theorem lemmaW_defect (x y : ℕ → ι → K) (a k : ℕ) + (hcomm : Commute (pm m) (pp x y (a + k))) {r c : ι} (hr : ¬ m r) (hc : m c) : + 2 * ∑ j ∈ Finset.range k, x (a + j) r * (y (a + j) ᵥ* pp x y (a + j)) c = pp x y a r c := by + have h0 := entry_zero_of_commute m hcomm hr hc + have h1 := pp_window_entry x y a k r c + rw [h0] at h1 + linear_combination h1 + +/-- **LEMMA W (i).** If moreover the cut prefix `A = pp a` commutes with `pm m` ("R untouched before"), +and `2 ≠ 0`: `Σ_j x_{a+j}[r] (y_{a+j}^T Q_{j-1})|_m = 0` for every borrowed role `r ∉ m`. -/ +theorem lemmaW (x y : ℕ → ι → K) (a k : ℕ) (h2 : (2 : K) ≠ 0) + (hA : Commute (pm m) (pp x y a)) (hcomm : Commute (pm m) (pp x y (a + k))) + {r c : ι} (hr : ¬ m r) (hc : m c) : + ∑ j ∈ Finset.range k, x (a + j) r * (y (a + j) ᵥ* pp x y (a + j)) c = 0 := by + have h := lemmaW_defect m x y a k hcomm hr hc + rw [entry_zero_of_commute m hA hr hc] at h + exact (mul_eq_zero.1 h).resolve_left h2 + +/-- vector form: the row vector `Σ_j x_{a+j}[r] w_j`, restricted to the mask, vanishes. -/ +theorem lemmaW_vec (x y : ℕ → ι → K) (a k : ℕ) (h2 : (2 : K) ≠ 0) + (hA : Commute (pm m) (pp x y a)) (hcomm : Commute (pm m) (pp x y (a + k))) {r : ι} (hr : ¬ m r) : + (∑ j ∈ Finset.range k, x (a + j) r • (y (a + j) ᵥ* pp x y (a + j))) ᵥ* pm m = 0 := by + funext c + rw [vecMul_pm_apply] + by_cases hc : m c + · simp only [hc, if_true, Finset.sum_apply, Pi.smul_apply, smul_eq_mul, Pi.zero_apply] + exact lemmaW m x y a k h2 hA hcomm hr hc + · simp [hc] + +/-- **LEMMA W (ii): unique toucher.** If exactly one thin `a+j₀` has `x[r] ≠ 0` (every other thin has +`x[r] = 0`), its pulled-back covector vanishes on the whole mask. -/ +theorem lemmaW_unique (x y : ℕ → ι → K) (a k : ℕ) (h2 : (2 : K) ≠ 0) + (hA : Commute (pm m) (pp x y a)) (hcomm : Commute (pm m) (pp x y (a + k))) + {r : ι} (hr : ¬ m r) {j₀ : ℕ} (hj₀ : j₀ < k) (hother : ∀ j, j < k → j ≠ j₀ → x (a + j) r = 0) + (hx : x (a + j₀) r ≠ 0) {c : ι} (hc : m c) : + (y (a + j₀) ᵥ* pp x y (a + j₀)) c = 0 := by + have h := lemmaW m x y a k h2 hA hcomm hr hc + rw [Finset.sum_eq_single j₀ (fun j hj hne => by rw [hother j (Finset.mem_range.1 hj) hne]; simp) + (fun hn => absurd (Finset.mem_range.2 hj₀) hn)] at h + exact (mul_eq_zero.1 h).resolve_left hx + +theorem isUnit_pp {x y : ℕ → ι → K} (hu : ∀ s, IsUnit (unitM (x s) (y s))) (a : ℕ) : + IsUnit (pp x y a) := by + induction a with + | zero => simp [pp] + | succ a ih => rw [pp]; exact (hu _).mul ih + +theorem vecMul_eq_zero_of_isUnit {A : Matrix ι ι K} (hA : IsUnit A) {v : ι → K} + (h : v ᵥ* A = 0) : v = 0 := by + obtain ⟨u, rfl⟩ := hA + have : (v ᵥ* (u : Matrix ι ι K)) ᵥ* ((u⁻¹ : (Matrix ι ι K)ˣ) : Matrix ι ι K) = 0 := by + rw [h]; simp + rwa [Matrix.vecMul_vecMul, ← Units.val_mul, mul_inv_cancel, Units.val_one, vecMul_one] at this + +/-- **LEMMA W (ii): single-thin impossibility.** One thin (`k = 1`) touching a role `r ∉ m` (`x[r] ≠ 0`) +before a stage with mask `m`, cut prefix commuting with `m` and invertible units, forces `y` to vanish on +the whole mask `m = m_R`. Hence if the thin has any support on `m_R` (`pm m y ≠ 0`) it cannot borrow. -/ +theorem single_thin_forces (x y : ℕ → ι → K) (a : ℕ) (h2 : (2 : K) ≠ 0) + (hu : ∀ s, IsUnit (unitM (x s) (y s))) + (hA : Commute (pm m) (pp x y a)) (hcomm : Commute (pm m) (pp x y (a + 1))) + {r : ι} (hr : ¬ m r) (hx : x a r ≠ 0) : InMask (fun i => ¬ m i) (y a) := by + -- covector w = y_a^T A vanishes on m + have hw : ∀ c, m c → (y a ᵥ* pp x y a) c = 0 := fun c hc => by + have := lemmaW_unique m x y a 1 h2 hA hcomm hr (j₀ := 0) (by omega) + (fun j hj hne => absurd (by omega) hne) (by simpa using hx) hc + simpa using this + have h1 : (y a ᵥ* pm m) ᵥ* pp x y a = 0 := by + rw [Matrix.vecMul_vecMul, hA.eq, ← Matrix.vecMul_vecMul] + funext c + rw [vecMul_pm_apply] + by_cases hc : m c + · simpa [hc] using hw c hc + · simp [hc] + have h3 := vecMul_eq_zero_of_isUnit (isUnit_pp hu a) h1 + intro i hi + have := congrFun h3 i + rw [vecMul_pm_apply] at this + have hmi : m i := by simpa using hi + simpa [hmi] using this + +/-- the identity cannot be strengthened: a thin with `y` off the mask may touch a borrowed role alone +(`ι = Fin 2`, `m = {0}`, `x = y = e_1`, `T = diag(1,-1)`; prefix before the stage commutes with `m`). -/ +example : ∃ (x y : ℕ → Fin 2 → ℚ) (m : Fin 2 → Prop) (_ : DecidablePred m), + Commute (pm m) (pp x y 0) ∧ Commute (pm m) (pp x y (0 + 1)) ∧ ¬ m 1 ∧ x 0 1 ≠ 0 ∧ y 0 0 = 0 := by + refine ⟨fun _ => ![0, 1], fun _ => ![0, 1], fun i => i = 0, inferInstance, ?_, ?_, by simp, by simp, by simp⟩ + · simp [pp] + · show pm _ * _ = _ * pm _ + ext i j + fin_cases i <;> fin_cases j <;> + simp [pm, pp, unitM, vecMulVec, Matrix.mul_apply, Fin.sum_univ_two, Matrix.one_apply] + +end LemmaW + +#print axioms LemmaW.pp_window_entry +#print axioms LemmaW.lemmaW_defect +#print axioms LemmaW.lemmaW +#print axioms LemmaW.lemmaW_vec +#print axioms LemmaW.lemmaW_unique +#print axioms LemmaW.single_thin_forces diff --git a/research/p104-lean-premises/lean/Nov15/LemmaW.md b/research/p104-lean-premises/lean/Nov15/LemmaW.md new file mode 100644 index 0000000000..1caf113413 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/LemmaW.md @@ -0,0 +1,13 @@ +# LemmaW.lean: BORROW Lemma W (R12 §2) in the caller stage model +Kernel-only, no sorry/native_decide, all axioms [propext, Classical.choice, Quot.sound]; 9 s / 2.0 GB. Imports Nov15.CallerBorrow (model: `unitM`, `pp`, `pm`). +## Model +Units T_s = 1 - 2 x_s y_s^T; prefix `pp s = T_{s-1}..T_0`. Cut prefix A = `pp a`; thins u_j = index a+j (j y vanishes on m_R (`InMask ¬m`). So a thin with ANY support of y on m_R cannot borrow alone; needs >= 2 thins with cancelling contributions. +## Verdict: paper statement TRUE, with one sharpening (not false) +R12 says a single toucher "needs its pulled-back covector to vanish on all of m_R": correct (`lemmaW_unique`). The gloss "impossible with a single thin" holds exactly when the thin's y meets m_R (pm y ≠ 0, with A invertible and commuting: w|_m = (pm y)^T A, zero iff pm y = 0). A single thin with y supported OFF m_R and x on r is consistent with Lemma W (Lean `example` in the file: Fin 2, m={0}, x=y=e_1, both prefixes commute). Hypothesis list: A commutes with m (else the defect term A[r,c] appears, `lemmaW_defect`), char ≠ 2. +Not formalised: "≥2 cancelling thins is achievable" (only the necessary condition), the rank/Jacobian rigidity numerics of R12 §2. diff --git a/research/p104-lean-premises/lean/Nov15/NativeColumns.lean b/research/p104-lean-premises/lean/Nov15/NativeColumns.lean new file mode 100644 index 0000000000..c61ec7cd6a --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/NativeColumns.lean @@ -0,0 +1,172 @@ +/- +LEAN-PREM3, Nov 17. #7620 premise `native_all_columns`: what "exact final rows" buys. +See NativeColumns.md. +Part A: data-level execution of a TokenCancel word over ANY K-module equals the row matrix +applied to the data (all columns, all tensor widths); exact rows <-> correct on every column. +Part B: column-test logic (basis columns determine a map; fewer do not; adjoint adds no +coverage; global phase is invisible to Pauli action but not to columns; census coverage). +-/ +import Nov15.TokenCancel +import Mathlib.LinearAlgebra.Matrix.ToLin +import Mathlib.Data.Matrix.Basic +import Mathlib.Data.Complex.Basic + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace NativeColumns +open TokenCancel + +section PartA +variable {K Reg C M : Type*} [Field K] [DecidableEq Reg] [DecidableEq C] [Fintype Reg] + [AddCommGroup M] [Module K M] + +/-- Data-level step: run the same event on actual data `v` (born reads the input `x`). -/ +def dstep (x v : Reg → M) : Ev K Reg C → (Reg → M) + | .born i _ => Function.update v i (x i) + | .init i _ => Function.update v i 0 + | .move _ _ => v + | .add i j a _ => Function.update v i (v i + a • v j) + | .scale i u _ => Function.update v i (u • v i) + | .clear i _ => Function.update v i 0 + | .copy i j _ => Function.update v i (v j) + +def drun (x : Reg → M) : (Reg → M) → List (Ev K Reg C) → (Reg → M) + | v, [] => v + | v, e :: es => drun x (dstep x v e) es + +/-- A row matrix applied to data. -/ +def evalRows (row : Reg → Reg → K) (x : Reg → M) : Reg → M := fun i => ∑ j, row i j • x j + +theorem evalRows_one (x : Reg → M) : evalRows (fun i j => (Pi.single i (1:K) : Reg → K) j) x = x := by + funext i + simp [evalRows, Pi.single_apply] + +theorem dstep_eval (x : Reg → M) (s : St K Reg C) (e : Ev K Reg C) : + dstep x (evalRows s.row x) e = evalRows (step s e).row x := by + cases e with + | born i c => + funext k + by_cases hk : k = i + · subst hk; simp [dstep, step, evalRows, Pi.single_apply] + · simp [dstep, step, evalRows, hk] + | init i c => + funext k + by_cases hk : k = i + · subst hk; simp [dstep, step, evalRows] + · simp [dstep, step, evalRows, hk] + | move i c => rfl + | add i j a c => + funext k + by_cases hk : k = i + · subst hk; simp [dstep, step, evalRows, add_smul, Finset.sum_add_distrib, Finset.smul_sum, smul_smul] + · simp [dstep, step, evalRows, hk] + | scale i u c => + funext k + by_cases hk : k = i + · subst hk; simp [dstep, step, evalRows, Finset.smul_sum, smul_smul] + · simp [dstep, step, evalRows, hk] + | clear i c => + funext k + by_cases hk : k = i + · subst hk; simp [dstep, step, evalRows] + · simp [dstep, step, evalRows, hk] + | copy i j c => + funext k + by_cases hk : k = i + · subst hk; simp [dstep, step, evalRows] + · simp [dstep, step, evalRows, hk] + +/-- Simulation: executing the word on data = (final rows) applied to the initial data. -/ +theorem drun_eval (x : Reg → M) (es : List (Ev K Reg C)) (s : St K Reg C) : + drun x (evalRows s.row x) es = evalRows (run s es).row x := by + induction es generalizing s with + | nil => rfl + | cons e es ih => simp only [drun, run]; rw [dstep_eval]; exact ih _ + +/-- Item 1: exact final rows = target rows => the word is correct on EVERY input, in EVERY +K-module (every column count, every tensor power `V^n`, any coefficient module). -/ +theorem all_columns_of_exact_rows (x : Reg → M) (es : List (Ev K Reg C)) (s : St K Reg C) + (T : Reg → Reg → K) (h : (run s es).row = T) : + drun x (evalRows s.row x) es = evalRows T x := by + rw [drun_eval, h] + +/-- Starting from the identity rows with data `x`, the word computes `T x`. -/ +theorem word_computes (x : Reg → M) (es : List (Ev K Reg C)) (s : St K Reg C) + (hs : s.row = fun i j => (Pi.single i (1:K) : Reg → K) j) (T : Reg → Reg → K) + (h : (run s es).row = T) : drun x x es = evalRows T x := by + have := all_columns_of_exact_rows x es s T h + rwa [hs, evalRows_one] at this + +/-- Converse (so exactness of rows is exactly the all-column statement): if the word agrees +with `T` on every unit column `e_c` over `K`, the final rows equal `T`. -/ +theorem exact_rows_of_columns (es : List (Ev K Reg C)) (s : St K Reg C) (T : Reg → Reg → K) + (h : ∀ c : Reg, drun (Pi.single c (1:K)) (evalRows s.row (Pi.single c (1:K))) es + = evalRows T (Pi.single c (1:K))) : (run s es).row = T := by + funext i c + have := congrFun (h c) i + rw [drun_eval] at this + simpa [evalRows, Pi.single_apply] using this + +theorem exact_rows_iff_columns (es : List (Ev K Reg C)) (s : St K Reg C) (T : Reg → Reg → K) : + (run s es).row = T ↔ ∀ c : Reg, drun (Pi.single c (1:K)) (evalRows s.row (Pi.single c (1:K))) es + = evalRows T (Pi.single c (1:K)) := + ⟨fun h c => all_columns_of_exact_rows _ es s T h, exact_rows_of_columns es s T⟩ + +end PartA + +section PartB + +/-- Basis columns determine a matrix. -/ +theorem matrix_ext_cols {R : Type*} [Semiring R] {m n : Type*} [Fintype n] [DecidableEq n] + (A B : Matrix m n R) (h : ∀ c, A.mulVec (Pi.single c 1) = B.mulVec (Pi.single c 1)) : A = B := by + ext i c + have := congrFun (h c) i + simpa using this + +/-- Agreement on a spanning set of columns suffices (not only the unit vectors). -/ +theorem linear_ext_span {K V W : Type*} [Field K] [AddCommGroup V] [Module K V] + [AddCommGroup W] [Module K W] (f g : V →ₗ[K] W) (S : Set V) + (hS : Submodule.span K S = ⊤) (h : ∀ v ∈ S, f v = g v) : f = g := + LinearMap.ext_on hS h + +/-- Fewer than all columns do not suffice: a 2x2 witness over `ℚ` agreeing on column 0. -/ +theorem partial_columns_insufficient : + ∃ A B : Matrix (Fin 2) (Fin 2) ℚ, + A.mulVec (Pi.single 0 1) = B.mulVec (Pi.single 0 1) ∧ A ≠ B := by + refine ⟨!![1, 0; 0, 1], !![1, 0; 0, 2], ?_, ?_⟩ + · funext i; fin_cases i <;> simp [Matrix.mulVec, dotProduct, Fin.sum_univ_two] + · intro h + have := congrFun (congrFun h 1) 1 + simp at this + +/-- The adjoint column test adds no coverage: forward exactness <-> adjoint exactness. -/ +theorem adjoint_iff_forward {m n : Type*} (A B : Matrix m n ℂ) : Matrix.conjTranspose A = Matrix.conjTranspose B ↔ A = B := + Matrix.conjTranspose_inj + +/-- Global phase is invisible to a Pauli-conjugation action but visible on every column: +`c • A` and `A` differ whenever `c ≠ 1` and `A ≠ 0` (here: `A` has a nonzero entry). -/ +theorem phase_visible {m n : Type*} (A : Matrix m n ℂ) (i : m) (j : n) (hA : A i j ≠ 0) + (c : ℂ) (hc : c ≠ 1) : c • A ≠ A := by + intro h + have := congrFun (congrFun h i) j + simp only [Matrix.smul_apply, smul_eq_mul] at this + have : (c - 1) * A i j = 0 := by rw [sub_mul, this]; ring + rcases mul_eq_zero.mp this with h1 | h1 + · exact hc (sub_eq_zero.mp h1) + · exact hA h1 + +/-- Census coverage: columns correct on every census pair + used pairs inside the census +=> every used pair correct. (`used ⊆ census` is the finite-set check in `affected_pairs`.) -/ +theorem census_coverage {P : Type*} (used census : Set P) (Correct : P → Prop) + (hsub : used ⊆ census) (hall : ∀ p ∈ census, Correct p) : ∀ p ∈ used, Correct p := + fun p hp => hall p (hsub hp) + +end PartB +end NativeColumns + +#print axioms NativeColumns.all_columns_of_exact_rows +#print axioms NativeColumns.exact_rows_iff_columns +#print axioms NativeColumns.partial_columns_insufficient +#print axioms NativeColumns.adjoint_iff_forward +#print axioms NativeColumns.phase_visible diff --git a/research/p104-lean-premises/lean/Nov15/NativeColumns.md b/research/p104-lean-premises/lean/Nov15/NativeColumns.md new file mode 100644 index 0000000000..0339d95ce4 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/NativeColumns.md @@ -0,0 +1,46 @@ +# NativeColumns (Nov 17): narrowing `native_all_columns` of #7620 + +Kernel-only, 5 s / 1.7 GB, no sorry/native_decide; axioms within [propext, Classical.choice, Quot.sound]. +File: `Nov15/NativeColumns.lean` (imports TokenCancel). + +## What the "columns" are +In #7630's `check.py` the column test is NOT randomized. +For each affected chart pair (a,b) (operator F_a^dag F_b on 2^9 = 512 dims) it compares ALL 512 forward +and ALL 512 adjoint exact Gaussian columns (`for c in range(FULL)`, line ~563), plus tableau (signed +Pauli action), absolute phase, exact rank, and a wrong-phase rejection. So per pair it is an exhaustive +exact check, not statistical evidence. The residue is elsewhere (below). The premise scope note's item 3 ("complete +finite contact identities are not an all-column implementation theorem") is about the compiler half. + +## Proved +1. Data-level semantics. `drun` executes a TokenCancel word on actual data in ANY K-module M + (born reads input, add/scale/copy/clear/init as in `step`). `drun_eval`: result = final rows applied + to the initial data. `all_columns_of_exact_rows`: (run s es).row = T => the word computes T x for + every x in every M, i.e. every column count and every tensor power (the Kronecker/factorwise point); + `word_computes` from identity start. +2. `exact_rows_iff_columns`: exact final rows <=> correct on every unit column (both directions), so + "exact rows" is exactly the all-column statement for the Q-linear word model (what the local audit script's + `all-column endpoint failure` check does with Fractions). +3. Column-test logic: `matrix_ext_cols` (unit columns determine a matrix), `linear_ext_span` (any + spanning set suffices), `partial_columns_insufficient` (2x2 over Q: agree on column 0, differ: a + subset test, random or not, is evidence only), `adjoint_iff_forward` (adjoint columns add NO coverage + once forward is exact; they are a consistency check of the checker), `phase_visible` (a global phase + c != 1 changes every nonzero entry: why the absolute-phase test is needed beyond the tableau), + `census_coverage` (correct on census + used pairs inside census => all used pairs correct). + +## How much this narrows the premise +Removes: the worry that the pair columns are only sampled (they are exhaustive: 512 of 512), that the +adjoint half is extra coverage, and the "all columns / all widths of the Q-word" half: an exact-rows +word (the local audit, CLEAR certificates) is correct on all columns by linearity (items 1-2). +STILL ASSUMED (not provable in this model): + a. Census completeness: the 981 pairs (964 inherited from #7623 by hash + 17) cover every pair the + native adapter is called on; `check.py` asserts `move_pairs(W) - move_pairs(B) <= allp` and the + 7623 inheritance, but that `move_pairs` is the right notion of "pair the adapter is used on" is a + code fact (`census_coverage` only gives the logic). + b. Operator realization: that the compiled native applies the verified recipe monomial.Fourier^r.monomial + on complex 512-dim states with the verified phase; the Python checks Gaussian-dyadic arithmetic, + Lean here is over a field K and does not model Pauli frames or complex phase. + c. Compiler/implementation half: universal erasure/compile services, rounded precision (precision_tape), + whole-job matching -- unchanged contract, as #7620's PR text says. + d. The Python checker itself (tool fact); Lean did not re-run the 512-column test. +Net: the "identity over all columns" half is now a kernel lemma plus an exhaustive exact test; the +"implementation" half is untouched. No paper statement found false. diff --git a/research/p104-lean-premises/lean/Nov15/NumCertK.lean b/research/p104-lean-premises/lean/Nov15/NumCertK.lean new file mode 100644 index 0000000000..1398c28ed5 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/NumCertK.md b/research/p104-lean-premises/lean/Nov15/NumCertK.md new file mode 100644 index 0000000000..5bd62abfc0 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/NumCertK22.lean b/research/p104-lean-premises/lean/Nov15/NumCertK22.lean new file mode 100644 index 0000000000..57817ac4ea --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/NumCertK22.lean @@ -0,0 +1,47 @@ +import Nov15.FloorK22 +import Nov15.NumCertKData + +/-! +NUMCERT-K22 : discharges FloorK22's `NumCert22 tbar22` by the kernel-checked interval arithmetic of +NumCertK / NumCertKData, and states `ceiling22_unconditional`. Kernel only; no native_decide. +-/ +namespace FloorK22 +open JointCeiling CallerCost + +/-- the K(S22) 17-call invoice, merged by rank, is F(s) = sum c_r r^s with the 24 coefficients `cfK`. -/ +theorem invoice_eq_Fc (s : ℝ) : + Finv s (invoice (caller 6 7) nK22 17) = NumCertK.Fc NumCertK.cfK s := by + simp only [Finv, Fh, invoice, caller, callerT, callerP, armT, armP, nK22, scale, NumCertK.Fc, NumCertK.cfK, + List.range_succ, List.range_zero] + norm_num + ring + +/-- **NumCert22 discharged** (kernel-checked; F(s) < 0 for every s in (0, 1 - .0060197405]). -/ +theorem numCert22 : NumCert22 tbar22 := by + intro s hs0 hs + rw [invoice_eq_Fc] + apply NumCertK.cfK_neg s hs0.le + have : (((9939802595 / 10 ^ 10 : ℚ)) : ℝ) = 1 - tbar22 := by unfold tbar22; push_cast; norm_num + rw [this]; exact hs + +section ClassK22 +open FloorE2E FloorD0 FloorK22Data ExportLaw +variable {K Reg C : Type*} [Field K] [DecidableEq K] [Fintype Reg] [DecidableEq Reg] + [PartialOrder C] [DecidableEq C] [Fintype C] +variable {Pub H Kfin : Finset Reg} {ini : Reg → Option C} {w : List (GEv K Reg C)} + {dim : C → ℕ} {e : C ≃ Fin rows.length} {D : KData C (Reg → K)} + +/-- **kappa <= .0060197405 on class K(S22), no numeric hypothesis**: `ceiling22` with NumCert22 discharged. -/ +theorem ceiling22_unconditional (hdim : ∀ a b : C, a < b → dim a < dim b) + (hK : ClassK22 Pub H Kfin ini w dim e D) (n : Inv) + (hF : ∀ s : ℝ, 0 < s → s ≤ 1 → + Finv s n = helperD0 (fun x : ℝ => x ^ s) dim H ini w - keptCost (fun x : ℝ => x ^ s) dim H ini w) + {s : ℝ} (hs0 : 0 < s) (hs : s ≤ 1 - tbar22) : + Finv s (invoice (caller 6 7) n 17) < 0 := + ceiling22 hdim hK n hF numCert22 hs0 hs + +end ClassK22 +end FloorK22 + +#print axioms FloorK22.numCert22 +#print axioms FloorK22.ceiling22_unconditional diff --git a/research/p104-lean-premises/lean/Nov15/NumCertKData.lean b/research/p104-lean-premises/lean/Nov15/NumCertKData.lean new file mode 100644 index 0000000000..adbd5d781f --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/NumCertKData.lean @@ -0,0 +1,50 @@ +import Nov15.NumCertK + +/-! +NUMCERT-K data half : the concrete interval checks for the K(S22) invoice (kernel `decide`), and the real-analysis +conclusion `cfK_neg`: F(s) < 0 on [0, 1 - .0060197405]. Library: Nov15/NumCertK.lean. +-/ +namespace NumCertK + +/-! ### 5. the K(S22) invoice, merged by rank: F(s) = sum c_r r^s, caller(6|7) + 17 * native K22 -/ +def cfK : CF := [(1, -42272), (2, 6494), (3, -1751), (4, -2159), (5, -2499), (6, -170), (8, -656), (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 cfK_ok : okR cfK := by decide +kernel +theorem cfK_p1 : Fup cfK 0 (45/100) < 0 := by decide +kernel +theorem cfK_p2 : Fup cfK (45/100) (6/10) < 0 := by decide +kernel +theorem cfK_p3 : Fup cfK (6/10) (7/10) < 0 := by decide +kernel +theorem cfK_p4 : Fup cfK (7/10) (8/10) < 0 := by decide +kernel +theorem cfK_p5 : Fup cfK (8/10) (85/100) < 0 := by decide +kernel +theorem cfK_p6 : Fup cfK (85/100) (9/10) < 0 := by decide +kernel +theorem cfK_d : 0 < dLo cfK (9/10) (9939802595/10^10) := by decide +kernel +theorem cfK_end : Fup cfK (9939802595/10^10) (9939802595/10^10) < 0 := by decide +kernel + +/-- **F(s) < 0 for every s in [0, 1 - .0060197405]**, F(s) = sum over the 24 ranks of c_r r^s (kernel-checked). -/ +theorem cfK_neg (s : ℝ) (h0 : 0 ≤ s) (hs : s ≤ ((9939802595 / 10 ^ 10 : ℚ) : ℝ)) : Fc cfK s < 0 := by + have o := cfK_ok + by_cases a1 : s ≤ ((45/100 : ℚ) : ℝ) + · exact Fc_neg_piece cfK o 0 (45/100) (le_refl _) (by norm_num) cfK_p1 s (by simpa using h0) a1 + by_cases a2 : s ≤ ((6/10 : ℚ) : ℝ) + · exact Fc_neg_piece cfK o (45/100) (6/10) (by norm_num) (by norm_num) cfK_p2 s (by push_neg at a1; exact a1.le) a2 + by_cases a3 : s ≤ ((7/10 : ℚ) : ℝ) + · exact Fc_neg_piece cfK o (6/10) (7/10) (by norm_num) (by norm_num) cfK_p3 s (by push_neg at a2; exact a2.le) a3 + by_cases a4 : s ≤ ((8/10 : ℚ) : ℝ) + · exact Fc_neg_piece cfK o (7/10) (8/10) (by norm_num) (by norm_num) cfK_p4 s (by push_neg at a3; exact a3.le) a4 + by_cases a5 : s ≤ ((85/100 : ℚ) : ℝ) + · exact Fc_neg_piece cfK o (8/10) (85/100) (by norm_num) (by norm_num) cfK_p5 s (by push_neg at a4; exact a4.le) a5 + by_cases a6 : s ≤ ((9/10 : ℚ) : ℝ) + · exact Fc_neg_piece cfK o (85/100) (9/10) (by norm_num) (by norm_num) cfK_p6 s (by push_neg at a5; exact a5.le) a6 + -- s in [9/10, s0]: F is increasing there (F' >= dLo > 0), so F(s) <= F(s0) < 0 + have h1 := Fc_mono cfK o (9/10) (9939802595/10^10) (by norm_num) (by norm_num) cfK_d s + (by push_neg at a6; exact a6.le) hs + have h2 := Fc_neg_piece cfK o (9939802595/10^10) (9939802595/10^10) (by norm_num) (by norm_num) cfK_end + ((9939802595 / 10 ^ 10 : ℚ) : ℝ) (le_refl _) (le_refl _) + linarith + +end NumCertK + +#print axioms NumCertK.pow_lo +#print axioms NumCertK.pow_hi +#print axioms NumCertK.cfK_neg diff --git a/research/p104-lean-premises/lean/Nov15/OwnedAscent.lean b/research/p104-lean-premises/lean/Nov15/OwnedAscent.lean new file mode 100644 index 0000000000..d88bdca931 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/OwnedAscent.lean @@ -0,0 +1,281 @@ +/- +OwnedAscent (lane LEAN-PREM2, Nov 17). Premise 6 (A6 "owned ascent"): cost symmetry, no credit, +conservativity of the relaxed legality over the strict one. See OwnedAscent.md. +-/ +import Nov15.FloorEndToEnd + +open Finset Module Submodule + +namespace OwnedAscent +open FloorE2E + +/-! ## 1. Cost symmetry -/ + +section Rank +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] [FiniteDimensional K V] + +/-- rank cost of a chart change `T` : the rank of the residual `T - 1`. -/ +noncomputable def rc (T : V →ₗ[K] V) : ℕ := Module.finrank K (LinearMap.range (T - LinearMap.id)) + +/-- the inverse of a chart change has the same rank cost: a rise and a fall cost the same. -/ +theorem rc_inv (T : V ≃ₗ[K] V) : rc (T.symm : V →ₗ[K] V) = rc (T : V →ₗ[K] V) := by + unfold rc + have h : LinearMap.range ((T.symm : V →ₗ[K] V) - LinearMap.id) = + Submodule.map (T.symm : V →ₗ[K] V) (LinearMap.range ((T : V →ₗ[K] V) - LinearMap.id)) := by + ext x + simp only [LinearMap.mem_range, Submodule.mem_map, LinearMap.sub_apply, LinearEquiv.coe_coe, + LinearMap.id_apply] + constructor + · rintro ⟨v, rfl⟩ + exact ⟨T (-v) - (-v), ⟨-v, by simp⟩, by simp; abel⟩ + · rintro ⟨y, ⟨v, rfl⟩, rfl⟩ + exact ⟨-v, by simp; abel⟩ + rw [h] + exact (T.symm.finrank_map_eq _) + + +/-- subadditivity: composing chart changes costs at most the sum. -/ +theorem rc_comp (A B : V →ₗ[K] V) : + rc (A ∘ₗ B) ≤ rc A + rc B := by + unfold rc + have h : LinearMap.range (A ∘ₗ B - LinearMap.id) ≤ + Submodule.map A (LinearMap.range (B - LinearMap.id)) ⊔ LinearMap.range (A - LinearMap.id) := by + rintro x ⟨v, rfl⟩ + refine Submodule.mem_sup.2 ⟨A (B v - v), ⟨_, ⟨v, rfl⟩, rfl⟩, A v - v, ⟨v, rfl⟩, ?_⟩ + simp + refine (Submodule.finrank_mono h).trans + ((Submodule.finrank_add_le_finrank_add_finrank _ _).trans ?_) + rw [Nat.add_comm (Module.finrank K (LinearMap.range (A - LinearMap.id)))] + exact add_le_add (Submodule.finrank_map_le _ _) le_rfl + +end Rank + + +/-- direction-free price: if the compiled rank of every nested chart change is `|dim b - dim a|` +(the paper's hypothesis, checked by `lowerup.py` on 2964 pairs; NOT derived here), the price of a +move `a → b` equals that of `b → a`. -/ +theorem price_symm {C : Type*} (dim : C → ℤ) (a b : C) : |dim b - dim a| = |dim a - dim b| := + abs_sub_comm _ _ + +section Rank2 +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] [FiniteDimensional K V] +/-- if the chart change `a → b` is the invertible `T` with rank cost `|dim b - dim a|`, then the +chart change back is `T⁻¹`, and its rank cost is the same number, with no further hypothesis. -/ +theorem back_cost (T : V ≃ₗ[K] V) (r : ℕ) (h : rc (T : V →ₗ[K] V) = r) : + rc (T.symm : V →ₗ[K] V) = r := by rw [rc_inv, h] +end Rank2 + +/-! ## 2. No credit (the pricer: paid = Σ|Δdim| over all moves; credit only from public endpoints) -/ + +variable {K Reg C : Type*} [Field K] [DecidableEq K] [Fintype Reg] [DecidableEq Reg] + [PartialOrder C] [DecidableEq C] + +/-- charge of one event: a MOVE pays `|Δdim|` whether public or owned, all else is rank 0. -/ +def mvCost (dim : C → ℤ) (s : GSt K Reg C) : GEv K Reg C → ℤ + | .move r c => match s.loc r with | some a => |dim c - dim a| | none => 0 + | _ => 0 + +/-- the owned share of the charge. -/ +def ownCost (Pub : Finset Reg) (dim : C → ℤ) (s : GSt K Reg C) : GEv K Reg C → ℤ + | .move r c => if r ∈ Pub then 0 else mvCost dim s (.move r c) + | _ => 0 + +/-- the public share of the charge. -/ +def pubCost (Pub : Finset Reg) (dim : C → ℤ) (s : GSt K Reg C) : GEv K Reg C → ℤ + | .move r c => if r ∈ Pub then mvCost dim s (.move r c) else 0 + | _ => 0 + +/-- owned ascent charge: `max(Δdim, 0)` of owned moves (what the strict verifier forces to 0). -/ +def ownAsc (Pub : Finset Reg) (dim : C → ℤ) (s : GSt K Reg C) : GEv K Reg C → ℤ + | .move r c => if r ∈ Pub then 0 else match s.loc r with | some a => max (dim c - dim a) 0 | none => 0 + | _ => 0 + +/-- sum of a per-event charge along a run. -/ +def sumFrom (f : GSt K Reg C → GEv K Reg C → ℤ) : GSt K Reg C → List (GEv K Reg C) → ℤ + | _, [] => 0 + | s, e :: es => f s e + sumFrom f (gstep s e) es + +theorem sumFrom_add (f g : GSt K Reg C → GEv K Reg C → ℤ) : + ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), + sumFrom (fun s e => f s e + g s e) s w = sumFrom f s w + sumFrom g s w + | _, [] => by simp [sumFrom] + | s, e :: es => by simp only [sumFrom, sumFrom_add f g (gstep s e) es]; ring + +/-- the charge splits into public and owned parts: an owned move is charged exactly like a public +one, nothing cheaper. -/ +theorem cost_split (Pub : Finset Reg) (dim : C → ℤ) (s : GSt K Reg C) (w : List (GEv K Reg C)) : + sumFrom (mvCost dim) s w = sumFrom (pubCost Pub dim) s w + sumFrom (ownCost Pub dim) s w := by + rw [← sumFrom_add] + congr 1; funext s e + cases e <;> simp [pubCost, ownCost, mvCost] + split_ifs <;> simp + +theorem ownCost_nonneg (Pub : Finset Reg) (dim : C → ℤ) (s : GSt K Reg C) (e : GEv K Reg C) : + 0 ≤ ownCost Pub dim s e := by + cases e <;> simp [ownCost, mvCost] + split_ifs <;> first | exact le_rfl | skip + all_goals (split <;> simp) + +theorem sumFrom_nonneg (f : GSt K Reg C → GEv K Reg C → ℤ) (hf : ∀ s e, 0 ≤ f s e) : + ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), 0 ≤ sumFrom f s w + | _, [] => by simp [sumFrom] + | s, e :: es => by simp only [sumFrom]; exact add_nonneg (hf _ _) (sumFrom_nonneg f hf _ _) + +/-- the owned part of the invoice is never negative: owned moves (ascending or descending) never +lower the price. -/ +theorem ownedCost_nonneg (Pub : Finset Reg) (dim : C → ℤ) (s : GSt K Reg C) + (w : List (GEv K Reg C)) : 0 ≤ sumFrom (ownCost Pub dim) s w := + sumFrom_nonneg _ (ownCost_nonneg Pub dim) s w + +/-- credit as the pricer takes it: only public registers, only from endpoint dimensions. -/ +def credit (Pub : Finset Reg) (dim : C → ℤ) (ini fin : Reg → Option C) (r : Reg) : ℤ := + if r ∈ Pub then + (match fin r with | some b => dim b | none => 0) - (match ini r with | some a => dim a | none => 0) + else 0 + +/-- an owned register earns no credit, whatever its path (ascending or descending). -/ +theorem owned_no_credit (Pub : Finset Reg) (dim : C → ℤ) (ini fin : Reg → Option C) (r : Reg) + (h : r ∉ Pub) : credit Pub dim ini fin r = 0 := by simp [credit, h] + +/-- invoice = public paid + owned paid - credit over helpers; credit is summed over helpers only +(`H ⊆ Pub`), so owned registers contribute nothing to it. -/ +def invoice (Pub H : Finset Reg) (dim : C → ℤ) (ini fin : Reg → Option C) (s : GSt K Reg C) + (w : List (GEv K Reg C)) : ℤ := + sumFrom (mvCost dim) s w - ∑ r ∈ H, credit Pub dim ini fin r + +theorem invoice_eq (Pub H : Finset Reg) (dim : C → ℤ) (ini fin : Reg → Option C) (s : GSt K Reg C) + (w : List (GEv K Reg C)) : + invoice Pub H dim ini fin s w = + (sumFrom (pubCost Pub dim) s w - ∑ r ∈ H, credit Pub dim ini fin r) + + sumFrom (ownCost Pub dim) s w := by + unfold invoice; rw [cost_split Pub]; ring + +/-- an owned ascent is charged at least 1 (never free, never negative), given strict-monotone dim. -/ +theorem owned_ascent_charged (Pub : Finset Reg) (dim : C → ℤ) (hd : StrictMono dim) + (s : GSt K Reg C) (r : Reg) (c : C) (hr : r ∉ Pub) (a : C) (ha : s.loc r = some a) (hlt : a < c) : + 1 ≤ ownCost Pub dim s (.move r c) := by + have := hd hlt + simp [ownCost, mvCost, hr, ha] + have := abs_of_pos (sub_pos.2 this) + omega + +/-! ## 3. Conservativity -/ + +/-- the STRICT verifier: public moves climb, owned moves DESCEND (`frames[b] < frames[a]`). -/ +def LegalEvS (Pub : Finset Reg) (s : GSt K Reg C) : GEv K Reg C → Prop + | .move r c => ∃ a, s.loc r = some a ∧ (r ∈ Pub → a < c) ∧ (r ∉ Pub → c < a) + | e => LegalEvG Pub s e + +def LegalS (Pub : Finset Reg) : GSt K Reg C → List (GEv K Reg C) → Prop + | _, [] => True + | s, e :: es => LegalEvS Pub s e ∧ LegalS Pub (gstep s e) es + +theorem legalEv_of_S (Pub : Finset Reg) (s : GSt K Reg C) (e : GEv K Reg C) (h : LegalEvS Pub s e) : + LegalEvG Pub s e := by + cases e with + | move r c => + obtain ⟨a, ha, h1, h2⟩ := h + exact ⟨a, ha, h1, fun hr => Or.inr (h2 hr)⟩ + | _ => exact h + +/-- every strict-legal word is relaxed-legal. -/ +theorem legal_of_S (Pub : Finset Reg) : ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), + LegalS Pub s w → LegalG Pub s w + | _, [], _ => trivial + | s, e :: es, ⟨h1, h2⟩ => ⟨legalEv_of_S Pub s e h1, legal_of_S Pub _ es h2⟩ + +/-- the two predicates agree on everything but owned ascents. -/ +theorem legal_diff (Pub : Finset Reg) (s : GSt K Reg C) (e : GEv K Reg C) + (hG : LegalEvG Pub s e) (hS : ¬ LegalEvS Pub s e) : + ∃ r c a, e = .move r c ∧ r ∉ Pub ∧ s.loc r = some a ∧ a < c := by + cases e with + | move r c => + obtain ⟨a, ha, h1, h2⟩ := hG + by_cases hr : r ∈ Pub + · exact absurd ⟨a, ha, h1, fun h => absurd hr h⟩ hS + · rcases h2 hr with h | h + · exact ⟨r, c, a, rfl, hr, ha, h⟩ + · exact absurd ⟨a, ha, fun h => absurd h hr, fun _ => h⟩ hS + | _ => exact absurd hG hS + +/-- public-side legality is untouched by the relaxation. -/ +theorem public_unchanged (Pub : Finset Reg) (s : GSt K Reg C) (r : Reg) (c : C) (hr : r ∈ Pub) : + LegalEvS Pub s (.move r c) ↔ LegalEvG Pub s (.move r c) := by + constructor + · exact legalEv_of_S Pub s _ + · rintro ⟨a, ha, h1, -⟩; exact ⟨a, ha, h1, fun h => absurd hr h⟩ + +/-- acceptance by the strict verifier. -/ +structure AcceptedS (Pub H : Finset Reg) (ini : Reg → Option C) (w : List (GEv K Reg C)) : Prop where + legal : LegalS Pub (s0 ini) w + pub_ini : ∀ r, r ∈ Pub ↔ ini r ≠ none + helpers_pub : H ⊆ Pub + helper_final : ∀ h ∈ H, (grun (s0 ini) w).row h = Pi.single h 1 + +/-- strict acceptance implies relaxed acceptance: EVERY theorem of FloorEndToEnd (stated for +`Accepted`, the relaxed class) holds for strict words. So a floor proved on the relaxed class is +a floor for the strict class too. -/ +theorem AcceptedS.toAccepted {Pub H : Finset Reg} {ini : Reg → Option C} {w : List (GEv K Reg C)} + (h : AcceptedS Pub H ini w) : Accepted Pub H ini w := + ⟨legal_of_S Pub _ w h.legal, h.pub_ini, h.helpers_pub, h.helper_final⟩ + +/-- sample transfer: hOnce for strict words, from the relaxed theorem. -/ +theorem hOnce_strict {Pub H : Finset Reg} {ini : Reg → Option C} {w : List (GEv K Reg C)} + (h : AcceptedS Pub H ini w) (c : C) (r : Reg) (hr : r ∈ Pub) (hini : ini r ≠ none) : + ExportLaw.nEnt {r} (proj c ini w) ≤ 1 := + hOnce_proj Pub c ini w (legal_of_S Pub _ w h.legal) r hr hini + +/-- under strict legality owned ascents do not occur: their ascent charge is 0. This is the +property the strict-only floors (owned-paid-56 etc.) rest on. -/ +theorem strict_no_owned_asc (Pub : Finset Reg) (dim : C → ℤ) (hd : StrictMono dim) : + ∀ (s : GSt K Reg C) (w : List (GEv K Reg C)), LegalS Pub s w → sumFrom (ownAsc Pub dim) s w = 0 + | _, [], _ => by simp [sumFrom] + | s, e :: es, ⟨h1, h2⟩ => by + simp only [sumFrom, strict_no_owned_asc Pub dim hd _ es h2, add_zero] + cases e with + | move r c => + obtain ⟨a, ha, -, h⟩ := h1 + by_cases hr : r ∈ Pub + · simp [ownAsc, hr] + · have := hd (h hr) + simp [ownAsc, hr, ha]; omega + | _ => simp [ownAsc] + +/-! ### The relaxation is strictly larger (counterexample to "strict = relaxed") -/ + +abbrev W1 : List (GEv ℚ (Fin 1) Bool) := [.init 0 false, .move 0 true] + +def dimB : Bool → ℤ := fun b => if b then 1 else 0 + +theorem W1_relaxed : LegalG (∅ : Finset (Fin 1)) (s0 (fun _ => (none : Option Bool))) W1 := by + simp [W1, LegalG, LegalEvG, gstep, s0] + +theorem W1_not_strict : ¬ LegalS (∅ : Finset (Fin 1)) (s0 (fun _ => (none : Option Bool))) W1 := by + simp [W1, LegalS, LegalEvS, LegalEvG, gstep, s0] + +/-- the relaxed class prices an owned ascent: charge 1 and ascent charge 1 on `W1`; the strict +verifier forbids it, so floors resting on `strict_no_owned_asc` do NOT transfer to the relaxed class. -/ +theorem W1_charge : sumFrom (mvCost dimB) (s0 (fun _ => (none : Option Bool))) W1 = 1 ∧ + sumFrom (ownAsc (∅ : Finset (Fin 1)) dimB) (s0 (fun _ => (none : Option Bool))) W1 = 1 := by + simp [W1, sumFrom, mvCost, ownAsc, gstep, s0, dimB] + + +#print axioms rc_inv +#print axioms rc_comp +#print axioms back_cost +#print axioms cost_split +#print axioms ownedCost_nonneg +#print axioms owned_no_credit +#print axioms invoice_eq +#print axioms owned_ascent_charged +#print axioms legal_of_S +#print axioms legal_diff +#print axioms public_unchanged +#print axioms AcceptedS.toAccepted +#print axioms hOnce_strict +#print axioms strict_no_owned_asc +#print axioms W1_relaxed +#print axioms W1_not_strict +#print axioms W1_charge + +end OwnedAscent diff --git a/research/p104-lean-premises/lean/Nov15/OwnedAscent.md b/research/p104-lean-premises/lean/Nov15/OwnedAscent.md new file mode 100644 index 0000000000..bce28509d0 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/OwnedAscent.md @@ -0,0 +1,24 @@ +# OwnedAscent.lean: premise 6 (A6, owned ascent) narrowed. No sorry, 7 s / 1.9 GB RSS +Imports Nov15.FloorEndToEnd. 17 `#print axioms`, all [propext, Classical.choice, Quot.sound]. No sorry, no native_decide. + +## Proved +1. **Cost symmetry.** + - `rc T` = rank of the residual `T - 1` of a chart change. `rc_inv`: `rc T⁻¹ = rc T`, so a fall costs exactly what the rise between the same frames costs (`back_cost`). `rc_comp`: rank cost is subadditive under composition. + - `price_symm`: if the compiled rank is `|dim b - dim a|` (hypothesis), the price of a→b and b→a coincide. + - `mvCost` charges every MOVE `|Δdim|`; `cost_split`: charge = public share + owned share, an owned move is charged like a public one. `ownedCost_nonneg`: the owned share is never negative; `owned_ascent_charged`: an owned ascent costs ≥ 1 (given dim strictly monotone, true for nested spans). +2. **No credit.** `credit` is taken only for `r ∈ Pub` from endpoint dims (the pricer's rule: only public endpoints, `check.py`). `owned_no_credit`: owned register credit = 0, ascent or not. `invoice_eq`: invoice = (public paid - helper credit) + owned paid, with owned paid ≥ 0. So ascent only ever adds to the invoice. +3. **Conservativity.** + - `LegalEvS` = strict verifier (owned moves must descend, public climb). `legal_of_S`: strict-legal ⇒ relaxed-legal. `AcceptedS.toAccepted`: strict-accepted ⇒ FloorEndToEnd `Accepted`. Hence EVERY FloorEndToEnd theorem (hOnce, class K, R1/α/β/u rows, `objective_le`) holds for strict words: the class-K floor proved on the relaxed class is also a floor for strict words (sample: `hOnce_strict`). + - `public_unchanged`: the public-move clause is identical in both predicates; `legal_diff`: they differ only on owned ascents. FloorEndToEnd already used the relaxed predicate (l.51), so no floor in that file changes. + +## Direction-based floors DO change (stated, not hidden) +`strict_no_owned_asc`: under strict legality the owned ascent charge is exactly 0. `W1_not_strict` / `W1_relaxed` / `W1_charge`: a 2-event word (INIT at the low frame, MOVE up) is relaxed-legal, strict-illegal, charge 1 with ascent charge 1. Floors that rest on "owned only descend" (owned-paid-56 #6315, eight-unit relay #6229, reader-497 #6257, surplus #6831, #6881 H6) do not transfer to the relaxed class. This is not a false statement; it is the scope those earlier notes already declared, now with a Lean witness. Nothing false found. + +## What is narrowed and what stays assumed +Narrowed (now theorems, in the abstract model): rank cost is direction-free given invertible chart changes; owned ascents never earn credit and never lower the invoice; relaxed legality is a superset whose only extra words are owned ascents; relaxed-class floors imply strict-class floors. +Still assumed: +- **Admission** (premise scope note): the compiler/contract text (Theorem 1G, FINITE-PRECOMPILATION 258-268, 05-layers.tex:83) never mentions direction; whether the maintainer accepts owned rises on arbitrary contents, factorwise at every width, stays the declaration. The P112 precedent supports it, does not prove it. +- **Compiled rank = |Δdim|** for each chart pair: modelled as a hypothesis (`price_symm`); the Clifford compilation is not formalised (python: 2964 pairs, lowerup.py's 104 pairs + reverses). `rc` is a generic linear-algebra proxy (rank of `T - 1`), not the Pauli/Fourier rank. +- CLEAR at any frame under owned_erasure (premise 1, ClearCert). +- The dim function and nested spans are inputs; the 47 owned MOVEs of the word are not replayed here. +Net: the premise shrinks from "owned ascent is priced soundly and harmlessly" to "the contract admits owned ascent on arbitrary content" (a pure admission question). Pricing, credit and floor-compatibility are discharged. diff --git a/research/p104-lean-premises/lean/Nov15/OwnedSkeleton.lean b/research/p104-lean-premises/lean/Nov15/OwnedSkeleton.lean new file mode 100644 index 0000000000..b5facaf47f --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/OwnedSkeleton.lean @@ -0,0 +1,173 @@ +/- +LEAN-PREM4, Nov 17. E1-E3 of the owned_erasure contract as a DECIDABLE check on the owned-event +skeleton, run (kernel `decide`) on the actual skeleton of the on7623 word (180 lifetimes). +See OwnedSkeleton.md. Data: OwnedSkeletonData.lean (generated, ownedskel_gen/gen.py). +-/ +import Nov15.ClearCert +import Nov15.OwnedSkeletonData + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace OwnedSkeleton +open TokenCancel + +abbrev E := Ev ℚ ℕ ℕ + +/-- Owned fields are the word registers 1501..1568 (68 labels). -/ +def base : ℕ := 1501 +def labels : ℕ := 68 +def calls : ℕ := 17 + +/-! ## Charts: GF(2) spans, proper nesting (check.py:104 `sp[a] < sp[b] or sp[b] < sp[a]`) -/ + +def spanL (gs : List ℕ) : List ℕ := gs.foldl (fun s g => s ++ s.map (· ^^^ g)) [0] + +def spanOf (c : ℕ) : Option (List ℕ) := (chartGens.lookup c).map spanL + +def subL (a b : List ℕ) : Bool := a.all fun x => b.contains x + +/-- charts `a`,`b` are properly nested one way or the other (both must be in the chart table). -/ +def nested (a b : ℕ) : Bool := + match spanOf a, spanOf b with + | some sa, some sb => (subL sa sb && !subL sb sa) || (subL sb sa && !subL sa sb) + | _, _ => false + +/-! ## E1/E2: bank discipline (explicit INIT, retained until CLEAR, erased, bounded by the label set) -/ + +/-- Liveness simulation: INIT only a dead field, MOVE/CLEAR only a live one (the bank is retained +until its unit clears it). Only owned INIT/MOVE/CLEAR events occur in a skeleton. -/ +def e1run : List ℕ → List E → Option (List ℕ) + | l, [] => some l + | l, .init i _ :: es => if l.contains i then none else e1run (i :: l) es + | l, .move i _ :: es => if l.contains i then e1run l es else none + | l, .clear i _ :: es => if l.contains i then e1run (l.erase i) es else none + | _, _ :: _ => none + +/-- E1: explicit init, no overlapping reuse of a name, everything erased at the end. -/ +def E1 (es : List E) : Prop := e1run [] es = some [] + +def evField : E → ℕ + | .init i _ => i | .move i _ => i | .clear i _ => i | _ => 0 + +/-- Peak number of simultaneously live owned banks. -/ +def peakAux : List ℕ → ℕ → List E → ℕ + | _, p, [] => p + | l, p, .init i _ :: es => peakAux (i :: l) (max p (l.length + 1)) es + | l, p, .clear i _ :: es => peakAux (l.erase i) p es + | l, p, _ :: es => peakAux l p es + +def peak (es : List E) : ℕ := peakAux [] 0 es + +/-- E2 (allocation): every field is one of the 68 labels and the peak fits the label set, so one +bank per label per call (17 x 68 = 1,156) retains each lifetime (the reuse lifetime proof). -/ +def E2 (es : List E) : Prop := (∀ e ∈ es, base ≤ evField e ∧ evField e < base + labels) ∧ peak es ≤ labels + +/-! ## E3: field identity / chronology: MOVE leaves the current chart (nested), CLEAR at current chart -/ + +def e3run : List (ℕ × ℕ) → List E → Bool + | l, [] => l.isEmpty + | l, .init i c :: es => (l.lookup i).isNone && e3run ((i, c) :: l) es + | l, .move i b :: es => + match l.lookup i with + | some a => nested a b && e3run ((i, b) :: l.filter (·.1 ≠ i)) es + | none => false + | l, .clear i c :: es => + match l.lookup i with + | some a => a == c && e3run (l.filter (·.1 ≠ i)) es + | none => false + | _, _ :: _ => false + +/-- E3 (field identity + chronology on the flat word): MOVE starts at the field's current chart and +is properly nested; CLEAR is at the current chart; nothing is left live. The parent/child half +("parent erases only after the entire child unit completed") needs the unit tree, which a flat +word does not carry: not expressible here. -/ +def E3 (es : List E) : Prop := e3run [] es = true + +/-- The decidable owned-event-skeleton predicate: E1-E3. -/ +def Sk (es : List E) : Prop := E1 es ∧ E2 es ∧ E3 es + +instance (es : List E) : Decidable (E1 es) := inferInstanceAs (Decidable (_ = _)) +instance (es : List E) : Decidable (E2 es) := inferInstanceAs (Decidable (_ ∧ _)) +instance (es : List E) : Decidable (E3 es) := inferInstanceAs (Decidable (_ = _)) +instance (es : List E) : Decidable (Sk es) := inferInstanceAs (Decidable (_ ∧ _)) + +/-! ## The skeleton of the on7623 word, checked in the kernel -/ + +theorem e1_skel : E1 skel := by decide +kernel +theorem e2_skel : E2 skel := by decide +kernel +theorem e3_skel : E3 skel := by decide +kernel +theorem sk_skel : Sk skel := ⟨e1_skel, e2_skel, e3_skel⟩ + +/-! ## Counting facts -/ + +def cnt (p : E → Bool) (es : List E) : ℕ := (es.filter p).length +def isInit : E → Bool | .init .. => true | _ => false +def isMove : E → Bool | .move .. => true | _ => false +def isClear : E → Bool | .clear .. => true | _ => false +def initLabels (es : List E) : List ℕ := (es.filter isInit).map evField |>.eraseDups + +theorem n_events : skel.length = 407 := by decide +kernel +theorem n_lifetimes : cnt isInit skel = 180 := by decide +kernel +theorem n_clears : cnt isClear skel = 180 := by decide +kernel +theorem n_moves : cnt isMove skel = 47 := by decide +kernel +theorem n_labels : (initLabels skel).length = 68 := by decide +kernel +theorem peak_skel : peak skel = 50 := by decide +kernel +theorem bank_count : calls * labels = 1156 := by decide +theorem peak_le : peak skel ≤ labels := by rw [peak_skel]; decide +theorem lifetimes_exceed_labels : labels < cnt isInit skel := by rw [n_lifetimes]; decide +/-- total lifetimes over the 17 calls vs the fixed 1,156 banks: reuse is real, so the disjointness +proof (E1: INIT only of a dead field) is exactly E2's "smaller reuse allocation needs its own +lifetime proof". -/ +theorem total_lifetimes : calls * cnt isInit skel = 3060 := by rw [n_lifetimes]; decide + +/-! ## Negative controls: the checker rejects -/ + +def c0 : List E := [.init 1501 3, .clear 1501 3] +theorem c0_ok : Sk c0 := by decide +kernel +theorem c_double_init : ¬ Sk [.init 1501 3, .init 1501 3, .clear 1501 3] := by decide +kernel +theorem c_leak : ¬ Sk [.init 1501 3] := by decide +kernel +theorem c_clear_dead : ¬ Sk [.clear 1501 3] := by decide +kernel +theorem c_wrong_chart : ¬ Sk [.init 1501 3, .clear 1501 115] := by decide +kernel +theorem c_label_range : ¬ Sk [.init 1569 3, .clear 1569 3] := by decide +kernel +/-- skeleton with one MOVE to a non-nested chart (115 vs 117 are incomparable) is rejected. -/ +theorem c_not_nested : ¬ Sk [.init 1501 115, .move 1501 117, .clear 1501 117] := by decide +kernel +theorem c_peak : ¬ E2 ((List.range 69).map (fun i => (Ev.init (1501 + i) 3 : E))) := by decide +kernel +/-- dropping the last event of the real skeleton leaks a bank. -/ +theorem c_skel_truncated : ¬ Sk skel.dropLast := by decide +kernel + +/-! ## Link to ClearCert: `Sk` is now a fact for this word, so ErasureOK reduces to losslessness -/ + +def owned (f : ℕ) : Prop := base ≤ f + +theorem erasure_ok_iff {K : Type*} [Field K] {C : Type*} [DecidableEq C] + {Reg : Type*} [DecidableEq Reg] (Skg : List (Ev K Reg C) → Prop) (own : Reg → Prop) + (s : St K Reg C) (es : List (Ev K Reg C)) (h : Skg (ClearCert.ownedEvents own es)) : + ClearCert.ErasureOK Skg own s es ↔ ClearCert.AllLossless s es := + ⟨fun h => h.2, fun h' => ⟨h, h'⟩⟩ + +/-- For any endpoint-exact word over ℚ-rows (with Nat registers and Nat charts) whose owned +events are exactly the on7623 skeleton, `owned_erasure`'s E1-E3 half and its content half both hold. -/ +theorem erasure_ok_on_skel (U : Submodule ℚ (ℕ → ℚ)) (s : St ℚ ℕ ℕ) (es : List (Ev ℚ ℕ ℕ)) + (hU : ClearCert.rowSpan s ≤ U) (hnb : ∀ e ∈ es, ClearCert.NoBorn e) + (hend : ClearCert.FullEnd U s es) + (hsk : ClearCert.ownedEvents owned es = skel) : + ClearCert.ErasureOK Sk owned s es := by + refine ⟨by rw [hsk]; exact sk_skel, ?_⟩ + exact fun pre post i c h => ClearCert.every_clear_lossless U s es hU hnb hend pre post i c h + +#print axioms sk_skel +#print axioms n_events +#print axioms n_lifetimes +#print axioms n_clears +#print axioms n_moves +#print axioms n_labels +#print axioms peak_skel +#print axioms bank_count +#print axioms total_lifetimes +#print axioms c_not_nested +#print axioms c_skel_truncated +#print axioms c_peak +#print axioms erasure_ok_on_skel + +end OwnedSkeleton diff --git a/research/p104-lean-premises/lean/Nov15/OwnedSkeleton.md b/research/p104-lean-premises/lean/Nov15/OwnedSkeleton.md new file mode 100644 index 0000000000..f664a058c1 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/OwnedSkeleton.md @@ -0,0 +1,27 @@ +# OwnedSkeleton.lean: E1-E3 as a decidable check, run on the real skeleton +Kernel-only (`decide +kernel`; no sorry, no native_decide); 13 `#print axioms` all within [propext, Classical.choice, Quot.sound] (most: propext only). 11 s, peak 3.3 GB (data elaboration; under the 3.5 GB guard). Imports Nov15.ClearCert (+ generated OwnedSkeletonData.lean). Build order: ClearCert, OwnedSkeletonData, OwnedSkeleton (oleans in .lake/build/lib/lean/Nov15). + +## What is defined +Skeleton = time-ordered list of owned `Ev` (`init f c | move f dest | clear f c`; MOVE source = the field's tracked current chart), the same event type ClearCert's `ownedEvents` filters, so it plugs into `ErasureOK`. Clauses as in the CLEARFORM note, section 0 (FINITE-PRECOMPILATION.md:34-35, :250-268; check.py `replay` :98-117): +- E1 (explicit INIT, erased, no overlapping reuse of a name): INIT only of a dead field, MOVE/CLEAR only of a live one, nothing live at the end (`e1run`). +- E2 (one bank per live unit retained to its CLEAR; reuse needs a lifetime proof): every field is one of the 68 labels (1501..1568) and peak live <= 68, so 17 calls x 68 labels = 1,156 banks hold every lifetime. +- E3 (field identity / chronology): MOVE starts at the current chart and is properly nested (GF(2) span of the frame, check.py:104), CLEAR is at the current chart (`e3run`). +`Sk := E1 /\ E2 /\ E3`, a `Decidable` Prop. + +## What is proved (all by kernel `decide`) +Data: the #7630 word file (208,738 events, sha prefix in the data file header), extracted by a script that is not shipped (fidelity of extraction by reading; the extractor only filters INIT/CLEAR and owned MOVEs, p >= 1501). Counts agree with VERIFY.json/check.py `core`: 407 events = 180 INIT + 180 CLEAR + 47 owned MOVE; 68 labels; peak 50. +- `sk_skel : Sk skel` (E1, E2, E3 separately too). `Sk` is now a kernel-checked FACT for our word. +- `erasure_ok_on_skel`: for any endpoint-exact, birth-free word whose owned events equal `skel`, `ErasureOK Sk owned s es` holds (Sk from the check, lossless content from ClearCert `every_clear_lossless`). +- Counts: `n_lifetimes` 180, `n_clears` 180, `n_moves` 47, `n_labels` 68, `peak_skel` 50, `peak_le` 50 <= 68, `bank_count` 17*68 = 1156, `lifetimes_exceed_labels` (180 > 68, so labels ARE reused), `total_lifetimes` 17*180 = 3060 lifetimes on 1,156 banks. +- 9 negative controls rejected (double INIT, leak, CLEAR of dead, CLEAR at wrong chart, label out of range, non-nested MOVE 115->117, 69 simultaneous banks, truncated real skeleton). + +## Paper statements +No false statement found. Two precision points: (1) The premise scope note's "the 180 lifetimes fit the allocation" is true only with reuse: 180 lifetimes per call on 68 labels (peak 50); E2's "a smaller reuse allocation requires its own lifetime proof" is what E1 disjointness + peak <= 68 supplies, so the reading "one bank per label" rests on this proof, not on one bank per lifetime. (2) The flat word's lifetimes interleave arbitrarily (2,165 crossing interval pairs; 251 CLEARs happen while a field on a strictly smaller chart is live), so E3's "parent erases only after the whole child unit completed / clear never acts on a descendant's live storage" cannot be read off the flat word. It needs the unit tree. + +## What stays assumed +- E3 parent/child half (unit tree, compiler recursion structure), not expressible on the flat word. +- E4 (copy/read/erase linear in volume), E5 (paid non-reversible erase permitted), E6 (dirty residuals via ADD errors): cost/permission, not in the row model. +- Compiler admission of the retained allocation, of owned ascent (OwnedAscent), `native_all_columns`, `compiler`, `precision_tape`, `analytic_recovery`. +- Extraction fidelity of skel/chartGens from word.json.gz (script; the 180 certificates and the full 208,738-event replay are still not in the kernel). +## How far narrowed +owned_erasure: content half (ClearCert) AND the checkable skeleton half E1, E2, E3-identity are now kernel facts for #7630's word; the residue is E3-tree, E4-E6 and compiler admission. Allocation (premise 4): 17x68 = 1156, peak 50 <= 68, label-range and disjoint reuse proved; what remains is only the convention that banks are fixed per label per call. diff --git a/research/p104-lean-premises/lean/Nov15/OwnedSkeletonData.lean b/research/p104-lean-premises/lean/Nov15/OwnedSkeletonData.lean new file mode 100644 index 0000000000..07422e844e --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/OwnedSkeletonData.lean @@ -0,0 +1,453 @@ +/- GENERATED by ownedskel_gen/gen.py from word.json.gz (sha256 of uncompressed JSON f5b4416e1b433e9a). + Owned-event skeleton, time order: INIT field chart | MOVE field dest | CLEAR field chart. + MOVE source chart = the field's current chart (tracked by the checker). Fields are word register numbers 1501..1568. -/ +import Nov15.TokenCancel +namespace OwnedSkeleton +open TokenCancel + +/-- 407 owned events. -/ +def skel : List (Ev ℚ ℕ ℕ) := [ + .init 1568 3, + .init 1564 1091, + .init 1562 1031, + .init 1556 595, + .init 1505 101, + .init 1519 381, + .init 1513 339, + .init 1518 377, + .init 1552 237, + .init 1504 376, + .init 1503 375, + .init 1523 378, + .init 1526 414, + .init 1515 338, + .init 1533 452, + .init 1517 337, + .init 1534 413, + .init 1516 340, + .init 1527 451, + .init 1538 415, + .init 1551 416, + .init 1550 417, + .init 1549 419, + .init 1548 420, + .init 1532 453, + .init 1509 456, + .init 1525 455, + .init 1547 601, + .init 1508 470, + .init 1510 477, + .move 1510 1090, + .init 1520 1090, + .move 1520 470, + .init 1521 470, + .move 1521 601, + .init 1536 470, + .init 1546 470, + .init 1537 1090, + .move 1547 470, + .move 1546 1090, + .init 1501 359, + .init 1502 353, + .clear 1502 353, + .clear 1501 359, + .init 1507 321, + .init 1512 322, + .init 1501 372, + .clear 1501 372, + .clear 1503 375, + .init 1522 360, + .init 1540 260, + .init 1560 306, + .init 1531 594, + .init 1529 267, + .move 1529 1091, + .init 1524 117, + .init 1501 538, + .init 1503 537, + .clear 1503 537, + .clear 1501 538, + .init 1528 543, + .move 1528 541, + .init 1506 260, + .init 1511 1091, + .init 1514 1091, + .move 1514 260, + .init 1502 541, + .move 1502 534, + .move 1502 117, + .move 1502 594, + .init 1501 724, + .clear 1501 724, + .init 1530 593, + .init 1501 372, + .clear 1501 372, + .clear 1519 381, + .clear 1525 455, + .clear 1513 339, + .init 1525 115, + .init 1501 371, + .clear 1507 321, + .clear 1501 371, + .clear 1518 377, + .init 1501 405, + .clear 1501 405, + .clear 1526 414, + .clear 1533 452, + .clear 1527 451, + .clear 1534 413, + .init 1533 433, + .init 1527 492, + .init 1535 431, + .init 1526 438, + .init 1507 431, + .init 1513 517, + .move 1513 243, + .init 1518 243, + .move 1518 431, + .init 1519 431, + .init 1503 390, + .init 1501 393, + .clear 1503 390, + .clear 1501 393, + .clear 1515 338, + .clear 1505 101, + .clear 1504 376, + .clear 1517 337, + .init 1503 389, + .init 1501 395, + .clear 1503 389, + .clear 1501 395, + .clear 1532 453, + .clear 1538 415, + .clear 1533 433, + .clear 1516 340, + .clear 1522 360, + .init 1501 369, + .clear 1512 322, + .clear 1501 369, + .clear 1523 378, + .init 1541 599, + .move 1541 260, + .clear 1527 492, + .clear 1526 438, + .init 1545 600, + .init 1544 431, + .init 1539 243, + .move 1519 600, + .move 1545 431, + .move 1544 243, + .init 1543 598, + .init 1534 394, + .init 1542 394, + .init 1538 240, + .init 1505 394, + .init 1512 518, + .move 1512 240, + .init 1516 240, + .move 1516 394, + .init 1517 394, + .move 1517 598, + .move 1543 394, + .move 1542 240, + .init 1561 306, + .clear 1560 306, + .init 1558 237, + .init 1559 237, + .clear 1558 237, + .clear 1551 416, + .clear 1550 417, + .clear 1549 419, + .clear 1548 420, + .clear 1568 3, + .init 1568 240, + .init 1551 1091, + .init 1548 529, + .init 1550 541, + .init 1549 549, + .init 1532 595, + .clear 1509 456, + .init 1533 597, + .clear 1541 260, + .clear 1529 1091, + .init 1501 737, + .init 1503 521, + .clear 1503 521, + .init 1503 525, + .init 1504 528, + .clear 1503 525, + .clear 1504 528, + .init 1503 526, + .clear 1503 526, + .init 1526 531, + .init 1503 553, + .clear 1503 553, + .init 1503 564, + .clear 1503 564, + .init 1503 576, + .clear 1503 576, + .init 1557 595, + .clear 1556 595, + .clear 1528 541, + .move 1539 517, + .init 1527 559, + .init 1523 1031, + .move 1538 518, + .move 1526 529, + .clear 1526 529, + .move 1548 531, + .clear 1548 531, + .init 1522 549, + .init 1503 529, + .move 1503 520, + .move 1503 595, + .clear 1501 737, + .init 1504 591, + .clear 1543 394, + .clear 1517 598, + .clear 1505 394, + .init 1515 260, + .move 1515 599, + .clear 1515 599, + .clear 1506 260, + .clear 1545 431, + .clear 1535 431, + .clear 1544 243, + .clear 1539 517, + .clear 1519 600, + .clear 1507 431, + .move 1532 520, + .move 1532 529, + .clear 1532 529, + .clear 1503 595, + .clear 1547 470, + .clear 1521 601, + .init 1501 548, + .clear 1501 548, + .clear 1508 470, + .init 1501 549, + .init 1509 595, + .clear 1509 595, + .init 1509 603, + .clear 1534 394, + .clear 1542 240, + .clear 1538 518, + .init 1554 120, + .init 1555 120, + .clear 1554 120, + .init 1503 744, + .clear 1503 744, + .init 1506 647, + .init 1505 645, + .clear 1505 645, + .clear 1506 647, + .init 1505 664, + .clear 1505 664, + .init 1503 665, + .clear 1503 665, + .move 1549 559, + .clear 1549 559, + .move 1527 549, + .clear 1527 549, + .move 1501 115, + .clear 1525 115, + .move 1501 593, + .init 1505 695, + .init 1506 693, + .clear 1506 693, + .init 1507 694, + .clear 1505 695, + .clear 1507 694, + .init 1505 736, + .init 1507 909, + .init 1506 723, + .init 1535 902, + .clear 1506 723, + .init 1548 913, + .init 1553 237, + .clear 1552 237, + .clear 1505 736, + .move 1537 477, + .clear 1536 470, + .clear 1546 1090, + .clear 1537 477, + .move 1530 549, + .clear 1530 549, + .init 1503 575, + .clear 1503 575, + .move 1531 117, + .init 1521 828, + .init 1505 829, + .clear 1505 829, + .init 1506 835, + .init 1538 838, + .init 1539 839, + .init 1530 840, + .init 1532 844, + .init 1534 845, + .init 1541 846, + .init 1503 847, + .clear 1503 847, + .init 1508 851, + .init 1515 834, + .init 1525 853, + .init 1527 855, + .init 1517 857, + .init 1526 863, + .init 1542 1074, + .clear 1542 1074, + .init 1529 872, + .init 1528 877, + .init 1546 873, + .init 1519 858, + .clear 1519 858, + .init 1503 881, + .clear 1503 881, + .init 1503 850, + .clear 1503 850, + .init 1544 1076, + .clear 1525 853, + .init 1547 1077, + .clear 1526 863, + .init 1505 841, + .clear 1505 841, + .init 1545 888, + .clear 1517 857, + .clear 1545 888, + .init 1525 889, + .clear 1525 889, + .init 1519 890, + .clear 1532 844, + .init 1542 894, + .clear 1521 828, + .init 1532 874, + .init 1536 1075, + .clear 1536 1075, + .init 1543 866, + .clear 1543 866, + .init 1537 885, + .clear 1537 885, + .init 1505 856, + .clear 1505 856, + .init 1503 574, + .clear 1503 574, + .move 1504 1031, + .move 1504 597, + .move 1533 1031, + .init 1563 1031, + .clear 1562 1031, + .move 1533 591, + .clear 1533 591, + .clear 1523 1031, + .clear 1504 597, + .clear 1557 595, + .clear 1555 120, + .init 1503 657, + .clear 1503 657, + .clear 1563 1031, + .init 1504 826, + .init 1503 827, + .clear 1503 827, + .init 1503 864, + .clear 1503 864, + .clear 1534 845, + .clear 1546 873, + .clear 1528 877, + .init 1505 892, + .clear 1505 892, + .clear 1504 826, + .clear 1544 1076, + .clear 1547 1077, + .clear 1507 909, + .clear 1501 593, + .clear 1502 594, + .init 1525 245, + .clear 1535 902, + .clear 1548 913, + .clear 1530 840, + .clear 1506 835, + .clear 1541 846, + .init 1506 917, + .clear 1506 917, + .init 1505 922, + .clear 1505 922, + .clear 1508 851, + .clear 1538 838, + .clear 1527 855, + .clear 1522 549, + .clear 1515 834, + .clear 1532 874, + .clear 1519 890, + .clear 1539 839, + .move 1550 543, + .clear 1550 543, + .move 1531 534, + .move 1531 541, + .clear 1531 541, + .clear 1524 117, + .clear 1529 872, + .clear 1542 894, + .init 1567 207, + .clear 1567 207, + .clear 1525 245, + .clear 1520 470, + .clear 1514 260, + .clear 1511 1091, + .clear 1518 431, + .clear 1516 394, + .clear 1512 240, + .clear 1510 1090, + .clear 1513 243, + .clear 1509 603, + .move 1551 267, + .clear 1551 267, + .move 1540 1091, + .clear 1540 1091, + .init 1565 1091, + .clear 1564 1091, + .clear 1553 237, + .clear 1559 237, + .clear 1561 306, + .clear 1565 1091, + .init 1566 127, + .init 1567 127, + .clear 1566 127, + .clear 1567 127, + .clear 1568 240] + +/-- Generators (GF(2) vectors as Nat bitmasks) of the charts used by owned MOVEs; span = chart. -/ +def chartGens : List (ℕ × List ℕ) := [ + (115, [7, 42, 75, 144, 272]), + (117, [8, 17, 34, 68, 391]), + (240, [13, 19, 70, 416]), + (243, [22, 37, 67, 392]), + (260, [11, 51, 448]), + (267, [1, 4, 10, 16, 34, 64, 128, 256]), + (394, [13, 85, 435]), + (431, [22, 67, 392]), + (470, [75, 137, 265]), + (477, [3, 5, 9, 17, 33, 65, 128, 256]), + (517, [2, 4, 8, 16, 33, 65, 128, 256]), + (518, [1, 2, 12, 16, 32, 68, 128, 256]), + (520, [1, 10, 20, 32, 64, 390]), + (529, [1, 10, 20, 32, 64, 128, 262]), + (531, [1, 4, 10, 16, 32, 64, 128, 258]), + (534, [4, 8, 17, 34, 64, 387]), + (541, [4, 8, 17, 34, 64, 131, 256]), + (543, [1, 4, 8, 16, 34, 64, 130, 256]), + (549, [2, 5, 16, 40, 73, 128, 256]), + (559, [1, 2, 4, 16, 40, 72, 128, 256]), + (591, [2, 4, 8, 16, 33, 64, 128, 257]), + (593, [7]), + (594, [25]), + (595, [52]), + (597, [82]), + (598, [491]), + (599, [448]), + (600, [67]), + (601, [137]), + (1031, [12, 18, 33, 64, 391]), + (1090, [265, 194, 164, 75]), + (1091, [11, 21, 51, 469])] + +end OwnedSkeleton diff --git a/research/p104-lean-premises/lean/Nov15/OwnedTree.lean b/research/p104-lean-premises/lean/Nov15/OwnedTree.lean new file mode 100644 index 0000000000..14e17e7b3d --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/OwnedTree.lean @@ -0,0 +1,239 @@ +/- +LEAN-PREM6, Nov 17. E3-tree: the PARENT/CHILD half of owned_erasure's E3 as a kernel fact for #7630's +owned skeleton. See OwnedTree.md. Data: OwnedTreeData.lean (generated, ownedtree_gen/gen.py). + +Model (FINITE-PRECOMPILATION.md section 3 and 6): a unit is the finite word; at each paid round (a +MOVE) the unit is suspended, the ENTIRE child unit (the same finite word, own unit tag) is run to +completion, then the parent advances. Owned banks are tagged by the unit path. A CLEAR in unit p +requires the bank (p,f) live and NO live bank of any strict descendant of p. +-/ +import Nov15.OwnedSkeleton + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace OwnedTree +open OwnedSkeleton + +abbrev Path := List ℕ +abbrev St := List (Path × ℕ) + +/-- `q` strictly extends `p`. -/ +def desc (p q : Path) : Bool := q.take p.length == p && p.length < q.length + +/-- One owned event in unit `p`; the CLEAR clause is E3's "never acts on a descendant's live storage". -/ +def applyEv (p : Path) (L : St) : E → Option St + | .init f _ => if (p, f) ∈ L then none else some ((p, f) :: L) + | .move f _ => if (p, f) ∈ L then some L else none + | .clear f _ => if (p, f) ∈ L ∧ ∀ q ∈ L, desc p q.1 = false then some (L.erase (p, f)) else none + | _ => none + +/-- Walk the events of unit `p` from index `i`; `ch gap L` runs all children called at that gap +(before event `gap`). -/ +def go (ch : ℕ → St → Option St) (p : Path) : ℕ → St → List E → Option St + | i, L, [] => ch i L + | i, L, e :: es => (ch i L).bind fun L' => (applyEv p L' e).bind fun L'' => go ch p (i + 1) L'' es + +def sitesAt (sites : List ℕ) (g : ℕ) : List ℕ := (List.range sites.length).filter fun j => sites[j]! == g + +/-- Run unit `p` to depth `d` (depth 0 = no child calls) with child call sites `sites` +(site j is child unit `p ++ [j]`). -/ +def execU (sites : List ℕ) : ℕ → Path → St → Option St + | 0, p, L => go (fun _ L => some L) p 0 L skel + | d + 1, p, L => + go (fun g L => (sitesAt sites g).foldlM (fun L j => execU sites d (p ++ [j]) L) L) p 0 L skel + +/-! ## The frame lemma: E1 of one unit, run inside any context, restores the context -/ + +def Fresh (p : Path) (L : St) : Prop := ∀ q ∈ L, ¬ p <+: q.1 +def NoDesc (p : Path) (L : St) : Prop := ∀ q ∈ L, desc p q.1 = false + +def own (p : Path) (l : List ℕ) : St := l.map fun f => (p, f) + +theorem desc_false_of_not_prefix {p q : Path} (h : ¬ p <+: q) : desc p q = false := by + unfold desc + by_cases h1 : q.take p.length = p + · exfalso; apply h; rw [← h1]; exact List.take_prefix _ _ + · simp [h1] + +theorem desc_self (p : Path) : desc p p = false := by simp [desc] + +theorem nodesc_own_append {p : Path} {l : List ℕ} {M : St} (hM : Fresh p M) : NoDesc p (own p l ++ M) := by + intro q hq + rcases List.mem_append.1 hq with h | h + · obtain ⟨f, _, rfl⟩ := List.mem_map.1 h + exact desc_self p + · exact desc_false_of_not_prefix (hM q h) + +theorem mem_own_append {p : Path} {l : List ℕ} {M : St} (hM : Fresh p M) (f : ℕ) : + ((p, f) ∈ own p l ++ M) ↔ f ∈ l := by + constructor + · intro h + rcases List.mem_append.1 h with h | h + · obtain ⟨g, hg, hq⟩ := List.mem_map.1 h + have : g = f := (Prod.mk.inj hq).2 + exact this ▸ hg + · exact absurd (List.prefix_refl p) (hM _ h) + · intro h; exact List.mem_append.2 (Or.inl (List.mem_map.2 ⟨f, h, rfl⟩)) + +theorem erase_own_append {p : Path} {l : List ℕ} {M : St} (f : ℕ) (hf : f ∈ l) : + (own p l ++ M).erase (p, f) = own p (l.erase f) ++ M := by + have hinj : Function.Injective (fun f : ℕ => ((p, f) : Path × ℕ)) := fun a b h => (Prod.mk.inj h).2 + unfold own + rw [List.erase_append_left _ (List.mem_map.2 ⟨f, hf, rfl⟩), List.map_erase hinj] + +/-- E1 of the unit (e1run) transports to the tagged run, in any context with no live bank at or below `p`. -/ +theorem go_frame (p : Path) (ch : ℕ → St → Option St) + (hch : ∀ i L, NoDesc p L → ch i L = some L) : + ∀ (es : List E) (i : ℕ) (l l' : List ℕ) (M : St), Fresh p M → e1run l es = some l' → + go ch p i (own p l ++ M) es = some (own p l' ++ M) := by + intro es + induction es with + | nil => + intro i l l' M hM h + simp only [e1run, Option.some.injEq] at h + subst h + simp [go, hch i _ (nodesc_own_append hM)] + | cons e es ih => + intro i l l' M hM h + have hc := hch i _ (nodesc_own_append (l := l) hM) + cases e with + | init f c => + simp only [e1run] at h + by_cases hf : f ∈ l + · simp [hf] at h + · have h' : e1run (f :: l) es = some l' := by simpa [hf] using h + have h1 : (p, f) ∉ own p l ++ M := fun hm => hf ((mem_own_append hM f).1 hm) + have := ih (i + 1) (f :: l) l' M hM h' + simp only [go, hc, Option.bind_some, applyEv, h1, if_false] + simpa [own] using this + | move f b => + simp only [e1run] at h + by_cases hf : f ∈ l + · have h' : e1run l es = some l' := by simpa [hf] using h + have := ih (i + 1) l l' M hM h' + have h1 : (p, f) ∈ own p l ++ M := (mem_own_append hM f).2 hf + simp only [go, hc, Option.bind_some, applyEv, h1, if_true] + exact this + · simp [hf] at h + | clear f c => + simp only [e1run] at h + by_cases hf : f ∈ l + · have h' : e1run (l.erase f) es = some l' := by simpa [hf] using h + have := ih (i + 1) (l.erase f) l' M hM h' + have h1 : (p, f) ∈ own p l ++ M := (mem_own_append hM f).2 hf + have h2 : ∀ q ∈ own p l ++ M, desc p q.1 = false := nodesc_own_append (l := l) hM + simp only [go, hc, Option.bind_some, applyEv] + rw [if_pos ⟨h1, h2⟩, erase_own_append f hf] + simpa using this + · simp [hf] at h + | _ => simp [e1run] at h + +/-! ## Main theorem: the whole call tree, any depth, any call sites -/ + +theorem fresh_child {p : Path} {L : St} (h : NoDesc p L) (j : ℕ) : Fresh (p ++ [j]) L := by + intro q hq hpre + have h1 := h q hq + have : desc p q.1 = true := by + unfold desc + have hp : p.length < (p ++ [j]).length := by simp + have hl := hpre.length_le + simp only [Bool.and_eq_true, beq_iff_eq, decide_eq_true_eq] + refine ⟨?_, by omega⟩ + have := (List.prefix_append p [j]).trans hpre + exact (List.prefix_iff_eq_take.1 this).symm + rw [h1] at this; exact absurd this (by simp) + +theorem fresh_of_nodesc_ext {p : Path} {L : St} (h : NoDesc p L) (j : ℕ) : NoDesc (p ++ [j]) L := by + intro q hq + have := fresh_child h j q hq + exact desc_false_of_not_prefix this + +/-- A child run starting in a state with no live bank at or below the child returns the state unchanged. -/ +theorem execU_id (sites : List ℕ) (sk_ok : e1run [] skel = some []) : + ∀ (d : ℕ) (p : Path) (L : St), Fresh p L → execU sites d p L = some L := by + intro d + induction d with + | zero => + intro p L hL + have := go_frame p (fun _ L => some L) (fun _ _ _ => rfl) skel 0 [] [] L hL sk_ok + simpa [own, execU] using this + | succ d ih => + intro p L hL + have key := go_frame p (fun g L => (sitesAt sites g).foldlM (fun L j => execU sites d (p ++ [j]) L) L) + (by + intro i L' hL' + have : ∀ (js : List ℕ) (L'' : St), NoDesc p L'' → + js.foldlM (fun L j => execU sites d (p ++ [j]) L) L'' = some L'' := by + intro js + induction js with + | nil => intro L'' _; rfl + | cons j js ihj => + intro L'' hL'' + simp only [List.foldlM, ih (p ++ [j]) L'' (fresh_child hL'' j)] + exact ihj L'' hL'' + exact this _ _ hL') skel 0 [] [] L hL sk_ok + simpa [own, execU] using key + +/-- E3-tree for the recursion tree of the word: running the root unit (path []) to any depth, with +child calls at ANY set of call sites, succeeds and leaves no bank live. -/ +theorem e3_tree (sites : List ℕ) (d : ℕ) : execU sites d [] [] = some [] := + execU_id sites (by decide +kernel) d [] [] (by intro q hq; simp at hq) + +/-! ## The caller layer (#7113: 17 sequential native calls, the caller owns no storage) -/ + +/-- The caller as the root: 17 sequential native calls (children `[k]`), each a full call tree. -/ +def callerRun (sites : List ℕ) (d : ℕ) : Option St := + (List.range 17).foldlM (fun L k => execU sites d [k] L) [] + +theorem caller_tree (sites : List ℕ) (d : ℕ) : callerRun sites d = some [] := by + have : ∀ (ks : List ℕ) (L : St), (∀ q ∈ L, q.1 = [] ∨ ∀ k ∈ ks, ¬ [k] <+: q.1) → False ∨ True := by + intro _ _ _; exact Or.inr trivial + unfold callerRun + have h : ∀ (ks : List ℕ), ks.Nodup → ∀ (L : St), (∀ q ∈ L, ∀ k ∈ ks, ¬ [k] <+: q.1) → + ks.foldlM (fun L k => execU sites d [k] L) L = some L := by + intro ks + induction ks with + | nil => intro _ L _; rfl + | cons k ks ih => + intro hnd L hL + simp only [List.foldlM, execU_id sites (by decide +kernel) d [k] L (fun q hq => hL q hq k (by simp)), + Option.bind_some] + exact ih (List.nodup_cons.1 hnd).2 L (fun q hq k' hk' => hL q hq k' (by simp [hk'])) + exact h _ (List.nodup_range) [] (by intro q hq; simp at hq) + +/-! ## Concrete runs (kernel) and negative controls -/ + +/-- Run a unit made from `skel'` instead of `skel` (to test rejection). -/ +def execBad (skel' : List E) (sites : List ℕ) (p : Path) : Option St := + go (fun g L => (sitesAt sites g).foldlM + (fun L j => go (fun _ L => some L) (p ++ [j]) 0 L skel') L) p 0 [] skel + +/-- Control 1: a child that leaks one bank (its last CLEAR missing) leaves a live descendant bank; +the parent's next CLEAR (of its own field) is then rejected. Site at gap 1: parent has live field. -/ +def parentSk : List E := [.init 1501 3, .clear 1501 3] +def childLeak : List E := [.init 1502 3] +theorem c_child_leak : go (fun g L => if g = 1 then + go (fun _ L => some L) [0] 0 L childLeak else some L) [] 0 [] parentSk = none := by decide +kernel +/-- Control 1b (accepting twin): the same call with a well-formed child succeeds. -/ +def childOk : List E := [.init 1502 3, .clear 1502 3] +theorem c_child_ok : go (fun g L => if g = 1 then + go (fun _ L => some L) [0] 0 L childOk else some L) [] 0 [] parentSk = some [] := by decide +kernel +/-- Control 3: a child that CLEARs a bank it never owns (the parent's field, same label, other tag). -/ +theorem c_child_steals : go (fun g L => if g = 1 then + go (fun _ L => some L) [0] 0 L [.clear 1501 3] else some L) [] 0 [] parentSk = none := by decide +kernel +/-- Control 4: a parent CLEAR with a descendant bank live (applyEv directly). -/ +theorem c_clear_with_desc : + applyEv [] [([], 1501), ([0], 1502)] (.clear 1501 3) = none := by decide +kernel +theorem c_clear_no_desc : + applyEv [] [([], 1501)] (.clear 1501 3) = some [] := by decide +kernel +/-- Control 5: a sibling-boundary leak at caller level: a leaking native call is rejected by `go` at the root. -/ +theorem c_caller_leak : (go (fun _ L => some L) [3] 0 [] childLeak).bind (fun L => + if L = [] then some L else none) = none := by decide +kernel + +#print axioms go_frame +#print axioms execU_id +#print axioms e3_tree +#print axioms caller_tree + +end OwnedTree diff --git a/research/p104-lean-premises/lean/Nov15/OwnedTree.md b/research/p104-lean-premises/lean/Nov15/OwnedTree.md new file mode 100644 index 0000000000..ec68be7126 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/OwnedTree.md @@ -0,0 +1,26 @@ +# OwnedTree.lean / OwnedTreeCheck.lean: E3-tree (parent/child chronology) as a kernel fact for #7630 +Kernel-only (`decide +kernel`; no sorry, no native_decide). Axioms: propext / Classical.choice / Quot.sound (the data instances: propext, Quot.sound only). OwnedTree.lean 6 s / 2.0 GB; OwnedTreeCheck.lean 12 s / 3.05 GB (under the 3.5 GB guard; the depth-1 concrete run is capped at 4 child units for that reason). Build order: OwnedSkeleton, OwnedTreeData (generated by a script, not shipped, from the #7630 word file and a copy of the #7113 caller), OwnedTree, OwnedTreeCheck. + +## What "the unit tree" is, and where the data is +- The word carries NO unit tags (events are INIT/CLEAR/MOVE with registers and charts only), so the tree is not extractable from it; it comes from the contract's execution model. FINITE-PRECOMPILATION.md section 3: "At round j, suspend every unit of that class, complete the entire child class fed by that round, and only then advance the parents". So a child unit is a COMPLETE call made at a paid round (a MOVE), atomic from the parent's view; section 6: each live unit instance has its own bank ("a different unit tag"), "the parent resumes, reads or erases its center only after the entire child unit has completed ... a clear never acts on a descendant's live storage". +- The child of a node is the same finite word (uniform supplier / self-similar recursion), so one skeleton `skel` describes every node. +- The caller layer (#7113 as a local copy, sha 255d89f3, read as data): 4,783 events, exactly 17 `J` (native call) events, all other ops in {ADD, SCALE, LAMBDA, SWAP, QUERY, IDLE_ODD, IDLE_ONE}. None of these creates or erases owned storage, so the caller owns nothing; the 17 native calls are sequential siblings (children [k]), not nested. +- Call sites: the 6,250 MOVE events of the word, each with gap = number of owned events before it (sitesAll; 47 are owned MOVEs, sitesOwned). The theorem below does not depend on which sites are calls. + +## What is defined and proved +- `execU sites d p L`: run unit `p` to recursion depth `d`; at gap g run every child `p ++ [j]` with `sites[j] = g`, to completion, before event g. Banks are `(path, field)`. `applyEv`: INIT needs the bank dead, MOVE needs it live, CLEAR needs it live AND no live bank of any strict descendant (E3's clause, `desc`). +- `go_frame` (frame lemma): E1 of one unit (`e1run l es = some l'`) transports to the tagged run inside ANY context with no live bank at or below the unit; the context is restored. +- `execU_id`: from `e1run [] skel = some []` (a `decide +kernel` fact, ie E1 of `Sk skel`), by induction on depth: running any unit in a context with nothing at or below it returns the context unchanged. +- `e3_tree sites d : execU sites d [] [] = some []` for ALL depths and ALL call-site lists; `e3_tree_real` instantiates it at the real 6,250 sites (`n_sites`). +- `caller_tree sites d`: the 17 sequential native calls [0]..[16], each a depth-d tree, run from the empty state and end empty. `caller_17_calls`, `caller_alphabet`, `caller_len` (Check file). +- Concrete runs: `concrete_d1_owned` (root + first 4 real owned-MOVE sites as child units, kernel-evaluated, `some []`). +- Negative controls, all rejected (`= none`): `c_child_leak` (child leaves a bank live, parent's CLEAR rejected), `c_child_steals` (child CLEARs the parent's label under its own tag), `c_clear_with_desc` (parent CLEAR with a live descendant bank), `c_caller_leak`, `c_real_child_leak` (the real skeleton minus its last event as the child unit, called mid-parent). Accepting twins: `c_child_ok`, `c_clear_no_desc`. + +## Reading of E3 (precision, no false statement found) +- E3-tree is not independent evidence: given atomic calls and unit-tagged banks, it is IMPLIED by E1's "nothing live at the end" for the child (`execU_id`), whatever the call sites. The 2,165 crossing lifetime pairs and the 251 CLEARs under a live smaller-chart field are all INSIDE one unit's own lifetimes; E3 constrains only ancestor-vs-descendant, so they are not violations. The flat word could not show this, and neither does it need to. +- Counterexample to a different reading (not the contract's): if "the tree" were a chart hierarchy (child = field on a strictly smaller chart) the flat word would violate "clear never acts on a descendant's live storage" 251 times. Nothing in the contract text identifies a unit with a chart level; section 3 identifies units with paid rounds. If a reviewer holds the chart reading, that is a real objection. +- The clause is not automatic if a compiler interleaves child rounds with parent events (non-atomic children). The contract's own section 3 forbids that, so atomicity is part of E3's wording, but it is an execution-model assumption, not a property of the word. + +## After this: E1-E6 status for #7630 +Kernel facts: E1 (OwnedSkeleton), E2 allocation (peak 50 <= 68, 17 x 68 = 1,156 banks; OwnedSkeleton), E3 flat half (OwnedSkeleton) and E3 tree half (here, under the atomic-call model for every depth and call-site set), and the content half of erasure (ClearCert: every CLEAR lossless). +Still assumed: E4 (copy/read/erase linear in volume), E5 (paid non-reversible erase permitted), E6 (dirty residuals propagate as ADD errors): cost/permission, not in the row model. Compiler admission of the allocation and of owned ascent; atomic-call scheduling and the "child = same word" self-similarity (execution model, not extracted); extraction fidelity (skel, sites and caller alphabet are script-extracted; the caller file is a local copy of #7113; the 208,738-event replay and the 180 certificates are still not in the kernel); `native_all_columns`, `compiler`, `precision_tape`, `analytic_recovery`. diff --git a/research/p104-lean-premises/lean/Nov15/OwnedTreeCheck.lean b/research/p104-lean-premises/lean/Nov15/OwnedTreeCheck.lean new file mode 100644 index 0000000000..b4aa9d0c46 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/OwnedTreeCheck.lean @@ -0,0 +1,35 @@ +/- +LEAN-PREM6: instances of OwnedTree on the real data (generated OwnedTreeData.lean). +-/ +import Nov15.OwnedTree +import Nov15.OwnedTreeData + +namespace OwnedTree +open OwnedSkeleton + +/-- Real call sites: all 6250 MOVE events of the word. -/ +theorem e3_tree_real (d : ℕ) : execU sitesAll d [] [] = some [] := e3_tree sitesAll d +theorem n_sites : sitesAll.length = 6250 := by decide +kernel +theorem n_sites_owned : sitesOwned.length = 47 := by decide +kernel + +/-- The caller's op alphabet has no owned-storage op (codes 0..6 are ADD SCALE LAMBDA SWAP QUERY +IDLE_ODD IDLE_ONE; 7 is J = one native call). -/ +theorem caller_alphabet : callerOps.all (fun x => decide (x ≤ 7)) = true := by decide +kernel +theorem caller_17_calls : callerOps.count 7 = 17 := by decide +kernel +theorem caller_len : callerOps.length = 4783 := by decide +kernel + +/-- Depth 1 with the first 4 real owned-MOVE call sites (root + 4 child units, 2,0xx events; more sites +exceed the 3.5 GB kernel-evaluation guard, the general case is `e3_tree_real`). -/ +theorem concrete_d1_owned : execU (sitesOwned.take 4) 1 [] [] = some [] := by decide +kernel + +/-- Control 2: the real skeleton with its last event dropped, used as the child unit of the real parent, +is rejected (leak crosses the child boundary into the parent's CLEARs). -/ +theorem c_real_child_leak : + execBad skel.dropLast [skel.length / 2] [] = none := by decide +kernel + +#print axioms e3_tree_real +#print axioms concrete_d1_owned +#print axioms c_real_child_leak +#print axioms caller_alphabet + +end OwnedTree diff --git a/research/p104-lean-premises/lean/Nov15/OwnedTreeData.lean b/research/p104-lean-premises/lean/Nov15/OwnedTreeData.lean new file mode 100644 index 0000000000..4db900cd7b --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/OwnedTreeData.lean @@ -0,0 +1,297 @@ +/- GENERATED by ownedtree_gen/gen.py. word sha256 f5b4416e1b433e9a, caller sha256 255d89f38cd45e38. + sitesAll: for each of the 6250 MOVE events of the word, the number of owned events before it (call gap 0..407). + sitesOwned: the same for the 47 owned MOVEs. callerOps: op codes of the #7113 caller events (4783), 7 = J (native call). -/ +namespace OwnedTree + +def sitesAllRows : List (List Nat) := [ + [4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9], + [10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], + [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15], + [15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19], + [19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20], + [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20], + [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20], + [20, 20, 20, 20, 20, 20, 21, 22, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], + [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], + [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26], + [26, 26, 26, 26, 27, 28, 28, 28, 28, 28, 28, 28, 30, 32, 33, 34, 34, 35, 35, 35, 38, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40], + [40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 42, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45], + [45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46], + [46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46], + [46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46], + [46, 46, 47, 47, 47, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50], + [50, 50, 50, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51], + [51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 52, 52], + [52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53], + [53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53], + [53, 53, 53, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56], + [56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 57, 57, 57, 58, 58, 59, 59, 59, 60, 60, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 65, 67, 68, 69], + [69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73], + [73, 73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77], + [77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, 81, 81, 83, 83, 83, 83, 83, 83], + [83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 87, 87, 87, 87, 87, 87, 87], + [87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89], + [89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90], + [90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, 92, 92, 92], + [92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 95, 95, 97, 99, 99, 99, 99, 99, 99, 99, 99, 100, 100, 100], + [100, 100, 100, 101, 101, 101, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 104, 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106], + [106, 106, 106, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 108, 108, 108, 108, 108, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 112, 112, 112], + [112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114], + [114, 114, 114, 114, 114, 114, 115, 115, 115, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 117, 117, 117, 117, 118, 118, 120, 120, 120, 120, 120, 120, 120, 120], + [120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, 121, 121, 121, 122, 122, 122, 122, 122, 122, 122], + [122, 122, 122, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123], + [123, 123, 123, 123, 123, 123, 124, 124, 124, 124, 124, 124, 124, 124, 124, 125, 125, 125, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 129, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130], + [130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130], + [130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130], + [130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134], + [134, 134, 134, 134, 134, 134, 134, 136, 138, 140, 140, 140, 141, 141, 141, 141, 142, 142, 142, 142, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143], + [143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143], + [143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143], + [143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143], + [143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145], + [145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145], + [145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145], + [146, 146, 146, 146, 146, 146, 147, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, 149], + [149, 149, 149, 150, 150, 150, 150, 150, 150, 150, 151, 151, 151, 151, 151, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152], + [152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154], + [154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154], + [154, 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 156, 156, 156, 156, 156, 156, 156, 157, 157, 157, 157, 157, 157, 157], + [157, 157, 157, 157, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158], + [158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 159, 159, 159, 159, 159, 161, 161, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162], + [162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162], + [162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162], + [162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162], + [162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162], + [162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162], + [162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162], + [162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162], + [162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 164, 164, 164, 164, 164, 164, 164, 165, 165, 165, 165], + [166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, 169, 170, 172, 172, 172, 172, 172], + [172, 172, 172, 172, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173], + [173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 174, 174, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175], + [175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175], + [175, 175, 175, 175, 175, 175, 175, 175, 175, 176, 176, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, 179, 179, 179, 179], + [179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181], + [182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, 185, 186, 186, 186, 186, 186, 186, 186, 186, 186], + [186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188], + [188, 190, 190, 190, 190, 192, 193, 193, 193, 194, 194, 194, 194, 194, 195, 195, 199, 200, 200, 201, 201, 201, 209, 209, 210, 210, 212, 212, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215], + [215, 215, 215, 216, 216, 217, 217, 217, 217, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 222, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225], + [225, 225, 226, 226, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228], + [230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230], + [230, 230, 230, 230, 231, 231, 231, 231, 231, 231, 231, 231, 232, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 235], + [235, 237, 237, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238], + [238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 239, 239, 239, 239, 240, 242, 244, 244, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245], + [245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245], + [245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245], + [245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 246, 246, 247, 247, 249, 249, 250, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251], + [251, 251, 251, 251, 251, 251, 252, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253], + [253, 253, 253, 253, 253, 253, 253, 253, 253, 254, 255, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 257, 257, 257], + [257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 259, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260], + [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260], + [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260], + [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260], + [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260], + [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260], + [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 264, 264], + [264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264], + [264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 266, 266, 266, 266, 266, 266, 266, 266, 266], + [266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 267, 267, 268, 268, 268, 268, 268, 268, 268], + [268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268], + [268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268], + [268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 269], + [269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269], + [269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 270, 270, 270, 270, 272, 272, 272, 273, 273, 273, 274, 275, 276, 276, 277, 278, 278, 278, 279], + [279, 281, 281, 282, 283, 284, 285, 286, 286, 287, 289, 289, 289, 289, 289, 290, 291, 292, 293, 293, 293, 293, 293, 293, 293, 293, 296, 296, 297, 297, 299, 299, 301, 301, 303, 303, 304, 305, 306, 306], + [306, 308, 308, 310, 310, 310, 310, 310, 310, 310, 310, 310, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 314, 314, 314, 314, 314, 315, 315, 315, 315, 315, 315, 317, 317, 317, 317, 317], + [317, 317, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 323, 323, 324, 324, 324], + [324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 325, 325, 326, 326, 329, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 333, 333, 333, 333, 333, 333, 333, 333, 334], + [334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335], + [335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 336, 336, 337, 337, 337, 337, 337, 337, 337], + [337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337], + [337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337], + [337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337], + [337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338], + [338, 338, 338, 338, 338, 338, 338, 339, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 341], + [341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 343, 343, 343, 343, 344, 344, 344, 344, 344, 344, 344, 344, 345, 345, 346, 346, 346, 346, 346, 346, 346, 346], + [346, 346, 346, 346, 348, 348, 348, 349, 350, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351], + [351, 351, 351, 351, 351, 351, 352, 352, 354, 354, 355, 355, 355, 355, 356, 356, 357, 357, 357, 357, 357, 357, 357, 357, 358, 359, 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, 360], + [360, 362, 362, 364, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 366, 366, 366, 366, 366, 366, 366, 366, 366], + [366, 366, 366, 367, 367, 367, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, 368], + [368, 368, 368, 369, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370], + [370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370], + [370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370], + [370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 371, 371, 371, 371, 371, 371, 371, 371, 371], + [371, 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372], + [372, 373, 374, 375, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 378, 378, 378, 378], + [378, 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 380, 380, 380, 380], + [380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380], + [380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 381, 381, 381, 381, 381, 381, 381, 381, 381], + [381, 381, 381, 381, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382], + [382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382], + [382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382], + [382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382], + [382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382], + [382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382], + [382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382], + [382, 382, 382, 382, 382, 383, 383, 383, 383, 383, 383, 383, 383, 385, 387, 387, 387, 387, 387, 390, 390, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391], + [391, 391, 391, 391, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 393, 393, 393, 393, 393], + [394, 394, 396, 396, 396, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398], + [398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398], + [398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398], + [398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398], + [398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398], + [398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398], + [398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, 399, 399, 399, 399], + [399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399], + [399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399], + [399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399], + [399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399], + [399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399], + [399, 399, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400], + [400, 400, 400, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 402, 404, 406], + [406, 406, 406, 406, 406, 406, 406, 406, 406, 407]] + +def sitesAll : List Nat := sitesAllRows.flatten + +def sitesOwnedRows : List (List Nat) := [ + [30, 32, 34, 38, 39, 54, 61, 65, 67, 68, 69, 95, 97, 121, 127, 128, 129, 136, 138, 140, 141, 142, 182, 185, 186, 188, 192, 193, 200, 209, 210, 238, 240, 242, 244, 260, 264, 268, 324, 325], + [326, 329, 372, 374, 375, 392, 394]] + +def sitesOwned : List Nat := sitesOwnedRows.flatten + +def callerOpsRows : List (List Nat) := [ + [0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 2, 1, 0, 0, 1], + [2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 1, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1], + [0, 0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0], + [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0], + [0, 1, 2, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + [2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], + [0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0], + [0, 6, 0, 0, 6, 0, 0, 6, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [2, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0], + [6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 0, 6, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + [0, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 3, 0, 3], + [0, 3, 3, 0, 3, 0, 3, 0, 3, 0, 3, 3, 0, 3, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 3, 0, 3, 3, 0, 3, 0, 3, 0, 3, 0, 3, 3], + [0, 3, 0, 3, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0], + [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 1, 0, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0], + [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], + [0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + [0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0], + [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0], + [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0], + [0, 1, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + [1, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0], + [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], + [0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 0], + [0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], + [0, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 1], + [0, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3], + [0, 0, 0, 1, 0, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], + [1, 0, 0, 2, 0, 1, 0, 1, 2, 2, 1, 7, 2, 2, 1, 0, 0, 1, 0, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], + [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2], + [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]] + +def callerOps : List Nat := callerOpsRows.flatten + +end OwnedTree diff --git a/research/p104-lean-premises/lean/Nov15/PadLift.lean b/research/p104-lean-premises/lean/Nov15/PadLift.lean new file mode 100644 index 0000000000..1a77a11d47 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/PadLift.lean @@ -0,0 +1,228 @@ +/- +SPECBREAK R64 PAD-LIFT . +Source: internal notes, AUDIT64, R66/RESULT66.md. See PadLift.md. +-/ +import Nov15.SpecRankP +import Mathlib.LinearAlgebra.Matrix.Rank +import Mathlib.LinearAlgebra.Matrix.Diagonal +import Mathlib.LinearAlgebra.Matrix.Block +import Mathlib.LinearAlgebra.Matrix.NonsingularInverse +import Mathlib.Tactic.Ring +import Mathlib.FieldTheory.Finite.Basic + +open Matrix Module + +attribute [local instance] Nat.fact_prime_two + +set_option linter.unusedSectionVars false + +namespace PadLift + +variable {K : Type*} [Field K] {α β : Type*} [Fintype α] [DecidableEq α] [Fintype β] [DecidableEq β] + +/-- `g = diag(g', -I_pad)`. -/ +def padG (g' : Matrix α α K) : Matrix (α ⊕ β) (α ⊕ β) K := fromBlocks g' 0 0 (-1) + +/-- rank of a block-diagonal matrix. -/ +theorem rank_blockdiag (A : Matrix α α K) (D : Matrix β β K) : + (fromBlocks A 0 0 D).rank = A.rank + D.rank := by + classical + let e := LinearEquiv.sumArrowLequivProdArrow α β K K + have hf : Matrix.toLin' (fromBlocks A 0 0 D) = + e.symm.toLinearMap ∘ₗ ((LinearMap.prodMap (Matrix.toLin' A) (Matrix.toLin' D)) ∘ₗ e.toLinearMap) := by + refine LinearMap.ext fun x => ?_ + obtain ⟨x1, x2, rfl⟩ : ∃ x1 x2, x = Sum.elim x1 x2 := ⟨_, _, (Sum.elim_comp_inl_inr x).symm⟩ + have h1 : e (Sum.elim x1 x2) = (x1, x2) := rfl + simp only [Matrix.toLin'_apply, Matrix.fromBlocks_mulVec, LinearMap.comp_apply, + LinearEquiv.coe_coe, h1, LinearMap.prodMap_apply, zero_mulVec, add_zero, zero_add] + apply e.injective + rw [LinearEquiv.apply_symm_apply] + rfl + have hrange : LinearMap.range (Matrix.toLin' (fromBlocks A 0 0 D)) = + Submodule.map e.symm.toLinearMap + (LinearMap.range (LinearMap.prodMap (Matrix.toLin' A) (Matrix.toLin' D))) := by + rw [hf, LinearMap.range_comp, + LinearMap.range_comp_of_range_eq_top _ (LinearEquiv.range e)] + have hprod : ∀ (p : Submodule K (α → K)) (q : Submodule K (β → K)), + finrank K (p.prod q) = finrank K p + finrank K q := fun p q => by + have hinj : Function.Injective (LinearMap.prodMap p.subtype q.subtype) := + Function.Injective.prodMap p.injective_subtype q.injective_subtype + have : LinearMap.range (p.subtype.prodMap q.subtype) = p.prod q := by + rw [LinearMap.range_prodMap, Submodule.range_subtype, Submodule.range_subtype] + rw [← this, LinearMap.finrank_range_of_inj hinj, Module.finrank_prod] + change finrank K (LinearMap.range (Matrix.toLin' (fromBlocks A 0 0 D))) = + finrank K (LinearMap.range (Matrix.toLin' A)) + finrank K (LinearMap.range (Matrix.toLin' D)) + rw [hrange, LinearEquiv.finrank_map_eq, LinearMap.range_prodMap, hprod] + +/-- **(1) PAD-LIFT, rank.** char ≠ 2: `rank(I - diag(g', -I_pad)) = rank(I - g') + |pad|`. -/ +theorem pad_rank (h2 : (2 : K) ≠ 0) (g' : Matrix α α K) : + (1 - padG (β := β) g').rank = (1 - g').rank + Fintype.card β := by + classical + have h : (1 : Matrix (α ⊕ β) (α ⊕ β) K) - padG g' = + fromBlocks (1 - g') 0 0 (Matrix.diagonal fun _ : β => (2 : K)) := by + ext i j + rcases i with i | i <;> rcases j with j | j <;> + simp [padG, Matrix.one_apply, Matrix.diagonal_apply] <;> (try split_ifs) <;> (try ring) + rw [h, rank_blockdiag, Matrix.rank_diagonal] + congr 1 + simp [h2] + +/-- **(2) PAD-LIFT, involution** (any characteristic): +`diag(g', -I_pad)² = I ⇔ g'² = I`. -/ +theorem pad_sq (g' : Matrix α α K) : padG (β := β) g' * padG g' = 1 ↔ g' * g' = 1 := by + have h : padG (β := β) g' * padG g' = fromBlocks (g' * g') 0 0 1 := by + simp [padG, Matrix.fromBlocks_multiply] + rw [h, ← Matrix.fromBlocks_one, Matrix.fromBlocks_inj] + simp + +/-- **(3) PAD-LIFT, lifting of a kill.** A kill of the form +"`rank(I - g') ≥ r`, with equality ⇒ `g'² = I`" lifts to +"`rank(I - g) ≥ r + |pad|`, with equality ⇒ `g² = I`". (char ≠ 2.) -/ +theorem lift_kill (h2 : (2 : K) ≠ 0) (g' : Matrix α α K) (r : ℕ) + (hge : r ≤ (1 - g').rank) (heq : (1 - g').rank = r → g' * g' = 1) : + r + Fintype.card β ≤ (1 - padG (β := β) g').rank ∧ + ((1 - padG (β := β) g').rank = r + Fintype.card β → padG (β := β) g' * padG g' = 1) := by + rw [pad_rank h2] + refine ⟨by omega, fun h => (pad_sq g').2 (heq (by omega))⟩ + +/-- Budget form: a rank budget `U` (rank(I - g) ≤ U) for the padded system. -/ +theorem lift_budget (h2 : (2 : K) ≠ 0) (g' : Matrix α α K) (r : ℕ) + (hge : r ≤ (1 - g').rank) (heq : (1 - g').rank = r → g' * g' = 1) (U : ℕ) + (hU : (1 - padG (β := β) g').rank ≤ U) : + r + Fintype.card β ≤ U ∧ + (U = r + Fintype.card β → padG (β := β) g' * padG g' = 1) := by + obtain ⟨h1, h3⟩ := lift_kill (β := β) h2 g' r hge heq + refine ⟨le_trans h1 hU, fun hUe => h3 (le_antisymm (hUe ▸ hU) h1)⟩ + +/-! ### The realisation level: dark pads give block-diagonal `J`, `D`, `g = D J⁻¹`. -/ + +/-- `J = diag(J', I_pad)`. -/ +def lift1 (M : Matrix α α K) : Matrix (α ⊕ β) (α ⊕ β) K := fromBlocks M 0 0 1 + +theorem lift1_mul (M N : Matrix α α K) : lift1 (β := β) (M * N) = lift1 M * lift1 N := by + simp [lift1, Matrix.fromBlocks_multiply] + +theorem lift1_one : lift1 (β := β) (1 : Matrix α α K) = 1 := by + simp [lift1] + +/-- A job `1 - x yᵀ` with `x, y` vanishing on the pad registers is `diag(1 - x' y'ᵀ, I_pad)`. -/ +theorem job_dark (x y : α → K) : + (1 : Matrix (α ⊕ β) (α ⊕ β) K) - Matrix.vecMulVec (Sum.elim x 0) (Sum.elim y 0) = + lift1 (1 - Matrix.vecMulVec x y) := by + ext i j + rcases i with i | i <;> rcases j with j | j <;> + simp [lift1, Matrix.one_apply, Matrix.vecMulVec_apply] + +/-- A product of dark jobs is `diag(J', I_pad)`. -/ +theorem jobs_dark (L : List ((α → K) × (α → K))) : + (L.map fun p => (1 : Matrix (α ⊕ β) (α ⊕ β) K) - + Matrix.vecMulVec (Sum.elim p.1 0) (Sum.elim p.2 0)).prod = + lift1 (L.map fun p => (1 : Matrix α α K) - Matrix.vecMulVec p.1 p.2).prod := by + induction L with + | nil => simp [lift1_one] + | cons p L ih => + rw [List.map_cons, List.prod_cons, List.map_cons, List.prod_cons, job_dark, ih, lift1_mul] + +/-- `g = D J⁻¹` with `D = diag(D', -I)`, `J = diag(J', I)`: `g = diag(D' J'⁻¹, -I)`. -/ +theorem g_blockdiag (D' J' : Matrix α α K) (hJ : IsUnit J'.det) : + fromBlocks D' 0 0 (-1 : Matrix β β K) * (lift1 (β := β) J')⁻¹ = padG (D' * J'⁻¹) := by + have hinv : (lift1 (β := β) J')⁻¹ = lift1 J'⁻¹ := by + apply Matrix.inv_eq_right_inv + rw [← lift1_mul, Matrix.mul_nonsing_inv _ hJ, lift1_one] + rw [hinv] + simp [lift1, padG, Matrix.fromBlocks_multiply] + +/-- Char 2 counterexample: `+2k` in (1) needs `char ≠ 2` (here `-I = I`, so the pad is invisible). -/ +theorem pad_rank_char2_fails : + ∃ g' : Matrix Unit Unit (ZMod 2), + (1 - padG (β := Unit) g').rank ≠ (1 - g').rank + Fintype.card Unit := by + refine ⟨1, ?_⟩ + have hneg : (-1 : Matrix Unit Unit (ZMod 2)) = 1 := by + ext i j; simp + have h : (1 : Matrix (Unit ⊕ Unit) (Unit ⊕ Unit) (ZMod 2)) - padG (β := Unit) 1 = 0 := by + rw [padG, hneg, Matrix.fromBlocks_one, sub_self] + rw [h]; simp + +/-! ### Corollary: `rank_ge` is dimension-free in `S` +(RB4 item 1 with `S` of arbitrary dimension `m`; the padded case is `m = 2k + 2`.) -/ +section Free +open SpecRankP + +/-- `Δ = +1` on `e₁` and ancillas, `-1` on `m` S-coordinates. -/ +def DlM (K : Type*) [Field K] (m : ℕ) (ι : Type*) [DecidableEq ι] : + Matrix (Unit ⊕ Fin m ⊕ ι) (Unit ⊕ Fin m ⊕ ι) K := + Matrix.diagonal (Sum.elim (fun _ => 1) (Sum.elim (fun _ => -1) (fun _ => 1))) + +theorem rank_ge_dim {ι : Type*} [Fintype ι] [DecidableEq ι] (m : ℕ) + (h2 : (2 : K) ≠ 0) (P : Matrix (Unit ⊕ Fin m ⊕ ι) (Unit ⊕ Fin m ⊕ ι) K) + (V : Submodule K (Unit ⊕ Fin m ⊕ ι → K)) (hV : finrank K V ≤ 2) + (he1 : (Pi.single (Sum.inl ()) 1 : Unit ⊕ Fin m ⊕ ι → K) ∈ V) + (hP : ∀ w, P *ᵥ w - w ∈ V) (hdet : P.det = 1) : + m ≤ (DlM K m ι - P).rank := by + let S : Submodule K (Unit ⊕ Fin m ⊕ ι → K) := + Submodule.span K (Set.range fun i : Fin m => (Pi.single (Sum.inr (Sum.inl i)) 1 : Unit ⊕ Fin m ⊕ ι → K)) + have hli : LinearIndependent K (fun i : Fin m => (Pi.single (Sum.inr (Sum.inl i)) 1 : Unit ⊕ Fin m ⊕ ι → K)) := by + have := (Pi.basisFun K (Unit ⊕ Fin m ⊕ ι)).linearIndependent + have h := this.comp (fun i : Fin m => (Sum.inr (Sum.inl i) : Unit ⊕ Fin m ⊕ ι)) + (fun a b h => by simpa using h) + convert h using 1 + funext i + simp [Pi.basisFun_apply] + have hS : finrank K S = m := by + simpa using finrank_span_eq_card hli + have hΔS : ∀ s ∈ S, Matrix.toLin' (DlM K m ι) s = -s := by + intro s hs + refine Submodule.span_induction ?_ ?_ ?_ ?_ hs + · rintro _ ⟨i, rfl⟩ + ext j + simp [DlM, Matrix.toLin'_apply, Matrix.mulVec_diagonal, Pi.single_apply] + aesop + · simp + · intro x y _ _ hx hy; rw [map_add, hx, hy]; abel + · intro a x _ hx; rw [map_smul, hx]; simp + have hΔe : Matrix.toLin' (DlM K m ι) (Pi.single (Sum.inl ()) 1) = Pi.single (Sum.inl ()) 1 := by + ext j + simp only [DlM, Matrix.toLin'_apply, Matrix.mulVec_diagonal, Pi.single_apply] + split_ifs with h <;> simp [h] + have heS : (Pi.single (Sum.inl ()) 1 : Unit ⊕ Fin m ⊕ ι → K) ∉ S := by + intro hm + have hmem : ∀ x ∈ S, x (Sum.inl ()) = 0 := by + intro x hx + refine Submodule.span_induction ?_ ?_ ?_ ?_ hx + · rintro _ ⟨i, rfl⟩; simp [Pi.single_apply] + · simp + · intro x y _ _ hx hy; simp [hx, hy] + · intro a x _ hx; simp [hx] + have := hmem _ hm + simp at this + have := rank_ge h2 S V (Matrix.toLin' (DlM K m ι)) (Matrix.toLin' P) hΔS _ hΔe heS hV he1 + (fun w => by simpa [Matrix.toLin'_apply] using hP w) (by rw [LinearMap.det_toLin']; exact hdet) + rw [hS] at this + have e : (DlM K m ι - P).rank = finrank K (LinearMap.range (Matrix.toLin' (DlM K m ι) - Matrix.toLin' P)) := by + rw [← map_sub]; rfl + rw [e]; exact this + +/-- The padded case: `dim S = 2k + 2` gives `rank(Δ - P) ≥ 2k + 2`; at `k = 1` this is the `4` of +`SpecRankP.rank_ge_four` (`m = 4`), at `k = 0`, `m = 2`. -/ +theorem rank_ge_pad {ι : Type*} [Fintype ι] [DecidableEq ι] (k : ℕ) + (h2 : (2 : K) ≠ 0) (P : Matrix (Unit ⊕ Fin (2 * k + 2) ⊕ ι) (Unit ⊕ Fin (2 * k + 2) ⊕ ι) K) + (V : Submodule K (Unit ⊕ Fin (2 * k + 2) ⊕ ι → K)) (hV : finrank K V ≤ 2) + (he1 : (Pi.single (Sum.inl ()) 1 : Unit ⊕ Fin (2 * k + 2) ⊕ ι → K) ∈ V) + (hP : ∀ w, P *ᵥ w - w ∈ V) (hdet : P.det = 1) : + 2 * k + 2 ≤ (DlM K (2 * k + 2) ι - P).rank := + rank_ge_dim _ h2 P V hV he1 hP hdet + +end Free + +end PadLift + +#print axioms PadLift.rank_blockdiag +#print axioms PadLift.pad_rank +#print axioms PadLift.pad_sq +#print axioms PadLift.lift_kill +#print axioms PadLift.lift_budget +#print axioms PadLift.jobs_dark +#print axioms PadLift.g_blockdiag +#print axioms PadLift.pad_rank_char2_fails +#print axioms PadLift.rank_ge_dim +#print axioms PadLift.rank_ge_pad diff --git a/research/p104-lean-premises/lean/Nov15/PadLift.md b/research/p104-lean-premises/lean/Nov15/PadLift.md new file mode 100644 index 0000000000..ee7778ee16 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/PadLift.md @@ -0,0 +1,15 @@ +# Nov15/PadLift.lean +Formalises R64 PAD-LIFT (internal notes) in the AUDIT64 form: lifting of the U-INDEPENDENT rank bound plus involution (not "kills at U"). Kernel-only: no sorry, no native_decide; 10 `#print axioms` all [propext, Classical.choice, Quot.sound]. 9 s / 2.1 GB (imports Nov15.SpecRankP + Mathlib sub-imports). + +## Proved (g' on index alpha, pad on index beta, |beta| = 2k, g = padG g' = fromBlocks g' 0 0 (-1)) +- `rank_blockdiag`: rank(diag(A, D)) = rank A + rank D (Mathlib had no such lemma). +- (1) `pad_rank` [char != 2]: rank(1 - padG g') = rank(1 - g') + |beta|. +- (2) `pad_sq` [any char]: padG g' * padG g' = 1 <-> g' * g' = 1. +- (3) `lift_kill` [char != 2]: "r <= rank(1-g'), equality => g'^2 = 1" gives "r + |beta| <= rank(1-g), equality => g^2 = 1". `lift_budget`: with rank(1-g) <= U, r + 2k <= U, and U = r + 2k => g^2 = 1 (so the lifted kill needs U >= r + 2k, equality case involutive). +- Realisation level (the "pads dark" step): `job_dark`/`jobs_dark`: a product of jobs 1 - x y^T with x, y zero on the pad registers (x = Sum.elim x' 0) equals lift1 J' = diag(J', I_pad); `g_blockdiag`: with D = diag(D', -I), J = diag(J', I), J' invertible, D J^-1 = padG (D' J'^-1). +- Corollary (dimension-free): `rank_ge_dim` = SpecRankP.rank_ge in RB1 coordinates with Fin m S-coordinates for ANY m: m <= rank(Delta - P) (same hypotheses as rank_ge_four, which is m = 4); `rank_ge_pad`: m = 2k + 2 gives 2k + 2 <= rank(Delta - P). (SpecRankP.rank_ge already had dim S arbitrary; this is the matrix form.) + +## Paper statement check +- TRUE as written provided char != 2 (the paper's standing hypothesis; R66 lists it). Counterexample otherwise: `pad_rank_char2_fails` (ZMod 2, g' = 1 on Unit, one pad register: -I = I so rank(1-g) = 0 != 0 + 1). Part (2) and the block form need no characteristic assumption. +- NOT formalised (hypotheses, as in the paper): that TS forces x, y to vanish on the pads (R42 TS, tight-set support) and D = -1 on pads at unit characters (F2); the individual kills (SPLIT/INV/LB) that supply the base bound for g'. PAD-LIFT is exactly "given those, the lift is formal": the Lean theorems take dark pads as the shape of g, J, D. +- Scope note per AUDIT64: the lift transfers bound + involution for each tight-covered profile at every k; it does not itself say "dead at U"; `lift_budget` shows the form: dead for U < r + 2k, involutive at U = r + 2k. diff --git a/research/p104-lean-premises/lean/Nov15/PlaneLaws.lean b/research/p104-lean-premises/lean/Nov15/PlaneLaws.lean new file mode 100644 index 0000000000..3802caa2b1 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/PlaneLaws.lean @@ -0,0 +1,270 @@ +/- +PlaneLaws . See PlaneLaws.md. Sources: internal notes (SPLIT), GC9.md + SPEC-PLANE.md (QUARTER). + +Vectors `Fin n → ZMod 2` with the standard dot; `one` = all-ones; a TOKEN/port is an odd vector (dot with `one` = 1). + Part 1 SPLIT (any n, any odd-port set): each token of u_t^perp lies in exactly one of u_t^perp ∩ u_t'^perp and + u_t^perp ∩ (u_t'+1)^perp (= u_t^perp ∩ t''^perp, t'' = u_t+u_t'+1). t'' is odd for odd n and t'' ≠ 1 iff u_t ≠ u_t'. + Part 2 QUARTER (any n, any subspace B containing 1): H_s = B ∩ s^perp is a hyperplane of B through p, avoiding 1; the quarters + Q_H = {odd s ⊥ H} partition the junk of p exactly (EXISTENCE and UNIQUENESS), each read by the ports of H. + Part 3 E7 numbers (n = 7, |B| = 16, kernel `decide` on 7-bit masks): 32 junk tokens, 4 quarters of 8, 4 readers each; SPLIT parts 16+16. +Kernel only: no sorry, no native_decide. +-/ +import Mathlib.LinearAlgebra.Matrix.DotProduct +import Mathlib.LinearAlgebra.Span.Basic +import Mathlib.Data.ZMod.Basic +import Mathlib.Algebra.BigOperators.Fin +import Mathlib.Tactic.FinCases +import Mathlib.Tactic.IntervalCases + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace PlaneLaws +open Matrix + +abbrev Vec (n : ℕ) := Fin n → ZMod 2 +def one (n : ℕ) : Vec n := fun _ => 1 +/-- odd = a token / port. -/ +def Tok {n : ℕ} (s : Vec n) : Prop := s ⬝ᵥ one n = 1 +/-- s is a junk token of p: odd and orthogonal to p. -/ +def Junk {n : ℕ} (p s : Vec n) : Prop := Tok s ∧ s ⬝ᵥ p = 0 + +theorem z2_xor : ∀ a : ZMod 2, (a = 0 ↔ ¬ (a + 1 = 0)) := by decide +/-- exactly one of a, b. -/ +def Xr (a b : Prop) : Prop := (a ∧ ¬ b) ∨ (¬ a ∧ b) + +theorem z2_nz : ∀ a : ZMod 2, ¬ a = 0 → a + 1 = 0 := by decide +theorem z2_add_eq : ∀ a b : ZMod 2, a + b = 0 → a = b := by decide + +/-! ### Part 1: SPLIT -/ +section Split +variable {n : ℕ} + +theorem dot_add_one (s u : Vec n) : s ⬝ᵥ (u + one n) = s ⬝ᵥ u + s ⬝ᵥ one n := dotProduct_add _ _ _ + +/-- SPLIT, dichotomy: an odd s is orthogonal to exactly one of u' and u'+1. -/ +theorem split_xor (s u' : Vec n) (hs : Tok s) : Xr (s ⬝ᵥ u' = 0) (s ⬝ᵥ (u' + one n) = 0) := by + have h := dot_add_one s u' + rw [hs] at h + rw [h] + have := z2_xor (s ⬝ᵥ u') + by_cases h0 : s ⬝ᵥ u' = 0 + · exact Or.inl ⟨h0, this.mp h0⟩ + · exact Or.inr ⟨h0, z2_nz _ h0⟩ + +/-- SPLIT lemma: every token of u_t^perp is in exactly one of C(t,t') and C(t,t'') (t'' = u_t + u_t' + 1). -/ +theorem split_lemma (ut ut' s : Vec n) (hs : Tok s) (h : s ⬝ᵥ ut = 0) : + Xr (s ⬝ᵥ ut' = 0) (s ⬝ᵥ (ut + ut' + one n) = 0) := by + have e : s ⬝ᵥ (ut + ut' + one n) = s ⬝ᵥ (ut' + one n) := by + rw [add_assoc, dotProduct_add, h, zero_add] + rw [e]; exact split_xor s ut' hs + +/-- the same, as a partition statement on the token set of t. -/ +theorem split_partition (ut ut' : Vec n) : + {s : Vec n | Tok s ∧ s ⬝ᵥ ut = 0} = + {s | Tok s ∧ s ⬝ᵥ ut = 0 ∧ s ⬝ᵥ ut' = 0} ∪ {s | Tok s ∧ s ⬝ᵥ ut = 0 ∧ s ⬝ᵥ (ut + ut' + one n) = 0} ∧ + Disjoint {s : Vec n | Tok s ∧ s ⬝ᵥ ut = 0 ∧ s ⬝ᵥ ut' = 0} {s | Tok s ∧ s ⬝ᵥ ut = 0 ∧ s ⬝ᵥ (ut + ut' + one n) = 0} := by + constructor + · ext s + simp only [Set.mem_setOf_eq, Set.mem_union] + constructor + · rintro ⟨hs, h⟩ + rcases split_lemma ut ut' s hs h with ⟨a, _⟩ | ⟨_, b⟩ + · exact Or.inl ⟨hs, h, a⟩ + · exact Or.inr ⟨hs, h, b⟩ + · rintro (⟨hs, h, _⟩ | ⟨hs, h, _⟩) <;> exact ⟨hs, h⟩ + · rw [Set.disjoint_left] + rintro s ⟨hs, h, a⟩ ⟨_, _, b⟩ + rcases split_lemma ut ut' s hs h with ⟨_, nb⟩ | ⟨na, _⟩ + · exact nb b + · exact na a + +/-- t'' is odd when n is odd and u_t, u_t' are odd. -/ +theorem tok_t'' (ut ut' : Vec n) (hn : one n ⬝ᵥ one n = 1) (h1 : Tok ut) (h2 : Tok ut') : + Tok (ut + ut' + one n) := by + unfold Tok at * + rw [add_assoc, add_dotProduct, add_dotProduct, h1, h2, hn]; decide + +/-- t'' = 1 iff u_t = u_t': so t'' is a port of the full odd set (1 excluded) exactly when t != t'. -/ +theorem t''_eq_one (ut ut' : Vec n) : ut + ut' + one n = one n ↔ ut = ut' := by + constructor + · intro h + funext i + have := congrFun h i + simp only [Pi.add_apply, one] at this + have h' : ut i + ut' i + 1 = 1 := this + exact z2_add_eq _ _ (by simpa using h') + · rintro rfl + funext i + simp only [Pi.add_apply, one] + generalize ut i = a; revert a; decide + +end Split + +/-! ### Part 2: QUARTER -/ +section Quarter +variable {n : ℕ} + +/-- H is a hyperplane of B avoiding 1: H ≤ B, 1 ∉ H, and B = H ∪ (H + 1). -/ +structure QHyp (B H : Submodule (ZMod 2) (Vec n)) : Prop where + le : H ≤ B + one_nmem : one n ∉ H + cover : ∀ b ∈ B, b ∈ H ∨ b + one n ∈ H + +/-- H_s = B ∩ s^perp as a submodule. -/ +def dotL (s : Vec n) : Vec n →ₗ[ZMod 2] ZMod 2 where + toFun v := s ⬝ᵥ v + map_add' := dotProduct_add s + map_smul' c v := by simp [dotProduct_smul] + +def Hs (B : Submodule (ZMod 2) (Vec n)) (s : Vec n) : Submodule (ZMod 2) (Vec n) := B ⊓ LinearMap.ker (dotL s) + +theorem mem_Hs {B : Submodule (ZMod 2) (Vec n)} {s b : Vec n} : b ∈ Hs B s ↔ b ∈ B ∧ s ⬝ᵥ b = 0 := by + simp [Hs, dotL] + +/-- QUARTER (a): for 1 ∈ B and an odd s, H_s is a hyperplane of B avoiding 1. -/ +theorem qhyp_Hs {B : Submodule (ZMod 2) (Vec n)} (hB : one n ∈ B) {s : Vec n} (hs : Tok s) : QHyp B (Hs B s) := by + refine ⟨inf_le_left, ?_, ?_⟩ + · rw [mem_Hs]; rintro ⟨_, h⟩; rw [hs] at h; exact absurd h (by decide) + · intro b hb + simp only [mem_Hs] + rcases split_xor s b hs with ⟨a, _⟩ | ⟨_, c⟩ + · exact Or.inl ⟨hb, a⟩ + · exact Or.inr ⟨B.add_mem hb hB, c⟩ + +/-- tokens of the quarter chart Q_H (odd s orthogonal to all of H). -/ +def Qtok (H : Submodule (ZMod 2) (Vec n)) (s : Vec n) : Prop := Tok s ∧ ∀ h ∈ H, s ⬝ᵥ h = 0 + +theorem qtok_Hs (B : Submodule (ZMod 2) (Vec n)) {s : Vec n} (hs : Tok s) : Qtok (Hs B s) s := + ⟨hs, fun h hh => (mem_Hs.mp hh).2⟩ + +/-- QUARTER (b), uniqueness: a hyperplane H of B avoiding 1 whose chart contains s is H_s. -/ +theorem qhyp_unique {B H : Submodule (ZMod 2) (Vec n)} (hH : QHyp B H) {s : Vec n} (hq : Qtok H s) : + H = Hs B s := by + ext b + rw [mem_Hs] + constructor + · intro hb; exact ⟨hH.le hb, hq.2 b hb⟩ + · rintro ⟨hbB, hsb⟩ + rcases hH.cover b hbB with h | h + · exact h + · exfalso + have := hq.2 _ h + rcases split_xor s b hq.1 with ⟨_, nb⟩ | ⟨na, _⟩ + · exact nb this + · exact na hsb + +/-- every token of Q_H is a junk token of every port p in H, in particular of each reader. -/ +theorem qtok_junk {H : Submodule (ZMod 2) (Vec n)} {p s : Vec n} (hp : p ∈ H) (hq : Qtok H s) : Junk p s := + ⟨hq.1, hq.2 p hp⟩ + +/-- QUARTER LEMMA (exact partition, any n): for a subspace B ∋ 1 and p ∈ B, each junk token s of p lies in the +chart Q_H of exactly one hyperplane H of B through p avoiding 1, namely H = H_s = B ∩ s^perp. -/ +theorem quarter_partition {B : Submodule (ZMod 2) (Vec n)} (hB : one n ∈ B) {p : Vec n} (hp : p ∈ B) {s : Vec n} + (hj : Junk p s) : ∃! H : Submodule (ZMod 2) (Vec n), QHyp B H ∧ p ∈ H ∧ Qtok H s := by + refine ⟨Hs B s, ⟨qhyp_Hs hB hj.1, mem_Hs.mpr ⟨hp, ?_⟩, qtok_Hs B hj.1⟩, ?_⟩ + · exact hj.2 + · rintro H ⟨hH, _, hq⟩; exact qhyp_unique hH hq + +/-- the readers of Q_H are the ports of H: each sees every token of Q_H as its own junk. -/ +theorem readers_see_all {H : Submodule (ZMod 2) (Vec n)} {r s : Vec n} (hr : r ∈ H) (hs : Qtok H s) : Junk r s := + qtok_junk hr hs + +/-- the quarters of different hyperplanes are disjoint (no token in two charts of H through p). -/ +theorem quarters_disjoint {B H H' : Submodule (ZMod 2) (Vec n)} (h : QHyp B H) (h' : QHyp B H') {s : Vec n} + (a : Qtok H s) (b : Qtok H' s) : H = H' := by + rw [qhyp_unique h a, qhyp_unique h' b] + +end Quarter + +/-! ### Part 3: E7 numbers, n = 7, vectors as 7-bit masks, kernel `decide` -/ +section E7 + +/-- parity of the weight of a 7-bit mask (xor-fold). -/ +def par (m : ℕ) : ℕ := + let m := m ^^^ (m >>> 4) + let m := m ^^^ (m >>> 2) + let m := m ^^^ (m >>> 1) + m &&& 1 +def dotb (a b : ℕ) : ℕ := par (a &&& b) +def tokb (s : ℕ) : Bool := par s == 1 +def ones : ℕ := 127 + +/-- a 4-dim block B ∋ 1: last four coordinates equal (16 vectors). -/ +def Bl : List ℕ := (List.range 128).filter fun x => + x.testBit 3 == x.testBit 4 && x.testBit 4 == x.testBit 5 && x.testBit 5 == x.testBit 6 + +def portb (p : ℕ) : Bool := tokb p && p != ones + +def junkb (p : ℕ) : List ℕ := (List.range 128).filter fun s => tokb s && dotb s p == 0 +def Hb (s : ℕ) : List ℕ := Bl.filter fun b => dotb s b == 0 +def quartersb (p : ℕ) : List (List ℕ) := ((junkb p).map Hb).dedup + +/-- Bl has 16 elements, contains 1 and has exactly 7 ports. -/ +theorem e7_block : Bl.length = 16 ∧ ones ∈ Bl ∧ (Bl.filter portb).length = 7 := by decide +kernel + +/-- QUARTER on E7: for every port p of B: 32 junk tokens, 4 quarters H (distinct hyperplanes through p, avoiding 1, +each of 8 elements), each chart holds exactly 8 tokens and has exactly 4 readers (ports in H); the quarters cover. -/ +def e7QuarterCheck : Bool := (Bl.filter portb).all fun p => + (junkb p).length == 32 && (quartersb p).length == 4 && + (quartersb p).all fun H => + H.length == 8 && H.contains p && !(H.contains ones) && (H.filter portb).length == 4 && + ((junkb p).filter fun s => Hb s == H).length == 8 + +theorem e7_quarter : e7QuarterCheck = true := by decide +kernel + +/-- SPLIT on E7: for ports t != t': t'' = u_t + u_t' + 1 is a port, u_t^perp has 32 tokens, C(t,t') has 16 +(so C(t,t'') has the other 16, by `split_partition`). -/ +def tokens (t : ℕ) : List ℕ := (List.range 128).filter fun s => tokb s && dotb s t == 0 + +def splitRow (t : ℕ) : Bool := (List.range 128).all fun t' => + if portb t && portb t' && t != t' then + portb (t ^^^ t' ^^^ ones) && (tokens t).length == 32 && ((tokens t).filter fun s => dotb s t' == 0).length == 16 + else true + +def chunkCheck (a b : ℕ) : Bool := (List.range b).all fun i => splitRow (a + i) + +theorem e7_split_0 : chunkCheck 0 16 = true := by decide +kernel +theorem e7_split_1 : chunkCheck 16 16 = true := by decide +kernel +theorem e7_split_2 : chunkCheck 32 16 = true := by decide +kernel +theorem e7_split_3 : chunkCheck 48 16 = true := by decide +kernel +theorem e7_split_4 : chunkCheck 64 16 = true := by decide +kernel +theorem e7_split_5 : chunkCheck 80 16 = true := by decide +kernel +theorem e7_split_6 : chunkCheck 96 16 = true := by decide +kernel +theorem e7_split_7 : chunkCheck 112 16 = true := by decide +kernel + +/-- SPLIT on E7, all 128 rows of t (eight kernel-checked chunks). -/ +theorem e7_split : ∀ t, t < 128 → splitRow t = true := by + have h : ∀ k, k < 8 → chunkCheck (16 * k) 16 = true := by + intro k hk + interval_cases k + · exact e7_split_0 + · exact e7_split_1 + · exact e7_split_2 + · exact e7_split_3 + · exact e7_split_4 + · exact e7_split_5 + · exact e7_split_6 + · exact e7_split_7 + intro t ht + have := h (t / 16) (by omega) + simp only [chunkCheck, List.all_eq_true, List.mem_range] at this + have := this (t % 16) (by omega) + have e : 16 * (t / 16) + t % 16 = t := by omega + rwa [e] at this + +/-- the E7 totals of GC9: 9 blocks x 7 ports x 4 quarters = 252 deliverers; 9 x 7 charts x 8 tokens = 504 events. -/ +theorem e7_totals : 9 * 7 * 4 = 252 ∧ 9 * 7 * 8 = 504 ∧ 504 * 4 = 252 * 8 := by decide + +end E7 + +end PlaneLaws + +#print axioms PlaneLaws.split_lemma +#print axioms PlaneLaws.split_partition +#print axioms PlaneLaws.tok_t'' +#print axioms PlaneLaws.t''_eq_one +#print axioms PlaneLaws.quarter_partition +#print axioms PlaneLaws.e7_block +#print axioms PlaneLaws.e7_quarter +#print axioms PlaneLaws.e7_split diff --git a/research/p104-lean-premises/lean/Nov15/PlaneLaws.md b/research/p104-lean-premises/lean/Nov15/PlaneLaws.md new file mode 100644 index 0000000000..9396cc12aa --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/PlaneLaws.md @@ -0,0 +1,22 @@ +# PlaneLaws : SPLIT and QUARTER lemmas in Lean + +`Nov15/PlaneLaws.lean`, Lean 4.33.0-rc1 + Mathlib, kernel only: no `sorry`, no `native_decide`; axioms `[propext, Classical.choice, Quot.sound]` (the E7 `decide +kernel` checks use only `propext`/`Quot.sound`). Builds in 17 s / 2.5 GB. +Setup: `Vec n = Fin n → ZMod 2`, standard dot, `one` = all-ones, token/port = odd (`Tok s : s ⬝ᵥ one = 1`), `Junk p s := Tok s ∧ s ⬝ᵥ p = 0`. + +## 1. SPLIT (GC8 section 1): TRUE as stated, any n +* `split_xor`: an odd s is orthogonal to exactly one of u' and u'+1. +* `split_lemma`, `split_partition`: tokens of u_t^perp = (u_t^perp ∩ u_t'^perp) ⊔ (u_t^perp ∩ t''^perp), disjoint, t'' = u_t+u_t'+1 (on u_t^perp, s ⊥ t'' iff s ⊥ u_t'+1). No odd-n and no port-set assumption. +* `tok_t''`: t'' is odd when `one ⬝ one = 1` (n odd). `t''_eq_one`: t'' = 1 iff u_t = u_t'. So for the full odd set minus 1 (E7), t'' is a port exactly when t ≠ t'. "t'' is a port" is NOT automatic for an arbitrary odd-port set (needs closure): only the partition is general. +* E7 (`e7_split`, kernel `decide` over all 63×62 ordered pairs, 7-bit masks): t'' port, |u_t^perp odd| = 32, |C(t,t')| = 16, hence |C(t,t'')| = 16. + +## 2. QUARTER (GC9 section 2, SPEC-PLANE rule 2): TRUE, exact partition for any n and any subspace B ∋ 1 +* `QHyp B H`: H ≤ B, 1 ∉ H, and every b ∈ B has b ∈ H or b+1 ∈ H (H is a hyperplane of B avoiding 1). +* `qhyp_Hs`: for odd s, H_s = B ∩ s^perp is such a hyperplane. `qtok_Hs`: s is a token of its own chart Q_H = {odd s ⊥ H}. +* `qhyp_unique`: a QHyp H with s ∈ Q_H equals H_s. `quarter_partition`: for p ∈ B and a junk token s of p there is exactly one hyperplane H of B through p avoiding 1 with s ∈ Q_H (existence and uniqueness): the quarters partition p's junk exactly, no overlap, no correction terms. +* `qtok_junk`, `readers_see_all`: every token of Q_H is a junk token of every p ∈ H, so the ports of H all read the shared chart. +* Counting (formulas, general n; NOT formalised for general n): dim B = d gives 2^(d-2) quarters through p, 2^(n-d) tokens each (so 2^(n-2) junk tokens), and 2^(d-2) readers (the odd elements of H, since p ∈ H is odd). E7 (n=7, d=4): 4 quarters × 8 tokens = 32, 4 readers. +* E7 instance, kernel-checked on a concrete block (`Bl`, last four coordinates equal; `e7_block`: |B|=16, 1 ∈ B, 7 ports; `e7_quarter`, all 7 ports p): 32 junk tokens, exactly 4 distinct H_s, each of 8 elements, containing p, avoiding 1, with 8 tokens (fibre of s ↦ H_s) and 4 ports; `e7_totals`: 9·7·4 = 252 deliverers, 9·7·8 = 504 events (the plane-spread totals are arithmetic given 9 disjoint blocks). +* The E7 section works on 7-bit masks (`par` = xor-fold parity); it is the same finite structure as `Vec 7`, but the bridge lemma between the two encodings is not proved. + +## Verdict +No paper statement in GC8/GC9/SPEC-PLANE sections 1-2 is false. Only the closure of the port set under t'' (E7 only) and the counting formulas (instance-checked) go beyond what is proved in general. diff --git a/research/p104-lean-premises/lean/Nov15/PsiLaw.lean b/research/p104-lean-premises/lean/Nov15/PsiLaw.lean new file mode 100644 index 0000000000..501f98751d --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/PsiLaw.lean @@ -0,0 +1,373 @@ +/- +REBUILD-CORE psi findings (RC8, RC9) formalised, See PsiLaw.md. +Kernel only: no sorry, no native_decide. +Build: lake env lean Nov15/PsiLaw.lean (imports the HubSettle olean) +-/ +import Nov15.HubSettle + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace PsiLaw +open Submodule Module Matrix RankLaw HubSettle + +/-! ## Part 1. One prefix transform and one V mix -/ + +section One +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] [DecidableEq C] + +/-- Two hub-prefix coordinate changes compose into ONE (the two hubs act as one transform). -/ +theorem mapRows_comp (L1 L2 : (Reg → K) →ₗ[K] (Reg → K)) (s : TokenCancel.St K Reg C) : + mapRows L1 (mapRows L2 s) = mapRows (L1 ∘ₗ L2) s := rfl + +end One + +section Exact +variable {K N G0 G1 : Type*} [Field K] [Fintype N] [Fintype G0] [Fintype G1] + [DecidableEq N] [DecidableEq G0] [DecidableEq G1] + +/-- **(1) psi = two conditions.** A word is hub-exact with prefix `M` iff (a) the non-V G0 rows hit +their targets and (b) the V-ending row spans agree (one invertible V mix). This is +`HubSettle.valid_iff`, restated with the conditions named as in RC8 sec. 1. -/ +theorem psi_two_conditions (Xn : Matrix G1 N K) (X0 : Matrix G1 G0 K) (Rn : Matrix G1 N K) + (R0 : Matrix G1 G0 K) {NV : Type*} [Fintype NV] [DecidableEq NV] (Rn0 Fn0 : Matrix NV G0 K) + (M : Matrix G0 G0 K) : + Valid Xn X0 Rn R0 Rn0 Fn0 M ↔ + Rn0 * M = Fn0 ∧ span K (Set.range (fromCols Xn (X0 * M)).row) + = span K (Set.range (fromCols Rn R0).row) := by + rw [valid_iff, P, Q, range_vecMulLinear, range_vecMulLinear] + +end Exact + +/-! ## Part 2. The span law -/ + +section Span +variable {K G ι : Type*} [Field K] [DecidableEq G] + +/-- Remove from register `r`'s end row the content `w` (the removed op's gift). -/ +def strip (X : Matrix G ι K) (r : G) (w : ι → K) : Matrix G ι K := X.updateRow r (X r - w) + +theorem strip_row_self (X : Matrix G ι K) (r : G) (w : ι → K) : (strip X r w).row r = X.row r - w := by + simp [strip, Matrix.row] + +theorem strip_row_ne (X : Matrix G ι K) (r : G) (w : ι → K) (g : G) (h : g ≠ r) : + (strip X r w).row g = X.row g := by + simp [strip, Matrix.row, h] + +/-- **SPAN LAW (pure linear algebra).** Removing `w` from one end row leaves the V-ending row span +unchanged (so a V settle can still exist, `vmixM_iff_span`) iff `w` lies in BOTH the old and the +new span. -/ +theorem span_strip_iff (X : Matrix G ι K) (r : G) (w : ι → K) : + span K (Set.range (strip X r w).row) = span K (Set.range X.row) ↔ + w ∈ span K (Set.range X.row) ∧ w ∈ span K (Set.range (strip X r w).row) := by + constructor + · intro h + have h1 : X.row r ∈ span K (Set.range X.row) := subset_span ⟨r, rfl⟩ + have h2 : (strip X r w).row r ∈ span K (Set.range X.row) := h ▸ subset_span ⟨r, rfl⟩ + have hw : w ∈ span K (Set.range X.row) := by + have := sub_mem h1 h2 + rwa [strip_row_self, sub_sub_cancel] at this + exact ⟨hw, h ▸ hw⟩ + · rintro ⟨hw, hw'⟩ + apply le_antisymm + · rw [span_le] + rintro _ ⟨g, rfl⟩ + by_cases hg : g = r + · subst hg; rw [strip_row_self] + exact sub_mem (subset_span ⟨g, rfl⟩) hw + · rw [strip_row_ne _ _ _ _ hg]; exact subset_span ⟨g, rfl⟩ + · rw [span_le] + rintro _ ⟨g, rfl⟩ + by_cases hg : g = r + · subst hg + have : X.row g = (strip X g w).row g + w := by rw [strip_row_self]; abel + rw [this]; exact add_mem (subset_span ⟨g, rfl⟩) hw' + · have := strip_row_ne X r w g hg + rw [← this]; exact subset_span ⟨g, rfl⟩ + +/-- Necessity half in the form RC8 states it: if the stripped row set still spans the old span, +then `w` is in the old span ("w must lie in the G1 span"). -/ +theorem span_law_necessary (X : Matrix G ι K) (r : G) (w : ι → K) + (h : span K (Set.range (strip X r w).row) = span K (Set.range X.row)) : + w ∈ span K (Set.range X.row) := ((span_strip_iff X r w).1 h).1 + +/-- **RC8 sec. 1 "only if" is NOT an "if".** `w` in the old span does not make the removal +repairable: with a single end row `(1)` and `w = (1)` the stripped row is `0`. The corrected +statement is `span_strip_iff` (w must also lie in the stripped span, i.e. the main's own row +must remain recoverable). -/ +theorem span_law_not_sufficient : + ∃ (X : Matrix (Fin 1) (Fin 1) ℚ) (w : Fin 1 → ℚ), + w ∈ span ℚ (Set.range X.row) ∧ + span ℚ (Set.range (strip X 0 w).row) ≠ span ℚ (Set.range X.row) := by + refine ⟨!![1], fun _ => 1, ?_, ?_⟩ + · exact subset_span ⟨0, by ext j; fin_cases j; simp [Matrix.row]⟩ + · intro h + have h1 := ((span_strip_iff (!![1] : Matrix (Fin 1) (Fin 1) ℚ) 0 (fun _ => 1)).1 h).2 + have hz : (strip (!![1] : Matrix (Fin 1) (Fin 1) ℚ) 0 (fun _ => 1)).row = fun _ => 0 := by + funext g; fin_cases g; ext j; fin_cases j; simp [strip, Matrix.row] + rw [hz] at h1 + have : span ℚ (Set.range (fun _ : Fin 1 => (0 : Fin 1 → ℚ))) = ⊥ := by + rw [eq_bot_iff, span_le]; rintro _ ⟨g, rfl⟩; simp + rw [this, mem_bot] at h1 + have := congrFun h1 0 + simp at this + +end Span + +section SpanPrefix +variable {K N G0 G1 : Type*} [Field K] [Fintype N] [Fintype G0] [Fintype G1] + [DecidableEq N] [DecidableEq G0] [DecidableEq G1] + +theorem fromCols_strip (Xn : Matrix G1 N K) (X0 : Matrix G1 G0 K) (M : Matrix G0 G0 K) (r : G1) + (wn : N → K) (w0 : G0 → K) : + fromCols (strip Xn r wn) (strip X0 r w0 * M) = + strip (fromCols Xn (X0 * M)) r (Sum.elim wn (w0 ᵥ* M)) := by + ext g c + by_cases hg : g = r + · subst hg + rcases c with n | c + · simp [strip] + · simp [strip, Matrix.mul_apply, Matrix.vecMul, dotProduct, sub_mul, Finset.sum_sub_distrib] + · rcases c with n | c + · simp [strip, hg] + · simp [strip, hg, Matrix.mul_apply] + +/-- **SPAN LAW with the prefix constraint.** Let `M` be a prefix at which the native is exact +(`P M = Q`, the V-ending rows span the targets). Remove content `w = (w_n | w_0)` from main `r`'s +end row; in the prefix model its G0 part is carried by the same `M`, giving `ŵ = (w_n | w_0 M)`. +The hub-only repair (same prefix, one V mix) exists iff `ŵ ∈ span(targets)` and `ŵ` is in the +stripped span. In particular `ŵ ∈ span(targets) = span(V-ending rows)` is NECESSARY. -/ +theorem span_law_prefix (Xn : Matrix G1 N K) (X0 : Matrix G1 G0 K) (Rn : Matrix G1 N K) + (R0 : Matrix G1 G0 K) (M : Matrix G0 G0 K) (r : G1) (wn : N → K) (w0 : G0 → K) + (hnat : span K (Set.range (fromCols Xn (X0 * M)).row) = span K (Set.range (fromCols Rn R0).row)) : + VMixM (fromCols (strip Xn r wn) (strip X0 r w0 * M)) (fromCols Rn R0) ↔ + Sum.elim wn (w0 ᵥ* M) ∈ span K (Set.range (fromCols Rn R0).row) ∧ + Sum.elim wn (w0 ᵥ* M) ∈ span K (Set.range + (fromCols (strip Xn r wn) (strip X0 r w0 * M)).row) := by + rw [vmixM_iff_span, fromCols_strip, ← hnat] + exact span_strip_iff _ _ _ |>.trans (by rw [hnat]) + +theorem span_law_prefix_necessary (Xn : Matrix G1 N K) (X0 : Matrix G1 G0 K) (Rn : Matrix G1 N K) + (R0 : Matrix G1 G0 K) (M : Matrix G0 G0 K) (r : G1) (wn : N → K) (w0 : G0 → K) + (hnat : span K (Set.range (fromCols Xn (X0 * M)).row) = span K (Set.range (fromCols Rn R0).row)) + (h : VMixM (fromCols (strip Xn r wn) (strip X0 r w0 * M)) (fromCols Rn R0)) : + Sum.elim wn (w0 ᵥ* M) ∈ span K (Set.range (fromCols Rn R0).row) := + ((span_law_prefix Xn X0 Rn R0 M r wn w0 hnat).1 h).1 + +end SpanPrefix + +/-! ### Corollary: an unshed carrier -/ + +section Carrier +variable {K G ι : Type*} [Field K] [Fintype G] [DecidableEq G] + +/-- A carrier `k` whose V-end row is its own target `R k` plus the content `x` it still holds +makes the V settle consistent only if `x` is in the target span. -/ +theorem unshed_forces_span (E R : Matrix G ι K) (h : VMixM E R) (k : G) (x : ι → K) + (hk : E k = R k + x) : x ∈ span K (Set.range R.row) := by + rw [vmixM_iff_span] at h + have h1 : E.row k ∈ span K (Set.range R.row) := h ▸ subset_span ⟨k, rfl⟩ + have h2 : R.row k ∈ span K (Set.range R.row) := subset_span ⟨k, rfl⟩ + have := sub_mem h1 h2 + have e : E.row k - R.row k = x := by + show E k - R k = x + rw [hk]; abel + rwa [e] at this + +/-- Non-vacuity, both halves, over `ℚ`: main target `(1,0,0)`, carrier target `(0,1,0)`, +content `x = (0,0,1)` outside the span. Unshed (carrier ends at `(0,1,1)`, main at `(1,1,0)`): +NO V settle. Shed (carrier ends at its target): a V settle exists. -/ +def Rt : Matrix (Fin 2) (Fin 3) ℚ := !![1, 0, 0; 0, 1, 0] +def Eun : Matrix (Fin 2) (Fin 3) ℚ := !![1, 1, 0; 0, 1, 1] +def Esh : Matrix (Fin 2) (Fin 3) ℚ := !![1, 1, 0; 0, 1, 0] + +theorem unshed_inconsistent : ¬ VMixM Eun Rt := by + intro h + have := unshed_forces_span Eun Rt h 1 (![0, 0, 1]) + (by ext j; fin_cases j <;> simp [Eun, Rt]) + have hle : span ℚ (Set.range Rt.row) ≤ LinearMap.ker (LinearMap.proj (R := ℚ) (φ := fun _ : Fin 3 => ℚ) 2) := by + rw [span_le]; rintro _ ⟨g, rfl⟩ + fin_cases g <;> simp [Rt, Matrix.row] + have := hle this + simp at this + +theorem shed_consistent : VMixM Esh Rt := by + refine ⟨!![1, -1; 0, 1], ?_, ?_⟩ + · simp [Matrix.det_fin_two] + · ext i j; fin_cases i <;> fin_cases j <;> simp [Esh, Rt, Matrix.mul_apply, Fin.sum_univ_two] + +end Carrier + +/-! ### Corollary: pick -> deliver -> shed needs three meetings -/ + +section Meetings +variable {K : Type*} [Field K] + +/-- A courier's contacts: `pick a` = meeting an x-holder, courier content += a; +`give b` = meeting the main, main receives `b * content`. -/ +inductive CEv (K : Type*) + | pick (a : K) + | give (b : K) + +/-- state = (courier's x-content, total x delivered to the main) -/ +def cstep : K × K → CEv K → K × K + | (c, d), .pick a => (c + a, d) + | (c, d), .give b => (c, d + b * c) + +def crun (st : K × K) (l : List (CEv K)) : K × K := l.foldl cstep st + +theorem content_nopick (l : List (CEv K)) (st : K × K) (h : ∀ e ∈ l, ∀ a, e ≠ .pick a) : + (crun st l).1 = st.1 := by + induction l generalizing st with + | nil => rfl + | cons e es ih => + simp only [crun, List.foldl_cons] at ih ⊢ + have h1 := ih (cstep st e) (fun e' he' => h e' (List.mem_cons_of_mem _ he')) + rw [h1] + cases e with + | pick a => exact absurd rfl (h _ List.mem_cons_self a) + | give b => rfl + +theorem exists_pick (l : List (CEv K)) (st : K × K) (h : (crun st l).1 ≠ st.1) : + ∃ l1 a l2, l = l1 ++ .pick a :: l2 := by + by_contra hc + apply h + apply content_nopick + intro e he a hea + subst hea + obtain ⟨l1, l2, hl⟩ := List.append_of_mem he + exact hc ⟨l1, a, l2, hl⟩ + +theorem exists_give (l : List (CEv K)) (st : K × K) (h : (crun st l).2 ≠ st.2) : + ∃ l1 b l2, l = l1 ++ .give b :: l2 ∧ b * (crun st l1).1 ≠ 0 := by + induction l generalizing st with + | nil => exact absurd rfl h + | cons e es ih => + simp only [crun, List.foldl_cons] at h ih ⊢ + by_cases h2 : (List.foldl cstep (cstep st e) es).2 = (cstep st e).2 + · cases e with + | pick a => exact absurd h2 (by simpa [cstep] using h) + | give b => + refine ⟨[], b, es, rfl, ?_⟩ + intro hb; apply h; rw [h2]; simpa [cstep] using hb + · obtain ⟨l1, b, l2, hl, hb⟩ := ih (cstep st e) h2 + exact ⟨e :: l1, b, l2, by rw [hl]; rfl, hb⟩ + +/-- **Three meetings.** A courier that starts and ends with x-content 0 and delivers a nonzero +total `x` to the main must (in this order) pick, give, and then shed. So a repairing carrier has +at least three meetings (pick -> deliver -> shed), matching TWO-STOP (Delivery.two_contacts_needed: +>= 2 contacts with different courier rows) with the pick/shed contacts counted separately. -/ +theorem three_meetings (l : List (CEv K)) (h0 : (crun (0, 0) l).1 = 0) (hd : (crun (0, 0) l).2 ≠ 0) : + ∃ l1 a l2 b l3 a' l4, l = l1 ++ .pick a :: (l2 ++ .give b :: (l3 ++ .pick a' :: l4)) ∧ + b ≠ 0 := by + obtain ⟨m1, b, m2, hl, hb⟩ := exists_give l (0, 0) hd + have hc : (crun (0, 0) m1).1 ≠ 0 := fun h => hb (by rw [h, mul_zero]) + obtain ⟨l1, a, l2, h1⟩ := exists_pick m1 (0, 0) hc + have hcs : ∀ (st : K × K) (b : K), (cstep st (CEv.give b)).1 = st.1 := by + intro st b; rcases st with ⟨c, d⟩; rfl + have hrun : crun (0, 0) (m1 ++ CEv.give b :: m2) = crun (cstep (crun (0, 0) m1) (CEv.give b)) m2 := by + simp [crun, List.foldl_append] + have hfin : (crun (cstep (crun (0, 0) m1) (CEv.give b)) m2).1 = 0 := by + rw [← hrun, ← hl]; exact h0 + have hne : (crun (cstep (crun (0, 0) m1) (CEv.give b)) m2).1 ≠ + (cstep (crun (0, 0) m1) (CEv.give b)).1 := by + rw [hfin, hcs]; exact fun h => hc h.symm + obtain ⟨l3, a', l4, h2⟩ := exists_pick m2 _ hne + refine ⟨l1, a, l2, b, l3, a', l4, ?_, ?_⟩ + · rw [hl, h1, h2]; simp + · intro hb0; apply hb; rw [hb0, zero_mul] + +end Meetings + +/-! ## Part 3. Exposed reads: no single prefix transform -/ + +section Exposure +open TokenCancel +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] [DecidableEq C] + +/-- A right multiplication preserves linear relations among rows. -/ +theorem relation_obstruction {m n : Type*} [Fintype m] [Fintype n] [DecidableEq n] + (Eold Enew : Matrix m n K) (y : m → K) (h0 : y ᵥ* Eold = 0) (h1 : y ᵥ* Enew ≠ 0) : + ¬ ∃ M : Matrix n n K, Eold * M = Enew := by + rintro ⟨M, rfl⟩ + apply h1 + rw [← Matrix.vecMul_vecMul, h0, Matrix.zero_vecMul] + +/-- **Swap law.** The op `p += q*o` commutes with a later `i += a*j` unless the later op READS +`p` (`j = p`) or WRITES `o` (`i = o`). Reading `o` is harmless. -/ +theorem add_swap (s : St K Reg C) (p o i j : Reg) (q a : K) (c c' : C) + (hj : j ≠ p) (hio : i ≠ o) : + step (step s (.add p o q c)) (.add i j a c') = step (step s (.add i j a c')) (.add p o q c) := by + simp only [step, St.mk.injEq, and_true] + funext r + by_cases hr : r = p <;> by_cases hr' : r = i + · subst hr; subst hr'; simp [Function.update_apply, hj, hio.symm]; abel + · subst hr; simp [Function.update_apply, hr', hj, hio.symm] + · subst hr'; simp [Function.update_apply, hr, hio, hio.symm, hj] + · simp [Function.update_apply, hr, hr'] + +/-- **Positive half.** If every event between the new and old time of the op `p += q*o` is an ADD +that neither reads `p` nor writes `o`, the op can be moved earlier with identical final state. -/ +theorem move_early (p o : Reg) (q : K) (c : C) (l : List (Ev K Reg C)) + (hl : ∀ e ∈ l, ∃ i j a c', e = .add i j a c' ∧ j ≠ p ∧ i ≠ o) (s : St K Reg C) : + run (step s (.add p o q c)) l = step (run s l) (.add p o q c) := by + induction l generalizing s with + | nil => rfl + | cons e es ih => + obtain ⟨i, j, a, c', rfl, hj, hio⟩ := hl e List.mem_cons_self + simp only [run] + rw [add_swap s p o i j q a c c' hj hio] + exact ih (fun e' he' => hl e' (List.mem_cons_of_mem _ he')) _ + +/-- The three-register witness: `r = 0`, `o = 1`, reader `u = 2`; the op `r += q*o` +at the old time (after the read) or relocated before the read. -/ +def evsOld (q a : K) : List (Ev K (Fin 3) Unit) := + [.born 0 (), .born 1 (), .init 2 (), .add 2 0 a (), .add 0 1 q ()] + +def evsNew (q a : K) : List (Ev K (Fin 3) Unit) := + [.born 0 (), .born 1 (), .init 2 (), .add 0 1 q (), .add 2 0 a ()] + +theorem rows_old (q a : K) : + (run (TokenCancel.start : St K (Fin 3) Unit) (evsOld q a)).row = + ![Pi.single 0 1 + q • Pi.single 1 1, Pi.single 1 1, a • Pi.single 0 1] := by + funext r; fin_cases r <;> simp [evsOld, run, step, TokenCancel.start] + +theorem rows_new (q a : K) : + (run (TokenCancel.start : St K (Fin 3) Unit) (evsNew q a)).row = + ![Pi.single 0 1 + q • Pi.single 1 1, Pi.single 1 1, + a • (Pi.single 0 1 + q • Pi.single 1 1)] := by + funext r; fin_cases r <;> simp [evsNew, run, step, TokenCancel.start] + +/-- **(3) The exposure obstruction.** Relocating `r += q*o` before a read of `r` by `u` changes +the end rows by `a q o_0` on `u` only. The end rows satisfy the relation `a r - a q o - u = 0` +before and not after, so NO matrix `M` (a fortiori no invertible prefix on the G0 columns) +carries the old end rows to the new ones. -/ +theorem exposed_read_no_prefix (q a : K) (hq : q ≠ 0) (ha : a ≠ 0) : + ¬ ∃ M : Matrix (Fin 3) (Fin 3) K, + (Matrix.of (run (TokenCancel.start : St K (Fin 3) Unit) (evsOld q a)).row) * M = + Matrix.of (run (TokenCancel.start : St K (Fin 3) Unit) (evsNew q a)).row := by + apply relation_obstruction _ _ ![a, -(a * q), -1] + · funext j + rw [rows_old] + fin_cases j <;> simp [Matrix.vecMul, dotProduct, Fin.sum_univ_three, Pi.single_apply] <;> ring + · intro h + have := congrFun h 1 + rw [rows_new] at this + simp [Matrix.vecMul, dotProduct, Fin.sum_univ_three, Pi.single_apply] at this + rcases this with h | h <;> simp_all + +end Exposure + +end PsiLaw + +#print axioms PsiLaw.psi_two_conditions +#print axioms PsiLaw.span_strip_iff +#print axioms PsiLaw.span_law_not_sufficient +#print axioms PsiLaw.span_law_prefix +#print axioms PsiLaw.unshed_forces_span +#print axioms PsiLaw.unshed_inconsistent +#print axioms PsiLaw.shed_consistent +#print axioms PsiLaw.three_meetings +#print axioms PsiLaw.add_swap +#print axioms PsiLaw.move_early +#print axioms PsiLaw.exposed_read_no_prefix diff --git a/research/p104-lean-premises/lean/Nov15/PsiLaw.md b/research/p104-lean-premises/lean/Nov15/PsiLaw.md new file mode 100644 index 0000000000..569cddb751 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/PsiLaw.md @@ -0,0 +1,18 @@ +# PsiLaw : rebuild RC8/RC9 psi findings in Lean +`Nov15/PsiLaw.lean`, imports HubSettle (olean). Kernel only, no sorry/native_decide; axioms within [propext, Classical.choice, Quot.sound]. 8 s, 2.0 GB. +Sources: internal notes lines 4-14, RC9.md lines 9-13 and 21-22. + +## 1. One transform, one mix (RC8 l.4-6) +`mapRows_comp`: two hub prefixes compose into ONE coordinate change. `psi_two_conditions` (= HubSettle.valid_iff): hub-exact with prefix M iff (a) Rn0*M = Fn0 and (b) rowspan[Xn | X0 M] = rowspan[Rn | R0] (one invertible V mix, `vmixM_iff_span`). Gauge/GL(A) criterion: HubSettle.prefix_valid / prefix_formula (unchanged). + +## 2. SPAN LAW (RC8 l.7-9, RC9 l.9-13) +- `span_strip_iff`: stripping w from one end row leaves the row span unchanged iff w in the OLD span AND in the NEW span. `span_law_necessary`: w in the span is necessary. +- `span_law_prefix` (prefix constraint): with a prefix M at which the native is exact, removing w=(w_n|w_0) from main r gives (w_n | w_0 M); a hub-only repair (same M, one V mix) exists iff that vector is in span(targets) = span(V-ending rows) and in the stripped span. `span_law_prefix_necessary`. +- **WORDING FIX (RC8 l.9 / the "iff" in the task)**: "repairable iff w in the G1 span" is only necessary. `span_law_not_sufficient`: one end row (1), w = (1): w in the span, stripped row is 0, no V settle. Corrected: iff w in old span and in stripped span (the main's own row must stay recoverable). RC8's own text says "only if", which is true. +- Carrier corollary (RC9 l.11-12): `unshed_forces_span`: a carrier whose V-end row is its target plus held content x forces x in span(targets). `unshed_inconsistent` / `shed_consistent` (Q, x outside span): unshed has no V settle, shed has one. `three_meetings`: a courier with content 0 at start and end delivering nonzero total contains, in order, pick, give (b != 0), pick/shed: >= 3 contacts. Consistent with TWO-STOP (Delivery.two_contacts_needed counts contacts with the main; here pick/shed are the x-holder meetings). Scope: abstract pick/give/shed model, content a scalar along x; legality (charts, co-presence) not modelled. + +## 3. Exposed reads (RC8 l.10-11) +- `relation_obstruction`: right multiplication preserves row relations. `exposed_read_no_prefix` (TokenCancel model, 3 registers r,o,u, any field, q,a != 0): relocating `r += q*o` before a read `u += a*r` makes the end rows violate the relation a r - a q o - u = 0; no matrix M (invertible or not) maps old end rows to new. +- `add_swap` / `move_early`: the op commutes with later ADDs unless they READ r (j = r) or WRITE o (i = o); if all intervening events are such ADDs the relocated word has identical final state. +- **WORDING FIX (RC8 l.10)**: "pure G0-column operation ONLY if neither register is read between": reads of o (the source) are harmless (`add_swap` allows j = o); the obstruction is reads of r and writes to o. If the rc8e census counted reads of o as exposure it overcounts (not checkable here). +- Not formalised: the census (55/57, 1-31 reads), that the relocated op is a G0-only column op at {0}; the obstruction is shown at the end-row level for one reader, general lists would be induction of the same relation. diff --git a/research/p104-lean-premises/lean/Nov15/RankLaw.lean b/research/p104-lean-premises/lean/Nov15/RankLaw.lean new file mode 100644 index 0000000000..c39250228b --- /dev/null +++ b/research/p104-lean-premises/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 (REBUILD-CORE, RESULT §7).** 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-lean-premises/lean/Nov15/RankLaw.md b/research/p104-lean-premises/lean/Nov15/RankLaw.md new file mode 100644 index 0000000000..fbd610a6ce --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/RankLawC.lean b/research/p104-lean-premises/lean/Nov15/RankLawC.lean new file mode 100644 index 0000000000..5c72771505 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/RankLawC.md b/research/p104-lean-premises/lean/Nov15/RankLawC.md new file mode 100644 index 0000000000..8559526b12 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/RelaySandwich.lean b/research/p104-lean-premises/lean/Nov15/RelaySandwich.lean new file mode 100644 index 0000000000..e3ad3667c8 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/Shadow.lean b/research/p104-lean-premises/lean/Nov15/Shadow.lean new file mode 100644 index 0000000000..2d3e838e45 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Shadow.lean @@ -0,0 +1,222 @@ +/- +Shadow . See Shadow.md. internal notes (SHADOW lemma), AUDIT7.md, R8.md. + +For every word, the TWIN replaces each main r (birth b, end c, route steps) by + * a single-jump main ⟨b, c, [(b, c)]⟩, and + * a fresh helper g = ⟨b, c, steps⟩ (born at b, ends at c) that runs the main's old route, +the two swapped at b and swapped back at c by gates (ADD/SCALE: not invoiced). +Part A (row level): the 4-gate swap and swap-back are exact swaps; so the final rows are unchanged + (main = old final row, g = its own unit row). +Part B (invoice, on FibreK's nativeInv): hypothesis P0-symmetry (a climb d on T and a MOVE of gap d on P carry the same + histogram: the D0 table, and the pricekit rank of both is d). Then the twin has the same NET count + cnt T r - cnt P r at every rank r (so same S, F(t), D0, kappa), but the RAW T and P histograms each gain the + common summand `mains.flatMap (tT (e-b))` (AUDIT7: that is why the interval gate, which counts invoiced T events, + fails on the full twin). +Part C: the twin's mains make a single jump (0 interior stops); no law that depends only on net invoice + F + finals + can force a main stop on a word of M, provided M is closed under the twin (replay/ascent legality: [C], not formalised). +Kernel only. +-/ +import Nov15.FibreK + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace Shadow +open FibreK CallerCost + +/-! ### Part A: the gates -/ +section Gates +variable {R M : Type*} [Ring R] [AddCommGroup M] [Module R M] + +/-- birth swap on (main row r, helper row g): ADD g += r ; ADD r -= g ; ADD g += r ; SCALE r by -1. -/ +def swapIn (p : M × M) : M × M := + let g1 := p.2 + p.1 + let r1 := p.1 - g1 + let g2 := g1 + r1 + (-r1, g2) + +/-- end swap-back: ADD r += g ; ADD g -= r ; ADD r += g ; SCALE g by -1. -/ +def swapOut (p : M × M) : M × M := + let r1 := p.1 + p.2 + let g1 := p.2 - r1 + let r2 := r1 + g1 + (r2, -g1) + +theorem swapIn_eq (r g : M) : swapIn (r, g) = (g, r) := by + simp only [swapIn, Prod.mk.injEq]; constructor <;> abel + +theorem swapOut_eq (r g : M) : swapOut (r, g) = (g, r) := by + simp only [swapOut, Prod.mk.injEq]; constructor <;> abel + +/-- the final rows: at birth r holds e_r, g holds e_g. After swapIn: r holds e_g, g holds e_r. g then runs the main's +old program and ends with ρ (the main's old final row); r (single jump, never gated) still holds e_g. +After swapOut: r holds ρ (the old final row), g holds e_g (its own unit row). -/ +theorem final_rows (er eg ρ : M) : + (swapIn (er, eg)).1 = eg ∧ (swapIn (er, eg)).2 = er ∧ swapOut ((swapIn (er, eg)).1, ρ) = (ρ, eg) := by + refine ⟨?_, ?_, ?_⟩ <;> simp [swapIn_eq, swapOut_eq] + +end Gates + +/-! ### Part B: invoice -/ + +/-- contribution of one register to F. -/ +noncomputable def hc (tb : Table) (h : Helper) (t : ℝ) : ℝ := + Fh (tb.tT (h.e - h.b)) t - (h.steps.map fun s => Fh (tb.tP (gap s)) t).sum + +theorem sum_map_sub' {α : Type*} (l : List α) (a b : α → ℝ) : + (l.map fun h => a h - b h).sum = (l.map a).sum - (l.map b).sum := by + induction l with + | nil => simp + | cons x l ih => simp [ih]; ring + +/-- F of the native, register by register. -/ +theorem Fi_native (E : Inv) (tb : Table) (H : List Helper) (t : ℝ) : + Fi (nativeInv E tb H) t = Fi E t + (H.map fun h => hc tb h t).sum := by + have e := K_word E tb H t + rw [e] + simp only [FK, Ssum, PiW, Multiset.map_coe, Multiset.sum_coe, hc, sum_map_sub', sum_flatMap_map, List.map_map, Function.comp_def] + ring + +/-- A word: ends `E` (invariant), mains, helpers, and final data `fin` (final rows). -/ +structure Word (Φ : Type*) where + E : Inv + mains : List Helper + helpers : List Helper + fin : Φ + +def Word.regs {Φ : Type*} (w : Word Φ) : List Helper := w.mains ++ w.helpers +def Word.inv {Φ : Type*} (tb : Table) (w : Word Φ) : Inv := nativeInv w.E tb w.regs + +/-- interior stops of mains = (route length - 1). -/ +def Word.mainStops {Φ : Type*} (w : Word Φ) : ℕ := (w.mains.map fun m => m.steps.length - 1).sum + +def shadowOf (m : Helper) : Helper := ⟨m.b, m.e, [(m.b, m.e)]⟩ + +/-- the TWIN. -/ +def Word.shadow {Φ : Type*} (w : Word Φ) : Word Φ := + ⟨w.E, w.mains.map shadowOf, w.helpers ++ w.mains, w.fin⟩ + +/-- P0 symmetry on the mains: births before ends and a climb d on T has the same histogram as a MOVE of gap d on P. -/ +def Sym {Φ : Type*} (tb : Table) (w : Word Φ) : Prop := + ∀ m ∈ w.mains, m.b ≤ m.e ∧ tb.tT (m.e - m.b) = tb.tP (m.e - m.b) + +theorem gap_shadow (m : Helper) (hb : m.b ≤ m.e) : gap (m.b, m.e) = m.e - m.b := by + simp only [gap]; omega + +theorem shadow_stops {Φ : Type*} (w : Word Φ) : w.shadow.mainStops = 0 := by + simp [Word.mainStops, Word.shadow, shadowOf, List.map_map, Function.comp_def] + +theorem sum_congr_mem {α : Type*} (l : List α) (f g : α → ℝ) (h : ∀ x ∈ l, f x = g x) : + (l.map f).sum = (l.map g).sum := by + induction l with + | nil => simp + | cons x l ih => + simp only [List.map_cons, List.sum_cons] + rw [h x (by simp), ih (fun y hy => h y (by simp [hy]))] + +/-- **SHADOW (F).** the twin has exactly the same F(t). -/ +theorem shadow_F {Φ : Type*} (tb : Table) (w : Word Φ) (hs : Sym tb w) (t : ℝ) : + Fi (w.shadow.inv tb) t = Fi (w.inv tb) t := by + unfold Word.inv Word.regs Word.shadow + simp only + rw [Fi_native, Fi_native] + simp only [List.map_append, List.sum_append, List.map_map] + have h2 : (w.mains.map fun m => Fh (tb.tT (m.e - m.b)) t - Fh (tb.tP (m.e - m.b)) t).sum = 0 := by + have : ∀ m ∈ w.mains, (Fh (tb.tT (m.e - m.b)) t - Fh (tb.tP (m.e - m.b)) t) = (fun _ => (0:ℝ)) m := by + intro m hm; simp only [(hs m hm).2, sub_self] + rw [sum_congr_mem _ _ _ this]; simp + have h3 : (w.mains.map ((fun h => hc tb h t) ∘ shadowOf)).sum = 0 := by + have : ∀ m ∈ w.mains, ((fun h => hc tb h t) ∘ shadowOf) m = (fun m => Fh (tb.tT (m.e - m.b)) t - Fh (tb.tP (m.e - m.b)) t) m := by + intro m hm + obtain ⟨hb, _⟩ := hs m hm + simp [Function.comp, hc, shadowOf, gap_shadow m hb] + rw [sum_congr_mem _ _ _ this]; exact h2 + rw [h3]; ring + +/-- the twin's invoice in the caller form. -/ +theorem shadow_invoice_F {Φ : Type*} (tb : Table) (w : Word Φ) (hs : Sym tb w) (c : Inv) (L : ℕ) (t : ℝ) : + Fi (invoice c (w.shadow.inv tb) L) t = Fi (invoice c (w.inv tb) L) t := by + rw [Fi_invoice, Fi_invoice, shadow_F tb w hs] + +/-- kappa (a root of the invoice F) is the same. -/ +theorem shadow_root {Φ : Type*} (tb : Table) (w : Word Φ) (hs : Sym tb w) (c : Inv) (L : ℕ) (κ : ℝ) : + IsRoot (Fi (invoice c (w.shadow.inv tb) L)) κ ↔ IsRoot (Fi (invoice c (w.inv tb) L)) κ := by + unfold IsRoot + rw [shadow_invoice_F tb w hs] + +/-- D0 for the D0 table: equal as well (the table is symmetric). -/ +theorem shadow_D0 {Φ : Type*} (w : Word Φ) (hb : ∀ m ∈ w.mains, m.b ≤ m.e) : + Dinv (w.shadow.inv d0Table) = Dinv (w.inv d0Table) := by + unfold Word.inv Word.regs Word.shadow + simp only + rw [d0_native, d0_native] + simp only [List.map_append, List.sum_append, List.map_map] + have h0 : (w.mains.map ((fun h : Helper => (fL (h.e - h.b) - (h.steps.map fun s => fL (gap s)).sum)) ∘ shadowOf)).sum = 0 := by + have : ∀ m ∈ w.mains, ((fun h : Helper => (fL (h.e - h.b) - (h.steps.map fun s => fL (gap s)).sum)) ∘ shadowOf) m + = (fun _ => (0:ℝ)) m := by + intro m hm + simp [Function.comp, shadowOf, gap_shadow m (hb m hm)] + rw [sum_congr_mem _ _ _ this]; simp + rw [h0]; ring + +/-- count of rank r in a histogram is additive. -/ +theorem cnt_append (l m : Hist) (r : ℕ) : cnt (l ++ m) r = cnt l r + cnt m r := by + simp [cnt, List.map_append, List.sum_append] + +/-- net count at rank r. -/ +def net (i : Inv) (r : ℕ) : ℤ := (cnt i.T r : ℤ) - cnt i.P r + +/-- **SHADOW (net histogram).** the signed histogram cnt T r - cnt P r of the twin equals the original's at every rank: +the raw T and P histograms each gain the common summand `A` (below), which cancels. -/ +theorem shadow_net {Φ : Type*} (tb : Table) (w : Word Φ) (hs : Sym tb w) (r : ℕ) : + net (w.shadow.inv tb) r = net (w.inv tb) r := by + unfold net Word.inv Word.regs Word.shadow nativeInv + simp only [List.flatMap_append, List.flatMap_map, cnt_append] + have hT : ∀ m ∈ w.mains, tb.tT (m.e - m.b) = tb.tP (m.e - m.b) := fun m hm => (hs m hm).2 + have hA : (w.mains.flatMap fun m => (shadowOf m).steps.flatMap fun s => tb.tP (gap s)) = + w.mains.flatMap fun m => tb.tT (m.e - m.b) := by + apply List.flatMap_congr + intro m hm + simp [shadowOf, gap_shadow m (hs m hm).1, hT m hm] + have hB : (w.mains.flatMap fun m => tb.tT ((shadowOf m).e - (shadowOf m).b)) = + w.mains.flatMap fun m => tb.tT (m.e - m.b) := by + apply List.flatMap_congr; intro m hm; simp [shadowOf] + rw [hA, hB] + push_cast + ring + +/-- the RAW T histogram of the twin = the original's T plus `A` (the gate caveat: the twin pays more invoiced T events). -/ +theorem shadow_T_raw {Φ : Type*} (tb : Table) (w : Word Φ) : + (w.shadow.inv tb).T = (w.inv tb).T ++ w.mains.flatMap (fun m => tb.tT (m.e - m.b)) := by + unfold Word.inv Word.regs Word.shadow nativeInv + simp only [List.flatMap_append, List.flatMap_map, List.append_assoc] + have hB : (w.mains.flatMap fun m => tb.tT ((shadowOf m).e - (shadowOf m).b)) = + w.mains.flatMap fun m => tb.tT (m.e - m.b) := by + apply List.flatMap_congr; intro m hm; simp [shadowOf] + rw [hB] + +/-! ### Part C: no law forces a main stop -/ + +/-- **COROLLARY.** `law` sees only the net signed histogram, the function F, and the final data. `M` is the model +(any predicate closed under the twin: the replay / ascent / ledger legality of the twin is [C] r7shadow.py, not +formalised here). If every word of M satisfying `law` has ≥ 1 main stop, then no word of M with symmetric mains satisfies `law`. -/ +theorem no_law_forces_main_stop {Φ : Type*} (tb : Table) (M : Word Φ → Prop) (hM : ∀ w, M w → M w.shadow) + (law : (ℕ → ℤ) → (ℝ → ℝ) → Φ → Prop) + (hforce : ∀ w, M w → law (net (w.inv tb)) (Fi (w.inv tb)) w.fin → 1 ≤ w.mainStops) + (w : Word Φ) (hw : M w) (hs : Sym tb w) : ¬ law (net (w.inv tb)) (Fi (w.inv tb)) w.fin := by + intro hl + have hnet : net (w.shadow.inv tb) = net (w.inv tb) := funext (shadow_net tb w hs) + have hF : Fi (w.shadow.inv tb) = Fi (w.inv tb) := funext (shadow_F tb w hs) + have hl' : law (net (w.shadow.inv tb)) (Fi (w.shadow.inv tb)) w.shadow.fin := by rw [hnet, hF]; exact hl + have := hforce w.shadow (hM w hw) hl' + rw [shadow_stops] at this + omega + +#print axioms shadow_F +#print axioms shadow_net +#print axioms shadow_D0 +#print axioms shadow_T_raw +#print axioms no_law_forces_main_stop +#print axioms final_rows + +end Shadow diff --git a/research/p104-lean-premises/lean/Nov15/Shadow.md b/research/p104-lean-premises/lean/Nov15/Shadow.md new file mode 100644 index 0000000000..5eef041cdb --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Shadow.md @@ -0,0 +1,38 @@ +# Shadow : the SHADOW lemma of whole-floor R7 in Lean + +`Nov15/Shadow.lean`, Lean 4.33.0-rc1 + Mathlib, kernel only: no `sorry`, no `native_decide`; every theorem prints +`[propext, Classical.choice, Quot.sound]` (or fewer). Builds in 7 s / 2.9 GB (the memory-guarded build script guard). Imports FibreK (Theorem K, +`nativeInv`, `Table`, `Helper`, `K_word`), CallerCost. + +## What is formalised +* Part A, gates (`swapIn_eq`, `swapOut_eq`, `final_rows`): the 4-gate birth swap (g += r, r -= g, g += r, SCALE r -1) and the end swap-back + (r += g, g -= r, r += g, SCALE g -1) are exact swaps of the pair of rows, in any module. So: r holds e_g after the birth swap, g runs the + main's old program and ends at rho, and the swap-back gives r = rho (old final row), g = e_g (its own unit row). ADD/SCALE are not in the table. +* Part B, invoice. A `Word` = ends `E`, mains, helpers, final data `fin`; registers are FibreK `Helper`s (birth, end, steps). + `shadow` replaces each main m by the single-jump main `` plus the twin helper g = m itself (born b, ends e, same steps). + `Fi_native`: F of a native = F(E) + sum over registers of (T-term of the climb - P-terms of its steps) (register-by-register form of Theorem K). + Hypothesis `Sym` (P0 symmetry on the mains): b <= e and `tT (e-b) = tP (e-b)` (a climb d on T and a MOVE of gap d on P carry the same histogram; + true for `d0Table`, and the price checker charges rank d to both). + - `shadow_F`: F(t) of the twin = F(t) of the word, all t. `shadow_invoice_F`, `shadow_root`: the same for the caller invoice and for kappa (every root). + - `shadow_D0`: Dinv equal for the D0 table (needs only b <= e). + - `shadow_net`: the signed histogram cnt T r - cnt P r is equal at EVERY rank r (hence S, F, D0, kappa). + - `shadow_T_raw`: the RAW T histogram of the twin is the original's T ++ `mains.flatMap (tT (e-b))`. +* Part C, `shadow_stops` (twin mains have 0 interior stops) and `no_law_forces_main_stop`: let M be any family of words closed under the twin. + A law that sees only the net histogram, F, and the final data cannot force a main stop on a word of M with symmetric mains: if every word of M + satisfying the law had >= 1 main stop, no word of M with `Sym` satisfies the law. + +## Wording corrections (paper statement vs Lean) +1. R7 sec. 2 says the twin has "the same invoice T, P". Literally false: the raw T and P histograms each GAIN the common summand + `mains.flatMap (tT (e-b))` (resp. the same list in tP; `shadow_T_raw`). What is equal is the NET: cnt T r - cnt P r at every rank, + hence S, F(t), D0, kappa (`shadow_net`, `shadow_F`, `shadow_D0`). R7's own phrase "T[8], P[8] cancel in T - P" is the right statement. + Consequently the corollary holds for laws that factor through net invoice / F / finals, NOT for laws that read the raw T or P counts. That is + exactly the AUDIT7 caveat: the interval gate counts invoiced T events (sum T 22,461 -> 29,261, delta .99995 > 31/32). +2. The cancellation needs the P0 symmetry hypothesis `Sym` (T and P rank for a climb / jump of the same d). It is an explicit hypothesis here (FibreK's + `Table` is abstract); in `d0Table` it is by definition. +3. AUDIT7 caveat (stated, not formalised): the twin is in model M as defined by price/replay/ascent, but the FULL twin FAILS the interval gate + (`validate.py full` -> interval_gate; delta .99995 vs 31/32). R8.md: that gate is a fixed-constant instance of a free-parameter theorem, not SPEC + (pinned sha 60a743d1); pinned gate admits at most 248 of the 400 mains on S22 (AUDIT7's rough scaling said ~90; the exact binary search in R8 gives + 248). So "forced main stops = 0" is a statement over M (price/replay/ascent), not over the gated verifier model. +4. Not formalised (hypothesis `hM : M w -> M w.shadow`): replay legality of the twin (public ascent, nesting, ledger and slot counts, other registers + reading r now read g). That part is [C] (r7shadow.py, AUDIT7 re-run, validate.py PASS pricekit/replay/official/primes) and is exactly what `hM` abstracts. + AUDIT7 claims 2-3 (one stop per register; f(d)-f(d-k) for k stops) are pricing arithmetic, not touched here. diff --git a/research/p104-lean-premises/lean/Nov15/SharedCourier.lean b/research/p104-lean-premises/lean/Nov15/SharedCourier.lean new file mode 100644 index 0000000000..c4be928df0 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SharedCourier.lean @@ -0,0 +1,493 @@ +/- +SharedCourier . See SharedCourier.md. Generator lemma behind GEN-B GB1's first win +(internal notes, section 3): a SHARED-SNAPSHOT courier picks up a row once and gives scaled copies to k +consumers along an ascending (time, frame) chain. + + (1) EXACTNESS (TokenCancel semantics): consumers' rows = base + (total coefficient) * snapshot + courier token + (shared: one token e_y; separate: one token e_{y_j} per give). Modulo tokens both plans agree; + TC (xclose_exact) removes a token exactly with one ADD of a token holder. + (2) COST (Theorem K, D0 table): D0 of a courier = f(e-b) - sum f(hop gap). Shared (gaps a0, a_1..a_{k+1}) vs k + separate couriers (gaps a0, P_j, R-P_j): exact difference, shared <= separate for k >= 1 (equal at + k = 1), strict for k >= 2 when a0, R >= 1. + (3) LEGALITY `legal_tail_iff`: the shared plan is Legal iff every consumer is present at its stop chart, stops are + not z, and no stop except the last is V (MOVE never leaves V). Ascent is NOT part of Legal. +Kernel only: no sorry, no native_decide. +-/ +import Nov15.TokenCancel +import Nov15.FibreK +import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog +import Mathlib.Analysis.Convex.SpecificFunctions.Basic + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace SharedCourier +open TokenCancel + +/-! ## (1) Exactness -/ +section Exact +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] [DecidableEq C] + +/-- a give: (consumer, coefficient, stop chart). -/ +abbrev Give (K Reg C : Type*) := Reg × K × C + +/-- total coefficient delivered to `r`. -/ +def cf : List (Give K Reg C) → Reg → K + | [], _ => 0 + | g :: G, r => (if g.1 = r then g.2.1 else 0) + cf G r + +/-- the chain of stops: MOVE the courier to the stop, then ADD `a` copies of its row into the consumer. -/ +def tailEvs (y : Reg) : List (Give K Reg C) → List (Ev K Reg C) + | [] => [] + | g :: G => .move y g.2.2 :: .add g.1 y g.2.1 g.2.2 :: tailEvs y G + +/-- SHARED courier: born at the snapshot chart, picks `p` once (coefficient 1), then walks the chain. -/ +def sharedEvs (y p : Reg) (cp : C) (G : List (Give K Reg C)) : List (Ev K Reg C) := + .born y cp :: .add y p 1 cp :: tailEvs y G + +/-- ONE courier for ONE give: pick, one stop, deliver, clear. -/ +def seg (y p : Reg) (cp : C) (g : Give K Reg C) : List (Ev K Reg C) := + [.born y cp, .add y p 1 cp, .move y g.2.2, .add g.1 y g.2.1 g.2.2, .clear y g.2.2] + +def sepEvs (p : Reg) (cp : C) : List (Reg × Give K Reg C) → List (Ev K Reg C) + | [] => [] + | q :: L => seg q.1 p cp q.2 ++ sepEvs p cp L + +lemma run_append (s : St K Reg C) (l m : List (Ev K Reg C)) : run s (l ++ m) = run (run s l) m := by + induction l generalizing s with + | nil => rfl + | cons e l ih => exact ih _ + +lemma tail_row (y : Reg) (G : List (Give K Reg C)) (hy : ∀ g ∈ G, g.1 ≠ y) : + ∀ (s : St K Reg C) (r : Reg), (run s (tailEvs y G)).row r = + if r = y then s.row y else s.row r + cf G r • s.row y := by + induction G with + | nil => intro s r; by_cases h : r = y <;> simp [tailEvs, run, cf, h] + | cons g G ih => + intro s r + have hg : g.1 ≠ y := hy g (by simp) + have hG : ∀ g' ∈ G, g'.1 ≠ y := fun g' h => hy g' (by simp [h]) + simp only [tailEvs, run, step] + rw [ih hG] + by_cases hr : r = y + · subst hr + simp [hg.symm, Function.update_of_ne hg.symm] + · simp only [hr, if_false, cf, Function.update_apply, hg.symm, ite_false] + by_cases h1 : g.1 = r + · subst h1; simp [Function.update_self, hg]; module + · simp [h1, Ne.symm h1] + +/-- SHARED plan: every non-courier register `r` ends with `row r + cf G r • (row p + e_y)`. -/ +theorem shared_row (s : St K Reg C) (y p : Reg) (cp : C) (G : List (Give K Reg C)) + (hyp : y ≠ p) (hy : ∀ g ∈ G, g.1 ≠ y) (r : Reg) (hr : r ≠ y) : + (run s (sharedEvs y p cp G)).row r = s.row r + cf G r • (s.row p + Pi.single y (1 : K)) := by + simp only [sharedEvs, run, step] + rw [tail_row y G hy] + have hrow : (Function.update (Function.update s.row y (Pi.single y 1)) y + (Function.update s.row y (Pi.single y 1) y + (1 : K) • Function.update s.row y (Pi.single y 1) p)) y + = Pi.single y 1 + s.row p := by simp [Function.update_of_ne hyp.symm] + simp [hr, hrow, Function.update_of_ne hyp.symm] + abel + +/-- one separate courier. -/ +theorem seg_row (s : St K Reg C) (y p : Reg) (cp : C) (g : Give K Reg C) + (hyp : y ≠ p) (hgy : g.1 ≠ y) (hgp : g.1 ≠ p) (r : Reg) : + (run s (seg y p cp g)).row r = + if r = y then 0 else if r = g.1 then s.row r + g.2.1 • (Pi.single y (1 : K) + s.row p) else s.row r := by + simp only [seg, run, step] + by_cases hr : r = y + · subst hr; simp + · by_cases h1 : r = g.1 + · subst h1 + simp [hr, hyp.symm, hgy, hgp] + try (rw [add_comm (Pi.single y (1 : K))]) + · simp [hr, h1, Function.update_of_ne hr, Function.update_of_ne h1] + +/-- token part delivered by the separate couriers (one token per give). -/ +def tokSep : List (Reg × Give K Reg C) → Reg → (Reg → K) + | [], _ => 0 + | q :: L, r => (if q.2.1 = r then q.2.2.1 • Pi.single q.1 (1 : K) else 0) + tokSep L r + +/-- SEPARATE plan (one courier per give, distinct couriers, none a consumer / `p`): +non-courier register `r` ends with `row r + cf G r • row p + (one token per give)`. -/ +theorem sep_row (p : Reg) (cp : C) (L : List (Reg × Give K Reg C)) + (hcp : ∀ q ∈ L, q.1 ≠ p) (hcons : ∀ q ∈ L, q.2.1 ≠ p) + (hcc : ∀ q ∈ L, ∀ q' ∈ L, q'.2.1 ≠ q.1) : + ∀ (s : St K Reg C) (r : Reg), (∀ q ∈ L, r ≠ q.1) → + (run s (sepEvs p cp L)).row r = s.row r + cf (L.map Prod.snd) r • s.row p + tokSep L r := by + induction L with + | nil => intro s r _; simp [sepEvs, run, cf, tokSep] + | cons q L ih => + intro s r hr + have hq : q.2.1 ≠ q.1 := hcc q (by simp) q (by simp) + have hrq : r ≠ q.1 := hr q (by simp) + have hL := ih (fun q' h => hcp q' (by simp [h])) (fun q' h => hcons q' (by simp [h])) + (fun q' h q'' h' => hcc q' (by simp [h]) q'' (by simp [h'])) + simp only [sepEvs, run_append, List.map_cons, cf, tokSep] + rw [hL _ r (fun q' h => hr q' (by simp [h]))] + have hp' : (run s (seg q.1 p cp q.2)).row p = s.row p := by + rw [seg_row s q.1 p cp q.2 (hcp q (by simp)) hq (hcons q (by simp))] + simp [Ne.symm (hcp q (by simp)), Ne.symm (hcons q (by simp))] + rw [hp', seg_row s q.1 p cp q.2 (hcp q (by simp)) hq (hcons q (by simp))] + by_cases h1 : r = q.2.1 + · subst h1; simp [hrq, Ne.symm hq]; module + · simp [hrq, h1, Ne.symm h1] + +/-- **(1) EXACTNESS.** Same plan (`G = L.map snd`). Remove the courier tokens (shared: `cf G r • e_y`; separate: `tokSep`): +every non-courier register ends with the same row `row r + cf G r • row p`, in both builds. -/ +theorem exact_mod_tokens (s : St K Reg C) (y p : Reg) (cp : C) (L : List (Reg × Give K Reg C)) + (hyp : y ≠ p) (hy : ∀ q ∈ L, q.2.1 ≠ y) + (hcp : ∀ q ∈ L, q.1 ≠ p) (hcons : ∀ q ∈ L, q.2.1 ≠ p) + (hcc : ∀ q ∈ L, ∀ q' ∈ L, q'.2.1 ≠ q.1) + (r : Reg) (hr : r ≠ y) (hrs : ∀ q ∈ L, r ≠ q.1) : + (run s (sharedEvs y p cp (L.map Prod.snd))).row r - cf (L.map Prod.snd) r • Pi.single y (1 : K) + = (run s (sepEvs p cp L)).row r - tokSep L r := by + rw [shared_row s y p cp _ hyp (fun g hg => by obtain ⟨q, hq, rfl⟩ := List.mem_map.mp hg; exact hy q hq) r hr, sep_row p cp L hcp hcons hcc s r hrs] + module + +/-- **TC (courier token cleanup).** A consumer holding `τ + k • e_y` (τ free of the courier token) and a token holder +`x` with row `e_y` at the same chart: one ADD of `-k` yields exactly τ, and `-k` is the only coefficient that does. +(Instance of TokenCancel's XCLOSE exactness, `DesignLaws.xclose_exact`, re-derived by hand here.) -/ +theorem tc_cleanup (z V : C) (s : St K Reg C) (r x y : Reg) (c : C) (hrx : r ≠ x) + (hr : s.loc r = some c) (hx : s.loc x = some c) (hxrow : s.row x = Pi.single y (1 : K)) + (τ : Reg → K) (hτ : τ y = 0) (k : K) (hrow : s.row r = τ + k • Pi.single y (1 : K)) : + LegalEv z V s (.add r x (-k) c) ∧ (step s (.add r x (-k) c)).row r = τ ∧ + ∀ a, (step s (.add r x a c)).row r = τ → a = -k := by + refine ⟨⟨hrx, hr, hx⟩, by simp [step, hrow, hxrow], fun a ha => ?_⟩ + have h := congrFun ha y + simp [step, hxrow, hrow, hτ] at h + linear_combination h + +end Exact + +/-! ## (3) Legality -/ +section Legality +variable {K Reg C : Type*} [Field K] [DecidableEq Reg] [DecidableEq C] + +/-- stop conditions, relative to a location map `ℓ` of the consumers: stop not `z`, consumer present at the stop, +the courier's previous chart is not `V` (a MOVE never leaves `V`). -/ +def okTail (ℓ : Reg → Option C) (z V : C) : C → List (Give K Reg C) → Prop + | _, [] => True + | c0, g :: G => c0 ≠ V ∧ g.2.2 ≠ z ∧ ℓ g.1 = some g.2.2 ∧ okTail ℓ z V g.2.2 G + +lemma okTail_upd (z V : C) (ℓ : Reg → Option C) (y : Reg) (v : Option C) (G : List (Give K Reg C)) + (hy : ∀ g ∈ G, g.1 ≠ y) (c0 : C) : + okTail (Function.update ℓ y v) z V c0 G ↔ okTail ℓ z V c0 G := by + induction G generalizing c0 with + | nil => simp [okTail] + | cons g G ih => + have hg : g.1 ≠ y := hy g (by simp) + simp only [okTail, Function.update_of_ne hg] + rw [ih (fun g' h => hy g' (by simp [h]))] + +/-- **(3) LEGALITY of the chain.** The courier sits at `c0`. The chain of stops is Legal (TokenCancel's co-presence, +no MOVE into `z`, no MOVE out of `V`) iff `okTail`: every consumer is at its stop chart, no stop is `z`, and every stop +but the last is not `V`. Nothing about ORDER of the charts: ascent is an extra constraint of the frame structure. -/ +theorem legal_tail_iff (z V : C) (y : Reg) (G : List (Give K Reg C)) (hy : ∀ g ∈ G, g.1 ≠ y) : + ∀ (s : St K Reg C) (c0 : C), s.loc y = some c0 → + (Legal z V s (tailEvs y G) ↔ okTail s.loc z V c0 G) := by + induction G with + | nil => intro s c0 _; simp [tailEvs, Legal, okTail] + | cons g G ih => + intro s c0 hc + have hg : g.1 ≠ y := hy g (by simp) + have hG : ∀ g' ∈ G, g'.1 ≠ y := fun g' h => hy g' (by simp [h]) + have hloc : (step (step s (.move y g.2.2)) (.add g.1 y g.2.1 g.2.2)).loc + = Function.update s.loc y (some g.2.2) := by simp [step] + have hsy : (step (step s (.move y g.2.2)) (.add g.1 y g.2.1 g.2.2)).loc y = some g.2.2 := by + rw [hloc]; simp + have IH := ih hG _ _ hsy + rw [hloc, okTail_upd z V s.loc y _ G hG] at IH + simp only [tailEvs, Legal] + rw [show (Legal z V (step (step s (.move y g.2.2)) (.add g.1 y g.2.1 g.2.2)) (tailEvs y G)) + ↔ okTail s.loc z V g.2.2 G from IH] + simp only [LegalEv, step, okTail] + constructor + · rintro ⟨⟨c1, h1, h2, h3⟩, ⟨_, h4, _⟩, h5⟩ + rw [hc] at h1; cases h1 + refine ⟨h2, h3, ?_, h5⟩ + simpa [Function.update_of_ne hg] using h4 + · rintro ⟨h2, h3, h4, h5⟩ + refine ⟨⟨c0, hc, h2, h3⟩, ⟨hg, ?_, by simp⟩, h5⟩ + simpa [Function.update_of_ne hg] using h4 + +/-- the whole shared plan is Legal iff: `p` and the courier's first position agree (`p` at `cp`, `y` fresh, `y ≠ p`) +and the chain is `okTail`. -/ +theorem legal_shared_iff (z V : C) (s : St K Reg C) (y p : Reg) (cp : C) (G : List (Give K Reg C)) + (hyp : y ≠ p) (hy : ∀ g ∈ G, g.1 ≠ y) : + Legal z V s (sharedEvs y p cp G) ↔ + s.loc y = none ∧ s.loc p = some cp ∧ okTail (Function.update s.loc y (some cp)) z V cp G := by + have hloc : (step (step s (.born y cp)) (.add y p 1 cp)).loc = Function.update s.loc y (some cp) := by + simp [step] + have hsy : (step (step s (.born y cp)) (.add y p 1 cp)).loc y = some cp := by rw [hloc]; simp + simp only [sharedEvs, Legal] + rw [legal_tail_iff z V y G hy _ cp hsy, hloc] + simp only [LegalEv, step] + constructor + · rintro ⟨h1, ⟨_, h2, h3⟩, h4⟩ + refine ⟨h1, ?_, h4⟩ + simpa [Function.update_of_ne hyp.symm] using h3 + · rintro ⟨h1, h2, h4⟩ + refine ⟨h1, ⟨hyp, by simp, ?_⟩, h4⟩ + simpa [Function.update_of_ne hyp.symm] using h2 + +/-- ASCENT (frame order) as a separate hypothesis on a preorder of charts: `cp ≤ g_1 ≤ ... ≤ g_m`. -/ +def Ascending [Preorder C] (cp : C) (G : List (Give K Reg C)) : Prop := + List.IsChain (· ≤ ·) (cp :: G.map fun g => g.2.2) + +/-- Legal does not see ascent: reversing the order of the (distinct) stops of a Legal chain with the same +consumers present keeps it Legal when the `V` stop is not interior. (Two stops, neither `V`.) -/ +theorem legal_blind_to_order (z V : C) (y : Reg) (g1 g2 : Give K Reg C) (hy1 : g1.1 ≠ y) (hy2 : g2.1 ≠ y) + (s : St K Reg C) (c0 : C) (hc : s.loc y = some c0) (hV1 : g1.2.2 ≠ V) (hV2 : g2.2.2 ≠ V) (hc0 : c0 ≠ V) + (h : Legal z V s (tailEvs y [g1, g2])) : Legal z V s (tailEvs y [g2, g1]) := by + have hy : ∀ g ∈ [g1, g2], g.1 ≠ y := by simp [hy1, hy2] + have hy' : ∀ g ∈ [g2, g1], g.1 ≠ y := by simp [hy1, hy2] + rw [legal_tail_iff z V y _ hy s c0 hc] at h + rw [legal_tail_iff z V y _ hy' s c0 hc] + simp only [okTail] at h ⊢ + exact ⟨hc0, h.2.2.2.2.1, h.2.2.2.2.2.1, hV2, h.2.1, h.2.2.1, trivial⟩ + +end Legality + +/-! ## (2) Cost under Theorem K -/ +section Cost +open CallerCost FibreK + +/-- D0 per helper (FibreK.d0_native; same definition as Delivery.courierD0, which is not built in this tree). -/ +noncomputable def courierD0 (h : Helper) : ℝ := fL (h.e - h.b) - (h.steps.map fun s => fL (gap s)).sum + +noncomputable def φ (x : ℝ) : ℝ := x * Real.log x + +lemma fL_eq (n : ℕ) : fL n = φ n := rfl + +lemma φ_zero : φ 0 = 0 := by simp [φ] + +/-- two-point majorisation for the convex `x log x`: `x` between `u` and `v`. -/ +lemma maj {u v x : ℝ} (hu : 0 ≤ u) (hux : u ≤ x) (hxv : x ≤ v) : + φ x + φ (u + v - x) ≤ φ u + φ v := by + rcases eq_or_lt_of_le (hux.trans hxv) with huv | huv + · have : x = u := by linarith + subst this; have : v = x := by linarith + subst this; simp + · have hvu : 0 < v - u := by linarith + set a := (v - x) / (v - u) with ha + set b := (x - u) / (v - u) with hb + have ha0 : 0 ≤ a := div_nonneg (by linarith) hvu.le + have hb0 : 0 ≤ b := div_nonneg (by linarith) hvu.le + have hab : a + b = 1 := by rw [ha, hb]; field_simp; ring + have hx : a * u + b * v = x := by rw [ha, hb]; field_simp; ring + have hy : b * u + a * v = u + v - x := by rw [ha, hb]; field_simp; ring + have hmem : ∀ w : ℝ, 0 ≤ w → w ∈ Set.Ici (0:ℝ) := fun w hw => hw + have hv0 : 0 ≤ v := by linarith + have c1 := Real.convexOn_mul_log.2 (hmem u hu) (hmem v hv0) ha0 hb0 hab + have c2 := Real.convexOn_mul_log.2 (hmem u hu) (hmem v hv0) hb0 ha0 (by linarith) + simp only [smul_eq_mul] at c1 c2 + rw [hx] at c1; rw [hy] at c2 + have e1 : φ x ≤ a * φ u + b * φ v := c1 + have e2 : φ (u + v - x) ≤ b * φ u + a * φ v := c2 + have hb1 : b = 1 - a := by linarith + rw [hb1] at e1 e2 + linarith + +lemma fL_incr (y z x : ℕ) (hyz : y ≤ z) : fL (y + x) + fL z ≤ fL y + fL (z + x) := by + have := maj (u := (y : ℝ)) (v := ((z + x : ℕ) : ℝ)) (x := (z : ℝ)) (by positivity) + (by exact_mod_cast hyz) (by push_cast; linarith [(Nat.cast_nonneg x : (0:ℝ) ≤ x)]) + have h2 : (y : ℝ) + ((z + x : ℕ) : ℝ) - z = ((y + x : ℕ) : ℝ) := by push_cast; ring + rw [h2] at this + simp only [fL_eq]; linarith + +/-- superadditivity (weak). -/ +lemma fL_super (a b : ℕ) : fL a + fL b ≤ fL (a + b) := by + have := fL_incr 0 a b (Nat.zero_le _) + simp [fL] at this ⊢; linarith + +/-- strict superadditivity for positive arguments. -/ +lemma fL_super_strict (a b : ℕ) (ha : 0 < a) (hb : 0 < b) : fL a + fL b < fL (a + b) := by + have ha' : (0:ℝ) < a := by exact_mod_cast ha + have hb' : (0:ℝ) < b := by exact_mod_cast hb + have h1 : Real.log a < Real.log (a + b) := Real.log_lt_log ha' (by linarith) + have h2 : Real.log b < Real.log (a + b) := Real.log_lt_log hb' (by linarith) + simp only [fL]; push_cast + nlinarith [mul_lt_mul_of_pos_left h1 ha', mul_lt_mul_of_pos_left h2 hb'] + +/-- prefix sums of the hop-gap sequence. -/ +def pre (a : ℕ → ℕ) (j : ℕ) : ℕ := ∑ i ∈ Finset.range j, a i + +lemma pre_succ (a : ℕ → ℕ) (j : ℕ) : pre a (j + 1) = pre a j + a j := by simp [pre, Finset.sum_range_succ] +lemma pre_mono (a : ℕ → ℕ) {i j : ℕ} (h : i ≤ j) : pre a i ≤ pre a j := by + induction h with + | refl => exact le_rfl + | step _ ih => rw [pre_succ]; omega + +/-- the convexity core: splitting a block of `n` gaps at every interior point costs at most `n·f(R)` plus the gaps. -/ +theorem split_ineq (a : ℕ → ℕ) (n : ℕ) : + ∑ j ∈ Finset.range (n + 1), (fL (pre a j) + fL (pre a n - pre a j)) + ≤ n * fL (pre a n) + ∑ i ∈ Finset.range n, fL (a i) := by + induction n with + | zero => simp [pre, fL] + | succ n ih => + have hΔ : ∀ j ∈ Finset.range n, fL (pre a (n + 1) - pre a j) ≤ fL (pre a n - pre a j) + fL (pre a (n+1)) - fL (pre a n) := by + intro j hj + have hj' : pre a j ≤ pre a n := pre_mono a (by simp at hj; omega) + have := fL_incr (pre a n - pre a j) (pre a n) (a n) (Nat.sub_le _ _) + have e : pre a n - pre a j + a n = pre a (n + 1) - pre a j := by rw [pre_succ]; omega + rw [e, ← pre_succ] at this + linarith + have h1 : ∑ j ∈ Finset.range n, (fL (pre a j) + fL (pre a (n + 1) - pre a j)) + ≤ ∑ j ∈ Finset.range n, (fL (pre a j) + fL (pre a n - pre a j) + fL (pre a (n+1)) - fL (pre a n)) := + Finset.sum_le_sum fun j hj => by have := hΔ j hj; linarith + rw [Finset.sum_range_succ] at ih + rw [Finset.sum_range_succ, Finset.sum_range_succ] + simp only [Finset.sum_add_distrib, Finset.sum_sub_distrib, Finset.sum_const, Finset.card_range, nsmul_eq_mul] at h1 + simp only [Finset.sum_range_succ (fun i => fL (a i)) n] + have e0 : pre a (n + 1) - pre a n = a n := by rw [pre_succ]; omega + have e1 : pre a n - pre a n = 0 := Nat.sub_self _ + have e2 : pre a (n + 1) - pre a (n + 1) = 0 := Nat.sub_self _ + rw [e1] at ih + rw [e0, e2] + have hf0 : fL 0 = 0 := by simp [fL] + simp only [hf0] at ih ⊢ + push_cast + simp only [Finset.sum_add_distrib] at ih ⊢ + nlinarith [h1, ih] + +/-- D0 of a courier whose hop gaps are the list `gs` and whose climb is their sum. -/ +theorem courierD0_gaps (h : Helper) (gs : List ℕ) (hs : h.steps.map gap = gs) (hd : h.e - h.b = gs.sum) : + courierD0 h = fL gs.sum - (gs.map fL).sum := by + have : (h.steps.map fun s => fL (gap s)).sum = ((h.steps.map gap).map fL).sum := by rw [List.map_map]; rfl + unfold courierD0; rw [this, hs, hd] + +/-- D0 depends on the multiset of gaps only (so the beta-side order G-chain -> F -> V is priced the same). -/ +theorem courierD0_perm (h h' : Helper) (hd : h.e - h.b = h'.e - h'.b) + (hp : (h.steps.map gap).Perm (h'.steps.map gap)) : courierD0 h = courierD0 h' := by + have e : ∀ h : Helper, (h.steps.map fun s => fL (gap s)).sum = ((h.steps.map gap).map fL).sum := by + intro h; rw [List.map_map]; rfl + unfold courierD0; rw [e h, e h', hd, (hp.map fL).sum_eq] + +lemma sum_range_map (g : ℕ → ℕ) (n : ℕ) : ((List.range n).map g).sum = ∑ i ∈ Finset.range n, g i := by + induction n with + | zero => simp + | succ n ih => simp [List.range_succ, ih, Finset.sum_range_succ] + +lemma sum_range_mapR (g : ℕ → ℝ) (n : ℕ) : ((List.range n).map g).sum = ∑ i ∈ Finset.range n, g i := by + induction n with + | zero => simp + | succ n ih => simp [List.range_succ, ih, Finset.sum_range_succ] + +/-- K-cost of the SHARED courier: pickup hop `a0`, then the `k+1` hops `a 0 .. a k` (k gives, last hop to V). -/ +noncomputable def sharedCost (a0 : ℕ) (k : ℕ) (a : ℕ → ℕ) : ℝ := + fL (a0 + pre a (k + 1)) - fL a0 - ∑ i ∈ Finset.range (k + 1), fL (a i) + +/-- K-cost of the `k` SEPARATE couriers (courier `j+1`, `j < k`, has hops `a0`, `P_{j+1}`, `R - P_{j+1}`). -/ +noncomputable def sepCost (a0 : ℕ) (k : ℕ) (a : ℕ → ℕ) : ℝ := + ∑ j ∈ Finset.range k, (fL (a0 + pre a (k + 1)) - fL a0 - fL (pre a (j + 1)) - fL (pre a (k + 1) - pre a (j + 1))) + +/-- the shared helper's D0 is `sharedCost`. -/ +theorem shared_helper_cost (h : Helper) (a0 k : ℕ) (a : ℕ → ℕ) + (hs : h.steps.map gap = a0 :: (List.range (k + 1)).map a) (hd : h.e - h.b = a0 + pre a (k + 1)) : + courierD0 h = sharedCost a0 k a := by + have hsum : (a0 :: (List.range (k + 1)).map a).sum = a0 + pre a (k + 1) := by + simp [List.sum_cons, sum_range_map, pre] + rw [courierD0_gaps h _ hs (by rw [hd, hsum]), hsum] + simp only [List.map_cons, List.sum_cons, List.map_map, Function.comp_def] + rw [sum_range_mapR (fun i => fL (a i))] + unfold sharedCost; ring + +/-- the separate courier for give `j+1`. -/ +theorem sep_helper_cost (h : Helper) (a0 k j : ℕ) (a : ℕ → ℕ) + (hs : h.steps.map gap = [a0, pre a (j + 1), pre a (k + 1) - pre a (j + 1)]) + (hd : h.e - h.b = a0 + pre a (k + 1)) (hjk : j + 1 ≤ k + 1) : + courierD0 h = fL (a0 + pre a (k + 1)) - fL a0 - fL (pre a (j + 1)) - fL (pre a (k + 1) - pre a (j + 1)) := by + have hle := pre_mono a hjk + have hsum : [a0, pre a (j + 1), pre a (k + 1) - pre a (j + 1)].sum = a0 + pre a (k + 1) := by + simp; omega + rw [courierD0_gaps h _ hs (by rw [hd, hsum]), hsum] + simp; ring + +/-- **EXACT DIFFERENCE** (separate - shared), `k` consumers. -/ +theorem diff_formula (a0 k : ℕ) (a : ℕ → ℕ) : + sepCost a0 k a - sharedCost a0 k a = + ((k : ℝ) - 1) * (fL (a0 + pre a (k + 1)) - fL a0) + - ∑ j ∈ Finset.range k, (fL (pre a (j + 1)) + fL (pre a (k + 1) - pre a (j + 1))) + + ∑ i ∈ Finset.range (k + 1), fL (a i) := by + unfold sepCost sharedCost + have : ∀ j ∈ Finset.range k, (fL (a0 + pre a (k + 1)) - fL a0 - fL (pre a (j + 1)) - fL (pre a (k + 1) - pre a (j + 1))) + = (fL (a0 + pre a (k + 1)) - fL a0) - (fL (pre a (j + 1)) + fL (pre a (k + 1) - pre a (j + 1))) := by + intro j _; ring + rw [Finset.sum_congr rfl this, Finset.sum_sub_distrib] + simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul] + ring + +/-- the interior split terms: `Σ_{j 1) = 8 * Real.log 2 ∧ sepCost 1 2 (fun _ => 1) = 12 * Real.log 2 := by + have p1 : pre (fun _ => 1) 3 = 3 := by simp [pre] + have p2 : pre (fun _ => 1) 1 = 1 := by simp [pre] + have p3 : pre (fun _ => 1) 2 = 2 := by simp [pre] + have l4 : Real.log 4 = 2 * Real.log 2 := by + rw [show (4:ℝ) = 2 ^ 2 by norm_num, Real.log_pow]; norm_num + have f1 : fL 1 = 0 := by simp [fL] + have f2 : fL 2 = 2 * Real.log 2 := by simp [fL] + have f4 : fL 4 = 8 * Real.log 2 := by simp only [fL]; push_cast; rw [l4]; ring + constructor + · unfold sharedCost; simp [Finset.sum_range_succ, p1, f1, f4] + · unfold sepCost; simp [Finset.sum_range_succ, p1, p2, p3, f1, f2, f4]; ring + +end Cost +end SharedCourier + +#print axioms SharedCourier.exact_mod_tokens +#print axioms SharedCourier.tc_cleanup +#print axioms SharedCourier.legal_shared_iff +#print axioms SharedCourier.shared_le_sep +#print axioms SharedCourier.shared_lt_sep +#print axioms SharedCourier.example_k2 diff --git a/research/p104-lean-premises/lean/Nov15/SharedCourier.md b/research/p104-lean-premises/lean/Nov15/SharedCourier.md new file mode 100644 index 0000000000..3b492ca392 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SharedCourier.md @@ -0,0 +1,28 @@ +# SharedCourier.lean: shared-snapshot courier (GB1 section 3). No sorry, ~10 s, 2.9 GB peak. Axioms: [propext, Classical.choice, Quot.sound] (tc_cleanup: [propext, Quot.sound]) +Source: internal notes Reuses TokenCancel (events, `run`, `Legal`, XCLOSE shape) and FibreK (`Helper`, `gap`, d0 table); Delivery is not built in this tree, so `courierD0` is restated (same formula as Delivery.courierD0 / FibreK.d0_native). + +**Model.** A give = (consumer, coefficient, stop chart). Shared courier y: `born y cp`, `add y p 1 cp` (pick up row p once), then per give `move y g; add consumer y a g`. Separate plan: one courier per give (`seg`: born, pick, move, deliver, clear). + +**(1) Exactness.** +- `shared_row`: every register r != y ends with `row r + cf G r • (row p + e_y)`, `cf G r` = total coefficient given to r. +- `sep_row`: for the separate plan every non-courier r ends with `row r + cf G r • row p + tokSep` (one token e_{y_j} per give). +- `exact_mod_tokens`: same plan (`G = L.map snd`): shared row - cf•e_y = separate row - tokSep, i.e. identical `row r + cf • row p`. +- `tc_cleanup`: TC. A consumer holding `tau + k•e_y` and a token holder x (row e_y) at the same chart: ONE ADD of -k gives exactly tau, and -k is the only such coefficient (hand-proved instance of XCLOSE). +- Hypotheses (scope): p is not a consumer and not a courier, consumers are never couriers, couriers distinct, and the snapshot row p is constant during the chain (all gives see the same content). Both plans are exact only modulo tokens; the shared plan leaves ONE token per consumer (cf•e_y), the separate plan one per give; cleanup needs a token holder co-present with the consumer. The courier's own row is garbage until cleared (not modelled for the shared plan). + +**(3) Legality.** +- `legal_tail_iff`: the chain is Legal iff `okTail`: each consumer present at its stop chart, no stop at z, and every stop except the last is not V (a MOVE never leaves V). +- `legal_shared_iff`: the whole shared plan is Legal iff y is fresh, p is at cp, and `okTail` (relative to the location map with y at cp). +- Ascent is NOT visible to `Legal` (`legal_blind_to_order`: swapping two stops keeps Legality); `Ascending` (IsChain ≤ on cp :: stops) is an extra frame-order constraint to impose separately (Delivery section 3, time order). + +**(2) Cost under Theorem K (D0 table).** D0 of a courier = f(e-b) - sum f(hop gap), f(r) = r ln r (`courierD0_gaps`; order-free by `courierD0_perm`, so the beta side G-chain -> F -> V is priced the same). +- Shared: hops a0 (pickup), a_0..a_k (k gives, last hop to V). `sharedCost a0 k a = f(a0+R) - f(a0) - sum f(a_i)`, R = P_{k+1}. +- k separate couriers (3 hops each: a0, P_j, R-P_j): `sepCost a0 k a = sum_j [f(a0+R) - f(a0) - f(P_j) - f(R-P_j)]`. +- `diff_formula`: sep - shared = (k-1)(f(a0+R) - f(a0)) - sum_j [f(P_j)+f(R-P_j)] + sum f(a_i), exact. +- `split_ineq` (convexity of x ln x, two-point majorisation `maj`): sum_j [f(P_j)+f(R-P_j)] <= (k-1) f(R) + sum f(a_i). +- `shared_le_sep` (k >= 1): shared <= separate. `shared_eq_sep_one`: equality at k = 1 (MINCH = 2 in GB1 is exactly this). `shared_lt_sep` (k >= 2, a0 >= 1, R >= 1): strict. `saving_ge`: saving >= (k-1)(f(a0+R) - f(a0) - f(R)) > 0. +- `example_k2`: a0 = 1, gaps 1,1,1: shared 8 ln 2 vs two separate 12 ln 2. +- Condition for the shared courier to be cheaper: k >= 2 consumers on the chain and nondegenerate gaps; no other condition on the stop positions (the sum over cost is always <=). The D0 per helper goes UP (more stops) while the helper COUNT drops k -> 1; GB1's 9,003 -> 7,387 helpers and D0 58,591 -> 49,185 are consistent in sign. +- Scope: same endpoints (birth 0, end V), same pickup hop, ascending hops (gap = difference), P0 = D0 table. Not covered: the helper-count term of Theorem K beyond D0 (pi multiset is shared by construction), real tariff r6 routing. + +No statement of GB1 section 3 found false. (Not proved here: the Z[1/30] / rank / V-mix claims of the pipeline.) diff --git a/research/p104-lean-premises/lean/Nov15/SmallRoots.lean b/research/p104-lean-premises/lean/Nov15/SmallRoots.lean new file mode 100644 index 0000000000..c20f6b76d3 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SmallRoots.lean @@ -0,0 +1,130 @@ +/- +(Nov 17): kernel check that the SMALLCALLER exact rational roots 1|1 (A and B form) and 2|2 (A form) +satisfy the root conditions of rc.py (algebraic core only). See SmallRoots.md for the scope. +Kernel only: no sorry, no native_decide. +-/ +import Nov15.SmallRootsA22Corners +namespace SmallRoots + +namespace A11c +theorem shape : A11_X.length = 6 + 2 ∧ A11_Y.length = 6 + 2 ∧ (∀ r ∈ A11_X, r.length = 6) ∧ ∀ r ∈ A11_Y, r.length = 6 := by decide +kernel +theorem isotropy : ∀ p ∈ List.zip A11_X A11_Y, dotv p.2 p.1 = 0 := by decide +kernel +theorem nonzero : ∀ p ∈ List.zip A11_X A11_Y, (∃ v ∈ p.1, v ≠ 0) ∧ ∃ v ∈ p.2, v ≠ 0 := by decide +kernel +theorem product : pref 6 A11_X A11_Y (6 + 2) = negIdMat 6 := by decide +kernel +theorem ordered : (A11_st.map (·.u0)).Pairwise (fun a b => a + 1 < b) ∧ ∀ s ∈ A11_st, s.u0 + 1 < 6 + 2 := by decide +kernel +theorem inside : ∀ s ∈ A11_st, inMask 6 A11_X A11_Y s := by decide +kernel +theorem before : ∀ s ∈ A11_st, commMask 6 s.mask (pref 6 A11_X A11_Y s.u0) := by decide +kernel +theorem after : ∀ s ∈ A11_st, commMask 6 s.mask (pref 6 A11_X A11_Y (s.u0 + 2)) := by decide +kernel +theorem len : A11_st.length = 2 := by decide +kernel +theorem bits_eq : bits 2 = [[0, 0], [1, 0], [0, 1], [1, 1]] := by decide +kernel +theorem corner0 : Mend 6 A11_X A11_Y A11_st ([0, 0] : List ℚ) = tgtD 6 A11_st ([0, 0] : List ℚ) := by decide +kernel +theorem corner1 : Mend 6 A11_X A11_Y A11_st ([1, 0] : List ℚ) = tgtD 6 A11_st ([1, 0] : List ℚ) := by decide +kernel +theorem corner2 : Mend 6 A11_X A11_Y A11_st ([0, 1] : List ℚ) = tgtD 6 A11_st ([0, 1] : List ℚ) := by decide +kernel +theorem corner3 : Mend 6 A11_X A11_Y A11_st ([1, 1] : List ℚ) = tgtD 6 A11_st ([1, 1] : List ℚ) := by decide +kernel +theorem symbolic : ∀ D ∈ bits A11_st.length, Mend 6 A11_X A11_Y A11_st D = tgtD 6 A11_st D := by + rw [len, bits_eq] + intro D hD + simp only [List.mem_cons, List.not_mem_nil, or_false] at hD + rcases hD with rfl | rfl | rfl | rfl + · exact corner0 + · exact corner1 + · exact corner2 + · exact corner3 +theorem pairs : ∀ s ∈ A11_st, (dotv (A11_Y.getD s.u0 []) (A11_X.getD (s.u0 + 1) []), dotv (A11_Y.getD (s.u0 + 1) []) (A11_X.getD s.u0 [])) = A11_pair := by decide +kernel +theorem rG : rankCert 6 (gram A11_X A11_Y) A11_rkG := by decide +kernel +theorem rX : rankCert 6 A11_X A11_rkX := by decide +kernel +theorem rY : rankCert 6 A11_Y A11_rkY := by decide +kernel +theorem conn : (reach (gram A11_X A11_Y) true).length = 6 + 2 ∧ (reach (gram A11_X A11_Y) false).length = 6 + 2 := by decide +kernel +end A11c + +theorem smallcaller_1_1_A : IsRoot 6 A11_X A11_Y A11_st A11_pair := + ⟨A11c.shape, A11c.isotropy, A11c.nonzero, A11c.product, A11c.ordered, A11c.inside, A11c.before, A11c.after, + A11c.symbolic, A11c.pairs, ⟨_, A11c.rG⟩, ⟨_, A11c.rX⟩, ⟨_, A11c.rY⟩, A11c.conn⟩ + +namespace B11c +theorem shape : B11_X.length = 6 + 2 ∧ B11_Y.length = 6 + 2 ∧ (∀ r ∈ B11_X, r.length = 6) ∧ ∀ r ∈ B11_Y, r.length = 6 := by decide +kernel +theorem isotropy : ∀ p ∈ List.zip B11_X B11_Y, dotv p.2 p.1 = 0 := by decide +kernel +theorem nonzero : ∀ p ∈ List.zip B11_X B11_Y, (∃ v ∈ p.1, v ≠ 0) ∧ ∃ v ∈ p.2, v ≠ 0 := by decide +kernel +theorem product : pref 6 B11_X B11_Y (6 + 2) = negIdMat 6 := by decide +kernel +theorem ordered : (B11_st.map (·.u0)).Pairwise (fun a b => a + 1 < b) ∧ ∀ s ∈ B11_st, s.u0 + 1 < 6 + 2 := by decide +kernel +theorem inside : ∀ s ∈ B11_st, inMask 6 B11_X B11_Y s := by decide +kernel +theorem before : ∀ s ∈ B11_st, commMask 6 s.mask (pref 6 B11_X B11_Y s.u0) := by decide +kernel +theorem after : ∀ s ∈ B11_st, commMask 6 s.mask (pref 6 B11_X B11_Y (s.u0 + 2)) := by decide +kernel +theorem len : B11_st.length = 2 := by decide +kernel +theorem bits_eq : bits 2 = [[0, 0], [1, 0], [0, 1], [1, 1]] := by decide +kernel +theorem corner0 : Mend 6 B11_X B11_Y B11_st ([0, 0] : List ℚ) = tgtD 6 B11_st ([0, 0] : List ℚ) := by decide +kernel +theorem corner1 : Mend 6 B11_X B11_Y B11_st ([1, 0] : List ℚ) = tgtD 6 B11_st ([1, 0] : List ℚ) := by decide +kernel +theorem corner2 : Mend 6 B11_X B11_Y B11_st ([0, 1] : List ℚ) = tgtD 6 B11_st ([0, 1] : List ℚ) := by decide +kernel +theorem corner3 : Mend 6 B11_X B11_Y B11_st ([1, 1] : List ℚ) = tgtD 6 B11_st ([1, 1] : List ℚ) := by decide +kernel +theorem symbolic : ∀ D ∈ bits B11_st.length, Mend 6 B11_X B11_Y B11_st D = tgtD 6 B11_st D := by + rw [len, bits_eq] + intro D hD + simp only [List.mem_cons, List.not_mem_nil, or_false] at hD + rcases hD with rfl | rfl | rfl | rfl + · exact corner0 + · exact corner1 + · exact corner2 + · exact corner3 +theorem pairs : ∀ s ∈ B11_st, (dotv (B11_Y.getD s.u0 []) (B11_X.getD (s.u0 + 1) []), dotv (B11_Y.getD (s.u0 + 1) []) (B11_X.getD s.u0 [])) = B11_pair := by decide +kernel +theorem rG : rankCert 6 (gram B11_X B11_Y) B11_rkG := by decide +kernel +theorem rX : rankCert 6 B11_X B11_rkX := by decide +kernel +theorem rY : rankCert 6 B11_Y B11_rkY := by decide +kernel +theorem conn : (reach (gram B11_X B11_Y) true).length = 6 + 2 ∧ (reach (gram B11_X B11_Y) false).length = 6 + 2 := by decide +kernel +end B11c + +theorem smallcaller_1_1_B : IsRoot 6 B11_X B11_Y B11_st B11_pair := + ⟨B11c.shape, B11c.isotropy, B11c.nonzero, B11c.product, B11c.ordered, B11c.inside, B11c.before, B11c.after, + B11c.symbolic, B11c.pairs, ⟨_, B11c.rG⟩, ⟨_, B11c.rX⟩, ⟨_, B11c.rY⟩, B11c.conn⟩ + +namespace A22c +theorem shape : A22_X.length = 10 + 2 ∧ A22_Y.length = 10 + 2 ∧ (∀ r ∈ A22_X, r.length = 10) ∧ ∀ r ∈ A22_Y, r.length = 10 := by decide +kernel +theorem isotropy : ∀ p ∈ List.zip A22_X A22_Y, dotv p.2 p.1 = 0 := by decide +kernel +theorem nonzero : ∀ p ∈ List.zip A22_X A22_Y, (∃ v ∈ p.1, v ≠ 0) ∧ ∃ v ∈ p.2, v ≠ 0 := by decide +kernel +theorem product : pref 10 A22_X A22_Y (10 + 2) = negIdMat 10 := by decide +kernel +theorem ordered : (A22_st.map (·.u0)).Pairwise (fun a b => a + 1 < b) ∧ ∀ s ∈ A22_st, s.u0 + 1 < 10 + 2 := by decide +kernel +theorem inside : ∀ s ∈ A22_st, inMask 10 A22_X A22_Y s := by decide +kernel +theorem before : ∀ s ∈ A22_st, commMask 10 s.mask (pref 10 A22_X A22_Y s.u0) := by decide +kernel +theorem after : ∀ s ∈ A22_st, commMask 10 s.mask (pref 10 A22_X A22_Y (s.u0 + 2)) := by decide +kernel +theorem len : A22_st.length = 4 := by decide +kernel +theorem bits_eq : bits 4 = [[0, 0, 0, 0], [1, 0, 0, 0], [0, 1, 0, 0], [1, 1, 0, 0], [0, 0, 1, 0], [1, 0, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 0, 0, 1], [1, 0, 0, 1], [0, 1, 0, 1], [1, 1, 0, 1], [0, 0, 1, 1], [1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]] := by decide +kernel +theorem symbolic : ∀ D ∈ bits A22_st.length, Mend 10 A22_X A22_Y A22_st D = tgtD 10 A22_st D := by + rw [len, bits_eq] + intro D hD + simp only [List.mem_cons, List.not_mem_nil, or_false] at hD + rcases hD with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl + · exact corner0 + · exact corner1 + · exact corner2 + · exact corner3 + · exact corner4 + · exact corner5 + · exact corner6 + · exact corner7 + · exact corner8 + · exact corner9 + · exact corner10 + · exact corner11 + · exact corner12 + · exact corner13 + · exact corner14 + · exact corner15 +theorem pairs : ∀ s ∈ A22_st, (dotv (A22_Y.getD s.u0 []) (A22_X.getD (s.u0 + 1) []), dotv (A22_Y.getD (s.u0 + 1) []) (A22_X.getD s.u0 [])) = A22_pair := by decide +kernel +theorem rG : rankCert 10 (gram A22_X A22_Y) A22_rkG := by decide +kernel +theorem rX : rankCert 10 A22_X A22_rkX := by decide +kernel +theorem rY : rankCert 10 A22_Y A22_rkY := by decide +kernel +theorem conn : (reach (gram A22_X A22_Y) true).length = 10 + 2 ∧ (reach (gram A22_X A22_Y) false).length = 10 + 2 := by decide +kernel +end A22c + +theorem smallcaller_2_2_A : IsRoot 10 A22_X A22_Y A22_st A22_pair := + ⟨A22c.shape, A22c.isotropy, A22c.nonzero, A22c.product, A22c.ordered, A22c.inside, A22c.before, A22c.after, + A22c.symbolic, A22c.pairs, ⟨_, A22c.rG⟩, ⟨_, A22c.rX⟩, ⟨_, A22c.rY⟩, A22c.conn⟩ + +/-- the pair types are exactly A = (0,0) and B = (-1, 1/2). -/ +theorem pair_types : A11_pair = (0, 0) ∧ A22_pair = (0, 0) ∧ B11_pair = (-1, 1/2) := by decide +kernel + +end SmallRoots + +#print axioms SmallRoots.smallcaller_1_1_A +#print axioms SmallRoots.smallcaller_1_1_B +#print axioms SmallRoots.smallcaller_2_2_A +#print axioms SmallRoots.pair_types diff --git a/research/p104-lean-premises/lean/Nov15/SmallRoots.md b/research/p104-lean-premises/lean/Nov15/SmallRoots.md new file mode 100644 index 0000000000..a2d406c810 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SmallRoots.md @@ -0,0 +1,17 @@ +# SmallRoots : kernel check of the small-caller roots +Files: Nov15/SmallRootsDefs.lean (conditions), SmallRootsData.lean (GENERATED by Nov15/smallroots_gen/gen.py from internal notes, rootB_1_1.json, rootA_2_2.json: exact rationals + rank certificates), SmallRootsA22Corners.lean (16 corner evaluations, own file for kernel memory), SmallRoots.lean (theorems). Builds with the memory-guarded build script, peak 2.9 GB (Corners file 2.6 GB, 49 s; main 24 s). Kernel only: `decide +kernel`; `#print axioms` = [propext, Classical.choice, Quot.sound]; no sorry, no native_decide. + +## Theorems +`smallcaller_1_1_A : IsRoot 6 A11_X A11_Y A11_st (0,0)`, `smallcaller_1_1_B : IsRoot 6 B11_* (-1, 1/2)`, `smallcaller_2_2_A : IsRoot 10 A22_* (0,0)`; `pair_types` pins the pair types. N = n + 2 units (rho = 2). + +## What `IsRoot` states (one field per rc.py `req`, rc.py = small-caller/rc.py; AUDIT1 (1)-(2) checked rc.py against root_check_h.py) +shape (N = n+2 rows of length n); isotropy y_k.x_k = 0; nonzero; product T_{N-1}..T_0 = -I (T = I - 2 x y^T, applied by `applyUnit`, rc.py "W = [[W[i][j] - 2*X[k][i]*d[j]"); stage units consecutive pairs, ordered and disjoint; units inside their coordinate mask; mask commutes with the prefix product before (pre[u0]) and after (pre[u0+2]); symbolic endpoint M(D) = -diag(prod D_i^[r in mask_i]); stage pair (alpha,beta) = (y_p.x_q, y_q.x_p) equals the declared pair; rank G = n, rank X = n, rank Y = n (certified by an n x n minor with exact inverse, `rankCert`); Gram digraph strongly connected (rc.py enforces it; AUDIT1 notes it is the MRCHECK author's line, not SPEC; included because rc.py has it). + +## Scope and honest gaps +- ALGEBRAIC CORE ONLY (AUDIT1 (3)): abstract masks, n = 2k + 2, not an emitted caller (no frame lowering, no events, no 96 A + 8 B port assembly, no header/address bindings, no verifier run). "Realisable" holds at root level only. +- Entries are rational, NOT dyadic (dyadic is a verifier line, not SPEC; #6931/#6932 precedent); hosted t is not in {0,-1} by design (A: t = 0 pair (0,0); B: (-1, 1/2) i.e. t = -1/2); no 18-stage condition (k = 2, 4 stages here). +- B thin units are QUERY-type isotropic transvections; the model prices B sign units as IDLE_ODD, so the 1|1 B price stays unestablished (AUDIT1 (5)). Not addressed here. +- `symbolic` is checked at the 2^L corners D in {0,1}^L (L = 2 for 1|1, 4 for 2|2), not as a polynomial identity. Equivalence with rc.py's symbolic check uses that M(D) is affine in each D_i (D_i scales the mask rows once, after stage i), so a function affine in each variable is determined by its corner values; that affinity lemma is NOT formalised. Corners are a necessary condition and, by the affinity remark, equivalent. +- `rank G = n` is the lower bound (an n x n minor is invertible); the upper bound is automatic since G = Y X^T factors through n dimensions (not formalised). Same for rank X, rank Y (sizes N x n). +- Also not proved (AUDIT1 last line): L0/L1/L2 reduction lemmas of R1 (only the explicit roots are checked, which is all that is needed). +- Negative controls run: pref at 7 units != -I, mismatched stage/mask data and a wrong prefix index make the corresponding `decide +kernel` fail. diff --git a/research/p104-lean-premises/lean/Nov15/SmallRootsA22Corners.lean b/research/p104-lean-premises/lean/Nov15/SmallRootsA22Corners.lean new file mode 100644 index 0000000000..55a934984b --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SmallRootsA22Corners.lean @@ -0,0 +1,25 @@ +/- +the 16 corner evaluations of the symbolic endpoint M(D) for the 2|2 A root (own file: kernel memory per file). +Kernel only. +-/ +import Nov15.SmallRootsData +namespace SmallRoots +namespace A22c +theorem corner0 : Mend 10 A22_X A22_Y A22_st ([0, 0, 0, 0] : List ℚ) = tgtD 10 A22_st ([0, 0, 0, 0] : List ℚ) := by decide +kernel +theorem corner1 : Mend 10 A22_X A22_Y A22_st ([1, 0, 0, 0] : List ℚ) = tgtD 10 A22_st ([1, 0, 0, 0] : List ℚ) := by decide +kernel +theorem corner2 : Mend 10 A22_X A22_Y A22_st ([0, 1, 0, 0] : List ℚ) = tgtD 10 A22_st ([0, 1, 0, 0] : List ℚ) := by decide +kernel +theorem corner3 : Mend 10 A22_X A22_Y A22_st ([1, 1, 0, 0] : List ℚ) = tgtD 10 A22_st ([1, 1, 0, 0] : List ℚ) := by decide +kernel +theorem corner4 : Mend 10 A22_X A22_Y A22_st ([0, 0, 1, 0] : List ℚ) = tgtD 10 A22_st ([0, 0, 1, 0] : List ℚ) := by decide +kernel +theorem corner5 : Mend 10 A22_X A22_Y A22_st ([1, 0, 1, 0] : List ℚ) = tgtD 10 A22_st ([1, 0, 1, 0] : List ℚ) := by decide +kernel +theorem corner6 : Mend 10 A22_X A22_Y A22_st ([0, 1, 1, 0] : List ℚ) = tgtD 10 A22_st ([0, 1, 1, 0] : List ℚ) := by decide +kernel +theorem corner7 : Mend 10 A22_X A22_Y A22_st ([1, 1, 1, 0] : List ℚ) = tgtD 10 A22_st ([1, 1, 1, 0] : List ℚ) := by decide +kernel +theorem corner8 : Mend 10 A22_X A22_Y A22_st ([0, 0, 0, 1] : List ℚ) = tgtD 10 A22_st ([0, 0, 0, 1] : List ℚ) := by decide +kernel +theorem corner9 : Mend 10 A22_X A22_Y A22_st ([1, 0, 0, 1] : List ℚ) = tgtD 10 A22_st ([1, 0, 0, 1] : List ℚ) := by decide +kernel +theorem corner10 : Mend 10 A22_X A22_Y A22_st ([0, 1, 0, 1] : List ℚ) = tgtD 10 A22_st ([0, 1, 0, 1] : List ℚ) := by decide +kernel +theorem corner11 : Mend 10 A22_X A22_Y A22_st ([1, 1, 0, 1] : List ℚ) = tgtD 10 A22_st ([1, 1, 0, 1] : List ℚ) := by decide +kernel +theorem corner12 : Mend 10 A22_X A22_Y A22_st ([0, 0, 1, 1] : List ℚ) = tgtD 10 A22_st ([0, 0, 1, 1] : List ℚ) := by decide +kernel +theorem corner13 : Mend 10 A22_X A22_Y A22_st ([1, 0, 1, 1] : List ℚ) = tgtD 10 A22_st ([1, 0, 1, 1] : List ℚ) := by decide +kernel +theorem corner14 : Mend 10 A22_X A22_Y A22_st ([0, 1, 1, 1] : List ℚ) = tgtD 10 A22_st ([0, 1, 1, 1] : List ℚ) := by decide +kernel +theorem corner15 : Mend 10 A22_X A22_Y A22_st ([1, 1, 1, 1] : List ℚ) = tgtD 10 A22_st ([1, 1, 1, 1] : List ℚ) := by decide +kernel +end A22c +end SmallRoots diff --git a/research/p104-lean-premises/lean/Nov15/SmallRootsData.lean b/research/p104-lean-premises/lean/Nov15/SmallRootsData.lean new file mode 100644 index 0000000000..2c68d08458 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SmallRootsData.lean @@ -0,0 +1,32 @@ +/- GENERATED by Nov15/smallroots_gen/gen.py from internal notes Do not edit. -/ +import Nov15.SmallRootsDefs +namespace SmallRoots + +/-- data: rootA_1_1.json (n = 6, N = 8) -/ +def A11_X : Mat := [[(1:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (1:ℚ), (0:ℚ)], [((7669675:ℚ)/80133192), ((-196870805:ℚ)/80133192), ((-212210155:ℚ)/80133192), ((-589975:ℚ)/26711064), ((3618345:ℚ)/2967896), ((33745055:ℚ)/26711064)], [((-99971642:ℚ)/47613), ((95664734:ℚ)/238065), ((1095381154:ℚ)/238065), ((95982154:ℚ)/79355), ((883026:ℚ)/15871), ((-187549178:ℚ)/79355)], [(-149:ℚ), ((143:ℚ)/5), ((1633:ℚ)/5), ((429:ℚ)/5), (4:ℚ), ((-838:ℚ)/5)], [(-10:ℚ), (2:ℚ), (22:ℚ), (6:ℚ), (0:ℚ), (-12:ℚ)], [(-1:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (-1:ℚ), (0:ℚ), (1:ℚ)]] +def A11_Y : Mat := [[(1:ℚ), (-1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (-1:ℚ), (0:ℚ)], [((-1:ℚ)/2), ((2:ℚ)/5), ((-2:ℚ)/5), ((-1:ℚ)/10), ((7:ℚ)/10), ((-7:ℚ)/10)], [((26266873:ℚ)/106844256), ((-21280013:ℚ)/26711064), ((21280013:ℚ)/26711064), ((-5431051:ℚ)/106844256), ((-122249027:ℚ)/106844256), ((122249027:ℚ)/106844256)], [((-14987:ℚ)/15871), ((109367:ℚ)/31742), ((-109367:ℚ)/31742), ((8086:ℚ)/15871), ((77907:ℚ)/15871), ((-77907:ℚ)/15871)], [((209:ℚ)/30), ((-353:ℚ)/60), ((353:ℚ)/60), (12:ℚ), (-10:ℚ), (10:ℚ)], [(1:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), (1:ℚ)]] +def A11_st : List Stage := [⟨0, [0, 1, 3, 4]⟩, ⟨6, [0, 2, 3, 5]⟩] +def A11_pair : ℚ × ℚ := ((0:ℚ), (0:ℚ)) +def A11_rkG : List ℕ × List ℕ × Mat := ([0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5], [[(0:ℚ), (0:ℚ), ((-2840840:ℚ)/1112961), ((-183301248:ℚ)/79355), ((-2568:ℚ)/5), (12:ℚ)], [(0:ℚ), (0:ℚ), ((4144385:ℚ)/3338883), ((94101424:ℚ)/79355), ((1319:ℚ)/5), (-6:ℚ)], [((1:ℚ)/10), ((-3:ℚ)/5), (0:ℚ), ((-373954896:ℚ)/396775), ((-5241:ℚ)/25), ((24:ℚ)/5)], [((60505109:ℚ)/106844256), ((19628083:ℚ)/17807376), ((4129825:ℚ)/53422128), (0:ℚ), ((-1349035:ℚ)/17807376), ((405215:ℚ)/2225922)], [((-250993:ℚ)/31742), ((-244393:ℚ)/15871), ((-56687747875:ℚ)/52991412093), ((-74800:ℚ)/15871), (0:ℚ), ((-39600:ℚ)/15871)], [((-13:ℚ)/12), (-2:ℚ), ((-943960:ℚ)/3338883), ((-10373504:ℚ)/79355), ((-144:ℚ)/5), (0:ℚ)]]) +def A11_rkX : List ℕ × List ℕ × Mat := ([0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5], [[(2:ℚ), (0:ℚ), ((-1:ℚ)/5), ((99761275:ℚ)/53422128), ((-822553:ℚ)/31742), ((-353:ℚ)/60)], [(-1:ℚ), (0:ℚ), ((1:ℚ)/5), ((-99761275:ℚ)/53422128), ((822553:ℚ)/31742), ((353:ℚ)/60)], [(1:ℚ), (0:ℚ), ((-3:ℚ)/10), ((46339147:ℚ)/35614752), ((-285780:ℚ)/15871), ((-24:ℚ)/5)], [(0:ℚ), (2:ℚ), ((-19:ℚ)/10), ((346222513:ℚ)/106844256), ((-714093:ℚ)/15871), (-10:ℚ)], [(0:ℚ), (-1:ℚ), ((19:ℚ)/10), ((-346222513:ℚ)/106844256), ((714093:ℚ)/15871), (10:ℚ)], [(0:ℚ), (1:ℚ), ((-13:ℚ)/10), ((228454015:ℚ)/106844256), ((-469700:ℚ)/15871), (-8:ℚ)]]) +def A11_rkY : List ℕ × List ℕ × Mat := ([0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5], [[(0:ℚ), (0:ℚ), ((-212210155:ℚ)/80133192), ((-92995714:ℚ)/238065), ((-433:ℚ)/5), (2:ℚ)], [(-1:ℚ), (0:ℚ), ((-212210155:ℚ)/80133192), ((-92995714:ℚ)/238065), ((-433:ℚ)/5), (2:ℚ)], [(-1:ℚ), (0:ℚ), ((7669675:ℚ)/80133192), ((-91381606:ℚ)/47613), (-427:ℚ), (10:ℚ)], [(0:ℚ), (0:ℚ), ((33745055:ℚ)/26711064), ((284626:ℚ)/15871), (4:ℚ), (0:ℚ)], [(0:ℚ), (-1:ℚ), ((33745055:ℚ)/26711064), ((284626:ℚ)/15871), (4:ℚ), (0:ℚ)], [(0:ℚ), (-1:ℚ), ((-589975:ℚ)/26711064), ((92678294:ℚ)/79355), ((1299:ℚ)/5), (-6:ℚ)]]) + +/-- data: rootB_1_1.json (n = 6, N = 8) -/ +def B11_X : Mat := [[(0:ℚ), (-2:ℚ), (0:ℚ), (-2:ℚ), (0:ℚ), (0:ℚ)], [(-2:ℚ), (-2:ℚ), (-2:ℚ), (-2:ℚ), (0:ℚ), (0:ℚ)], [((-78622810:ℚ)/5934687), ((-1798300:ℚ)/179839), ((-7365988:ℚ)/5934687), ((-17925530:ℚ)/5934687), ((-12501958:ℚ)/1978229), ((-32096134:ℚ)/5934687)], [((-45966231:ℚ)/1295), ((-8581518:ℚ)/259), ((-523662:ℚ)/175), ((-67111542:ℚ)/6475), ((-3138822:ℚ)/175), ((-112405917:ℚ)/6475)], [((176:ℚ)/7), ((165:ℚ)/7), ((74:ℚ)/35), ((257:ℚ)/35), ((444:ℚ)/35), ((432:ℚ)/35)], [(20:ℚ), (10:ℚ), (2:ℚ), (6:ℚ), (12:ℚ), (6:ℚ)], [(0:ℚ), (-2:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (-2:ℚ)], [(-2:ℚ), (-2:ℚ), (0:ℚ), (0:ℚ), (-2:ℚ), (-2:ℚ)]] +def B11_Y : Mat := [[((-1:ℚ)/4), ((1:ℚ)/4), ((3:ℚ)/4), ((-1:ℚ)/4), (0:ℚ), (0:ℚ)], [(0:ℚ), ((1:ℚ)/4), ((1:ℚ)/4), ((-1:ℚ)/2), (0:ℚ), (0:ℚ)], [((-1:ℚ)/2), ((1:ℚ)/14), ((1:ℚ)/2), ((5:ℚ)/7), ((25:ℚ)/28), ((-13:ℚ)/28)], [((17119897:ℚ)/17804061), ((-652337:ℚ)/35608122), ((-40174481:ℚ)/35608122), ((-27000433:ℚ)/17804061), ((-29299526:ℚ)/17804061), ((15473141:ℚ)/17804061)], [((-7199:ℚ)/1110), ((257:ℚ)/1110), ((8501:ℚ)/1110), ((11321:ℚ)/1110), ((12337:ℚ)/1110), ((-181:ℚ)/30)], [((193:ℚ)/140), ((201:ℚ)/35), ((79:ℚ)/70), ((-481:ℚ)/140), ((-207:ℚ)/140), ((-163:ℚ)/20)], [((-1:ℚ)/2), ((-1:ℚ)/2), (0:ℚ), (0:ℚ), (1:ℚ), ((1:ℚ)/2)], [((-1:ℚ)/2), (0:ℚ), (0:ℚ), (0:ℚ), ((3:ℚ)/4), ((-1:ℚ)/4)]] +def B11_st : List Stage := [⟨0, [0, 1, 2, 3]⟩, ⟨6, [0, 1, 4, 5]⟩] +def B11_pair : ℚ × ℚ := ((-1:ℚ), ((1:ℚ)/2)) +def B11_rkG : List ℕ × List ℕ × Mat := ([0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5], [[(0:ℚ), (2:ℚ), ((-467558:ℚ)/179839), ((-7161:ℚ)/185), ((-11:ℚ)/2), (0:ℚ)], [(-1:ℚ), (0:ℚ), ((-7:ℚ)/11), ((4855653:ℚ)/5180), ((3879:ℚ)/28), ((-5:ℚ)/2)], [((-11:ℚ)/7), ((22:ℚ)/7), ((-83143:ℚ)/16349), ((52309389:ℚ)/18130), ((20911:ℚ)/49), ((-55:ℚ)/7)], [((1058482:ℚ)/1618551), ((-1037930:ℚ)/1618551), ((618389615018:ℚ)/291078593289), ((-76296434311:ℚ)/127031730), ((-2014647739:ℚ)/22659714), ((2594825:ℚ)/1618551)], [((507596:ℚ)/555), ((-99464:ℚ)/111), ((26963399624:ℚ)/9073695), ((-201069139304:ℚ)/239575), ((-482667811:ℚ)/3885), ((248660:ℚ)/111)], [((337:ℚ)/35), ((-323:ℚ)/35), ((2568007:ℚ)/81745), ((-1636763007:ℚ)/181300), ((-1309631:ℚ)/980), ((337:ℚ)/14)]]) +def B11_rkX : List ℕ × List ℕ × Mat := ([0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5], [[((-1:ℚ)/4), (0:ℚ), ((-9:ℚ)/7), ((159287:ℚ)/1978229), ((41491:ℚ)/370), ((79:ℚ)/70)], [((-1:ℚ)/4), ((1:ℚ)/4), ((6:ℚ)/7), ((-2615377:ℚ)/11869374), ((-113911:ℚ)/370), ((-481:ℚ)/140)], [((3:ℚ)/4), ((-1:ℚ)/2), ((9:ℚ)/7), ((-159287:ℚ)/1978229), ((-41491:ℚ)/370), ((-79:ℚ)/70)], [((-1:ℚ)/4), ((-1:ℚ)/4), ((-6:ℚ)/7), ((2615377:ℚ)/11869374), ((113911:ℚ)/370), ((481:ℚ)/140)], [((1:ℚ)/4), ((1:ℚ)/4), ((29:ℚ)/14), ((-8575781:ℚ)/35608122), ((-373133:ℚ)/1110), ((-481:ℚ)/140)], [((3:ℚ)/4), ((-1:ℚ)/2), ((-6:ℚ)/7), ((765601:ℚ)/1978229), ((200223:ℚ)/370), ((208:ℚ)/35)]]) +def B11_rkY : List ℕ × List ℕ × Mat := ([0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5], [[(-2:ℚ), (6:ℚ), ((16905154:ℚ)/5934687), ((-4777512:ℚ)/1295), ((-3816:ℚ)/7), (10:ℚ)], [(4:ℚ), (-2:ℚ), ((4584076:ℚ)/179839), ((-4752858:ℚ)/1295), ((-3809:ℚ)/7), (10:ℚ)], [(0:ℚ), (2:ℚ), ((-23492840:ℚ)/5934687), ((-4802166:ℚ)/6475), ((-3823:ℚ)/35), (2:ℚ)], [(2:ℚ), (-2:ℚ), ((63890834:ℚ)/5934687), ((-14283228:ℚ)/6475), ((-11434:ℚ)/35), (6:ℚ)], [(-2:ℚ), (4:ℚ), ((2215682:ℚ)/1978229), ((-4919451:ℚ)/6475), ((-3928:ℚ)/35), (2:ℚ)], [(2:ℚ), (0:ℚ), ((78061438:ℚ)/5934687), ((-14537223:ℚ)/6475), ((-11644:ℚ)/35), (6:ℚ)]]) + +/-- data: rootA_2_2.json (n = 10, N = 12) -/ +def A22_X : Mat := [[(1:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(1:ℚ), (2:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (2:ℚ), (1:ℚ), (0:ℚ), (0:ℚ)], [((-11129814657:ℚ)/27536375945288), ((-6549403490655:ℚ)/3933767992184), ((-6549403490655:ℚ)/3933767992184), ((-45823564805271:ℚ)/27536375945288), ((-45823564805271:ℚ)/27536375945288), ((53175781139:ℚ)/27536375945288), ((-2174659022907:ℚ)/3933767992184), ((-2174659022907:ℚ)/3933767992184), ((-15328964722627:ℚ)/27536375945288), ((-15328964722627:ℚ)/27536375945288)], [((1243334860153:ℚ)/14859747), ((8447325757:ℚ)/707607), ((8447325757:ℚ)/707607), ((-2309275879409:ℚ)/14859747), ((-2309275879409:ℚ)/14859747), ((59605663111:ℚ)/4953249), ((-8445910543:ℚ)/707607), ((-8445910543:ℚ)/707607), ((-19814744447:ℚ)/550361), ((-19814744447:ℚ)/550361)], [(-15749:ℚ), (-2247:ℚ), (-2247:ℚ), (29251:ℚ), (29251:ℚ), (-2265:ℚ), (2247:ℚ), (2247:ℚ), (6777:ℚ), (6777:ℚ)], [(14:ℚ), (2:ℚ), (2:ℚ), (-26:ℚ), (-26:ℚ), (2:ℚ), (-2:ℚ), (-2:ℚ), (-6:ℚ), (-6:ℚ)], [(-1:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (2:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (-1:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (2:ℚ)], [(-1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (-1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ)]] +def A22_Y : Mat := [[(1:ℚ), (-1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (-1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(1:ℚ), (0:ℚ), (-1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), (-1:ℚ), (0:ℚ), (0:ℚ)], [((-1:ℚ)/2), ((-9:ℚ)/86), ((9:ℚ)/86), ((-9:ℚ)/86), ((9:ℚ)/86), ((-9:ℚ)/86), ((5:ℚ)/43), ((-5:ℚ)/43), ((5:ℚ)/43), ((-5:ℚ)/43)], [((-3039888818661:ℚ)/55072751890576), ((-6399683322687:ℚ)/55072751890576), ((6399683322687:ℚ)/55072751890576), ((-6399683322687:ℚ)/55072751890576), ((6399683322687:ℚ)/55072751890576), ((21136692622601:ℚ)/55072751890576), ((3555379623715:ℚ)/27536375945288), ((-3555379623715:ℚ)/27536375945288), ((3555379623715:ℚ)/27536375945288), ((-3555379623715:ℚ)/27536375945288)], [((-3185345:ℚ)/9906498), ((-1166224:ℚ)/1651083), ((1166224:ℚ)/1651083), ((-1166224:ℚ)/1651083), ((1166224:ℚ)/1651083), ((66445031:ℚ)/29719494), ((24975563:ℚ)/29719494), ((-24975563:ℚ)/29719494), ((24975563:ℚ)/29719494), ((-24975563:ℚ)/29719494)], [(-10:ℚ), (8:ℚ), (-8:ℚ), (8:ℚ), (-8:ℚ), (70:ℚ), ((-257:ℚ)/4), ((257:ℚ)/4), ((-257:ℚ)/4), ((257:ℚ)/4)], [(1:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (0:ℚ)], [(1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ)]] +def A22_st : List Stage := [⟨0, [0, 1, 5, 6]⟩, ⟨2, [0, 1, 2, 5, 6, 7]⟩, ⟨8, [0, 3, 4, 5, 8, 9]⟩, ⟨10, [0, 4, 5, 9]⟩] +def A22_pair : ℚ × ℚ := ((0:ℚ), (0:ℚ)) +def A22_rkG : List ℕ × List ℕ × Mat := ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [[(0:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), ((5729336827491:ℚ)/3442046993161), ((-152272177448:ℚ)/2122821), (11938:ℚ), (12:ℚ), (1:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (1:ℚ), ((1909473617686:ℚ)/3442046993161), ((-50617242928:ℚ)/2122821), (3968:ℚ), (4:ℚ), (0:ℚ), (1:ℚ)], [(-1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), ((-5729336827491:ℚ)/3442046993161), ((152272177448:ℚ)/2122821), (-11938:ℚ), (-12:ℚ), (-1:ℚ), (0:ℚ)], [(0:ℚ), (-1:ℚ), (0:ℚ), (0:ℚ), ((-1909473617686:ℚ)/3442046993161), ((50617242928:ℚ)/2122821), (-3968:ℚ), (-4:ℚ), (0:ℚ), (-1:ℚ)], [((-26:ℚ)/43), ((1:ℚ)/86), ((26:ℚ)/43), ((-1:ℚ)/86), (0:ℚ), ((3933767992184:ℚ)/91281303), ((-308404:ℚ)/43), ((-310:ℚ)/43), ((-26:ℚ)/43), ((1:ℚ)/86)], [((-335311637725:ℚ)/1966883996092), ((4035210579551:ℚ)/7867535984368), ((335311637725:ℚ)/1966883996092), ((-4035210579551:ℚ)/7867535984368), ((-21022983241:ℚ)/27536375945288), (0:ℚ), ((-10718123229:ℚ)/983441998046), ((11470926851:ℚ)/1966883996092), ((-335311637725:ℚ)/1966883996092), ((4035210579551:ℚ)/7867535984368)], [((-26970355:ℚ)/29719494), ((40567336:ℚ)/14859747), ((26970355:ℚ)/29719494), ((-40567336:ℚ)/14859747), ((-402267511600979687:ℚ)/102295894960966380534), ((-185636:ℚ)/550361), (0:ℚ), ((447214:ℚ)/14859747), ((-26970355:ℚ)/29719494), ((40567336:ℚ)/14859747)], [(-2:ℚ), ((23:ℚ)/4), (2:ℚ), ((-23:ℚ)/4), ((958400706575:ℚ)/6884093986322), ((-13495208060:ℚ)/2122821), (1060:ℚ), (0:ℚ), (-2:ℚ), ((23:ℚ)/4)], [(-1:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), ((5729336827491:ℚ)/3442046993161), ((-152272177448:ℚ)/2122821), (11938:ℚ), (12:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (-1:ℚ), (0:ℚ), (1:ℚ), ((1909473617686:ℚ)/3442046993161), ((-50617242928:ℚ)/2122821), (3968:ℚ), (4:ℚ), (0:ℚ), (0:ℚ)]]) +def A22_rkX : List ℕ × List ℕ × Mat := ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [[(2:ℚ), (0:ℚ), (-2:ℚ), (0:ℚ), ((-95:ℚ)/86), ((-1769509815497:ℚ)/7867535984368), ((-17651440:ℚ)/14859747), (8:ℚ), (0:ℚ), (0:ℚ)], [(-1:ℚ), (0:ℚ), (2:ℚ), (0:ℚ), ((95:ℚ)/86), ((1769509815497:ℚ)/7867535984368), ((17651440:ℚ)/14859747), (-8:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (-1:ℚ), (0:ℚ), ((-95:ℚ)/86), ((-1769509815497:ℚ)/7867535984368), ((-17651440:ℚ)/14859747), (8:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), ((-9:ℚ)/86), ((-912983286303:ℚ)/7867535984368), ((-345145:ℚ)/550361), (-12:ℚ), (-1:ℚ), (0:ℚ)], [(1:ℚ), (0:ℚ), (-1:ℚ), (0:ℚ), ((-1:ℚ)/2), ((-428263264597:ℚ)/7867535984368), ((-8332525:ℚ)/29719494), (10:ℚ), (1:ℚ), (0:ℚ)], [(0:ℚ), (2:ℚ), (0:ℚ), (-2:ℚ), ((-4:ℚ)/43), ((881999410679:ℚ)/983441998046), ((139909561:ℚ)/29719494), ((-257:ℚ)/4), (0:ℚ), (0:ℚ)], [(0:ℚ), (-1:ℚ), (0:ℚ), (2:ℚ), ((4:ℚ)/43), ((-881999410679:ℚ)/983441998046), ((-139909561:ℚ)/29719494), ((257:ℚ)/4), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (-1:ℚ), ((-4:ℚ)/43), ((881999410679:ℚ)/983441998046), ((139909561:ℚ)/29719494), ((-257:ℚ)/4), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), ((5:ℚ)/43), ((507212936835:ℚ)/3933767992184), ((7453261:ℚ)/9906498), ((303:ℚ)/4), (0:ℚ), (-1:ℚ)], [(0:ℚ), (1:ℚ), (0:ℚ), (-1:ℚ), ((-9:ℚ)/86), ((3020784705881:ℚ)/7867535984368), ((58774889:ℚ)/29719494), (-70:ℚ), (0:ℚ), (1:ℚ)]]) +def A22_rkY : List ℕ × List ℕ × Mat := ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [[(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), ((-45823564805271:ℚ)/27536375945288), ((-25421040545:ℚ)/2122821), (1993:ℚ), (2:ℚ), (0:ℚ), (0:ℚ)], [(-1:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), ((-45823564805271:ℚ)/27536375945288), ((-25421040545:ℚ)/2122821), (1993:ℚ), (2:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (-1:ℚ), (0:ℚ), ((-45823564805271:ℚ)/27536375945288), ((-25421040545:ℚ)/2122821), (1993:ℚ), (2:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), ((45823564805271:ℚ)/27536375945288), ((25421040545:ℚ)/2122821), (-1993:ℚ), (-2:ℚ), (1:ℚ), (0:ℚ)], [(-1:ℚ), (0:ℚ), (1:ℚ), (0:ℚ), ((91658259425199:ℚ)/27536375945288), ((-14094570767:ℚ)/235869), (9945:ℚ), (10:ℚ), (1:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), ((-15328964722627:ℚ)/27536375945288), ((25425286187:ℚ)/2122821), (-1993:ℚ), (-2:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (-1:ℚ), (0:ℚ), (0:ℚ), ((-15328964722627:ℚ)/27536375945288), ((25425286187:ℚ)/2122821), (-1993:ℚ), (-2:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (-1:ℚ), ((-15328964722627:ℚ)/27536375945288), ((25425286187:ℚ)/2122821), (-1993:ℚ), (-2:ℚ), (0:ℚ), (0:ℚ)], [(0:ℚ), (0:ℚ), (0:ℚ), (0:ℚ), ((15328964722627:ℚ)/27536375945288), ((-25425286187:ℚ)/2122821), (1993:ℚ), (2:ℚ), (0:ℚ), (1:ℚ)], [(0:ℚ), (-1:ℚ), (0:ℚ), (1:ℚ), ((30604753664115:ℚ)/27536375945288), ((-25347509705:ℚ)/707607), (5961:ℚ), (6:ℚ), (0:ℚ), (1:ℚ)]]) + +end SmallRoots diff --git a/research/p104-lean-premises/lean/Nov15/SmallRootsDefs.lean b/research/p104-lean-premises/lean/Nov15/SmallRootsDefs.lean new file mode 100644 index 0000000000..ca30fe729f --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SmallRootsDefs.lean @@ -0,0 +1,92 @@ +/- +(Nov 17): definitions for the SMALLCALLER root conditions (algebraic core). See SmallRoots.md. +Matrices are lists of rows over ℚ; every condition is a decidable Prop, so `decide +kernel` checks it. +Source of truth for the list of conditions: internal notes (check), cited per definition, +which AUDIT1.md:(1)-(2) verified against root_check_h.py (SPEC-level lines). +-/ +import Mathlib.Data.Rat.Defs +import Mathlib.Algebra.BigOperators.Group.List.Basic +namespace SmallRoots + +abbrev Mat := List (List ℚ) + +/-- one stage = a consecutive pair of units (u0, u0+1) inside a coordinate mask (rc.py:ST[i]['units'],['mask']). -/ +structure Stage where + u0 : ℕ + mask : List ℕ + +def dotv (a b : List ℚ) : ℚ := (List.zipWith (· * ·) a b).sum +def idMat (n : ℕ) : Mat := (List.range n).map fun i => (List.range n).map fun j => if i = j then 1 else 0 +def negIdMat (n : ℕ) : Mat := (List.range n).map fun i => (List.range n).map fun j => if i = j then -1 else 0 +def col (W : Mat) (j : ℕ) : List ℚ := W.map fun r => r.getD j 0 +/-- left action of the unit T = I - 2 x yᵀ: W ↦ T W = W - 2 x (yᵀ W) (rc.py lines "W = [[W[i][j] - 2*X[k][i]*d[j]"). -/ +def applyUnit (n : ℕ) (x y : List ℚ) (W : Mat) : Mat := + let d := (List.range n).map fun j => dotv y (col W j) + (List.zipWith (fun xi row => List.zipWith (fun w dj => w - 2 * xi * dj) row d) x W) +/-- prefix product T_{k-1} ⋯ T_0 (rc.py `pre[k]`). -/ +def pref (n : ℕ) (X Y : Mat) (k : ℕ) : Mat := + ((List.zip X Y).take k).foldl (fun W p => applyUnit n p.1 p.2 W) (idMat n) + +/-- W commutes with the coordinate projector onto `mask` (rc.py `comm`). -/ +def commMask (n : ℕ) (mask : List ℕ) (W : Mat) : Prop := + ∀ i ∈ List.range n, ∀ j ∈ List.range n, (i ∈ mask ↔ ¬ j ∈ mask) → (W.getD i []).getD j 0 = 0 +instance (n mask W) : Decidable (commMask n mask W) := by unfold commMask; infer_instance + +/-- rc.py 'units inside mask'. -/ +def inMask (n : ℕ) (X Y : Mat) (s : Stage) : Prop := + ∀ u ∈ [s.u0, s.u0 + 1], ∀ c ∈ List.range n, ¬ c ∈ s.mask → (X.getD u []).getD c 0 = 0 ∧ (Y.getD u []).getD c 0 = 0 +instance (n X Y s) : Decidable (inMask n X Y s) := by unfold inMask; infer_instance + +/-- All 0/1 assignments to `L` stage variables. -/ +def bits : ℕ → List (List ℚ) + | 0 => [[]] + | L + 1 => (bits L).flatMap fun b => [0 :: b, 1 :: b] + +/-- Symbolic endpoint M(D) evaluated at a numeric D: run the units in time order; right after the second unit of +stage i, multiply the rows of the coordinates in mask_i by D_i (rc.py section "symbolic endpoint"). -/ +def scaleAfter (idx : ℕ) (st : List Stage) (D : List ℚ) (V : Mat) : Mat := + (List.zip st D).foldl (fun V p => if p.1.u0 + 1 = idx then + (V.zipIdx.map fun rd => if rd.2 ∈ p.1.mask then rd.1.map (· * p.2) else rd.1) else V) V +def Mend (n : ℕ) (X Y : Mat) (st : List Stage) (D : List ℚ) : Mat := + (List.range X.length).foldl (fun W idx => + scaleAfter idx st D (applyUnit n (X.getD idx []) (Y.getD idx []) W)) (idMat n) +/-- target -diag(∏_{i : r ∈ mask_i} D_i) (rc.py `tgt`). -/ +def tgtD (n : ℕ) (st : List Stage) (D : List ℚ) : Mat := + (List.range n).map fun r => (List.range n).map fun c => + if r = c then -((List.zip st D).map fun p => if r ∈ p.1.mask then p.2 else 1).prod else 0 + +/-- Certificate that a matrix A has rank ≥ n: rows rs, columns cs (n each, distinct) and an exact inverse B of the minor. -/ +def rankCert (n : ℕ) (A : Mat) (c : List ℕ × List ℕ × Mat) : Prop := + c.1.length = n ∧ c.2.1.length = n ∧ c.1.Nodup ∧ c.2.1.Nodup ∧ + (c.1.map fun i => ((c.2.1.map fun j => (A.getD i []).getD j 0))).map + (fun r => (List.range n).map fun j => dotv r (col c.2.2 j)) = idMat n +instance (n A c) : Decidable (rankCert n A c) := by unfold rankCert; infer_instance + +def gram (X Y : Mat) : Mat := Y.map fun y => X.map fun x => dotv y x +/-- Reachability from vertex 0 in the Gram digraph (edge u→v iff G[v][u] ≠ 0 when fw, else G[u][v] ≠ 0): N rounds of closure. -/ +def reach (G : Mat) (fw : Bool) : List ℕ := + let N := G.length + (List.range N).foldl (fun S _ => (List.range N).filter fun v => + v ∈ S ∨ ∃ u ∈ S, (if fw then (G.getD v []).getD u 0 else (G.getD u []).getD v 0) ≠ 0) [0] + +/-- The root conditions of SMALLCALLER rc.py `check`, for a k-stage two-arm root with N = n+2 units. -/ +structure IsRoot (n : ℕ) (X Y : Mat) (st : List Stage) (pair : ℚ × ℚ) : Prop where + shape : X.length = n + 2 ∧ Y.length = n + 2 ∧ (∀ r ∈ X, r.length = n) ∧ ∀ r ∈ Y, r.length = n + isotropy : ∀ p ∈ List.zip X Y, dotv p.2 p.1 = 0 -- rc.py 'isotropy' + nonzero : ∀ p ∈ List.zip X Y, (∃ v ∈ p.1, v ≠ 0) ∧ ∃ v ∈ p.2, v ≠ 0 -- 'nonzero' + product : pref n X Y (n + 2) = negIdMat n -- 'product=-I' + stages_ordered : (st.map (·.u0)).Pairwise (fun a b => a + 1 < b) ∧ ∀ s ∈ st, s.u0 + 1 < n + 2 + -- 'stage units disjoint/consecutive/ordered' + inside : ∀ s ∈ st, inMask n X Y s -- 'units inside mask' + mask_before : ∀ s ∈ st, commMask n s.mask (pref n X Y s.u0) -- 'mask|prefix before' + mask_after : ∀ s ∈ st, commMask n s.mask (pref n X Y (s.u0 + 2)) -- 'mask|prefix after' + symbolic : ∀ D ∈ bits st.length, Mend n X Y st D = tgtD n st D -- 'symbolic M(D)=-diag(prod D^eps)' (corners) + pairs : ∀ s ∈ st, (dotv (Y.getD s.u0 []) (X.getD (s.u0 + 1) []), dotv (Y.getD (s.u0 + 1) []) (X.getD s.u0 [])) = pair + -- 'pair (alpha,beta)' + rankG : ∃ c, rankCert n (gram X Y) c -- 'rank G=n' (lower bound; ≤ n since G = Y Xᵀ) + spanX : ∃ c, rankCert n X c -- 'x span' (rank X = n) + spanY : ∃ c, rankCert n Y c -- 'y span' + connected : (reach (gram X Y) true).length = n + 2 ∧ (reach (gram X Y) false).length = n + 2 + -- 'Gram strongly connected' + +end SmallRoots diff --git a/research/p104-lean-premises/lean/Nov15/Spec0K0.md b/research/p104-lean-premises/lean/Nov15/Spec0K0.md new file mode 100644 index 0000000000..8cad35113a --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0K0.md @@ -0,0 +1,5 @@ +# Spec0K0*.lean: spec-break survivor #0, k = 0 radical certificates +Core: `Spec0K0Core.lean` (explicit 4x4 matrices, jobs MJ, flags MEm/MFm, omega, LLm = (DU)^2 - I, Rel, Kill). Field K, CharZero (needed: certificates have denominators 2^k). +Pipeline (internal notes): gen7-style model -> Singular `lift` of 1 = c0 (1 - t f) + sum c_k g_k over Q for each target f (4 omegas + 64 entries of (D_mu U_mu)^2 - I) -> Lean: by_contra, t = f^-1, `linear_combination` with the cofactors (each c_k g_k separate `have` via mul_eq_zero_of_right to keep elaboration small). One certificate per CLASS, over the whole ideal J (W3 = Z4, W7 = I, unit blocks, job relations): f in rad(J) iff f vanishes on every component, so this is equivalent to (and replaces) the 292 per-component tests. +Class ABCEDF (the audited one, 4 components): 68 targets: 28 are identically zero polynomials (`ring`), 32 certified by radical certificates (files Spec0K0_ABCEDF_s0..s6.lean, each 34-81 s, <= 2.7 GB, axioms [propext, Classical.choice, Quot.sound]), 8 NOT certified: omega_1, omega_2, omega_5, omega_6 and the four (1,4) entries (equal to omega-type polynomials). Singular proves all 8 are in J itself (m = 1) in the 31-variable ring, and in rad(J) with W7, U5, U6 dropped (om1: 36 nonzero cofactors, 3.8k terms; with prefix-product node variables 65 cofactors, 327 KB), but Lean `ring` on any of these identities exceeds the 3.5 GB guard (flat base ring: 86-200 KB per certificate; node form: elaboration fixed by splitting, ring still > 3.5 GB). Coverage: classes 0.9 of 90 (ABCEDF at 60/68 targets); batching other classes would only add the same 60/68 and was not run. +Next step (not done): a reflective polynomial-identity checker (monomials as sorted index lists, kernel `decide`) or staged Groebner-chain certificates with small cofactors for the four omega identities. diff --git a/research/p104-lean-premises/lean/Nov15/Spec0K0Core.lean b/research/p104-lean-premises/lean/Nov15/Spec0K0Core.lean new file mode 100644 index 0000000000..ee26cbfbd8 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0K0Core.lean @@ -0,0 +1,80 @@ +/- +core definitions for the k = 0 radical checks of SPECBREAK survivor #0 (RB6 step 4). +4x4 matrices as explicit 16-field structures (no Mathlib Matrix), jobs M_c = [[1,p,pq/2],[0,j,-q],[0,0,1]], +j = [[a,b],[c,-a]], E = diag(1,jE,1), F = diag(1,-jE,1). +-/ +import Mathlib.Tactic.Ring +import Mathlib.Tactic.LinearCombination +import Mathlib.Algebra.Field.Defs +import Mathlib.Algebra.GroupWithZero.Basic + +namespace Spec0K0 + +@[ext] structure M4 (K : Type*) where + (m11 m12 m13 m14 : K) + (m21 m22 m23 m24 : K) + (m31 m32 m33 m34 : K) + (m41 m42 m43 m44 : K) + +variable {K : Type*} [Field K] + +/-- matrix product, written out entrywise -/ +def mm (A B : M4 K) : M4 K where + m11 := A.m11*B.m11 + A.m12*B.m21 + A.m13*B.m31 + A.m14*B.m41 + m12 := A.m11*B.m12 + A.m12*B.m22 + A.m13*B.m32 + A.m14*B.m42 + m13 := A.m11*B.m13 + A.m12*B.m23 + A.m13*B.m33 + A.m14*B.m43 + m14 := A.m11*B.m14 + A.m12*B.m24 + A.m13*B.m34 + A.m14*B.m44 + m21 := A.m21*B.m11 + A.m22*B.m21 + A.m23*B.m31 + A.m24*B.m41 + m22 := A.m21*B.m12 + A.m22*B.m22 + A.m23*B.m32 + A.m24*B.m42 + m23 := A.m21*B.m13 + A.m22*B.m23 + A.m23*B.m33 + A.m24*B.m43 + m24 := A.m21*B.m14 + A.m22*B.m24 + A.m23*B.m34 + A.m24*B.m44 + m31 := A.m31*B.m11 + A.m32*B.m21 + A.m33*B.m31 + A.m34*B.m41 + m32 := A.m31*B.m12 + A.m32*B.m22 + A.m33*B.m32 + A.m34*B.m42 + m33 := A.m31*B.m13 + A.m32*B.m23 + A.m33*B.m33 + A.m34*B.m43 + m34 := A.m31*B.m14 + A.m32*B.m24 + A.m33*B.m34 + A.m34*B.m44 + m41 := A.m41*B.m11 + A.m42*B.m21 + A.m43*B.m31 + A.m44*B.m41 + m42 := A.m41*B.m12 + A.m42*B.m22 + A.m43*B.m32 + A.m44*B.m42 + m43 := A.m41*B.m13 + A.m42*B.m23 + A.m43*B.m33 + A.m44*B.m43 + m44 := A.m41*B.m14 + A.m42*B.m24 + A.m43*B.m34 + A.m44*B.m44 + +infixl:70 " ⊗ " => mm + +def diag4 (a b c d : K) : M4 K := ⟨a,0,0,0, 0,b,0,0, 0,0,c,0, 0,0,0,d⟩ +def Z4 : M4 K := diag4 1 (-1) (-1) 1 +def I4 : M4 K := diag4 1 1 1 1 +def zero4 : M4 K := diag4 0 0 0 0 +/-- generic element of the unitriangular-block shape (1 | * * * ; 0 | 2x2 | * ; 0 0 0 1) -/ +def nd (x12 x13 x14 x22 x23 x24 x32 x33 x34 : K) : M4 K := + ⟨1,x12,x13,x14, 0,x22,x23,x24, 0,x32,x33,x34, 0,0,0,1⟩ + +/-- job letter A..D -/ +def MJ (a b c p1 p2 q1 q2 : K) : M4 K := + ⟨1,p1,p2,(p1*q1+p2*q2)/2, 0,a,b,-q1, 0,c,-a,-q2, 0,0,0,1⟩ +def MEm (e1 e2 e3 : K) : M4 K := ⟨1,0,0,0, 0,e1,e2,0, 0,e3,-e1,0, 0,0,0,1⟩ +def MFm (e1 e2 e3 : K) : M4 K := ⟨1,0,0,0, 0,-e1,-e2,0, 0,-e3,e1,0, 0,0,0,1⟩ + +/-- the five defining relations of a job (j² = 1, p(I+j)=0, (I+j)q=0), as polynomial = 0 -/ +def JobOK (a b c p1 p2 q1 q2 : K) : Prop := + a^2 + b*c - 1 = 0 ∧ p1*(1+a) + p2*c = 0 ∧ p1*b + p2*(1-a) = 0 ∧ + (1+a)*q1 + b*q2 = 0 ∧ c*q1 + (1-a)*q2 = 0 +def EpsOK (e1 e2 e3 : K) : Prop := e1^2 + e2*e3 - 1 = 0 + +/-- ω_μ = 2 U₁₄ − d₁ U₁₂ U₂₄ − d₂ U₁₃ U₃₄ -/ +def omega (d1 d2 : K) (U : M4 K) : K := 2*U.m14 - d1*U.m12*U.m24 - d2*U.m13*U.m34 +/-- (D U)² − I with D = diag(−1,d₁,d₂,−1) -/ +def LLm (d1 d2 : K) (U : M4 K) : M4 K := + mm (mm (mm (diag4 (-1) d1 d2 (-1)) U) (diag4 (-1) d1 d2 (-1))) U |> fun X => ⟨X.m11-1,X.m12,X.m13,X.m14, X.m21,X.m22-1,X.m23,X.m24, X.m31,X.m32,X.m33-1,X.m34, X.m41,X.m42,X.m43,X.m44-1⟩ + +/-- the four unit-block relations: lower-right 2x2 block of U equals diag(d1,d2) -/ +def UnitRel (d1 d2 : K) (U : M4 K) : Prop := U.m22 = d1 ∧ U.m23 = 0 ∧ U.m32 = 0 ∧ U.m33 = d2 + +/-- relations of a class: W3 = diag(1,-1,-1,1), W7 = I, units μ=1,2,5,6 -/ +def Rel (w3 w7 u1 u2 u5 u6 : M4 K) : Prop := + w3 = Z4 ∧ w7 = I4 ∧ UnitRel (-1) 1 u1 ∧ UnitRel 1 (-1) u2 ∧ UnitRel 1 (-1) u5 ∧ UnitRel (-1) 1 u6 + +/-- kill conclusion for one unit: ω = 0 and (DU)² = I -/ +def KU (d1 d2 : K) (U : M4 K) : Prop := omega d1 d2 U = 0 ∧ LLm d1 d2 U = zero4 +def Kill (u1 u2 u5 u6 : M4 K) : Prop := + KU (-1) 1 u1 ∧ KU 1 (-1) u2 ∧ KU 1 (-1) u5 ∧ KU (-1) 1 u6 + +end Spec0K0 diff --git a/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s0.lean b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s0.lean new file mode 100644 index 0000000000..b1686d8d39 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s0.lean @@ -0,0 +1,202 @@ +/- k=0 radical certificates, class ABCEDF (generated by internal notes from Singular `lift`). -/ +import Nov15.Spec0K0Core +namespace Spec0K0 +variable {K : Type*} [Field K] [CharZero K] + +theorem ll1_11_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m11 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll1_21_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m21 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll1_31_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m31 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll1_41_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m41 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll1_42_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m42 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll1_43_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m43 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll1_44_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m44 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll2_11_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m11 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll2_21_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m21 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll2_31_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m31 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll2_41_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m41 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll2_42_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m42 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll2_43_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m43 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll2_44_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m44 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll5_11_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m11 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll5_21_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m21 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll5_31_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m31 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll5_41_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m41 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll5_42_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m42 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll5_43_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m43 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll5_44_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m44 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll6_11_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m11 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll6_21_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m21 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll6_31_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m31 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll6_41_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m41 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll6_42_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m42 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll6_43_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m43 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +theorem ll6_44_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m44 = 0 := by + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] + ring +end Spec0K0 diff --git a/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s1.lean b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s1.lean new file mode 100644 index 0000000000..3246190914 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s1.lean @@ -0,0 +1,162 @@ +/- k=0 radical certificates, class ABCEDF (generated by internal notes from Singular `lift`). -/ +import Nov15.Spec0K0Core +namespace Spec0K0 +variable {K : Type*} [Field K] [CharZero K] + +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll1_12_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m12 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m12) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-4*aA^2*pA2*aB*e3*t-4*bA*cA*pA2*aB*e3*t+aA*bA*aB*pB1*e3*t+bA*cA*bB*pB1*e3*t-bA*cA*aB*pB2*e3*t+aA*bA*cB*pB2*e3*t+bA*aB*pB1*e1*e3*t-aA*bB*pB1*e1*e3*t+aA*aB*pB2*e1*e3*t+bA*cB*pB2*e1*e3*t+aA*aB*pB1*e2*e3*t+cA*bB*pB1*e2*e3*t-cA*aB*pB2*e2*e3*t+aA*cB*pB2*e2*e3*t+aA*pA1*aB^2*t-cA*pA2*aB^2*t+aA*pA1*bB*cB*t-cA*pA2*bB*cB*t-aA*pA1*aB*e1*t-cA*pA2*aB*e1*t-bA*pA1*cB*e1*t+aA*pA2*cB*e1*t+cA*pA1*aB*e2*t-aA*pA1*cB*e2*t+2*bA*pA1*aB*e3*t+aA*pA2*aB*e3*t-2*aA*pA1*bB*e3*t+cA*pA2*bB*e3*t-pB2*e3*t+pA1*t) * hE + (-cA*pA1*aB*cB*e2^2*t-cA*pA2*cB^2*e2^2*t+cA*pA1*aB*bB*e2*e3*t+aA*pA2*aB*cB*e2*e3*t+3*cA*pA2*bB*cB*e2*e3*t-bA*pA2*cB^2*e2*e3*t-aA*pA2*aB*bB*e3^2*t-2*cA*pA2*bB^2*e3^2*t+bA*pA2*bB*cB*e3^2*t+pA1*aB*cB*e1*e2*t+pA2*cB^2*e1*e2*t-aA*cB*pB1*e1*e2*t-cA*cB*pB2*e1*e2*t-pA1*cB^2*e2^2*t+3*pA1*aB*bB*e1*e3*t+3*pA2*bB*cB*e1*e3*t-4*pA1*aB^2*e2*e3*t-2*pA2*aB*cB*e2*e3*t-pA1*bB*cB*e2*e3*t+aA*aB*pB1*e2*e3*t+bA*cB*pB1*e2*e3*t+cA*aB*pB2*e2*e3*t-aA*cB*pB2*e2*e3*t-2*pA2*aB*bB*e3^2*t+2*pA1*bB^2*e3^2*t-bA*bB*pB1*e3^2*t+aA*bB*pB2*e3^2*t-2*pA2*cB*e1*t+pA1*cB*e2*t-2*pA2*aB*e3*t-pA1*bB*e3*t) * hA0 + (aB*cB*e1*e2*t-cB^2*e2^2*t+3*aB*bB*e1*e3*t+3*bB*cB*e2*e3*t+2*bB^2*e3^2*t-aB*e1*t-cB*e2*t-2*bB*e3*t-2*e2*e3*t+t) * hA1 + (cB^2*e1*e2*t+3*bB*cB*e1*e3*t-2*aB*cB*e2*e3*t-2*aB*bB*e3^2*t-cB*e1*t-aB*e3*t-2*e1*e3*t) * hA2 + (-cA*pA1*e1*e2*t-bA*pA1*e1*e3*t-2*aA*pA2*e1*e3*t-2*aA*pA1*e2*e3*t+cA*pA2*e2*e3*t+bA*pA2*e3^2*t-4*pA1*e2*e3*t+aA*pA1*t-cA*pA2*t) * hB0 + (-cA*e1*e2*t+aA*bA*e3*t) * hB1 + (bA*cA*e3*t-bA*e3^2*t) * hB2 + (-aA*cA*pA1*aB*e2*t-aA*cA*pA2*cB*e2*t+aA^2*pA2*aB*e3*t+2*aA*cA*pA2*bB*e3*t-aA*bA*pA2*cB*e3*t-aA^2*pB1*e1*t-aA*cA*pB2*e1*t+aA*pA1*e1^2*t-aA*pB1*e1^2*t-cA*pA1*aB*e2*t-aA*pA1*cB*e2*t-cA*pA2*cB*e2*t+cA*pA1*e1*e2*t-cA*pB1*e1*e2*t-aA*pA2*aB*e3*t-2*aA*pA1*bB*e3*t-3*cA*pA2*bB*e3*t+aA*bA*pB1*e3*t-aA^2*pB2*e3*t+aA*pA2*e1*e3*t-pB2*e1^2*e3*t-3*cA*pA2*e2*e3*t+pB1*e1*e2*e3*t-pA1*aB*e1*t+pA2*cB*e1*t+pA1*e1^2*t-3*pA1*cB*e2*t-pA1*bB*e3*t+2*pA1*e2*e3*t+aA*pA1*t+2*cA*pA2*t+pB1*e1*t+2*pB2*e3*t) * hu5_22 + (cA^2*pA1*aB*e2*t+cA^2*pA2*cB*e2*t-aA*cA*pA2*aB*e3*t-2*cA^2*pA2*bB*e3*t+bA*cA*pA2*cB*e3*t+aA*cA*pB1*e1*t+cA^2*pB2*e1*t-cA*pA1*e1^2*t+cA*pB1*e1^2*t+cA*pA1*cB*e2*t+3*aA*pA1*aB*e3*t+cA*pA2*aB*e3*t+2*cA*pA1*bB*e3*t-aA^2*pB1*e3*t-bA*cA*pB1*e3*t+aA*pA1*e1*e3*t+3*cA*pA2*e1*e3*t-aA*pB1*e1*e3*t-pB1*e1^2*e3*t+aA*pA2*e3^2*t-pB2*e1*e3^2*t+2*pA1*cB*e1*t-pA1*aB*e3*t-pA2*cB*e3*t-pA1*e1*e3*t-cA*pA1*t+pB1*e3*t) * hu5_23 + (-bA*cA*pA1*aB*e2*t-bA*cA*pA2*cB*e2*t+aA*bA*pA2*aB*e3*t+2*bA*cA*pA2*bB*e3*t-bA^2*pA2*cB*e3*t-aA*bA*pB1*e1*t-bA*cA*pB2*e1*t+bA*pA1*e1^2*t-bA*pB1*e1^2*t+aA*pA1*aB*e2*t-bA*pA1*cB*e2*t+aA*pA2*cB*e2*t-aA*pA1*e1*e2*t+aA*pB1*e1*e2*t-bA*pA2*aB*e3*t-2*bA*pA1*bB*e3*t+3*aA*pA2*bB*e3*t+bA^2*pB1*e3*t-aA*bA*pB2*e3*t+bA*pA2*e1*e3*t+bA*pB2*e1*e3*t+3*aA*pA2*e2*e3*t-bA*pB1*e2*e3*t+pB2*e1*e2*e3*t-pB1*e2^2*e3*t+pA2*e1^2*t+pA1*aB*e2*t-pA2*cB*e2*t-pA1*e1*e2*t-4*pA2*bB*e3*t-pA2*e2*e3*t+bA*pA1*t-2*aA*pA2*t+pB2*e1*t) * hu5_32 + (-aA*cA*pA1*aB*e2*t-aA*cA*pA2*cB*e2*t+aA^2*pA2*aB*e3*t+2*aA*cA*pA2*bB*e3*t-aA*bA*pA2*cB*e3*t-aA^2*pB1*e1*t-aA*cA*pB2*e1*t+aA*pA1*e1^2*t-aA*pB1*e1^2*t-aA*pA1*cB*e2*t+3*bA*pA1*aB*e3*t-aA*pA2*aB*e3*t-2*aA*pA1*bB*e3*t-aA^2*pB2*e3*t-bA*cA*pB2*e3*t+bA*pA1*e1*e3*t-3*aA*pA2*e1*e3*t+pB1*e1*e2*e3*t+bA*pA2*e3^2*t+bA*pB2*e3^2*t+pB2*e2*e3^2*t-pA1*aB*e1*t-pA2*cB*e1*t-pA1*cB*e2*t-pA1*bB*e3*t+2*pA2*e1*e3*t-pA1*e2*e3*t+aA*pA1*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll1_13_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m13 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m13) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (4*aA^2*pA2*aB*e1*t+4*bA*cA*pA2*aB*e1*t+2*aA^2*aB*pB2*e1*t+2*bA*cA*aB*pB2*e1*t-2*aA^2*aB*pB1*e2*t-2*bA*cA*aB*pB1*e2*t+bA^2*aB*pB1*e3*t-aA*bA*bB*pB1*e3*t+aA*bA*aB*pB2*e3*t+bA^2*cB*pB2*e3*t+bA*pA1*aB^2*t+5*aA*pA2*aB^2*t+bA*pA1*bB*cB*t+5*aA*pA2*bB*cB*t+2*aA*aB^2*pB2*t+2*aA*bB*cB*pB2*t-bA*pA1*aB*e1*t+aA*pA2*aB*e1*t+aA*pA1*bB*e1*t+cA*pA2*bB*e1*t-3*aA*pA1*aB*e2*t-2*cA*pA2*aB*e2*t-cA*pA1*bB*e2*t-2*bA*pA1*cB*e2*t+2*aA*pA2*cB*e2*t+bA*pA2*aB*e3*t-aA*pA2*bB*e3*t-4*aA*pA2*t-2*aA*pB2*t-pA2*t) * hE + (-cA*pA2*aB*cB*e2^2*t-cA*pA1*bB*cB*e2^2*t+2*aA*pA2*cB^2*e2^2*t+cA*pA2*aB*bB*e2*e3*t+cA*pA1*bB^2*e2*e3*t+bA*pA2*aB*cB*e2*e3*t-3*aA*pA2*bB*cB*e2*e3*t-bA*pA2*aB*bB*e3^2*t+aA*pA2*bB^2*e3^2*t+pA2*aB*cB*e1*e2*t-pA1*bB*cB*e1*e2*t-bA*cB*pB1*e1*e2*t+aA*cB*pB2*e1*e2*t+pA1*aB*cB*e2^2*t-aA*cB*pB1*e2^2*t-cA*cB*pB2*e2^2*t+pA2*aB*bB*e1*e3*t-pA1*bB^2*e1*e3*t-2*pA2*aB^2*e2*e3*t+pA1*aB*bB*e2*e3*t+bA*aB*pB1*e2*e3*t+aA*bB*pB1*e2*e3*t-aA*aB*pB2*e2*e3*t+cA*bB*pB2*e2*e3*t+4*pA2*aB*e1*t+2*pA1*bB*e1*t+2*aB*pB2*e1*t-2*pA1*aB*e2*t+3*pA2*cB*e2*t-2*aB*pB1*e2*t-3*pA2*bB*e3*t) * hA0 + (-bB*cB*e1*e2*t+aB*cB*e2^2*t-bB^2*e1*e3*t+aB*bB*e2*e3*t+bB*e1*t-3*aB*e2*t+2*e1*e2*t) * hA1 + (aB*cB*e1*e2*t+aB*bB*e1*e3*t+2*bB*cB*e2*e3*t-aB*e1*t-2*cB*e2*t+bB*e3*t-2*e2*e3*t-t) * hA2 + (2*aA*pA1*e1*e2*t-cA*pA2*e1*e2*t-cA*pA1*e2^2*t-bA*pA2*e1*e3*t-bA*pA1*e2*e3*t-2*aA*pA2*e2*e3*t-2*pA2*e2*e3*t+bA*pA1*t+5*aA*pA2*t+2*aA*pB2*t) * hB0 + (2*aA*e1*e2*t-cA*e2^2*t+bA^2*e3*t-2*e2*t) * hB1 + (cA*e1*e2*t-aA*bA*e3*t+2*aA*e2*e3*t) * hB2 + (-aA*cA*pA2*aB*e2*t-aA*cA*pA1*bB*e2*t+2*aA^2*pA2*cB*e2*t+aA*bA*pA2*aB*e3*t-aA^2*pA2*bB*e3*t-aA*bA*pB1*e1*t+aA^2*pB2*e1*t-aA*pA2*e1^2*t-aA*pB2*e1^2*t+aA*pA1*aB*e2*t-cA*pA2*aB*e2*t+cA*pA1*bB*e2*t-aA^2*pB1*e2*t-aA*cA*pB2*e2*t+aA*pA1*e1*e2*t+3*cA*pA2*e1*e2*t+aA*pB1*e1*e2*t+cA*pB2*e1*e2*t+cA*pA1*e2^2*t-cA*pB1*e2^2*t-bA*pB2*e1*e3*t+bA*pB1*e2*e3*t-7*pA2*aB*e1*t-pA1*bB*e1*t-2*aB*pB2*e1*t-7*pA2*cB*e2*t-2*cB*pB2*e2*t+pA1*e1*e2*t+pA2*bB*e3*t+pA2*e2*e3*t+3*aA*pA2*t-pB1*e2*t) * hu5_22 + (cA^2*pA2*aB*e2*t+cA^2*pA1*bB*e2*t-2*aA*cA*pA2*cB*e2*t-bA*cA*pA2*aB*e3*t+aA*cA*pA2*bB*e3*t+bA*cA*pB1*e1*t-aA*cA*pB2*e1*t-3*cA*pA2*e1^2*t-cA*pB2*e1^2*t-cA*pA1*aB*e2*t+aA*cA*pB1*e2*t+cA^2*pB2*e2*t-cA*pA1*e1*e2*t+cA*pB1*e1*e2*t+aA*pA2*aB*e3*t-aA*pA1*bB*e3*t-aA*bA*pB1*e3*t+aA^2*pB2*e3*t-aA*pA2*e1*e3*t-bA*pB1*e1*e3*t-aA*pB2*e1*e3*t+aA*pA1*e2*e3*t+aA*pB1*e2*e3*t-bA*pB2*e3^2*t+8*pA2*cB*e1*t+2*cB*pB2*e1*t+pA1*e1^2*t-7*pA2*aB*e3*t-pA1*bB*e3*t-2*aB*pB2*e3*t-pA2*e1*e3*t+2*pA1*e2*e3*t+2*aA*pA1*t-3*cA*pA2*t+pB1*e1*t+pB2*e3*t) * hu5_23 + (-bA*cA*pA2*aB*e2*t-bA*cA*pA1*bB*e2*t+2*aA*bA*pA2*cB*e2*t+bA^2*pA2*aB*e3*t-aA*bA*pA2*bB*e3*t-bA^2*pB1*e1*t+aA*bA*pB2*e1*t-bA*pA2*e1^2*t-bA*pB2*e1^2*t+bA*pA1*aB*e2*t+aA*pA2*aB*e2*t-aA*pA1*bB*e2*t-aA*bA*pB1*e2*t-bA*cA*pB2*e2*t+bA*pA1*e1*e2*t-3*aA*pA2*e1*e2*t+bA*pB1*e1*e2*t-aA*pB2*e1*e2*t-aA*pA1*e2^2*t+aA*pB1*e2^2*t-2*pA2*bB*e1*t+3*pA2*aB*e2*t+pA1*bB*e2*t+pA2*e1*e2*t+pA1*e2^2*t+3*bA*pA2*t+pB2*e2*t) * hu5_32 + (-aA*cA*pA2*aB*e2*t-aA*cA*pA1*bB*e2*t+2*aA^2*pA2*cB*e2*t+aA*bA*pA2*aB*e3*t-aA^2*pA2*bB*e3*t-aA*bA*pB1*e1*t+aA^2*pB2*e1*t+3*aA*pA2*e1^2*t+aA*pB2*e1^2*t+aA*pA1*aB*e2*t-aA^2*pB1*e2*t-aA*cA*pB2*e2*t+aA*pA1*e1*e2*t-aA*pB1*e1*e2*t+bA*pA2*aB*e3*t-bA*pA1*bB*e3*t-bA^2*pB1*e3*t+aA*bA*pB2*e3*t-bA*pA2*e1*e3*t-bA*pB2*e1*e3*t+bA*pA1*e2*e3*t+bA*pB1*e2*e3*t-3*pA2*aB*e1*t+pA1*bB*e1*t+pA2*e1^2*t-3*pA2*cB*e2*t-pA1*e1*e2*t-3*pA2*bB*e3*t+2*pA2*e2*e3*t+2*bA*pA1*t+3*aA*pA2*t+pB2*e1*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll1_22_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m22 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m22) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-4*aA^2*bA*aB*e3*t-4*bA^2*cA*aB*e3*t+aA^2*aB^2*t-3*bA*cA*aB^2*t+aA^2*bB*cB*t-3*bA*cA*bB*cB*t-cA*aB*e2*t+aA*cB*e2*t-bA*aB*e3*t+aA*bB*e3*t) * hE + (-aA*cA*aB*cB*e2^2*t-bA*cA*cB^2*e2^2*t+aA*cA*aB*bB*e2*e3*t+aA*bA*aB*cB*e2*e3*t+3*bA*cA*bB*cB*e2*e3*t-bA^2*cB^2*e2*e3*t-aA*bA*aB*bB*e3^2*t-2*bA*cA*bB^2*e3^2*t+bA^2*bB*cB*e3^2*t+4*aB^2*e2*e3*t+4*bB*cB*e2*e3*t-4*bA*cB*e1*t+aA*cB*e2*t-aA*bB*e3*t-2*aB^2*t-2*bB*cB*t-2*e2*e3*t+3*t) * hA0 + (-aA*cA*e1*e2*t-3*aA*bA*e1*e3*t-2*aA^2*e2*e3*t+bA*cA*e2*e3*t+bA^2*e3^2*t+3*aA^2*t-bA*cA*t+4*e2*e3*t-2*t) * hB0 + (-aA^2*cA*aB*e2*t-aA*bA*cA*cB*e2*t+aA^2*bA*aB*e3*t+2*aA*bA*cA*bB*e3*t-aA*bA^2*cB*e3*t+aA^2*e1^2*t+aA*cA*e1*e2*t+aA*bA*e1*e3*t-3*bA*cA*e2*e3*t-aA*aB*e1*t+bA*cB*e1*t+cA*aB*e2*t-2*aA*cB*e2*t+aA*bB*e3*t+aA^2*t+4*bA*cA*t-e2*e3*t) * hu5_22 + (aA*cA^2*aB*e2*t+bA*cA^2*cB*e2*t-aA*bA*cA*aB*e3*t-2*bA*cA^2*bB*e3*t+bA^2*cA*cB*e3*t-aA*cA*e1^2*t+aA^2*e1*e3*t+3*bA*cA*e1*e3*t+aA*bA*e3^2*t+2*aA*cB*e1*t-cA*cB*e2*t-4*aA*aB*e3*t-2*cA*bB*e3*t-bA*cB*e3*t-aA*cA*t+e1*e3*t) * hu5_23 + (-aA*bA*cA*aB*e2*t-bA^2*cA*cB*e2*t+aA*bA^2*aB*e3*t+2*bA^2*cA*bB*e3*t-bA^3*cB*e3*t+aA*bA*e1^2*t-aA^2*e1*e2*t+bA^2*e1*e3*t+3*aA*bA*e2*e3*t+2*bA*aB*e1*t+2*bA*cB*e2*t-2*bA*bB*e3*t-3*aA*bA*t+e1*e2*t) * hu5_32 + (-aA^2*cA*aB*e2*t-aA*bA*cA*cB*e2*t+aA^2*bA*aB*e3*t+2*aA*bA*cA*bB*e3*t-aA*bA^2*cB*e3*t+aA^2*e1^2*t-2*aA*bA*e1*e3*t+bA^2*e3^2*t-aA*aB*e1*t-3*bA*cB*e1*t-bA*aB*e3*t+aA*bB*e3*t+aA^2*t+e2*e3*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll1_23_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m23 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m23) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (4*aA^2*bA*aB*e1*t+4*bA^2*cA*aB*e1*t+6*aA*bA*aB^2*t+6*aA*bA*bB*cB*t+2*aA*aB*e2*t-3*cA*bB*e2*t+5*bA*cB*e2*t-4*aA*bA*t) * hE + (-bA*cA*aB*cB*e2^2*t-aA*cA*bB*cB*e2^2*t+2*aA*bA*cB^2*e2^2*t+bA*cA*aB*bB*e2*e3*t+aA*cA*bB^2*e2*e3*t+bA^2*aB*cB*e2*e3*t-3*aA*bA*bB*cB*e2*e3*t-bA^2*aB*bB*e3^2*t+aA*bA*bB^2*e3^2*t+4*bA*aB*e1*t+2*aA*bB*e1*t-2*aA*aB*e2*t+3*bA*cB*e2*t-3*bA*bB*e3*t+2*e1*e2*t) * hA0 + (2*aA^2*e1*e2*t-bA*cA*e1*e2*t-aA*cA*e2^2*t-bA^2*e1*e3*t-3*aA*bA*e2*e3*t+6*aA*bA*t) * hB0 + (-aA*bA*cA*aB*e2*t-aA^2*cA*bB*e2*t+2*aA^2*bA*cB*e2*t+aA*bA^2*aB*e3*t-aA^2*bA*bB*e3*t-aA*bA*e1^2*t+aA^2*e1*e2*t+3*bA*cA*e1*e2*t+aA*cA*e2^2*t-7*bA*aB*e1*t-aA*bB*e1*t+3*aA*aB*e2*t+3*cA*bB*e2*t-7*bA*cB*e2*t+bA*bB*e3*t+3*aA*bA*t-5*e1*e2*t) * hu5_22 + (bA*cA^2*aB*e2*t+aA*cA^2*bB*e2*t-2*aA*bA*cA*cB*e2*t-bA^2*cA*aB*e3*t+aA*bA*cA*bB*e3*t-3*bA*cA*e1^2*t-aA*cA*e1*e2*t-aA*bA*e1*e3*t+aA^2*e2*e3*t+8*bA*cB*e1*t-3*cA*aB*e2*t+4*aA*cB*e2*t-7*bA*aB*e3*t+2*aA^2*t-3*bA*cA*t-5*e2*e3*t) * hu5_23 + (-bA^2*cA*aB*e2*t-aA*bA*cA*bB*e2*t+2*aA*bA^2*cB*e2*t+bA^3*aB*e3*t-aA*bA^2*bB*e3*t-bA^2*e1^2*t-2*aA*bA*e1*e2*t-aA^2*e2^2*t-2*bA*bB*e1*t+6*bA*aB*e2*t-2*aA*bB*e2*t+3*bA^2*t+3*e2^2*t) * hu5_32 + (-aA*bA*cA*aB*e2*t-aA^2*cA*bB*e2*t+2*aA^2*bA*cB*e2*t+aA*bA^2*aB*e3*t-aA^2*bA*bB*e3*t+3*aA*bA*e1^2*t+aA^2*e1*e2*t-bA^2*e1*e3*t+aA*bA*e2*e3*t-3*bA*aB*e1*t+aA*bB*e1*t+3*aA*aB*e2*t+bA*cB*e2*t-2*bA*bB*e3*t+5*aA*bA*t-3*e1*e2*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll1_24_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m24 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m24) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (2*aA^2*bA*cB*qB1*t+2*bA^2*cA*cB*qB1*t-2*aA^2*bA*aB*qB2*t-2*bA^2*cA*aB*qB2*t-2*bA*cA*aB*qB2*e2*t+2*aA*bA*cB*qB2*e2*t+2*bA*cA*bB*qB1*e3*t-2*bA^2*cB*qB1*e3*t+2*bA^2*aB*qB2*e3*t-2*aA*bA*bB*qB2*e3*t-aA*qA1*aB*e1*t-bA*qA2*aB*e1*t-cA*qA1*bB*e1*t+aA*qA2*bB*e1*t+cA*qA1*aB*e2*t-aA*qA2*aB*e2*t-aA*qA1*cB*e2*t-bA*qA2*cB*e2*t-aA*aB*qB1*t-bA*cB*qB1*t+bA*aB*qB2*t-aA*bB*qB2*t+qA1*t) * hE + (aA*qA2*bB*e1*t-bA*qA1*cB*e1*t-aA*qA2*aB*e2*t-bA*qA2*cB*e2*t+bA*qA1*aB*e3*t+bA*qA2*bB*e3*t+2*bA*cB*qB1*t-2*bA*aB*qB2*t-qA2*bB*e1*t+qA2*aB*e2*t-qA1*cB*e2*t+2*cB*qB1*e2*t-2*aB*qB2*e2*t+qA1*bB*e3*t-qB1*e1*t+qB2*e2*t) * hA0 + (-cB*e2*t+bB*e3*t) * hA3 + (-bB*e1*t+aB*e2*t+bA*t) * hA4 + (aA^2*e1*t-bA*cA*e1*t-2*aA*bA*e3*t-aA*t) * hB3 + (2*aA*bA*e1*t-aA^2*e2*t-bA*cA*e2*t-2*bA^2*e3*t+bA*t+2*e2*t) * hB4 + (-2*bA*cA*qB1*e1*t+2*aA*bA*qB2*e1*t+2*bA*qB1*e1*e3*t+2*bA*qB2*e2*e3*t+bA*cA*qA1*t-aA*bA*qA2*t-aA*qA1*t+aA*qB1*t+bA*qB2*t+qB1*e1*t+qB2*e2*t) * hu5_22 + (-2*bA*cA*qB1*e3*t+2*aA*bA*qB2*e3*t-2*bA*qB2*e1*e3*t+2*bA*qB1*e3^2*t+aA^2*qA2*t+bA*cA*qA2*t+qA2*e1^2*t+qA2*e2*e3*t+cA*qA1*t-aA*qA2*t-2*cA*qB1*t+2*aA*qB2*t-qB2*e1*t+qB1*e3*t-2*qA2*t) * hu5_23 + (2*aA*bA*qB1*e1*t+2*bA^2*qB2*e1*t+2*bA*qB2*e1*e2*t-2*bA*qB1*e2*e3*t-aA*bA*qA1*t-bA^2*qA2*t-bA*qA1*t+2*bA*qB1*t) * hu5_32 + (2*aA*bA*qB1*e3*t+2*bA^2*qB2*e3*t+2*bA*qB1*e1*e3*t+2*bA*qB2*e2*e3*t-qA1*e1^2*t-qA1*e2*e3*t-aA*qA1*t-bA*qA2*t+aA*qB1*t-bA*qB2*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll1_32_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m32 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m32) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (4*aA^2*bA*cB*e3*t+4*bA^2*cA*cB*e3*t-2*aA*cA*aB^2*t-2*aA*cA*bB*cB*t-2*aA*aB*e3*t+4*cA*bB*e3*t-6*bA*cB*e3*t) * hE + (cA^2*aB*cB*e2^2*t-aA*cA*cB^2*e2^2*t-cA^2*aB*bB*e2*e3*t-bA*cA*aB*cB*e2*e3*t+3*aA*cA*bB*cB*e2*e3*t-aA*bA*cB^2*e2*e3*t+bA*cA*aB*bB*e3^2*t-2*aA*cA*bB^2*e3^2*t+aA*bA*bB*cB*e3^2*t-2*aA*cB*e1*t+cA*cB*e2*t+2*aA*aB*e3*t-cA*bB*e3*t+4*bA*cB*e3*t-2*e1*e3*t) * hA0 + (cA^2*e1*e2*t-2*aA^2*e1*e3*t+bA*cA*e1*e3*t+3*aA*cA*e2*e3*t+aA*bA*e3^2*t-2*aA*cA*t) * hB0 + (aA*cA^2*aB*e2*t-aA^2*cA*cB*e2*t-aA*bA*cA*aB*e3*t+2*aA^2*cA*bB*e3*t-aA^2*bA*cB*e3*t-aA*cA*e1^2*t-cA^2*e1*e2*t-3*aA^2*e1*e3*t-4*bA*cA*e1*e3*t-3*aA*cA*e2*e3*t+cA*aB*e1*t-aA*cB*e1*t-2*cA*bB*e3*t+3*aA*cA*t+6*e1*e3*t) * hu5_22 + (-cA^3*aB*e2*t+aA*cA^2*cB*e2*t+bA*cA^2*aB*e3*t-2*aA*cA^2*bB*e3*t+aA*bA*cA*cB*e3*t+cA^2*e1^2*t+2*aA*cA*e1*e3*t-3*aA^2*e3^2*t-4*bA*cA*e3^2*t+cA*aB*e3*t-3*aA*cB*e3*t-cA^2*t+6*e3^2*t) * hu5_23 + (bA*cA^2*aB*e2*t-aA*bA*cA*cB*e2*t-bA^2*cA*aB*e3*t+2*aA*bA*cA*bB*e3*t-aA*bA^2*cB*e3*t-bA*cA*e1^2*t+aA*cA*e1*e2*t+aA*bA*e1*e3*t+3*aA^2*e2*e3*t-2*bA*cB*e1*t-cA*aB*e2*t+2*aA*cB*e2*t-aA*bB*e3*t-2*aA^2*t+bA*cA*t-4*e2*e3*t) * hu5_32 + (aA*cA^2*aB*e2*t-aA^2*cA*cB*e2*t-aA*bA*cA*aB*e3*t+2*aA^2*cA*bB*e3*t-aA^2*bA*cB*e3*t-aA*cA*e1^2*t-3*aA^2*e1*e3*t-bA*cA*e1*e3*t+aA*bA*e3^2*t+cA*aB*e1*t-3*aA*cB*e1*t+cA*cB*e2*t+cA*bB*e3*t-2*bA*cB*e3*t+aA*cA*t+4*e1*e3*t) * hu5_33) +end Spec0K0 diff --git a/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s2.lean b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s2.lean new file mode 100644 index 0000000000..59c2f32664 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s2.lean @@ -0,0 +1,208 @@ +/- k=0 radical certificates, class ABCEDF (generated by internal notes from Singular `lift`). -/ +import Nov15.Spec0K0Core +namespace Spec0K0 +variable {K : Type*} [Field K] [CharZero K] + +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll1_33_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m33 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m33) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-4*aA^2*bA*aB*e3*t-4*bA^2*cA*aB*e3*t+aA^2*aB^2*t-3*bA*cA*aB^2*t+aA^2*bB*cB*t-3*bA*cA*bB*cB*t-3*cA*aB*e2*t+3*aA*cB*e2*t+bA*aB*e3*t-aA*bB*e3*t) * hE + (-aA*cA*aB*cB*e2^2*t+cA^2*bB*cB*e2^2*t-2*bA*cA*cB^2*e2^2*t+aA*cA*aB*bB*e2*e3*t-cA^2*bB^2*e2*e3*t+aA*bA*aB*cB*e2*e3*t+3*bA*cA*bB*cB*e2*e3*t-aA*bA*aB*bB*e3^2*t-bA*cA*bB^2*e3^2*t+4*aB^2*e2*e3*t+4*bB*cB*e2*e3*t-4*bA*cB*e1*t-aA*cB*e2*t+aA*bB*e3*t-2*aB^2*t-2*bB*cB*t-2*e2*e3*t+3*t) * hA0 + (-3*aA*cA*e1*e2*t+cA^2*e2^2*t-aA*bA*e1*e3*t-2*aA^2*e2*e3*t+bA*cA*e2*e3*t+3*aA^2*t-bA*cA*t+4*e2*e3*t-2*t) * hB0 + (-aA^2*cA*aB*e2*t+aA*cA^2*bB*e2*t-2*aA*bA*cA*cB*e2*t+aA^2*bA*aB*e3*t+aA*bA*cA*bB*e3*t+3*aA^2*e1^2*t+2*aA*cA*e1*e2*t-cA^2*e2^2*t-4*bA*cA*e2*e3*t-3*aA*aB*e1*t-cA*bB*e1*t+3*cA*aB*e2*t-3*aA*cB*e2*t-aA^2*t+4*bA*cA*t+e2*e3*t) * hu5_22 + (aA*cA^2*aB*e2*t-cA^3*bB*e2*t+2*bA*cA^2*cB*e2*t-aA*bA*cA*aB*e3*t-bA*cA^2*bB*e3*t-3*aA*cA*e1^2*t+cA^2*e1*e2*t+3*aA^2*e1*e3*t+4*bA*cA*e1*e3*t-aA*cA*e2*e3*t+2*aA*cB*e1*t-2*cA*cB*e2*t-4*aA*aB*e3*t-2*cA*bB*e3*t+aA*cA*t-e1*e3*t) * hu5_23 + (-aA*bA*cA*aB*e2*t+bA*cA^2*bB*e2*t-2*bA^2*cA*cB*e2*t+aA*bA^2*aB*e3*t+bA^2*cA*bB*e3*t+3*aA*bA*e1^2*t-3*aA^2*e1*e2*t-bA*cA*e1*e2*t+aA*cA*e2^2*t+4*aA*bA*e2*e3*t+2*bA*aB*e1*t-cA*bB*e2*t+2*bA*cB*e2*t-bA*bB*e3*t-5*aA*bA*t+3*e1*e2*t) * hu5_32 + (-aA^2*cA*aB*e2*t+aA*cA^2*bB*e2*t-2*aA*bA*cA*cB*e2*t+aA^2*bA*aB*e3*t+aA*bA*cA*bB*e3*t+3*aA^2*e1^2*t-aA*cA*e1*e2*t-aA*bA*e1*e3*t-bA*cA*e2*e3*t-3*aA*aB*e1*t-cA*bB*e1*t-4*bA*cB*e1*t-aA*cB*e2*t+bA*aB*e3*t-aA^2*t+3*e2*e3*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll1_34_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m34 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3))).m34) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (2*aA^3*cB*qB1*t+2*aA*bA*cA*cB*qB1*t+2*aA^2*bA*cB*qB2*t+2*bA^2*cA*cB*qB2*t+2*aA^2*aB*qB2*e1*t+2*bA*cA*aB*qB2*e1*t-2*aA*cA*aB*qB2*e2*t+2*aA^2*cB*qB2*e2*t+2*aA*cA*bB*qB1*e3*t-2*aA*bA*cB*qB1*e3*t+2*aA*bA*aB*qB2*e3*t+2*bA*cA*bB*qB2*e3*t+2*aA*aB^2*qB2*t+2*aA*bB*cB*qB2*t+cA*qA1*aB*e1*t-aA*qA2*aB*e1*t-aA*qA1*cB*e1*t-bA*qA2*cB*e1*t+aA*qA1*aB*e3*t+bA*qA2*aB*e3*t+cA*qA1*bB*e3*t-aA*qA2*bB*e3*t+3*cA*aB*qB1*t-3*aA*cB*qB1*t+aA*aB*qB2*t+3*cA*bB*qB2*t-2*bA*cB*qB2*t-2*aA*qB2*t+qA2*t) * hE + (2*aA*cB*qB1*t+2*bA*cB*qB2*t-2*cB*qB1*e1*t+4*aB*qB2*e1*t+2*cB*qB2*e2*t+2*aB*qB1*e3*t+2*bB*qB2*e3*t-qB2*e1*t-qB1*e3*t) * hA0 + (2*aA*qB2*t) * hB0 + (-2*aA*cA*e1*t-aA^2*e3*t+bA*cA*e3*t+3*cA*t+2*e3*t) * hB3 + (aA^2*e1*t-bA*cA*e1*t-2*aA*bA*e3*t-aA*t-2*e1*t) * hB4 + (-2*aA*cA*qB1*e1*t-2*bA*cA*qB2*e1*t-2*aA*qB2*e1^2*t+2*aA*qB1*e1*e3*t-2*aB*qB2*e1*t+qA2*e1^2*t-2*cB*qB2*e2*t+qA2*e2*e3*t+3*cA*qB1*t-aA*qB2*t+2*qB2*e1*t-qA2*t) * hu5_22 + (-2*aA*cA*qB1*e3*t-2*bA*cA*qB2*e3*t-2*aA*qB2*e1*e3*t+2*aA*qB1*e3^2*t+2*cB*qB2*e1*t-2*aB*qB2*e3*t-2*cA*qB2*t+2*qB2*e3*t) * hu5_23 + (2*aA^2*qB1*e1*t+2*aA*bA*qB2*e1*t-2*bA*qB2*e1^2*t+2*aA*qB2*e1*e2*t-2*aA*qB1*e2*e3*t-2*bA*qB2*e2*e3*t-qA1*e1^2*t-qA1*e2*e3*t-2*aA*qB1*t-2*bA*qB2*t-3*qB1*e1*t-3*qB2*e2*t) * hu5_32 + (2*aA^2*qB1*e3*t+2*aA*bA*qB2*e3*t+2*aA*qB1*e1*e3*t+2*aA*qB2*e2*e3*t+cA*qB1*t-aA*qB2*t+3*qB2*e1*t-3*qB1*e3*t+qA2*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll2_12_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m12 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m12) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-3/2*bA*aB*aC*pC1*aD^2*e3*t+3/2*aA*bB*aC*pC1*aD^2*e3*t-3/2*aA*aB*bC*pC1*aD^2*e3*t-3/2*bA*cB*bC*pC1*aD^2*e3*t-3/2*cA*bB*aC*pC1*aD*bD*e3*t+3/2*bA*cB*aC*pC1*aD*bD*e3*t+3/2*cA*aB*bC*pC1*aD*bD*e3*t-3/2*aA*cB*bC*pC1*aD*bD*e3*t-3/2*bA*aB*cC*pC1*aD*bD*e3*t+3/2*aA*bB*cC*pC1*aD*bD*e3*t-3/2*cA*aB*aC*pC1*bD^2*e3*t+3/2*aA*cB*aC*pC1*bD^2*e3*t-3/2*aA*aB*cC*pC1*bD^2*e3*t-3/2*cA*bB*cC*pC1*bD^2*e3*t-3*aA*aB*pC1*aD*e2*e3*t-3*bA*cB*pC1*aD*e2*e3*t+3*cA*aB*pC1*bD*e2*e3*t-3*aA*cB*pC1*bD*e2*e3*t+3/2*aA*aB*aC*pC1*aD*t+3/2*cA*bB*aC*pC1*aD*t-3/2*cA*aB*bC*pC1*aD*t+3/2*aA*cB*bC*pC1*aD*t+3/2*cA*aB*aC*pC1*bD*t-3/2*aA*cB*aC*pC1*bD*t+3/2*aA*aB*cC*pC1*bD*t+3/2*cA*bB*cC*pC1*bD*t-3*aC^2*pC2*aD*e3*t-3*bC*cC*pC2*aD*e3*t-aC^2*aD*pD2*e3*t-bC*cC*aD*pD2*e3*t-aC*pC1*aD^2*t-cC*pC2*aD^2*t+2*cC*pC1*aD*bD*t+2*bC*pC1*aD*cD*t-aC*pC1*bD*cD*t+3*cC*pC2*bD*cD*t-aC*pC1*aD*e1*t-cC*pC2*aD*e1*t-bC*pC1*cD*e1*t+aC*pC2*cD*e1*t-3*cA*aB*pC1*e2*t+3*aA*cB*pC1*e2*t-2*bC*cD*pD1*t+2*cC*aD*pD2*t+3*pC1*bD*e3*t-pC1*t) * hE + (-1/4*cC*pC1*bD*cD*e1*e2*t+1/4*bC*pC1*cD^2*e1*e2*t+1/4*cC*bD*cD*pD1*e1*e2*t-1/4*bC*cD^2*pD1*e1*e2*t+1/2*cC*aD*cD*pD1*e2^2*t-1/2*aC*cD^2*pD1*e2^2*t+1/4*cC*pC1*bD^2*e1*e3*t-1/4*bC*pC1*bD*cD*e1*e3*t-1/4*cC*bD^2*pD1*e1*e3*t+1/4*bC*bD*cD*pD1*e1*e3*t-5/4*cC*pC2*bD*cD*e2*e3*t+5/4*bC*pC2*cD^2*e2*e3*t-1/2*cC*aD*bD*pD1*e2*e3*t+1/2*aC*bD*cD*pD1*e2*e3*t+1/4*cC*bD*cD*pD2*e2*e3*t-1/4*bC*cD^2*pD2*e2*e3*t+5/4*cC*pC2*bD^2*e3^2*t-5/4*bC*pC2*bD*cD*e3^2*t-1/4*cC*bD^2*pD2*e3^2*t+1/4*bC*bD*cD*pD2*e3^2*t-pC1*aD*cD*e1*e2*t+1/2*pC1*cD^2*e2^2*t+pC1*aD*bD*e1*e3*t+3*pC1*bD*e1^2*e3*t-2*pC2*aD*cD*e2*e3*t-3/2*bC*cD*pD1*e2*e3*t+3/2*aC*cD*pD2*e2*e3*t-3*pC1*aD*e1*e2*e3*t+2*pC2*aD*bD*e3^2*t-1/2*pC1*bD^2*e3^2*t+3/2*bC*bD*pD1*e3^2*t-3/2*aC*bD*pD2*e3^2*t-cD*pD1*e2*t-3*pC2*aD*e3*t+bD*pD1*e3*t-aD*pD2*e3*t) * hC0 + (-aD*cD*e1*e2*t+1/2*cD^2*e2^2*t+aD*bD*e1*e3*t-4*aD^2*e2*e3*t-4*bD*cD*e2*e3*t-1/2*bD^2*e3^2*t-aD*e1*t+2*e2*e3*t-t) * hC1 + (-2*aD*cD*e2*e3*t+2*aD*bD*e3^2*t-cD*e1*t+e1*e3*t) * hC2 + (cC*pD1*e1*e2*t+bC*pC1*e1*e3*t+2*aC*pC2*e1*e3*t+2*aC*pC1*e2*e3*t+2*cC*pC2*e2*e3*t+aC*pD1*e2*e3*t+cC*pD2*e2*e3*t-bC*pC2*e3^2*t+4*pC1*e2*e3*t-aC*pC1*t+cC*pC2*t) * hD0 + (cC*e1*e2*t+bC*e1*e3*t+aC*e2*e3*t) * hD1 + (-aC*e1*e3*t+cC*e2*e3*t+bC*e3^2*t+e3*t) * hD2 + (3/2*pC1*aD*e3*t) * h3_23 + (-3/2*pC1*bD*e3*t+3/2*pC1*t) * h3_33 + (-3/2*aA*aB*pC1*aD*e1*e3*t-3/2*bA*cB*pC1*aD*e1*e3*t+3/2*cA*aB*pC1*bD*e1*e3*t-3/2*aA*cB*pC1*bD*e1*e3*t+aC*pC1*aD*cD*t-3/2*cA*aB*pC1*e1*t+3/2*aA*cB*pC1*e1*t-3/2*aC*pC1*e1*e3*t-1/2*aC*pD1*e1*e3*t-2*aC*pC2*e3^2*t-aC*pD2*e3^2*t-aC*cD*pD1*t-1/4*pC1*cD*e1*t+1/4*cD*pD1*e1*t-5/4*pC2*cD*e3*t+1/4*cD*pD2*e3*t-pC1*e1*e3*t-1/2*pD1*e3*t) * hu2_23 + (-3/2*bA*aB*pC1*aD*e2*e3*t+3/2*aA*bB*pC1*aD*e2*e3*t-3/2*aA*aB*pC1*bD*e2*e3*t-3/2*cA*bB*pC1*bD*e2*e3*t+1/4*bC*cC*pC1*bD*e1*t-1/4*bC^2*pC1*cD*e1*t-1/4*bC*cC*bD*pD1*e1*t+1/4*bC^2*cD*pD1*e1*t-1/2*bC*cC*aD*pD1*e2*t+1/2*aC*bC*cD*pD1*e2*t+5/4*bC*cC*pC2*bD*e3*t-5/4*bC^2*pC2*cD*e3*t-1/4*bC*cC*bD*pD2*e3*t+1/4*bC^2*cD*pD2*e3*t-aC*pC2*aD^2*t+aC*pC1*aD*bD*t+aC*pC2*bD*cD*t+bC*pC1*aD*e1*t+3/2*aA*aB*pC1*e2*t+3/2*cA*bB*pC1*e2*t-1/2*bC*pC1*cD*e2*t+2*bC*pC2*aD*e3*t-1/2*bC*pC1*bD*e3*t+3/2*bC^2*pD1*e3*t-3/2*aC*bC*pD2*e3*t-3*bC*pC2*e1*e3*t-bC*pD2*e1*e3*t+aC*aD*pD2*t-2*pC2*aD*e1*t+7/4*pC1*bD*e1*t+1/4*bD*pD1*e1*t-pC2*e1^2*t+1/2*pC2*cD*e2*t+1/2*aD*pD1*e2*t-7/4*pC2*bD*e3*t+1/4*bD*pD2*e3*t+aC*pC2*t+bC*pD1*t+2*pD2*e1*t) * hu2_32 + (3/2*bA*aB*pC1*aD*e1*e3*t-3/2*aA*bB*pC1*aD*e1*e3*t+3/2*aA*aB*pC1*bD*e1*e3*t+3/2*cA*bB*pC1*bD*e1*e3*t-3/2*aA*aB*pC1*aD*e2*e3*t-3/2*bA*cB*pC1*aD*e2*e3*t+3/2*cA*aB*pC1*bD*e2*e3*t-3/2*aA*cB*pC1*bD*e2*e3*t-1/4*aC*cC*pC1*bD*e1*t+1/4*aC*bC*pC1*cD*e1*t+1/4*aC*cC*bD*pD1*e1*t-1/4*aC*bC*cD*pD1*e1*t+1/2*aC*cC*aD*pD1*e2*t-1/2*aC^2*cD*pD1*e2*t-5/4*aC*cC*pC2*bD*e3*t+5/4*aC*bC*pC2*cD*e3*t+1/4*aC*cC*bD*pD2*e3*t-1/4*aC*bC*cD*pD2*e3*t-cC*pC2*aD^2*t+cC*pC1*aD*bD*t+bC*pC1*aD*cD*t+cC*pC2*bD*cD*t-3/2*aA*aB*pC1*e1*t-3/2*cA*bB*pC1*e1*t-aC*pC1*aD*e1*t-3/2*cA*aB*pC1*e2*t+3/2*aA*cB*pC1*e2*t+1/2*aC*pC1*cD*e2*t-2*aC*pC2*aD*e3*t+1/2*aC*pC1*bD*e3*t-3/2*aC*bC*pD1*e3*t+3/2*aC^2*pD2*e3*t-3/2*bC*pC1*e1*e3*t+3*aC*pC2*e1*e3*t-1/2*bC*pD1*e1*e3*t+aC*pD2*e1*e3*t-2*bC*pC2*e3^2*t-bC*pD2*e3^2*t-bC*cD*pD1*t+cC*aD*pD2*t-5/2*pC1*aD*e1*t-2*pC2*cD*e1*t+1/2*aD*pD1*e1*t+pC1*e1^2*t-1/2*pC1*cD*e2*t-1/2*cD*pD1*e2*t-5/2*pC2*aD*e3*t+1/2*pC1*bD*e3*t+1/2*aD*pD2*e3*t-pC2*e1*e3*t+cC*pC2*t-aC*pD1*t-3/2*pD2*e3*t) * hu2_33 + (3*pC1*aD*e1*e2*e3*t) * hu5_22 + (3*pC1*aD*e2*e3^2*t-3/2*pC1*aD*e3*t) * hu5_23 + (-3*pC1*bD*e1*e2*e3*t+3*pC1*e1*e2*t) * hu5_32 + (-3*pC1*bD*e2*e3^2*t+3/2*pC1*bD*e3*t+3*pC1*e2*e3*t-3/2*pC1*t) * hu5_33 + (3/2*aA*aB*pC1*aD*e2*e3*t+3/2*bA*cB*pC1*aD*e2*e3*t-3/2*cA*aB*pC1*bD*e2*e3*t+3/2*aA*cB*pC1*bD*e2*e3*t+1/2*aC*cC*pC1*bD*e1*t-1/2*aC*bC*pC1*cD*e1*t-1/2*aC*cC*bD*pD1*e1*t+1/2*aC*bC*cD*pD1*e1*t-aC*cC*aD*pD1*e2*t+aC^2*cD*pD1*e2*t+5/2*aC*cC*pC2*bD*e3*t-5/2*aC*bC*pC2*cD*e3*t-1/2*aC*cC*bD*pD2*e3*t+1/2*aC*bC*cD*pD2*e3*t+2*aC*pC1*aD*e1*t+3/2*cA*aB*pC1*e2*t-3/2*aA*cB*pC1*e2*t-aC*pC1*cD*e2*t+4*aC*pC2*aD*e3*t-aC*pC1*bD*e3*t+3*aC*bC*pD1*e3*t-3*aC^2*pD2*e3*t-3*aC*pC2*e1*e3*t-aC*pD2*e1*e3*t+3*pC1*aD*e1*t+pC2*cD*e1*t-pC1*e1^2*t+2*pC1*bD*e3*t+2*aC*pD1*t-pD1*e1*t+2*pD2*e3*t) * hu6_22 + (-aC*pC1*aD*cD*t-3/2*aC*pC1*e1*e3*t+1/2*aC*pD1*e1*e3*t-aC*pC2*e3^2*t+aC*cD*pD1*t-1/4*pC1*cD*e1*t+1/4*cD*pD1*e1*t-3*pC1*aD*e3*t-1/4*pC2*cD*e3*t+1/4*cD*pD2*e3*t+1/2*pD1*e3*t) * hu6_23 + (1/4*bC*cC*pC1*bD*e1*t-1/4*bC^2*pC1*cD*e1*t-1/4*bC*cC*bD*pD1*e1*t+1/4*bC^2*cD*pD1*e1*t-1/2*bC*cC*aD*pD1*e2*t+1/2*aC*bC*cD*pD1*e2*t+5/4*bC*cC*pC2*bD*e3*t-5/4*bC^2*pC2*cD*e3*t-1/4*bC*cC*bD*pD2*e3*t+1/4*bC^2*cD*pD2*e3*t+aC*pC2*aD^2*t-aC*pC1*aD*bD*t-aC*pC2*bD*cD*t+bC*pC1*aD*e1*t-1/2*bC*pC1*cD*e2*t+2*bC*pC2*aD*e3*t-1/2*bC*pC1*bD*e3*t+3/2*bC^2*pD1*e3*t-3/2*aC*bC*pD2*e3*t-aC*aD*pD2*t+3/4*pC1*bD*e1*t-3/4*bD*pD1*e1*t-pC1*aD*e2*t-1/2*pC2*cD*e2*t+1/2*aD*pD1*e2*t-3/4*pC2*bD*e3*t-3/4*bD*pD2*e3*t-aC*pC2*t+bC*pD1*t-pD2*e1*t) * hu6_32 + (3/2*aA*aB*pC1*aD*e2*e3*t+3/2*bA*cB*pC1*aD*e2*e3*t-3/2*cA*aB*pC1*bD*e2*e3*t+3/2*aA*cB*pC1*bD*e2*e3*t+1/4*aC*cC*pC1*bD*e1*t-1/4*aC*bC*pC1*cD*e1*t-1/4*aC*cC*bD*pD1*e1*t+1/4*aC*bC*cD*pD1*e1*t-1/2*aC*cC*aD*pD1*e2*t+1/2*aC^2*cD*pD1*e2*t+5/4*aC*cC*pC2*bD*e3*t-5/4*aC*bC*pC2*cD*e3*t-1/4*aC*cC*bD*pD2*e3*t+1/4*aC*bC*cD*pD2*e3*t+cC*pC2*aD^2*t-cC*pC1*aD*bD*t-bC*pC1*aD*cD*t-cC*pC2*bD*cD*t+aC*pC1*aD*e1*t+3/2*cA*aB*pC1*e2*t-3/2*aA*cB*pC1*e2*t-1/2*aC*pC1*cD*e2*t+2*aC*pC2*aD*e3*t-1/2*aC*pC1*bD*e3*t+3/2*aC*bC*pD1*e3*t-3/2*aC^2*pD2*e3*t-3/2*bC*pC1*e1*e3*t-3*aC*pC2*e1*e3*t+1/2*bC*pD1*e1*e3*t-aC*pD2*e1*e3*t-bC*pC2*e3^2*t+bC*cD*pD1*t-cC*aD*pD2*t+1/2*pC1*aD*e1*t-pC2*cD*e1*t+1/2*aD*pD1*e1*t-pC1*e1^2*t-1/2*pC1*cD*e2*t+1/2*cD*pD1*e2*t-1/2*pC2*aD*e3*t+1/2*pC1*bD*e3*t+1/2*aD*pD2*e3*t-cC*pC2*t+aC*pD1*t+5/2*pD2*e3*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll2_13_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m13 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_32 := congrArg M4.m32 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_32 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m13) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (bA*aB*aC*aD^2*pD2*e3*t-aA*bB*aC*aD^2*pD2*e3*t+aA*aB*bC*aD^2*pD2*e3*t+bA*cB*bC*aD^2*pD2*e3*t+cA*bB*aC*aD*bD*pD2*e3*t-bA*cB*aC*aD*bD*pD2*e3*t-cA*aB*bC*aD*bD*pD2*e3*t+aA*cB*bC*aD*bD*pD2*e3*t+bA*aB*cC*aD*bD*pD2*e3*t-aA*bB*cC*aD*bD*pD2*e3*t+cA*aB*aC*bD^2*pD2*e3*t-aA*cB*aC*bD^2*pD2*e3*t+aA*aB*cC*bD^2*pD2*e3*t+cA*bB*cC*bD^2*pD2*e3*t+aA*aB*aC*aD*pD1*e2*t+cA*bB*aC*aD*pD1*e2*t-cA*aB*bC*aD*pD1*e2*t+aA*cB*bC*aD*pD1*e2*t+cA*aB*aC*bD*pD1*e2*t-aA*cB*aC*bD*pD1*e2*t+aA*aB*cC*bD*pD1*e2*t+cA*bB*cC*bD*pD1*e2*t-cA*aB*aC*aD*pD2*e2*t+aA*cB*aC*aD*pD2*e2*t-aA*aB*cC*aD*pD2*e2*t-cA*bB*cC*aD*pD2*e2*t+aA*aB*aC*cD*pD2*e2*t+cA*bB*aC*cD*pD2*e2*t-cA*aB*bC*cD*pD2*e2*t+aA*cB*bC*cD*pD2*e2*t+2*aA*aB*aD*pD2*e2*e3*t+2*bA*cB*aD*pD2*e2*e3*t-2*cA*aB*bD*pD2*e2*e3*t+2*aA*cB*bD*pD2*e2*e3*t-2*aC^2*aD*pD1*e2*t-2*bC*cC*aD*pD1*e2*t-2*cA*aB*pD1*e2^2*t+2*aA*cB*pD1*e2^2*t-2*bC*aD*pD1*e2*e3*t+2*aC*bD*pD1*e2*e3*t-2*aA*aB*pD2*e2*e3*t-2*cA*bB*pD2*e2*e3*t-2*aC*aD*pD2*e2*e3*t-2*bC*cD*pD2*e2*e3*t-bC*pC1*aD^2*t+4*cC*pC2*aD*bD*t-5*bC*pC1*bD*cD*t-2*aC*pC1*aD*e2*t-2*cC*pC2*aD*e2*t-2*bC*pC1*cD*e2*t+2*aC*pC2*cD*e2*t+6*bC*aD*pD1*t+6*bC*cD*pD2*t-2*bD*pD2*e3*t) * hE + (-3/4*cC*pC2*bD*cD*e1*e2*t+3/4*bC*pC2*cD^2*e1*e2*t-1/4*cC*bD*cD*pD2*e1*e2*t+1/4*bC*cD^2*pD2*e1*e2*t-1/4*cC*pC1*bD*cD*e2^2*t+1/4*bC*pC1*cD^2*e2^2*t+1/4*cC*bD*cD*pD1*e2^2*t-1/4*bC*cD^2*pD1*e2^2*t+3/4*cC*pC2*bD^2*e1*e3*t-3/4*bC*pC2*bD*cD*e1*e3*t+1/4*cC*bD^2*pD2*e1*e3*t-1/4*bC*bD*cD*pD2*e1*e3*t+1/4*cC*pC1*bD^2*e2*e3*t-bC*pC2*aD*cD*e2*e3*t-1/4*bC*pC1*bD*cD*e2*e3*t+aC*pC2*bD*cD*e2*e3*t-1/4*cC*bD^2*pD1*e2*e3*t+1/4*bC*bD*cD*pD1*e2*e3*t+bC*pC2*aD*bD*e3^2*t-aC*pC2*bD^2*e3^2*t+7/2*pC1*aD*cD*e2^2*t+5/2*pC2*cD^2*e2^2*t-pC2*aD*bD*e1*e3*t-2*bD*pD2*e1^2*e3*t+pC2*aD^2*e2*e3*t-7/2*pC1*aD*bD*e2*e3*t-pC2*bD*cD*e2*e3*t+2*aD*pD2*e1*e2*e3*t-3/2*pC2*bD^2*e3^2*t-3/2*pC2*cD*e2*t-2*aD*pD1*e2*t-2*cD*pD2*e2*t+3/2*pC2*bD*e3*t+2*bD*pD2*e3*t) * hC0 + (7/2*aD*cD*e2^2*t-7/2*aD*bD*e2*e3*t-bD*e1*t-aD*e2*t-2*e1*e2*t) * hC1 + (5/2*cD^2*e2^2*t-aD*bD*e1*e3*t-aD^2*e2*e3*t-3*bD*cD*e2*e3*t-3/2*bD^2*e3^2*t-3/2*cD*e2*t-1/2*bD*e3*t+4*e2*e3*t) * hC2 + (-2*aC*pC1*e1*e2*t-2*cC*pC2*e1*e2*t-cC*pD2*e1*e2*t+cC*pD1*e2^2*t+bC*pC2*e1*e3*t+bC*pC1*e2*e3*t-4*aC*pC2*e2*e3*t+2*pC2*e2*e3*t-bC*pC1*t) * hD0 + (-2*aC*e1*e2*t+cC*e2^2*t-5*bC*e2*e3*t+6*bC*t-2*e2*t) * hD1 + (-cC*e1*e2*t+3*bC*e1*e3*t) * hD2 + (-aD*pD2*e3*t) * h3_23 + (-pD2*e2*t) * h3_32 + (bD*pD2*e3*t+pD1*e2*t) * h3_33 + (aA*aB*aD*pD2*e1*e3*t+bA*cB*aD*pD2*e1*e3*t-cA*aB*bD*pD2*e1*e3*t+aA*cB*bD*pD2*e1*e3*t-cA*aB*pD1*e1*e2*t+aA*cB*pD1*e1*e2*t-cA*aB*pD2*e2*e3*t+aA*cB*pD2*e2*e3*t-2*aC*pC1*bD*cD*t+1/2*aC*pC2*aD*e3*t+1/2*aC*pC2*e1*e3*t-1/2*aC*pD2*e1*e3*t-3/2*aC*pC1*e2*e3*t+3/2*aC*pD1*e2*e3*t-2*pD1*e1*e2*e3*t-2*pD2*e2*e3^2*t-23/4*pC2*cD*e1*t-1/4*cD*pD2*e1*t+9/4*pC1*cD*e2*t+1/4*cD*pD1*e2*t+6*pC2*aD*e3*t-7/2*pC1*bD*e3*t-2*pC1*e2*e3*t-1/2*aC*pC1*t-3*aC*pD1*t+4*pD1*e1*t+4*pD2*e3*t+1/2*pC1*t) * hu2_23 + (bA*aB*aD*pD2*e2*e3*t-aA*bB*aD*pD2*e2*e3*t+aA*aB*bD*pD2*e2*e3*t+cA*bB*bD*pD2*e2*e3*t+3/4*bC*cC*pC2*bD*e1*t-3/4*bC^2*pC2*cD*e1*t+1/4*bC*cC*bD*pD2*e1*t-1/4*bC^2*cD*pD2*e1*t+1/4*bC*cC*pC1*bD*e2*t-1/4*bC^2*pC1*cD*e2*t-1/4*bC*cC*bD*pD1*e2*t+1/4*bC^2*cD*pD1*e2*t-aA*aB*pD2*e1*e2*t-cA*bB*pD2*e1*e2*t+aA*aB*pD1*e2^2*t+cA*bB*pD1*e2^2*t+bC^2*pC2*aD*e3*t-aC*bC*pC2*bD*e3*t+2*aC*pC2*aD*bD*t-7/2*bC*pC1*aD*e2*t-5/2*bC*pC2*cD*e2*t-2*bC*pD1*e1*e2*t-3/2*bC*pC2*bD*e3*t+5/4*pC2*bD*e1*t-1/4*bD*pD2*e1*t-3/2*pC2*aD*e2*t-1/4*pC1*bD*e2*t+1/4*bD*pD1*e2*t-2*pC2*e1*e2*t+3/2*bC*pC2*t+2*bC*pD2*t) * hu2_32 + (-bA*aB*aD*pD2*e1*e3*t+aA*bB*aD*pD2*e1*e3*t-aA*aB*bD*pD2*e1*e3*t-cA*bB*bD*pD2*e1*e3*t+aA*aB*aD*pD2*e2*e3*t+bA*cB*aD*pD2*e2*e3*t-cA*aB*bD*pD2*e2*e3*t+aA*cB*bD*pD2*e2*e3*t-3/4*aC*cC*pC2*bD*e1*t+3/4*aC*bC*pC2*cD*e1*t-1/4*aC*cC*bD*pD2*e1*t+1/4*aC*bC*cD*pD2*e1*t-1/4*aC*cC*pC1*bD*e2*t+1/4*aC*bC*pC1*cD*e2*t+1/4*aC*cC*bD*pD1*e2*t-1/4*aC*bC*cD*pD1*e2*t-aA*aB*pD1*e1*e2*t-cA*bB*pD1*e1*e2*t+cA*aB*pD2*e1*e2*t-aA*cB*pD2*e1*e2*t-cA*aB*pD1*e2^2*t+aA*cB*pD1*e2^2*t-aC*bC*pC2*aD*e3*t+aC^2*pC2*bD*e3*t-aA*aB*pD2*e2*e3*t-cA*bB*pD2*e2*e3*t+2*cC*pC2*aD*bD*t-2*bC*pC1*bD*cD*t+7/2*aC*pC1*aD*e2*t+5/2*aC*pC2*cD*e2*t+2*aC*pD1*e1*e2*t+1/2*bC*pC2*aD*e3*t+3/2*aC*pC2*bD*e3*t+1/2*bC*pC2*e1*e3*t-1/2*bC*pD2*e1*e3*t-3/2*bC*pC1*e2*e3*t+3/2*bC*pD1*e2*e3*t+2*pD2*e1*e2*e3*t-2*pD1*e2^2*e3*t-17/2*pC2*aD*e1*t+4*pC1*bD*e1*t-1/2*aD*pD2*e1*t-pC1*aD*e2*t-9/2*pC2*cD*e2*t+1/2*aD*pD1*e2*t+2*pC1*e1*e2*t-1/2*pC2*bD*e3*t-2*pC2*e2*e3*t-1/2*bC*pC1*t-3/2*aC*pC2*t-3*bC*pD1*t-2*aC*pD2*t-2*pD2*e1*t+2*pD1*e2*t+1/2*pC2*t) * hu2_33 + (-2*aD*pD2*e1*e2*e3*t) * hu5_22 + (-2*aD*pD2*e2*e3^2*t+aD*pD2*e3*t) * hu5_23 + (2*bD*pD2*e1*e2*e3*t+2*pD1*e1*e2^2*t+2*pD2*e2^2*e3*t-pD2*e2*t) * hu5_32 + (2*bD*pD2*e2*e3^2*t-2*pD2*e1*e2*e3*t+2*pD1*e2^2*e3*t-bD*pD2*e3*t-pD1*e2*t) * hu5_33 + (-aA*aB*aD*pD2*e2*e3*t-bA*cB*aD*pD2*e2*e3*t+cA*aB*bD*pD2*e2*e3*t-aA*cB*bD*pD2*e2*e3*t+3/2*aC*cC*pC2*bD*e1*t-3/2*aC*bC*pC2*cD*e1*t+1/2*aC*cC*bD*pD2*e1*t-1/2*aC*bC*cD*pD2*e1*t+1/2*aC*cC*pC1*bD*e2*t-1/2*aC*bC*pC1*cD*e2*t-1/2*aC*cC*bD*pD1*e2*t+1/2*aC*bC*cD*pD1*e2*t-cA*aB*pD2*e1*e2*t+aA*cB*pD2*e1*e2*t+cA*aB*pD1*e2^2*t-aA*cB*pD1*e2^2*t+2*aC*bC*pC2*aD*e3*t-2*aC^2*pC2*bD*e3*t-7*aC*pC1*aD*e2*t-5*aC*pC2*cD*e2*t-2*aC*pD1*e1*e2*t-3*aC*pC2*bD*e3*t-2*pD2*e1*e2*e3*t+2*pD1*e2^2*e3*t+10*pC2*aD*e1*t-5*pC1*bD*e1*t+pC1*aD*e2*t+6*pC2*cD*e2*t-2*pC1*e1*e2*t+5*pC2*bD*e3*t+3*aC*pC2*t+4*aC*pD2*t+6*pD2*e1*t-3*pD1*e2*t) * hu6_22 + (2*aC*pC1*bD*cD*t+1/2*aC*pC2*aD*e3*t-1/2*aC*pC2*e1*e3*t+5/2*aC*pD2*e1*e3*t+3/2*aC*pC1*e2*e3*t-7/2*aC*pD1*e2*e3*t+13/4*pC2*cD*e1*t-1/4*cD*pD2*e1*t+9/4*pC1*cD*e2*t+1/4*cD*pD1*e2*t-4*pC2*aD*e3*t+3/2*pC1*bD*e3*t+1/2*aC*pC1*t+3*aC*pD1*t-3*pD1*e1*t+1/2*pC1*t) * hu6_23 + (3/4*bC*cC*pC2*bD*e1*t-3/4*bC^2*pC2*cD*e1*t+1/4*bC*cC*bD*pD2*e1*t-1/4*bC^2*cD*pD2*e1*t+1/4*bC*cC*pC1*bD*e2*t-1/4*bC^2*pC1*cD*e2*t-1/4*bC*cC*bD*pD1*e2*t+1/4*bC^2*cD*pD1*e2*t+bC^2*pC2*aD*e3*t-aC*bC*pC2*bD*e3*t-2*aC*pC2*aD*bD*t-7/2*bC*pC1*aD*e2*t-5/2*bC*pC2*cD*e2*t-3/2*bC*pC2*bD*e3*t+9/4*pC2*bD*e1*t+3/4*bD*pD2*e1*t-9/2*pC2*aD*e2*t-1/4*pC1*bD*e2*t-3/4*bD*pD1*e2*t+3/2*bC*pC2*t+2*bC*pD2*t-pD2*e2*t) * hu6_32 + (-aA*aB*aD*pD2*e2*e3*t-bA*cB*aD*pD2*e2*e3*t+cA*aB*bD*pD2*e2*e3*t-aA*cB*bD*pD2*e2*e3*t+3/4*aC*cC*pC2*bD*e1*t-3/4*aC*bC*pC2*cD*e1*t+1/4*aC*cC*bD*pD2*e1*t-1/4*aC*bC*cD*pD2*e1*t+1/4*aC*cC*pC1*bD*e2*t-1/4*aC*bC*pC1*cD*e2*t-1/4*aC*cC*bD*pD1*e2*t+1/4*aC*bC*cD*pD1*e2*t-cA*aB*pD2*e1*e2*t+aA*cB*pD2*e1*e2*t+cA*aB*pD1*e2^2*t-aA*cB*pD1*e2^2*t+aC*bC*pC2*aD*e3*t-aC^2*pC2*bD*e3*t-2*cC*pC2*aD*bD*t+2*bC*pC1*bD*cD*t-7/2*aC*pC1*aD*e2*t-5/2*aC*pC2*cD*e2*t-2*aC*pD1*e1*e2*t+1/2*bC*pC2*aD*e3*t-3/2*aC*pC2*bD*e3*t-1/2*bC*pC2*e1*e3*t+5/2*bC*pD2*e1*e3*t+3/2*bC*pC1*e2*e3*t-7/2*bC*pD1*e2*e3*t-2*pD2*e1*e2*e3*t+2*pD1*e2^2*e3*t+5/2*pC2*aD*e1*t-3*pC1*bD*e1*t-1/2*aD*pD2*e1*t+5/2*pC2*cD*e2*t+1/2*aD*pD1*e2*t-2*pC1*e1*e2*t+5/2*pC2*bD*e3*t+1/2*bC*pC1*t+3/2*aC*pC2*t+3*bC*pD1*t+2*aC*pD2*t+3*pD2*e1*t-2*pD1*e2*t+1/2*pC2*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll2_22_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m22 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m22) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-bA*aB*aC*aD^2*cD*t+aA*bB*aC*aD^2*cD*t-aA*aB*bC*aD^2*cD*t-bA*cB*bC*aD^2*cD*t-cA*bB*aC*aD*bD*cD*t+bA*cB*aC*aD*bD*cD*t+cA*aB*bC*aD*bD*cD*t-aA*cB*bC*aD*bD*cD*t-bA*aB*cC*aD*bD*cD*t+aA*bB*cC*aD*bD*cD*t-cA*aB*aC*bD^2*cD*t+aA*cB*aC*bD^2*cD*t-aA*aB*cC*bD^2*cD*t-cA*bB*cC*bD^2*cD*t-2*aA*aB*aD*cD*e2*t-2*bA*cB*aD*cD*e2*t+2*cA*aB*bD*cD*e2*t-2*aA*cB*bD*cD*e2*t+aA*aB*aC*aD*t+cA*bB*aC*aD*t-cA*aB*bC*aD*t+aA*cB*bC*aD*t+aC^2*aD^2*t-bC*cC*aD^2*t+cA*aB*aC*bD*t-aA*cB*aC*bD*t+aA*aB*cC*bD*t+cA*bB*cC*bD*t-aC^2*bD*cD*t-3*bC*cC*bD*cD*t-2*cA*aB*e2*t+2*aA*cB*e2*t+2*bD*cD*t) * hE + (1/4*aC*cC*bD*cD*e1*e2*t-1/4*aC*bC*cD^2*e1*e2*t-1/4*aC*cC*bD^2*e1*e3*t+1/4*aC*bC*bD*cD*e1*e3*t+5/4*bC*cC*bD*cD*e2*e3*t-5/4*bC^2*cD^2*e2*e3*t-5/4*bC*cC*bD^2*e3^2*t+5/4*bC^2*bD*cD*e3^2*t+2*bD*cD*e1^2*t-2*aD*cD*e1*e2*t+4*aD^2*e2*e3*t+4*bD*cD*e2*e3*t+2*aC*cD*e2*t-2*aC*bD*e3*t-2*bD*cD*t-2*e2*e3*t+t) * hC0 + (-3*aC*bC*e1*e3*t-2*aC^2*e2*e3*t-2*bC*cC*e2*e3*t+bC^2*e3^2*t+aC^2*t-bC*cC*t+4*e2*e3*t) * hD0 + (aD*cD*t) * h3_23 + (-bD*cD*t+t) * h3_33 + (-aA*aB*aD*cD*e1*t-bA*cB*aD*cD*e1*t+cA*aB*bD*cD*e1*t-aA*cB*bD*cD*e1*t-3/2*aC^2*e1*e3*t+1/2*aC*bC*e3^2*t-cA*aB*e1*t+aA*cB*e1*t-3/4*aC*cD*e1*t+aC*aD*e3*t+2*cC*bD*e3*t+5/4*bC*cD*e3*t) * hu2_23 + (-1/4*aC*bC*cC*bD*e1*t+1/4*aC*bC^2*cD*e1*t-bA*aB*aD*cD*e2*t+aA*bB*aD*cD*e2*t-aA*aB*bD*cD*e2*t-cA*bB*bD*cD*e2*t-5/4*bC^2*cC*bD*e3*t+5/4*bC^3*cD*e3*t+bC*aD*e1*t+1/4*aC*bD*e1*t+aA*aB*e2*t+cA*bB*e2*t-aC*aD*e2*t-3*bC*cD*e2*t+5/4*bC*bD*e3*t-3*aC*bC*t) * hu2_32 + (1/4*aC^2*cC*bD*e1*t-1/4*aC^2*bC*cD*e1*t+bA*aB*aD*cD*e1*t-aA*bB*aD*cD*e1*t+aA*aB*bD*cD*e1*t+cA*bB*bD*cD*e1*t-aA*aB*aD*cD*e2*t-bA*cB*aD*cD*e2*t+cA*aB*bD*cD*e2*t-aA*cB*bD*cD*e2*t+5/4*aC*bC*cC*bD*e3*t-5/4*aC*bC^2*cD*e3*t-3/2*aC*bC*e1*e3*t+1/2*bC^2*e3^2*t-aA*aB*e1*t-cA*bB*e1*t-1/2*aC*aD*e1*t-cC*bD*e1*t+4*bC*cD*e1*t-cA*aB*e2*t+aA*cB*e2*t-3/2*bC*aD*e3*t+aC*bD*e3*t+2*aC^2*t-bC*cC*t-2*t) * hu2_33 + (2*aD*cD*e1*e2*t) * hu5_22 + (2*aD*cD*e2*e3*t-aD*cD*t) * hu5_23 + (-2*bD*cD*e1*e2*t+2*e1*e2*t) * hu5_32 + (-2*bD*cD*e2*e3*t+bD*cD*t+2*e2*e3*t-t) * hu5_33 + (-1/2*aC^2*cC*bD*e1*t+1/2*aC^2*bC*cD*e1*t+aA*aB*aD*cD*e2*t+bA*cB*aD*cD*e2*t-cA*aB*bD*cD*e2*t+aA*cB*bD*cD*e2*t-5/2*aC*bC*cC*bD*e3*t+5/2*aC*bC^2*cD*e3*t+3*aC*aD*e1*t+2*cC*bD*e1*t-bC*cD*e1*t+cA*aB*e2*t-aA*cB*e2*t-2*aC*bD*e3*t-4*aC^2*t+4*t) * hu6_22 + (3/2*aC^2*e1*e3*t-1/2*aC*bC*e3^2*t-3/4*aC*cD*e1*t+4*aC*aD*e3*t+1/4*bC*cD*e3*t) * hu6_23 + (-1/4*aC*bC*cC*bD*e1*t+1/4*aC*bC^2*cD*e1*t-5/4*bC^2*cC*bD*e3*t+5/4*bC^3*cD*e3*t+bC*aD*e1*t-3/4*aC*bD*e1*t+1/4*bC*bD*e3*t-aC*bC*t) * hu6_32 + (-1/4*aC^2*cC*bD*e1*t+1/4*aC^2*bC*cD*e1*t+aA*aB*aD*cD*e2*t+bA*cB*aD*cD*e2*t-cA*aB*bD*cD*e2*t+aA*cB*bD*cD*e2*t-5/4*aC*bC*cC*bD*e3*t+5/4*aC*bC^2*cD*e3*t+3/2*aC*bC*e1*e3*t-1/2*bC^2*e3^2*t+5/2*aC*aD*e1*t+cC*bD*e1*t-bC*cD*e1*t+cA*aB*e2*t-aA*cB*e2*t+5/2*bC*aD*e3*t-aC*bD*e3*t-2*aC^2*t+bC*cC*t+2*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll2_23_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m23 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m23) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-bA*aB*aC*aD^3*t+aA*bB*aC*aD^3*t-aA*aB*bC*aD^3*t-bA*cB*bC*aD^3*t-cA*bB*aC*aD^2*bD*t+bA*cB*aC*aD^2*bD*t+cA*aB*bC*aD^2*bD*t-aA*cB*bC*aD^2*bD*t-bA*aB*cC*aD^2*bD*t+aA*bB*cC*aD^2*bD*t-cA*aB*aC*aD*bD^2*t+aA*cB*aC*aD*bD^2*t-aA*aB*cC*aD*bD^2*t-cA*bB*cC*aD*bD^2*t-2*aA*aB*aD^2*e2*t-2*bA*cB*aD^2*e2*t+2*cA*aB*aD*bD*e2*t-2*aA*cB*aD*bD*e2*t+bA*aB*aC*aD*t-aA*bB*aC*aD*t+aA*aB*bC*aD*t+bA*cB*bC*aD*t+2*aC*bC*aD^2*t-aA*aB*aC*bD*t-bA*cB*aC*bD*t+bA*aB*cC*bD*t-aA*bB*cC*bD*t-2*aC^2*aD*bD*t-2*bC*cC*aD*bD*t+2*aC*bC*bD*cD*t+2*aA*aB*e2*t+2*bA*cB*e2*t+2*aD*bD*t) * hE + (3/4*bC*cC*bD*cD*e1*e2*t-3/4*bC^2*cD^2*e1*e2*t+1/4*aC*cC*bD*cD*e2^2*t-1/4*aC*bC*cD^2*e2^2*t-3/4*bC*cC*bD^2*e1*e3*t+3/4*bC^2*bD*cD*e1*e3*t-1/4*aC*cC*bD^2*e2*e3*t+2*bC^2*aD*cD*e2*e3*t-7/4*aC*bC*bD*cD*e2*e3*t-2*bC^2*aD*bD*e3^2*t+2*aC*bC*bD^2*e3^2*t+2*aD*bD*e1^2*t-2*aD^2*e1*e2*t-2*aD*bD*t+2*e1*e2*t) * hC0 + (2*aC^2*e1*e2*t+2*bC*cC*e1*e2*t-bC^2*e1*e3*t+aC*bC*e2*e3*t+2*aC*bC*t) * hD0 + (aD^2*t-t) * h3_23 + (-aD*bD*t) * h3_33 + (-aA*aB*aD^2*e1*t-bA*cB*aD^2*e1*t+cA*aB*aD*bD*e1*t-aA*cB*aD*bD*e1*t-1/2*aC*bC*e1*e3*t+1/2*aC^2*e2*e3*t+aA*aB*e1*t+bA*cB*e1*t-aC*aD*e1*t+19/4*bC*cD*e1*t+1/4*aC*cD*e2*t-6*bC*aD*e3*t-2*aC*bD*e3*t+aC^2*t) * hu2_23 + (-3/4*bC^2*cC*bD*e1*t+3/4*bC^3*cD*e1*t-bA*aB*aD^2*e2*t+aA*bB*aD^2*e2*t-1/4*aC*bC*cC*bD*e2*t-aA*aB*aD*bD*e2*t-cA*bB*aD*bD*e2*t+1/4*aC*bC^2*cD*e2*t-2*bC^3*aD*e3*t+2*aC*bC^2*bD*e3*t-17/4*bC*bD*e1*t+bA*aB*e2*t-aA*bB*e2*t+3*bC*aD*e2*t+1/4*aC*bD*e2*t) * hu2_32 + (bA*aB*aD^2*e1*t-aA*bB*aD^2*e1*t+3/4*aC*bC*cC*bD*e1*t+aA*aB*aD*bD*e1*t+cA*bB*aD*bD*e1*t-3/4*aC*bC^2*cD*e1*t-aA*aB*aD^2*e2*t-bA*cB*aD^2*e2*t+1/4*aC^2*cC*bD*e2*t+cA*aB*aD*bD*e2*t-aA*cB*aD*bD*e2*t-1/4*aC^2*bC*cD*e2*t+2*aC*bC^2*aD*e3*t-2*aC^2*bC*bD*e3*t-1/2*bC^2*e1*e3*t+1/2*aC*bC*e2*e3*t-bA*aB*e1*t+aA*bB*e1*t+13/2*bC*aD*e1*t+3*aC*bD*e1*t+aA*aB*e2*t+bA*cB*e2*t-1/2*aC*aD*e2*t+6*bC*cD*e2*t+aC*bC*t) * hu2_33 + (2*aD^2*e1*e2*t-2*e1*e2*t) * hu5_22 + (2*aD^2*e2*e3*t-aD^2*t-2*e2*e3*t+t) * hu5_23 + (-2*aD*bD*e1*e2*t) * hu5_32 + (-2*aD*bD*e2*e3*t+aD*bD*t) * hu5_33 + (-3/2*aC*bC*cC*bD*e1*t+3/2*aC*bC^2*cD*e1*t+aA*aB*aD^2*e2*t+bA*cB*aD^2*e2*t-1/2*aC^2*cC*bD*e2*t-cA*aB*aD*bD*e2*t+aA*cB*aD*bD*e2*t+1/2*aC^2*bC*cD*e2*t-4*aC*bC^2*aD*e3*t+4*aC^2*bC*bD*e3*t-9*bC*aD*e1*t-7*aC*bD*e1*t-aA*aB*e2*t-bA*cB*e2*t+2*aC*aD*e2*t-5*bC*cD*e2*t-5*bC*bD*e3*t) * hu6_22 + (1/2*aC*bC*e1*e3*t-1/2*aC^2*e2*e3*t-aC*aD*e1*t-13/4*bC*cD*e1*t+1/4*aC*cD*e2*t+3*bC*aD*e3*t-3*aC*bD*e3*t-aC^2*t) * hu6_23 + (-3/4*bC^2*cC*bD*e1*t+3/4*bC^3*cD*e1*t-1/4*aC*bC*cC*bD*e2*t+1/4*aC*bC^2*cD*e2*t-2*bC^3*aD*e3*t+2*aC*bC^2*bD*e3*t-29/4*bC*bD*e1*t+6*bC*aD*e2*t+1/4*aC*bD*e2*t) * hu6_32 + (-3/4*aC*bC*cC*bD*e1*t+3/4*aC*bC^2*cD*e1*t+aA*aB*aD^2*e2*t+bA*cB*aD^2*e2*t-1/4*aC^2*cC*bD*e2*t-cA*aB*aD*bD*e2*t+aA*cB*aD*bD*e2*t+1/4*aC^2*bC*cD*e2*t-2*aC*bC^2*aD*e3*t+2*aC^2*bC*bD*e3*t+1/2*bC^2*e1*e3*t-1/2*aC*bC*e2*e3*t-5/2*bC*aD*e1*t-4*aC*bD*e1*t-aA*aB*e2*t-bA*cB*e2*t+3/2*aC*aD*e2*t+bC*cD*e2*t-5*bC*bD*e3*t-aC*bC*t) * hu6_33) +end Spec0K0 diff --git a/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s3.lean b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s3.lean new file mode 100644 index 0000000000..eb5f8cb4c5 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s3.lean @@ -0,0 +1,192 @@ +/- k=0 radical certificates, class ABCEDF (generated by internal notes from Singular `lift`). -/ +import Nov15.Spec0K0Core +namespace Spec0K0 +variable {K : Type*} [Field K] [CharZero K] + +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll2_24_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m24 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m24) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-3/2*bC*cC*aD*qD2*e2*t+3/2*aC*bC*cD*qD2*e2*t+3/2*bC*cC*bD*qD1*e3*t-3/2*bC^2*cD*qD1*e3*t+3/2*bC^2*aD*qD2*e3*t-3/2*aC*bC*bD*qD2*e3*t+aC*qC1*aD^2*t+aC*qC1*bD*cD*t+aC*aD*qD1*t+bC*cD*qD1*t-bC*aD*qD2*t+aC*bD*qD2*t) * hE + (-1/8*bC*cC*bD*cD*qD2*e2*t+1/8*bC^2*cD^2*qD2*e2*t+1/8*bC*cC*bD^2*qD2*e3*t-1/8*bC^2*bD*cD*qD2*e3*t-1/2*qC1*cD*e2*t+cD*qD1*e2*t-aD*qD2*e2*t+1/2*qC1*bD*e3*t-qD1*e1*t) * hC0 + (aD*e1*t+1/2*cD*e2*t+1/2*bD*e3*t+t) * hC3 + (-1/2*bC*cC*qD2*e2*t+aC*qC1*t) * hD0 + (aC^2*e1*t-bC*cC*e1*t-aC*bC*e3*t+aC*t) * hD3 + (aC*bC*e1*t-1/2*bC*cC*e2*t-3/2*bC^2*e3*t+bC*t+e2*t) * hD4 + (-1/2*aC^2*qD2*e1*t+1/2*aC^2*qD1*e3*t+3/4*aC*bC*qD2*e3*t+3/2*bC*qD2*e1*e3*t-3/2*bC*qD1*e3^2*t-1/8*bC*cD*qD2*t-qC1*cD*e1*t+qC1*aD*e3*t-1/2*aC*qC2*t+1/2*cC*qD1*t-5/2*aC*qD2*t-qD2*e1*t+qD1*e3*t+3/2*qC2*t) * hu2_23 + (1/8*bC^2*cC*bD*qD2*t-1/8*bC^3*cD*qD2*t+aC*bC*qD1*e1*t-3/2*bC*qD2*e1*e2*t+3/2*bC*qD1*e2*e3*t-1/8*bC*bD*qD2*t+1/2*bC*qC1*t-bC*qD1*t) * hu2_32 + (-1/8*aC*bC*cC*bD*qD2*t+1/8*aC*bC^2*cD*qD2*t+bC*cC*qD1*e1*t-1/2*aC*bC*qD2*e1*t+1/2*aC*bC*qD1*e3*t+3/4*bC^2*qD2*e3*t-1/4*bC*aD*qD2*t-qC1*aD*e1*t-qC1*cD*e2*t-1/2*aC*qC1*t-1/2*bC*qC2*t+aC*qD1*t+bC*qD2*t-qD1*e1*t-qD2*e2*t+1/2*qC1*t) * hu2_33 + (1/4*aC*bC*cC*bD*qD2*t-1/4*aC*bC^2*cD*qD2*t-3/2*bC*qD1*e1*e3*t-3/2*bC*qD2*e2*e3*t+qC1*aD*e1*t+qC1*cD*e2*t+aC*qC1*t-2*aC*qD1*t-bC*qD2*t+qD1*e1*t+qD2*e2*t-qC1*t) * hu6_22 + (1/2*aC^2*qD2*e1*t-1/2*aC^2*qD1*e3*t-3/4*aC*bC*qD2*e3*t-1/8*bC*cD*qD2*t+1/2*aC*qC2*t+1/2*cC*qD1*t+1/2*aC*qD2*t-1/2*qC2*t) * hu6_23 + (1/8*bC^2*cC*bD*qD2*t-1/8*bC^3*cD*qD2*t-aC*bC*qD1*e1*t+3/8*bC*bD*qD2*t+1/2*bC*qC1*t-bC*qD1*t) * hu6_32 + (1/8*aC*bC*cC*bD*qD2*t-1/8*aC*bC^2*cD*qD2*t-bC*cC*qD1*e1*t+1/2*aC*bC*qD2*e1*t-1/2*aC*bC*qD1*e3*t-3/4*bC^2*qD2*e3*t-3/2*bC*qD1*e1*e3*t-3/2*bC*qD2*e2*e3*t-1/4*bC*aD*qD2*t+qC1*aD*e1*t+qC1*cD*e2*t+1/2*aC*qC1*t+1/2*bC*qC2*t-aC*qD1*t+qD1*e1*t+qD2*e2*t-1/2*qC1*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll2_32_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m32 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m32) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-2*aC*cC*aD^2*t-2*aC*cC*bD*cD*t-2*cC*aD*e1*t+2*aC*cD*e1*t) * hE + (-1/4*cC^2*bD*cD*e1*e2*t+1/4*bC*cC*cD^2*e1*e2*t+1/4*cC^2*bD^2*e1*e3*t-1/4*bC*cC*bD*cD*e1*e3*t+7*bC*cC*aD*cD*e2*e3*t-11/4*aC*cC*bD*cD*e2*e3*t-17/4*aC*bC*cD^2*e2*e3*t-7*bC*cC*aD*bD*e3^2*t+11/4*aC*cC*bD^2*e3^2*t+17/4*aC*bC*bD*cD*e3^2*t-2*e1*e3*t) * hC0 + (-2*aC^2*e1*e3*t+bC*cC*e1*e3*t-aC*bC*e3^2*t-2*aC*cC*t) * hD0 + (-1/2*aC^2*e3^2*t-1/4*cC*cD*e1*t+2*cC*aD*e3*t+13/4*aC*cD*e3*t) * hu2_23 + (1/4*bC*cC^2*bD*e1*t-1/4*bC^2*cC*cD*e1*t-7*bC^2*cC*aD*e3*t+11/4*aC*bC*cC*bD*e3*t+17/4*aC*bC^2*cD*e3*t+3/2*aC*bC*e1*e3*t-aC*aD*e1*t-1/4*cC*bD*e1*t+bC*cD*e1*t-2*aC*cD*e2*t+4*bC*aD*e3*t-3/4*aC*bD*e3*t-aC^2*t-2*e1^2*t) * hu2_32 + (-1/4*aC*cC^2*bD*e1*t+1/4*aC*bC*cC*cD*e1*t+7*aC*bC*cC*aD*e3*t-11/4*aC^2*cC*bD*e3*t-17/4*aC^2*bC*cD*e3*t+3/2*bC*cC*e1*e3*t-1/2*aC*bC*e3^2*t-7/2*cC*aD*e1*t+aC*cD*e1*t-2*cC*cD*e2*t-13/2*aC*aD*e3*t-bC*cD*e3*t-aC*cC*t-2*e1*e3*t) * hu2_33 + (1/2*aC*cC^2*bD*e1*t-1/2*aC*bC*cC*cD*e1*t-14*aC*bC*cC*aD*e3*t+11/2*aC^2*cC*bD*e3*t+17/2*aC^2*bC*cD*e3*t+3*cC*aD*e1*t+3*aC*cD*e1*t+3*cC*cD*e2*t+10*aC*aD*e3*t-cC*bD*e3*t) * hu6_22 + (1/2*aC^2*e3^2*t-1/4*cC*cD*e1*t-cC*aD*e3*t+17/4*aC*cD*e3*t) * hu6_23 + (1/4*bC*cC^2*bD*e1*t-1/4*bC^2*cC*cD*e1*t-7*bC^2*cC*aD*e3*t+11/4*aC*bC*cC*bD*e3*t+17/4*aC*bC^2*cD*e3*t-3/2*aC*bC*e1*e3*t+aC*aD*e1*t+3/4*cC*bD*e1*t+3*bC*cD*e1*t-cC*aD*e2*t-aC*cD*e2*t+4*bC*aD*e3*t-7/4*aC*bD*e3*t+aC^2*t) * hu6_32 + (1/4*aC*cC^2*bD*e1*t-1/4*aC*bC*cC*cD*e1*t-7*aC*bC*cC*aD*e3*t+11/4*aC^2*cC*bD*e3*t+17/4*aC^2*bC*cD*e3*t-3/2*bC*cC*e1*e3*t+1/2*aC*bC*e3^2*t+3/2*cC*aD*e1*t+2*aC*cD*e1*t+cC*cD*e2*t+7/2*aC*aD*e3*t-cC*bD*e3*t-bC*cD*e3*t+aC*cC*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll2_33_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m33 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m33) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-bA*aB*aC*aD^2*cD*t+aA*bB*aC*aD^2*cD*t-aA*aB*bC*aD^2*cD*t-bA*cB*bC*aD^2*cD*t-cA*bB*aC*aD*bD*cD*t+bA*cB*aC*aD*bD*cD*t+cA*aB*bC*aD*bD*cD*t-aA*cB*bC*aD*bD*cD*t-bA*aB*cC*aD*bD*cD*t+aA*bB*cC*aD*bD*cD*t-cA*aB*aC*bD^2*cD*t+aA*cB*aC*bD^2*cD*t-aA*aB*cC*bD^2*cD*t-cA*bB*cC*bD^2*cD*t-2*aA*aB*aD*cD*e2*t-2*bA*cB*aD*cD*e2*t+2*cA*aB*bD*cD*e2*t-2*aA*cB*bD*cD*e2*t+aA*aB*aC*aD*t+cA*bB*aC*aD*t-cA*aB*bC*aD*t+aA*cB*bC*aD*t+aC^2*aD^2*t-bC*cC*aD^2*t+cA*aB*aC*bD*t-aA*cB*aC*bD*t+aA*aB*cC*bD*t+cA*bB*cC*bD*t-aC^2*bD*cD*t-3*bC*cC*bD*cD*t-2*cA*aB*e2*t+2*aA*cB*e2*t+2*bD*cD*t) * hE + (3/4*aC*cC*bD*cD*e1*e2*t-3/4*aC*bC*cD^2*e1*e2*t-1/4*cC^2*bD*cD*e2^2*t+1/4*bC*cC*cD^2*e2^2*t-3/4*aC*cC*bD^2*e1*e3*t+3/4*aC*bC*bD*cD*e1*e3*t+1/4*cC^2*bD^2*e2*e3*t+bC*cC*bD*cD*e2*e3*t-5/4*bC^2*cD^2*e2*e3*t-5/4*bC*cC*bD^2*e3^2*t+5/4*bC^2*bD*cD*e3^2*t+2*bD*cD*e1^2*t-2*aD*cD*e1*e2*t+4*aD^2*e2*e3*t+4*bD*cD*e2*e3*t+6*aC*cD*e2*t-6*aC*bD*e3*t-2*bD*cD*t-2*e2*e3*t+t) * hC0 + (-aC*bC*e1*e3*t-2*aC^2*e2*e3*t-2*bC*cC*e2*e3*t+aC^2*t-bC*cC*t+4*e2*e3*t) * hD0 + (aD*cD*t) * h3_23 + (-bD*cD*t+t) * h3_33 + (-aA*aB*aD*cD*e1*t-bA*cB*aD*cD*e1*t+cA*aB*bD*cD*e1*t-aA*cB*bD*cD*e1*t-1/2*aC^2*e1*e3*t-cA*aB*e1*t+aA*cB*e1*t-1/4*aC*cD*e1*t-1/4*cC*cD*e2*t+5*aC*aD*e3*t+9*cC*bD*e3*t+5/4*bC*cD*e3*t) * hu2_23 + (-3/4*aC*bC*cC*bD*e1*t+3/4*aC*bC^2*cD*e1*t+1/4*bC*cC^2*bD*e2*t-1/4*bC^2*cC*cD*e2*t-bA*aB*aD*cD*e2*t+aA*bB*aD*cD*e2*t-aA*aB*bD*cD*e2*t-cA*bB*bD*cD*e2*t-5/4*bC^2*cC*bD*e3*t+5/4*bC^3*cD*e3*t+3*bC*aD*e1*t+3/4*aC*bD*e1*t+aA*aB*e2*t+cA*bB*e2*t-5*aC*aD*e2*t-1/4*cC*bD*e2*t-10*bC*cD*e2*t-3/4*bC*bD*e3*t-7*aC*bC*t) * hu2_32 + (3/4*aC^2*cC*bD*e1*t-3/4*aC^2*bC*cD*e1*t+bA*aB*aD*cD*e1*t-aA*bB*aD*cD*e1*t+aA*aB*bD*cD*e1*t+cA*bB*bD*cD*e1*t-1/4*aC*cC^2*bD*e2*t+1/4*aC*bC*cC*cD*e2*t-aA*aB*aD*cD*e2*t-bA*cB*aD*cD*e2*t+cA*aB*bD*cD*e2*t-aA*cB*bD*cD*e2*t+5/4*aC*bC*cC*bD*e3*t-5/4*aC*bC^2*cD*e3*t-1/2*aC*bC*e1*e3*t-aA*aB*e1*t-cA*bB*e1*t-11/2*aC*aD*e1*t-5*cC*bD*e1*t+12*bC*cD*e1*t-cA*aB*e2*t+aA*cB*e2*t-1/2*cC*aD*e2*t-aC*cD*e2*t-11/2*bC*aD*e3*t+6*aC^2*t-bC*cC*t-6*t) * hu2_33 + (2*aD*cD*e1*e2*t) * hu5_22 + (2*aD*cD*e2*e3*t-aD*cD*t) * hu5_23 + (-2*bD*cD*e1*e2*t+2*e1*e2*t) * hu5_32 + (-2*bD*cD*e2*e3*t+bD*cD*t+2*e2*e3*t-t) * hu5_33 + (-3/2*aC^2*cC*bD*e1*t+3/2*aC^2*bC*cD*e1*t+1/2*aC*cC^2*bD*e2*t-1/2*aC*bC*cC*cD*e2*t+aA*aB*aD*cD*e2*t+bA*cB*aD*cD*e2*t-cA*aB*bD*cD*e2*t+aA*cB*bD*cD*e2*t-5/2*aC*bC*cC*bD*e3*t+5/2*aC*bC^2*cD*e3*t+17*aC*aD*e1*t+11*cC*bD*e1*t+cA*aB*e2*t-aA*cB*e2*t+2*aC*cD*e2*t-12*aC^2*t+12*t) * hu6_22 + (1/2*aC^2*e1*e3*t-1/4*aC*cD*e1*t-1/4*cC*cD*e2*t+6*aC*aD*e3*t-2*cC*bD*e3*t+5/4*bC*cD*e3*t) * hu6_23 + (-3/4*aC*bC*cC*bD*e1*t+3/4*aC*bC^2*cD*e1*t+1/4*bC*cC^2*bD*e2*t-1/4*bC^2*cC*cD*e2*t-5/4*bC^2*cC*bD*e3*t+5/4*bC^3*cD*e3*t+3*bC*aD*e1*t-9/4*aC*bD*e1*t-2*aC*aD*e2*t-1/4*cC*bD*e2*t+1/4*bC*bD*e3*t-5*aC*bC*t) * hu6_32 + (-3/4*aC^2*cC*bD*e1*t+3/4*aC^2*bC*cD*e1*t+1/4*aC*cC^2*bD*e2*t-1/4*aC*bC*cC*cD*e2*t+aA*aB*aD*cD*e2*t+bA*cB*aD*cD*e2*t-cA*aB*bD*cD*e2*t+aA*cB*bD*cD*e2*t-5/4*aC*bC*cC*bD*e3*t+5/4*aC*bC^2*cD*e3*t+1/2*aC*bC*e1*e3*t+23/2*aC*aD*e1*t+6*cC*bD*e1*t+cA*aB*e2*t-aA*cB*e2*t-1/2*cC*aD*e2*t+aC*cD*e2*t+13/2*bC*aD*e3*t-6*aC^2*t+bC*cC*t+6*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll2_34_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m34 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_32 := congrArg M4.m32 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_32 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3))).m34) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (bA*aB*aC*aD^2*qD2*e3*t-aA*bB*aC*aD^2*qD2*e3*t+aA*aB*bC*aD^2*qD2*e3*t+bA*cB*bC*aD^2*qD2*e3*t+cA*bB*aC*aD*bD*qD2*e3*t-bA*cB*aC*aD*bD*qD2*e3*t-cA*aB*bC*aD*bD*qD2*e3*t+aA*cB*bC*aD*bD*qD2*e3*t+bA*aB*cC*aD*bD*qD2*e3*t-aA*bB*cC*aD*bD*qD2*e3*t+cA*aB*aC*bD^2*qD2*e3*t-aA*cB*aC*bD^2*qD2*e3*t+aA*aB*cC*bD^2*qD2*e3*t+cA*bB*cC*bD^2*qD2*e3*t-cA*aB*aC*aD*qD2*e2*t+aA*cB*aC*aD*qD2*e2*t-aA*aB*cC*aD*qD2*e2*t-cA*bB*cC*aD*qD2*e2*t+aA*aB*aC*cD*qD2*e2*t+cA*bB*aC*cD*qD2*e2*t-cA*aB*bC*cD*qD2*e2*t+aA*cB*bC*cD*qD2*e2*t+aA*aB*aC*aD*qD1*e3*t+cA*bB*aC*aD*qD1*e3*t-cA*aB*bC*aD*qD1*e3*t+aA*cB*bC*aD*qD1*e3*t+cA*aB*aC*bD*qD1*e3*t-aA*cB*aC*bD*qD1*e3*t+aA*aB*cC*bD*qD1*e3*t+cA*bB*cC*bD*qD1*e3*t+2*aA*aB*aD*qD2*e2*e3*t+2*bA*cB*aD*qD2*e2*e3*t-2*cA*aB*bD*qD2*e2*e3*t+2*aA*cB*bD*qD2*e2*e3*t-2*aC*cC*aD*qD2*e2*t+2*aC^2*cD*qD2*e2*t+2*aC*cC*bD*qD1*e3*t-2*aC*bC*cD*qD1*e3*t+2*aC*bC*aD*qD2*e3*t+2*bC*cC*bD*qD2*e3*t-2*cA*aB*qD1*e2*e3*t+2*aA*cB*qD1*e2*e3*t-2*cC*aD*qD1*e2*e3*t+2*aC*cD*qD1*e2*e3*t-2*aA*aB*qD2*e2*e3*t-2*cA*bB*qD2*e2*e3*t-2*aC*aD*qD2*e2*e3*t-2*cC*bD*qD2*e2*e3*t-aC*qC2*aD^2*t-aC*qC2*bD*cD*t-cC*aD*qD1*t+aC*cD*qD1*t-aC*aD*qD2*t-cC*bD*qD2*t-2*bD*qD2*e3*t) * hE + (-2*bD*qD2*e1^2*e3*t+2*aD*qD2*e1*e2*e3*t-2*cD*qD1*e1*t+2*aD*qD2*e1*t+1/2*qC2*cD*e2*t-1/2*qC2*bD*e3*t+2*aD*qD1*e3*t+4*bD*qD2*e3*t-qD2*e1*t+qD1*e3*t) * hC0 + (-aD*e1*t-1/2*cD*e2*t-1/2*bD*e3*t+t) * hC4 + (-aC*qC2*t) * hD0 + (-2*aC*cC*e1*t-aC^2*e3*t+bC*cC*e3*t-2*cC*e2*e3*t-cC*t+2*e3*t) * hD3 + (aC^2*e1*t-bC*cC*e1*t-2*aC*bC*e3*t+2*aC*e2*e3*t+aC*t-2*e1*t) * hD4 + (-aD*qD2*e3*t) * h3_23 + (-qD2*e2*t) * h3_32 + (bD*qD2*e3*t+qD1*e3*t) * h3_33 + (aA*aB*aD*qD2*e1*e3*t+bA*cB*aD*qD2*e1*e3*t-cA*aB*bD*qD2*e1*e3*t+aA*cB*bD*qD2*e1*e3*t-cA*aB*qD1*e1*e3*t+aA*cB*qD1*e1*e3*t-cA*aB*qD2*e2*e3*t+aA*cB*qD2*e2*e3*t+aC^2*qD2*e3*t+2*aC*qD2*e1*e3*t-2*aC*qD1*e3^2*t+qC2*cD*e1*t-qC2*aD*e3*t+3/2*cC*qD2*t) * hu2_23 + (bA*aB*aD*qD2*e2*e3*t-aA*bB*aD*qD2*e2*e3*t+aA*aB*bD*qD2*e2*e3*t+cA*bB*bD*qD2*e2*e3*t-aA*aB*qD2*e1*e2*t-cA*bB*qD2*e1*e2*t+aA*aB*qD1*e2*e3*t+cA*bB*qD1*e2*e3*t+aC^2*qD1*e1*t+aC*bC*qD2*e1*t-2*aC*qD2*e1*e2*t-aC*bC*qD1*e3*t+3*aC*qD1*e2*e3*t+2*bC*qD2*e2*e3*t-2*qD1*e1*e2*e3*t-2*qD2*e2^2*e3*t-1/2*aC*qC1*t-1/2*bC*qC2*t+aC*qD1*t+11/2*bC*qD2*t-qD1*e1*t-qD2*e2*t+1/2*qC1*t) * hu2_32 + (-bA*aB*aD*qD2*e1*e3*t+aA*bB*aD*qD2*e1*e3*t-aA*aB*bD*qD2*e1*e3*t-cA*bB*bD*qD2*e1*e3*t+aA*aB*aD*qD2*e2*e3*t+bA*cB*aD*qD2*e2*e3*t-cA*aB*bD*qD2*e2*e3*t+aA*cB*bD*qD2*e2*e3*t+cA*aB*qD2*e1*e2*t-aA*cB*qD2*e1*e2*t-aA*aB*qD1*e1*e3*t-cA*bB*qD1*e1*e3*t-cA*aB*qD1*e2*e3*t+aA*cB*qD1*e2*e3*t-aA*aB*qD2*e2*e3*t-cA*bB*qD2*e2*e3*t+aC*cC*qD1*e1*t+bC*cC*qD2*e1*t-bC*cC*qD1*e3*t+aC*bC*qD2*e3*t+cC*qD1*e2*e3*t-2*aC*qD2*e2*e3*t+2*qD2*e1*e2*e3*t-2*qD1*e2*e3^2*t+qC2*aD*e1*t+qC2*cD*e2*t-1/2*cC*qC1*t+1/2*aC*qC2*t+cC*qD1*t-3*aC*qD2*t+qD2*e1*t-qD1*e3*t-3/2*qC2*t) * hu2_33 + (-2*aD*qD2*e1*e2*e3*t) * hu5_22 + (-2*aD*qD2*e2*e3^2*t+aD*qD2*e3*t) * hu5_23 + (2*bD*qD2*e1*e2*e3*t+2*qD1*e1*e2*e3*t+2*qD2*e2^2*e3*t-qD2*e2*t) * hu5_32 + (2*bD*qD2*e2*e3^2*t-2*qD2*e1*e2*e3*t+2*qD1*e2*e3^2*t-bD*qD2*e3*t-qD1*e3*t) * hu5_33 + (-aA*aB*aD*qD2*e2*e3*t-bA*cB*aD*qD2*e2*e3*t+cA*aB*bD*qD2*e2*e3*t-aA*cB*bD*qD2*e2*e3*t-cA*aB*qD2*e1*e2*t+aA*cB*qD2*e1*e2*t+cA*aB*qD1*e2*e3*t-aA*cB*qD1*e2*e3*t-2*aC*qD1*e1*e3*t-qC2*aD*e1*t-qC2*cD*e2*t-aC*qC2*t-3*cC*qD1*t+6*aC*qD2*t) * hu6_22 + (-aC^2*qD2*e3*t+3/2*cC*qD2*t) * hu6_23 + (-aC^2*qD1*e1*t-aC*bC*qD2*e1*t+aC*bC*qD1*e3*t-aC*qD1*e2*e3*t+1/2*aC*qC1*t-1/2*bC*qC2*t+aC*qD1*t+3/2*bC*qD2*t+1/2*qC1*t) * hu6_32 + (-aA*aB*aD*qD2*e2*e3*t-bA*cB*aD*qD2*e2*e3*t+cA*aB*bD*qD2*e2*e3*t-aA*cB*bD*qD2*e2*e3*t-cA*aB*qD2*e1*e2*t+aA*cB*qD2*e1*e2*t+cA*aB*qD1*e2*e3*t-aA*cB*qD1*e2*e3*t-aC*cC*qD1*e1*t-bC*cC*qD2*e1*t+bC*cC*qD1*e3*t-aC*bC*qD2*e3*t-2*aC*qD1*e1*e3*t-cC*qD1*e2*e3*t-qC2*aD*e1*t-qC2*cD*e2*t+1/2*cC*qC1*t-1/2*aC*qC2*t-2*cC*qD1*t+3*aC*qD2*t+1/2*qC2*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll5_12_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m12 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m12) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (4*aA^2*pA2*aB*e3*t+4*bA*cA*pA2*aB*e3*t-aA*bA*aB*pB1*e3*t-bA*cA*bB*pB1*e3*t+bA*cA*aB*pB2*e3*t-aA*bA*cB*pB2*e3*t-bA*aB*pB1*e1*e3*t+aA*bB*pB1*e1*e3*t-aA*aB*pB2*e1*e3*t-bA*cB*pB2*e1*e3*t-aA*aB*pB1*e2*e3*t-cA*bB*pB1*e2*e3*t+cA*aB*pB2*e2*e3*t-aA*cB*pB2*e2*e3*t-aA*pA1*aB^2*t+cA*pA2*aB^2*t-aA*pA1*bB*cB*t+cA*pA2*bB*cB*t+aA*pA1*aB*e1*t+cA*pA2*aB*e1*t+bA*pA1*cB*e1*t-aA*pA2*cB*e1*t-cA*pA1*aB*e2*t+aA*pA1*cB*e2*t-2*bA*pA1*aB*e3*t-aA*pA2*aB*e3*t+2*aA*pA1*bB*e3*t-cA*pA2*bB*e3*t+pB2*e3*t-pA1*t) * hE + (cA*pA1*aB*cB*e2^2*t+cA*pA2*cB^2*e2^2*t-cA*pA1*aB*bB*e2*e3*t-aA*pA2*aB*cB*e2*e3*t-3*cA*pA2*bB*cB*e2*e3*t+bA*pA2*cB^2*e2*e3*t+aA*pA2*aB*bB*e3^2*t+2*cA*pA2*bB^2*e3^2*t-bA*pA2*bB*cB*e3^2*t-pA1*aB*cB*e1*e2*t-pA2*cB^2*e1*e2*t+aA*cB*pB1*e1*e2*t+cA*cB*pB2*e1*e2*t+pA1*cB^2*e2^2*t-3*pA1*aB*bB*e1*e3*t-3*pA2*bB*cB*e1*e3*t+4*pA1*aB^2*e2*e3*t+2*pA2*aB*cB*e2*e3*t+pA1*bB*cB*e2*e3*t-aA*aB*pB1*e2*e3*t-bA*cB*pB1*e2*e3*t-cA*aB*pB2*e2*e3*t+aA*cB*pB2*e2*e3*t+2*pA2*aB*bB*e3^2*t-2*pA1*bB^2*e3^2*t+bA*bB*pB1*e3^2*t-aA*bB*pB2*e3^2*t+2*pA2*cB*e1*t-pA1*cB*e2*t+2*pA2*aB*e3*t+pA1*bB*e3*t) * hA0 + (-aB*cB*e1*e2*t+cB^2*e2^2*t-3*aB*bB*e1*e3*t-3*bB*cB*e2*e3*t-2*bB^2*e3^2*t+aB*e1*t+cB*e2*t+2*bB*e3*t+2*e2*e3*t-t) * hA1 + (-cB^2*e1*e2*t-3*bB*cB*e1*e3*t+2*aB*cB*e2*e3*t+2*aB*bB*e3^2*t+cB*e1*t+aB*e3*t+2*e1*e3*t) * hA2 + (cA*pA1*e1*e2*t+bA*pA1*e1*e3*t+2*aA*pA2*e1*e3*t+2*aA*pA1*e2*e3*t-cA*pA2*e2*e3*t-bA*pA2*e3^2*t+4*pA1*e2*e3*t-aA*pA1*t+cA*pA2*t) * hB0 + (cA*e1*e2*t-aA*bA*e3*t) * hB1 + (-bA*cA*e3*t+bA*e3^2*t) * hB2 + (aA*cA*pA1*aB*e2*t+aA*cA*pA2*cB*e2*t-aA^2*pA2*aB*e3*t-2*aA*cA*pA2*bB*e3*t+aA*bA*pA2*cB*e3*t+aA^2*pB1*e1*t+aA*cA*pB2*e1*t-aA*pA1*e1^2*t+aA*pB1*e1^2*t+cA*pA1*aB*e2*t+aA*pA1*cB*e2*t+cA*pA2*cB*e2*t-cA*pA1*e1*e2*t+cA*pB1*e1*e2*t+aA*pA2*aB*e3*t+2*aA*pA1*bB*e3*t+3*cA*pA2*bB*e3*t-aA*bA*pB1*e3*t+aA^2*pB2*e3*t-aA*pA2*e1*e3*t+pB2*e1^2*e3*t+3*cA*pA2*e2*e3*t-pB1*e1*e2*e3*t+pA1*aB*e1*t-pA2*cB*e1*t-pA1*e1^2*t+3*pA1*cB*e2*t+pA1*bB*e3*t-2*pA1*e2*e3*t-aA*pA1*t-2*cA*pA2*t-pB1*e1*t-2*pB2*e3*t) * hu5_22 + (-cA^2*pA1*aB*e2*t-cA^2*pA2*cB*e2*t+aA*cA*pA2*aB*e3*t+2*cA^2*pA2*bB*e3*t-bA*cA*pA2*cB*e3*t-aA*cA*pB1*e1*t-cA^2*pB2*e1*t+cA*pA1*e1^2*t-cA*pB1*e1^2*t-cA*pA1*cB*e2*t-3*aA*pA1*aB*e3*t-cA*pA2*aB*e3*t-2*cA*pA1*bB*e3*t+aA^2*pB1*e3*t+bA*cA*pB1*e3*t-aA*pA1*e1*e3*t-3*cA*pA2*e1*e3*t+aA*pB1*e1*e3*t+pB1*e1^2*e3*t-aA*pA2*e3^2*t+pB2*e1*e3^2*t-2*pA1*cB*e1*t+pA1*aB*e3*t+pA2*cB*e3*t+pA1*e1*e3*t+cA*pA1*t-pB1*e3*t) * hu5_23 + (bA*cA*pA1*aB*e2*t+bA*cA*pA2*cB*e2*t-aA*bA*pA2*aB*e3*t-2*bA*cA*pA2*bB*e3*t+bA^2*pA2*cB*e3*t+aA*bA*pB1*e1*t+bA*cA*pB2*e1*t-bA*pA1*e1^2*t+bA*pB1*e1^2*t-aA*pA1*aB*e2*t+bA*pA1*cB*e2*t-aA*pA2*cB*e2*t+aA*pA1*e1*e2*t-aA*pB1*e1*e2*t+bA*pA2*aB*e3*t+2*bA*pA1*bB*e3*t-3*aA*pA2*bB*e3*t-bA^2*pB1*e3*t+aA*bA*pB2*e3*t-bA*pA2*e1*e3*t-bA*pB2*e1*e3*t-3*aA*pA2*e2*e3*t+bA*pB1*e2*e3*t-pB2*e1*e2*e3*t+pB1*e2^2*e3*t-pA2*e1^2*t-pA1*aB*e2*t+pA2*cB*e2*t+pA1*e1*e2*t+4*pA2*bB*e3*t+pA2*e2*e3*t-bA*pA1*t+2*aA*pA2*t-pB2*e1*t) * hu5_32 + (aA*cA*pA1*aB*e2*t+aA*cA*pA2*cB*e2*t-aA^2*pA2*aB*e3*t-2*aA*cA*pA2*bB*e3*t+aA*bA*pA2*cB*e3*t+aA^2*pB1*e1*t+aA*cA*pB2*e1*t-aA*pA1*e1^2*t+aA*pB1*e1^2*t+aA*pA1*cB*e2*t-3*bA*pA1*aB*e3*t+aA*pA2*aB*e3*t+2*aA*pA1*bB*e3*t+aA^2*pB2*e3*t+bA*cA*pB2*e3*t-bA*pA1*e1*e3*t+3*aA*pA2*e1*e3*t-pB1*e1*e2*e3*t-bA*pA2*e3^2*t-bA*pB2*e3^2*t-pB2*e2*e3^2*t+pA1*aB*e1*t+pA2*cB*e1*t+pA1*cB*e2*t+pA1*bB*e3*t-2*pA2*e1*e3*t+pA1*e2*e3*t-aA*pA1*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll5_13_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m13 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m13) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-4*aA^2*pA2*aB*e1*t-4*bA*cA*pA2*aB*e1*t-2*aA^2*aB*pB2*e1*t-2*bA*cA*aB*pB2*e1*t+2*aA^2*aB*pB1*e2*t+2*bA*cA*aB*pB1*e2*t-bA^2*aB*pB1*e3*t+aA*bA*bB*pB1*e3*t-aA*bA*aB*pB2*e3*t-bA^2*cB*pB2*e3*t-bA*pA1*aB^2*t-5*aA*pA2*aB^2*t-bA*pA1*bB*cB*t-5*aA*pA2*bB*cB*t-2*aA*aB^2*pB2*t-2*aA*bB*cB*pB2*t+bA*pA1*aB*e1*t-aA*pA2*aB*e1*t-aA*pA1*bB*e1*t-cA*pA2*bB*e1*t+3*aA*pA1*aB*e2*t+2*cA*pA2*aB*e2*t+cA*pA1*bB*e2*t+2*bA*pA1*cB*e2*t-2*aA*pA2*cB*e2*t-bA*pA2*aB*e3*t+aA*pA2*bB*e3*t+4*aA*pA2*t+2*aA*pB2*t+pA2*t) * hE + (cA*pA2*aB*cB*e2^2*t+cA*pA1*bB*cB*e2^2*t-2*aA*pA2*cB^2*e2^2*t-cA*pA2*aB*bB*e2*e3*t-cA*pA1*bB^2*e2*e3*t-bA*pA2*aB*cB*e2*e3*t+3*aA*pA2*bB*cB*e2*e3*t+bA*pA2*aB*bB*e3^2*t-aA*pA2*bB^2*e3^2*t-pA2*aB*cB*e1*e2*t+pA1*bB*cB*e1*e2*t+bA*cB*pB1*e1*e2*t-aA*cB*pB2*e1*e2*t-pA1*aB*cB*e2^2*t+aA*cB*pB1*e2^2*t+cA*cB*pB2*e2^2*t-pA2*aB*bB*e1*e3*t+pA1*bB^2*e1*e3*t+2*pA2*aB^2*e2*e3*t-pA1*aB*bB*e2*e3*t-bA*aB*pB1*e2*e3*t-aA*bB*pB1*e2*e3*t+aA*aB*pB2*e2*e3*t-cA*bB*pB2*e2*e3*t-4*pA2*aB*e1*t-2*pA1*bB*e1*t-2*aB*pB2*e1*t+2*pA1*aB*e2*t-3*pA2*cB*e2*t+2*aB*pB1*e2*t+3*pA2*bB*e3*t) * hA0 + (bB*cB*e1*e2*t-aB*cB*e2^2*t+bB^2*e1*e3*t-aB*bB*e2*e3*t-bB*e1*t+3*aB*e2*t-2*e1*e2*t) * hA1 + (-aB*cB*e1*e2*t-aB*bB*e1*e3*t-2*bB*cB*e2*e3*t+aB*e1*t+2*cB*e2*t-bB*e3*t+2*e2*e3*t+t) * hA2 + (-2*aA*pA1*e1*e2*t+cA*pA2*e1*e2*t+cA*pA1*e2^2*t+bA*pA2*e1*e3*t+bA*pA1*e2*e3*t+2*aA*pA2*e2*e3*t+2*pA2*e2*e3*t-bA*pA1*t-5*aA*pA2*t-2*aA*pB2*t) * hB0 + (-2*aA*e1*e2*t+cA*e2^2*t-bA^2*e3*t+2*e2*t) * hB1 + (-cA*e1*e2*t+aA*bA*e3*t-2*aA*e2*e3*t) * hB2 + (aA*cA*pA2*aB*e2*t+aA*cA*pA1*bB*e2*t-2*aA^2*pA2*cB*e2*t-aA*bA*pA2*aB*e3*t+aA^2*pA2*bB*e3*t+aA*bA*pB1*e1*t-aA^2*pB2*e1*t+aA*pA2*e1^2*t+aA*pB2*e1^2*t-aA*pA1*aB*e2*t+cA*pA2*aB*e2*t-cA*pA1*bB*e2*t+aA^2*pB1*e2*t+aA*cA*pB2*e2*t-aA*pA1*e1*e2*t-3*cA*pA2*e1*e2*t-aA*pB1*e1*e2*t-cA*pB2*e1*e2*t-cA*pA1*e2^2*t+cA*pB1*e2^2*t+bA*pB2*e1*e3*t-bA*pB1*e2*e3*t+7*pA2*aB*e1*t+pA1*bB*e1*t+2*aB*pB2*e1*t+7*pA2*cB*e2*t+2*cB*pB2*e2*t-pA1*e1*e2*t-pA2*bB*e3*t-pA2*e2*e3*t-3*aA*pA2*t+pB1*e2*t) * hu5_22 + (-cA^2*pA2*aB*e2*t-cA^2*pA1*bB*e2*t+2*aA*cA*pA2*cB*e2*t+bA*cA*pA2*aB*e3*t-aA*cA*pA2*bB*e3*t-bA*cA*pB1*e1*t+aA*cA*pB2*e1*t+3*cA*pA2*e1^2*t+cA*pB2*e1^2*t+cA*pA1*aB*e2*t-aA*cA*pB1*e2*t-cA^2*pB2*e2*t+cA*pA1*e1*e2*t-cA*pB1*e1*e2*t-aA*pA2*aB*e3*t+aA*pA1*bB*e3*t+aA*bA*pB1*e3*t-aA^2*pB2*e3*t+aA*pA2*e1*e3*t+bA*pB1*e1*e3*t+aA*pB2*e1*e3*t-aA*pA1*e2*e3*t-aA*pB1*e2*e3*t+bA*pB2*e3^2*t-8*pA2*cB*e1*t-2*cB*pB2*e1*t-pA1*e1^2*t+7*pA2*aB*e3*t+pA1*bB*e3*t+2*aB*pB2*e3*t+pA2*e1*e3*t-2*pA1*e2*e3*t-2*aA*pA1*t+3*cA*pA2*t-pB1*e1*t-pB2*e3*t) * hu5_23 + (bA*cA*pA2*aB*e2*t+bA*cA*pA1*bB*e2*t-2*aA*bA*pA2*cB*e2*t-bA^2*pA2*aB*e3*t+aA*bA*pA2*bB*e3*t+bA^2*pB1*e1*t-aA*bA*pB2*e1*t+bA*pA2*e1^2*t+bA*pB2*e1^2*t-bA*pA1*aB*e2*t-aA*pA2*aB*e2*t+aA*pA1*bB*e2*t+aA*bA*pB1*e2*t+bA*cA*pB2*e2*t-bA*pA1*e1*e2*t+3*aA*pA2*e1*e2*t-bA*pB1*e1*e2*t+aA*pB2*e1*e2*t+aA*pA1*e2^2*t-aA*pB1*e2^2*t+2*pA2*bB*e1*t-3*pA2*aB*e2*t-pA1*bB*e2*t-pA2*e1*e2*t-pA1*e2^2*t-3*bA*pA2*t-pB2*e2*t) * hu5_32 + (aA*cA*pA2*aB*e2*t+aA*cA*pA1*bB*e2*t-2*aA^2*pA2*cB*e2*t-aA*bA*pA2*aB*e3*t+aA^2*pA2*bB*e3*t+aA*bA*pB1*e1*t-aA^2*pB2*e1*t-3*aA*pA2*e1^2*t-aA*pB2*e1^2*t-aA*pA1*aB*e2*t+aA^2*pB1*e2*t+aA*cA*pB2*e2*t-aA*pA1*e1*e2*t+aA*pB1*e1*e2*t-bA*pA2*aB*e3*t+bA*pA1*bB*e3*t+bA^2*pB1*e3*t-aA*bA*pB2*e3*t+bA*pA2*e1*e3*t+bA*pB2*e1*e3*t-bA*pA1*e2*e3*t-bA*pB1*e2*e3*t+3*pA2*aB*e1*t-pA1*bB*e1*t-pA2*e1^2*t+3*pA2*cB*e2*t+pA1*e1*e2*t+3*pA2*bB*e3*t-2*pA2*e2*e3*t-2*bA*pA1*t-3*aA*pA2*t-pB2*e1*t) * hu5_33) +end Spec0K0 diff --git a/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s4.lean b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s4.lean new file mode 100644 index 0000000000..6e098c7d4b --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s4.lean @@ -0,0 +1,162 @@ +/- k=0 radical certificates, class ABCEDF (generated by internal notes from Singular `lift`). -/ +import Nov15.Spec0K0Core +namespace Spec0K0 +variable {K : Type*} [Field K] [CharZero K] + +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll5_22_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m22 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m22) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-4*aA^2*bA*aB*e3*t-4*bA^2*cA*aB*e3*t+aA^2*aB^2*t-3*bA*cA*aB^2*t+aA^2*bB*cB*t-3*bA*cA*bB*cB*t-cA*aB*e2*t+aA*cB*e2*t-bA*aB*e3*t+aA*bB*e3*t) * hE + (-aA*cA*aB*cB*e2^2*t-bA*cA*cB^2*e2^2*t+aA*cA*aB*bB*e2*e3*t+aA*bA*aB*cB*e2*e3*t+3*bA*cA*bB*cB*e2*e3*t-bA^2*cB^2*e2*e3*t-aA*bA*aB*bB*e3^2*t-2*bA*cA*bB^2*e3^2*t+bA^2*bB*cB*e3^2*t+4*aB^2*e2*e3*t+4*bB*cB*e2*e3*t-4*bA*cB*e1*t+aA*cB*e2*t-aA*bB*e3*t-2*aB^2*t-2*bB*cB*t-2*e2*e3*t+3*t) * hA0 + (-aA*cA*e1*e2*t-3*aA*bA*e1*e3*t-2*aA^2*e2*e3*t+bA*cA*e2*e3*t+bA^2*e3^2*t+3*aA^2*t-bA*cA*t+4*e2*e3*t-2*t) * hB0 + (-aA^2*cA*aB*e2*t-aA*bA*cA*cB*e2*t+aA^2*bA*aB*e3*t+2*aA*bA*cA*bB*e3*t-aA*bA^2*cB*e3*t+aA^2*e1^2*t+aA*cA*e1*e2*t+aA*bA*e1*e3*t-3*bA*cA*e2*e3*t-aA*aB*e1*t+bA*cB*e1*t+cA*aB*e2*t-2*aA*cB*e2*t+aA*bB*e3*t+aA^2*t+4*bA*cA*t-e2*e3*t) * hu5_22 + (aA*cA^2*aB*e2*t+bA*cA^2*cB*e2*t-aA*bA*cA*aB*e3*t-2*bA*cA^2*bB*e3*t+bA^2*cA*cB*e3*t-aA*cA*e1^2*t+aA^2*e1*e3*t+3*bA*cA*e1*e3*t+aA*bA*e3^2*t+2*aA*cB*e1*t-cA*cB*e2*t-4*aA*aB*e3*t-2*cA*bB*e3*t-bA*cB*e3*t-aA*cA*t+e1*e3*t) * hu5_23 + (-aA*bA*cA*aB*e2*t-bA^2*cA*cB*e2*t+aA*bA^2*aB*e3*t+2*bA^2*cA*bB*e3*t-bA^3*cB*e3*t+aA*bA*e1^2*t-aA^2*e1*e2*t+bA^2*e1*e3*t+3*aA*bA*e2*e3*t+2*bA*aB*e1*t+2*bA*cB*e2*t-2*bA*bB*e3*t-3*aA*bA*t+e1*e2*t) * hu5_32 + (-aA^2*cA*aB*e2*t-aA*bA*cA*cB*e2*t+aA^2*bA*aB*e3*t+2*aA*bA*cA*bB*e3*t-aA*bA^2*cB*e3*t+aA^2*e1^2*t-2*aA*bA*e1*e3*t+bA^2*e3^2*t-aA*aB*e1*t-3*bA*cB*e1*t-bA*aB*e3*t+aA*bB*e3*t+aA^2*t+e2*e3*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll5_23_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m23 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m23) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (4*aA^2*bA*aB*e1*t+4*bA^2*cA*aB*e1*t+6*aA*bA*aB^2*t+6*aA*bA*bB*cB*t+2*aA*aB*e2*t-3*cA*bB*e2*t+5*bA*cB*e2*t-4*aA*bA*t) * hE + (-bA*cA*aB*cB*e2^2*t-aA*cA*bB*cB*e2^2*t+2*aA*bA*cB^2*e2^2*t+bA*cA*aB*bB*e2*e3*t+aA*cA*bB^2*e2*e3*t+bA^2*aB*cB*e2*e3*t-3*aA*bA*bB*cB*e2*e3*t-bA^2*aB*bB*e3^2*t+aA*bA*bB^2*e3^2*t+4*bA*aB*e1*t+2*aA*bB*e1*t-2*aA*aB*e2*t+3*bA*cB*e2*t-3*bA*bB*e3*t+2*e1*e2*t) * hA0 + (2*aA^2*e1*e2*t-bA*cA*e1*e2*t-aA*cA*e2^2*t-bA^2*e1*e3*t-3*aA*bA*e2*e3*t+6*aA*bA*t) * hB0 + (-aA*bA*cA*aB*e2*t-aA^2*cA*bB*e2*t+2*aA^2*bA*cB*e2*t+aA*bA^2*aB*e3*t-aA^2*bA*bB*e3*t-aA*bA*e1^2*t+aA^2*e1*e2*t+3*bA*cA*e1*e2*t+aA*cA*e2^2*t-7*bA*aB*e1*t-aA*bB*e1*t+3*aA*aB*e2*t+3*cA*bB*e2*t-7*bA*cB*e2*t+bA*bB*e3*t+3*aA*bA*t-5*e1*e2*t) * hu5_22 + (bA*cA^2*aB*e2*t+aA*cA^2*bB*e2*t-2*aA*bA*cA*cB*e2*t-bA^2*cA*aB*e3*t+aA*bA*cA*bB*e3*t-3*bA*cA*e1^2*t-aA*cA*e1*e2*t-aA*bA*e1*e3*t+aA^2*e2*e3*t+8*bA*cB*e1*t-3*cA*aB*e2*t+4*aA*cB*e2*t-7*bA*aB*e3*t+2*aA^2*t-3*bA*cA*t-5*e2*e3*t) * hu5_23 + (-bA^2*cA*aB*e2*t-aA*bA*cA*bB*e2*t+2*aA*bA^2*cB*e2*t+bA^3*aB*e3*t-aA*bA^2*bB*e3*t-bA^2*e1^2*t-2*aA*bA*e1*e2*t-aA^2*e2^2*t-2*bA*bB*e1*t+6*bA*aB*e2*t-2*aA*bB*e2*t+3*bA^2*t+3*e2^2*t) * hu5_32 + (-aA*bA*cA*aB*e2*t-aA^2*cA*bB*e2*t+2*aA^2*bA*cB*e2*t+aA*bA^2*aB*e3*t-aA^2*bA*bB*e3*t+3*aA*bA*e1^2*t+aA^2*e1*e2*t-bA^2*e1*e3*t+aA*bA*e2*e3*t-3*bA*aB*e1*t+aA*bB*e1*t+3*aA*aB*e2*t+bA*cB*e2*t-2*bA*bB*e3*t+5*aA*bA*t-3*e1*e2*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll5_24_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m24 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m24) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-2*aA^2*bA*cB*qB1*t-2*bA^2*cA*cB*qB1*t+2*aA^2*bA*aB*qB2*t+2*bA^2*cA*aB*qB2*t+2*bA*cA*aB*qB2*e2*t-2*aA*bA*cB*qB2*e2*t-2*bA*cA*bB*qB1*e3*t+2*bA^2*cB*qB1*e3*t-2*bA^2*aB*qB2*e3*t+2*aA*bA*bB*qB2*e3*t+aA*qA1*aB*e1*t+bA*qA2*aB*e1*t+cA*qA1*bB*e1*t-aA*qA2*bB*e1*t-cA*qA1*aB*e2*t+aA*qA2*aB*e2*t+aA*qA1*cB*e2*t+bA*qA2*cB*e2*t+aA*aB*qB1*t+bA*cB*qB1*t-bA*aB*qB2*t+aA*bB*qB2*t-qA1*t) * hE + (-aA*qA2*bB*e1*t+bA*qA1*cB*e1*t+aA*qA2*aB*e2*t+bA*qA2*cB*e2*t-bA*qA1*aB*e3*t-bA*qA2*bB*e3*t-2*bA*cB*qB1*t+2*bA*aB*qB2*t+qA2*bB*e1*t-qA2*aB*e2*t+qA1*cB*e2*t-2*cB*qB1*e2*t+2*aB*qB2*e2*t-qA1*bB*e3*t+qB1*e1*t-qB2*e2*t) * hA0 + (cB*e2*t-bB*e3*t) * hA3 + (bB*e1*t-aB*e2*t-bA*t) * hA4 + (-aA^2*e1*t+bA*cA*e1*t+2*aA*bA*e3*t+aA*t) * hB3 + (-2*aA*bA*e1*t+aA^2*e2*t+bA*cA*e2*t+2*bA^2*e3*t-bA*t-2*e2*t) * hB4 + (2*bA*cA*qB1*e1*t-2*aA*bA*qB2*e1*t-2*bA*qB1*e1*e3*t-2*bA*qB2*e2*e3*t-bA*cA*qA1*t+aA*bA*qA2*t+aA*qA1*t-aA*qB1*t-bA*qB2*t-qB1*e1*t-qB2*e2*t) * hu5_22 + (2*bA*cA*qB1*e3*t-2*aA*bA*qB2*e3*t+2*bA*qB2*e1*e3*t-2*bA*qB1*e3^2*t-aA^2*qA2*t-bA*cA*qA2*t-qA2*e1^2*t-qA2*e2*e3*t-cA*qA1*t+aA*qA2*t+2*cA*qB1*t-2*aA*qB2*t+qB2*e1*t-qB1*e3*t+2*qA2*t) * hu5_23 + (-2*aA*bA*qB1*e1*t-2*bA^2*qB2*e1*t-2*bA*qB2*e1*e2*t+2*bA*qB1*e2*e3*t+aA*bA*qA1*t+bA^2*qA2*t+bA*qA1*t-2*bA*qB1*t) * hu5_32 + (-2*aA*bA*qB1*e3*t-2*bA^2*qB2*e3*t-2*bA*qB1*e1*e3*t-2*bA*qB2*e2*e3*t+qA1*e1^2*t+qA1*e2*e3*t+aA*qA1*t+bA*qA2*t-aA*qB1*t+bA*qB2*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll5_32_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m32 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m32) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (4*aA^2*bA*cB*e3*t+4*bA^2*cA*cB*e3*t-2*aA*cA*aB^2*t-2*aA*cA*bB*cB*t-2*aA*aB*e3*t+4*cA*bB*e3*t-6*bA*cB*e3*t) * hE + (cA^2*aB*cB*e2^2*t-aA*cA*cB^2*e2^2*t-cA^2*aB*bB*e2*e3*t-bA*cA*aB*cB*e2*e3*t+3*aA*cA*bB*cB*e2*e3*t-aA*bA*cB^2*e2*e3*t+bA*cA*aB*bB*e3^2*t-2*aA*cA*bB^2*e3^2*t+aA*bA*bB*cB*e3^2*t-2*aA*cB*e1*t+cA*cB*e2*t+2*aA*aB*e3*t-cA*bB*e3*t+4*bA*cB*e3*t-2*e1*e3*t) * hA0 + (cA^2*e1*e2*t-2*aA^2*e1*e3*t+bA*cA*e1*e3*t+3*aA*cA*e2*e3*t+aA*bA*e3^2*t-2*aA*cA*t) * hB0 + (aA*cA^2*aB*e2*t-aA^2*cA*cB*e2*t-aA*bA*cA*aB*e3*t+2*aA^2*cA*bB*e3*t-aA^2*bA*cB*e3*t-aA*cA*e1^2*t-cA^2*e1*e2*t-3*aA^2*e1*e3*t-4*bA*cA*e1*e3*t-3*aA*cA*e2*e3*t+cA*aB*e1*t-aA*cB*e1*t-2*cA*bB*e3*t+3*aA*cA*t+6*e1*e3*t) * hu5_22 + (-cA^3*aB*e2*t+aA*cA^2*cB*e2*t+bA*cA^2*aB*e3*t-2*aA*cA^2*bB*e3*t+aA*bA*cA*cB*e3*t+cA^2*e1^2*t+2*aA*cA*e1*e3*t-3*aA^2*e3^2*t-4*bA*cA*e3^2*t+cA*aB*e3*t-3*aA*cB*e3*t-cA^2*t+6*e3^2*t) * hu5_23 + (bA*cA^2*aB*e2*t-aA*bA*cA*cB*e2*t-bA^2*cA*aB*e3*t+2*aA*bA*cA*bB*e3*t-aA*bA^2*cB*e3*t-bA*cA*e1^2*t+aA*cA*e1*e2*t+aA*bA*e1*e3*t+3*aA^2*e2*e3*t-2*bA*cB*e1*t-cA*aB*e2*t+2*aA*cB*e2*t-aA*bB*e3*t-2*aA^2*t+bA*cA*t-4*e2*e3*t) * hu5_32 + (aA*cA^2*aB*e2*t-aA^2*cA*cB*e2*t-aA*bA*cA*aB*e3*t+2*aA^2*cA*bB*e3*t-aA^2*bA*cB*e3*t-aA*cA*e1^2*t-3*aA^2*e1*e3*t-bA*cA*e1*e3*t+aA*bA*e3^2*t+cA*aB*e1*t-3*aA*cB*e1*t+cA*cB*e2*t+cA*bB*e3*t-2*bA*cB*e3*t+aA*cA*t+4*e1*e3*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll5_33_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m33 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m33) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-4*aA^2*bA*aB*e3*t-4*bA^2*cA*aB*e3*t+aA^2*aB^2*t-3*bA*cA*aB^2*t+aA^2*bB*cB*t-3*bA*cA*bB*cB*t-3*cA*aB*e2*t+3*aA*cB*e2*t+bA*aB*e3*t-aA*bB*e3*t) * hE + (-aA*cA*aB*cB*e2^2*t+cA^2*bB*cB*e2^2*t-2*bA*cA*cB^2*e2^2*t+aA*cA*aB*bB*e2*e3*t-cA^2*bB^2*e2*e3*t+aA*bA*aB*cB*e2*e3*t+3*bA*cA*bB*cB*e2*e3*t-aA*bA*aB*bB*e3^2*t-bA*cA*bB^2*e3^2*t+4*aB^2*e2*e3*t+4*bB*cB*e2*e3*t-4*bA*cB*e1*t-aA*cB*e2*t+aA*bB*e3*t-2*aB^2*t-2*bB*cB*t-2*e2*e3*t+3*t) * hA0 + (-3*aA*cA*e1*e2*t+cA^2*e2^2*t-aA*bA*e1*e3*t-2*aA^2*e2*e3*t+bA*cA*e2*e3*t+3*aA^2*t-bA*cA*t+4*e2*e3*t-2*t) * hB0 + (-aA^2*cA*aB*e2*t+aA*cA^2*bB*e2*t-2*aA*bA*cA*cB*e2*t+aA^2*bA*aB*e3*t+aA*bA*cA*bB*e3*t+3*aA^2*e1^2*t+2*aA*cA*e1*e2*t-cA^2*e2^2*t-4*bA*cA*e2*e3*t-3*aA*aB*e1*t-cA*bB*e1*t+3*cA*aB*e2*t-3*aA*cB*e2*t-aA^2*t+4*bA*cA*t+e2*e3*t) * hu5_22 + (aA*cA^2*aB*e2*t-cA^3*bB*e2*t+2*bA*cA^2*cB*e2*t-aA*bA*cA*aB*e3*t-bA*cA^2*bB*e3*t-3*aA*cA*e1^2*t+cA^2*e1*e2*t+3*aA^2*e1*e3*t+4*bA*cA*e1*e3*t-aA*cA*e2*e3*t+2*aA*cB*e1*t-2*cA*cB*e2*t-4*aA*aB*e3*t-2*cA*bB*e3*t+aA*cA*t-e1*e3*t) * hu5_23 + (-aA*bA*cA*aB*e2*t+bA*cA^2*bB*e2*t-2*bA^2*cA*cB*e2*t+aA*bA^2*aB*e3*t+bA^2*cA*bB*e3*t+3*aA*bA*e1^2*t-3*aA^2*e1*e2*t-bA*cA*e1*e2*t+aA*cA*e2^2*t+4*aA*bA*e2*e3*t+2*bA*aB*e1*t-cA*bB*e2*t+2*bA*cB*e2*t-bA*bB*e3*t-5*aA*bA*t+3*e1*e2*t) * hu5_32 + (-aA^2*cA*aB*e2*t+aA*cA^2*bB*e2*t-2*aA*bA*cA*cB*e2*t+aA^2*bA*aB*e3*t+aA*bA*cA*bB*e3*t+3*aA^2*e1^2*t-aA*cA*e1*e2*t-aA*bA*e1*e3*t-bA*cA*e2*e3*t-3*aA*aB*e1*t-cA*bB*e1*t-4*bA*cB*e1*t-aA*cB*e2*t+bA*aB*e3*t-aA^2*t+3*e2*e3*t) * hu5_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll5_34_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m34 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (1) (-1) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3))).m34) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-2*aA^3*cB*qB1*t-2*aA*bA*cA*cB*qB1*t-2*aA^2*bA*cB*qB2*t-2*bA^2*cA*cB*qB2*t-2*aA^2*aB*qB2*e1*t-2*bA*cA*aB*qB2*e1*t+2*aA*cA*aB*qB2*e2*t-2*aA^2*cB*qB2*e2*t-2*aA*cA*bB*qB1*e3*t+2*aA*bA*cB*qB1*e3*t-2*aA*bA*aB*qB2*e3*t-2*bA*cA*bB*qB2*e3*t-2*aA*aB^2*qB2*t-2*aA*bB*cB*qB2*t-cA*qA1*aB*e1*t+aA*qA2*aB*e1*t+aA*qA1*cB*e1*t+bA*qA2*cB*e1*t-aA*qA1*aB*e3*t-bA*qA2*aB*e3*t-cA*qA1*bB*e3*t+aA*qA2*bB*e3*t-3*cA*aB*qB1*t+3*aA*cB*qB1*t-aA*aB*qB2*t-3*cA*bB*qB2*t+2*bA*cB*qB2*t+2*aA*qB2*t-qA2*t) * hE + (-2*aA*cB*qB1*t-2*bA*cB*qB2*t+2*cB*qB1*e1*t-4*aB*qB2*e1*t-2*cB*qB2*e2*t-2*aB*qB1*e3*t-2*bB*qB2*e3*t+qB2*e1*t+qB1*e3*t) * hA0 + (-2*aA*qB2*t) * hB0 + (2*aA*cA*e1*t+aA^2*e3*t-bA*cA*e3*t-3*cA*t-2*e3*t) * hB3 + (-aA^2*e1*t+bA*cA*e1*t+2*aA*bA*e3*t+aA*t+2*e1*t) * hB4 + (2*aA*cA*qB1*e1*t+2*bA*cA*qB2*e1*t+2*aA*qB2*e1^2*t-2*aA*qB1*e1*e3*t+2*aB*qB2*e1*t-qA2*e1^2*t+2*cB*qB2*e2*t-qA2*e2*e3*t-3*cA*qB1*t+aA*qB2*t-2*qB2*e1*t+qA2*t) * hu5_22 + (2*aA*cA*qB1*e3*t+2*bA*cA*qB2*e3*t+2*aA*qB2*e1*e3*t-2*aA*qB1*e3^2*t-2*cB*qB2*e1*t+2*aB*qB2*e3*t+2*cA*qB2*t-2*qB2*e3*t) * hu5_23 + (-2*aA^2*qB1*e1*t-2*aA*bA*qB2*e1*t+2*bA*qB2*e1^2*t-2*aA*qB2*e1*e2*t+2*aA*qB1*e2*e3*t+2*bA*qB2*e2*e3*t+qA1*e1^2*t+qA1*e2*e3*t+2*aA*qB1*t+2*bA*qB2*t+3*qB1*e1*t+3*qB2*e2*t) * hu5_32 + (-2*aA^2*qB1*e3*t-2*aA*bA*qB2*e3*t-2*aA*qB1*e1*e3*t-2*aA*qB2*e2*e3*t-cA*qB1*t+aA*qB2*t-3*qB2*e1*t+3*qB1*e3*t-qA2*t) * hu5_33) +end Spec0K0 diff --git a/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s5.lean b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s5.lean new file mode 100644 index 0000000000..75fb699320 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s5.lean @@ -0,0 +1,224 @@ +/- k=0 radical certificates, class ABCEDF (generated by internal notes from Singular `lift`). -/ +import Nov15.Spec0K0Core +namespace Spec0K0 +variable {K : Type*} [Field K] [CharZero K] + +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll6_12_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m12 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_32 := congrArg M4.m32 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_32 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m12) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-1/2*bA*aB*aC*aD^2*pD2*e3^2*t+1/2*aA*bB*aC*aD^2*pD2*e3^2*t-1/2*aA*aB*bC*aD^2*pD2*e3^2*t-1/2*bA*cB*bC*aD^2*pD2*e3^2*t-1/2*cA*bB*aC*aD*bD*pD2*e3^2*t+1/2*bA*cB*aC*aD*bD*pD2*e3^2*t+1/2*cA*aB*bC*aD*bD*pD2*e3^2*t-1/2*aA*cB*bC*aD*bD*pD2*e3^2*t-1/2*bA*aB*cC*aD*bD*pD2*e3^2*t+1/2*aA*bB*cC*aD*bD*pD2*e3^2*t-1/2*cA*aB*aC*bD^2*pD2*e3^2*t+1/2*aA*cB*aC*bD^2*pD2*e3^2*t-1/2*aA*aB*cC*bD^2*pD2*e3^2*t-1/2*cA*bB*cC*bD^2*pD2*e3^2*t+3/2*bA*aB*aC*pC1*aD^2*e3*t-3/2*aA*bB*aC*pC1*aD^2*e3*t+3/2*aA*aB*bC*pC1*aD^2*e3*t+3/2*bA*cB*bC*pC1*aD^2*e3*t+3/2*cA*bB*aC*pC1*aD*bD*e3*t-3/2*bA*cB*aC*pC1*aD*bD*e3*t-3/2*cA*aB*bC*pC1*aD*bD*e3*t+3/2*aA*cB*bC*pC1*aD*bD*e3*t+3/2*bA*aB*cC*pC1*aD*bD*e3*t-3/2*aA*bB*cC*pC1*aD*bD*e3*t+3/2*cA*aB*aC*pC1*bD^2*e3*t-3/2*aA*cB*aC*pC1*bD^2*e3*t+3/2*aA*aB*cC*pC1*bD^2*e3*t+3/2*cA*bB*cC*pC1*bD^2*e3*t-aA*aB*aD*pD2*e2*e3^2*t-bA*cB*aD*pD2*e2*e3^2*t+cA*aB*bD*pD2*e2*e3^2*t-aA*cB*bD*pD2*e2*e3^2*t-1/2*cA*aB*aC*aD^2*pD2*t+1/2*aA*cB*aC*aD^2*pD2*t-1/2*aA*aB*cC*aD^2*pD2*t-1/2*cA*bB*cC*aD^2*pD2*t+1/2*aA*aB*aC*aD*cD*pD2*t+1/2*cA*bB*aC*aD*cD*pD2*t-1/2*cA*aB*bC*aD*cD*pD2*t+1/2*aA*cB*bC*aD*cD*pD2*t+3*aA*aB*pC1*aD*e2*e3*t+3*bA*cB*pC1*aD*e2*e3*t-3*cA*aB*pC1*bD*e2*e3*t+3*aA*cB*pC1*bD*e2*e3*t-3/2*aA*aB*aC*pC1*aD*t-3/2*cA*bB*aC*pC1*aD*t+3/2*cA*aB*bC*pC1*aD*t-3/2*aA*cB*bC*pC1*aD*t-3/2*cA*aB*aC*pC1*bD*t+3/2*aA*cB*aC*pC1*bD*t-3/2*aA*aB*cC*pC1*bD*t-3/2*cA*bB*cC*pC1*bD*t-1/2*aA*aB*aC*aD*pD1*t-1/2*cA*bB*aC*aD*pD1*t+1/2*cA*aB*bC*aD*pD1*t-1/2*aA*cB*bC*aD*pD1*t-1/2*cA*aB*aC*bD*pD1*t+1/2*aA*cB*aC*bD*pD1*t-1/2*aA*aB*cC*bD*pD1*t-1/2*cA*bB*cC*bD*pD1*t+1/2*cA*aB*aC*aD*pD2*t-1/2*aA*cB*aC*aD*pD2*t+1/2*aA*aB*cC*aD*pD2*t+1/2*cA*bB*cC*aD*pD2*t-1/2*aA*aB*aC*cD*pD2*t-1/2*cA*bB*aC*cD*pD2*t+1/2*cA*aB*bC*cD*pD2*t-1/2*aA*cB*bC*cD*pD2*t-aC^2*pC2*aD*e3*t-bC*cC*pC2*aD*e3*t-aA*aB*aD*pD2*e3*t-cA*bB*aD*pD2*e3*t-aC*aD^2*pD2*e3*t-aC*bD*cD*pD2*e3*t+aC*pC1*aD^2*t-3*cC*pC2*aD^2*t-2*cC*pC1*aD*bD*t+2*bC*pC1*aD*cD*t+aC*pC1*bD*cD*t-3*cC*pC2*bD*cD*t+aC^2*aD*pD1*t+bC*cC*aD*pD1*t+aC*pC1*aD*e1*t+cC*pC2*aD*e1*t+bC*pC1*cD*e1*t-aC*pC2*cD*e1*t+3*cA*aB*pC1*e2*t-3*aA*cB*pC1*e2*t+cA*aB*pD1*e2*t-aA*cB*pD1*e2*t+bC*aD*pD1*e3*t-aC*bD*pD1*e3*t+aA*aB*pD2*e3*t+cA*bB*pD2*e3*t+aC*aD*pD2*e3*t+bC*cD*pD2*e3*t+bD*pD2*e3^2*t-3*pC1*bD*e3*t+pC1*t) * hE + (-1/4*cC*pC1*bD*cD*e1*e2*t+1/4*bC*pC1*cD^2*e1*e2*t+1/4*cC*pC1*bD^2*e1*e3*t-1/4*bC*pC1*bD*cD*e1*e3*t-3/4*cC*pC2*bD*cD*e2*e3*t+3/4*bC*pC2*cD^2*e2*e3*t+3/4*cC*pC2*bD^2*e3^2*t-3/4*bC*pC2*bD*cD*e3^2*t+bD*pD2*e1^2*e3^2*t-aD*pD2*e1*e2*e3^2*t+1/2*cC*aD*cD*pD2*e2*t-1/2*aC*cD^2*pD2*e2*t+3*pC1*aD*cD*e1*e2*t+3/2*pC1*cD^2*e2^2*t-1/2*cC*aD*bD*pD2*e3*t+1/2*aC*bD*cD*pD2*e3*t-3*pC1*aD*bD*e1*e3*t-3*pC1*bD*e1^2*e3*t+2*pC2*aD*cD*e2*e3*t-2*pC1*bD*cD*e2*e3*t+3*pC1*aD*e1*e2*e3*t-2*pC2*aD*bD*e3^2*t+1/2*pC1*bD^2*e3^2*t-1/2*aC*cD*pD1*e2*t-1/2*cC*cD*pD2*e2*t+1/2*aC*bD*pD1*e3*t+1/2*cC*bD*pD2*e3*t+cD*pD2*e2*e3*t-bD*pD2*e3^2*t-pC2*aD*e3*t+aD*pD1*t) * hC0 + (3*aD*cD*e1*e2*t+3/2*cD^2*e2^2*t-3*aD*bD*e1*e3*t+4*aD^2*e2*e3*t+2*bD*cD*e2*e3*t+1/2*bD^2*e3^2*t+aD*e1*t+cD*e2*t-bD*e3*t-2*e2*e3*t+t) * hC1 + (2*aD*cD*e2*e3*t-2*aD*bD*e3^2*t-cD*e1*t+2*aD*e3*t-e1*e3*t) * hC2 + (bC*pC1*e1*e3*t+2*aC*pC2*e1*e3*t-2*aC*pC1*e2*e3*t-2*cC*pC2*e2*e3*t+bC*pC2*e3^2*t-4*pC1*e2*e3*t+aC*pC1*t-cC*pC2*t) * hD0 + (aC*e1*t+bC*e3*t+t) * hD1 + (1/2*aD*pD2*e3^2*t-3/2*pC1*aD*e3*t) * h3_23 + (-1/2*aD*pD2*t+1/2*pD2*t) * h3_32 + (-1/2*bD*pD2*e3^2*t+3/2*pC1*bD*e3*t-3/2*pC1*t-1/2*pD1*t) * h3_33 + (-1/2*aA*aB*aD*pD2*e1*e3^2*t-1/2*bA*cB*aD*pD2*e1*e3^2*t+1/2*cA*aB*bD*pD2*e1*e3^2*t-1/2*aA*cB*bD*pD2*e1*e3^2*t+3/2*aA*aB*pC1*aD*e1*e3*t+3/2*bA*cB*pC1*aD*e1*e3*t-3/2*cA*aB*pC1*bD*e1*e3*t+3/2*aA*cB*pC1*bD*e1*e3*t-1/2*cA*aB*aD*pD2*e3*t+1/2*aA*cB*aD*pD2*e3*t-1/2*aC*pD2*e1*e3^2*t+aC*pC1*aD*cD*t+3/2*cA*aB*pC1*e1*t-3/2*aA*cB*pC1*e1*t+1/2*cA*aB*pD1*e1*t-1/2*aA*cB*pD1*e1*t+1/2*cA*aB*pD2*e3*t-1/2*aA*cB*pD2*e3*t+5/2*aC*pC1*e1*e3*t+cD*pD2*e1*e3*t-aD*pD2*e3^2*t-1/4*pC1*cD*e1*t+4*pC1*aD*e3*t-3/4*pC2*cD*e3*t+pC1*e1*e3*t+pD1*e1*e3*t+pD2*e3^2*t) * hu2_23 + (-1/2*bA*aB*aD*pD2*e2*e3^2*t+1/2*aA*bB*aD*pD2*e2*e3^2*t-1/2*aA*aB*bD*pD2*e2*e3^2*t-1/2*cA*bB*bD*pD2*e2*e3^2*t+3/2*bA*aB*pC1*aD*e2*e3*t-3/2*aA*bB*pC1*aD*e2*e3*t+3/2*aA*aB*pC1*bD*e2*e3*t+3/2*cA*bB*pC1*bD*e2*e3*t+1/4*bC*cC*pC1*bD*e1*t-1/4*bC^2*pC1*cD*e1*t-1/2*aA*aB*aD*pD2*e1*t-1/2*cA*bB*aD*pD2*e1*t+3/4*bC*cC*pC2*bD*e3*t-3/4*bC^2*pC2*cD*e3*t-aC*pC2*aD^2*t-aC*pC1*aD*bD*t-aC*pC2*bD*cD*t-1/2*bC*cC*aD*pD2*t+1/2*aC*bC*cD*pD2*t-3*bC*pC1*aD*e1*t+1/2*aA*aB*pD2*e1*t+1/2*cA*bB*pD2*e1*t-3/2*aA*aB*pC1*e2*t-3/2*cA*bB*pC1*e2*t-3/2*bC*pC1*cD*e2*t-1/2*aA*aB*pD1*e2*t-1/2*cA*bB*pD1*e2*t-2*bC*pC2*aD*e3*t+1/2*bC*pC1*bD*e3*t-bC*pC2*e1*e3*t+1/2*aC*bC*pD1*t+1/2*bC*cC*pD2*t-2*pC2*aD*e1*t-9/4*pC1*bD*e1*t+bC*pD1*e1*t+pC2*e1^2*t-1/2*pC2*cD*e2*t-1/4*pC2*bD*e3*t-bC*pD2*e3*t-aC*pC2*t+1/2*aD*pD2*t-pC2*t-1/2*pD2*t) * hu2_32 + (1/2*bA*aB*aD*pD2*e1*e3^2*t-1/2*aA*bB*aD*pD2*e1*e3^2*t+1/2*aA*aB*bD*pD2*e1*e3^2*t+1/2*cA*bB*bD*pD2*e1*e3^2*t-1/2*aA*aB*aD*pD2*e2*e3^2*t-1/2*bA*cB*aD*pD2*e2*e3^2*t+1/2*cA*aB*bD*pD2*e2*e3^2*t-1/2*aA*cB*bD*pD2*e2*e3^2*t-3/2*bA*aB*pC1*aD*e1*e3*t+3/2*aA*bB*pC1*aD*e1*e3*t-3/2*aA*aB*pC1*bD*e1*e3*t-3/2*cA*bB*pC1*bD*e1*e3*t+3/2*aA*aB*pC1*aD*e2*e3*t+3/2*bA*cB*pC1*aD*e2*e3*t-3/2*cA*aB*pC1*bD*e2*e3*t+3/2*aA*cB*pC1*bD*e2*e3*t-1/4*aC*cC*pC1*bD*e1*t+1/4*aC*bC*pC1*cD*e1*t+1/2*cA*aB*aD*pD2*e1*t-1/2*aA*cB*aD*pD2*e1*t-3/4*aC*cC*pC2*bD*e3*t+3/4*aC*bC*pC2*cD*e3*t-1/2*aA*aB*aD*pD2*e3*t-1/2*cA*bB*aD*pD2*e3*t-1/2*bC*pD2*e1*e3^2*t-cC*pC2*aD^2*t-cC*pC1*aD*bD*t+bC*pC1*aD*cD*t-cC*pC2*bD*cD*t+1/2*aC*cC*aD*pD2*t-1/2*aC^2*cD*pD2*t+3/2*aA*aB*pC1*e1*t+3/2*cA*bB*pC1*e1*t+3*aC*pC1*aD*e1*t+1/2*aA*aB*pD1*e1*t+1/2*cA*bB*pD1*e1*t-1/2*cA*aB*pD2*e1*t+1/2*aA*cB*pD2*e1*t+3/2*cA*aB*pC1*e2*t-3/2*aA*cB*pC1*e2*t+3/2*aC*pC1*cD*e2*t+1/2*cA*aB*pD1*e2*t-1/2*aA*cB*pD1*e2*t+2*aC*pC2*aD*e3*t-1/2*aC*pC1*bD*e3*t+1/2*aA*aB*pD2*e3*t+1/2*cA*bB*pD2*e3*t+5/2*bC*pC1*e1*e3*t+aC*pC2*e1*e3*t+aD*pD2*e1*e3*t+cD*pD2*e2*e3*t-1/2*aC^2*pD1*t-1/2*aC*cC*pD2*t-5/2*pC1*aD*e1*t+2*pC2*cD*e1*t-aC*pD1*e1*t-pC1*e1^2*t-3/2*pC1*cD*e2*t-3/2*pC2*aD*e3*t-5/2*pC1*bD*e3*t+aC*pD2*e3*t+pC2*e1*e3*t-pD2*e1*e3*t+pD1*e2*e3*t-cC*pC2*t-1/2*cD*pD2*t+pC1*t-1/2*pD1*t) * hu2_33 + (aD*pD2*e1*e2*e3^2*t-3*pC1*aD*e1*e2*e3*t) * hu5_22 + (aD*pD2*e2*e3^3*t-3*pC1*aD*e2*e3^2*t-1/2*aD*pD2*e3^2*t+3/2*pC1*aD*e3*t) * hu5_23 + (-bD*pD2*e1*e2*e3^2*t+3*pC1*bD*e1*e2*e3*t+aD*pD2*e2*e3*t-3*pC1*e1*e2*t-pD1*e1*e2*t-pD2*e2*e3*t-1/2*aD*pD2*t+1/2*pD2*t) * hu5_32 + (-bD*pD2*e2*e3^3*t+3*pC1*bD*e2*e3^2*t-aD*pD2*e1*e3*t+1/2*bD*pD2*e3^2*t-3/2*pC1*bD*e3*t+pD2*e1*e3*t-3*pC1*e2*e3*t-pD1*e2*e3*t+3/2*pC1*t+1/2*pD1*t) * hu5_33 + (1/2*aA*aB*aD*pD2*e2*e3^2*t+1/2*bA*cB*aD*pD2*e2*e3^2*t-1/2*cA*aB*bD*pD2*e2*e3^2*t+1/2*aA*cB*bD*pD2*e2*e3^2*t-3/2*aA*aB*pC1*aD*e2*e3*t-3/2*bA*cB*pC1*aD*e2*e3*t+3/2*cA*aB*pC1*bD*e2*e3*t-3/2*aA*cB*pC1*bD*e2*e3*t+1/2*aC*cC*pC1*bD*e1*t-1/2*aC*bC*pC1*cD*e1*t-1/2*cA*aB*aD*pD2*e1*t+1/2*aA*cB*aD*pD2*e1*t+3/2*aC*cC*pC2*bD*e3*t-3/2*aC*bC*pC2*cD*e3*t-aC*cC*aD*pD2*t+aC^2*cD*pD2*t-6*aC*pC1*aD*e1*t+1/2*cA*aB*pD2*e1*t-1/2*aA*cB*pD2*e1*t-3/2*cA*aB*pC1*e2*t+3/2*aA*cB*pC1*e2*t-3*aC*pC1*cD*e2*t-1/2*cA*aB*pD1*e2*t+1/2*aA*cB*pD1*e2*t-4*aC*pC2*aD*e3*t+aC*pC1*bD*e3*t-aC*pC2*e1*e3*t-aD*pD2*e1*e3*t-cD*pD2*e2*e3*t+aC^2*pD1*t+aC*cC*pD2*t+3*pC1*aD*e1*t-pC2*cD*e1*t+aC*pD1*e1*t+pC1*e1^2*t+pC1*cD*e2*t+pC1*bD*e3*t-2*aC*pD2*e3*t+pD2*e1*e3*t-pD1*e2*e3*t-2*pC1*t+pD1*t) * hu6_22 + (-1/2*aC*pD2*e1*e3^2*t-aC*pC1*aD*cD*t+1/2*aC*pC1*e1*e3*t-aC*pC2*e3^2*t-1/4*pC1*cD*e1*t+pC1*aD*e3*t-7/4*pC2*cD*e3*t+aC*pD1*e3*t) * hu6_23 + (1/4*bC*cC*pC1*bD*e1*t-1/4*bC^2*pC1*cD*e1*t+3/4*bC*cC*pC2*bD*e3*t-3/4*bC^2*pC2*cD*e3*t+aC*pC2*aD^2*t+aC*pC1*aD*bD*t+aC*pC2*bD*cD*t-1/2*bC*cC*aD*pD2*t+1/2*aC*bC*cD*pD2*t-3*bC*pC1*aD*e1*t-3/2*bC*pC1*cD*e2*t-2*bC*pC2*aD*e3*t+1/2*bC*pC1*bD*e3*t+1/2*aC*bC*pD1*t+1/2*bC*cC*pD2*t+3/4*pC1*bD*e1*t-pC1*aD*e2*t-3/2*pC2*cD*e2*t+3/4*pC2*bD*e3*t-bC*pD2*e3*t+aC*pC2*t+1/2*aD*pD2*t-pC2*t-3/2*pD2*t) * hu6_32 + (1/2*aA*aB*aD*pD2*e2*e3^2*t+1/2*bA*cB*aD*pD2*e2*e3^2*t-1/2*cA*aB*bD*pD2*e2*e3^2*t+1/2*aA*cB*bD*pD2*e2*e3^2*t-3/2*aA*aB*pC1*aD*e2*e3*t-3/2*bA*cB*pC1*aD*e2*e3*t+3/2*cA*aB*pC1*bD*e2*e3*t-3/2*aA*cB*pC1*bD*e2*e3*t+1/4*aC*cC*pC1*bD*e1*t-1/4*aC*bC*pC1*cD*e1*t-1/2*cA*aB*aD*pD2*e1*t+1/2*aA*cB*aD*pD2*e1*t+3/4*aC*cC*pC2*bD*e3*t-3/4*aC*bC*pC2*cD*e3*t-1/2*bC*pD2*e1*e3^2*t+cC*pC2*aD^2*t+cC*pC1*aD*bD*t-bC*pC1*aD*cD*t+cC*pC2*bD*cD*t-1/2*aC*cC*aD*pD2*t+1/2*aC^2*cD*pD2*t-3*aC*pC1*aD*e1*t+1/2*cA*aB*pD2*e1*t-1/2*aA*cB*pD2*e1*t-3/2*cA*aB*pC1*e2*t+3/2*aA*cB*pC1*e2*t-3/2*aC*pC1*cD*e2*t-1/2*cA*aB*pD1*e2*t+1/2*aA*cB*pD1*e2*t-2*aC*pC2*aD*e3*t+1/2*aC*pC1*bD*e3*t+1/2*bC*pC1*e1*e3*t-aC*pC2*e1*e3*t-aD*pD2*e1*e3*t-cD*pD2*e2*e3*t-bC*pC2*e3^2*t+1/2*aC^2*pD1*t+1/2*aC*cC*pD2*t+1/2*pC1*aD*e1*t+pC2*cD*e1*t+aC*pD1*e1*t+pC1*e1^2*t-1/2*pC1*cD*e2*t+1/2*pC2*aD*e3*t+1/2*pC1*bD*e3*t+bC*pD1*e3*t-aC*pD2*e3*t+pD2*e1*e3*t-pD1*e2*e3*t+cC*pC2*t+1/2*cD*pD2*t-pC1*t+1/2*pD1*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll6_13_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m13 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m13) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (2*bA*aB*aC*pC2*aD^2*e3*t-2*aA*bB*aC*pC2*aD^2*e3*t+2*aA*aB*bC*pC2*aD^2*e3*t+2*bA*cB*bC*pC2*aD^2*e3*t+2*cA*bB*aC*pC2*aD*bD*e3*t-2*bA*cB*aC*pC2*aD*bD*e3*t-2*cA*aB*bC*pC2*aD*bD*e3*t+2*aA*cB*bC*pC2*aD*bD*e3*t+2*bA*aB*cC*pC2*aD*bD*e3*t-2*aA*bB*cC*pC2*aD*bD*e3*t+2*cA*aB*aC*pC2*bD^2*e3*t-2*aA*cB*aC*pC2*bD^2*e3*t+2*aA*aB*cC*pC2*bD^2*e3*t+2*cA*bB*cC*pC2*bD^2*e3*t+4*aA*aB*pC2*aD*e2*e3*t+4*bA*cB*pC2*aD*e2*e3*t-4*cA*aB*pC2*bD*e2*e3*t+4*aA*cB*pC2*bD*e2*e3*t+2*aA*aB*aC*pC2*aD*t+2*cA*bB*aC*pC2*aD*t-2*cA*aB*bC*pC2*aD*t+2*aA*cB*bC*pC2*aD*t+2*cA*aB*aC*pC2*bD*t-2*aA*cB*aC*pC2*bD*t+2*aA*aB*cC*pC2*bD*t+2*cA*bB*cC*pC2*bD*t+bC*pC1*aD^2*t+bC*pC1*bD*cD*t+aC^2*aD*pD2*t+bC*cC*aD*pD2*t-4*cA*aB*pC2*e2*t+4*aA*cB*pC2*e2*t-2*aC*pC1*aD*e2*t-2*cC*pC2*aD*e2*t-2*bC*pC1*cD*e2*t+2*aC*pC2*cD*e2*t-4*pC2*bD*e3*t) * hE + (-3/4*cC*pC2*bD*cD*e1*e2*t+3/4*bC*pC2*cD^2*e1*e2*t+1/4*cC*pC1*bD*cD*e2^2*t-1/4*bC*pC1*cD^2*e2^2*t+3/4*cC*pC2*bD^2*e1*e3*t-3/4*bC*pC2*bD*cD*e1*e3*t-1/4*cC*pC1*bD^2*e2*e3*t-3*bC*pC2*aD*cD*e2*e3*t+1/4*bC*pC1*bD*cD*e2*e3*t+3*aC*pC2*bD*cD*e2*e3*t+3*bC*pC2*aD*bD*e3^2*t-3*aC*pC2*bD^2*e3^2*t+1/2*bC*aD*cD*pD1*e2*t-1/2*aC*bD*cD*pD1*e2*t+1/2*pC1*aD*cD*e2^2*t+1/2*pC2*cD^2*e2^2*t-1/2*bC*aD*bD*pD1*e3*t+1/2*aC*bD^2*pD1*e3*t+pC2*aD*bD*e1*e3*t-4*pC2*bD*e1^2*e3*t-pC2*aD^2*e2*e3*t-1/2*pC1*aD*bD*e2*e3*t-pC2*bD*cD*e2*e3*t+4*pC2*aD*e1*e2*e3*t+1/2*pC2*bD^2*e3^2*t-1/2*pC2*cD*e2*t+1/2*pC2*bD*e3*t+aD*pD2*t) * hC0 + (1/2*aD*cD*e2^2*t-1/2*aD*bD*e2*e3*t-bD*e1*t-aD*e2*t-2*e1*e2*t) * hC1 + (1/2*cD^2*e2^2*t+aD*bD*e1*e3*t+aD^2*e2*e3*t+bD*cD*e2*e3*t+1/2*bD^2*e3^2*t-3/2*cD*e2*t-1/2*bD*e3*t-4*e2*e3*t) * hC2 + (-2*aC*pC1*e1*e2*t-2*cC*pC2*e1*e2*t+bC*pC2*e1*e3*t-bC*pC1*e2*e3*t+4*aC*pC2*e2*e3*t-aC*pD1*e2*t-2*pC2*e2*e3*t+bC*pC1*t) * hD0 + (bC*e1*t-aC*e2*t) * hD1 + (aC*e1*t+bC*e3*t-t) * hD2 + (-2*pC2*aD*e3*t) * h3_23 + (2*pC2*bD*e3*t+2*pC2*t) * h3_33 + (2*aA*aB*pC2*aD*e1*e3*t+2*bA*cB*pC2*aD*e1*e3*t-2*cA*aB*pC2*bD*e1*e3*t+2*aA*cB*pC2*bD*e1*e3*t-2*cA*aB*pC2*e1*t+2*aA*cB*pC2*e1*t-1/2*aC*pC2*aD*e3*t+5/2*aC*pC2*e1*e3*t+3/2*aC*pC1*e2*e3*t-7/4*pC2*cD*e1*t-1/2*aC*pD1*e1*t+3/4*pC1*cD*e2*t+4*pC2*aD*e3*t+1/2*pC1*bD*e3*t-2*pC1*e2*e3*t+1/2*aC*pC1*t-1/2*aD*pD1*t+1/2*pC1*t) * hu2_23 + (2*bA*aB*pC2*aD*e2*e3*t-2*aA*bB*pC2*aD*e2*e3*t+2*aA*aB*pC2*bD*e2*e3*t+2*cA*bB*pC2*bD*e2*e3*t+3/4*bC*cC*pC2*bD*e1*t-3/4*bC^2*pC2*cD*e1*t-1/4*bC*cC*pC1*bD*e2*t+1/4*bC^2*pC1*cD*e2*t+3*bC^2*pC2*aD*e3*t-3*aC*bC*pC2*bD*e3*t-1/2*bC^2*aD*pD1*t+1/2*aC*bC*bD*pD1*t+2*aA*aB*pC2*e2*t+2*cA*bB*pC2*e2*t-1/2*bC*pC1*aD*e2*t-1/2*bC*pC2*cD*e2*t+1/2*bC*pC2*bD*e3*t-11/4*pC2*bD*e1*t+bC*pD2*e1*t+3/2*pC2*aD*e2*t+1/4*pC1*bD*e2*t-2*pC2*e1*e2*t+1/2*bC*pC2*t) * hu2_32 + (-2*bA*aB*pC2*aD*e1*e3*t+2*aA*bB*pC2*aD*e1*e3*t-2*aA*aB*pC2*bD*e1*e3*t-2*cA*bB*pC2*bD*e1*e3*t+2*aA*aB*pC2*aD*e2*e3*t+2*bA*cB*pC2*aD*e2*e3*t-2*cA*aB*pC2*bD*e2*e3*t+2*aA*cB*pC2*bD*e2*e3*t-3/4*aC*cC*pC2*bD*e1*t+3/4*aC*bC*pC2*cD*e1*t+1/4*aC*cC*pC1*bD*e2*t-1/4*aC*bC*pC1*cD*e2*t-3*aC*bC*pC2*aD*e3*t+3*aC^2*pC2*bD*e3*t+1/2*aC*bC*aD*pD1*t-1/2*aC^2*bD*pD1*t-2*aA*aB*pC2*e1*t-2*cA*bB*pC2*e1*t-2*cA*aB*pC2*e2*t+2*aA*cB*pC2*e2*t+1/2*aC*pC1*aD*e2*t+1/2*aC*pC2*cD*e2*t-1/2*bC*pC2*aD*e3*t-1/2*aC*pC2*bD*e3*t+5/2*bC*pC2*e1*e3*t+3/2*bC*pC1*e2*e3*t-9/2*pC2*aD*e1*t-1/2*bC*pD1*e1*t-aC*pD2*e1*t+pC1*aD*e2*t-1/2*pC2*cD*e2*t+2*pC1*e1*e2*t-9/2*pC2*bD*e3*t-2*pC2*e2*e3*t+1/2*bC*pC1*t-1/2*aC*pC2*t+1/2*bD*pD1*t+1/2*pC2*t) * hu2_33 + (-4*pC2*aD*e1*e2*e3*t) * hu5_22 + (-4*pC2*aD*e2*e3^2*t+2*pC2*aD*e3*t) * hu5_23 + (4*pC2*bD*e1*e2*e3*t+4*pC2*e1*e2*t) * hu5_32 + (4*pC2*bD*e2*e3^2*t-2*pC2*bD*e3*t+4*pC2*e2*e3*t-2*pC2*t) * hu5_33 + (-2*aA*aB*pC2*aD*e2*e3*t-2*bA*cB*pC2*aD*e2*e3*t+2*cA*aB*pC2*bD*e2*e3*t-2*aA*cB*pC2*bD*e2*e3*t+3/2*aC*cC*pC2*bD*e1*t-3/2*aC*bC*pC2*cD*e1*t-1/2*aC*cC*pC1*bD*e2*t+1/2*aC*bC*pC1*cD*e2*t+6*aC*bC*pC2*aD*e3*t-6*aC^2*pC2*bD*e3*t-aC*bC*aD*pD1*t+aC^2*bD*pD1*t+2*cA*aB*pC2*e2*t-2*aA*cB*pC2*e2*t-aC*pC1*aD*e2*t-aC*pC2*cD*e2*t+aC*pC2*bD*e3*t+4*pC2*aD*e1*t+pC1*bD*e1*t+aC*pD2*e1*t-pC1*aD*e2*t+pC2*cD*e2*t-2*pC1*e1*e2*t+4*pC2*bD*e3*t+aC*pC2*t+pD2*t) * hu6_22 + (-1/2*aC*pC2*aD*e3*t+3/2*aC*pC2*e1*e3*t-3/2*aC*pC1*e2*e3*t+5/4*pC2*cD*e1*t+1/2*aC*pD1*e1*t+3/4*pC1*cD*e2*t-1/2*pC1*bD*e3*t+aC*pD2*e3*t-1/2*aC*pC1*t-1/2*aD*pD1*t+1/2*pC1*t) * hu6_23 + (3/4*bC*cC*pC2*bD*e1*t-3/4*bC^2*pC2*cD*e1*t-1/4*bC*cC*pC1*bD*e2*t+1/4*bC^2*pC1*cD*e2*t+3*bC^2*pC2*aD*e3*t-3*aC*bC*pC2*bD*e3*t-1/2*bC^2*aD*pD1*t+1/2*aC*bC*bD*pD1*t-1/2*bC*pC1*aD*e2*t-1/2*bC*pC2*cD*e2*t+1/2*bC*pC2*bD*e3*t+9/4*pC2*bD*e1*t-3/2*pC2*aD*e2*t+1/4*pC1*bD*e2*t+1/2*bC*pC2*t) * hu6_32 + (-2*aA*aB*pC2*aD*e2*e3*t-2*bA*cB*pC2*aD*e2*e3*t+2*cA*aB*pC2*bD*e2*e3*t-2*aA*cB*pC2*bD*e2*e3*t+3/4*aC*cC*pC2*bD*e1*t-3/4*aC*bC*pC2*cD*e1*t-1/4*aC*cC*pC1*bD*e2*t+1/4*aC*bC*pC1*cD*e2*t+3*aC*bC*pC2*aD*e3*t-3*aC^2*pC2*bD*e3*t-1/2*aC*bC*aD*pD1*t+1/2*aC^2*bD*pD1*t+2*cA*aB*pC2*e2*t-2*aA*cB*pC2*e2*t-1/2*aC*pC1*aD*e2*t-1/2*aC*pC2*cD*e2*t-1/2*bC*pC2*aD*e3*t+1/2*aC*pC2*bD*e3*t+3/2*bC*pC2*e1*e3*t-3/2*bC*pC1*e2*e3*t-3/2*pC2*aD*e1*t-pC1*bD*e1*t+1/2*bC*pD1*e1*t+aC*pD2*e1*t-1/2*pC2*cD*e2*t-2*pC1*e1*e2*t+3/2*pC2*bD*e3*t+bC*pD2*e3*t-1/2*bC*pC1*t+1/2*aC*pC2*t-1/2*bD*pD1*t+1/2*pC2*t-pD2*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll6_22_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m22 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m22) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-bA*aB*aC*aD^2*cD*t+aA*bB*aC*aD^2*cD*t-aA*aB*bC*aD^2*cD*t-bA*cB*bC*aD^2*cD*t-cA*bB*aC*aD*bD*cD*t+bA*cB*aC*aD*bD*cD*t+cA*aB*bC*aD*bD*cD*t-aA*cB*bC*aD*bD*cD*t-bA*aB*cC*aD*bD*cD*t+aA*bB*cC*aD*bD*cD*t-cA*aB*aC*bD^2*cD*t+aA*cB*aC*bD^2*cD*t-aA*aB*cC*bD^2*cD*t-cA*bB*cC*bD^2*cD*t-2*aA*aB*aD*cD*e2*t-2*bA*cB*aD*cD*e2*t+2*cA*aB*bD*cD*e2*t-2*aA*cB*bD*cD*e2*t+aA*aB*aC*aD*t+cA*bB*aC*aD*t-cA*aB*bC*aD*t+aA*cB*bC*aD*t+aC^2*aD^2*t-bC*cC*aD^2*t+cA*aB*aC*bD*t-aA*cB*aC*bD*t+aA*aB*cC*bD*t+cA*bB*cC*bD*t-aC^2*bD*cD*t-3*bC*cC*bD*cD*t-2*cA*aB*e2*t+2*aA*cB*e2*t+2*bD*cD*t) * hE + (-1/4*aC*cC*bD*cD*e1*e2*t+1/4*aC*bC*cD^2*e1*e2*t+1/4*aC*cC*bD^2*e1*e3*t-1/4*aC*bC*bD*cD*e1*e3*t-3/4*bC*cC*bD*cD*e2*e3*t+3/4*bC^2*cD^2*e2*e3*t+3/4*bC*cC*bD^2*e3^2*t-3/4*bC^2*bD*cD*e3^2*t+2*bD*cD*e1^2*t-2*aD*cD*e1*e2*t+4*aD^2*e2*e3*t+4*bD*cD*e2*e3*t-4*aC*cD*e2*t+4*aC*bD*e3*t-2*bD*cD*t-2*e2*e3*t+t) * hC0 + (3*aC*bC*e1*e3*t-2*aC^2*e2*e3*t-2*bC*cC*e2*e3*t+bC^2*e3^2*t+aC^2*t-bC*cC*t+4*e2*e3*t) * hD0 + (aD*cD*t) * h3_23 + (-bD*cD*t+t) * h3_33 + (-aA*aB*aD*cD*e1*t-bA*cB*aD*cD*e1*t+cA*aB*bD*cD*e1*t-aA*cB*bD*cD*e1*t+3/2*aC^2*e1*e3*t+1/2*aC*bC*e3^2*t-cA*aB*e1*t+aA*cB*e1*t-5/4*aC*cD*e1*t+2*aC*aD*e3*t-3*cC*bD*e3*t-3/4*bC*cD*e3*t) * hu2_23 + (1/4*aC*bC*cC*bD*e1*t-1/4*aC*bC^2*cD*e1*t-bA*aB*aD*cD*e2*t+aA*bB*aD*cD*e2*t-aA*aB*bD*cD*e2*t-cA*bB*bD*cD*e2*t+3/4*bC^2*cC*bD*e3*t-3/4*bC^3*cD*e3*t+3*bC*aD*e1*t-1/4*aC*bD*e1*t+aA*aB*e2*t+cA*bB*e2*t+2*aC*aD*e2*t+5*bC*cD*e2*t+1/4*bC*bD*e3*t+3*aC*bC*t) * hu2_32 + (-1/4*aC^2*cC*bD*e1*t+1/4*aC^2*bC*cD*e1*t+bA*aB*aD*cD*e1*t-aA*bB*aD*cD*e1*t+aA*aB*bD*cD*e1*t+cA*bB*bD*cD*e1*t-aA*aB*aD*cD*e2*t-bA*cB*aD*cD*e2*t+cA*aB*bD*cD*e2*t-aA*cB*bD*cD*e2*t-3/4*aC*bC*cC*bD*e3*t+3/4*aC*bC^2*cD*e3*t+3/2*aC*bC*e1*e3*t+1/2*bC^2*e3^2*t-aA*aB*e1*t-cA*bB*e1*t-3/2*aC*aD*e1*t+2*cC*bD*e1*t-5*bC*cD*e1*t-cA*aB*e2*t+aA*cB*e2*t-aC*cD*e2*t+9/2*bC*aD*e3*t-4*aC^2*t-bC*cC*t+4*t) * hu2_33 + (2*aD*cD*e1*e2*t) * hu5_22 + (2*aD*cD*e2*e3*t-aD*cD*t) * hu5_23 + (-2*bD*cD*e1*e2*t+2*e1*e2*t) * hu5_32 + (-2*bD*cD*e2*e3*t+bD*cD*t+2*e2*e3*t-t) * hu5_33 + (1/2*aC^2*cC*bD*e1*t-1/2*aC^2*bC*cD*e1*t+aA*aB*aD*cD*e2*t+bA*cB*aD*cD*e2*t-cA*aB*bD*cD*e2*t+aA*cB*bD*cD*e2*t+3/2*aC*bC*cC*bD*e3*t-3/2*aC*bC^2*cD*e3*t+aC*aD*e1*t-4*cC*bD*e1*t-bC*cD*e1*t+cA*aB*e2*t-aA*cB*e2*t+2*aC*cD*e2*t+8*aC^2*t-8*t) * hu6_22 + (-3/2*aC^2*e1*e3*t-1/2*aC*bC*e3^2*t-5/4*aC*cD*e1*t-aC*aD*e3*t+cC*bD*e3*t-7/4*bC*cD*e3*t) * hu6_23 + (1/4*aC*bC*cC*bD*e1*t-1/4*aC*bC^2*cD*e1*t+3/4*bC^2*cC*bD*e3*t-3/4*bC^3*cD*e3*t+3*bC*aD*e1*t+3/4*aC*bD*e1*t+aC*aD*e2*t+5/4*bC*bD*e3*t+5*aC*bC*t) * hu6_32 + (1/4*aC^2*cC*bD*e1*t-1/4*aC^2*bC*cD*e1*t+aA*aB*aD*cD*e2*t+bA*cB*aD*cD*e2*t-cA*aB*bD*cD*e2*t+aA*cB*bD*cD*e2*t+3/4*aC*bC*cC*bD*e3*t-3/4*aC*bC^2*cD*e3*t-3/2*aC*bC*e1*e3*t-1/2*bC^2*e3^2*t-1/2*aC*aD*e1*t-2*cC*bD*e1*t+2*bC*cD*e1*t+cA*aB*e2*t-aA*cB*e2*t+aC*cD*e2*t-7/2*bC*aD*e3*t+4*aC^2*t+bC*cC*t-4*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll6_23_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m23 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m23) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (bA*aB*aC*aD^3*t-aA*bB*aC*aD^3*t+aA*aB*bC*aD^3*t+bA*cB*bC*aD^3*t+cA*bB*aC*aD^2*bD*t-bA*cB*aC*aD^2*bD*t-cA*aB*bC*aD^2*bD*t+aA*cB*bC*aD^2*bD*t+bA*aB*cC*aD^2*bD*t-aA*bB*cC*aD^2*bD*t+cA*aB*aC*aD*bD^2*t-aA*cB*aC*aD*bD^2*t+aA*aB*cC*aD*bD^2*t+cA*bB*cC*aD*bD^2*t+2*aA*aB*aD^2*e2*t+2*bA*cB*aD^2*e2*t-2*cA*aB*aD*bD*e2*t+2*aA*cB*aD*bD*e2*t-bA*aB*aC*aD*t+aA*bB*aC*aD*t-aA*aB*bC*aD*t-bA*cB*bC*aD*t+2*aC*bC*aD^2*t+aA*aB*aC*bD*t+bA*cB*aC*bD*t-bA*aB*cC*bD*t+aA*bB*cC*bD*t+2*aC^2*aD*bD*t+2*bC*cC*aD*bD*t+2*aC*bC*bD*cD*t-2*aA*aB*e2*t-2*bA*cB*e2*t-2*aD*bD*t) * hE + (-3/4*bC*cC*bD*cD*e1*e2*t+3/4*bC^2*cD^2*e1*e2*t+1/4*aC*cC*bD*cD*e2^2*t-1/4*aC*bC*cD^2*e2^2*t+3/4*bC*cC*bD^2*e1*e3*t-3/4*bC^2*bD*cD*e1*e3*t-1/4*aC*cC*bD^2*e2*e3*t-bC^2*aD*cD*e2*e3*t+5/4*aC*bC*bD*cD*e2*e3*t+bC^2*aD*bD*e3^2*t-aC*bC*bD^2*e3^2*t-2*aD*bD*e1^2*t+2*aD^2*e1*e2*t+2*aD*bD*t-2*e1*e2*t) * hC0 + (-2*aC^2*e1*e2*t-2*bC*cC*e1*e2*t+bC^2*e1*e3*t-aC*bC*e2*e3*t+2*aC*bC*t) * hD0 + (-aD^2*t+t) * h3_23 + (aD*bD*t) * h3_33 + (aA*aB*aD^2*e1*t+bA*cB*aD^2*e1*t-cA*aB*aD*bD*e1*t+aA*cB*aD*bD*e1*t+1/2*aC*bC*e1*e3*t-1/2*aC^2*e2*e3*t-aA*aB*e1*t-bA*cB*e1*t+aC*aD*e1*t-11/4*bC*cD*e1*t+1/4*aC*cD*e2*t+3*bC*aD*e3*t+aC*bD*e3*t+aC^2*t) * hu2_23 + (3/4*bC^2*cC*bD*e1*t-3/4*bC^3*cD*e1*t+bA*aB*aD^2*e2*t-aA*bB*aD^2*e2*t-1/4*aC*bC*cC*bD*e2*t+aA*aB*aD*bD*e2*t+cA*bB*aD*bD*e2*t+1/4*aC*bC^2*cD*e2*t+bC^3*aD*e3*t-aC*bC^2*bD*e3*t+1/4*bC*bD*e1*t-bA*aB*e2*t+aA*bB*e2*t+bC*aD*e2*t+1/4*aC*bD*e2*t) * hu2_32 + (-bA*aB*aD^2*e1*t+aA*bB*aD^2*e1*t-3/4*aC*bC*cC*bD*e1*t-aA*aB*aD*bD*e1*t-cA*bB*aD*bD*e1*t+3/4*aC*bC^2*cD*e1*t+aA*aB*aD^2*e2*t+bA*cB*aD^2*e2*t+1/4*aC^2*cC*bD*e2*t-cA*aB*aD*bD*e2*t+aA*cB*aD*bD*e2*t-1/4*aC^2*bC*cD*e2*t-aC*bC^2*aD*e3*t+aC^2*bC*bD*e3*t+1/2*bC^2*e1*e3*t-1/2*aC*bC*e2*e3*t+bA*aB*e1*t-aA*bB*e1*t-9/2*bC*aD*e1*t-3*aC*bD*e1*t-aA*aB*e2*t-bA*cB*e2*t+3/2*aC*aD*e2*t-2*bC*cD*e2*t-2*bC*bD*e3*t+aC*bC*t) * hu2_33 + (-2*aD^2*e1*e2*t+2*e1*e2*t) * hu5_22 + (-2*aD^2*e2*e3*t+aD^2*t+2*e2*e3*t-t) * hu5_23 + (2*aD*bD*e1*e2*t) * hu5_32 + (2*aD*bD*e2*e3*t-aD*bD*t) * hu5_33 + (3/2*aC*bC*cC*bD*e1*t-3/2*aC*bC^2*cD*e1*t-aA*aB*aD^2*e2*t-bA*cB*aD^2*e2*t-1/2*aC^2*cC*bD*e2*t+cA*aB*aD*bD*e2*t-aA*cB*aD*bD*e2*t+1/2*aC^2*bC*cD*e2*t+2*aC*bC^2*aD*e3*t-2*aC^2*bC*bD*e3*t+5*bC*aD*e1*t+5*aC*bD*e1*t+aA*aB*e2*t+bA*cB*e2*t-2*aC*aD*e2*t+2*bC*cD*e2*t+4*bC*bD*e3*t) * hu6_22 + (-1/2*aC*bC*e1*e3*t+1/2*aC^2*e2*e3*t+aC*aD*e1*t+5/4*bC*cD*e1*t+1/4*aC*cD*e2*t-2*bC*aD*e3*t+2*aC*bD*e3*t-aC^2*t) * hu6_23 + (3/4*bC^2*cC*bD*e1*t-3/4*bC^3*cD*e1*t-1/4*aC*bC*cC*bD*e2*t+1/4*aC*bC^2*cD*e2*t+bC^3*aD*e3*t-aC*bC^2*bD*e3*t+13/4*bC*bD*e1*t-2*bC*aD*e2*t+1/4*aC*bD*e2*t) * hu6_32 + (3/4*aC*bC*cC*bD*e1*t-3/4*aC*bC^2*cD*e1*t-aA*aB*aD^2*e2*t-bA*cB*aD^2*e2*t-1/4*aC^2*cC*bD*e2*t+cA*aB*aD*bD*e2*t-aA*cB*aD*bD*e2*t+1/4*aC^2*bC*cD*e2*t+aC*bC^2*aD*e3*t-aC^2*bC*bD*e3*t-1/2*bC^2*e1*e3*t+1/2*aC*bC*e2*e3*t+1/2*bC*aD*e1*t+2*aC*bD*e1*t+aA*aB*e2*t+bA*cB*e2*t-1/2*aC*aD*e2*t+2*bC*bD*e3*t-aC*bC*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll6_24_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m24 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_32 := congrArg M4.m32 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_32 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m24) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-3/2*bA*aB*aC*aD^2*qD1*e1*e3*t+3/2*aA*bB*aC*aD^2*qD1*e1*e3*t-3/2*aA*aB*bC*aD^2*qD1*e1*e3*t-3/2*bA*cB*bC*aD^2*qD1*e1*e3*t-3/2*cA*bB*aC*aD*bD*qD1*e1*e3*t+3/2*bA*cB*aC*aD*bD*qD1*e1*e3*t+3/2*cA*aB*bC*aD*bD*qD1*e1*e3*t-3/2*aA*cB*bC*aD*bD*qD1*e1*e3*t-3/2*bA*aB*cC*aD*bD*qD1*e1*e3*t+3/2*aA*bB*cC*aD*bD*qD1*e1*e3*t-3/2*cA*aB*aC*bD^2*qD1*e1*e3*t+3/2*aA*cB*aC*bD^2*qD1*e1*e3*t-3/2*aA*aB*cC*bD^2*qD1*e1*e3*t-3/2*cA*bB*cC*bD^2*qD1*e1*e3*t-1/2*cA*aB*aC*aD*qD2*e2^2*t+1/2*aA*cB*aC*aD*qD2*e2^2*t-1/2*aA*aB*cC*aD*qD2*e2^2*t-1/2*cA*bB*cC*aD*qD2*e2^2*t+1/2*aA*aB*aC*cD*qD2*e2^2*t+1/2*cA*bB*aC*cD*qD2*e2^2*t-1/2*cA*aB*bC*cD*qD2*e2^2*t+1/2*aA*cB*bC*cD*qD2*e2^2*t+1/2*aA*aB*aC*aD*qD1*e2*e3*t+1/2*cA*bB*aC*aD*qD1*e2*e3*t-1/2*cA*aB*bC*aD*qD1*e2*e3*t+1/2*aA*cB*bC*aD*qD1*e2*e3*t+1/2*cA*aB*aC*bD*qD1*e2*e3*t-1/2*aA*cB*aC*bD*qD1*e2*e3*t+1/2*aA*aB*cC*bD*qD1*e2*e3*t+1/2*cA*bB*cC*bD*qD1*e2*e3*t-3*aA*aB*aD*qD1*e1*e2*e3*t-3*bA*cB*aD*qD1*e1*e2*e3*t+3*cA*aB*bD*qD1*e1*e2*e3*t-3*aA*cB*bD*qD1*e1*e2*e3*t+1/2*bA*aB*aC*aD^2*qD2*t-1/2*aA*bB*aC*aD^2*qD2*t+1/2*aA*aB*bC*aD^2*qD2*t+1/2*bA*cB*bC*aD^2*qD2*t-aA*aB*aC*aD*bD*qD2*t-1/2*cA*bB*aC*aD*bD*qD2*t-1/2*bA*cB*aC*aD*bD*qD2*t+1/2*cA*aB*bC*aD*bD*qD2*t-1/2*aA*cB*bC*aD*bD*qD2*t+1/2*bA*aB*cC*aD*bD*qD2*t-1/2*aA*bB*cC*aD*bD*qD2*t-1/2*cA*aB*aC*bD^2*qD2*t+1/2*aA*cB*aC*bD^2*qD2*t-1/2*aA*aB*cC*bD^2*qD2*t-1/2*cA*bB*cC*bD^2*qD2*t-aC*cC*aD*qD2*e2^2*t+aC^2*cD*qD2*e2^2*t+aC*cC*bD*qD1*e2*e3*t-aC*bC*cD*qD1*e2*e3*t+aC*bC*aD*qD2*e2*e3*t+bC*cC*bD*qD2*e2*e3*t-cA*aB*qD1*e2^2*e3*t+aA*cB*qD1*e2^2*e3*t-cC*aD*qD1*e2^2*e3*t+aC*cD*qD1*e2^2*e3*t-aA*aB*qD2*e2^2*e3*t-cA*bB*qD2*e2^2*e3*t-aC*aD*qD2*e2^2*e3*t-cC*bD*qD2*e2^2*e3*t-aA*aB*aC*aD*qD1*t-cA*bB*aC*aD*qD1*t+cA*aB*bC*aD*qD1*t-aA*cB*bC*aD*qD1*t-cA*aB*aC*bD*qD1*t+aA*cB*aC*bD*qD1*t-aA*aB*cC*bD*qD1*t-cA*bB*cC*bD*qD1*t-1/2*bA*aB*aC*aD*qD2*t+1/2*aA*bB*aC*aD*qD2*t-1/2*aA*aB*bC*aD*qD2*t-1/2*bA*cB*bC*aD*qD2*t+1/2*aA*aB*aC*bD*qD2*t+1/2*bA*cB*aC*bD*qD2*t-1/2*bA*aB*cC*bD*qD2*t+1/2*aA*bB*cC*bD*qD2*t+aA*aB*aD*qD2*e2*t+bA*cB*aD*qD2*e2*t+cA*aB*bD*qD2*e2*t-aA*cB*bD*qD2*e2*t-aC*qC1*aD^2*t-aC*qC1*bD*cD*t+2*bC*cC*aD*qD1*t+2*aC*bC*cD*qD1*t-2*aC*bC*aD*qD2*t+aC^2*bD*qD2*t+3*bC*cC*bD*qD2*t+2*cA*aB*qD1*e2*t-2*aA*cB*qD1*e2*t+cC*aD*qD1*e2*t-aC*cD*qD1*e2*t-aA*aB*qD2*e2*t-bA*cB*qD2*e2*t+aC*aD*qD2*e2*t+cC*bD*qD2*e2*t+3*bD*qD1*e1*e3*t-bD*qD2*t) * hE + (-1/4*aC*cC*bD*cD*qD1*e1*e2*t+1/4*aC*bC*cD^2*qD1*e1*e2*t+1/4*bC*cC*bD*cD*qD2*e1*e2*t-1/4*bC^2*cD^2*qD2*e1*e2*t+1/4*aC*cC*bD^2*qD1*e1*e3*t-1/4*aC*bC*bD*cD*qD1*e1*e3*t-1/4*bC*cC*bD^2*qD2*e1*e3*t+1/4*bC^2*bD*cD*qD2*e1*e3*t-1/4*bC*cC*bD*cD*qD1*e2*e3*t+1/4*bC^2*cD^2*qD1*e2*e3*t+1/4*bC*cC*bD^2*qD1*e3^2*t-1/4*bC^2*bD*cD*qD1*e3^2*t+3*bD*qD1*e1^3*e3*t-3*aD*qD1*e1^2*e2*e3*t-bD*qD2*e1^2*t+3*cD*qD1*e1*e2*t-2*aD*qD2*e1*e2*t-3*bD*qD1*e1*e3*t-aD*qD1*e2*e3*t-3*bD*qD2*e2*e3*t+1/2*qC1*cD*e2*t+qD2*e1*e2*t-1/2*qC1*bD*e3*t-2*qD1*e2*e3*t+aD*qD1*t+2*bD*qD2*t+qD1*t) * hC0 + (-aD*e1*t-1/2*cD*e2*t-1/2*bD*e3*t-t) * hC3 + (-aC*cC*qD1*e1*e2*t+bC*cC*qD2*e1*e2*t-bC*cC*qD1*e2*e3*t-aC*qC1*t) * hD0 + (-aC*cC*e1*e2*t-3*aC*bC*e1*e3*t+2*aC^2*e2*e3*t+bC*cC*e2*e3*t-cC*e2^2*e3*t-bC^2*e3^2*t-aC^2*t+bC*cC*t+cC*e2*t-e2*e3*t+t) * hD3 + (-aC^2*e1*e2*t+bC^2*e1*e3*t-4*aC*bC*e2*e3*t+aC*e2^2*e3*t+2*aC*bC*t-aC*e2*t+3*e1*e2*t) * hD4 + (3/2*aD*qD1*e1*e3*t-1/2*aD*qD2*t+1/2*qD2*t) * h3_23 + (-1/2*qD2*e2^2*t) * h3_32 + (-3/2*bD*qD1*e1*e3*t+1/2*qD1*e2*e3*t-1/2*bD*qD2*t-qD1*t) * h3_33 + (-3/2*aA*aB*aD*qD1*e1^2*e3*t-3/2*bA*cB*aD*qD1*e1^2*e3*t+3/2*cA*aB*bD*qD1*e1^2*e3*t-3/2*aA*cB*bD*qD1*e1^2*e3*t-1/2*cA*aB*qD1*e1*e2*e3*t+1/2*aA*cB*qD1*e1*e2*e3*t-1/2*cA*aB*qD2*e2^2*e3*t+1/2*aA*cB*qD2*e2^2*e3*t+1/2*aA*aB*aD*qD2*e1*t+1/2*bA*cB*aD*qD2*e1*t+1/2*cA*aB*bD*qD2*e1*t-1/2*aA*cB*bD*qD2*e1*t+3/2*aC^2*qD1*e1*e3*t-1/2*aC*bC*qD2*e1*e3*t-3/2*aC*qD1*e1^2*e3*t+2*aC^2*qD2*e2*e3*t+1/2*aC*qD2*e1*e2*e3*t+1/2*aC*bC*qD1*e3^2*t-aC*qD1*e2*e3^2*t+cA*aB*qD1*e1*t-aA*cB*qD1*e1*t-1/4*aC*cD*qD1*e1*t-1/2*aA*aB*qD2*e1*t-1/2*bA*cB*qD2*e1*t+1/4*bC*cD*qD2*e1*t-1/4*bC*cD*qD1*e3*t-aC^2*qD2*t+qC1*cD*e1*t-aC*qD2*e1*t+cC*qD2*e2*t-qC1*aD*e3*t+1/2*aC*qD1*e3*t+1/2*aC*qC2*t-1/2*qC2*t) * hu2_23 + (-3/2*bA*aB*aD*qD1*e1*e2*e3*t+3/2*aA*bB*aD*qD1*e1*e2*e3*t-3/2*aA*aB*bD*qD1*e1*e2*e3*t-3/2*cA*bB*bD*qD1*e1*e2*e3*t+1/4*aC*bC*cC*bD*qD1*e1*t-1/4*aC*bC^2*cD*qD1*e1*t-1/4*bC^2*cC*bD*qD2*e1*t+1/4*bC^3*cD*qD2*e1*t-1/2*aA*aB*qD2*e1*e2^2*t-1/2*cA*bB*qD2*e1*e2^2*t+1/4*bC^2*cC*bD*qD1*e3*t-1/4*bC^3*cD*qD1*e3*t+1/2*aA*aB*qD1*e2^2*e3*t+1/2*cA*bB*qD1*e2^2*e3*t+1/2*bA*aB*aD*qD2*e2*t-1/2*aA*bB*aD*qD2*e2*t-1/2*aA*aB*bD*qD2*e2*t-1/2*cA*bB*bD*qD2*e2*t-aC*qD2*e1*e2^2*t+3/2*aC*qD1*e2^2*e3*t+bC*qD2*e2^2*e3*t-qD1*e1*e2^2*e3*t-qD2*e2^3*e3*t-1/4*aC*bD*qD1*e1*t+1/4*bC*bD*qD2*e1*t-aA*aB*qD1*e2*t-cA*bB*qD1*e2*t-1/2*bA*aB*qD2*e2*t+1/2*aA*bB*qD2*e2*t-1/4*bC*bD*qD1*e3*t-aC*bC*qD1*t-2*bC*qD1*e1*t-3/2*aC*qD1*e2*t+qD1*e1*e2*t+qD2*e2^2*t-1/2*bC*qC1*t) * hu2_32 + (3/2*bA*aB*aD*qD1*e1^2*e3*t-3/2*aA*bB*aD*qD1*e1^2*e3*t+3/2*aA*aB*bD*qD1*e1^2*e3*t+3/2*cA*bB*bD*qD1*e1^2*e3*t-3/2*aA*aB*aD*qD1*e1*e2*e3*t-3/2*bA*cB*aD*qD1*e1*e2*e3*t+3/2*cA*aB*bD*qD1*e1*e2*e3*t-3/2*aA*cB*bD*qD1*e1*e2*e3*t-1/4*aC^2*cC*bD*qD1*e1*t+1/4*aC^2*bC*cD*qD1*e1*t+1/4*aC*bC*cC*bD*qD2*e1*t-1/4*aC*bC^2*cD*qD2*e1*t+1/2*cA*aB*qD2*e1*e2^2*t-1/2*aA*cB*qD2*e1*e2^2*t-1/4*aC*bC*cC*bD*qD1*e3*t+1/4*aC*bC^2*cD*qD1*e3*t-1/2*aA*aB*qD1*e1*e2*e3*t-1/2*cA*bB*qD1*e1*e2*e3*t-1/2*cA*aB*qD1*e2^2*e3*t+1/2*aA*cB*qD1*e2^2*e3*t-1/2*aA*aB*qD2*e2^2*e3*t-1/2*cA*bB*qD2*e2^2*e3*t-1/2*bA*aB*aD*qD2*e1*t+1/2*aA*bB*aD*qD2*e1*t+1/2*aA*aB*bD*qD2*e1*t+1/2*cA*bB*bD*qD2*e1*t+1/2*aA*aB*aD*qD2*e2*t+1/2*bA*cB*aD*qD2*e2*t+1/2*cA*aB*bD*qD2*e2*t-1/2*aA*cB*bD*qD2*e2*t+3/2*aC*bC*qD1*e1*e3*t-1/2*bC^2*qD2*e1*e3*t-3/2*bC*qD1*e1^2*e3*t+2*aC*bC*qD2*e2*e3*t-1/2*bC*qD2*e1*e2*e3*t+1/2*cC*qD1*e2^2*e3*t-aC*qD2*e2^2*e3*t+qD2*e1*e2^2*e3*t+1/2*bC^2*qD1*e3^2*t-qD1*e2^2*e3^2*t+aA*aB*qD1*e1*t+cA*bB*qD1*e1*t-1/2*aC*aD*qD1*e1*t+1/2*bA*aB*qD2*e1*t-1/2*aA*bB*qD2*e1*t+1/2*bC*aD*qD2*e1*t+cA*aB*qD1*e2*t-aA*cB*qD1*e2*t-1/2*aA*aB*qD2*e2*t-1/2*bA*cB*qD2*e2*t-1/2*bC*aD*qD1*e3*t-bC*cC*qD1*t-aC*bC*qD2*t+qC1*aD*e1*t+2*aC*qD1*e1*t-bC*qD2*e1*t+qC1*cD*e2*t-1/2*cC*qD1*e2*t-qD2*e1*e2*t+1/2*bC*qD1*e3*t+qD1*e2*e3*t+1/2*aC*qC1*t+1/2*bC*qC2*t+1/2*qC1*t) * hu2_33 + (3*aD*qD1*e1^2*e2*e3*t-aD*qD2*e1*e2*t+qD2*e1*e2*t) * hu5_22 + (3*aD*qD1*e1*e2*e3^2*t-3/2*aD*qD1*e1*e3*t-aD*qD2*e2*e3*t+qD2*e2*e3*t+1/2*aD*qD2*t-1/2*qD2*t) * hu5_23 + (-3*bD*qD1*e1^2*e2*e3*t+qD1*e1*e2^2*e3*t+qD2*e2^3*e3*t-bD*qD2*e1*e2*t-2*qD1*e1*e2*t-1/2*qD2*e2^2*t) * hu5_32 + (-3*bD*qD1*e1*e2*e3^2*t-qD2*e1*e2^2*e3*t+qD1*e2^2*e3^2*t+3/2*bD*qD1*e1*e3*t-bD*qD2*e2*e3*t-5/2*qD1*e2*e3*t+1/2*bD*qD2*t+qD1*t) * hu5_33 + (3/2*aA*aB*aD*qD1*e1*e2*e3*t+3/2*bA*cB*aD*qD1*e1*e2*e3*t-3/2*cA*aB*bD*qD1*e1*e2*e3*t+3/2*aA*cB*bD*qD1*e1*e2*e3*t+1/2*aC^2*cC*bD*qD1*e1*t-1/2*aC^2*bC*cD*qD1*e1*t-1/2*aC*bC*cC*bD*qD2*e1*t+1/2*aC*bC^2*cD*qD2*e1*t-1/2*cA*aB*qD2*e1*e2^2*t+1/2*aA*cB*qD2*e1*e2^2*t+1/2*aC*bC*cC*bD*qD1*e3*t-1/2*aC*bC^2*cD*qD1*e3*t+1/2*cA*aB*qD1*e2^2*e3*t-1/2*aA*cB*qD1*e2^2*e3*t-1/2*aA*aB*aD*qD2*e2*t-1/2*bA*cB*aD*qD2*e2*t-1/2*cA*aB*bD*qD2*e2*t+1/2*aA*cB*bD*qD2*e2*t-aC*qD1*e1*e2*e3*t-cA*aB*qD1*e2*t+aA*cB*qD1*e2*t+1/2*aA*aB*qD2*e2*t+1/2*bA*cB*qD2*e2*t-qC1*aD*e1*t-4*aC*qD1*e1*t+bC*qD2*e1*t-qC1*cD*e2*t-aC*qC1*t-qC1*t) * hu6_22 + (-3/2*aC^2*qD1*e1*e3*t+1/2*aC*bC*qD2*e1*e3*t-3/2*aC*qD1*e1^2*e3*t-2*aC^2*qD2*e2*e3*t-1/2*aC*qD2*e1*e2*e3*t-1/2*aC*bC*qD1*e3^2*t-1/4*aC*cD*qD1*e1*t+1/4*bC*cD*qD2*e1*t-1/4*bC*cD*qD1*e3*t+aC^2*qD2*t+2*aC*qD2*e1*t+cC*qD2*e2*t+1/2*aC*qD1*e3*t+bC*qD2*e3*t-1/2*aC*qC2*t+3/2*qC2*t) * hu6_23 + (1/4*aC*bC*cC*bD*qD1*e1*t-1/4*aC*bC^2*cD*qD1*e1*t-1/4*bC^2*cC*bD*qD2*e1*t+1/4*bC^3*cD*qD2*e1*t+1/4*bC^2*cC*bD*qD1*e3*t-1/4*bC^3*cD*qD1*e3*t-1/2*aC*qD1*e2^2*e3*t+3/4*aC*bD*qD1*e1*t-3/4*bC*bD*qD2*e1*t+3/4*bC*bD*qD1*e3*t+aC*bC*qD1*t-3*bC*qD1*e1*t+1/2*aC*qD1*e2*t+bC*qD2*e2*t-1/2*bC*qC1*t) * hu6_32 + (3/2*aA*aB*aD*qD1*e1*e2*e3*t+3/2*bA*cB*aD*qD1*e1*e2*e3*t-3/2*cA*aB*bD*qD1*e1*e2*e3*t+3/2*aA*cB*bD*qD1*e1*e2*e3*t+1/4*aC^2*cC*bD*qD1*e1*t-1/4*aC^2*bC*cD*qD1*e1*t-1/4*aC*bC*cC*bD*qD2*e1*t+1/4*aC*bC^2*cD*qD2*e1*t-1/2*cA*aB*qD2*e1*e2^2*t+1/2*aA*cB*qD2*e1*e2^2*t+1/4*aC*bC*cC*bD*qD1*e3*t-1/4*aC*bC^2*cD*qD1*e3*t+1/2*cA*aB*qD1*e2^2*e3*t-1/2*aA*cB*qD1*e2^2*e3*t-1/2*aA*aB*aD*qD2*e2*t-1/2*bA*cB*aD*qD2*e2*t-1/2*cA*aB*bD*qD2*e2*t+1/2*aA*cB*bD*qD2*e2*t-3/2*aC*bC*qD1*e1*e3*t+1/2*bC^2*qD2*e1*e3*t-3/2*bC*qD1*e1^2*e3*t-2*aC*bC*qD2*e2*e3*t-aC*qD1*e1*e2*e3*t-1/2*bC*qD2*e1*e2*e3*t-1/2*cC*qD1*e2^2*e3*t-1/2*bC^2*qD1*e3^2*t-1/2*aC*aD*qD1*e1*t+1/2*bC*aD*qD2*e1*t-cA*aB*qD1*e2*t+aA*cB*qD1*e2*t+1/2*aA*aB*qD2*e2*t+1/2*bA*cB*qD2*e2*t-1/2*bC*aD*qD1*e3*t+bC*cC*qD1*t+aC*bC*qD2*t-qC1*aD*e1*t-aC*qD1*e1*t-bC*qD2*e1*t-qC1*cD*e2*t+1/2*cC*qD1*e2*t+3/2*bC*qD1*e3*t-1/2*aC*qC1*t-1/2*bC*qC2*t-1/2*qC1*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll6_32_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m32 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m32) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-2*aC*cC*aD^2*t-2*aC*cC*bD*cD*t+2*cC*aD*e1*t-2*aC*cD*e1*t) * hE + (1/4*cC^2*bD*cD*e1*e2*t-1/4*bC*cC*cD^2*e1*e2*t-1/4*cC^2*bD^2*e1*e3*t+1/4*bC*cC*bD*cD*e1*e3*t-bC*cC*aD*cD*e2*e3*t-3/4*aC*cC*bD*cD*e2*e3*t+7/4*aC*bC*cD^2*e2*e3*t+bC*cC*aD*bD*e3^2*t+3/4*aC*cC*bD^2*e3^2*t-7/4*aC*bC*bD*cD*e3^2*t+2*e1*e3*t) * hC0 + (2*aC^2*e1*e3*t-bC*cC*e1*e3*t-aC*bC*e3^2*t-2*aC*cC*t) * hD0 + (-1/2*aC^2*e3^2*t+1/4*cC*cD*e1*t-2*cC*aD*e3*t+5/4*aC*cD*e3*t) * hu2_23 + (-1/4*bC*cC^2*bD*e1*t+1/4*bC^2*cC*cD*e1*t+bC^2*cC*aD*e3*t+3/4*aC*bC*cC*bD*e3*t-7/4*aC*bC^2*cD*e3*t-3/2*aC*bC*e1*e3*t+aC*aD*e1*t+1/4*cC*bD*e1*t+5*bC*cD*e1*t-2*aC*cD*e2*t-3/4*aC*bD*e3*t-aC^2*t+2*e1^2*t) * hu2_32 + (1/4*aC*cC^2*bD*e1*t-1/4*aC*bC*cC*cD*e1*t-aC*bC*cC*aD*e3*t-3/4*aC^2*cC*bD*e3*t+7/4*aC^2*bC*cD*e3*t-3/2*bC*cC*e1*e3*t-1/2*aC*bC*e3^2*t+7/2*cC*aD*e1*t-3*aC*cD*e1*t-5/2*aC*aD*e3*t+3*bC*cD*e3*t-aC*cC*t+2*e1*e3*t) * hu2_33 + (-1/2*aC*cC^2*bD*e1*t+1/2*aC*bC*cC*cD*e1*t+2*aC*bC*cC*aD*e3*t+3/2*aC^2*cC*bD*e3*t-7/2*aC^2*bC*cD*e3*t-3*cC*aD*e1*t+7*aC*cD*e1*t+2*cC*cD*e2*t+2*aC*aD*e3*t) * hu6_22 + (1/2*aC^2*e3^2*t+1/4*cC*cD*e1*t+cC*aD*e3*t+9/4*aC*cD*e3*t) * hu6_23 + (-1/4*bC*cC^2*bD*e1*t+1/4*bC^2*cC*cD*e1*t+bC^2*cC*aD*e3*t+3/4*aC*bC*cC*bD*e3*t-7/4*aC*bC^2*cD*e3*t+3/2*aC*bC*e1*e3*t-aC*aD*e1*t-3/4*cC*bD*e1*t+3*bC*cD*e1*t+cC*aD*e2*t-3*aC*cD*e2*t+1/4*aC*bD*e3*t+aC^2*t) * hu6_32 + (-1/4*aC*cC^2*bD*e1*t+1/4*aC*bC*cC*cD*e1*t+aC*bC*cC*aD*e3*t+3/4*aC^2*cC*bD*e3*t-7/4*aC^2*bC*cD*e3*t+3/2*bC*cC*e1*e3*t+1/2*aC*bC*e3^2*t-3/2*cC*aD*e1*t+6*aC*cD*e1*t+2*cC*cD*e2*t-1/2*aC*aD*e3*t+3*bC*cD*e3*t+aC*cC*t) * hu6_33) +end Spec0K0 diff --git a/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s6.lean b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s6.lean new file mode 100644 index 0000000000..a088670c63 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0K0_ABCEDF_s6.lean @@ -0,0 +1,84 @@ +/- k=0 radical certificates, class ABCEDF (generated by internal notes from Singular `lift`). -/ +import Nov15.Spec0K0Core +namespace Spec0K0 +variable {K : Type*} [Field K] [CharZero K] + +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll6_33_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m33 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m33) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (-bA*aB*aC*aD^2*cD*t+aA*bB*aC*aD^2*cD*t-aA*aB*bC*aD^2*cD*t-bA*cB*bC*aD^2*cD*t-cA*bB*aC*aD*bD*cD*t+bA*cB*aC*aD*bD*cD*t+cA*aB*bC*aD*bD*cD*t-aA*cB*bC*aD*bD*cD*t-bA*aB*cC*aD*bD*cD*t+aA*bB*cC*aD*bD*cD*t-cA*aB*aC*bD^2*cD*t+aA*cB*aC*bD^2*cD*t-aA*aB*cC*bD^2*cD*t-cA*bB*cC*bD^2*cD*t-2*aA*aB*aD*cD*e2*t-2*bA*cB*aD*cD*e2*t+2*cA*aB*bD*cD*e2*t-2*aA*cB*bD*cD*e2*t+aA*aB*aC*aD*t+cA*bB*aC*aD*t-cA*aB*bC*aD*t+aA*cB*bC*aD*t+aC^2*aD^2*t-bC*cC*aD^2*t+cA*aB*aC*bD*t-aA*cB*aC*bD*t+aA*aB*cC*bD*t+cA*bB*cC*bD*t-aC^2*bD*cD*t-3*bC*cC*bD*cD*t-2*cA*aB*e2*t+2*aA*cB*e2*t+2*bD*cD*t) * hE + (-3/4*aC*cC*bD*cD*e1*e2*t+3/4*aC*bC*cD^2*e1*e2*t-1/4*cC^2*bD*cD*e2^2*t+1/4*bC*cC*cD^2*e2^2*t+3/4*aC*cC*bD^2*e1*e3*t-3/4*aC*bC*bD*cD*e1*e3*t+1/4*cC^2*bD^2*e2*e3*t-bC*cC*bD*cD*e2*e3*t+3/4*bC^2*cD^2*e2*e3*t+3/4*bC*cC*bD^2*e3^2*t-3/4*bC^2*bD*cD*e3^2*t+2*bD*cD*e1^2*t-2*aD*cD*e1*e2*t+4*aD^2*e2*e3*t+4*bD*cD*e2*e3*t-4*aC*cD*e2*t+4*aC*bD*e3*t-2*bD*cD*t-2*e2*e3*t+t) * hC0 + (aC*bC*e1*e3*t-2*aC^2*e2*e3*t-2*bC*cC*e2*e3*t+aC^2*t-bC*cC*t+4*e2*e3*t) * hD0 + (aD*cD*t) * h3_23 + (-bD*cD*t+t) * h3_33 + (-aA*aB*aD*cD*e1*t-bA*cB*aD*cD*e1*t+cA*aB*bD*cD*e1*t-aA*cB*bD*cD*e1*t+1/2*aC^2*e1*e3*t-cA*aB*e1*t+aA*cB*e1*t-7/4*aC*cD*e1*t-1/4*cC*cD*e2*t-6*cC*bD*e3*t-3/4*bC*cD*e3*t) * hu2_23 + (3/4*aC*bC*cC*bD*e1*t-3/4*aC*bC^2*cD*e1*t+1/4*bC*cC^2*bD*e2*t-1/4*bC^2*cC*cD*e2*t-bA*aB*aD*cD*e2*t+aA*bB*aD*cD*e2*t-aA*aB*bD*cD*e2*t-cA*bB*bD*cD*e2*t+3/4*bC^2*cC*bD*e3*t-3/4*bC^3*cD*e3*t+bC*aD*e1*t-3/4*aC*bD*e1*t+aA*aB*e2*t+cA*bB*e2*t+4*aC*aD*e2*t-1/4*cC*bD*e2*t+6*bC*cD*e2*t+1/4*bC*bD*e3*t+3*aC*bC*t) * hu2_32 + (-3/4*aC^2*cC*bD*e1*t+3/4*aC^2*bC*cD*e1*t+bA*aB*aD*cD*e1*t-aA*bB*aD*cD*e1*t+aA*aB*bD*cD*e1*t+cA*bB*bD*cD*e1*t-1/4*aC*cC^2*bD*e2*t+1/4*aC*bC*cC*cD*e2*t-aA*aB*aD*cD*e2*t-bA*cB*aD*cD*e2*t+cA*aB*bD*cD*e2*t-aA*cB*bD*cD*e2*t-3/4*aC*bC*cC*bD*e3*t+3/4*aC*bC^2*cD*e3*t+1/2*aC*bC*e1*e3*t-aA*aB*e1*t-cA*bB*e1*t-1/2*aC*aD*e1*t+4*cC*bD*e1*t-7*bC*cD*e1*t-cA*aB*e2*t+aA*cB*e2*t-1/2*cC*aD*e2*t+9/2*bC*aD*e3*t+aC*bD*e3*t-4*aC^2*t-bC*cC*t+4*t) * hu2_33 + (2*aD*cD*e1*e2*t) * hu5_22 + (2*aD*cD*e2*e3*t-aD*cD*t) * hu5_23 + (-2*bD*cD*e1*e2*t+2*e1*e2*t) * hu5_32 + (-2*bD*cD*e2*e3*t+bD*cD*t+2*e2*e3*t-t) * hu5_33 + (3/2*aC^2*cC*bD*e1*t-3/2*aC^2*bC*cD*e1*t+1/2*aC*cC^2*bD*e2*t-1/2*aC*bC*cC*cD*e2*t+aA*aB*aD*cD*e2*t+bA*cB*aD*cD*e2*t-cA*aB*bD*cD*e2*t+aA*cB*bD*cD*e2*t+3/2*aC*bC*cC*bD*e3*t-3/2*aC*bC^2*cD*e3*t-5*aC*aD*e1*t-7*cC*bD*e1*t+cA*aB*e2*t-aA*cB*e2*t-2*aC*bD*e3*t+8*aC^2*t-8*t) * hu6_22 + (-1/2*aC^2*e1*e3*t-7/4*aC*cD*e1*t-1/4*cC*cD*e2*t-aC*aD*e3*t+cC*bD*e3*t-3/4*bC*cD*e3*t) * hu6_23 + (3/4*aC*bC*cC*bD*e1*t-3/4*aC*bC^2*cD*e1*t+1/4*bC*cC^2*bD*e2*t-1/4*bC^2*cC*cD*e2*t+3/4*bC^2*cC*bD*e3*t-3/4*bC^3*cD*e3*t+bC*aD*e1*t+9/4*aC*bD*e1*t+aC*aD*e2*t-1/4*cC*bD*e2*t-3/4*bC*bD*e3*t+5*aC*bC*t) * hu6_32 + (3/4*aC^2*cC*bD*e1*t-3/4*aC^2*bC*cD*e1*t+1/4*aC*cC^2*bD*e2*t-1/4*aC*bC*cC*cD*e2*t+aA*aB*aD*cD*e2*t+bA*cB*aD*cD*e2*t-cA*aB*bD*cD*e2*t+aA*cB*bD*cD*e2*t+3/4*aC*bC*cC*bD*e3*t-3/4*aC*bC^2*cD*e3*t-1/2*aC*bC*e1*e3*t-11/2*aC*aD*e1*t-3*cC*bD*e1*t+bC*cD*e1*t+cA*aB*e2*t-aA*cB*e2*t-1/2*cC*aD*e2*t-7/2*bC*aD*e3*t-aC*bD*e3*t+4*aC^2*t+bC*cC*t-4*t) * hu6_33) +set_option maxHeartbeats 0 in +set_option maxRecDepth 100000 in +theorem ll6_34_ABCEDF (aA bA cA pA1 pA2 qA1 qA2 aB bB cB pB1 pB2 qB1 qB2 aC bC cC pC1 pC2 qC1 qC2 aD bD cD pD1 pD2 qD1 qD2 e1 e2 e3 : K) + (hA : JobOK aA bA cA pA1 pA2 qA1 qA2) (hB : JobOK aB bB cB pB1 pB2 qB1 qB2) + (hC : JobOK aC bC cC pC1 pC2 qC1 qC2) (hD : JobOK aD bD cD pD1 pD2 qD1 qD2) (hE : EpsOK e1 e2 e3) + (hR : Rel (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (mm (mm (mm (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MJ aC bC cC pC1 pC2 qC1 qC2)) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MFm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MJ aD bD cD pD1 pD2 qD1 qD2)) (MFm e1 e2 e3)) (mm (mm (MJ aA bA cA pA1 pA2 qA1 qA2) (MJ aB bB cB pB1 pB2 qB1 qB2)) (MEm e1 e2 e3)) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))) : + (LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m34 = 0 := by + obtain ⟨hA0,hA1,hA2,hA3,hA4⟩ := hA + obtain ⟨hB0,hB1,hB2,hB3,hB4⟩ := hB + obtain ⟨hC0,hC1,hC2,hC3,hC4⟩ := hC + obtain ⟨hD0,hD1,hD2,hD3,hD4⟩ := hD + unfold EpsOK at hE + obtain ⟨hW3, hW7, hu1, hu2, hu5, hu6⟩ := hR + obtain ⟨hu1_22, hu1_23, hu1_32, hu1_33⟩ := hu1 + obtain ⟨hu2_22, hu2_23, hu2_32, hu2_33⟩ := hu2 + obtain ⟨hu5_22, hu5_23, hu5_32, hu5_33⟩ := hu5 + obtain ⟨hu6_22, hu6_23, hu6_32, hu6_33⟩ := hu6 + have h3_23 := congrArg M4.m23 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_23 + have h3_32 := congrArg M4.m32 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_32 + have h3_33 := congrArg M4.m33 hW3 + dsimp only [mm, MJ, MEm, MFm, Z4, I4, diag4] at h3_33 + dsimp only [mm, MJ, MEm, MFm] at hu2_23 + dsimp only [mm, MJ, MEm, MFm] at hu2_32 + dsimp only [mm, MJ, MEm, MFm] at hu2_33 + dsimp only [mm, MJ, MEm, MFm] at hu5_22 + dsimp only [mm, MJ, MEm, MFm] at hu5_23 + dsimp only [mm, MJ, MEm, MFm] at hu5_32 + dsimp only [mm, MJ, MEm, MFm] at hu5_33 + dsimp only [mm, MJ, MEm, MFm] at hu6_22 + dsimp only [mm, MJ, MEm, MFm] at hu6_23 + dsimp only [mm, MJ, MEm, MFm] at hu6_32 + dsimp only [mm, MJ, MEm, MFm] at hu6_33 + clear hW3 hW7 + by_contra hne + obtain ⟨t, ht⟩ : ∃ t : K, t * ((LLm (-1) (1) (mm (mm (MJ aC bC cC pC1 pC2 qC1 qC2) (MEm e1 e2 e3)) (MJ aD bD cD pD1 pD2 qD1 qD2))).m34) = 1 := ⟨_, inv_mul_cancel₀ hne⟩ + dsimp only [LLm, mm, MJ, MEm, MFm, diag4] at ht + exact one_ne_zero (show (1:K) = 0 by linear_combination (-(1)) * ht + (1/2*bA*aB*aC*aD^2*qD1*e3^2*t-1/2*aA*bB*aC*aD^2*qD1*e3^2*t+1/2*aA*aB*bC*aD^2*qD1*e3^2*t+1/2*bA*cB*bC*aD^2*qD1*e3^2*t+1/2*cA*bB*aC*aD*bD*qD1*e3^2*t-1/2*bA*cB*aC*aD*bD*qD1*e3^2*t-1/2*cA*aB*bC*aD*bD*qD1*e3^2*t+1/2*aA*cB*bC*aD*bD*qD1*e3^2*t+1/2*bA*aB*cC*aD*bD*qD1*e3^2*t-1/2*aA*bB*cC*aD*bD*qD1*e3^2*t+1/2*cA*aB*aC*bD^2*qD1*e3^2*t-1/2*aA*cB*aC*bD^2*qD1*e3^2*t+1/2*aA*aB*cC*bD^2*qD1*e3^2*t+1/2*cA*bB*cC*bD^2*qD1*e3^2*t+aA*aB*aD*qD1*e2*e3^2*t+bA*cB*aD*qD1*e2*e3^2*t-cA*aB*bD*qD1*e2*e3^2*t+aA*cB*bD*qD1*e2*e3^2*t+1/2*cA*aB*aC*aD^2*qD1*t-1/2*aA*cB*aC*aD^2*qD1*t+1/2*aA*aB*cC*aD^2*qD1*t+1/2*cA*bB*cC*aD^2*qD1*t-1/2*aA*aB*aC*aD*cD*qD1*t-1/2*cA*bB*aC*aD*cD*qD1*t+1/2*cA*aB*bC*aD*cD*qD1*t-1/2*aA*cB*bC*aD*cD*qD1*t+cC^2*aD*qD2*e2^2*t-aC*cC*cD*qD2*e2^2*t-cC^2*bD*qD1*e2*e3*t+bC*cC*cD*qD1*e2*e3*t-bC*cC*aD*qD2*e2*e3*t+aC*cC*bD*qD2*e2*e3*t+1/2*cA*aB*aC*aD*qD1*t-1/2*aA*cB*aC*aD*qD1*t+1/2*aA*aB*cC*aD*qD1*t+1/2*cA*bB*cC*aD*qD1*t-1/2*aA*aB*aC*cD*qD1*t-1/2*cA*bB*aC*cD*qD1*t+1/2*cA*aB*bC*cD*qD1*t-1/2*aA*cB*bC*cD*qD1*t+1/2*aA*aB*aC*aD*qD2*t+1/2*cA*bB*aC*aD*qD2*t-1/2*cA*aB*bC*aD*qD2*t+1/2*aA*cB*bC*aD*qD2*t+1/2*cA*aB*aC*bD*qD2*t-1/2*aA*cB*aC*bD*qD2*t+1/2*aA*aB*cC*bD*qD2*t+1/2*cA*bB*cC*bD*qD2*t+aA*aB*aD*qD1*e3*t+cA*bB*aD*qD1*e3*t+aC*qC2*aD^2*t+aC*qC2*bD*cD*t+2*aC*cC*aD*qD1*t+aC^2*cD*qD1*t-bC*cC*cD*qD1*t+2*bC*cC*aD*qD2*t+2*aC*cC*bD*qD2*t-cA*aB*qD2*e2*t+aA*cB*qD2*e2*t+aA*aB*qD1*e3*t+cA*bB*qD1*e3*t-aC*aD*qD1*e3*t-bC*cD*qD1*e3*t+bC*aD*qD2*e3*t-aC*bD*qD2*e3*t-bD*qD1*e3^2*t-cD*qD1*t) * hE + (1/4*cC^2*bD*cD*qD1*e1*e2*t-1/4*bC*cC*cD^2*qD1*e1*e2*t+1/4*aC*cC*bD*cD*qD2*e1*e2*t-1/4*aC*bC*cD^2*qD2*e1*e2*t-1/4*cC^2*bD^2*qD1*e1*e3*t+1/4*bC*cC*bD*cD*qD1*e1*e3*t-1/4*aC*cC*bD^2*qD2*e1*e3*t+1/4*aC*bC*bD*cD*qD2*e1*e3*t-1/4*aC*cC*bD*cD*qD1*e2*e3*t+1/4*aC*bC*cD^2*qD1*e2*e3*t+bC*cC*bD*cD*qD2*e2*e3*t-bC^2*cD^2*qD2*e2*e3*t+1/4*cC*bD*cD*qD2*e2^2*e3*t-1/4*bC*cD^2*qD2*e2^2*e3*t+1/4*aC*cC*bD^2*qD1*e3^2*t-1/4*aC*bC*bD*cD*qD1*e3^2*t-bC*cC*bD^2*qD2*e3^2*t+bC^2*bD*cD*qD2*e3^2*t-1/4*cC*bD^2*qD2*e2*e3^2*t+1/4*bC*bD*cD*qD2*e2*e3^2*t-bD*qD1*e1^2*e3^2*t+aD*qD1*e1*e2*e3^2*t-1/4*cC*bD*cD*qD2*e2*t+1/4*bC*cD^2*qD2*e2*t+1/4*cC*bD^2*qD2*e3*t-1/4*bC*bD*cD*qD2*e3*t-cD*qD1*e1^2*t+aD*qD1*e1*e3*t-2*cD*qD1*e2*e3*t+aD*qD2*e2*e3*t+bD*qD1*e3^2*t-1/2*qC2*cD*e2*t+1/2*qC2*bD*e3*t+2*qD1*e1*e3*t+qD2*e2*e3*t+aD*qD2*t-qD2*t) * hC0 + (aD*e1*t+1/2*cD*e2*t+1/2*bD*e3*t-t) * hC4 + (cC^2*qD1*e1*e2*t+aC*cC*qD2*e1*e2*t-aC*cC*qD1*e2*e3*t+4*bC*cC*qD2*e2*e3*t+cC*qD2*e2^2*e3*t-cC*qD2*e2*t+aC*qC2*t) * hD0 + (cC^2*e1*e2*t-2*aC^2*e1*e3*t+bC*cC*e1*e3*t-aC*cC*e2*e3*t-aC*bC*e3^2*t+2*aC*cC*t-aC*e3*t) * hD3 + (aC*cC*e1*e2*t+aC*bC*e1*e3*t-aC^2*e2*e3*t+3*bC*cC*e2*e3*t+aC^2*t-bC*cC*t-bC*e3*t-e2*e3*t-t) * hD4 + (-1/2*aD*qD1*e3^2*t) * h3_23 + (1/2*aD*qD1*t+1/2*qD1*t) * h3_32 + (1/2*bD*qD1*e3^2*t+1/2*qD2*t) * h3_33 + (1/2*aA*aB*aD*qD1*e1*e3^2*t+1/2*bA*cB*aD*qD1*e1*e3^2*t-1/2*cA*aB*bD*qD1*e1*e3^2*t+1/2*aA*cB*bD*qD1*e1*e3^2*t+1/2*cA*aB*aD*qD1*e3*t-1/2*aA*cB*aD*qD1*e3*t-1/2*aC^2*qD2*e1*e3*t+1/2*aC^2*qD1*e3^2*t+1/2*aC*qD1*e1*e3^2*t+cC*qD1*e2*e3^2*t-1/2*aC*qD2*e2*e3^2*t+1/4*cC*cD*qD1*e1*t-1/2*cA*aB*qD2*e1*t+1/2*aA*cB*qD2*e1*t+1/4*aC*cD*qD2*e1*t+1/2*cA*aB*qD1*e3*t-1/2*aA*cB*qD1*e3*t-1/4*aC*cD*qD1*e3*t+bC*cD*qD2*e3*t+1/4*cD*qD2*e2*e3*t-qC2*cD*e1*t+qC2*aD*e3*t+qD2*e1*e3*t-qD1*e3^2*t-1/4*cD*qD2*t) * hu2_23 + (1/2*bA*aB*aD*qD1*e2*e3^2*t-1/2*aA*bB*aD*qD1*e2*e3^2*t+1/2*aA*aB*bD*qD1*e2*e3^2*t+1/2*cA*bB*bD*qD1*e2*e3^2*t-1/4*bC*cC^2*bD*qD1*e1*t+1/4*bC^2*cC*cD*qD1*e1*t-1/4*aC*bC*cC*bD*qD2*e1*t+1/4*aC*bC^2*cD*qD2*e1*t+1/4*aC*bC*cC*bD*qD1*e3*t-1/4*aC*bC^2*cD*qD1*e3*t-bC^2*cC*bD*qD2*e3*t+bC^3*cD*qD2*e3*t-1/4*bC*cC*bD*qD2*e2*e3*t+1/4*bC^2*cD*qD2*e2*e3*t+1/2*aA*aB*aD*qD1*e1*t+1/2*cA*bB*aD*qD1*e1*t+cC*qD2*e1*e2^2*t-3/2*aC*bC*qD1*e1*e3*t-bC*qD2*e1*e2*e3*t-cC*qD1*e2^2*e3*t+aC*qD2*e2^2*e3*t+1/4*bC*cC*bD*qD2*t-1/4*bC^2*cD*qD2*t+1/2*aA*aB*qD1*e1*t+1/2*cA*bB*qD1*e1*t+1/4*cC*bD*qD1*e1*t+1/4*aC*bD*qD2*e1*t+1/2*aA*aB*qD2*e2*t+1/2*cA*bB*qD2*e2*t-1/4*aC*bD*qD1*e3*t+bC*bD*qD2*e3*t+1/4*bD*qD2*e2*e3*t-aC^2*qD1*t+aC*bC*qD2*t+aC*qD1*e1*t+cC*qD1*e2*t+aC*qD2*e2*t+2*bC*qD1*e3*t+1/2*aC*qC1*t+1/2*bC*qC2*t-1/4*bD*qD2*t+1/2*qC1*t) * hu2_32 + (-1/2*bA*aB*aD*qD1*e1*e3^2*t+1/2*aA*bB*aD*qD1*e1*e3^2*t-1/2*aA*aB*bD*qD1*e1*e3^2*t-1/2*cA*bB*bD*qD1*e1*e3^2*t+1/2*aA*aB*aD*qD1*e2*e3^2*t+1/2*bA*cB*aD*qD1*e2*e3^2*t-1/2*cA*aB*bD*qD1*e2*e3^2*t+1/2*aA*cB*bD*qD1*e2*e3^2*t+1/4*aC*cC^2*bD*qD1*e1*t-1/4*aC*bC*cC*cD*qD1*e1*t+1/4*aC^2*cC*bD*qD2*e1*t-1/4*aC^2*bC*cD*qD2*e1*t-1/4*aC^2*cC*bD*qD1*e3*t+1/4*aC^2*bC*cD*qD1*e3*t+aC*bC*cC*bD*qD2*e3*t-aC*bC^2*cD*qD2*e3*t+1/4*aC*cC*bD*qD2*e2*e3*t-1/4*aC*bC*cD*qD2*e2*e3*t-1/2*cA*aB*aD*qD1*e1*t+1/2*aA*cB*aD*qD1*e1*t+1/2*aA*aB*aD*qD1*e3*t+1/2*cA*bB*aD*qD1*e3*t-3/2*bC*cC*qD1*e1*e3*t-1/2*aC*bC*qD2*e1*e3*t+cC*qD2*e2^2*e3*t+1/2*aC*bC*qD1*e3^2*t+1/2*bC*qD1*e1*e3^2*t-1/2*bC*qD2*e2*e3^2*t-1/4*aC*cC*bD*qD2*t+1/4*aC*bC*cD*qD2*t-1/2*cA*aB*qD1*e1*t+1/2*aA*cB*qD1*e1*t+1/2*cC*aD*qD1*e1*t-1/2*aA*aB*qD2*e1*t-1/2*cA*bB*qD2*e1*t+1/2*aC*aD*qD2*e1*t-1/2*cA*aB*qD2*e2*t+1/2*aA*cB*qD2*e2*t+1/2*aA*aB*qD1*e3*t+1/2*cA*bB*qD1*e3*t-1/2*aC*aD*qD1*e3*t+2*bC*aD*qD2*e3*t+1/2*aD*qD2*e2*e3*t-aC*cC*qD1*t+bC*cC*qD2*t-qC2*aD*e1*t+cC*qD1*e1*t-qC2*cD*e2*t-2*aC*qD1*e3*t+qD1*e1*e3*t+qD2*e2*e3*t+1/2*cC*qC1*t-1/2*aC*qC2*t-1/2*aD*qD2*t+1/2*qC2*t) * hu2_33 + (-aD*qD1*e1*e2*e3^2*t) * hu5_22 + (-aD*qD1*e2*e3^3*t+1/2*aD*qD1*e3^2*t) * hu5_23 + (bD*qD1*e1*e2*e3^2*t-aD*qD1*e2*e3*t+qD2*e1*e2*t-qD1*e2*e3*t+1/2*aD*qD1*t+1/2*qD1*t) * hu5_32 + (bD*qD1*e2*e3^3*t+aD*qD1*e1*e3*t-1/2*bD*qD1*e3^2*t+qD1*e1*e3*t+qD2*e2*e3*t-1/2*qD2*t) * hu5_33 + (-1/2*aA*aB*aD*qD1*e2*e3^2*t-1/2*bA*cB*aD*qD1*e2*e3^2*t+1/2*cA*aB*bD*qD1*e2*e3^2*t-1/2*aA*cB*bD*qD1*e2*e3^2*t-1/2*aC*cC^2*bD*qD1*e1*t+1/2*aC*bC*cC*cD*qD1*e1*t-1/2*aC^2*cC*bD*qD2*e1*t+1/2*aC^2*bC*cD*qD2*e1*t+1/2*aC^2*cC*bD*qD1*e3*t-1/2*aC^2*bC*cD*qD1*e3*t-2*aC*bC*cC*bD*qD2*e3*t+2*aC*bC^2*cD*qD2*e3*t-1/2*aC*cC*bD*qD2*e2*e3*t+1/2*aC*bC*cD*qD2*e2*e3*t+1/2*cA*aB*aD*qD1*e1*t-1/2*aA*cB*aD*qD1*e1*t+cC*qD1*e1*e2*e3*t-aC*qD2*e1*e2*e3*t+1/2*aC*cC*bD*qD2*t-1/2*aC*bC*cD*qD2*t+1/2*cA*aB*qD1*e1*t-1/2*aA*cB*qD1*e1*t+1/2*cA*aB*qD2*e2*t-1/2*aA*cB*qD2*e2*t+qC2*aD*e1*t-2*cC*qD1*e1*t-2*aC*qD2*e1*t+qC2*cD*e2*t-2*cC*qD2*e2*t+4*aC*qD1*e3*t-qD1*e1*e3*t-qD2*e2*e3*t+aC*qC2*t) * hu6_22 + (1/2*aC^2*qD2*e1*e3*t-1/2*aC^2*qD1*e3^2*t+1/2*aC*qD1*e1*e3^2*t-1/2*aC*qD2*e2*e3^2*t+1/4*cC*cD*qD1*e1*t+1/4*aC*cD*qD2*e1*t-1/4*aC*cD*qD1*e3*t+bC*cD*qD2*e3*t+1/4*cD*qD2*e2*e3*t+cC*qD1*e3*t-1/4*cD*qD2*t) * hu6_23 + (-1/4*bC*cC^2*bD*qD1*e1*t+1/4*bC^2*cC*cD*qD1*e1*t-1/4*aC*bC*cC*bD*qD2*e1*t+1/4*aC*bC^2*cD*qD2*e1*t+1/4*aC*bC*cC*bD*qD1*e3*t-1/4*aC*bC^2*cD*qD1*e3*t-bC^2*cC*bD*qD2*e3*t+bC^3*cD*qD2*e3*t-1/4*bC*cC*bD*qD2*e2*e3*t+1/4*bC^2*cD*qD2*e2*e3*t+3/2*aC*bC*qD1*e1*e3*t+1/4*bC*cC*bD*qD2*t-1/4*bC^2*cD*qD2*t-3/4*cC*bD*qD1*e1*t-3/4*aC*bD*qD2*e1*t+3/4*aC*bD*qD1*e3*t-3*bC*bD*qD2*e3*t-3/4*bD*qD2*e2*e3*t+aC^2*qD1*t-aC*bC*qD2*t-3*bC*qD2*e1*t+2*aC*qD2*e2*t+2*bC*qD1*e3*t-1/2*aC*qC1*t+1/2*bC*qC2*t+3/4*bD*qD2*t+1/2*qC1*t) * hu6_32 + (-1/2*aA*aB*aD*qD1*e2*e3^2*t-1/2*bA*cB*aD*qD1*e2*e3^2*t+1/2*cA*aB*bD*qD1*e2*e3^2*t-1/2*aA*cB*bD*qD1*e2*e3^2*t-1/4*aC*cC^2*bD*qD1*e1*t+1/4*aC*bC*cC*cD*qD1*e1*t-1/4*aC^2*cC*bD*qD2*e1*t+1/4*aC^2*bC*cD*qD2*e1*t+1/4*aC^2*cC*bD*qD1*e3*t-1/4*aC^2*bC*cD*qD1*e3*t-aC*bC*cC*bD*qD2*e3*t+aC*bC^2*cD*qD2*e3*t-1/4*aC*cC*bD*qD2*e2*e3*t+1/4*aC*bC*cD*qD2*e2*e3*t+1/2*cA*aB*aD*qD1*e1*t-1/2*aA*cB*aD*qD1*e1*t+3/2*bC*cC*qD1*e1*e3*t+1/2*aC*bC*qD2*e1*e3*t+cC*qD1*e1*e2*e3*t-aC*qD2*e1*e2*e3*t-1/2*aC*bC*qD1*e3^2*t+1/2*bC*qD1*e1*e3^2*t-1/2*bC*qD2*e2*e3^2*t+1/4*aC*cC*bD*qD2*t-1/4*aC*bC*cD*qD2*t+1/2*cA*aB*qD1*e1*t-1/2*aA*cB*qD1*e1*t+1/2*cC*aD*qD1*e1*t+1/2*aC*aD*qD2*e1*t+1/2*cA*aB*qD2*e2*t-1/2*aA*cB*qD2*e2*t-1/2*aC*aD*qD1*e3*t+2*bC*aD*qD2*e3*t+1/2*aD*qD2*e2*e3*t+aC*cC*qD1*t-bC*cC*qD2*t+qC2*aD*e1*t-2*cC*qD1*e1*t-3*aC*qD2*e1*t+qC2*cD*e2*t-2*cC*qD2*e2*t+2*aC*qD1*e3*t-bC*qD2*e3*t-qD1*e1*e3*t-qD2*e2*e3*t-1/2*cC*qC1*t+1/2*aC*qC2*t-1/2*aD*qD2*t-3/2*qC2*t) * hu6_33) +end Spec0K0 +#print axioms Spec0K0.ll6_33_ABCEDF +#print axioms Spec0K0.ll6_34_ABCEDF diff --git a/research/p104-lean-premises/lean/Nov15/Spec0Sym.lean b/research/p104-lean-premises/lean/Nov15/Spec0Sym.lean new file mode 100644 index 0000000000..806ebc9000 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0Sym.lean @@ -0,0 +1,401 @@ +/- +, piece (A): the order-8 letter symmetry on the 720 job orders of SPECBREAK survivor #0 (RB5/RB6). +Letters A..F = 0..5. Group G = <(AB), (CD), (AC)(BD)> (dihedral, order 8). Orders = permutations of the six letters, +acted on by relabelling letters: g . o = o.map g. + * finite data: `Gl` (8 letter permutations), `reps` (RB5/reps0.txt, 90 orders); + * `Gl` is closed under composition (so it is a group action), `reps` are orders, pairwise in distinct orbits, and + every one of the 720 orders is the image of a rep => EXACTLY 90 orbits (decide +kernel); + * invariance of the kill condition: for every g in Gl there is a model-preserving relabelling rho |-> rho'' (identity on + parameters for the elements fixing the pairs {A,B},{C,D}, conjugation by the (2 3)-swap of the middle 2x2 block for + the elements exchanging them) with Rel_{g.o}(rho) => Rel_o(rho'') and Kill_o(rho'') => Kill_{g.o}(rho). + So `Kill` for the 90 reps gives `Kill` for all 720 orders (theorem `reduction`). +-/ +import Nov15.Spec0K0Core +import Mathlib.Data.List.Perm.Basic +import Mathlib.Data.List.Permutation +import Mathlib.Data.List.FinRange + +namespace Spec0K0 + +/-! ## finite data -/ + +/-- image list of a letter permutation, as a function -/ +def fn (l : List (Fin 6)) : Fin 6 → Fin 6 := fun c => l.getD c.val 0 + +def Gl : List (List (Fin 6)) := [ + [0,1,2,3,4,5], + [2,3,0,1,4,5], + [0,1,3,2,4,5], + [3,2,0,1,4,5], + [1,0,2,3,4,5], + [2,3,1,0,4,5], + [1,0,3,2,4,5], + [3,2,1,0,4,5]] + +def reps : List (List (Fin 6)) := [ + [0,1,2,3,4,5], + [0,1,2,3,5,4], + [0,1,2,4,3,5], + [0,1,2,4,5,3], + [0,1,2,5,3,4], + [0,1,2,5,4,3], + [0,1,4,2,3,5], + [0,1,4,2,5,3], + [0,1,4,5,2,3], + [0,1,5,2,3,4], + [0,1,5,2,4,3], + [0,1,5,4,2,3], + [0,2,1,3,4,5], + [0,2,1,3,5,4], + [0,2,1,4,3,5], + [0,2,1,4,5,3], + [0,2,1,5,3,4], + [0,2,1,5,4,3], + [0,2,3,1,4,5], + [0,2,3,1,5,4], + [0,2,3,4,1,5], + [0,2,3,4,5,1], + [0,2,3,5,1,4], + [0,2,3,5,4,1], + [0,2,4,1,3,5], + [0,2,4,1,5,3], + [0,2,4,3,1,5], + [0,2,4,3,5,1], + [0,2,4,5,1,3], + [0,2,4,5,3,1], + [0,2,5,1,3,4], + [0,2,5,1,4,3], + [0,2,5,3,1,4], + [0,2,5,3,4,1], + [0,2,5,4,1,3], + [0,2,5,4,3,1], + [0,4,1,2,3,5], + [0,4,1,2,5,3], + [0,4,1,5,2,3], + [0,4,2,1,3,5], + [0,4,2,1,5,3], + [0,4,2,3,1,5], + [0,4,2,3,5,1], + [0,4,2,5,1,3], + [0,4,2,5,3,1], + [0,4,5,1,2,3], + [0,4,5,2,1,3], + [0,4,5,2,3,1], + [0,5,1,2,3,4], + [0,5,1,2,4,3], + [0,5,1,4,2,3], + [0,5,2,1,3,4], + [0,5,2,1,4,3], + [0,5,2,3,1,4], + [0,5,2,3,4,1], + [0,5,2,4,1,3], + [0,5,2,4,3,1], + [0,5,4,1,2,3], + [0,5,4,2,1,3], + [0,5,4,2,3,1], + [4,0,1,2,3,5], + [4,0,1,2,5,3], + [4,0,1,5,2,3], + [4,0,2,1,3,5], + [4,0,2,1,5,3], + [4,0,2,3,1,5], + [4,0,2,3,5,1], + [4,0,2,5,1,3], + [4,0,2,5,3,1], + [4,0,5,1,2,3], + [4,0,5,2,1,3], + [4,0,5,2,3,1], + [4,5,0,1,2,3], + [4,5,0,2,1,3], + [4,5,0,2,3,1], + [5,0,1,2,3,4], + [5,0,1,2,4,3], + [5,0,1,4,2,3], + [5,0,2,1,3,4], + [5,0,2,1,4,3], + [5,0,2,3,1,4], + [5,0,2,3,4,1], + [5,0,2,4,1,3], + [5,0,2,4,3,1], + [5,0,4,1,2,3], + [5,0,4,2,1,3], + [5,0,4,2,3,1], + [5,4,0,1,2,3], + [5,4,0,2,1,3], + [5,4,0,2,3,1]] + +def idl : List (Fin 6) := List.finRange 6 + +theorem Gl_length : Gl.length = 8 := by decide +kernel +theorem Gl_id : idl ∈ Gl := by decide +kernel +theorem Gl_perm : ∀ g ∈ Gl, g.Perm idl := by decide +kernel +theorem Gl_closed : ∀ g ∈ Gl, ∀ h ∈ Gl, idl.map (fun c => fn g (fn h c)) ∈ Gl := by decide +kernel + +theorem reps_length : reps.length = 90 := by decide +kernel +theorem reps_perm : ∀ r ∈ reps, r.Perm idl := by decide +kernel +theorem reps_nodup : reps.Nodup := by decide +kernel +theorem perms_length : idl.permutations'.length = 720 := by decide +kernel + +/-- canonical form of an order: the orbit element with least base-6 code -/ +def enc (l : List (Fin 6)) : ℕ := l.foldl (fun a x => 6*a + x.val) 0 +def canon (p : List (Fin 6)) : List (Fin 6) := + (Gl.map (fun g => p.map (fn g))).foldl (fun m q => if enc q < enc m then q else m) p + +theorem coverC : (idl.permutations'.all fun p => reps.contains (canon p)) = true := by decide +kernel +theorem distC : (reps.all fun r => Gl.all fun g => !(reps.contains (r.map (fn g))) || (r.map (fn g) == r)) = true := by + decide +kernel +theorem Gl_inv : ∀ g ∈ Gl, ∃ h ∈ Gl, ∀ c, fn h (fn g c) = c := by decide +kernel + +theorem foldl_sel {α : Type*} (f : α → α → α) (hf : ∀ m q, f m q = m ∨ f m q = q) : + ∀ (l : List α) (m : α), l.foldl f m = m ∨ l.foldl f m ∈ l := by + intro l + induction l with + | nil => intro m; left; rfl + | cons q qs ih => + intro m + simp only [List.foldl_cons, List.mem_cons] + rcases ih (f m q) with h | h + · rcases hf m q with h' | h' + · left; rw [h, h'] + · right; left; rw [h, h'] + · right; right; exact h + +theorem canon_mem (p : List (Fin 6)) : ∃ g ∈ Gl, p.map (fn g) = canon p := by + unfold canon + rcases foldl_sel (fun m q => if enc q < enc m then q else m) + (fun m q => by by_cases h : enc q < enc m <;> simp [h]) (Gl.map (fun g => p.map (fn g))) p with h | h + · refine ⟨idl, Gl_id, ?_⟩ + rw [h] + have hid : fn idl = id := funext (by decide) + rw [hid, List.map_id] + · obtain ⟨g, hg, hgq⟩ := List.mem_map.mp h + exact ⟨g, hg, hgq⟩ + +/-- every order is the image of a representative -/ +theorem cover : ∀ p ∈ idl.permutations', ∃ r ∈ reps, ∃ g ∈ Gl, r.map (fn g) = p := by + intro p hp + have h1 := List.all_eq_true.mp coverC p hp + have hr : canon p ∈ reps := List.contains_iff_mem.mp h1 + obtain ⟨g, hg, hgp⟩ := canon_mem p + obtain ⟨h, hh, hinv⟩ := Gl_inv g hg + refine ⟨canon p, hr, h, hh, ?_⟩ + rw [← hgp, List.map_map] + have : (fn h ∘ fn g) = id := funext hinv + rw [this, List.map_id] + +/-- representatives lie in pairwise distinct orbits: hence exactly 90 orbits -/ +theorem distinct : ∀ r ∈ reps, ∀ s ∈ reps, (∃ g ∈ Gl, r.map (fn g) = s) → r = s := by + intro r hr s hs ⟨g, hg, h⟩ + have h1 := List.all_eq_true.mp distC r hr + have h2 := List.all_eq_true.mp h1 g hg + rw [h] at h2 + have : reps.contains s = true := List.contains_iff_mem.mpr hs + rw [this] at h2 + exact (by simpa [h] using h2 : s = r).symm + +/-! ## the kill condition is invariant -/ + +section +variable {K : Type*} [Field K] + +/-- conjugation by the swap of coordinates 2 and 3 -/ +def conj (U : M4 K) : M4 K := + ⟨U.m11,U.m13,U.m12,U.m14, U.m31,U.m33,U.m32,U.m34, U.m21,U.m23,U.m22,U.m24, U.m41,U.m43,U.m42,U.m44⟩ + +theorem conj_mm (A B : M4 K) : conj (mm A B) = mm (conj A) (conj B) := by + ext <;> simp only [conj, mm] <;> ring +theorem conj_conj (A : M4 K) : conj (conj A) = A := by cases A; rfl +theorem conj_I4 : conj (I4 : M4 K) = I4 := by simp only [conj, I4, diag4] +theorem conj_Z4 : conj (Z4 : M4 K) = Z4 := by simp only [conj, Z4, diag4] +theorem conj_zero4 : conj (zero4 : M4 K) = zero4 := by simp only [conj, zero4, diag4] +theorem conj_inj {A B : M4 K} (h : conj A = conj B) : A = B := by + have := congrArg conj h; rwa [conj_conj, conj_conj] at this + +theorem conj_unit (d1 d2 : K) (U : M4 K) : UnitRel d1 d2 (conj U) ↔ UnitRel d2 d1 U := by + simp only [UnitRel, conj] + constructor + · rintro ⟨a, b, c, d⟩; exact ⟨d, c, b, a⟩ + · rintro ⟨a, b, c, d⟩; exact ⟨d, c, b, a⟩ + +theorem conj_omega (d1 d2 : K) (U : M4 K) : omega d1 d2 (conj U) = omega d2 d1 U := by + simp only [omega, conj]; ring + +theorem conj_LLm (d1 d2 : K) (U : M4 K) : LLm d1 d2 (conj U) = conj (LLm d2 d1 U) := by + ext <;> simp only [LLm, conj, mm, diag4] <;> ring + +theorem conj_KU (d1 d2 : K) (U : M4 K) : KU d1 d2 (conj U) ↔ KU d2 d1 U := by + unfold KU + rw [conj_omega, conj_LLm] + constructor + · rintro ⟨a, b⟩; refine ⟨a, conj_inj ?_⟩; rw [b, conj_zero4] + · rintro ⟨a, b⟩; refine ⟨a, ?_⟩; rw [b, conj_zero4] + +/-- word product of the letters of `o` lying in `S`, in order (right-nested) -/ +def wp : List (Fin 6) → (Fin 6 → Bool) → (Fin 6 → M4 K) → M4 K + | [], _, _ => I4 + | c :: cs, S, ρ => if S c then mm (ρ c) (wp cs S ρ) else wp cs S ρ + +theorem wp_map (ε : M4 K → M4 K) (hmul : ∀ A B, ε (mm A B) = mm (ε A) (ε B)) (hI : ε I4 = I4) + (g : Fin 6 → Fin 6) (ρ ρ'' : Fin 6 → M4 K) (hρ : ∀ c, ρ (g c) = ε (ρ'' c)) (S : Fin 6 → Bool) : + ∀ o : List (Fin 6), wp (o.map g) S ρ = ε (wp o (fun c => S (g c)) ρ'') := by + intro o + induction o with + | nil => simp only [List.map_nil, wp, hI] + | cons c cs ih => + simp only [List.map_cons, wp] + by_cases h : S (g c) + · simp only [h, if_true, hmul, hρ, ih] + · simp only [h, Bool.false_eq_true, if_false, ih] + +def sABCD : Fin 6 → Bool := fun c => decide (c.val < 4) +def sALL : Fin 6 → Bool := fun _ => true +def sABF : Fin 6 → Bool := fun c => decide (c.val = 0 ∨ c.val = 1 ∨ c.val = 5) +def sCDF : Fin 6 → Bool := fun c => decide (c.val = 2 ∨ c.val = 3 ∨ c.val = 5) +def sABE : Fin 6 → Bool := fun c => decide (c.val = 0 ∨ c.val = 1 ∨ c.val = 4) +def sCDE : Fin 6 → Bool := fun c => decide (c.val = 2 ∨ c.val = 3 ∨ c.val = 4) + +/-- the relations / the kill statement for the order `o` and the letter matrices `ρ` -/ +def Rel' (o : List (Fin 6)) (ρ : Fin 6 → M4 K) : Prop := + Rel (wp o sABCD ρ) (wp o sALL ρ) (wp o sABF ρ) (wp o sCDF ρ) (wp o sABE ρ) (wp o sCDE ρ) +def Kill' (o : List (Fin 6)) (ρ : Fin 6 → M4 K) : Prop := + Kill (wp o sABF ρ) (wp o sCDF ρ) (wp o sABE ρ) (wp o sCDE ρ) + +/-- the model: letters A..D are job matrices, E, F the flag matrices -/ +def ModelOK (ρ : Fin 6 → M4 K) : Prop := + (∀ c : Fin 6, c.val < 4 → ∃ a b c' p1 p2 q1 q2 : K, JobOK a b c' p1 p2 q1 q2 ∧ ρ c = MJ a b c' p1 p2 q1 q2) ∧ + (∃ e1 e2 e3 : K, EpsOK e1 e2 e3 ∧ ρ 4 = MEm e1 e2 e3 ∧ ρ 5 = MFm e1 e2 e3) + +theorem conj_MJ (a b c p1 p2 q1 q2 : K) : + conj (MJ a b c p1 p2 q1 q2) = MJ (-a) c b p2 p1 q2 q1 := by + ext <;> simp only [conj, MJ] <;> ring +theorem conj_MEm (e1 e2 e3 : K) : conj (MEm e1 e2 e3) = MEm (-e1) e3 e2 := by + ext <;> simp only [conj, MEm] <;> ring +theorem conj_MFm (e1 e2 e3 : K) : conj (MFm e1 e2 e3) = MFm (-e1) e3 e2 := by + ext <;> simp only [conj, MFm] <;> ring + +theorem jobOK_conj {a b c p1 p2 q1 q2 : K} (h : JobOK a b c p1 p2 q1 q2) : + JobOK (-a) c b p2 p1 q2 q1 := by + obtain ⟨h0, h1, h2, h3, h4⟩ := h + refine ⟨by linear_combination h0, by linear_combination h1 * 0 + h2, by linear_combination h1, ?_, ?_⟩ + · linear_combination h4 + · linear_combination h3 + +theorem epsOK_conj {e1 e2 e3 : K} (h : EpsOK e1 e2 e3) : EpsOK (-e1) e3 e2 := by + unfold EpsOK at *; linear_combination h + +def SideF (g : Fin 6 → Fin 6) : Prop := + g 4 = 4 ∧ g 5 = 5 ∧ ∀ c, sABCD (g c) = sABCD c ∧ sABF (g c) = sABF c ∧ sCDF (g c) = sCDF c ∧ + sABE (g c) = sABE c ∧ sCDE (g c) = sCDE c +def SideT (g : Fin 6 → Fin 6) : Prop := + g 4 = 4 ∧ g 5 = 5 ∧ ∀ c, sABCD (g c) = sABCD c ∧ sABF (g c) = sCDF c ∧ sCDF (g c) = sABF c ∧ + sABE (g c) = sCDE c ∧ sCDE (g c) = sABE c + +instance (g : Fin 6 → Fin 6) : Decidable (SideF g) := by unfold SideF; infer_instance +instance (g : Fin 6 → Fin 6) : Decidable (SideT g) := by unfold SideT; infer_instance + +theorem Gl_side : ∀ g ∈ Gl, SideF (fn g) ∨ SideT (fn g) := by decide +kernel + +/-- generic relabelling: `ρ'' c = ε (ρ (g c))` stays in the model, and word products transform by `ε` -/ +theorem step_gen (ε : M4 K → M4 K) (hmul : ∀ A B, ε (mm A B) = mm (ε A) (ε B)) (hI : ε I4 = I4) + (hinv : ∀ A, ε (ε A) = A) + (hεJ : ∀ a b c p1 p2 q1 q2 : K, JobOK a b c p1 p2 q1 q2 → + ∃ a' b' c' p1' p2' q1' q2' : K, JobOK a' b' c' p1' p2' q1' q2' ∧ ε (MJ a b c p1 p2 q1 q2) = MJ a' b' c' p1' p2' q1' q2') + (hεE : ∀ e1 e2 e3 : K, EpsOK e1 e2 e3 → + ∃ e1' e2' e3' : K, EpsOK e1' e2' e3' ∧ ε (MEm e1 e2 e3) = MEm e1' e2' e3' ∧ ε (MFm e1 e2 e3) = MFm e1' e2' e3') + (g : Fin 6 → Fin 6) (h4 : g 4 = 4) (h5 : g 5 = 5) (hjob : ∀ c : Fin 6, c.val < 4 → (g c).val < 4) + (ρ : Fin 6 → M4 K) (hρ : ModelOK ρ) : + ∃ ρ'' : Fin 6 → M4 K, ModelOK ρ'' ∧ + ∀ (S : Fin 6 → Bool) (r : List (Fin 6)), wp (r.map g) S ρ = ε (wp r (fun c => S (g c)) ρ'') := by + obtain ⟨hj, e1, e2, e3, he, h4', h5'⟩ := hρ + refine ⟨fun c => ε (ρ (g c)), ⟨?_, ?_⟩, ?_⟩ + · intro c hc + obtain ⟨a, b, c', p1, p2, q1, q2, hok, hρc⟩ := hj (g c) (hjob c hc) + obtain ⟨a', b', c'', p1', p2', q1', q2', hok', hε⟩ := hεJ a b c' p1 p2 q1 q2 hok + exact ⟨a', b', c'', p1', p2', q1', q2', hok', by simp only [hρc, hε]⟩ + · obtain ⟨e1', e2', e3', hok', hε4, hε5⟩ := hεE e1 e2 e3 he + exact ⟨e1', e2', e3', hok', by simp only [h4, h4', hε4], by simp only [h5, h5', hε5]⟩ + · intro S r + exact wp_map ε hmul hI g ρ _ (fun c => (hinv _).symm) S r + +theorem step_F (g : Fin 6 → Fin 6) (hg : SideF g) (ρ : Fin 6 → M4 K) (hρ : ModelOK ρ) (r : List (Fin 6)) : + ∃ ρ'' : Fin 6 → M4 K, ModelOK ρ'' ∧ (Rel' (r.map g) ρ → Rel' r ρ'') ∧ (Kill' r ρ'' → Kill' (r.map g) ρ) := by + obtain ⟨h4, h5, hs⟩ := hg + have hS : ∀ S : Fin 6 → Bool, (∀ c, S (g c) = S c) → (fun c => S (g c)) = S := fun S h => funext h + have hjob : ∀ c : Fin 6, c.val < 4 → (g c).val < 4 := by + intro c hc + have := (hs c).1 + simp only [sABCD, decide_eq_decide] at this + exact this.mpr hc + obtain ⟨ρ'', hm, hw⟩ := step_gen id (fun _ _ => rfl) rfl (fun _ => rfl) + (fun a b c p1 p2 q1 q2 h => ⟨a, b, c, p1, p2, q1, q2, h, rfl⟩) + (fun e1 e2 e3 h => ⟨e1, e2, e3, h, rfl, rfl⟩) g h4 h5 hjob ρ hρ + have w := fun S => hw S r + simp only [id] at w + refine ⟨ρ'', hm, ?_, ?_⟩ + · unfold Rel' + rw [w sABCD, w sALL, w sABF, w sCDF, w sABE, w sCDE, hS sABCD (fun c => (hs c).1), hS sALL (fun _ => rfl), + hS sABF (fun c => (hs c).2.1), hS sCDF (fun c => (hs c).2.2.1), hS sABE (fun c => (hs c).2.2.2.1), + hS sCDE (fun c => (hs c).2.2.2.2)] + exact id + · unfold Kill' + rw [w sABF, w sCDF, w sABE, w sCDE, hS sABF (fun c => (hs c).2.1), hS sCDF (fun c => (hs c).2.2.1), + hS sABE (fun c => (hs c).2.2.2.1), hS sCDE (fun c => (hs c).2.2.2.2)] + exact id + +theorem step_T (g : Fin 6 → Fin 6) (hg : SideT g) (ρ : Fin 6 → M4 K) (hρ : ModelOK ρ) (r : List (Fin 6)) : + ∃ ρ'' : Fin 6 → M4 K, ModelOK ρ'' ∧ (Rel' (r.map g) ρ → Rel' r ρ'') ∧ (Kill' r ρ'' → Kill' (r.map g) ρ) := by + obtain ⟨h4, h5, hs⟩ := hg + have hS : ∀ S S' : Fin 6 → Bool, (∀ c, S (g c) = S' c) → (fun c => S (g c)) = S' := fun S S' h => funext h + have hjob : ∀ c : Fin 6, c.val < 4 → (g c).val < 4 := by + intro c hc + have := (hs c).1 + simp only [sABCD, decide_eq_decide] at this + exact this.mpr hc + obtain ⟨ρ'', hm, hw⟩ := step_gen conj conj_mm conj_I4 conj_conj + (fun a b c p1 p2 q1 q2 h => ⟨-a, c, b, p2, p1, q2, q1, jobOK_conj h, conj_MJ _ _ _ _ _ _ _⟩) + (fun e1 e2 e3 h => ⟨-e1, e3, e2, epsOK_conj h, conj_MEm _ _ _, conj_MFm _ _ _⟩) g h4 h5 hjob ρ hρ + have w := fun S => hw S r + have a1 := hS sABCD sABCD (fun c => (hs c).1) + have a2 := hS sALL sALL (fun _ => rfl) + have a3 := hS sABF sCDF (fun c => (hs c).2.1) + have a4 := hS sCDF sABF (fun c => (hs c).2.2.1) + have a5 := hS sABE sCDE (fun c => (hs c).2.2.2.1) + have a6 := hS sCDE sABE (fun c => (hs c).2.2.2.2) + refine ⟨ρ'', hm, ?_, ?_⟩ + · unfold Rel' Rel + rw [w sABCD, w sALL, w sABF, w sCDF, w sABE, w sCDE, a1, a2, a3, a4, a5, a6] + rintro ⟨h3, h7, k1, k2, k5, k6⟩ + refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ + · apply conj_inj; rw [h3, conj_Z4] + · apply conj_inj; rw [h7, conj_I4] + · exact (conj_unit _ _ _).mp k2 + · exact (conj_unit _ _ _).mp k1 + · exact (conj_unit _ _ _).mp k6 + · exact (conj_unit _ _ _).mp k5 + · unfold Kill' Kill + rw [w sABF, w sCDF, w sABE, w sCDE, a3, a4, a5, a6] + rintro ⟨k1, k2, k5, k6⟩ + exact ⟨(conj_KU _ _ _).mpr k2, (conj_KU _ _ _).mpr k1, (conj_KU _ _ _).mpr k6, (conj_KU _ _ _).mpr k5⟩ + +/-- Reduction: Kill on the 90 representatives gives Kill on all 720 orders. -/ +theorem reduction + (hreps : ∀ r ∈ reps, ∀ ρ : Fin 6 → M4 K, ModelOK ρ → Rel' r ρ → Kill' r ρ) : + ∀ o : List (Fin 6), o.Perm idl → ∀ ρ : Fin 6 → M4 K, ModelOK ρ → Rel' o ρ → Kill' o ρ := by + intro o ho ρ hρ hrel + obtain ⟨r, hr, g, hg, rfl⟩ := cover o (List.mem_permutations'.mpr ho) + have hside := Gl_side g hg + have key : ∃ ρ'' : Fin 6 → M4 K, ModelOK ρ'' ∧ (Rel' (r.map (fn g)) ρ → Rel' r ρ'') ∧ (Kill' r ρ'' → Kill' (r.map (fn g)) ρ) := by + rcases hside with h | h + · exact step_F (fn g) h ρ hρ r + · exact step_T (fn g) h ρ hρ r + obtain ⟨ρ'', hm, h1, h2⟩ := key + exact h2 (hreps r hr ρ'' hm (h1 hrel)) +end + +end Spec0K0 + +#print axioms Spec0K0.reduction +#print axioms Spec0K0.cover +#print axioms Spec0K0.distinct +#print axioms Spec0K0.Gl_closed +#print axioms Spec0K0.step_T diff --git a/research/p104-lean-premises/lean/Nov15/Spec0Sym.md b/research/p104-lean-premises/lean/Nov15/Spec0Sym.md new file mode 100644 index 0000000000..3eada8ff27 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec0Sym.md @@ -0,0 +1,8 @@ +# Spec0Sym.lean: spec-break survivor #0, the 720-order symmetry reduction +Kernel-only (`decide +kernel`, `ring`, `linear_combination`), 0 sorry, 23 s / 3.2 GB (`Nov15/Spec0K0Core.lean` must be built first). Axioms [propext, Classical.choice, Quot.sound] (reduction, cover, distinct, Gl_closed, step_T checked). +- Data: `Gl` = the 8 letter permutations <(AB),(CD),(AC)(BD)>, `reps` = RB5/reps0.txt (90 orders), orders = permutations of the six letters, g.o = o.map g. +- `Gl_closed`, `Gl_inv`, `Gl_id`: Gl is closed under composition and inverses (a group of order 8 acting on orders). +- `cover` (via `coverC`, canonical form = least base-6 code in the orbit, 720 orders over `List.permutations'`): every order is the image of a rep. `distinct` (via `distC`): no two reps are in one orbit, `reps_nodup`, `reps_length = 90`. Hence exactly 90 orbits. +- Invariance of the kill condition (model level): `Rel'`/`Kill'` use word products of letter matrices rho : Fin 6 -> M4 (A..D jobs, E/F flags). For every g in Gl: `step_F` (g fixes the pairs {A,B},{C,D}: rho'' = rho o g) or `step_T` (g exchanges them: rho'' = conj(rho o g), conj = conjugation by the (2 3)-swap of the middle 2x2 block, which keeps jobs/flags in the model: conj_MJ, jobOK_conj, epsOK_conj; swaps units 1<->2, 5<->6 and their diagonal signs, conj_unit/conj_omega/conj_LLm/conj_KU). Both give: rho model, Rel'_{g.r}(rho) => Rel'_r(rho'') and Kill'_r(rho'') => Kill'_{g.r}(rho). +- `reduction`: if Kill holds for the 90 reps over all model points satisfying Rel, it holds for all 720 orders. +Named gaps: (i) `wp` is right-nested from I4; the per-class files (Spec0K0__*.lean) state words left-nested and explicit, so the bridge wp = explicit word (mm_assoc, mm_one) is not formalised; (ii) the model itself (4x4 flag reflections, units' Levi blocks Dbar_mu, jobs satisfying j^2=1, p(I+j)=0, (I+j)q=0) is RB6's reduction, taken as the definition of `ModelOK`/`Rel`; (iii) `Kill`'s ω and (DU)^2=I are the k=0 statements only. diff --git a/research/p104-lean-premises/lean/Nov15/Spec6.lean b/research/p104-lean-premises/lean/Nov15/Spec6.lean new file mode 100644 index 0000000000..fa2c656a76 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec6.lean @@ -0,0 +1,726 @@ +/- +SPECBREAK R63 survivor #6 kill . See Spec6.md. +Kernel-only. Setting: V a vector space over a field K with 2 ≠ 0, vectors e, functional φ with φ e = 1, +R = 1 - 2 e⊗φ, jobs g = 1 - x⊗y with y x = 2. n-free (V arbitrary), order-free, char ≠ 2. +-/ +import Mathlib.LinearAlgebra.Dual.Lemmas +import Mathlib.Tactic.Module +import Mathlib.Tactic.Abel +import Mathlib.Tactic.LinearCombination +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Ring +import Mathlib.Tactic.Tauto + +open Module + +set_option linter.unusedSectionVars false +set_option linter.unusedVariables false + +namespace Spec6 + +/-! ## §0 jobs, R, types -/ +section Basic +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] + +structure Job (K V : Type*) [Field K] [AddCommGroup V] [Module K V] where + x : V + y : Dual K V + hxy : y x = 2 + +def Job.g (j : Job K V) : Module.End K V := 1 - LinearMap.smulRight j.y j.x + +theorem Job.g_apply (j : Job K V) (v : V) : j.g v = v - j.y v • j.x := by + simp [Job.g, LinearMap.smulRight_apply] + +theorem Job.g_sq (j : Job K V) : j.g * j.g = 1 := by + ext v + simp only [Module.End.mul_apply, Job.g_apply, map_sub, map_smul, j.hxy, smul_eq_mul, Module.End.one_apply] + module + +/-- R = 1 - 2 e⊗φ -/ +def Rm (e : V) (φ : Dual K V) : Module.End K V := 1 - (2 : K) • LinearMap.smulRight φ e + +theorem Rm_apply (e : V) (φ : Dual K V) (v : V) : Rm e φ v = v - (2 * φ v) • e := by + simp [Rm, LinearMap.smulRight_apply, mul_smul] + +theorem Rm_sq (e : V) (φ : Dual K V) (he : φ e = 1) : Rm e φ * Rm e φ = 1 := by + ext v + simp only [Module.End.mul_apply, Rm_apply, map_sub, map_smul, he, smul_eq_mul, Module.End.one_apply] + module + +def xT (e : V) (j : Job K V) : Prop := j.x ∈ Submodule.span K {e} +def yT (φ : Dual K V) (j : Job K V) : Prop := j.y ∈ Submodule.span K {φ} + +end Basic + +/-! ## §1 linear-algebra keys -/ +section Keys +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] + +theorem exists_ker (χ ψ : Dual K V) (hχ : ∃ v0, χ v0 ≠ 0) (h : ∀ v, χ v = 0 → ψ v = 0) : + ∃ c : K, ψ = c • χ := by + obtain ⟨v0, hv0⟩ := hχ + refine ⟨ψ v0 / χ v0, ?_⟩ + ext v + have h1 : χ (v - (χ v / χ v0) • v0) = 0 := by + simp only [map_sub, map_smul, smul_eq_mul] + field_simp + ring + have h3 := h _ h1 + simp only [map_sub, map_smul, smul_eq_mul] at h3 + simp only [LinearMap.smul_apply, smul_eq_mul] + have : ψ v = χ v / χ v0 * ψ v0 := by linear_combination h3 + rw [this]; field_simp + +theorem coef_zero {e x : V} (hx : x ∉ Submodule.span K {e}) {a b : K} + (h : a • e + b • x = 0) : b = 0 ∧ a • e = 0 := by + by_cases hb : b = 0 + · subst hb + rw [zero_smul, add_zero] at h + exact ⟨rfl, h⟩ + · exfalso + apply hx + rw [Submodule.mem_span_singleton] + refine ⟨-(a / b), ?_⟩ + have h' : b • x = -(a • e) := eq_neg_of_add_eq_zero_right h + have : x = b⁻¹ • (b • x) := by rw [smul_smul, inv_mul_cancel₀ hb, one_smul] + rw [this, h'] + module + +theorem e_ne {e : V} {φ : Dual K V} (he : φ e = 1) : e ≠ 0 := by + rintro rfl; simp at he + +theorem vanish_contra {e : V} {φ : Dual K V} (he : φ e = 1) (h2 : (2 : K) ≠ 0) (j : Job K V) + (hx : ¬ xT e j) (hy : ¬ yT φ j) (ψ : Dual K V) (hψ : ∃ v, ψ v ≠ 0) + (hv : ∀ v, ψ v = 0 → (j.g * Rm e φ) v = v) : False := by + have hφ : ∀ v, ψ v = 0 → φ v = 0 ∧ j.y v = 0 := by + intro v hv0 + have h0 := hv v hv0 + simp only [Module.End.mul_apply, Rm_apply, Job.g_apply, map_sub, map_smul, smul_eq_mul] at h0 + have h3 : (-(2 * φ v)) • e + (-(j.y v - 2 * φ v * j.y e)) • j.x = 0 := by + calc _ = (v - j.y v • j.x - (2 * φ v) • (e - j.y e • j.x)) - v := by module + _ = 0 := by rw [h0, sub_self] + obtain ⟨hb, ha⟩ := coef_zero hx h3 + have hφv : φ v = 0 := by + rcases smul_eq_zero.mp ha with h | h + · have : 2 * φ v = 0 := by linear_combination -h + rcases mul_eq_zero.mp this with h | h + · exact absurd h h2 + · exact h + · exact absurd h (e_ne he) + refine ⟨hφv, ?_⟩ + rw [hφv] at hb + linear_combination -hb + obtain ⟨c, hc⟩ := exists_ker ψ φ hψ (fun v hv0 => (hφ v hv0).1) + obtain ⟨c', hc'⟩ := exists_ker ψ j.y hψ (fun v hv0 => (hφ v hv0).2) + have hc0 : c ≠ 0 := by + rintro rfl + have := congrArg (fun f => f e) hc + simp [he] at this + apply hy + show j.y ∈ Submodule.span K {φ} + rw [Submodule.mem_span_singleton] + refine ⟨c' / c, ?_⟩ + rw [hc', hc] + ext v + simp only [LinearMap.smul_apply, smul_eq_mul] + field_simp + +end Keys + +/-! ## §2 one vertex: L1, L3, L2 (x-plane), L4 (mixed ends) -/ +section Vertex +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] +variable {e : V} {φ : Dual K V} + +/-- the group G_X (as a predicate): Im(g - 1) ⊆ ⟨e⟩ -/ +def GX (e : V) (g : Module.End K V) : Prop := ∃ w : Dual K V, ∀ v, g v = v + w v • e + +theorem GX_mul {g h : Module.End K V} (hg : GX e g) (hh : GX e h) : GX e (g * h) := by + obtain ⟨wg, hwg⟩ := hg + obtain ⟨wh, hwh⟩ := hh + refine ⟨wg + wh + (wg e) • wh, fun v => ?_⟩ + rw [Module.End.mul_apply, hwg, hwh] + simp only [map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply, smul_eq_mul] + module + +theorem GX_R : GX e (Rm e φ) := + ⟨-(2 : K) • φ, fun v => by rw [Rm_apply]; simp only [LinearMap.smul_apply, smul_eq_mul]; module⟩ + +theorem GX_job {j : Job K V} (hj : xT e j) : GX e j.g := by + obtain ⟨c, hc⟩ := Submodule.mem_span_singleton.mp hj + refine ⟨-c • j.y, fun v => ?_⟩ + rw [Job.g_apply, ← hc] + simp only [LinearMap.smul_apply, smul_eq_mul] + module + +theorem job_of_GX (h2 : (2 : K) ≠ 0) {j : Job K V} (hj : GX e j.g) : xT e j := by + obtain ⟨w, hw⟩ := hj + have h1 := hw j.x + rw [Job.g_apply, j.hxy] at h1 + have h3 : (2 : K) • j.x = (-(w j.x)) • e := by + have : j.x - (2 : K) • j.x = j.x + w j.x • e := h1 + have h4 : (2 : K) • j.x = -(w j.x • e) := by + have : (2 : K) • j.x = j.x - (j.x + w j.x • e) := by rw [← this]; module + rw [this]; module + rw [h4]; module + show j.x ∈ Submodule.span K {e} + rw [Submodule.mem_span_singleton] + refine ⟨-(w j.x) / 2, ?_⟩ + calc (-(w j.x) / 2) • e = (2 : K)⁻¹ • ((-(w j.x)) • e) := by + rw [smul_smul]; congr 1; field_simp + _ = (2 : K)⁻¹ • ((2 : K) • j.x) := by rw [h3] + _ = j.x := by rw [smul_smul, inv_mul_cancel₀ h2, one_smul] + +/-- the vertex relation: ordered word of three jobs is R -/ +def Rel (e : V) (φ : Dual K V) (a b c : Job K V) : Prop := a.g * b.g * c.g = Rm e φ + +theorem rel_third {a b c : Job K V} (h : Rel e φ a b c) : c.g = b.g * a.g * Rm e φ := by + have : b.g * a.g * (a.g * b.g * c.g) = c.g := by + calc _ = b.g * (a.g * a.g) * (b.g * c.g) := by simp only [mul_assoc] + _ = c.g := by rw [a.g_sq, mul_one, ← mul_assoc, b.g_sq, one_mul] + rw [← this]; unfold Rel at h; rw [h] + +theorem rel_first {a b c : Job K V} (h : Rel e φ a b c) : a.g = Rm e φ * c.g * b.g := by + have : a.g * b.g * c.g * c.g * b.g = a.g := by + calc _ = a.g * b.g * (c.g * c.g) * b.g := by simp only [mul_assoc] + _ = a.g := by rw [c.g_sq, mul_one, mul_assoc, b.g_sq, mul_one] + unfold Rel at h + rw [← h]; exact this.symm + +theorem rel_second {a b c : Job K V} (h : Rel e φ a b c) : b.g = a.g * Rm e φ * c.g := by + have : a.g * (a.g * b.g * c.g) * c.g = b.g := by + calc _ = (a.g * a.g) * b.g * (c.g * c.g) := by simp only [mul_assoc] + _ = b.g := by rw [a.g_sq, c.g_sq, one_mul, mul_one] + unfold Rel at h + rw [← h]; exact this.symm + +theorem rel_bc {a b c : Job K V} (h : Rel e φ a b c) : b.g * c.g = a.g * Rm e φ := by + unfold Rel at h + have : a.g * (a.g * b.g * c.g) = b.g * c.g := by + calc _ = (a.g * a.g) * (b.g * c.g) := by simp only [mul_assoc] + _ = b.g * c.g := by rw [a.g_sq, one_mul] + rw [← this, h] + +theorem rel_rev (he : φ e = 1) {a b c : Job K V} (h : Rel e φ a b c) : Rel e φ c b a := by + have h1 : c.g * b.g * a.g * Rm e φ = 1 := by + unfold Rel at h + rw [← h] + calc _ = c.g * b.g * (a.g * a.g) * (b.g * c.g) := by simp only [mul_assoc] + _ = c.g * (b.g * b.g) * c.g := by rw [a.g_sq, mul_one]; simp only [mul_assoc] + _ = 1 := by rw [b.g_sq, mul_one, c.g_sq] + unfold Rel + calc c.g * b.g * a.g = c.g * b.g * a.g * (Rm e φ * Rm e φ) := by rw [Rm_sq e φ he, mul_one] + _ = (c.g * b.g * a.g * Rm e φ) * Rm e φ := by simp only [mul_assoc] + _ = Rm e φ := by rw [h1, one_mul] + +/-- L1: two X-type edges at a vertex force the third. -/ +theorem L1_third (h2 : (2 : K) ≠ 0) {a b c : Job K V} (h : Rel e φ a b c) + (ha : xT e a) (hb : xT e b) : xT e c := by + apply job_of_GX h2; rw [rel_third h] + exact GX_mul (GX_mul (GX_job hb) (GX_job ha)) GX_R + +theorem L1_first (h2 : (2 : K) ≠ 0) {a b c : Job K V} (h : Rel e φ a b c) + (hb : xT e b) (hc : xT e c) : xT e a := by + apply job_of_GX h2; rw [rel_first h] + exact GX_mul (GX_mul GX_R (GX_job hc)) (GX_job hb) + +theorem L1_second (h2 : (2 : K) ≠ 0) {a b c : Job K V} (h : Rel e φ a b c) + (ha : xT e a) (hc : xT e c) : xT e b := by + apply job_of_GX h2; rw [rel_second h] + exact GX_mul (GX_mul (GX_job ha) GX_R) (GX_job hc) + +/-- a functional not in span φ is nonzero somewhere on ker φ -/ +theorem exists_kerφ (he : φ e = 1) (y : Dual K V) (hy : ¬ y ∈ Submodule.span K {φ}) : + ∃ v, φ v = 0 ∧ y v ≠ 0 := by + by_contra hcon + push Not at hcon + obtain ⟨c, hc⟩ := exists_ker φ y ⟨e, by rw [he]; exact one_ne_zero⟩ hcon + exact hy (Submodule.mem_span_singleton.mpr ⟨c, hc.symm⟩) + +/-- L3 (x side): the N-type end a of a vertex forbids b, c both X-type. -/ +theorem L3x (he : φ e = 1) (h2 : (2 : K) ≠ 0) {a b c : Job K V} (h : Rel e φ a b c) + (hn : ¬ xT e a) (hn' : ¬ yT φ a) (hb : xT e b) (hc : xT e c) : False := by + have hG : GX e (a.g * Rm e φ) := by rw [← rel_bc h]; exact GX_mul (GX_job hb) (GX_job hc) + obtain ⟨w, hw⟩ := hG + obtain ⟨v, hv1, hv2⟩ := exists_kerφ he a.y hn' + have h1 := hw v + rw [Module.End.mul_apply, Rm_apply, hv1, mul_zero, zero_smul, sub_zero, Job.g_apply] at h1 + apply hn + show a.x ∈ Submodule.span K {e} + rw [Submodule.mem_span_singleton] + refine ⟨-(w v) / a.y v, ?_⟩ + have h3 : a.y v • a.x = -(w v • e) := by + have : v - a.y v • a.x = v + w v • e := h1 + have h4 : a.y v • a.x = v - (v + w v • e) := by rw [← this]; module + rw [h4]; module + calc (-(w v) / a.y v) • e = (a.y v)⁻¹ • (-(w v • e)) := by + rw [smul_neg, smul_smul, ← neg_smul]; congr 1; field_simp + _ = (a.y v)⁻¹ • (a.y v • a.x) := by rw [h3] + _ = a.x := by rw [smul_smul, inv_mul_cancel₀ hv2, one_smul] + +end Vertex + +section Vertex2 +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] +variable {e : V} {φ : Dual K V} + +theorem mem_of_smul_mem {S : Submodule K V} {s : K} {x : V} (hs : s ≠ 0) (h : s • x ∈ S) : x ∈ S := by + have := S.smul_mem s⁻¹ h + rwa [smul_smul, inv_mul_cancel₀ hs, one_smul] at this + +theorem gR_mem (a : Job K V) (v : V) : + a.g (Rm e φ v) - v ∈ Submodule.span K {e, a.x} := by + rw [Submodule.mem_span_pair] + refine ⟨-(2 * φ v), -(a.y v - 2 * φ v * a.y e), ?_⟩ + simp only [Rm_apply, Job.g_apply, map_sub, map_smul, smul_eq_mul] + module + +theorem hbc_apply {a b c : Job K V} (h : Rel e φ a b c) (v : V) : + b.g (c.g v) = a.g (Rm e φ v) := by + have := congrArg (fun f => f v) (rel_bc h) + simpa using this + +/-- L2 (x side): at a vertex whose first job a is N-type, the other two x's lie in ⟨e, x_a⟩. -/ +theorem xplane (he : φ e = 1) (h2 : (2 : K) ≠ 0) {a b c : Job K V} (h : Rel e φ a b c) + (hn : ¬ xT e a) (hn' : ¬ yT φ a) : + b.x ∈ Submodule.span K {e, a.x} ∧ c.x ∈ Submodule.span K {e, a.x} := by + have hA : ∃ v, c.y v = 0 ∧ b.y v ≠ 0 := by + by_contra hcon + push Not at hcon + refine vanish_contra he h2 a hn hn' c.y ⟨c.x, by rw [c.hxy]; exact h2⟩ (fun v hv => ?_) + rw [Module.End.mul_apply, ← hbc_apply h, Job.g_apply c v, hv, zero_smul, sub_zero, + Job.g_apply, hcon v hv, zero_smul, sub_zero] + have hbx : b.x ∈ Submodule.span K {e, a.x} := by + obtain ⟨v, hv1, hv2⟩ := hA + have := gR_mem (e := e) (φ := φ) a v + rw [← hbc_apply h, Job.g_apply c v, hv1, zero_smul, sub_zero, Job.g_apply] at this + have h3 : b.y v • b.x ∈ Submodule.span K {e, a.x} := by + have h4 : b.y v • b.x = -(v - b.y v • b.x - v) := by abel + rw [h4]; exact Submodule.neg_mem _ this + exact mem_of_smul_mem hv2 h3 + refine ⟨hbx, ?_⟩ + have hB : ∃ v, b.y v = 0 ∧ c.y v ≠ 0 := by + by_contra hcon + push Not at hcon + refine vanish_contra he h2 a hn hn' b.y ⟨b.x, by rw [b.hxy]; exact h2⟩ (fun v hv => ?_) + rw [Module.End.mul_apply, ← hbc_apply h, Job.g_apply c v, hcon v hv, zero_smul, sub_zero, + Job.g_apply, hv, zero_smul, sub_zero] + obtain ⟨v, hv1, hv2⟩ := hB + have := gR_mem (e := e) (φ := φ) a v + rw [← hbc_apply h] at this + simp only [Job.g_apply, map_sub, map_smul, smul_eq_mul, hv1] at this + have hmem := Submodule.sub_mem _ (Submodule.smul_mem _ (c.y v * b.y c.x) hbx) this + apply mem_of_smul_mem hv2 + convert hmem using 1 + module + +/-- L4 core: X-only first end, Y-only last end is impossible. -/ +theorem mixed (he : φ e = 1) (h2 : (2 : K) ≠ 0) {a b c : Job K V} (h : Rel e φ a b c) + (ha : xT e a) (ha' : ¬ yT φ a) (hc : yT φ c) (hc' : ¬ xT e c) : False := by + obtain ⟨u, hu⟩ := Submodule.mem_span_singleton.mp ha + obtain ⟨d, hd⟩ := Submodule.mem_span_singleton.mp hc + have hae : a.y e * u = 2 := by + have := a.hxy + rw [← hu] at this + simpa [mul_comm] using this + have hcy : ∀ v, c.y v = d * φ v := fun v => by rw [← hd]; rfl + have hd0 : d ≠ 0 := by + intro h0 + have := c.hxy + rw [hcy, h0, zero_mul] at this + exact h2 this.symm + have hu0 : u ≠ 0 := by + intro h0 + rw [h0, mul_zero] at hae + exact h2 hae.symm + let w : Dual K V := (2 : K) • φ - u • a.y + have hw : ∀ v, a.g (Rm e φ v) = v + w v • e := by + intro v + simp only [Rm_apply, Job.g_apply, map_sub, map_smul, smul_eq_mul, w, LinearMap.sub_apply, + LinearMap.smul_apply, ← hu] + match_scalars + · ring + · linear_combination (2 * φ v) * hae + have hwe : w e = 0 := by + simp only [w, LinearMap.sub_apply, LinearMap.smul_apply, smul_eq_mul, he] + linear_combination -hae + have hw0 : ∃ v, φ v = 0 ∧ w v ≠ 0 := by + by_contra hcon + push Not at hcon + obtain ⟨k, hk⟩ := exists_ker φ w ⟨e, by rw [he]; exact one_ne_zero⟩ hcon + have hk0 : k = 0 := by + have := congrArg (fun f => f e) hk + simp only [LinearMap.smul_apply, smul_eq_mul, he, mul_one] at this + rw [hwe] at this; exact this.symm + rw [hk0, zero_smul] at hk + apply ha' + show a.y ∈ Submodule.span K {φ} + rw [Submodule.mem_span_singleton] + refine ⟨2 / u, ?_⟩ + ext v + have := congrArg (fun f => f v) hk + simp only [w, LinearMap.sub_apply, LinearMap.smul_apply, smul_eq_mul, LinearMap.zero_apply] at this + simp only [LinearMap.smul_apply, smul_eq_mul] + field_simp + linear_combination this + obtain ⟨v0, hv0, hwv0⟩ := hw0 + have E1 := hbc_apply h v0 + rw [hw v0, Job.g_apply c v0, hcy, hv0, mul_zero, zero_smul, sub_zero, Job.g_apply] at E1 + have hb1 : b.y v0 • b.x = -(w v0 • e) := by + have h4 : b.y v0 • b.x = v0 - (v0 + w v0 • e) := by rw [← E1]; module + rw [h4]; module + have hby : b.y v0 ≠ 0 := by + intro h0 + rw [h0, zero_smul] at hb1 + have : w v0 • e = 0 := by + have := neg_eq_zero.mp hb1.symm + exact this + rcases smul_eq_zero.mp this with h | h + · exact hwv0 h + · exact e_ne he h + have hbx : b.x = (-(w v0) / b.y v0) • e := by + calc b.x = (b.y v0)⁻¹ • (b.y v0 • b.x) := by rw [smul_smul, inv_mul_cancel₀ hby, one_smul] + _ = (-(w v0) / b.y v0) • e := by + rw [hb1, smul_neg, smul_smul, ← neg_smul]; congr 1; field_simp + have E2 := hbc_apply h e + rw [hw e, hwe, zero_smul, add_zero] at E2 + have hce : c.y e = d := by rw [hcy, he, mul_one] + rw [Job.g_apply c e, hce, Job.g_apply] at E2 + simp only [map_sub, map_smul, smul_eq_mul] at E2 + set q : K := b.y e - d * b.y c.x with hq + have E3 : d • c.x = (-(q * (-(w v0) / b.y v0))) • e := by + have h5 : d • c.x = -(q • b.x) := by + have : d • c.x = e - (e - d • c.x - q • b.x) - q • b.x := by module + rw [this, E2]; module + rw [h5, hbx, smul_smul] + module + apply hc' + show c.x ∈ Submodule.span K {e} + rw [Submodule.mem_span_singleton] + refine ⟨d⁻¹ * (-(q * (-(w v0) / b.y v0))), ?_⟩ + calc (d⁻¹ * (-(q * (-(w v0) / b.y v0)))) • e = d⁻¹ • ((-(q * (-(w v0) / b.y v0))) • e) := by + rw [smul_smul] + _ = d⁻¹ • (d • c.x) := by rw [E3] + _ = c.x := by rw [smul_smul, inv_mul_cancel₀ hd0, one_smul] + +end Vertex2 + +/-! ## §3 duality: transpose the whole vertex system (V ↦ Dual V, e ↦ φ, φ ↦ eval e) -/ +section Dualize +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] +variable {e : V} {φ : Dual K V} + +def Job.dual (j : Job K V) : Job K (Dual K V) := + ⟨j.y, Dual.eval K V j.x, by simpa using j.hxy⟩ + +theorem dual_g (j : Job K V) : j.dual.g = j.g.dualMap := by + refine LinearMap.ext fun ψ => LinearMap.ext fun v => ?_ + simp [Job.g_apply, Job.dual, LinearMap.dualMap_apply'] + ring + +theorem dual_R : Rm φ (Dual.eval K V e) = (Rm e φ).dualMap := by + refine LinearMap.ext fun ψ => LinearMap.ext fun v => ?_ + simp [Rm_apply, LinearMap.dualMap_apply'] + ring + +theorem dualMap_mul (f g : Module.End K V) : (f * g).dualMap = g.dualMap * f.dualMap := by + refine LinearMap.ext fun ψ => LinearMap.ext fun v => ?_ + simp [LinearMap.dualMap_apply'] + +theorem rel_dual (he : φ e = 1) {a b c : Job K V} (h : Rel e φ a b c) : + Rel φ (Dual.eval K V e) a.dual b.dual c.dual := by + have h1 := rel_rev he h + unfold Rel at h1 ⊢ + rw [dual_g, dual_g, dual_g, dual_R, ← h1, dualMap_mul, dualMap_mul, mul_assoc] + +theorem yT_dual_iff {e : V} (j : Job K V) : yT (Dual.eval K V e) j.dual ↔ xT e j := by + unfold yT xT + show Dual.eval K V j.x ∈ Submodule.span K {Dual.eval K V e} ↔ _ + constructor + · intro h + obtain ⟨c, hc⟩ := Submodule.mem_span_singleton.mp h + rw [Submodule.mem_span_singleton] + refine ⟨c, ?_⟩ + apply Module.eval_apply_injective K + simpa using hc + · intro h + obtain ⟨c, hc⟩ := Submodule.mem_span_singleton.mp h + rw [Submodule.mem_span_singleton] + exact ⟨c, by rw [← hc]; simp⟩ + +end Dualize + +/-! ## §3 the K4 incidence: abstract case split (i)-(v), by `grind` after splitting each vertex into XX / YY / plane -/ +section K4 +variable {α : Type*} (X Y : α → Prop) (M N : α → α → Prop) + +def PlA (X : α → Prop) (M : α → α → Prop) (a b c : α) : Prop := + ¬(X a ∧ X b) ∧ ¬(X a ∧ X c) ∧ ¬(X b ∧ X c) ∧ + (¬X a → M a b ∧ M a c) ∧ (¬X b → M b a ∧ M b c) ∧ (¬X c → M c a ∧ M c b) + +def L1A (X : α → Prop) (a b c : α) : Prop := + (X a → X b → X c) ∧ (X a → X c → X b) ∧ (X b → X c → X a) + +def VtA (X Y : α → Prop) (M N : α → α → Prop) (a b c : α) : Prop := + L1A X a b c ∧ L1A Y a b c ∧ + ((X a ∧ X b ∧ X c) ∨ (Y a ∧ Y b ∧ Y c) ∨ (PlA X M a b c ∧ PlA Y N a b c)) + +theorem L1A_swap12 {a b c : α} (h : L1A X a b c) : L1A X b a c := by + unfold L1A at *; tauto +theorem L1A_swap23 {a b c : α} (h : L1A X a b c) : L1A X a c b := by + unfold L1A at *; tauto +theorem PlA_swap12 {a b c : α} (h : PlA X M a b c) : PlA X M b a c := by + unfold PlA at *; tauto +theorem PlA_swap23 {a b c : α} (h : PlA X M a b c) : PlA X M a c b := by + unfold PlA at *; tauto + +theorem VtA_swap12 {a b c : α} (h : VtA X Y M N a b c) : VtA X Y M N b a c := by + obtain ⟨l1, l2, t⟩ := h + refine ⟨L1A_swap12 _ l1, L1A_swap12 _ l2, ?_⟩ + rcases t with ⟨h1, h2, h3⟩ | ⟨h1, h2, h3⟩ | ⟨hp, hq⟩ + · exact Or.inl ⟨h2, h1, h3⟩ + · exact Or.inr (Or.inl ⟨h2, h1, h3⟩) + · exact Or.inr (Or.inr ⟨PlA_swap12 _ _ hp, PlA_swap12 _ _ hq⟩) +theorem VtA_swap23 {a b c : α} (h : VtA X Y M N a b c) : VtA X Y M N a c b := by + obtain ⟨l1, l2, t⟩ := h + refine ⟨L1A_swap23 _ l1, L1A_swap23 _ l2, ?_⟩ + rcases t with ⟨h1, h2, h3⟩ | ⟨h1, h2, h3⟩ | ⟨hp, hq⟩ + · exact Or.inl ⟨h1, h3, h2⟩ + · exact Or.inr (Or.inl ⟨h1, h3, h2⟩) + · exact Or.inr (Or.inr ⟨PlA_swap23 _ _ hp, PlA_swap23 _ _ hq⟩) + +end K4 + +/-! ## §4 vertex theorem: every vertex is XX, YY or plane (with L1 on both sides) -/ +section VertexThm +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] +variable {e : V} {φ : Dual K V} + +/-- x of edge q lies in the plane ⟨e, x_t⟩ -/ +def Mx (e : V) (t q : Job K V) : Prop := q.x ∈ Submodule.span K {e, t.x} +def My (φ : Dual K V) (t q : Job K V) : Prop := q.y ∈ Submodule.span K {φ, t.y} +def Vt (e : V) (φ : Dual K V) (a b c : Job K V) : Prop := VtA (xT e) (yT φ) (Mx e) (My φ) a b c + +theorem mem_swap {M : Type*} [AddCommGroup M] [Module K M] {e a b : M} + (hb : b ∈ Submodule.span K {e, a}) (hnb : b ∉ Submodule.span K {e}) : + a ∈ Submodule.span K {e, b} := by + obtain ⟨p, q, hpq⟩ := Submodule.mem_span_pair.mp hb + have hq : q ≠ 0 := by + rintro rfl + apply hnb + rw [Submodule.mem_span_singleton] + exact ⟨p, by simpa using hpq⟩ + rw [Submodule.mem_span_pair] + refine ⟨-(p / q), q⁻¹, ?_⟩ + rw [← hpq] + match_scalars <;> field_simp <;> ring + +theorem span_pair_le {M : Type*} [AddCommGroup M] [Module K M] {e a b : M} + (h : a ∈ Submodule.span K {e, b}) : Submodule.span K {e, a} ≤ Submodule.span K {e, b} := by + rw [Submodule.span_le] + intro z hz + rcases hz with rfl | rfl + · exact Submodule.subset_span (by simp) + · exact h + +theorem tr_gen {M : Type*} [AddCommGroup M] [Module K M] {e a b i : M} + (hb : b ∈ Submodule.span K {e, a}) (hnb : b ∉ Submodule.span K {e}) + (hi : i ∈ Submodule.span K {e, a}) : i ∈ Submodule.span K {e, b} := + span_pair_le (mem_swap hb hnb) hi + +theorem plX_first (he : φ e = 1) (h2 : (2 : K) ≠ 0) {a b c : Job K V} (h : Rel e φ a b c) + (hn : ¬ xT e a) (hn' : ¬ yT φ a) : PlA (xT e) (Mx e) a b c := by + obtain ⟨hb, hc⟩ := xplane he h2 h hn hn' + have hnn : ¬ (xT e b ∧ xT e c) := fun ⟨h1, h3⟩ => L3x he h2 h hn hn' h1 h3 + refine ⟨fun ⟨h1, _⟩ => hn h1, fun ⟨h1, _⟩ => hn h1, hnn, fun _ => ⟨hb, hc⟩, + fun hnb => ?_, fun hnc => ?_⟩ + · exact ⟨mem_swap hb hnb, span_pair_le (mem_swap hb hnb) hc⟩ + · exact ⟨mem_swap hc hnc, span_pair_le (mem_swap hc hnc) hb⟩ + +theorem he_dual (he : φ e = 1) : (Dual.eval K V e) φ = 1 := by simpa using he + +theorem plY_first (he : φ e = 1) (h2 : (2 : K) ≠ 0) {a b c : Job K V} (h : Rel e φ a b c) + (hn : ¬ xT e a) (hn' : ¬ yT φ a) : PlA (yT φ) (My φ) a b c := + plX_first (e := φ) (φ := Dual.eval K V e) (he_dual he) h2 (rel_dual he h) hn' + (fun hh => hn ((yT_dual_iff a).1 hh)) + +theorem vertex (he : φ e = 1) (h2 : (2 : K) ≠ 0) {a b c : Job K V} (h : Rel e φ a b c) : + Vt e φ a b c := by + have L1x : L1A (xT e) a b c := + ⟨fun ha hb => L1_third h2 h ha hb, fun ha hc => L1_second h2 h ha hc, + fun hb hc => L1_first h2 h hb hc⟩ + have L1y : L1A (yT φ) a b c := + (⟨fun ha hb => L1_third h2 (rel_dual he h) ha hb, fun ha hc => L1_second h2 (rel_dual he h) ha hc, + fun hb hc => L1_first h2 (rel_dual he h) hb hc⟩ : L1A (xT φ) a.dual b.dual c.dual) + refine ⟨L1x, L1y, ?_⟩ + by_cases N1 : ¬ xT e a ∧ ¬ yT φ a + · exact Or.inr (Or.inr ⟨plX_first he h2 h N1.1 N1.2, plY_first he h2 h N1.1 N1.2⟩) + by_cases N3 : ¬ xT e c ∧ ¬ yT φ c + · have hr := rel_rev he h + have p1 := plX_first he h2 hr N3.1 N3.2 + have p2 := plY_first he h2 hr N3.1 N3.2 + exact Or.inr (Or.inr ⟨PlA_swap12 _ _ (PlA_swap23 _ _ (PlA_swap12 _ _ p1)), + PlA_swap12 _ _ (PlA_swap23 _ _ (PlA_swap12 _ _ p2))⟩) + by_cases xa : xT e a + · by_cases xc : xT e c + · exact Or.inl ⟨xa, L1x.2.1 xa xc, xc⟩ + · have yc : yT φ c := by + by_contra yc; exact N3 ⟨xc, yc⟩ + by_cases ya : yT φ a + · exact Or.inr (Or.inl ⟨ya, L1y.2.1 ya yc, yc⟩) + · exact (mixed he h2 h xa ya yc xc).elim + · have ya : yT φ a := by + by_contra ya; exact N1 ⟨xa, ya⟩ + by_cases yc : yT φ c + · exact Or.inr (Or.inl ⟨ya, L1y.2.1 ya yc, yc⟩) + · have xc : xT e c := by + by_contra xc; exact N3 ⟨xc, yc⟩ + exact (mixed (e := φ) (φ := Dual.eval K V e) (he_dual he) h2 (rel_dual he h) ya + (fun hh => xa ((yT_dual_iff a).1 hh)) ((yT_dual_iff c).2 xc) yc).elim + +/-- any of the six orders of the three jobs of a vertex gives the same symmetric statement -/ +theorem vertex_any (he : φ e = 1) (h2 : (2 : K) ≠ 0) {a b c : Job K V} + (h : Rel e φ a b c ∨ Rel e φ a c b ∨ Rel e φ b a c ∨ Rel e φ b c a ∨ Rel e φ c a b ∨ + Rel e φ c b a) : Vt e φ a b c := by + rcases h with h | h | h | h | h | h + · exact vertex he h2 h + · exact VtA_swap23 _ _ _ _ (vertex he h2 h) + · exact VtA_swap12 _ _ _ _ (vertex he h2 h) + · exact VtA_swap12 _ _ _ _ (VtA_swap23 _ _ _ _ (vertex he h2 h)) + · exact VtA_swap23 _ _ _ _ (VtA_swap12 _ _ _ _ (vertex he h2 h)) + · exact VtA_swap23 _ _ _ _ (VtA_swap12 _ _ _ _ (VtA_swap23 _ _ _ _ (vertex he h2 h))) + +end VertexThm + +/-! ## §5 the K4 case split, abstract (cases (i)-(v) of DERIV63) -/ +section K4b +variable {α : Type*} (X Y : α → Prop) (M N : α → α → Prop) +set_option maxHeartbeats 8000000 in +theorem k4A (hfx : ∀ t q, X q → M t q) (hfy : ∀ t q, Y q → N t q) + (hrefl : ∀ t, M t t) (hreflY : ∀ t, N t t) + (htr : ∀ t t' i, M t t' → ¬X t' → M t i → M t' i) + (htrY : ∀ t t' i, N t t' → ¬Y t' → N t i → N t' i) + (p1 p2 p3 p4 p5 p6 : α) + (hv1 : VtA X Y M N p2 p4 p6) (hv2 : VtA X Y M N p1 p3 p6) + (hv3 : VtA X Y M N p1 p4 p5) (hv4 : VtA X Y M N p2 p3 p5) : + (X p1 ∧ X p2 ∧ X p3 ∧ X p4 ∧ X p5 ∧ X p6) ∨ (Y p1 ∧ Y p2 ∧ Y p3 ∧ Y p4 ∧ Y p5 ∧ Y p6) ∨ + (((M p1 p1 ∧ M p1 p2 ∧ M p1 p3 ∧ M p1 p4 ∧ M p1 p5 ∧ M p1 p6) ∨ + (M p2 p1 ∧ M p2 p2 ∧ M p2 p3 ∧ M p2 p4 ∧ M p2 p5 ∧ M p2 p6) ∨ + (M p3 p1 ∧ M p3 p2 ∧ M p3 p3 ∧ M p3 p4 ∧ M p3 p5 ∧ M p3 p6) ∨ + (M p4 p1 ∧ M p4 p2 ∧ M p4 p3 ∧ M p4 p4 ∧ M p4 p5 ∧ M p4 p6) ∨ + (M p5 p1 ∧ M p5 p2 ∧ M p5 p3 ∧ M p5 p4 ∧ M p5 p5 ∧ M p5 p6) ∨ + (M p6 p1 ∧ M p6 p2 ∧ M p6 p3 ∧ M p6 p4 ∧ M p6 p5 ∧ M p6 p6)) ∧ + ((N p1 p1 ∧ N p1 p2 ∧ N p1 p3 ∧ N p1 p4 ∧ N p1 p5 ∧ N p1 p6) ∨ + (N p2 p1 ∧ N p2 p2 ∧ N p2 p3 ∧ N p2 p4 ∧ N p2 p5 ∧ N p2 p6) ∨ + (N p3 p1 ∧ N p3 p2 ∧ N p3 p3 ∧ N p3 p4 ∧ N p3 p5 ∧ N p3 p6) ∨ + (N p4 p1 ∧ N p4 p2 ∧ N p4 p3 ∧ N p4 p4 ∧ N p4 p5 ∧ N p4 p6) ∨ + (N p5 p1 ∧ N p5 p2 ∧ N p5 p3 ∧ N p5 p4 ∧ N p5 p5 ∧ N p5 p6) ∨ + (N p6 p1 ∧ N p6 p2 ∧ N p6 p3 ∧ N p6 p4 ∧ N p6 p5 ∧ N p6 p6))) := by + obtain ⟨l1, l1', t1⟩ := hv1 + obtain ⟨l2, l2', t2⟩ := hv2 + obtain ⟨l3, l3', t3⟩ := hv3 + obtain ⟨l4, l4', t4⟩ := hv4 + unfold PlA L1A at * + rcases t1 with t1 | t1 | t1 <;> rcases t2 with t2 | t2 | t2 <;> rcases t3 with t3 | t3 | t3 <;> + rcases t4 with t4 | t4 | t4 <;> + first + | grind + | (by_cases hY1 : Y p1 <;> by_cases hY2 : Y p2 <;> by_cases hY3 : Y p3 <;> + by_cases hY4 : Y p4 <;> by_cases hY5 : Y p5 <;> by_cases hY6 : Y p6 <;> grind) + | (by_cases hX1 : X p1 <;> by_cases hX2 : X p2 <;> by_cases hX3 : X p3 <;> + by_cases hX4 : X p4 <;> by_cases hX5 : X p5 <;> by_cases hX6 : X p6 <;> grind) +end K4b + +/-! ## §6 composition: spec6_dead -/ +section Compose +variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] +variable {e : V} {φ : Dual K V} + +def ALLX (e : V) (jA jB jC jD jE jF : Job K V) : Prop := + xT e jA ∧ xT e jB ∧ xT e jC ∧ xT e jD ∧ xT e jE ∧ xT e jF +def ALLY (φ : Dual K V) (jA jB jC jD jE jF : Job K V) : Prop := + yT φ jA ∧ yT φ jB ∧ yT φ jC ∧ yT φ jD ∧ yT φ jE ∧ yT φ jF +/-- PL: all six x in one plane ⟨e, p⟩ and all six y in one plane ⟨φ, q⟩ -/ +def PLdef (e : V) (φ : Dual K V) (jA jB jC jD jE jF : Job K V) : Prop := + (∃ p : V, jA.x ∈ Submodule.span K {e, p} ∧ jB.x ∈ Submodule.span K {e, p} ∧ + jC.x ∈ Submodule.span K {e, p} ∧ jD.x ∈ Submodule.span K {e, p} ∧ + jE.x ∈ Submodule.span K {e, p} ∧ jF.x ∈ Submodule.span K {e, p}) ∧ + (∃ q : Dual K V, jA.y ∈ Submodule.span K {φ, q} ∧ jB.y ∈ Submodule.span K {φ, q} ∧ + jC.y ∈ Submodule.span K {φ, q} ∧ jD.y ∈ Submodule.span K {φ, q} ∧ + jE.y ∈ Submodule.span K {φ, q} ∧ jF.y ∈ Submodule.span K {φ, q}) + +/-- Structure theorem: four vertex relations (K4: BDF, ACF, ADE, BCE) ⇒ PL ∨ ALLX ∨ ALLY. -/ +theorem spec6_trichotomy (he : φ e = 1) (h2 : (2 : K) ≠ 0) (jA jB jC jD jE jF : Job K V) + (hBDF : Rel e φ jB jD jF ∨ Rel e φ jB jF jD ∨ Rel e φ jD jB jF ∨ Rel e φ jD jF jB ∨ + Rel e φ jF jB jD ∨ Rel e φ jF jD jB) + (hACF : Rel e φ jA jC jF ∨ Rel e φ jA jF jC ∨ Rel e φ jC jA jF ∨ Rel e φ jC jF jA ∨ + Rel e φ jF jA jC ∨ Rel e φ jF jC jA) + (hADE : Rel e φ jA jD jE ∨ Rel e φ jA jE jD ∨ Rel e φ jD jA jE ∨ Rel e φ jD jE jA ∨ + Rel e φ jE jA jD ∨ Rel e φ jE jD jA) + (hBCE : Rel e φ jB jC jE ∨ Rel e φ jB jE jC ∨ Rel e φ jC jB jE ∨ Rel e φ jC jE jB ∨ + Rel e φ jE jB jC ∨ Rel e φ jE jC jB) : + PLdef e φ jA jB jC jD jE jF ∨ ALLX e jA jB jC jD jE jF ∨ ALLY φ jA jB jC jD jE jF := by + have hfx : ∀ t q : Job K V, xT e q → Mx e t q := fun t q hq => + Submodule.span_mono (by simp) hq + have hfy : ∀ t q : Job K V, yT φ q → My φ t q := fun t q hq => + Submodule.span_mono (by simp) hq + have hrefl : ∀ t : Job K V, Mx e t t := fun t => Submodule.subset_span (by simp) + have hreflY : ∀ t : Job K V, My φ t t := fun t => Submodule.subset_span (by simp) + have htr : ∀ t t' i : Job K V, Mx e t t' → ¬ xT e t' → Mx e t i → Mx e t' i := + fun t t' i h1 h2' h3 => tr_gen h1 h2' h3 + have htrY : ∀ t t' i : Job K V, My φ t t' → ¬ yT φ t' → My φ t i → My φ t' i := + fun t t' i h1 h2' h3 => tr_gen h1 h2' h3 + have key := k4A (xT e) (yT φ) (Mx e) (My φ) hfx hfy hrefl hreflY htr htrY jA jB jC jD jE jF + (vertex_any he h2 hBDF) (vertex_any he h2 hACF) (vertex_any he h2 hADE) (vertex_any he h2 hBCE) + rcases key with h | h | ⟨hx, hy⟩ + · exact Or.inr (Or.inl h) + · exact Or.inr (Or.inr h) + · left + refine ⟨?_, ?_⟩ + · rcases hx with h | h | h | h | h | h + · exact ⟨jA.x, h⟩ + · exact ⟨jB.x, h⟩ + · exact ⟨jC.x, h⟩ + · exact ⟨jD.x, h⟩ + · exact ⟨jE.x, h⟩ + · exact ⟨jF.x, h⟩ + · rcases hy with h | h | h | h | h | h + · exact ⟨jA.y, h⟩ + · exact ⟨jB.y, h⟩ + · exact ⟨jC.y, h⟩ + · exact ⟨jD.y, h⟩ + · exact ⟨jE.y, h⟩ + · exact ⟨jF.y, h⟩ + +/-- Survivor #6 is dead, modulo R58's kill of PL / ALLX / ALLY, kept as named hypotheses. -/ +theorem spec6_dead (he : φ e = 1) (h2 : (2 : K) ≠ 0) (jA jB jC jD jE jF : Job K V) + (hBDF : Rel e φ jB jD jF ∨ Rel e φ jB jF jD ∨ Rel e φ jD jB jF ∨ Rel e φ jD jF jB ∨ + Rel e φ jF jB jD ∨ Rel e φ jF jD jB) + (hACF : Rel e φ jA jC jF ∨ Rel e φ jA jF jC ∨ Rel e φ jC jA jF ∨ Rel e φ jC jF jA ∨ + Rel e φ jF jA jC ∨ Rel e φ jF jC jA) + (hADE : Rel e φ jA jD jE ∨ Rel e φ jA jE jD ∨ Rel e φ jD jA jE ∨ Rel e φ jD jE jA ∨ + Rel e φ jE jA jD ∨ Rel e φ jE jD jA) + (hBCE : Rel e φ jB jC jE ∨ Rel e φ jB jE jC ∨ Rel e φ jC jB jE ∨ Rel e φ jC jE jB ∨ + Rel e φ jE jB jC ∨ Rel e φ jE jC jB) + (R58_PL : ¬ PLdef e φ jA jB jC jD jE jF) + (R58_ALLX : ¬ ALLX e jA jB jC jD jE jF) + (R58_ALLY : ¬ ALLY φ jA jB jC jD jE jF) : False := by + rcases spec6_trichotomy he h2 jA jB jC jD jE jF hBDF hACF hADE hBCE with h | h | h + · exact R58_PL h + · exact R58_ALLX h + · exact R58_ALLY h + +end Compose + +/-! ## axiom audit -/ +#print axioms Spec6.L1_third +#print axioms Spec6.L3x +#print axioms Spec6.xplane +#print axioms Spec6.mixed +#print axioms Spec6.vertex +#print axioms Spec6.k4A +#print axioms Spec6.spec6_trichotomy +#print axioms Spec6.spec6_dead + +end Spec6 diff --git a/research/p104-lean-premises/lean/Nov15/Spec6.md b/research/p104-lean-premises/lean/Nov15/Spec6.md new file mode 100644 index 0000000000..84950951b7 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/Spec6.md @@ -0,0 +1,26 @@ +# Spec6: spec-break R63, survivor #6 (cells (2,1),(2,2)) kill, formalised + +File: `Nov15/Spec6.lean`. Kernel-only; axioms `propext, Classical.choice, Quot.sound`; no `sorry`, no `native_decide`. ~41 s, 2.1 GB. Standalone (Mathlib only; did not import SpecRankP/SpecLemmaU/SpecINV, which are about #0 and not needed). + +Setting (n-free, order-free, char != 2): V any vector space over a field K with 2 != 0, `e : V`, `phi : Dual V`, `phi e = 1`, `R = 1 - 2 e⊗phi`; a `Job` is `g = 1 - x⊗y`, `y x = 2`. X-type = `x ∈ span{e}`, Y-type = `y ∈ span{phi}`. + +| paper | Lean | +|---|---| +| G_X group, R in G_X, reflection in G_X iff X-type | `GX`, `GX_mul`, `GX_R`, `GX_job`, `job_of_GX` | +| L1 two X => third X (three rearrangements g3=g2g1R, g1=Rg3g2, g2=g1Rg3) | `L1_third/_first/_second`; Y side by transposition (`Job.dual`, `rel_dual`) | +| L2 (x/y in plane , when end p is N-type) | `xplane` (x), y by `Job.dual`; packaged in `plX_first`, `plY_first` | +| L3 / F1 (<= 1 X and <= 1 Y at a plane vertex) | `L3x` (+ dual inside `plY_first`) | +| L4 (X-only end vs Y-only end impossible, both orders; Eq vertices) | `mixed` (X-only first, Y-only last), other order = `mixed` on the dual; `vertex` does the case split ends-N / XX / YY | +| vertex types exactly PLANE, XX, YY | `vertex : Vt e φ a b c` (also last-end-N via `rel_rev`), `vertex_any` (all six orders) | +| K4 incidence + case split (i)-(v) over (#XX,#YY) | `k4A` (abstract atoms; 81 cases XX/YY/plane per vertex, closed by `grind`; the 8 one-special-vertex cases (iii)/(v) split on the Y (resp. X) status of the six edges) | +| ending in PL / ALLX / ALLY | `spec6_trichotomy` | +| R58 kill of PL/ALLX/ALLY | named hypotheses `R58_PL`, `R58_ALLX`, `R58_ALLY` in `spec6_dead` (not re-proved; R58's `mu=3`/unit relations are not formalised) | + +Verdict: every paper statement (L1-L4, F1, the case split) is TRUE as written; no counterexample. Wording points: +* L4 in Lean does not use the "x2 || x3 vs independent" split. Cleaner route: with end 1 X-only and end 3 Y-only, `g2g3 = g1R = 1 + w⊗e`-form with `w = 2phi - u y1`, `w e = 0`, `w != 0`; evaluate `g2g3 v` at a `v ∈ ker phi` with `w v != 0` (forces x2 || e) and at `v = e` (forces x3 || e, contradiction). So no dichotomy is needed. +* L2 independence of y2,y3 is not assumed: it is derived (claims A/B in `xplane`): if y2 vanished on ker y3 (or y3 on ker y2) then g1R - 1 would vanish on a hyperplane, forcing y1 in span phi (`vanish_contra`). This is the rank(g2g3-1)=2 step made explicit. +* "plane vertex" = an end N-type; an N-type middle edge forces an N-type end (else `vertex` lands in XX or YY, which has no N edge). The proof of (iv) uses t N-type at w_i, then `Mx`-transitivity (`tr_gen`), exactly as DERIV63 says. +* In (iii), a vertex that is XX gives no y-information and a YY vertex no x-information; the case split never needs it (every edge lies in a plane vertex). The abstract hypotheses of `k4A` encode only: L1 on both sides, and per vertex XX | YY | (plane: <=1 X, <=1 Y, all x's in the plane of any non-X edge, all y's in the plane of any non-Y edge). +* Hypotheses on the vertex relations are per-vertex orders, arbitrary (6-way disjunction), so the result is order-free. + +Not formalised: the char list / reduction of #6 to cells (2,1),(2,2), BDF being a genuine char in the same basis (R57 item 3, assumed as in AUDIT63 item 7), R58's kill, minimal-counterexample frame. No non-vacuity numerics added (AUDIT63 item 8 has the 11,744 integer 2D solutions). diff --git a/research/p104-lean-premises/lean/Nov15/SpecGC.lean b/research/p104-lean-premises/lean/Nov15/SpecGC.lean new file mode 100644 index 0000000000..12c52653fc --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecGC.lean @@ -0,0 +1,893 @@ +/- +SPECBREAK R68 (GC/II, TWIN, SPLIT-EQ) and R71 (L1), Sources: internal notes,AUDIT68}.md, R71/{RESULT71,AUDIT71}.md. See SpecGC.md. +Builds on Nov15/SpecTS.lean (model_commute, lemmaTS_model, refl_sq, ...), SpecINV.lean (inv_word), +PadLift.lean (rank_blockdiag), SpecTSUR.lean (ev/jobsP/uconj/ucount, UR_upper). +-/ +import Nov15.SpecTS +import Nov15.SpecINV +import Nov15.PadLift +import Mathlib.LinearAlgebra.Matrix.Rank + +open Matrix Finset SpecTSUR Module + +set_option linter.unusedSectionVars false + +namespace SpecGC + +variable {K : Type*} [Field K] + +/-! ## §A. rank helpers -/ +section Rank +variable {n : Type*} [Fintype n] [DecidableEq n] + +theorem eq_of_mulVec_eq (A B : Matrix n n K) (h : ∀ v, A *ᵥ v = B *ᵥ v) : A = B := by + ext i j + have := congrFun (h (Pi.single j 1)) i + simpa [Matrix.mulVec_single_one] using this + +theorem rank_mul_invol_left (X A : Matrix n n K) (hX : X * X = 1) : (X * A).rank = A.rank := by + have hu : IsUnit X.det := + (Matrix.isUnit_iff_isUnit_det X).1 (⟨⟨X, X, hX, hX⟩, rfl⟩) + exact Matrix.rank_mul_eq_right_of_isUnit_det X A hu + +theorem rank_mul_invol_right (A X : Matrix n n K) (hX : X * X = 1) : (A * X).rank = A.rank := by + have hu : IsUnit X.det := + (Matrix.isUnit_iff_isUnit_det X).1 (⟨⟨X, X, hX, hX⟩, rfl⟩) + exact Matrix.rank_mul_eq_left_of_isUnit_det X A hu + +theorem rank_smul_eq (c : K) (hc : c ≠ 0) (A : Matrix n n K) : (c • A).rank = A.rank := by + have h1 : (c • A) = (diagonal fun _ : n => c) * A := by ext i j; simp [diagonal_mul] + have h2 : A = (diagonal fun _ : n => c⁻¹) * (c • A) := by + ext i j; simp [diagonal_mul, hc] + apply le_antisymm + · rw [h1]; exact rank_mul_le_right _ _ + · conv_lhs => rw [h2] + exact rank_mul_le_right _ _ + +theorem rank_sub_comm (A B : Matrix n n K) : (A - B).rank = (B - A).rank := by + rw [← neg_sub, SpecTSUR.rank_neg_eq] + +/-- nested ranges: `rank(A-B) + rank B ≤ rank A` ⇒ `range B ⊆ range A`. -/ +theorem range_le_of_rank (A B : Matrix n n K) (h : (A - B).rank + B.rank ≤ A.rank) (v : n → K) : + ∃ z, A *ᵥ z = B *ᵥ v := by + set S : Submodule K (n → K) := + LinearMap.range (A - B).mulVecLin ⊔ LinearMap.range B.mulVecLin with hS + have hle : LinearMap.range A.mulVecLin ≤ S := by + rintro _ ⟨w, rfl⟩ + have e : A *ᵥ w = (A - B) *ᵥ w + B *ᵥ w := by rw [Matrix.sub_mulVec]; abel + show A *ᵥ w ∈ S + rw [e] + exact Submodule.add_mem_sup ⟨w, rfl⟩ ⟨w, rfl⟩ + have hfin : finrank K S ≤ finrank K (LinearMap.range A.mulVecLin) := by + refine (Submodule.finrank_add_le_finrank_add_finrank _ _).trans ?_ + exact h + have heq := Submodule.eq_of_le_of_finrank_le hle hfin + have : B *ᵥ v ∈ LinearMap.range A.mulVecLin := by + rw [heq] + exact Submodule.mem_sup_right ⟨v, rfl⟩ + obtain ⟨z, hz⟩ := this + exact ⟨z, hz⟩ + +/-- idempotents, `rank(P-Q) + rank Q ≤ rank P` ⇒ `P Q = Q`. -/ +theorem idem_nested (P Q : Matrix n n K) (hP : P * P = P) + (h : (P - Q).rank + Q.rank ≤ P.rank) : P * Q = Q := by + apply eq_of_mulVec_eq + intro v + obtain ⟨z, hz⟩ := range_le_of_rank P Q h v + rw [← Matrix.mulVec_mulVec, ← hz, Matrix.mulVec_mulVec, hP] + +theorem idem_comm (P Q : Matrix n n K) (hP : P * P = P) + (h : (P - Q).rank + Q.rank ≤ P.rank) : P * Q = Q * P := by + have h1 := idem_nested P Q hP h + have hPt : Pᵀ * Pᵀ = Pᵀ := by rw [← Matrix.transpose_mul, hP] + have h' : (Pᵀ - Qᵀ).rank + Qᵀ.rank ≤ Pᵀ.rank := by + rw [← Matrix.transpose_sub, Matrix.rank_transpose, Matrix.rank_transpose, + Matrix.rank_transpose] + exact h + have h2 := idem_nested Pᵀ Qᵀ hPt h' + have h3 : Q * P = Q := by + have := congrArg Matrix.transpose h2 + rw [Matrix.transpose_mul, Matrix.transpose_transpose, Matrix.transpose_transpose] at this + exact this + rw [h1, h3] + +/-- two involutions with `rank(D-K) + rank(1-K) ≤ rank(1-D)` commute. -/ +theorem invol_commute (h2 : (2 : K) ≠ 0) (D K' : Matrix n n K) (hD : D * D = 1) (hK : K' * K' = 1) + (h : (D - K').rank + (1 - K').rank ≤ (1 - D).rank) : D * K' = K' * D := by + set P : Matrix n n K := (2 : K)⁻¹ • (1 - D) with hPdef + set Q : Matrix n n K := (2 : K)⁻¹ • (1 - K') with hQdef + have h2i : (2 : K) * (2 : K)⁻¹ = 1 := mul_inv_cancel₀ h2 + have hPD : D = 1 - (2 : K) • P := by + rw [hPdef, smul_smul, h2i, one_smul]; abel + have hQK : K' = 1 - (2 : K) • Q := by + rw [hQdef, smul_smul, h2i, one_smul]; abel + have hPP : P * P = P := by + have : (1 - D) * (1 - D) = (2 : K) • (1 - D) := by + have : (1 - D) * (1 - D) = 1 - D - D + D * D := by noncomm_ring + rw [this, hD, two_smul]; abel + rw [hPdef, smul_mul_smul_comm, this, smul_smul] + congr 1; field_simp + have hrP : P.rank = (1 - D).rank := rank_smul_eq _ (inv_ne_zero h2) _ + have hrQ : Q.rank = (1 - K').rank := rank_smul_eq _ (inv_ne_zero h2) _ + have hPQ : (P - Q).rank = (D - K').rank := by + have : P - Q = (-(2 : K)⁻¹) • (D - K') := by + rw [hPdef, hQdef, ← smul_sub, neg_smul, ← smul_neg]; congr 1; abel + rw [this, rank_smul_eq _ (neg_ne_zero.2 (inv_ne_zero h2))] + have hc := idem_comm P Q hPP (by rw [hPQ, hrQ, hrP]; exact h) + rw [hPD, hQK] + simp only [mul_sub, sub_mul, Matrix.mul_one, Matrix.one_mul, smul_mul_assoc, mul_smul_comm, + hc] + module + +/-- the reflection `1 - x yᵀ` has `rank (· - 1) ≤ 1` -/ +theorem refl_sub_one_rank (a b : n → K) : (SpecTSUR.refl a b - 1).rank ≤ 1 := by + have : SpecTSUR.refl a b - 1 = -vecMulVec a b := by simp [SpecTSUR.refl] + rw [this, SpecTSUR.rank_neg_eq] + exact Matrix.rank_vecMulVec_le a b + +theorem refl_one_sub_rank (a b : n → K) : (1 - SpecTSUR.refl a b).rank ≤ 1 := by + rw [rank_sub_comm]; exact refl_sub_one_rank a b + +/-- a rank-one drop forces `x` into the range of `A`. -/ +theorem mem_range_of_rank_lt (A : Matrix n n K) (x y : n → K) + (h : (A - vecMulVec x y).rank < A.rank) : ∃ z, A *ᵥ z = x := by + by_contra hx + push Not at hx + set B : Matrix n n K := A - vecMulVec x y with hB + have hker : LinearMap.ker B.mulVecLin ≤ LinearMap.ker A.mulVecLin := by + intro v hv + have hv' : B *ᵥ v = 0 := hv + have e : B *ᵥ v = A *ᵥ v - (y ⬝ᵥ v) • x := by + rw [hB, Matrix.sub_mulVec, Matrix.vecMulVec_mulVec] + simp + have hyv : y ⬝ᵥ v = 0 := by + by_contra hne + apply hx ((y ⬝ᵥ v)⁻¹ • v) + rw [Matrix.mulVec_smul] + have : A *ᵥ v = (y ⬝ᵥ v) • x := by rw [e] at hv'; exact sub_eq_zero.1 hv' + rw [this, smul_smul, inv_mul_cancel₀ hne, one_smul] + rw [hyv, zero_smul, sub_zero] at e + show A *ᵥ v = 0 + rw [← e]; exact hv' + have h1 := Submodule.finrank_mono hker + have rA := LinearMap.finrank_range_add_finrank_ker A.mulVecLin + have rB := LinearMap.finrank_range_add_finrank_ker B.mulVecLin + have : A.rank ≤ B.rank := by + unfold Matrix.rank; omega + omega + +end Rank + +/-! ## §B. conjugating a reflection -/ +section Conj +variable {n : Type*} [Fintype n] [DecidableEq n] + +/-- conjugating `1 - a bᵀ` by a unit gives `1 - (P a)(b P⁻¹)ᵀ` with the same pairing `b·a`. -/ +theorem conj_form_c (P t : (Matrix n n K)ˣ) (c : K) (a b : n → K) (hab : b ⬝ᵥ a = c) + (ht : (t : Matrix n n K) = SpecTSUR.refl a b) : + ∃ a' b' : n → K, b' ⬝ᵥ a' = c ∧ + ((P * t * P⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) = SpecTSUR.refl a' b' := by + refine ⟨(P : Matrix n n K) *ᵥ a, b ᵥ* ((P⁻¹ : (Matrix n n K)ˣ) : Matrix n n K), ?_, ?_⟩ + · rw [Matrix.dotProduct_mulVec, Matrix.vecMul_vecMul] + have : ((P⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) * (P : Matrix n n K) = 1 := P.inv_mul + rw [this, Matrix.vecMul_one] + exact hab + · have hPP : (P : Matrix n n K) * ((P⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) = 1 := P.mul_inv + simp only [Units.val_mul, ht, SpecTSUR.refl, mul_sub, sub_mul, Matrix.mul_one, + Matrix.mul_vecMulVec, Matrix.vecMulVec_mul, hPP] + +end Conj + +/-! ## §C. The commuting family `K`: involution, `rank(1 - K) = b` -/ +section KFam +variable {n : Type*} [Fintype n] [DecidableEq n] [DecidableEq K] + +/-- `b` reflections with Gram `y_i·x_j = 2 δ_ij` (the odd classes' target-pairs): their product `K` is an +involution and `rank(1 - K) = b`. -/ +theorem K_data (h2 : (2 : K) ≠ 0) (b : ℕ) (x y : ℕ → n → K) + (hg : ∀ i j : Fin b, y i ⬝ᵥ x j = if i = j then 2 else 0) : + pp x y b * pp x y b = 1 ∧ (1 - pp x y b).rank = b := by + have hc : ∀ i j, Commute (SpecTS.gJ x y b i) (SpecTS.gJ x y b j) := by + intro i j + by_cases hij : i = j + · subst hij; exact Commute.refl _ + · exact SpecTS.refl_comm _ _ _ _ (by simp [hg i j, hij]) (by simp [hg j i, Ne.symm hij]) + have hs : ∀ i, SpecTS.gJ x y b i * SpecTS.gJ x y b i = 1 := fun i => + SpecTS.refl_sq _ _ (by simpa using hg i i) + constructor + · rw [SpecTS.pp_eq_prod, SpecTS.prod_ofFn_mul b _ _ (fun i j => hc i j)] + have : (fun i : Fin b => SpecTS.gJ x y b i * SpecTS.gJ x y b i) = fun _ => 1 := funext hs + rw [this]; simp + · have hGm : (SpecTS.Ym y b)ᵀ * Xm x b = (2 : K) • (1 : Matrix (Fin b) (Fin b) K) := by + ext i j + have := gram_apply x y b i j + simp only [SpecTS.Ym] at this ⊢ + rw [this, hg i j] + simp [Matrix.one_apply] + have hN : Nm x y b = 1 := by + ext i j + simp only [Nm, Matrix.add_apply, Matrix.of_apply] + by_cases hij : i < j + · simp [hij, hg i j, hij.ne] + · simp [hij] + have hZ : Zm x y b = Xm x b := by + have := ZN_eq x y b + rwa [hN, Matrix.mul_one] at this + have e : 1 - pp x y b = Xm x b * (SpecTS.Ym y b)ᵀ := by + rw [SpecINV.one_sub_pp, hZ]; rfl + rw [e] + apply le_antisymm + · exact (rank_mul_le_left _ _).trans ((Matrix.rank_le_card_width _).trans (by simp)) + · have h4 : (4 : K) ≠ 0 := by + have : (4 : K) = 2 * 2 := by norm_num + rw [this]; exact mul_ne_zero h2 h2 + have hh : (SpecTS.Ym y b)ᵀ * (Xm x b * (SpecTS.Ym y b)ᵀ) * Xm x b = (4 : K) • (1 : Matrix (Fin b) (Fin b) K) := by + calc (SpecTS.Ym y b)ᵀ * (Xm x b * (SpecTS.Ym y b)ᵀ) * Xm x b + = ((SpecTS.Ym y b)ᵀ * Xm x b) * ((SpecTS.Ym y b)ᵀ * Xm x b) := by + simp only [Matrix.mul_assoc] + _ = _ := by + rw [hGm, smul_mul_smul_comm, Matrix.mul_one]; congr 1; norm_num + have hrk : ((4 : K) • (1 : Matrix (Fin b) (Fin b) K)).rank = b := by + have : (4 : K) • (1 : Matrix (Fin b) (Fin b) K) = diagonal fun _ => (4 : K) := by + ext i j; by_cases h : i = j <;> simp [Matrix.one_apply, diagonal_apply, h] + rw [this, rank_diagonal]; simp [h4] + have h5 : ((SpecTS.Ym y b)ᵀ * (Xm x b * (SpecTS.Ym y b)ᵀ) * Xm x b).rank ≤ + (Xm x b * (SpecTS.Ym y b)ᵀ).rank := + (rank_mul_le_left _ _).trans (rank_mul_le_right _ _) + rw [hh, hrk] at h5 + exact h5 + +end KFam + +/-! ## §D. The kill count (GC/II) -/ +section Kill +variable {n : Type*} [Fintype n] [DecidableEq n] [DecidableEq K] + +/-- interface to the unit-count budget: for a word `w` with transvection units, `D = ev w`, +`J = jobsP w`, `U = ucount w`: (up) `rank(D - J) ≤ U`; (inv) if `g = D J⁻¹` is an involution then +`rank(D - J) ≤ U - 1` (INV). -/ +theorem word_up_inv (h2 : (2 : K) ≠ 0) + (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = SpecTSUR.refl a b) : + (((ev w : (Matrix n n K)ˣ) : Matrix n n K) - ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K)).rank + ≤ ucount w ∧ + ((((ev w : (Matrix n n K)ˣ) : Matrix n n K) * (((jobsP w)⁻¹ : (Matrix n n K)ˣ) : Matrix n n K)) * + (((ev w : (Matrix n n K)ˣ) : Matrix n n K) * (((jobsP w)⁻¹ : (Matrix n n K)ˣ) : Matrix n n K)) = 1 → + (((ev w : (Matrix n n K)ˣ) : Matrix n n K) - ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K)).rank + ≤ ucount w - 1) := by + refine ⟨SpecTSUR.UR_upper w (fun t ht => ?_), fun hg => ?_⟩ + · obtain ⟨a, b, -, ht'⟩ := hform t ht + rw [ht'] + exact refl_sub_one_rank a b + · have h1 := ev_move w 1 + simp only [one_mul] at h1 + have hgu : (uconj w 1).prod = ev w * (jobsP w)⁻¹ := eq_mul_inv_of_mul_eq h1.symm + have hg' : (((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K) * + (((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K) = 1 := by + rw [hgu]; simpa using hg + have hINV := SpecINV.inv_word h2 w hform hg' + have e : ((ev w : (Matrix n n K)ˣ) : Matrix n n K) - ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) = + -((1 - (((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K)) * + ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K)) := by + rw [h1]; simp [sub_mul] + rw [e, SpecTSUR.rank_neg_eq] + exact (rank_mul_le_left _ _).trans hINV + +/-- if `J = R K` with involutions `R, K` then `J⁻¹ = K R` -/ +theorem inv_of_RK (J : (Matrix n n K)ˣ) (R K' : Matrix n n K) (hR : R * R = 1) (hK : K' * K' = 1) + (hJ : (J : Matrix n n K) = R * K') : ((J⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) = K' * R := by + have h1 : (J : Matrix n n K) * (K' * R) = 1 := by + rw [hJ]; calc R * K' * (K' * R) = R * (K' * K') * R := by simp only [Matrix.mul_assoc] + _ = 1 := by rw [hK, Matrix.mul_one, hR] + calc ((J⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) = ((J⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) * 1 := by simp + _ = ((J⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) * ((J : Matrix n n K) * (K' * R)) := by rw [h1] + _ = K' * R := by rw [← Matrix.mul_assoc, J.inv_mul, Matrix.one_mul] + +/-- gap lower bound: `|r - b| ≤ rank(D - K)` for `r = rank(1 - D)`, `b = rank(1 - K)`. -/ +theorem gap_le (D K' : Matrix n n K) : + ((1 - D).rank - (1 - K').rank) + ((1 - K').rank - (1 - D).rank) ≤ (D - K').rank := by + have h1 := rank_le_sub_add (1 - D) (1 - K') + have h2 := rank_le_sub_add (1 - K') (1 - D) + have e1 : (1 - D) - (1 - K') = K' - D := by abel + have e2 : (1 - K') - (1 - D) = D - K' := by abel + rw [e1, rank_sub_comm K' D] at h1 + rw [e2] at h2 + omega + +/-- **GC/II, strict form.** `J = R K` with `rank(1 - R) ≤ h`: `rank(D - J) ≥ gap - h`; so +`U + h < gap` (`gap = |r - b|`) is a contradiction with `rank(D - J) ≤ U`. -/ +theorem gc_strict (D K' R J : Matrix n n K) (h U : ℕ) (hJ : J = R * K') (hR : (1 - R).rank ≤ h) + (hup : (D - J).rank ≤ U) + (hgap : U + h < ((1 - D).rank - (1 - K').rank) + ((1 - K').rank - (1 - D).rank)) : False := by + have h1 := gap_le D K' + have e : D - K' = (D - J) - (1 - R) * K' := by rw [hJ]; noncomm_ring + have h2 : (D - K').rank ≤ (D - J).rank + (1 - R).rank := by + rw [e] + refine (SpecTSUR.rank_sub_le' _ _).trans ?_ + have := rank_mul_le_left (1 - R) K' + omega + omega + +/-- **GC/II, h = 0** (`J = K`): `U ≤ gap` is dead (strict by the upper bound, equality by INV). -/ +theorem gc_h0 (h2 : (2 : K) ≠ 0) (D K' : Matrix n n K) (U : ℕ) (hU : 0 < U) + (hD : D * D = 1) (hK : K' * K' = 1) + (hup : (D - K').rank ≤ U) (hinv : D * K' = K' * D → (D - K').rank ≤ U - 1) + (hgap : U ≤ ((1 - D).rank - (1 - K').rank) + ((1 - K').rank - (1 - D).rank)) : False := by + have h1 := gap_le D K' + have hc : D * K' = K' * D := by + by_cases hrb : (1 - K').rank ≤ (1 - D).rank + · exact invol_commute h2 D K' hD hK (by omega) + · refine (invol_commute h2 K' D hK hD ?_).symm + rw [rank_sub_comm]; omega + have := hinv hc + omega + +/-- **GC/II, h = 1** (`J = R K`, `R = 1 - x yᵀ` a reflection, `y·x = 2`): `U + 1 ≤ gap` is dead. +Equality case: `rank(D - K) = gap` ⇒ `D, K` commute ⇒ `E = DK` involution; `rank(R - E) < rank(1 - E)` ⇒ +`x ∈ col(1 - E)`, `y ∈ row(1 - E)` ⇒ `E x = -x`, `y E = -y` ⇒ `R E = E R` ⇒ `g = E R` involution ⇒ INV. -/ +theorem gc_h1 (h2 : (2 : K) ≠ 0) (D K' : Matrix n n K) (x y : n → K) (J : Matrix n n K) (U : ℕ) + (hU : 0 < U) (hD : D * D = 1) (hK : K' * K' = 1) (hxy : y ⬝ᵥ x = 2) + (hJ : J = SpecTSUR.refl x y * K') + (hup : (D - J).rank ≤ U) + (hinv : (D * K' * SpecTSUR.refl x y) * (D * K' * SpecTSUR.refl x y) = 1 → (D - J).rank ≤ U - 1) + (hgap : U + 1 ≤ ((1 - D).rank - (1 - K').rank) + ((1 - K').rank - (1 - D).rank)) : False := by + set R := SpecTSUR.refl x y with hRdef + have hR2 : R * R = 1 := SpecTS.refl_sq x y hxy + have hRr : (1 - R).rank ≤ 1 := refl_one_sub_rank x y + have hlow := gap_le D K' + have hup' : (D - K').rank ≤ (D - J).rank + 1 := by + have e : D - K' = (D - J) - (1 - R) * K' := by rw [hJ]; noncomm_ring + rw [e] + refine (SpecTSUR.rank_sub_le' _ _).trans ?_ + have := rank_mul_le_left (1 - R) K' + omega + have hc : D * K' = K' * D := by + by_cases hrb : (1 - K').rank ≤ (1 - D).rank + · exact invol_commute h2 D K' hD hK (by omega) + · refine (invol_commute h2 K' D hK hD ?_).symm + rw [rank_sub_comm]; omega + have hE2' : (D * K') * (D * K') = 1 := by + calc D * K' * (D * K') = D * (K' * D) * K' := by simp only [Matrix.mul_assoc] + _ = D * (D * K') * K' := by rw [hc] + _ = (D * D) * (K' * K') := by simp only [Matrix.mul_assoc] + _ = 1 := by rw [hD, hK, Matrix.mul_one] + set E := D * K' with hE + have hE2 : E * E = 1 := hE2' + -- rank(1 - E) = rank(D - K) ≥ gap + have hrE : (1 - E).rank = (D - K').rank := by + have : 1 - E = D * (D - K') := by rw [hE, mul_sub, hD] + rw [this]; exact rank_mul_invol_left D _ hD + -- rank(R - E) = rank(D - J) + have hrRE : (R - E).rank = (D - J).rank := by + have : D - J = (E - R) * K' := by + rw [hJ, hE]; calc D - R * K' = D * (K' * K') - R * K' := by rw [hK, Matrix.mul_one] + _ = _ := by noncomm_ring + rw [this, rank_mul_invol_right _ _ hK, rank_sub_comm] + have hlt : (R - E).rank < (1 - E).rank := by omega + have eRE : R - E = (1 - E) - vecMulVec x y := by rw [hRdef]; simp [SpecTSUR.refl]; abel + rw [eRE] at hlt + obtain ⟨z, hz⟩ := mem_range_of_rank_lt (1 - E) x y hlt + -- transpose version for y + have hlt' : ((1 - E)ᵀ - vecMulVec y x).rank < (1 - E)ᵀ.rank := by + rw [← Matrix.transpose_vecMulVec, ← Matrix.transpose_sub, Matrix.rank_transpose, + Matrix.rank_transpose] + exact hlt + obtain ⟨w, hw⟩ := mem_range_of_rank_lt (1 - E)ᵀ y x hlt' + have hEx : E *ᵥ x = -x := by + rw [← hz, Matrix.mulVec_mulVec] + have : E * (1 - E) = -(1 - E) := by rw [mul_sub, Matrix.mul_one, hE2]; abel + rw [this, Matrix.neg_mulVec] + have hyE : y ᵥ* E = -y := by + rw [← hw, Matrix.mulVec_transpose, Matrix.vecMul_vecMul] + have : (1 - E) * E = -(1 - E) := by rw [sub_mul, Matrix.one_mul, hE2]; abel + rw [this, Matrix.vecMul_neg] + have hcomm : E * R = R * E := by + rw [hRdef] + simp only [SpecTSUR.refl, mul_sub, sub_mul, Matrix.mul_one, Matrix.one_mul, + Matrix.mul_vecMulVec, Matrix.vecMulVec_mul, hEx, hyE] + ext i j; simp + have hg2 : (E * R) * (E * R) = 1 := by + calc E * R * (E * R) = E * (R * E) * R := by simp only [Matrix.mul_assoc] + _ = E * (E * R) * R := by rw [hcomm] + _ = (E * E) * (R * R) := by simp only [Matrix.mul_assoc] + _ = 1 := by rw [hE2, hR2, Matrix.mul_one] + have hfin := hinv hg2 + omega + +end Kill + +/-! ## §E. TWIN rule and commutation inside a tight set -/ +section Twin +variable {n : Type*} [Fintype n] [DecidableEq n] + +/-- coefficient formula: with Gram `2 I`, `v = Σ c_i x_i` has `c_t = (y_t·v)/2`. -/ +theorem twin_coeff (h2 : (2 : K) ≠ 0) (k : ℕ) (x y : ℕ → n → K) + (hg : ∀ i j : Fin k, y i ⬝ᵥ x j = if i = j then 2 else 0) + (c : Fin k → K) (v : n → K) (hv : v = ∑ i : Fin k, c i • x i) (t : Fin k) : + y t ⬝ᵥ v = 2 * c t := by + rw [hv, dotProduct_sum] + simp only [dotProduct_smul, smul_eq_mul, hg t] + simp [mul_comm] + +/-- **TWIN rule** (R68 T3). `j` is a job with `x_j ∈ span{x_t}`, `y_j ∈ span{y_t}` (support inside the +tight set's row space), `y_j·x_j = 2`; all `t ≠ t₀` are adjacent to `j` (`y_t·x_j = 0 = y_j·x_t`). +Then `x_j = c x_{t₀}`, `y_j = d y_{t₀}`, `c d = 1` and the two jobs are EQUAL: `g_j = g_{t₀}`. -/ +theorem twin_rule (h2 : (2 : K) ≠ 0) (k : ℕ) (x y : ℕ → n → K) + (hg : ∀ i j : Fin k, y i ⬝ᵥ x j = if i = j then 2 else 0) + (xj yj : n → K) (c d : Fin k → K) + (hx : xj = ∑ i : Fin k, c i • x i) (hy : yj = ∑ i : Fin k, d i • y i) + (hjj : yj ⬝ᵥ xj = 2) (t0 : Fin k) + (hadj : ∀ t : Fin k, t ≠ t0 → y t ⬝ᵥ xj = 0 ∧ yj ⬝ᵥ x t = 0) : + SpecTSUR.refl xj yj = SpecTSUR.refl (x t0) (y t0) := by + have hc : ∀ t, t ≠ t0 → c t = 0 := by + intro t ht + have := twin_coeff h2 k x y hg c xj hx t + rw [(hadj t ht).1] at this + have h' : (2 : K) * c t = 0 := this.symm + exact (mul_eq_zero.1 h').resolve_left h2 + have hd : ∀ t, t ≠ t0 → d t = 0 := by + intro t ht + have h1 : yj ⬝ᵥ x t = 2 * d t := by + rw [hy, sum_dotProduct] + simp only [smul_dotProduct, smul_eq_mul] + have : ∀ i : Fin k, d i * (y i ⬝ᵥ x t) = if i = t then 2 * d i else 0 := by + intro i; rw [hg i t]; by_cases h : i = t <;> simp [h, mul_comm] + simp only [this]; simp + rw [(hadj t ht).2] at h1 + exact (mul_eq_zero.1 h1.symm).resolve_left h2 + have hx' : xj = c t0 • x t0 := by + rw [hx, Finset.sum_eq_single t0] + · intro t _ ht; rw [hc t ht, zero_smul] + · intro h; exact absurd (Finset.mem_univ _) h + have hy' : yj = d t0 • y t0 := by + rw [hy, Finset.sum_eq_single t0] + · intro t _ ht; rw [hd t ht, zero_smul] + · intro h; exact absurd (Finset.mem_univ _) h + have hcd : c t0 * d t0 = 1 := by + rw [hx', hy', dotProduct_smul, smul_dotProduct, hg t0 t0] at hjj + simp only [smul_eq_mul, if_true] at hjj + have : (2 : K) * (c t0 * d t0) = 2 * 1 := by linear_combination hjj + exact mul_left_cancel₀ h2 this + rw [hx', hy'] + simp only [SpecTSUR.refl, Matrix.smul_vecMulVec, Matrix.vecMulVec_smul, smul_smul] + rw [mul_comm, hcd, one_smul] + +/-- if every `t` is adjacent to `j` then `j` is dead (`x_j = 0` contradicts `y_j·x_j = 2`). -/ +theorem twin_empty (h2 : (2 : K) ≠ 0) (k : ℕ) (x y : ℕ → n → K) + (hg : ∀ i j : Fin k, y i ⬝ᵥ x j = if i = j then 2 else 0) + (xj yj : n → K) (c : Fin k → K) (hx : xj = ∑ i : Fin k, c i • x i) + (hjj : yj ⬝ᵥ xj = 2) (hadj : ∀ t : Fin k, y t ⬝ᵥ xj = 0) : False := by + have hc : ∀ t, c t = 0 := by + intro t + have := twin_coeff h2 k x y hg c xj hx t + rw [hadj t] at this + exact (mul_eq_zero.1 this.symm).resolve_left h2 + have : xj = 0 := by rw [hx]; simp [hc] + rw [this, dotProduct_zero] at hjj + exact h2 (by linear_combination -hjj) + +end Twin + +section TwinModel +variable [DecidableEq K] +variable {τ α ι : Type*} [Fintype τ] [Fintype α] [Fintype ι] [DecidableEq τ] [DecidableEq α] + +/-- GC/II fact (a): the jobs of one tight character pairwise commute (from Lemma TS). -/ +theorem jobs_commute (h2 : (2 : K) ≠ 0) (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) (k : ℕ) + (x y : ℕ → τ ⊕ α → K) (hprod : pp x y k = SpecTS.Dmod μ t) + (hcard : (univ.filter fun j : τ => μ ⬝ᵥ t j = 1).card = k) (i j : Fin k) : + Commute (SpecTS.gJ x y k i) (SpecTS.gJ x y k j) := + SpecTS.model_commute h2 μ t k x y hprod hcard i j + +/-- the TWIN rule in the model setting: the Gram hypothesis comes from Lemma TS. -/ +theorem twin_model (h2 : (2 : K) ≠ 0) (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) (k : ℕ) + (x y : ℕ → τ ⊕ α → K) (hprod : pp x y k = SpecTS.Dmod μ t) + (hcard : (univ.filter fun j : τ => μ ⬝ᵥ t j = 1).card = k) + (xj yj : τ ⊕ α → K) (c d : Fin k → K) + (hx : xj = ∑ i : Fin k, c i • x i) (hy : yj = ∑ i : Fin k, d i • y i) + (hjj : yj ⬝ᵥ xj = 2) (t0 : Fin k) + (hadj : ∀ t : Fin k, t ≠ t0 → y t ⬝ᵥ xj = 0 ∧ yj ⬝ᵥ x t = 0) : + SpecTSUR.refl xj yj = SpecTSUR.refl (x t0) (y t0) := + twin_rule h2 k x y (SpecTS.lemmaTS_model h2 μ t k x y hprod hcard).1 xj yj c d hx hy hjj t0 hadj + +end TwinModel + +/-! ## §F. The split `J = R'_1 ⋯ R'_h · K` (only the H letters are conjugated) -/ +section Split +variable {n : Type*} [Fintype n] [DecidableEq n] [DecidableEq K] + +/-- group lemma: the ordered product of the `inr` letters of a word is an involution when the `inr` +letters are involutions that pairwise commute -/ +theorem jobsP_commute {G : Type*} [Group G] (b : G) : + ∀ w : List (G ⊕ G), (∀ j, Sum.inr j ∈ w → b * j = j * b) → b * jobsP w = jobsP w * b + | [], _ => by simp [jobsP] + | .inl _ :: w, h => jobsP_commute b w (fun j hj => h j (by simp [hj])) + | .inr j :: w, h => by + have h1 := h j (by simp) + have h2 := jobsP_commute b w (fun j' hj' => h j' (by simp [hj'])) + simp only [jobsP] + calc b * (j * jobsP w) = (b * j) * jobsP w := by rw [mul_assoc] + _ = j * (b * jobsP w) := by rw [h1, mul_assoc] + _ = j * (jobsP w * b) := by rw [h2] + _ = _ := by rw [mul_assoc] + +theorem jobsP_invol {G : Type*} [Group G] : + ∀ w : List (G ⊕ G), (∀ j, Sum.inr j ∈ w → j * j = 1) → + (∀ j j', Sum.inr j ∈ w → Sum.inr j' ∈ w → j * j' = j' * j) → jobsP w * jobsP w = 1 + | [], _, _ => by simp [jobsP] + | .inl _ :: w, h1, h2 => + jobsP_invol w (fun j hj => h1 j (by simp [hj])) (fun j j' hj hj' => h2 j j' (by simp [hj]) (by simp [hj'])) + | .inr j :: w, h1, h2 => by + have ih := jobsP_invol w (fun j hj => h1 j (by simp [hj])) + (fun j j' hj hj' => h2 j j' (by simp [hj]) (by simp [hj'])) + have hc := jobsP_commute j w (fun j' hj' => h2 j j' (by simp) (by simp [hj'])) + simp only [jobsP] + calc j * jobsP w * (j * jobsP w) = j * (jobsP w * j) * jobsP w := by simp only [mul_assoc] + _ = j * (j * jobsP w) * jobsP w := by rw [← hc] + _ = (j * j) * (jobsP w * jobsP w) := by simp only [mul_assoc] + _ = 1 := by rw [h1 j (by simp), ih, mul_one] + +/-- conjugates of reflections (pairing `c`) stay reflections with the same pairing -/ +theorem uconj_forms_c (c : K) : ∀ (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) (pre : (Matrix n n K)ˣ), + (∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = c ∧ (t : Matrix n n K) = SpecTSUR.refl a b) → + ∀ g ∈ uconj w pre, ∃ a b : n → K, b ⬝ᵥ a = c ∧ (g : Matrix n n K) = SpecTSUR.refl a b + | [], _, _ => by simp [uconj] + | .inl t :: w, pre, h => by + intro g hg + simp only [uconj, List.mem_cons] at hg + rcases hg with rfl | hg + · obtain ⟨a, b, hab, ht⟩ := h t (by simp) + exact conj_form_c pre t c a b hab ht + · exact uconj_forms_c c w pre (fun t ht => h t (by simp [ht])) g hg + | .inr j :: w, pre, h => uconj_forms_c c w (pre * j) (fun t ht => h t (by simp [ht])) + +/-- **Split.** A word of job letters in which the `inl` letters are the `h` odd-man reflections +(`y·x = 2`) and the `inr` letters are the commuting involutions `K`. Its ordered product is +`J = R · K` with `R = R'_1 ⋯ R'_h` (the conjugated reflections), `rank(1 - R) ≤ h`, and `K` an +involution; for `h = 1`, `R = 1 - x yᵀ` with `y·x = 2`. -/ +theorem split_word + (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (hH : ∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 2 ∧ (t : Matrix n n K) = SpecTSUR.refl a b) + (hK1 : ∀ j, Sum.inr j ∈ w → j * j = 1) + (hK2 : ∀ j j', Sum.inr j ∈ w → Sum.inr j' ∈ w → j * j' = j' * j) : + ∃ R : Matrix n n K, + ((ev w : (Matrix n n K)ˣ) : Matrix n n K) = R * ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) ∧ + (R - 1).rank ≤ ucount w ∧ jobsP w * jobsP w = 1 ∧ + (ucount w = 1 → ∃ x y : n → K, y ⬝ᵥ x = 2 ∧ R = SpecTSUR.refl x y) := by + have h1 := ev_move w 1 + simp only [one_mul] at h1 + have hforms := uconj_forms_c 2 w 1 hH + refine ⟨(((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K), ?_, ?_, jobsP_invol w hK1 hK2, ?_⟩ + · rw [h1]; simp + · have := SpecTSUR.rank_prod_sub_one_le (uconj w 1) (fun g hg => by + obtain ⟨a, b, -, hab⟩ := hforms g hg + rw [hab]; exact refl_sub_one_rank a b) + rwa [length_uconj] at this + · intro hu + have hlen := length_uconj w 1 + rw [hu] at hlen + obtain ⟨g, hg⟩ := List.length_eq_one_iff.1 hlen + obtain ⟨a, b, hab, hgm⟩ := hforms g (by rw [hg]; simp) + refine ⟨a, b, hab, ?_⟩ + rw [hg]; simpa using hgm + +end Split + +/-! ## §G. GC/II for words -/ +section GCWord +variable {n : Type*} [Fintype n] [DecidableEq n] [DecidableEq K] + +theorem prod_invol_of_comm (D K' : Matrix n n K) (hD : D * D = 1) (hK : K' * K' = 1) + (hc : D * K' = K' * D) : (D * K') * (D * K') = 1 := by + calc D * K' * (D * K') = D * (K' * D) * K' := by simp only [Matrix.mul_assoc] + _ = D * (D * K') * K' := by rw [hc] + _ = (D * D) * (K' * K') := by simp only [Matrix.mul_assoc] + _ = 1 := by rw [hD, hK, Matrix.mul_one] + +/-- **GC/II, h = 0, for words.** `J = K` (a commuting involution), `D = ev w`. Whenever +`U = ucount w ≥ 1` and `|r - b| ≥ U` (`r = rank(1 - D)`, `b = rank(1 - K)`) the character is dead. -/ +theorem gc_dead_h0 (h2 : (2 : K) ≠ 0) + (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = SpecTSUR.refl a b) + (K' : Matrix n n K) (hK : K' * K' = 1) (hJ : ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) = K') + (hD : ((ev w : (Matrix n n K)ˣ) : Matrix n n K) * ((ev w : (Matrix n n K)ˣ) : Matrix n n K) = 1) + (hU : 0 < ucount w) + (hgap : ucount w ≤ ((1 - ((ev w : (Matrix n n K)ˣ) : Matrix n n K)).rank - (1 - K').rank) + + ((1 - K').rank - (1 - ((ev w : (Matrix n n K)ˣ) : Matrix n n K)).rank)) : False := by + obtain ⟨hup, hinv⟩ := word_up_inv h2 w hform + have hJi : (((jobsP w)⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) = K' := by + simpa using inv_of_RK (jobsP w) 1 K' (by simp) hK (by rw [hJ]; simp) + rw [hJ] at hup hinv + rw [hJi] at hinv + refine gc_h0 h2 _ K' (ucount w) hU hD hK hup (fun hc => hinv ?_) hgap + exact prod_invol_of_comm _ K' hD hK hc + +/-- **GC/II, h = 1, for words.** `J = R K` with `R = 1 - x yᵀ`, `y·x = 2` (the single odd-man +reflection, conjugated) and `K` an involution. `U ≥ 1` and `gap ≥ U + 1` is dead. -/ +theorem gc_dead_h1 (h2 : (2 : K) ≠ 0) + (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = SpecTSUR.refl a b) + (K' : Matrix n n K) (x y : n → K) (hxy : y ⬝ᵥ x = 2) (hK : K' * K' = 1) + (hJ : ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) = SpecTSUR.refl x y * K') + (hD : ((ev w : (Matrix n n K)ˣ) : Matrix n n K) * ((ev w : (Matrix n n K)ˣ) : Matrix n n K) = 1) + (hU : 0 < ucount w) + (hgap : ucount w + 1 ≤ ((1 - ((ev w : (Matrix n n K)ˣ) : Matrix n n K)).rank - (1 - K').rank) + + ((1 - K').rank - (1 - ((ev w : (Matrix n n K)ˣ) : Matrix n n K)).rank)) : False := by + obtain ⟨hup, hinv⟩ := word_up_inv h2 w hform + have hR2 : SpecTSUR.refl x y * SpecTSUR.refl x y = 1 := SpecTS.refl_sq x y hxy + have hJi : (((jobsP w)⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) = K' * SpecTSUR.refl x y := + inv_of_RK (jobsP w) _ K' hR2 hK hJ + rw [hJi] at hinv + exact gc_h1 h2 _ K' x y _ (ucount w) hU hD hK hxy hJ hup + (by simpa only [Matrix.mul_assoc] using hinv) hgap + +/-- **GC/II, strict, for words.** `J = R K`, `rank(1 - R) ≤ h`: `U + h < gap` is dead. -/ +theorem gc_dead_strict (h2 : (2 : K) ≠ 0) + (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = SpecTSUR.refl a b) + (K' R : Matrix n n K) (h : ℕ) (hR : (1 - R).rank ≤ h) + (hJ : ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) = R * K') + (hgap : ucount w + h < ((1 - ((ev w : (Matrix n n K)ˣ) : Matrix n n K)).rank - (1 - K').rank) + + ((1 - K').rank - (1 - ((ev w : (Matrix n n K)ˣ) : Matrix n n K)).rank)) : False := + gc_strict _ K' R _ h (ucount w) hJ hR (word_up_inv h2 w hform).1 hgap + +end GCWord + +/-! ## §H. L1 (R71): at `U = 1` every `M_μ = D J` is a transvection (unipotent, `rank(M - I) ≤ 1`) -/ +section L1 +variable {n : Type*} [Fintype n] [DecidableEq n] [DecidableEq K] + +/-- **L1.** One unit letter (`ucount w = 1`, a transvection `1 - a bᵀ`, `b·a = 0`), `J = jobsP w` an +involution (`J² = I`), `M = D J` with `D = ev w`. Then `M` is itself a transvection: +`(M - I)² = 0` (so `M` is unipotent), `rank(M - I) ≤ 1`, `tr M = n`, `det M = 1`. -/ +theorem L1 (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = SpecTSUR.refl a b) + (hU : ucount w = 1) (hJ2 : jobsP w * jobsP w = 1) : + (((ev w : (Matrix n n K)ˣ) : Matrix n n K) * ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) - 1) * + (((ev w : (Matrix n n K)ˣ) : Matrix n n K) * ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) - 1) = 0 ∧ + (((ev w : (Matrix n n K)ˣ) : Matrix n n K) * ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) - 1).rank ≤ 1 ∧ + IsNilpotent (((ev w : (Matrix n n K)ˣ) : Matrix n n K) * ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) - 1) ∧ + (((ev w : (Matrix n n K)ˣ) : Matrix n n K) * ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K)).trace = + (Fintype.card n : K) ∧ + (((ev w : (Matrix n n K)ˣ) : Matrix n n K) * ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K)).det = 1 := by + have h1 := ev_move w 1 + simp only [one_mul] at h1 + have hlen := length_uconj w 1 + rw [hU] at hlen + obtain ⟨g, hg⟩ := List.length_eq_one_iff.1 hlen + obtain ⟨a, b, hab, hgm⟩ := SpecINV.uconj_forms w 1 hform g (by rw [hg]; simp) + have hJJ : ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) * ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) = 1 := by + rw [← Units.val_mul, hJ2]; rfl + have hM : ((ev w : (Matrix n n K)ˣ) : Matrix n n K) * ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) = + SpecTSUR.refl a b := by + rw [h1, hg, ← hgm] + simp only [List.prod_cons, List.prod_nil, mul_one, Units.val_mul] + rw [Matrix.mul_assoc, hJJ, Matrix.mul_one] + have hsub : SpecTSUR.refl a b - 1 = -vecMulVec a b := by simp [SpecTSUR.refl] + have hsq : (SpecTSUR.refl a b - 1) * (SpecTSUR.refl a b - 1) = 0 := by + rw [hsub, Matrix.neg_mul, Matrix.mul_neg, neg_neg, Matrix.vecMulVec_mul_vecMulVec, hab] + simp + rw [hM] + refine ⟨hsq, refl_sub_one_rank a b, ⟨2, by rw [pow_two]; exact hsq⟩, ?_, ?_⟩ + · rw [SpecTSUR.refl, Matrix.trace_sub, Matrix.trace_one, Matrix.trace_vecMulVec, dotProduct_comm, hab] + simp + · rw [SpecINV.det_refl, hab]; simp + +end L1 + +/-! ## §I. SPLIT-EQ (R68, with AUDIT68's fix `dim K = m - 1`) -/ +section SplitEq +variable {n : Type*} [Fintype n] [DecidableEq n] [DecidableEq K] + +theorem rank_le_one_exists (M : Matrix n n K) (h : M.rank ≤ 1) : ∃ u v : n → K, M = vecMulVec u v := by + have h1 : finrank K (LinearMap.range M.mulVecLin) ≤ 1 := h + obtain ⟨u, hu⟩ := finrank_le_one_iff.1 h1 + have hc : ∀ j : n, ∃ c : K, c • u.1 = M *ᵥ Pi.single j 1 := by + intro j + obtain ⟨c, hc⟩ := hu ⟨M *ᵥ Pi.single j 1, ⟨Pi.single j 1, rfl⟩⟩ + exact ⟨c, congrArg Subtype.val hc⟩ + choose v hv using hc + refine ⟨u.1, v, ?_⟩ + ext i j + have := congrFun (hv j) i + simp only [Pi.smul_apply, smul_eq_mul, Matrix.mulVec_single_one] at this + rw [vecMulVec_apply, mul_comm, this]; rfl + +theorem rank_zero_eq_zero (M : Matrix n n K) (h : M.rank = 0) : M = 0 := by + apply eq_of_mulVec_eq + intro v + have h0 : finrank K (LinearMap.range M.mulVecLin) = 0 := h + rw [Submodule.finrank_eq_zero] at h0 + have : M *ᵥ v ∈ LinearMap.range M.mulVecLin := ⟨v, rfl⟩ + rw [h0] at this + simpa using this + +/-- **SPLIT-EQ core.** `ε = ±1`, `det J_K = ±1`, `dim K = card n`, and +`rank(ε - J_K)` at (or below) the determinant bit `[det J_K ≠ ε^{dim K}]` ⇒ `J_K² = I`. +(The paper's "`det J_K = -ε^(m-1)`" is this with `dim K = m - 1`.) -/ +theorem split_eq_invol (h2 : (2 : K) ≠ 0) (JK : Matrix n n K) (ε : K) (hε : ε = 1 ∨ ε = -1) + (hdet : JK.det = 1 ∨ JK.det = -1) + (hr : (ε • 1 - JK).rank ≤ if JK.det = ε ^ Fintype.card n then 0 else 1) : JK * JK = 1 := by + have hε0 : ε ≠ 0 := by rcases hε with rfl | rfl <;> simp + have hεε : ε * ε = 1 := by rcases hε with rfl | rfl <;> simp + have hpow : ε ^ Fintype.card n = 1 ∨ ε ^ Fintype.card n = -1 := by + rcases hε with rfl | rfl + · simp + · rcases neg_one_pow_eq_or K (Fintype.card n) with h | h <;> simp [h] + have hne : (1 : K) ≠ -1 := by intro h; apply h2; linear_combination h + by_cases hd : JK.det = ε ^ Fintype.card n + · rw [if_pos hd] at hr + have h0 := rank_zero_eq_zero _ (Nat.le_zero.1 hr) + have : JK = ε • 1 := (sub_eq_zero.1 h0).symm + rw [this, smul_mul_smul_comm, Matrix.one_mul, hεε, one_smul] + · rw [if_neg hd] at hr + obtain ⟨u, v, hM⟩ := rank_le_one_exists _ hr + have h1 : JK = ε • 1 - vecMulVec u v := by rw [← hM]; abel + have hdn : JK.det = -ε ^ Fintype.card n := by + rcases hdet with h | h <;> rcases hpow with h' | h' <;> simp_all + have hJ : JK = ε • (1 + replicateCol Unit ((-ε⁻¹) • u) * replicateRow Unit v) := by + rw [← vecMulVec_eq Unit, h1] + ext i j + by_cases hij : i = j + · subst hij + simp only [Matrix.sub_apply, Matrix.smul_apply, Matrix.one_apply_eq, vecMulVec_apply, + Pi.smul_apply, smul_eq_mul, Matrix.add_apply, Pi.neg_apply] + field_simp + ring + · simp only [Matrix.sub_apply, Matrix.smul_apply, Matrix.one_apply_ne hij, vecMulVec_apply, + Pi.smul_apply, smul_eq_mul, Matrix.add_apply, Pi.neg_apply] + field_simp + ring + have hdet2 : JK.det = ε ^ Fintype.card n * (1 + (-ε⁻¹) * (v ⬝ᵥ u)) := by + rw [hJ, Matrix.det_smul, det_one_add_replicateCol_mul_replicateRow, dotProduct_smul] + simp only [smul_eq_mul] + have hpn : ε ^ Fintype.card n ≠ 0 := pow_ne_zero _ hε0 + have hvu : v ⬝ᵥ u = 2 * ε := by + have : ε ^ Fintype.card n * (1 + (-ε⁻¹) * (v ⬝ᵥ u)) = -ε ^ Fintype.card n := by + rw [← hdet2, hdn] + have h3 : (1 + (-ε⁻¹) * (v ⬝ᵥ u)) = -1 := by + apply mul_left_cancel₀ hpn; rw [this]; ring + field_simp at h3 + linear_combination -h3 + rw [h1] + have e : (ε • 1 - vecMulVec u v) * (ε • 1 - vecMulVec u v) = + (ε * ε) • (1 : Matrix n n K) - (2 * ε) • vecMulVec u v + + (vecMulVec u v * vecMulVec u v) := by + simp only [sub_mul, mul_sub, smul_mul_smul_comm, Matrix.one_mul, Matrix.mul_one, + Matrix.smul_mul, Matrix.mul_smul] + module + rw [e, Matrix.vecMulVec_mul_vecMulVec, hvu, hεε, one_smul, Matrix.vecMulVec_smul] + simp + +end SplitEq + +section SplitEqBlocks +variable {κ ω : Type*} [Fintype κ] [DecidableEq κ] [Fintype ω] [DecidableEq ω] [DecidableEq K] + +/-- block form: `D - J = diag((ε - σ), ε - J_K, D_w - 1)`. -/ +theorem DJ_blocks (ε σ : K) (JK : Matrix κ κ K) (Dw : Matrix ω ω K) : + (fromBlocks (ε • (1 : Matrix (Unit ⊕ κ) (Unit ⊕ κ) K)) 0 0 Dw) - + fromBlocks (fromBlocks (σ • (1 : Matrix Unit Unit K)) 0 0 JK) 0 0 1 = + fromBlocks (fromBlocks ((ε - σ) • (1 : Matrix Unit Unit K)) 0 0 (ε • 1 - JK)) 0 0 (Dw - 1) := by + ext i j + rcases i with (i | i) | i <;> rcases j with (j | j) | j <;> + simp [Matrix.one_apply, sub_smul] <;> (try split_ifs) <;> simp_all + +theorem rank_unit_scalar (c : K) : ((c • (1 : Matrix Unit Unit K))).rank = if c ≠ 0 then 1 else 0 := by + have : (c • (1 : Matrix Unit Unit K)) = diagonal fun _ => c := by + ext i j; simp [Matrix.one_apply, diagonal_apply] + rw [this, rank_diagonal] + by_cases hc : c = 0 <;> simp [hc] + +/-- **SPLIT-EQ for words, general block form.** Coordinates `((Unit ⊕ κ) ⊕ ω)`: `V₁ = ⟨x_H⟩ ⊕ K` +(hub, then `K = ker y_H|V₁`) and the dark part `ω`. `D = ε` on `V₁`, `D_w` (an involution) on `ω`; +`J = σ ⊕ J_K ⊕ I`. With `d = rank(D_w - 1)`, the SPLIT bound is +`d + [ε ≠ σ] + [det J_K ≠ ε^{dim K}] ≤ U`, and EQUALITY IS DEAD (equality ⇒ `rank(ε - J_K)` pinned at +the det bit ⇒ `J_K` involution ⇒ `g = D J` involution ⇒ INV gives `rank(D - J) ≤ U - 1`). -/ +theorem split_eq_dead (h2 : (2 : K) ≠ 0) + (w : List ((Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K)ˣ ⊕ (Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : (Unit ⊕ κ) ⊕ ω → K, b ⬝ᵥ a = 0 ∧ + (t : Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K) = SpecTSUR.refl a b) + (ε σ : K) (hε : ε = 1 ∨ ε = -1) (hσ : σ = 1 ∨ σ = -1) + (JK : Matrix κ κ K) (hdetJ : JK.det = 1 ∨ JK.det = -1) + (Dw : Matrix ω ω K) (hDw : Dw * Dw = 1) + (hD : ((ev w : (Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K)ˣ) : Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K) = + fromBlocks (ε • (1 : Matrix (Unit ⊕ κ) (Unit ⊕ κ) K)) 0 0 Dw) + (hJ : ((jobsP w : (Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K)ˣ) : Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K) = + fromBlocks (fromBlocks (σ • (1 : Matrix Unit Unit K)) 0 0 JK) 0 0 1) + (hU : 0 < ucount w) : + (Dw - 1).rank + (if ε ≠ σ then 1 else 0) + (if JK.det ≠ ε ^ Fintype.card κ then 1 else 0) < ucount w := by + obtain ⟨hup, hinv⟩ := word_up_inv h2 w hform + have hεε : ε * ε = 1 := by rcases hε with rfl | rfl <;> simp + have hσσ : σ * σ = 1 := by rcases hσ with rfl | rfl <;> simp + set D := ((ev w : (Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K)ˣ) : Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K) with hDdef + set J := ((jobsP w : (Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K)ˣ) : Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K) with hJdef + have hrank : (D - J).rank = (Dw - 1).rank + (ε • 1 - JK).rank + ((ε - σ) • (1 : Matrix Unit Unit K)).rank := by + rw [hD, hJ, DJ_blocks, PadLift.rank_blockdiag, PadLift.rank_blockdiag]; ring + rw [rank_unit_scalar (ε - σ)] at hrank + have hbit : (if JK.det ≠ ε ^ Fintype.card κ then 1 else 0) ≤ (ε • 1 - JK).rank := by + by_cases hd : JK.det = ε ^ Fintype.card κ + · simp [hd] + · simp only [ne_eq, hd, not_false_eq_true, if_true] + by_contra hlt + have h0 := rank_zero_eq_zero (ε • 1 - JK) (by omega) + have : JK = ε • 1 := (sub_eq_zero.1 h0).symm + apply hd; rw [this, Matrix.det_smul, Matrix.det_one]; simp + have hεσ : (if ε - σ ≠ 0 then 1 else 0) = (if ε ≠ σ then 1 else 0) := by + by_cases h : ε = σ <;> simp [h, sub_eq_zero] + rw [hεσ] at hrank + by_contra hcon + push Not at hcon + -- equality: rank(D - J) = U = bound + have hrK : (ε • 1 - JK).rank ≤ (if JK.det ≠ ε ^ Fintype.card κ then 1 else 0) := by omega + have hK' : (ε • 1 - JK).rank ≤ if JK.det = ε ^ Fintype.card κ then 0 else 1 := by + by_cases hd : JK.det = ε ^ Fintype.card κ + · simpa [hd] using hrK + · simpa [hd] using hrK + have hJK2 := split_eq_invol h2 JK ε hε hdetJ hK' + have hJ2 : J * J = 1 := by + have hs : (σ • (1 : Matrix Unit Unit K)) * (σ • (1 : Matrix Unit Unit K)) = 1 := by + rw [smul_mul_smul_comm, Matrix.one_mul, hσσ, one_smul] + rw [hJ] + simp only [Matrix.fromBlocks_multiply, Matrix.zero_mul, Matrix.mul_zero, add_zero, zero_add, + Matrix.mul_one, hJK2, hs, Matrix.fromBlocks_one] + have hD2 : D * D = 1 := by + rw [hD] + simp only [Matrix.fromBlocks_multiply, Matrix.zero_mul, Matrix.mul_zero, add_zero, zero_add, hDw] + have : (ε • (1 : Matrix (Unit ⊕ κ) (Unit ⊕ κ) K)) * (ε • 1) = 1 := by + rw [smul_mul_smul_comm, Matrix.one_mul, hεε, one_smul] + rw [this, Matrix.fromBlocks_one] + have hc : D * J = J * D := by + rw [hD, hJ] + simp only [Matrix.fromBlocks_multiply, Matrix.zero_mul, Matrix.mul_zero, add_zero, zero_add, + Matrix.mul_one, Matrix.one_mul] + congr 1 + rw [Matrix.smul_mul, Matrix.mul_smul, Matrix.one_mul, Matrix.mul_one] + have hJi : ((((jobsP w)⁻¹ : (Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K)ˣ)) : Matrix ((Unit ⊕ κ) ⊕ ω) ((Unit ⊕ κ) ⊕ ω) K) = J := by + simpa using inv_of_RK (jobsP w) 1 J (by simp) hJ2 (by simp [hJdef]) + rw [hJi] at hinv + have := hinv (prod_invol_of_comm D J hD2 hJ2 hc) + omega + +end SplitEqBlocks + +/-! ## Non-vacuity: `K_data` on the SpecTS example (one reflection, `y·x = 2`) -/ +example : pp SpecTS.ex_x SpecTS.ex_y 1 * pp SpecTS.ex_x SpecTS.ex_y 1 = 1 ∧ + (1 - pp SpecTS.ex_x SpecTS.ex_y 1).rank = 1 := + K_data (K := ℚ) (by norm_num) 1 SpecTS.ex_x SpecTS.ex_y (by + intro i j + have hi : i = 0 := Subsingleton.elim _ _ + have hj : j = 0 := Subsingleton.elim _ _ + subst hi; subst hj + simp [SpecTS.ex_x, SpecTS.ex_y, dotProduct, Fintype.sum_sum_type]) + +end SpecGC + +open SpecGC in +#print axioms twin_rule +open SpecGC in +#print axioms twin_model +open SpecGC in +#print axioms jobs_commute +open SpecGC in +#print axioms K_data +open SpecGC in +#print axioms gc_strict +open SpecGC in +#print axioms gc_h0 +open SpecGC in +#print axioms gc_h1 +open SpecGC in +#print axioms split_word +open SpecGC in +#print axioms gc_dead_h0 +open SpecGC in +#print axioms gc_dead_h1 +open SpecGC in +#print axioms gc_dead_strict +open SpecGC in +#print axioms split_eq_invol +open SpecGC in +#print axioms split_eq_dead +open SpecGC in +#print axioms L1 diff --git a/research/p104-lean-premises/lean/Nov15/SpecGC.md b/research/p104-lean-premises/lean/Nov15/SpecGC.md new file mode 100644 index 0000000000..44ac893918 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecGC.md @@ -0,0 +1,18 @@ +# Nov15/SpecGC.lean +Formalises the J = 7 kill tools: R68 (GC/II, TWIN, SPLIT-EQ; AUDIT68 SOUND-WITH-FIXES) and R71 L1 (AUDIT71). Kernel-only: no sorry, no native_decide; `#print axioms` on all 14 headline theorems = [propext, Classical.choice, Quot.sound]. 12 s / 2.1 GB. Builds on SpecTS (`model_commute`, `lemmaTS_model`, `refl_sq`), SpecINV (`inv_word`, `det_refl`, `one_sub_pp`), PadLift (`rank_blockdiag`), SpecTSUR (`ev/jobsP/uconj/ucount`, `UR_upper`). +**Verdict: no paper statement is false as written (no counterexample).** Wording fixes only (below). + +## Proved +- `jobs_commute` (= `SpecTS.model_commute`): jobs of one tight character commute. +- TWIN: `twin_coeff` (Gram 2I: `y_t . v = 2 c_t`), `twin_rule` (x_j in span x_t, y_j in span y_t, y_j.x_j = 2, every t != t0 adjacent (y_t.x_j = 0 = y_j.x_t) => `refl x_j y_j = refl x_t0 y_t0`, i.e. g_j = g_t), `twin_empty` (all adjacent => dead), `twin_model` (Gram from Lemma TS). +- Split: `split_word` (word with inl = the h odd-man reflections (y.x = 2), inr = commuting involutions: `ev w = R * jobsP w`, `rank(R-1) <= h`, `jobsP w` an involution; h = 1 => R = 1 - x y^T, y.x = 2; only inl letters are conjugated, `uconj_forms_c`). `K_data`: b reflections with Gram 2I => product K involution, `rank(1-K) = b` (non-vacuity example included). +- Kill count: `gap_le` (|r-b| <= rank(D-K)), `gc_strict` (J = RK, rank(1-R) <= h, U + h < gap => False), `gc_h0` (U <= gap, U >= 1 => False; equality: rank(D-K) = gap => D,K commute via `idem_nested`/`invol_commute` => INV), `gc_h1` (R = 1 - x y^T, U+1 <= gap => False: D,K commute, E = DK, rank(R-E) < rank(1-E) => x in col, y in row (`mem_range_of_rank_lt`) => Ex = -x, yE = -y => ER = RE => g = ER involution => INV). Word versions `gc_dead_h0/h1/strict` use `word_up_inv` (rank(D-J) <= U; g involution => rank(D-J) <= U-1). +- SPLIT-EQ: `split_eq_invol` (eps = +-1, det J_K = +-1, rank(eps - J_K) <= [det J_K != eps^(dim K)] => J_K^2 = I; rank-1 outer product + det lemma), `split_eq_dead` (block coordinates (Unit + kappa) + omega: D = eps on V1, J = sigma + J_K + I: `d + [eps != sigma] + [det J_K != eps^dim K] < U`, i.e. the SPLIT bound is never attained when U >= 1). +- L1: `L1` (ucount w = 1, J^2 = I, M = D J: (M-1)^2 = 0, rank(M-1) <= 1, nilpotent (M-1) = unipotent M, tr M = n, det M = 1). + +## Wording fixes / hypotheses made explicit +1. RESULT68 "det J_K = -eps^(m-1)": correct exactly when dim K = m-1 (AUDIT68); Lean states the exponent as `Fintype.card n = dim K`. +2. GC kills need U >= 1 (U = 0, gap = 0 is not a contradiction); equality cases use INV (hinv hypothesis), the strict case only the upper bound. +3. h = 1 equality needs only `rank(R-E) < rank(1-E)`; it also uses K^2 = I, which `split_word` supplies from "K letters are commuting involutions" (the classes of the paper must be pairwise commuting involutions). +4. L1 needs J^2 = I (then M = D J = D J^-1 = g is one conjugated transvection); without it M != g. +5. Still INHERITED/unaudited: the model setting of SpecTS (what is a tight character, which jobs are H/K, the r = #flipped targets and b = #odd classes counts: r, b enter as `rank(1-D)`, `rank(1-K)`; for diagonal D use `SpecTSUR.rank_one_sub_diag`, for K use `K_data`). diff --git a/research/p104-lean-premises/lean/Nov15/SpecINV.lean b/research/p104-lean-premises/lean/Nov15/SpecINV.lean new file mode 100644 index 0000000000..2c1384c5e4 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecINV.lean @@ -0,0 +1,925 @@ +/- +SPECBREAK R43 Lemma INV (involution + unit rank) and Lemma SPLIT, Source: internal notes §1-5, AUDIT43.md. See SpecINV.md. +Builds on Nov15/SpecTSUR.lean (pp, zv, Zm, sum_ZY, UR_lower, ev/jobsP/uconj/ucount, UR_upper). +-/ +import Nov15.SpecTSUR +import Mathlib.LinearAlgebra.Matrix.SchurComplement +import Mathlib.FieldTheory.Finite.Basic + +open Matrix Finset SpecTSUR + +set_option linter.unusedSectionVars false + +namespace SpecINV + +variable {K : Type*} [Field K] + +/-! ## §1. Lemma INV -/ +section Inv +variable {n : Type*} [Fintype n] [DecidableEq n] + +theorem one_sub_pp (x y : ℕ → n → K) (U : ℕ) : + 1 - pp x y U = Zm x y U * (Matrix.of fun a (i : Fin U) => y i a)ᵀ := by + rw [pp_eq, sub_sub_cancel, sum_ZY] + +/-- **Lemma INV.** char ≠ 2; `g = T_0 ⋯ T_{U-1}` with `T_i = I - x_i y_iᵀ` (transvection, `y_i·x_i = 0`); +`g² = I` ⇒ `rank(I - g) ≤ U - 1`. (Only `y_0·x_0 = 0` is used: the first factor.) -/ +theorem inv_rank [DecidableEq K] (h2 : (2 : K) ≠ 0) (U : ℕ) (x y : ℕ → n → K) + (hq : ∀ i < U, y i ⬝ᵥ x i = 0) (hg : pp x y U * pp x y U = 1) : + (1 - pp x y U).rank ≤ U - 1 := by + rcases Nat.eq_zero_or_pos U with rfl | hU + · simp [pp] + set Z := Zm x y U with hZ + set Qm : Matrix n (Fin U) K := Matrix.of fun a (i : Fin U) => y i a with hQm + have hA : 1 - pp x y U = Z * Qmᵀ := one_sub_pp x y U + have hle : (1 - pp x y U).rank ≤ U := by + rw [hA] + exact (rank_mul_le_left _ _).trans (by simpa using Z.rank_le_card_width) + by_contra hcon + have hU' : (1 - pp x y U).rank = U := by omega + have hrZ : Z.rank = U := by + have h1 : (1 - pp x y U).rank ≤ Z.rank := by rw [hA]; exact rank_mul_le_left _ _ + have h3 : Z.rank ≤ U := by simpa using Z.rank_le_card_width + omega + have hrQ : Qm.rank = U := by + have h1 : (1 - pp x y U).rank ≤ Qmᵀ.rank := by rw [hA]; exact rank_mul_le_right _ _ + rw [Matrix.rank_transpose] at h1 + have h3 : Qm.rank ≤ U := by simpa using Qm.rank_le_card_width + omega + obtain ⟨L, hL⟩ := exists_left_inv Z hrZ + obtain ⟨L2, hL2⟩ := exists_left_inv Qm hrQ + have hR : Qmᵀ * L2ᵀ = 1 := by + rw [← Matrix.transpose_mul, hL2, Matrix.transpose_one] + have hsq : (1 - pp x y U) * (1 - pp x y U) = (1 - pp x y U) + (1 - pp x y U) := by + calc (1 - pp x y U) * (1 - pp x y U) + = 1 - pp x y U - pp x y U + pp x y U * pp x y U := by noncomm_ring + _ = _ := by rw [hg]; abel + have hmid : Qmᵀ * Z = 1 + 1 := by + have e1 : L * ((Z * Qmᵀ) * (Z * Qmᵀ)) * L2ᵀ = Qmᵀ * Z := by + calc L * ((Z * Qmᵀ) * (Z * Qmᵀ)) * L2ᵀ + = (L * Z) * (Qmᵀ * Z) * (Qmᵀ * L2ᵀ) := by simp only [Matrix.mul_assoc] + _ = _ := by rw [hL, hR]; simp + have e2 : L * ((Z * Qmᵀ) + (Z * Qmᵀ)) * L2ᵀ = 1 + 1 := by + calc L * ((Z * Qmᵀ) + (Z * Qmᵀ)) * L2ᵀ + = (L * Z) * (Qmᵀ * L2ᵀ) + (L * Z) * (Qmᵀ * L2ᵀ) := by + simp only [Matrix.mul_add, Matrix.add_mul, Matrix.mul_assoc] + _ = _ := by rw [hL, hR]; simp + rw [← e1, ← e2, ← hA, hsq] + have h00 := congrFun (congrFun hmid ⟨0, hU⟩) ⟨0, hU⟩ + have hz0 : zv x y 0 = x 0 := by simp [zv, pp] + have hdot : (Qmᵀ * Z) ⟨0, hU⟩ ⟨0, hU⟩ = y 0 ⬝ᵥ x 0 := by + simp only [Matrix.mul_apply, hQm, hZ, Zm, Matrix.transpose_apply, Matrix.of_apply, dotProduct] + simp [hz0] + rw [hdot, hq 0 hU] at h00 + simp only [Matrix.add_apply, Matrix.one_apply_eq] at h00 + apply h2 + linear_combination -h00 + + +/-! ### cons / shift: from a list of transvections to a `pp` product -/ + +/-- prepend a vector to a sequence -/ +def shift (a : n → K) (x : ℕ → n → K) : ℕ → n → K + | 0 => a + | j + 1 => x j + +theorem pp_shift (a b : n → K) (x y : ℕ → n → K) (m : ℕ) : + pp (shift a x) (shift b y) (m + 1) = refl a b * pp x y m := by + induction m with + | zero => simp [pp, shift] + | succ m ih => + rw [pp, ih, pp, Matrix.mul_assoc] + rfl + +theorem prod_units_pp (l : List (Matrix n n K)ˣ) + (h : ∀ t ∈ l, ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = refl a b) : + ∃ x y : ℕ → n → K, (∀ i < l.length, y i ⬝ᵥ x i = 0) ∧ + ((l.prod : (Matrix n n K)ˣ) : Matrix n n K) = pp x y l.length := by + induction l with + | nil => exact ⟨fun _ => 0, fun _ => 0, by simp, by simp [pp]⟩ + | cons t l ih => + obtain ⟨a, b, hab, ht⟩ := h t (by simp) + obtain ⟨x, y, hxy, hp⟩ := ih fun u hu => h u (by simp [hu]) + refine ⟨shift a x, shift b y, ?_, ?_⟩ + · intro i hi + cases i with + | zero => simpa [shift] using hab + | succ j => exact hxy j (by simpa using hi) + · simp only [List.prod_cons, Units.val_mul, List.length_cons] + rw [pp_shift, ht, hp] + +/-- conjugating a transvection by a unit gives a transvection -/ +theorem conj_form (P t : (Matrix n n K)ˣ) + (h : ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = refl a b) : + ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ ((P * t * P⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) = refl a b := by + obtain ⟨a, b, hab, ht⟩ := h + refine ⟨(P : Matrix n n K) *ᵥ a, b ᵥ* ((P⁻¹ : (Matrix n n K)ˣ) : Matrix n n K), ?_, ?_⟩ + · rw [Matrix.dotProduct_mulVec, Matrix.vecMul_vecMul] + have : ((P⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) * (P : Matrix n n K) = 1 := P.inv_mul + rw [this, Matrix.vecMul_one] + exact hab + · have hPP : (P : Matrix n n K) * ((P⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) = 1 := P.mul_inv + simp only [Units.val_mul, ht, SpecTSUR.refl, mul_sub, sub_mul, Matrix.mul_one, Matrix.mul_vecMulVec, + Matrix.vecMulVec_mul, hPP] + +end Inv + +/-! ## §2. INV for words, and the combined bound `d + |k - r₁| ≤ U - 1` -/ +section Word +variable {n : Type*} [Fintype n] [DecidableEq n] [DecidableEq K] + +theorem uconj_forms : ∀ (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) (pre : (Matrix n n K)ˣ), + (∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = refl a b) → + ∀ c ∈ uconj w pre, ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (c : Matrix n n K) = refl a b + | [], _, _ => by simp [uconj] + | .inl t :: w, pre, h => by + intro c hc + simp only [uconj, List.mem_cons] at hc + rcases hc with rfl | hc + · exact conj_form pre t (h t (by simp)) + · exact uconj_forms w pre (fun t ht => h t (by simp [ht])) c hc + | .inr j :: w, pre, h => by + exact uconj_forms w (pre * j) (fun t ht => h t (by simp [ht])) + +/-- **INV for words.** `g = ∏ (conjugated units)` is a product of `U` transvections; if `g² = I` then +`rank(I - g) ≤ U - 1`. -/ +theorem inv_word (h2 : (2 : K) ≠ 0) + (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = refl a b) + (hg : (((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K) * + (((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K) = 1) : + (1 - (((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K)).rank ≤ ucount w - 1 := by + obtain ⟨x, y, hxy, hp⟩ := prod_units_pp (uconj w 1) (uconj_forms w 1 hform) + rw [length_uconj] at hxy hp + rw [hp] at hg ⊢ + exact inv_rank h2 _ x y hxy hg + +/-- `D, J` commuting involutions ⇒ `rank(D - J) ≤ U - 1` (INV applied to `g = D J⁻¹`). -/ +theorem inv_DJ (h2 : (2 : K) ≠ 0) + (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = refl a b) + (hD2 : ev w * ev w = 1) (hJ2 : jobsP w * jobsP w = 1) (hc : ev w * jobsP w = jobsP w * ev w) : + (((ev w : (Matrix n n K)ˣ) : Matrix n n K) - ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K)).rank + ≤ ucount w - 1 := by + have h1 := ev_move w 1 + simp only [one_mul] at h1 + have hJinv : (jobsP w)⁻¹ = jobsP w := inv_eq_of_mul_eq_one_right hJ2 + have hgu : (uconj w 1).prod = ev w * jobsP w := by + have : (uconj w 1).prod = ev w * (jobsP w)⁻¹ := eq_mul_inv_of_mul_eq h1.symm + rw [this, hJinv] + have hg2 : (uconj w 1).prod * (uconj w 1).prod = 1 := by + rw [hgu] + calc ev w * jobsP w * (ev w * jobsP w) = ev w * (jobsP w * ev w) * jobsP w := by group + _ = ev w * (ev w * jobsP w) * jobsP w := by rw [hc] + _ = (ev w * ev w) * (jobsP w * jobsP w) := by group + _ = 1 := by rw [hD2, hJ2]; simp + have hg2' : (((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K) * + (((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K) = 1 := by + rw [← Units.val_mul, hg2]; rfl + have hINV := inv_word h2 w hform hg2' + have e : ((ev w : (Matrix n n K)ˣ) : Matrix n n K) - ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) = + -((1 - (((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K)) * + ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K)) := by + rw [h1]; simp [sub_mul] + rw [e, rank_neg_eq] + exact (rank_mul_le_left _ _).trans hINV + +end Word + +/-! ## §3. Corollary: `U ≥ 5` for the six R42 survivors -/ +section Cor +variable {n₁ nd : Type*} [Fintype n₁] [Fintype nd] [DecidableEq n₁] [DecidableEq nd] [DecidableEq K] + +/-- **Corollary (UR_lower + INV).** In the UR_combined setting, if moreover `D, J` are commuting +involutions and the units are transvections, then `d + |k - r₁| ≤ U - 1`. -/ +theorem UR_inv_combined (h2 : (2 : K) ≠ 0) (k : ℕ) (x y : ℕ → n₁ → K) + (hg : ∀ i < k, ∀ j < k, y i ⬝ᵥ x j = if i = j then 2 else 0) + (s₁ : n₁ → K) (sd : nd → K) (hs₁ : ∀ a, s₁ a = 1 ∨ s₁ a = -1) (hsd : ∀ a, sd a = 1 ∨ sd a = -1) + (w : List ((Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ ⊕ (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n₁ ⊕ nd → K, b ⬝ᵥ a = 0 ∧ + (t : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) = refl a b) + (hD : ((ev w : (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ) : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) = + fromBlocks (diagonal s₁) 0 0 (diagonal sd)) + (hJ : ((jobsP w : (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ) : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) = + fromBlocks (pp x y k) 0 0 1) + (hD2 : ev w * ev w = 1) (hJ2 : jobsP w * jobsP w = 1) (hc : ev w * jobsP w = jobsP w * ev w) : + (univ.filter fun a => sd a = -1).card + + ((k - (univ.filter fun a => s₁ a = -1).card) + ((univ.filter fun a => s₁ a = -1).card - k)) + ≤ ucount w - 1 := by + have hl := UR_lower h2 k x y hg s₁ sd hs₁ hsd + have hu := inv_DJ h2 w hform hD2 hJ2 hc + rw [hD, hJ] at hu + exact hl.trans hu + +/-- the arithmetic: bound `4` (both patterns of the six survivors) forces `U ≥ 5`. -/ +theorem six_arith (U d k r : ℕ) (hb : d + ((k - r) + (r - k)) ≤ U - 1) + (h : (d = 1 ∧ k = 3 ∧ r = 0) ∨ (d = 2 ∧ k = 3 ∧ r = 1)) : 5 ≤ U := by + rcases h with ⟨rfl, rfl, rfl⟩ | ⟨rfl, rfl, rfl⟩ <;> omega + +/-- **R26 #10-#14 (pattern d = 1, k = 3, r₁ = 0) and #8 (d = 2, k = 3, r₁ = 1)**: character data as +hypotheses; conclusion `5 ≤ U`, in particular `U = 3, 4` are impossible. -/ +theorem six_survivors (h2 : (2 : K) ≠ 0) (k : ℕ) (x y : ℕ → n₁ → K) + (hg : ∀ i < k, ∀ j < k, y i ⬝ᵥ x j = if i = j then 2 else 0) + (s₁ : n₁ → K) (sd : nd → K) (hs₁ : ∀ a, s₁ a = 1 ∨ s₁ a = -1) (hsd : ∀ a, sd a = 1 ∨ sd a = -1) + (w : List ((Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ ⊕ (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n₁ ⊕ nd → K, b ⬝ᵥ a = 0 ∧ + (t : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) = refl a b) + (hD : ((ev w : (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ) : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) = + fromBlocks (diagonal s₁) 0 0 (diagonal sd)) + (hJ : ((jobsP w : (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ) : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) = + fromBlocks (pp x y k) 0 0 1) + (hD2 : ev w * ev w = 1) (hJ2 : jobsP w * jobsP w = 1) (hc : ev w * jobsP w = jobsP w * ev w) + (hpat : ((univ.filter fun a => sd a = -1).card = 1 ∧ k = 3 ∧ + (univ.filter fun a => s₁ a = -1).card = 0) ∨ + ((univ.filter fun a => sd a = -1).card = 2 ∧ k = 3 ∧ + (univ.filter fun a => s₁ a = -1).card = 1)) : + 5 ≤ ucount w := + six_arith _ _ _ _ (UR_inv_combined h2 k x y hg s₁ sd hs₁ hsd w hform hD hJ hD2 hJ2 hc) hpat + +end Cor + +/-! ## §4. Lemma SPLIT (hub job `H` sharing a tight set with every other job) + +Tight sets + Lemma TS give the pairing hypotheses `y_H·x_j = 0 = y_j·x_H` (j ≠ H), `y_H·x_H = 2` +(taken as hypotheses below). -/ +section Split +variable {n : Type*} [Fintype n] [DecidableEq n] + +theorem refl_mulVec (a b v : n → K) : refl a b *ᵥ v = v - (b ⬝ᵥ v) • a := by + rw [SpecTSUR.refl, sub_mulVec, one_mulVec, vecMulVec_mulVec, op_smul_eq_smul] + +theorem vecMul_refl (a b v : n → K) : v ᵥ* refl a b = v - (v ⬝ᵥ a) • b := by + rw [SpecTSUR.refl, Matrix.vecMul_sub, Matrix.vecMul_one, vecMul_vecMulVec] + +/-- the hub vector `x_H`: the ordered product of the jobs sends it to `-x_H` if `H` is among the +first `k` jobs, else fixes it (all other jobs fix `x_H`, `y_H·x_H = 2`). -/ +theorem hub_mulVec (x y : ℕ → n → K) (h0 : ℕ) (hh : y h0 ⬝ᵥ x h0 = 2) (k0 : ℕ) + (hx : ∀ i, i < k0 → i ≠ h0 → y i ⬝ᵥ x h0 = 0) (k : ℕ) (hk0 : k ≤ k0) : + pp x y k *ᵥ x h0 = if h0 < k then -x h0 else x h0 := by + induction k with + | zero => simp [pp] + | succ k ih => + have ih := ih (by omega) + rw [pp, ← Matrix.mulVec_mulVec, refl_mulVec] + by_cases hk : k = h0 + · subst hk + rw [hh, show x k - (2 : K) • x k = -x k by module, Matrix.mulVec_neg, ih] + simp + · rw [hx k (by omega) hk, zero_smul, sub_zero, ih] + have : (h0 < k + 1) ↔ (h0 < k) := by omega + simp [this] + +/-- the hub functional `y_H`: `y_H ᵥ* (ordered product) = ∓ y_H`, so `ker y_H` is `J`-invariant. -/ +theorem hub_vecMul (x y : ℕ → n → K) (h0 : ℕ) (hh : y h0 ⬝ᵥ x h0 = 2) (k0 : ℕ) + (hy : ∀ i, i < k0 → i ≠ h0 → y h0 ⬝ᵥ x i = 0) (k : ℕ) (hk0 : k ≤ k0) : + y h0 ᵥ* pp x y k = (if h0 < k then (-1 : K) else 1) • y h0 := by + induction k with + | zero => simp [pp] + | succ k ih => + have ih := ih (by omega) + rw [pp, ← Matrix.vecMul_vecMul, ih, Matrix.smul_vecMul, vecMul_refl] + by_cases hk : k = h0 + · subst hk + rw [hh] + simp only [lt_self_iff_false, if_false, Nat.lt_succ_self, if_true] + module + · have hlt : (h0 < k + 1) ↔ (h0 < k) := by omega + simp [hy k (by omega) hk, hlt] + + +theorem det_refl (a b : n → K) : (refl a b).det = 1 - b ⬝ᵥ a := by + have : refl a b = 1 + replicateCol Unit (-a) * replicateRow Unit b := by + rw [← vecMulVec_eq Unit, SpecTSUR.refl, Matrix.neg_vecMulVec, sub_eq_add_neg] + rw [this, det_one_add_replicateCol_mul_replicateRow, dotProduct_neg] + ring + +/-- `det J = (-1)^k` for `k` reflections with `y_i·x_i = 2` -/ +theorem det_pp (x y : ℕ → n → K) (k : ℕ) (hy : ∀ i < k, y i ⬝ᵥ x i = 2) : + (pp x y k).det = (-1) ^ k := by + induction k with + | zero => simp [pp] + | succ k ih => + rw [pp, Matrix.det_mul, ih (fun i hi => hy i (by omega)), det_refl, hy k (by omega), pow_succ] + ring + +variable [DecidableEq K] + +theorem rank_zero_mulVec (M : Matrix n n K) (h : M.rank = 0) (v : n → K) : M *ᵥ v = 0 := by + have h0 := Submodule.finrank_eq_zero.1 (show Module.finrank K (LinearMap.range M.mulVecLin) = 0 from h) + have hv : M *ᵥ v ∈ LinearMap.range M.mulVecLin := ⟨v, rfl⟩ + rw [h0] at hv + simpa using hv + +theorem eps_mulVec (J : Matrix n n K) (h : n → K) (σ ε : K) (hJh : J *ᵥ h = σ • h) : + ((ε • 1 - J : Matrix n n K)) *ᵥ h = (ε - σ) • h := by + rw [sub_mulVec, Matrix.smul_mulVec, one_mulVec, hJh]; module + +/-- **SPLIT key.** If `rank(ε - J) ≤ 1` and `ε ≠ σ` then `ε - J` is the rank-one matrix +`((ε - σ)/2) x_H y_Hᵀ`. -/ +theorem split_key (h2 : (2 : K) ≠ 0) (J : Matrix n n K) (h η : n → K) (σ ε : K) + (hηh : η ⬝ᵥ h = 2) (hJh : J *ᵥ h = σ • h) (hηJ : η ᵥ* J = σ • η) + (hεσ : ε ≠ σ) (hr : ((ε • 1 - J : Matrix n n K)).rank ≤ 1) : + (ε • 1 - J : Matrix n n K) = vecMulVec (((ε - σ) / 2) • h) η := by + set M : Matrix n n K := ε • 1 - J with hM + have hMh : M *ᵥ h = (ε - σ) • h := eps_mulVec J h σ ε hJh + have hh0 : h ≠ 0 := by + rintro rfl + simp at hηh + exact h2 hηh.symm + have hεσ' : ε - σ ≠ 0 := sub_ne_zero.2 hεσ + have hw0 : M *ᵥ h ≠ 0 := by rw [hMh]; exact smul_ne_zero hεσ' hh0 + have hspan : Submodule.span K {M *ᵥ h} = LinearMap.range M.mulVecLin := by + apply Submodule.eq_of_le_of_finrank_le + · rw [Submodule.span_singleton_le_iff_mem]; exact ⟨h, rfl⟩ + · rw [finrank_span_singleton hw0]; exact hr + rw [Matrix.ext_iff_mulVec] + intro v + set v' : n → K := v - ((η ⬝ᵥ v) / 2) • h with hv'def + have hv' : η ⬝ᵥ v' = 0 := by + rw [hv'def, dotProduct_sub, dotProduct_smul, hηh] + simp only [smul_eq_mul]; field_simp; ring + have hMv' : M *ᵥ v' ∈ Submodule.span K {M *ᵥ h} := by rw [hspan]; exact ⟨v', rfl⟩ + obtain ⟨c, hc⟩ := Submodule.mem_span_singleton.1 hMv' + have hη0 : η ⬝ᵥ (M *ᵥ v') = 0 := by + rw [hM, sub_mulVec, dotProduct_sub, Matrix.smul_mulVec, one_mulVec, dotProduct_smul, + Matrix.dotProduct_mulVec, hηJ, smul_dotProduct, hv'] + simp + have hcc : c * ((ε - σ) * 2) = 0 := by + have := hη0 + rw [← hc, dotProduct_smul, hMh, dotProduct_smul, hηh] at this + simpa [smul_eq_mul, mul_assoc] using this + have hc0 : c = 0 := by + rcases mul_eq_zero.1 hcc with h | h + · exact h + · rcases mul_eq_zero.1 h with h | h + · exact absurd h hεσ' + · exact absurd h h2 + have hMv'0 : M *ᵥ v' = 0 := by rw [← hc, hc0, zero_smul] + have hv : v = v' + ((η ⬝ᵥ v) / 2) • h := by rw [hv'def]; abel + have hMv : M *ᵥ v = ((η ⬝ᵥ v) / 2) • ((ε - σ) • h) := by + conv_lhs => rw [hv] + rw [Matrix.mulVec_add, hMv'0, Matrix.mulVec_smul, hMh, zero_add] + rw [hMv, vecMulVec_mulVec] + simp only [op_smul_eq_smul, smul_smul, smul_eq_mul] + congr 1 + ring + +/-- determinant of the rank-one `J` produced by `split_key`: `det J · ε = σ ε^N`. -/ +theorem split_det (h2 : (2 : K) ≠ 0) (J : Matrix n n K) (h η : n → K) (σ ε : K) + (hηh : η ⬝ᵥ h = 2) (hε : ε ≠ 0) + (hM : (ε • 1 - J : Matrix n n K) = vecMulVec (((ε - σ) / 2) • h) η) : + J.det * ε = σ * ε ^ Fintype.card n := by + have hJ : J = ε • (1 + replicateCol Unit ((-((ε - σ) / 2 / ε)) • h) * replicateRow Unit η) := by + have h1 : J = ε • 1 - vecMulVec (((ε - σ) / 2) • h) η := by + rw [← hM]; abel + rw [← vecMulVec_eq Unit, h1] + ext i j + by_cases hij : i = j + · subst hij + simp only [Matrix.sub_apply, Matrix.smul_apply, Matrix.one_apply_eq, vecMulVec_apply, + Pi.smul_apply, smul_eq_mul, Matrix.add_apply, Pi.neg_apply] + field_simp + ring + · simp only [Matrix.sub_apply, Matrix.smul_apply, Matrix.one_apply_ne hij, vecMulVec_apply, + Pi.smul_apply, smul_eq_mul, Matrix.add_apply, Pi.neg_apply] + field_simp + ring + rw [hJ, Matrix.det_smul, det_one_add_replicateCol_mul_replicateRow, dotProduct_smul, hηh] + simp only [smul_eq_mul] + field_simp + ring + + +/-- **Lemma SPLIT (rank form).** Hub vector `h = x_H`, hub functional `η = y_H` (`η·h = 2`), `J h = σ h`, +`η J = σ η` (so `V = ⟨x_H⟩ ⊕ ker η`, both `J`-invariant). For a scalar `D = ε ≠ 0`: +`rank(ε - J) ≥ [x_H term: ε ≠ σ] + [det term: det J ≠ σ ε^{N-1}, written as `det J · ε ≠ σ ε^N`]`. -/ +theorem split_rank_ge (h2 : (2 : K) ≠ 0) (J : Matrix n n K) (h η : n → K) (σ ε : K) + (hηh : η ⬝ᵥ h = 2) (hJh : J *ᵥ h = σ • h) (hηJ : η ᵥ* J = σ • η) (hε : ε ≠ 0) : + (if ε ≠ σ then 1 else 0) + (if J.det * ε ≠ σ * ε ^ Fintype.card n then 1 else 0) + ≤ (ε • 1 - J : Matrix n n K).rank := by + have hh0 : h ≠ 0 := by + rintro rfl + simp at hηh + exact h2 hηh.symm + by_cases ha : ε = σ + · subst ha + by_cases hb : J.det * ε ≠ ε * ε ^ Fintype.card n + · simp only [ne_eq, not_true_eq_false, if_false, hb, not_false_eq_true, if_true, zero_add] + by_contra hcon + have h0 : (ε • 1 - J : Matrix n n K).rank = 0 := by omega + have hz : (ε • 1 - J : Matrix n n K) = 0 := + Matrix.ext_iff_mulVec.2 fun v => by simpa using rank_zero_mulVec _ h0 v + have hJ : J = ε • 1 := by rw [← sub_eq_zero, ← neg_sub, hz, neg_zero] + apply hb + rw [hJ, Matrix.det_smul]; simp; ring + · simp [hb] + · by_cases hb : J.det * ε ≠ σ * ε ^ Fintype.card n + · rw [if_pos ha, if_pos hb] + by_contra hcon + have hr : (ε • 1 - J : Matrix n n K).rank ≤ 1 := by omega + exact hb (split_det h2 J h η σ ε hηh hε (split_key h2 J h η σ ε hηh hJh hηJ ha hr)) + · rw [if_pos ha, if_neg hb] + by_contra hcon + have h0 : (ε • 1 - J : Matrix n n K).rank = 0 := by omega + have := rank_zero_mulVec _ h0 h + rw [eps_mulVec J h σ ε hJh] at this + exact smul_ne_zero (sub_ne_zero.2 ha) hh0 this + + +/-- hub data ⇒ `J h = σ h`, `η J = σ η` and `det J = (-1)^k` for `J = pp x y k`. -/ +theorem hub_data (x y : ℕ → n → K) (h0 k : ℕ) (hh : y h0 ⬝ᵥ x h0 = 2) + (hx : ∀ i, i < k → i ≠ h0 → y i ⬝ᵥ x h0 = 0) (hy : ∀ i, i < k → i ≠ h0 → y h0 ⬝ᵥ x i = 0) + (hk : ∀ i, i < k → y i ⬝ᵥ x i = 2) : + pp x y k *ᵥ x h0 = (if h0 < k then (-1 : K) else 1) • x h0 ∧ + y h0 ᵥ* pp x y k = (if h0 < k then (-1 : K) else 1) • y h0 ∧ + (pp x y k).det = (-1) ^ k := by + refine ⟨?_, hub_vecMul x y h0 hh k hy k le_rfl, det_pp x y k hk⟩ + rw [hub_mulVec x y h0 hh k hx k le_rfl] + split_ifs <;> simp + +end Split + +section SplitDJ +variable {n₁ nd : Type*} [Fintype n₁] [Fintype nd] [DecidableEq n₁] [DecidableEq nd] [DecidableEq K] + +/-- **SPLIT on `V₁ ⊕ dark`.** `D = ε ⊕ diag sd`, `J = (ordered product of the `k` active jobs) ⊕ I`; hub job +`h0` pairs trivially with all other active jobs. Then `rank(D - J) ≥ d + [ε ≠ σ] + [det term]`, +`σ = -1` iff `H` is active. -/ +theorem split_DJ_rank (h2 : (2 : K) ≠ 0) (k : ℕ) (x y : ℕ → n₁ → K) (h0 : ℕ) + (hh : y h0 ⬝ᵥ x h0 = 2) + (hx : ∀ i, i < k → i ≠ h0 → y i ⬝ᵥ x h0 = 0) (hy : ∀ i, i < k → i ≠ h0 → y h0 ⬝ᵥ x i = 0) + (hk : ∀ i, i < k → y i ⬝ᵥ x i = 2) (ε : K) (hε : ε = 1 ∨ ε = -1) + (sd : nd → K) (hsd : ∀ a, sd a = 1 ∨ sd a = -1) : + (univ.filter fun a => sd a = -1).card + + ((if ε ≠ (if h0 < k then (-1 : K) else 1) then 1 else 0) + + (if (-1) ^ k * ε ≠ (if h0 < k then (-1 : K) else 1) * ε ^ Fintype.card n₁ then 1 else 0)) + ≤ (fromBlocks (ε • (1 : Matrix n₁ n₁ K)) 0 0 (diagonal sd) - + fromBlocks (pp x y k) 0 0 1).rank := by + have hε0 : ε ≠ 0 := by rcases hε with rfl | rfl <;> simp + obtain ⟨h1, h2', h3⟩ := hub_data x y h0 k hh hx hy hk + have hsp := split_rank_ge h2 (pp x y k) (x h0) (y h0) _ ε hh h1 h2' hε0 + rw [h3] at hsp + have hBr : ((diagonal sd : Matrix nd nd K) - 1).rank = (univ.filter fun a => sd a = -1).card := by + rw [← neg_sub, rank_neg_eq]; exact rank_one_sub_diag h2 sd hsd + have eD : fromBlocks (ε • (1 : Matrix n₁ n₁ K)) 0 0 (diagonal sd) - fromBlocks (pp x y k) 0 0 1 = + fromBlocks (ε • 1 - pp x y k) 0 0 (diagonal sd - 1) := by + ext (i | i) (j | j) <;> simp + rw [eD] + have := rank_fromBlocks_diag_ge (ε • 1 - pp x y k) ((diagonal sd : Matrix nd nd K) - 1) + omega + +/-- **R26 #2 (hub E) and #3 (hub F)**, `d = 2` dark targets, `V₁` of dimension 3. The surviving +characters are of two shapes: `H ∉ S` (`k = 3`, `ε = -1`, `H` index ≥ k; μ = 1, 6 resp. 9, 14) and +`H ∈ S` (`k = 4`, `ε = +1`; μ = 11, 12). Character data as hypotheses; `rank(D - J) ≥ 4`, so `U ≥ 4` +(`U = 3` dead). -/ +theorem split_R26_2_3 (h2 : (2 : K) ≠ 0) (hcard : Fintype.card n₁ = 3) (k : ℕ) + (x y : ℕ → n₁ → K) (h0 : ℕ) (hh : y h0 ⬝ᵥ x h0 = 2) + (hx : ∀ i, i < k → i ≠ h0 → y i ⬝ᵥ x h0 = 0) (hy : ∀ i, i < k → i ≠ h0 → y h0 ⬝ᵥ x i = 0) + (hk : ∀ i, i < k → y i ⬝ᵥ x i = 2) (ε : K) (sd : nd → K) (hsd : ∀ a, sd a = 1 ∨ sd a = -1) + (hd : (univ.filter fun a => sd a = -1).card = 2) + (hpat : (k = 3 ∧ 3 ≤ h0 ∧ ε = -1) ∨ (k = 4 ∧ h0 < 4 ∧ ε = 1)) : + 4 ≤ (fromBlocks (ε • (1 : Matrix n₁ n₁ K)) 0 0 (diagonal sd) - + fromBlocks (pp x y k) 0 0 1).rank := by + have hε : ε = 1 ∨ ε = -1 := by rcases hpat with ⟨_, _, h⟩ | ⟨_, _, h⟩ <;> simp [h] + have hb := split_DJ_rank h2 k x y h0 hh hx hy hk ε hε sd hsd + have hne : (1 : K) ≠ -1 := by intro h; apply h2; linear_combination h + have hne' : (-1 : K) ≠ 1 := fun h => hne h.symm + rw [hd, hcard] at hb + rcases hpat with ⟨rfl, h3, rfl⟩ | ⟨rfl, h4, rfl⟩ + · have hlt : ¬ h0 < 3 := by omega + have hA : (-1 : K) ≠ 1 := hne' + have hB : (-1 : K) ^ 3 * -1 ≠ 1 * (-1) ^ 3 := by + intro h; apply h2; linear_combination h + rw [if_neg hlt, if_pos hA, if_pos hB] at hb + omega + · have hA : (1 : K) ≠ -1 := hne + have hB : (-1 : K) ^ 4 * 1 ≠ -1 * 1 ^ 3 := by + intro h; apply h2; linear_combination h + rw [if_pos h4, if_pos hA, if_pos hB] at hb + omega + +end SplitDJ + +/-! ## §5. The `U = 4` equality step (R43 item 4, audit §3): `K` of dimension 2, eigenvalues `ε` and +`det/ε` distinct ⇒ `J_K` involution ⇒ `g` involution ⇒ INV. Formalised in coordinates adapted to +`V₁ = ⟨x_H⟩ ⊕ K` (`Fin 1 ⊕ Fin 2`), where `J = σ ⊕ J_K ⊕ I_dark`. -/ +section Equality +variable [DecidableEq K] + +/-- a `2×2` matrix with `det = -1` and `rank(ε - J) ≤ 1`, `ε = ±1`, is an involution. -/ +theorem two_by_two_invol (h2 : (2 : K) ≠ 0) (J : Matrix (Fin 2) (Fin 2) K) (ε : K) + (hε : ε = 1 ∨ ε = -1) (hdet : J.det = -1) (hr : (ε • 1 - J : Matrix (Fin 2) (Fin 2) K).rank ≤ 1) : + J * J = 1 := by + have hε2 : ε * ε = 1 := by rcases hε with rfl | rfl <;> norm_num + have hd0 : (ε • 1 - J : Matrix (Fin 2) (Fin 2) K).det = 0 := by + by_contra hne + have hu : IsUnit (ε • 1 - J : Matrix (Fin 2) (Fin 2) K) := + (Matrix.isUnit_iff_isUnit_det _).2 (isUnit_iff_ne_zero.2 hne) + have := Matrix.rank_of_isUnit _ hu + simp at this + omega + rw [Matrix.det_fin_two] at hd0 hdet + simp only [Matrix.sub_apply, Matrix.smul_apply, Matrix.one_apply_eq, Matrix.one_apply_ne, + ne_eq, Fin.zero_eq_one_iff, OfNat.ofNat_ne_one, not_false_eq_true, Fin.one_eq_zero_iff, + smul_eq_mul, mul_one, mul_zero, zero_sub] at hd0 + have hkey : ε * (J 0 0 + J 1 1) = 0 := by linear_combination (-1) * hd0 + hε2 + hdet + have hsum : J 0 0 + J 1 1 = 0 := by + have : ε ≠ 0 := by rintro rfl; simp at hε2 + exact (mul_eq_zero.1 hkey).resolve_left this + ext i j + fin_cases i <;> fin_cases j <;> simp [Matrix.mul_apply, Fin.sum_univ_two] + · linear_combination (J 0 0) * hsum - hdet + · linear_combination (J 0 1) * hsum + · linear_combination (J 1 0) * hsum + · linear_combination (J 1 1) * hsum - hdet + + +theorem rank_scalar_one (c : K) (hc : c ≠ 0) : + ((c • 1 : Matrix (Fin 1) (Fin 1) K)).rank = 1 := by + have hu : IsUnit (c • 1 : Matrix (Fin 1) (Fin 1) K) := by + rw [Matrix.isUnit_iff_isUnit_det]; simp [hc] + simpa using Matrix.rank_of_isUnit _ hu + +theorem rank_ge_one_of_ne (JK : Matrix (Fin 2) (Fin 2) K) (ε : K) (hb : JK.det ≠ ε ^ 2) : + 1 ≤ (ε • 1 - JK : Matrix (Fin 2) (Fin 2) K).rank := by + by_contra hcon + have h0 : (ε • 1 - JK : Matrix (Fin 2) (Fin 2) K).rank = 0 := by omega + have hz : (ε • 1 - JK : Matrix (Fin 2) (Fin 2) K) = 0 := + Matrix.ext_iff_mulVec.2 fun v => by simpa using rank_zero_mulVec _ h0 v + have hJ : JK = ε • 1 := by rw [← sub_eq_zero, ← neg_sub, hz, neg_zero] + apply hb + rw [hJ, Matrix.det_smul]; simp + +section U4 +variable {nd : Type*} [Fintype nd] [DecidableEq nd] + +/-- **LEMMA SPLIT, `U = 4` equality step** (R26 #2 / #3, `d = 2`), in coordinates adapted to +`V₁ = ⟨x_H⟩ ⊕ K` (`Fin 1 ⊕ Fin 2`): `D = ε ⊕ diag sd`, `J = (σ ⊕ J_K) ⊕ I`, `ε ≠ σ` (x_H term), +`det J_K ≠ ε^{dim K}` (det term). If `U = d + 2` the word cannot exist: the slack forces +`rank(ε - J_K) ≤ 1`, so `J_K² = I` (`two_by_two_invol`), `g` is an involution, and INV gives +`rank(D - J) ≤ U - 1 = d + 1 < d + 2`. -/ +theorem split_U4 (h2 : (2 : K) ≠ 0) (σ ε : K) (hσ : σ = 1 ∨ σ = -1) (hε : ε = 1 ∨ ε = -1) + (hεσ : ε ≠ σ) (JK : Matrix (Fin 2) (Fin 2) K) (hdetK : JK.det = 1 ∨ JK.det = -1) + (hb : JK.det ≠ ε ^ 2) (sd : nd → K) (hsd : ∀ a, sd a = 1 ∨ sd a = -1) + (w : List ((Matrix ((Fin 1 ⊕ Fin 2) ⊕ nd) ((Fin 1 ⊕ Fin 2) ⊕ nd) K)ˣ ⊕ + (Matrix ((Fin 1 ⊕ Fin 2) ⊕ nd) ((Fin 1 ⊕ Fin 2) ⊕ nd) K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : (Fin 1 ⊕ Fin 2) ⊕ nd → K, b ⬝ᵥ a = 0 ∧ + (t : Matrix ((Fin 1 ⊕ Fin 2) ⊕ nd) ((Fin 1 ⊕ Fin 2) ⊕ nd) K) = refl a b) + (hD : ((ev w : (Matrix ((Fin 1 ⊕ Fin 2) ⊕ nd) ((Fin 1 ⊕ Fin 2) ⊕ nd) K)ˣ) : + Matrix ((Fin 1 ⊕ Fin 2) ⊕ nd) ((Fin 1 ⊕ Fin 2) ⊕ nd) K) = + fromBlocks (ε • (1 : Matrix (Fin 1 ⊕ Fin 2) (Fin 1 ⊕ Fin 2) K)) 0 0 (diagonal sd)) + (hJ : ((jobsP w : (Matrix ((Fin 1 ⊕ Fin 2) ⊕ nd) ((Fin 1 ⊕ Fin 2) ⊕ nd) K)ˣ) : + Matrix ((Fin 1 ⊕ Fin 2) ⊕ nd) ((Fin 1 ⊕ Fin 2) ⊕ nd) K) = + fromBlocks (fromBlocks (σ • (1 : Matrix (Fin 1) (Fin 1) K)) 0 0 JK) 0 0 1) : + ucount w ≠ (univ.filter fun a => sd a = -1).card + 2 := by + intro hU + have hσσ : σ * σ = 1 := by rcases hσ with rfl | rfl <;> norm_num + have hεε : ε * ε = 1 := by rcases hε with rfl | rfl <;> norm_num + have hsd2 : ∀ a, sd a * sd a = 1 := fun a => by rcases hsd a with h | h <;> rw [h] <;> norm_num + have hε0 : ε ≠ 0 := by rintro rfl; simp at hεε + have hεσ' : ε - σ ≠ 0 := sub_ne_zero.2 hεσ + have hunits : ∀ t, Sum.inl t ∈ w → ((t : Matrix ((Fin 1 ⊕ Fin 2) ⊕ nd) ((Fin 1 ⊕ Fin 2) ⊕ nd) K) - 1).rank ≤ 1 := by + intro t ht + obtain ⟨a, b, -, hab⟩ := hform t ht + have : (t : Matrix ((Fin 1 ⊕ Fin 2) ⊕ nd) ((Fin 1 ⊕ Fin 2) ⊕ nd) K) - 1 = -vecMulVec a b := by + rw [hab, SpecTSUR.refl]; abel + rw [this, rank_neg_eq] + exact rank_vecMulVec_le a b + have hup := UR_upper w hunits + rw [hD, hJ, hU] at hup + have hBr : ((diagonal sd : Matrix nd nd K) - 1).rank = (univ.filter fun a => sd a = -1).card := by + rw [← neg_sub, rank_neg_eq]; exact rank_one_sub_diag h2 sd hsd + have e1 : (ε • (1 : Matrix (Fin 1 ⊕ Fin 2) (Fin 1 ⊕ Fin 2) K) - + fromBlocks (σ • (1 : Matrix (Fin 1) (Fin 1) K)) 0 0 JK) = + fromBlocks ((ε - σ) • (1 : Matrix (Fin 1) (Fin 1) K)) 0 0 (ε • 1 - JK) := by + ext (i | i) (j | j) <;> simp [Matrix.one_apply, sub_smul] + have eD : fromBlocks (ε • (1 : Matrix (Fin 1 ⊕ Fin 2) (Fin 1 ⊕ Fin 2) K)) 0 0 (diagonal sd) - + fromBlocks (fromBlocks (σ • (1 : Matrix (Fin 1) (Fin 1) K)) 0 0 JK) 0 0 1 = + fromBlocks (fromBlocks ((ε - σ) • (1 : Matrix (Fin 1) (Fin 1) K)) 0 0 (ε • 1 - JK)) 0 0 + (diagonal sd - 1) := by + rw [← e1]; ext (i | i) (j | j) <;> simp + have hr1 := rank_fromBlocks_diag_ge ((ε - σ) • (1 : Matrix (Fin 1) (Fin 1) K)) (ε • 1 - JK) + have hr2 := rank_fromBlocks_diag_ge + (fromBlocks ((ε - σ) • (1 : Matrix (Fin 1) (Fin 1) K)) 0 0 (ε • 1 - JK)) + ((diagonal sd : Matrix nd nd K) - 1) + rw [eD] at hup + have hr3 := rank_scalar_one (ε - σ) hεσ' + have hK1 : (ε • 1 - JK : Matrix (Fin 2) (Fin 2) K).rank ≤ 1 := by omega + have hdet : JK.det = -1 := by + rcases hdetK with h | h + · exfalso; apply hb; rw [h]; rcases hε with rfl | rfl <;> norm_num + · exact h + have hJK : JK * JK = 1 := two_by_two_invol h2 JK ε hε hdet hK1 + have hJ2 : jobsP w * jobsP w = 1 := by + apply Units.ext + rw [Units.val_mul, hJ] + simp [Matrix.fromBlocks_multiply, hJK, smul_smul, hσσ] + have hD2 : ev w * ev w = 1 := by + apply Units.ext + rw [Units.val_mul, hD] + simp only [Matrix.fromBlocks_multiply, Matrix.zero_mul, Matrix.mul_zero, add_zero, + Matrix.smul_mul, Matrix.mul_smul, Matrix.one_mul, smul_smul, hεε, one_smul, + Matrix.diagonal_mul_diagonal] + have : (fun a => sd a * sd a) = fun _ => (1 : K) := funext hsd2 + simp [this] + have hc : ev w * jobsP w = jobsP w * ev w := by + apply Units.ext + rw [Units.val_mul, Units.val_mul, hD, hJ] + simp [Matrix.fromBlocks_multiply, Matrix.smul_mul, Matrix.mul_smul] + have hinv := inv_DJ h2 w hform hD2 hJ2 hc + rw [hD, hJ, hU] at hinv + have hne : 1 ≤ (ε • 1 - JK : Matrix (Fin 2) (Fin 2) K).rank := rank_ge_one_of_ne JK ε hb + rw [eD] at hinv + omega + +end U4 +end Equality + +/-! ## §6. Necessity of the hypotheses (counterexamples) -/ +section Sanity +open Matrix + +instance : Fact (Nat.Prime 2) := ⟨Nat.prime_two⟩ + +/-- `y·x = 0` cannot be dropped: `1 - 2·[1]` over ℚ (`n = Fin 1`) is an involution with +`rank(I - g) = 1 > U - 1 = 0`. -/ +theorem inv_needs_transvection : ∃ (x y : ℕ → Fin 1 → ℚ), + y 0 ⬝ᵥ x 0 ≠ 0 ∧ pp x y 1 * pp x y 1 = 1 ∧ ¬ (1 - pp x y 1).rank ≤ 1 - 1 := by + refine ⟨fun _ => ![1], fun _ => ![2], by simp [dotProduct], ?_, ?_⟩ + · ext i j; fin_cases i; fin_cases j + simp [pp, SpecTSUR.refl, Matrix.mul_apply, vecMulVec_apply]; norm_num + · intro h + have h0 : (1 - pp (fun _ => ![1]) (fun _ => (![2] : Fin 1 → ℚ)) 1 : Matrix (Fin 1) (Fin 1) ℚ).rank = 0 := by + omega + have := rank_zero_mulVec _ h0 ![1] + have h1 := congrFun this 0 + simp [pp, SpecTSUR.refl, mulVec, dotProduct, vecMulVec_apply] at h1 + +/-- `char ≠ 2` cannot be dropped: over `ZMod 2`, `x = e₀, y = e₁` (`y·x = 0`), `g = I - x yᵀ` is an +involution with `rank(I - g) = 1 > U - 1 = 0`. -/ +theorem inv_needs_char : ∃ (x y : ℕ → Fin 2 → ZMod 2), + y 0 ⬝ᵥ x 0 = 0 ∧ pp x y 1 * pp x y 1 = 1 ∧ ¬ (1 - pp x y 1).rank ≤ 1 - 1 := by + refine ⟨fun _ => ![1, 0], fun _ => ![0, 1], by simp [dotProduct, Fin.sum_univ_two], ?_, ?_⟩ + · ext i j; fin_cases i <;> fin_cases j <;> + simp [pp, SpecTSUR.refl, Matrix.mul_apply, vecMulVec_apply, Fin.sum_univ_two] <;> decide + · intro h + have h0 : (1 - pp (fun _ => (![1, 0] : Fin 2 → ZMod 2)) (fun _ => (![0, 1] : Fin 2 → ZMod 2)) 1 : + Matrix (Fin 2) (Fin 2) (ZMod 2)).rank = 0 := by omega + have := rank_zero_mulVec _ h0 ![0, 1] + have h1 := congrFun this 0 + simp [pp, SpecTSUR.refl, mulVec, dotProduct, vecMulVec_apply, Fin.sum_univ_two] at h1 + +end Sanity + +/-! ## §7. `split_U4` basis-free: the change of basis +`split_U4` is stated in coordinates adapted to `V₁ = ⟨x_H⟩ ⊕ K ⊕ dark`. Here: `Phi B` (coordinates in a +basis `B` of `n → K`, an algebra equivalence), transport of words (`mapW`), the adapted-basis form +`split_U4_basis`, and the basis-free form `split_U4_free`, which BUILDS the adapted basis from the +decomposition `DirectSum.IsInternal ![A, K₀, W]`. -/ +section BasisFree +open Module + +section BasisChange +variable {n : Type*} [Fintype n] [DecidableEq n] {ι : Type*} [Fintype ι] [DecidableEq ι] + +/-- coordinates of a matrix in the basis `B` of `n → K` -/ +noncomputable def Phi (B : Basis ι K (n → K)) : Matrix n n K ≃ₐ[K] Matrix ι ι K := + (Matrix.toLinAlgEquiv' (R := K) (n := n)).trans (LinearMap.toMatrixAlgEquiv B) + +theorem Phi_apply (B : Basis ι K (n → K)) (M : Matrix n n K) (i j : ι) : + Phi B M i j = B.repr (M *ᵥ B j) i := by + simp [Phi, LinearMap.toMatrixAlgEquiv_apply, LinearMap.toMatrix_apply] + + +theorem Phi_of_eigen (B : Basis ι K (n → K)) (M : Matrix n n K) (c : ι → K) + (h : ∀ j, M *ᵥ B j = c j • B j) : Phi B M = diagonal c := by + ext i j + rw [Phi_apply, h, map_smul] + by_cases hij : i = j + · subst hij; simp + · simp [Matrix.diagonal_apply, Finsupp.single_apply, hij, Ne.symm hij] + +theorem Phi_refl (B : Basis ι K (n → K)) (a β : n → K) : + Phi B (refl a β) = refl (fun i => B.repr a i) (fun j => β ⬝ᵥ B j) := by + ext i j + rw [Phi_apply, refl_mulVec] + simp [SpecTSUR.refl, vecMulVec_apply, Matrix.one_apply, Finsupp.single_apply, eq_comm, mul_comm] + +theorem dot_Phi (B : Basis ι K (n → K)) (a β : n → K) : + (fun j => β ⬝ᵥ B j) ⬝ᵥ (fun i => B.repr a i) = β ⬝ᵥ a := by + have h1 : β ⬝ᵥ a = ∑ i, B.repr a i * (β ⬝ᵥ B i) := by + conv_lhs => rw [← B.sum_repr a] + rw [dotProduct_sum]; simp [dotProduct_smul] + rw [h1]; simp [dotProduct, mul_comm] + + +/-! word transport along a monoid hom -/ +def mapW {G H : Type*} (f : G → H) : List (G ⊕ G) → List (H ⊕ H) + | [] => [] + | .inl a :: w => .inl (f a) :: mapW f w + | .inr a :: w => .inr (f a) :: mapW f w + +theorem ev_mapW {G H : Type*} [Group G] [Group H] (f : G →* H) : + ∀ w : List (G ⊕ G), ev (mapW f w) = f (ev w) + | [] => by simp [mapW, ev] + | .inl a :: w => by simp [mapW, ev, ev_mapW f w] + | .inr a :: w => by simp [mapW, ev, ev_mapW f w] + +theorem jobsP_mapW {G H : Type*} [Group G] [Group H] (f : G →* H) : + ∀ w : List (G ⊕ G), jobsP (mapW f w) = f (jobsP w) + | [] => by simp [mapW, jobsP] + | .inl a :: w => by simp [mapW, jobsP, jobsP_mapW f w] + | .inr a :: w => by simp [mapW, jobsP, jobsP_mapW f w] + +theorem ucount_mapW {G H : Type*} (f : G → H) : + ∀ w : List (G ⊕ G), ucount (mapW f w) = ucount w + | [] => by simp [mapW, ucount] + | .inl a :: w => by simp [mapW, ucount, ucount_mapW f w] + | .inr a :: w => by simp [mapW, ucount, ucount_mapW f w] + +theorem mem_mapW {G H : Type*} (f : G → H) : + ∀ (w : List (G ⊕ G)) (t' : H), Sum.inl t' ∈ mapW f w → ∃ t, Sum.inl t ∈ w ∧ t' = f t + | [], t', h => by simp [mapW] at h + | .inl a :: w, t', h => by + simp only [mapW, List.mem_cons, Sum.inl.injEq, reduceCtorEq, or_false] at h + rcases h with h | h + · exact ⟨a, by simp, h⟩ + · obtain ⟨t, ht, e⟩ := mem_mapW f w t' h + exact ⟨t, by simp [ht], e⟩ + | .inr a :: w, t', h => by + simp only [mapW, List.mem_cons, reduceCtorEq, false_or] at h + obtain ⟨t, ht, e⟩ := mem_mapW f w t' h + exact ⟨t, by simp [ht], e⟩ + + +end BasisChange + +section BasisU4 +variable {n : Type*} [Fintype n] [DecidableEq n] {nd : Type*} [Fintype nd] [DecidableEq nd] [DecidableEq K] + +theorem split_U4_basis (h2 : (2 : K) ≠ 0) (σ ε : K) (hσ : σ = 1 ∨ σ = -1) (hε : ε = 1 ∨ ε = -1) + (hεσ : ε ≠ σ) (B : Basis ((Fin 1 ⊕ Fin 2) ⊕ nd) K (n → K)) + (JK : Matrix (Fin 2) (Fin 2) K) (hdetK : JK.det = 1 ∨ JK.det = -1) + (hb : JK.det ≠ ε ^ 2) (sd : nd → K) (hsd : ∀ a, sd a = 1 ∨ sd a = -1) + (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = refl a b) + (hD1 : ∀ i, ((ev w : (Matrix n n K)ˣ) : Matrix n n K) *ᵥ B (Sum.inl i) = ε • B (Sum.inl i)) + (hD2 : ∀ a, ((ev w : (Matrix n n K)ˣ) : Matrix n n K) *ᵥ B (Sum.inr a) = sd a • B (Sum.inr a)) + (hJ1 : ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) *ᵥ B (Sum.inl (Sum.inl 0)) = σ • B (Sum.inl (Sum.inl 0))) + (hJ2 : ∀ j, ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) *ᵥ B (Sum.inl (Sum.inr j)) = + ∑ i, JK i j • B (Sum.inl (Sum.inr i))) + (hJ3 : ∀ a, ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) *ᵥ B (Sum.inr a) = B (Sum.inr a)) : + ucount w ≠ (univ.filter fun a => sd a = -1).card + 2 := by + let f : (Matrix n n K)ˣ →* (Matrix ((Fin 1 ⊕ Fin 2) ⊕ nd) ((Fin 1 ⊕ Fin 2) ⊕ nd) K)ˣ := + Units.map (Phi B : Matrix n n K →* _) + have hf : ∀ u : (Matrix n n K)ˣ, (f u : Matrix _ _ K) = Phi B (u : Matrix n n K) := fun u => rfl + have key := split_U4 h2 σ ε hσ hε hεσ JK hdetK hb sd hsd (mapW f w) ?_ ?_ ?_ + · rwa [ucount_mapW] at key + · intro t' ht' + obtain ⟨t, ht, rfl⟩ := mem_mapW f w t' ht' + obtain ⟨a, β, hβ, hab⟩ := hform t ht + refine ⟨fun i => B.repr a i, fun j => β ⬝ᵥ B j, ?_, ?_⟩ + · rw [dot_Phi]; exact hβ + · rw [hf, hab, Phi_refl] + · rw [ev_mapW, hf] + have := Phi_of_eigen B ((ev w : (Matrix n n K)ˣ) : Matrix n n K) (Sum.elim (fun _ => ε) sd) (by + rintro (i | a) + · simpa using hD1 i + · simpa using hD2 a) + rw [this] + ext (i | i) (j | j) <;> simp [Matrix.diagonal_apply, Matrix.one_apply] + · rw [jobsP_mapW, hf] + ext i j + rw [Phi_apply] + rcases j with (j | j) | j + · obtain rfl : j = 0 := Subsingleton.elim _ _ + rw [hJ1] + rcases i with (i | i) | i + · obtain rfl : i = 0 := Subsingleton.elim _ _ + simp + · simp + · simp + · rw [hJ2] + rcases i with (i | i) | i + · simp + · simp [Finsupp.single_apply] + fin_cases i <;> simp + · simp + · rw [hJ3] + rcases i with (i | i) | i + · simp + · simp + · simp [Finsupp.single_apply, Matrix.one_apply, eq_comm] + +end BasisU4 + +/-! ### From a direct-sum decomposition to an adapted basis -/ +section Free +variable {n : Type*} [Fintype n] [DecidableEq n] {nd : Type} [Fintype nd] [DecidableEq nd] [DecidableEq K] + +/-- index bookkeeping: `(Fin 1 ⊕ Fin 2) ⊕ nd ≃ Σ i : Fin 3, ![Fin 1, Fin 2, nd] i` -/ +def idxEquiv (nd : Type) : ((Fin 1 ⊕ Fin 2) ⊕ nd) ≃ Σ i : Fin 3, (![Fin 1, Fin 2, nd] i) where + toFun := Sum.elim (Sum.elim (fun a => ⟨0, a⟩) (fun a => ⟨1, a⟩)) (fun a => ⟨2, a⟩) + invFun := fun p => match p with + | ⟨0, a⟩ => Sum.inl (Sum.inl a) + | ⟨1, a⟩ => Sum.inl (Sum.inr a) + | ⟨2, a⟩ => Sum.inr a + left_inv := by rintro ((a | a) | a) <;> rfl + right_inv := by rintro ⟨i, a⟩; fin_cases i <;> rfl + + +/-- **`split_U4`, basis-free.** `V = A ⊕ K₀ ⊕ W` (`DirectSum.IsInternal ![A, K₀, W]`), `A = ⟨x_H⟩` of +dimension 1, `K₀` of dimension 2, `V₁ = A ⊕ K₀`; `D = ev w` is `ε` on `V₁` and has the ±1 eigenbasis +`bW` (eigenvalues `sd`) on the dark part `W`; `J = jobsP w` is `σ` on `A`, preserves `K₀`, and is the +identity on `W`. The `x_H` term `ε ≠ σ` and the det term `det(J|K₀) ≠ ε²` are the hypotheses of +`split_U4`; then `U ≠ d + 2`, `d = #{sd = -1}`. The adapted basis is built from the decomposition. -/ +theorem split_U4_free (h2 : (2 : K) ≠ 0) (σ ε : K) (hσ : σ = 1 ∨ σ = -1) (hε : ε = 1 ∨ ε = -1) + (hεσ : ε ≠ σ) (A K0 W : Submodule K (n → K)) (hint : DirectSum.IsInternal ![A, K0, W]) + (hA : Module.finrank K A = 1) (hK0 : Module.finrank K K0 = 2) + (bW : Module.Basis nd K W) (sd : nd → K) (hsd : ∀ a, sd a = 1 ∨ sd a = -1) + (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (hform : ∀ t, Sum.inl t ∈ w → ∃ a b : n → K, b ⬝ᵥ a = 0 ∧ (t : Matrix n n K) = refl a b) + (D J : Matrix n n K) (hD : ((ev w : (Matrix n n K)ˣ) : Matrix n n K) = D) + (hJ : ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) = J) + (hDA : ∀ v ∈ A, D *ᵥ v = ε • v) (hDK : ∀ v ∈ K0, D *ᵥ v = ε • v) + (hDW : ∀ a, D *ᵥ (bW a : n → K) = sd a • (bW a : n → K)) + (hJA : ∀ v ∈ A, J *ᵥ v = σ • v) (hJK : ∀ v ∈ K0, J.mulVecLin v ∈ K0) + (hJW : ∀ v ∈ W, J *ᵥ v = v) + (hdetK : LinearMap.det (J.mulVecLin.restrict hJK) = 1 ∨ LinearMap.det (J.mulVecLin.restrict hJK) = -1) + (hb : LinearMap.det (J.mulVecLin.restrict hJK) ≠ ε ^ 2) : + ucount w ≠ (univ.filter fun a => sd a = -1).card + 2 := by + classical + let bA : Module.Basis (Fin 1) K A := Module.finBasisOfFinrankEq K A hA + let bK : Module.Basis (Fin 2) K K0 := Module.finBasisOfFinrankEq K K0 hK0 + let vb : ∀ i : Fin 3, Module.Basis (![Fin 1, Fin 2, nd] i) K (![A, K0, W] i) := fun i => + match i with + | 0 => bA + | 1 => bK + | 2 => bW + let b' := hint.collectedBasis vb + let B : Module.Basis ((Fin 1 ⊕ Fin 2) ⊕ nd) K (n → K) := b'.reindex (idxEquiv nd).symm + have hB : ∀ j, B j = b' (idxEquiv nd j) := fun j => by simp [B] + let fK := J.mulVecLin.restrict hJK + let JK : Matrix (Fin 2) (Fin 2) K := LinearMap.toMatrix bK bK fK + have hJKdet : JK.det = LinearMap.det fK := LinearMap.det_toMatrix bK fK + refine split_U4_basis h2 σ ε hσ hε hεσ B JK (by rw [hJKdet]; exact hdetK) + (by rw [hJKdet]; exact hb) sd hsd w hform ?_ ?_ ?_ ?_ ?_ + · intro i + rw [hD, hB] + rcases i with i | i + · exact hDA _ (hint.collectedBasis_mem vb (idxEquiv nd (Sum.inl (Sum.inl i)))) + · exact hDK _ (hint.collectedBasis_mem vb (idxEquiv nd (Sum.inl (Sum.inr i)))) + · intro a + rw [hD, hB] + have e3 : b' (idxEquiv nd (Sum.inr a)) = (bW a : n → K) := by + simp [b', idxEquiv, vb] + rfl + rw [e3] + exact hDW a + · rw [hJ, hB] + exact hJA _ (hint.collectedBasis_mem vb (idxEquiv nd (Sum.inl (Sum.inl 0)))) + · intro j + rw [hJ, hB] + have e1 : b' (idxEquiv nd (Sum.inl (Sum.inr j))) = (bK j : n → K) := by + simp [b', idxEquiv, vb] + rfl + have e2 : ∀ i, b' (idxEquiv nd (Sum.inl (Sum.inr i))) = (bK i : n → K) := fun i => by + simp [b', idxEquiv, vb] + rfl + rw [e1] + have hfK : J.mulVecLin (bK j : n → K) = ((fK (bK j) : K0) : n → K) := rfl + have hsum : fK (bK j) = ∑ i, JK i j • bK i := by + conv_lhs => rw [← bK.sum_repr (fK (bK j))] + refine Finset.sum_congr rfl fun i _ => ?_ + simp [JK, LinearMap.toMatrix_apply] + have : J *ᵥ (bK j : n → K) = ((fK (bK j) : K0) : n → K) := hfK + rw [this, hsum] + simp [hB, e2] + · intro a + rw [hJ, hB] + exact hJW _ (hint.collectedBasis_mem vb (idxEquiv nd (Sum.inr a))) + +end Free + + +end BasisFree + +end SpecINV + +#print axioms SpecINV.inv_rank +#print axioms SpecINV.inv_word +#print axioms SpecINV.inv_DJ +#print axioms SpecINV.UR_inv_combined +#print axioms SpecINV.six_survivors +#print axioms SpecINV.hub_data +#print axioms SpecINV.split_key +#print axioms SpecINV.split_rank_ge +#print axioms SpecINV.split_DJ_rank +#print axioms SpecINV.split_R26_2_3 +#print axioms SpecINV.two_by_two_invol +#print axioms SpecINV.split_U4 +#print axioms SpecINV.inv_needs_transvection +#print axioms SpecINV.inv_needs_char +#print axioms SpecINV.Phi_refl +#print axioms SpecINV.split_U4_basis +#print axioms SpecINV.split_U4_free diff --git a/research/p104-lean-premises/lean/Nov15/SpecINV.md b/research/p104-lean-premises/lean/Nov15/SpecINV.md new file mode 100644 index 0000000000..3c73860451 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecINV.md @@ -0,0 +1,24 @@ +# Nov15/SpecINV.lean +Formalises the AUDITED R43 lemmas (internal notes, AUDIT43.md) on top of Nov15/SpecTSUR.lean. +Kernel-only: no sorry, no native_decide; all 14 printed theorems use [propext, Classical.choice, Quot.sound]. 8 s, 2.1 GB. +Matrices over a field K (`pp`, `refl = 1 - x yᵀ`, `ev/jobsP/uconj/ucount`, `UR_upper/UR_lower` imported from SpecTSUR). + +## Result: no paper statement is false as written. Two points where the Lean form is sharper / differs +- INV needs only the FIRST factor to be a transvection (`y_0·x_0 = 0` is the only use of `q.p = 0`); the proof avoids N^-1: with Z = columns z_i (Z N = P) and I - g = Z Qᵀ, rank U gives Qᵀ Z = 2I, entry (0,0): q_0·z_0 = q_0·p_0 = 0 = 2. +- SPLIT det term is proved as `det J · ε ≠ σ ε^N` (N = dim V₁, σ = -1 iff H active; equivalent to the paper's `det J_K ≠ ε^{dim K}` because det J = σ det J_K). The U = 4 equality step is formalised in coordinates ADAPTED to V₁ = ⟨x_H⟩ ⊕ K (Fin 1 ⊕ Fin 2); the basis-change to those coordinates is NOT proved (a conjugation; ranks and involutivity are invariant, but it is a stated hypothesis form). +- (audit item, not re-proved) "md = 4 ⇒ dead" holds only inside the N = 10 family (U ≤ 4); the Lean results say U ≥ 5 (resp. rank bound) and nothing about md. + +## Contents +1. `inv_rank`: char ≠ 2, `g = pp x y U` with y_0·x_0 = 0 (paper: all y_i·x_i = 0), g² = 1 ⇒ rank(1 - g) ≤ U - 1. `pp_shift`, `prod_units_pp`, `conj_form`, `uconj_forms` turn a word's conjugated units (`uconj w 1`) into a `pp` product; `inv_word`; `inv_DJ`: D, J commuting involutions (`ev w`, `jobsP w`) and transvection units ⇒ rank(D - J) ≤ U - 1 (g = D J⁻¹ = (uconj w 1).prod, D - J = (g - 1) J). +2. `UR_inv_combined`: d + |k - r₁| ≤ U - 1 (UR_lower + INV). `six_arith`/`six_survivors`: the two bound-4 patterns — (d, k, r₁) = (1, 3, 0) for R26 #10-#14 and (2, 3, 1) for #8 — give 5 ≤ U; character data are hypotheses `hpat` (pattern), hD, hJ, hD2/hJ2/hc. +3. SPLIT: `hub_mulVec`, `hub_vecMul`, `hub_data` (J x_H = σ x_H, y_H J = σ y_H, det J = (-1)^k from the pairing hypotheses y_i·x_H = 0 = y_H·x_i for the other active jobs i, y·x = 2); `split_key` (rank(ε - J) ≤ 1, ε ≠ σ ⇒ ε - J = ((ε-σ)/2) x_H y_Hᵀ, no basis of K needed), `split_det` (matrix determinant lemma), `split_rank_ge` (rank(ε - J) ≥ [ε ≠ σ] + [det term]), `split_DJ_rank` (with dark flips: rank(D - J) ≥ d + [x_H term] + [det term]), `split_R26_2_3`: d = 2, dim V₁ = 3, patterns (k=3, H∉S, ε=-1) and (k=4, H∈S, ε=+1) (R26#2 hub E μ=1,6,11,12; #3 hub F μ=9,14,11,12 are the same arithmetic) ⇒ rank(D - J) ≥ 4, so U ≥ 4, U = 3 dead (with UR_upper). +4. U = 4 equality: `two_by_two_invol` (2×2, det -1, rank(ε - J) ≤ 1, ε = ±1 ⇒ J² = I, via det(ε - J) = 0 ⇒ tr = 0 ⇒ Cayley-Hamilton by entries), `split_U4`: in adapted coordinates, D = ε ⊕ diag sd, J = (σ ⊕ J_K) ⊕ I, ε ≠ σ, det J_K ≠ ε², det J_K = ±1: `ucount w ≠ d + 2` (slack ⇒ rank(ε - J_K) ≤ 1 ⇒ J_K² = I ⇒ J², D², [D,J] ⇒ INV ⇒ rank(D - J) ≤ d + 1 < d + 2). With d = 2 this is U ≠ 4 for R26#2, #3; combined with U ≠ 3 above: U ≥ 5. +5. Counterexamples: `inv_needs_transvection` (ℚ, y·x = 2: involution with rank(I - g) = 1 > 0), `inv_needs_char` (ZMod 2, e₀/e₁: same). Both hypotheses are necessary. + +## Hypotheses taken from the cards (not proved here) +Tight-set pairing y_H·x_j = 0 = y_j·x_H (R43 item 3 via Lemma TS), the hub being active or not, character data (ε, σ, k, d, dim V₁), D = scalar ε on V₁ (r₁ ∈ {0, m}), D ⊕ J block forms, that all active jobs form the listed product, units being transvections. + +## Addendum : the change of basis in `split_U4` is now proved +`Phi B` (algebra equivalence `Matrix n n K ≃ₐ Matrix ι ι K`, coordinates in a basis `B` of `n → K`), `mapW`/`ev_mapW`/`jobsP_mapW`/`ucount_mapW` (word transport along a monoid hom), `Phi_refl`/`dot_Phi` (transvection form and `y·x = 0` preserved). +- `split_U4_basis`: any basis `B` indexed by `(Fin 1 ⊕ Fin 2) ⊕ nd` with `D`-eigen data (`ε` on the first three vectors, `sd` on the rest) and `J`-data (`σ`, a 2x2 block `JK`, identity) gives `U ≠ d + 2` for matrices on an arbitrary `n`. +- `split_U4_free` (basis-free): `V = A ⊕ K₀ ⊕ W` via `DirectSum.IsInternal ![A, K₀, W]`, `dim A = 1` (`A = ⟨x_H⟩`), `dim K₀ = 2`, `D` = `ε` on `A, K₀` and ±1 eigenbasis `bW` on `W`, `J` = `σ` on `A`, preserves `K₀` (det of the restriction `≠ ε²`, = ±1), identity on `W`. The adapted basis is BUILT (`collectedBasis` + `idxEquiv`). Conclusion `ucount w ≠ #{sd = -1} + 2`. `nd : Type` (universe 0, for `![Fin 1, Fin 2, nd]`). Kernel-only, standard axioms. diff --git a/research/p104-lean-premises/lean/Nov15/SpecLemmaU.lean b/research/p104-lean-premises/lean/Nov15/SpecLemmaU.lean new file mode 100644 index 0000000000..208070dd60 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecLemmaU.lean @@ -0,0 +1,470 @@ +/- +SPECBREAK RB6 survivor #0 kill steps . +Source: internal notes,AUDIT}.md. See SpecLemmaU.md for exact statements. +-/ +import Mathlib.LinearAlgebra.Determinant +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +import Mathlib.LinearAlgebra.Matrix.Rank +import Mathlib.LinearAlgebra.Matrix.ToLin +import Mathlib.LinearAlgebra.Matrix.SchurComplement +import Mathlib.Tactic.LinearCombination +import Mathlib.Tactic.Abel + +open Module LinearMap Matrix + +set_option linter.unusedSectionVars false + +namespace SpecLemmaU + +/-! ## §1 LEMMA U, abstract form (auditor's derivation, not RB4's `rank_ge`) -/ +section Abstract +variable {K W : Type*} [Field K] [AddCommGroup W] [Module K W] [FiniteDimensional K W] + +/-- `Fix(Λ) ⊆ F1`: from `Λ w = w` get `D w = P w`, so `D w - w = P w - w ∈ V ⊆ F1`; with +`D w + w ∈ F1` this gives `2 w ∈ F1`. -/ +theorem fix_le (h2 : (2 : K) ≠ 0) (F1 V : Submodule K W) (hVF : V ≤ F1) (D P Λ : W →ₗ[K] W) + (hP : ∀ w, P w - w ∈ V) (hD : ∀ w, D w + w ∈ F1) (hΛ : ∀ w, P (Λ w) = D w) : + ∀ w, Λ w = w → w ∈ F1 := by + intro w hw + have h1 : D w = P w := by rw [← hΛ, hw] + have h3 : D w - w ∈ F1 := by rw [h1]; exact hVF (hP w) + have h4 : (2 : K) • w ∈ F1 := by + have := F1.sub_mem (hD w) h3 + have e : (D w + w) - (D w - w) = (2 : K) • w := by rw [two_smul]; abel + rwa [e] at this + have := F1.smul_mem (2 : K)⁻¹ h4 + rwa [smul_smul, inv_mul_cancel₀ h2, one_smul] at this + +/-- `Λ ≡ -1 (mod F1)`. -/ +theorem lam_neg_mod (F1 V : Submodule K W) (hVF : V ≤ F1) (D P Λ : W →ₗ[K] W) + (hP : ∀ w, P w - w ∈ V) (hD : ∀ w, D w + w ∈ F1) (hΛ : ∀ w, P (Λ w) = D w) : + ∀ w, Λ w + w ∈ F1 := by + intro w + have h1 : P (Λ w) - Λ w ∈ F1 := hVF (hP (Λ w)) + have := F1.add_mem (F1.neg_mem h1) (hD w) + have e : -(P (Λ w) - Λ w) + (D w + w) = Λ w + w := by rw [← hΛ w]; abel + rwa [e] at this + +/-- **LEMMA U (abstract).** `K` a field with `2 ≠ 0`, `W` finite-dimensional, `V ≤ F1` subspaces with +`codim F1 = c`, `im (P - 1) ⊆ V`, `D ≡ -1 (mod F1)` (i.e. `D w + w ∈ F1`), and `Λ = P⁻¹ D` +(stated as `P ∘ Λ = D`). Then `rank (Λ - 1) ≥ c`, and equality forces `Λ² = 1`. +(No bound on `dim V` is used; `P` need not be invertible.) -/ +theorem lemmaU (h2 : (2 : K) ≠ 0) (F1 V : Submodule K W) (hVF : V ≤ F1) (D P Λ : W →ₗ[K] W) + (hP : ∀ w, P w - w ∈ V) (hD : ∀ w, D w + w ∈ F1) (hΛ : ∀ w, P (Λ w) = D w) + (c : ℕ) (hc : finrank K W = finrank K F1 + c) : + c ≤ finrank K (range (Λ - 1)) ∧ (finrank K (range (Λ - 1)) = c → ∀ w, Λ (Λ w) = w) := by + have hker : ker (Λ - 1) ≤ F1 := by + intro w hw + refine fix_le h2 F1 V hVF D P Λ hP hD hΛ w ?_ + have : Λ w - w = 0 := by simpa using hw + exact sub_eq_zero.1 this + have hrn := LinearMap.finrank_range_add_finrank_ker (Λ - 1) + have hle : finrank K (ker (Λ - 1)) ≤ finrank K F1 := Submodule.finrank_mono hker + refine ⟨by omega, fun hr => ?_⟩ + have heq : ker (Λ - 1) = F1 := + Submodule.eq_of_le_of_finrank_le hker (by omega) + have hfix : ∀ f ∈ F1, Λ f = f := by + intro f hf + have : f ∈ ker (Λ - 1) := by rw [heq]; exact hf + have h0 : Λ f - f = 0 := by simpa using this + exact sub_eq_zero.1 h0 + intro w + have h5 := hfix _ (lam_neg_mod F1 V hVF D P Λ hP hD hΛ w) + rw [map_add] at h5 + have : Λ (Λ w) + Λ w = Λ w + w := h5 + exact add_right_cancel (b := Λ w) (by rw [this, add_comm]) + +end Abstract + + +/-! ## §2 LEMMA U in RB6 coordinates `Fin 4 ⊕ ι` (C4 = e1..e4, F1 = {C4-coordinates = 0} = ) -/ +section Mat +variable {K : Type*} [Field K] {ι : Type*} [Fintype ι] [DecidableEq ι] + +/-- `D = -1` on the four `C4` coordinates, `d` (= `-1` on `e5`, `+1` on `e6`, `E'`) on the rest. -/ +def Dm (K : Type*) [Field K] {ι : Type*} [Fintype ι] [DecidableEq ι] (d : ι → K) : + Matrix (Fin 4 ⊕ ι) (Fin 4 ⊕ ι) K := + diagonal (Sum.elim (fun _ => (-1 : K)) d) + +theorem Dm_mul_Dm (d : ι → K) (hd : ∀ j, d j * d j = 1) : Dm K d * Dm K d = 1 := by + rw [Dm, diagonal_mul_diagonal, ← diagonal_one]; congr 1; funext a + rcases a with a | a <;> simp [hd] + +/-- the projection to the `C4` coordinates. -/ +noncomputable def piC (K : Type*) [Field K] (ι : Type*) : + (Fin 4 ⊕ ι → K) →ₗ[K] (Fin 4 → K) := + LinearMap.funLeft K K (Sum.inl : Fin 4 → Fin 4 ⊕ ι) + +theorem finrank_ker_piC : finrank K (Fin 4 ⊕ ι → K) = finrank K (ker (piC K ι)) + 4 := by + have hs : Function.Surjective (piC K ι) := + LinearMap.funLeft_surjective_of_injective K K _ Sum.inl_injective + have h := LinearMap.finrank_range_add_finrank_ker (piC K ι) + rw [LinearMap.range_eq_top.2 hs, finrank_top, Module.finrank_fin_fun] at h + omega + +/-- **LEMMA U, matrix form.** `char ≠ 2`; `D = Dm d` with `d² = 1`; `P` invertible with +`(P - 1) w` having zero `C4`-coordinates for all `w` (this is "`V ⊆ F1`", i.e. `proj_C4 X0 = 0`). +Then `rank (P⁻¹ D - 1) ≥ 4`, and rank `= 4` ⇒ `(P⁻¹ D)² = 1`. -/ +theorem lemmaU_mat (h2 : (2 : K) ≠ 0) (d : ι → K) (hd : ∀ j, d j * d j = 1) + (P : Matrix (Fin 4 ⊕ ι) (Fin 4 ⊕ ι) K) (hdet : IsUnit P.det) + (hPV : ∀ (w : Fin 4 ⊕ ι → K) (i : Fin 4), (P *ᵥ w - w) (Sum.inl i) = 0) : + 4 ≤ (P⁻¹ * Dm K d - 1).rank ∧ + ((P⁻¹ * Dm K d - 1).rank = 4 → (P⁻¹ * Dm K d) * (P⁻¹ * Dm K d) = 1) := by + set F1 : Submodule K (Fin 4 ⊕ ι → K) := ker (piC K ι) with hF1 + have memF1 : ∀ w, w ∈ F1 ↔ ∀ i : Fin 4, w (Sum.inl i) = 0 := by + intro w + simp only [hF1, LinearMap.mem_ker, piC, LinearMap.funLeft_apply] + exact ⟨fun h i => congrFun h i, fun h => funext h⟩ + have hP : ∀ w, (Matrix.toLin' P) w - w ∈ F1 := fun w => by + rw [memF1]; intro i; simpa [Matrix.toLin'_apply] using hPV w i + have hD : ∀ w, (Matrix.toLin' (Dm K d)) w + w ∈ F1 := fun w => by + rw [memF1]; intro i + simp [Dm, Matrix.toLin'_apply, Matrix.mulVec_diagonal] + have hΛ : ∀ w, (Matrix.toLin' P) ((Matrix.toLin' (P⁻¹ * Dm K d)) w) = (Matrix.toLin' (Dm K d)) w := by + intro w + show P *ᵥ ((P⁻¹ * Dm K d) *ᵥ w) = Dm K d *ᵥ w + rw [Matrix.mulVec_mulVec, ← Matrix.mul_assoc, Matrix.mul_nonsing_inv _ hdet, Matrix.one_mul] + have hsub : Matrix.toLin' (P⁻¹ * Dm K d) - 1 = Matrix.toLin' (P⁻¹ * Dm K d - 1) := by + rw [map_sub, Matrix.toLin'_one]; rfl + have hrk : (P⁻¹ * Dm K d - 1).rank = finrank K (range (Matrix.toLin' (P⁻¹ * Dm K d) - 1)) := by + rw [hsub]; rfl + obtain ⟨h1, h3⟩ := lemmaU h2 F1 F1 le_rfl (Matrix.toLin' (Dm K d)) (Matrix.toLin' P) + (Matrix.toLin' (P⁻¹ * Dm K d)) hP hD hΛ 4 finrank_ker_piC + refine ⟨hrk ▸ h1, fun hr => ?_⟩ + have := h3 (hrk ▸ hr) + apply Matrix.toLin'.injective + rw [Matrix.toLin'_mul, Matrix.toLin'_one] + exact LinearMap.ext fun w => this w + +/-- **LEMMA U, transpose case.** Same conclusions when instead the `C4`-*columns* of `P - 1` +vanish (`Y0` vanishes on `C4`). -/ +theorem lemmaU_mat_T (h2 : (2 : K) ≠ 0) (d : ι → K) (hd : ∀ j, d j * d j = 1) + (P : Matrix (Fin 4 ⊕ ι) (Fin 4 ⊕ ι) K) (hdet : IsUnit P.det) + (hPc : ∀ (j : Fin 4 ⊕ ι) (i : Fin 4), P j (Sum.inl i) = (1 : Matrix (Fin 4 ⊕ ι) (Fin 4 ⊕ ι) K) j (Sum.inl i)) : + 4 ≤ (P⁻¹ * Dm K d - 1).rank ∧ + ((P⁻¹ * Dm K d - 1).rank = 4 → (P⁻¹ * Dm K d) * (P⁻¹ * Dm K d) = 1) := by + have hdetT : IsUnit Pᵀ.det := by rwa [Matrix.det_transpose] + have hPV : ∀ (w : Fin 4 ⊕ ι → K) (i : Fin 4), (Pᵀ *ᵥ w - w) (Sum.inl i) = 0 := by + intro w i + have : (Pᵀ *ᵥ w) (Sum.inl i) = w (Sum.inl i) := by + simp only [Matrix.mulVec, dotProduct, Matrix.transpose_apply] + rw [← Finset.sum_erase_add _ _ (Finset.mem_univ (Sum.inl i : Fin 4 ⊕ ι))] + have : ∀ j ∈ Finset.univ.erase (Sum.inl i : Fin 4 ⊕ ι), P j (Sum.inl i) * w j = 0 := by + intro j hj + rw [hPc j i]; simp [Matrix.one_apply, Finset.ne_of_mem_erase hj] + rw [Finset.sum_eq_zero this, hPc]; simp + simp [this] + have hDt : (Dm K d)ᵀ = Dm K d := by simp [Dm, diagonal_transpose] + obtain ⟨h1, h3⟩ := lemmaU_mat h2 d hd Pᵀ hdetT hPV + -- ranks agree + have hrank : (P⁻¹ * Dm K d - 1).rank = (Pᵀ⁻¹ * Dm K d - 1).rank := by + have hD2 : IsUnit (Dm K d).det := by + have := Dm_mul_Dm d hd + have h := congrArg Matrix.det this + rw [Matrix.det_mul, Matrix.det_one] at h + exact IsUnit.of_mul_eq_one _ h + have e : ∀ Q : Matrix (Fin 4 ⊕ ι) (Fin 4 ⊕ ι) K, IsUnit Q.det → + Q⁻¹ * Dm K d - 1 = Q⁻¹ * (Dm K d - Q) := by + intro Q hQ + rw [Matrix.mul_sub, Matrix.nonsing_inv_mul _ hQ] + rw [e P hdet, e Pᵀ hdetT, + Matrix.rank_mul_eq_right_of_isUnit_det _ _ (Matrix.isUnit_nonsing_inv_det P hdet), + Matrix.rank_mul_eq_right_of_isUnit_det _ _ (Matrix.isUnit_nonsing_inv_det Pᵀ hdetT), + ← Matrix.rank_transpose (Dm K d - Pᵀ)] + simp [hDt] + refine ⟨hrank ▸ h1, fun hr => ?_⟩ + have h4 := h3 (hrank ▸ hr) + have hDD := Dm_mul_Dm d hd + rw [← Matrix.transpose_nonsing_inv] at h4 + have h5 := congrArg Matrix.transpose h4 + rw [Matrix.transpose_mul, Matrix.transpose_mul, Matrix.transpose_transpose, Matrix.transpose_one, + hDt] at h5 + calc P⁻¹ * Dm K d * (P⁻¹ * Dm K d) + = Dm K d * (Dm K d * P⁻¹ * (Dm K d * P⁻¹)) * Dm K d := by + simp only [Matrix.mul_assoc] + rw [← Matrix.mul_assoc (Dm K d) (Dm K d), hDD, Matrix.one_mul] + _ = 1 := by rw [h5, Matrix.mul_one, hDD] + +end Mat + +/-! ## §3 Sylvester step: `P_ABCD = Z ⇒ p0 + q0 ≤ 2` -/ +section Syl +variable {K : Type*} [Field K] + +/-- Sylvester's rank inequality `rank A + rank B ≤ rank (A B) + k`. -/ +theorem sylvester {m n o : Type*} [Fintype m] [Fintype n] [Fintype o] [DecidableEq n] + (A : Matrix m n K) (B : Matrix n o K) : + A.rank + B.rank ≤ (A * B).rank + Fintype.card n := by + set fA := A.mulVecLin + set fB := B.mulVecLin + have hAB : (A * B).rank = finrank K (range (fA ∘ₗ fB)) := by + rw [← Matrix.mulVecLin_mul]; rfl + have hA : A.rank = finrank K (range fA) := rfl + have hB : B.rank = finrank K (range fB) := rfl + set g : range fB →ₗ[K] (m → K) := fA.domRestrict (range fB) + have hrg : range g = range (fA ∘ₗ fB) := by + ext x; constructor + · rintro ⟨⟨_, ⟨y, rfl⟩⟩, rfl⟩; exact ⟨y, rfl⟩ + · rintro ⟨y, rfl⟩; exact ⟨⟨fB y, ⟨y, rfl⟩⟩, rfl⟩ + have h1 := LinearMap.finrank_range_add_finrank_ker g + have hk : finrank K (ker g) ≤ finrank K (ker fA) := by + rw [← Submodule.finrank_map_subtype_eq (range fB) (ker g)] + refine Submodule.finrank_mono ?_ + rintro w ⟨⟨s, hs⟩, hsk, rfl⟩ + simpa [g] using hsk + have h2 := LinearMap.finrank_range_add_finrank_ker fA + have hc : finrank K (n → K) = Fintype.card n := by simp + rw [hrg] at h1 + omega + +/-- **Sylvester step.** `X, Y : ι × 4`, `N` invertible (unitriangular in the paper), with +`rank (X N Yᵀ) = r`, `rank X = r + p0`, `rank Y = r + q0` (`p0 = dim span x / im(XNYᵀ)`, etc.). +Then `p0 + q0 + r ≤ 4`. For `r = 2` this is `p0 + q0 ≤ 2`. -/ +theorem sylvester_step {ι : Type*} [Fintype ι] (X Y : Matrix ι (Fin 4) K) + (N : Matrix (Fin 4) (Fin 4) K) (hN : IsUnit N.det) (r p0 q0 : ℕ) + (hr : (X * N * Yᵀ).rank = r) (hp : X.rank = r + p0) (hq : Y.rank = r + q0) : + p0 + q0 + r ≤ 4 := by + have h := sylvester X (N * Yᵀ) + rw [← Matrix.mul_assoc, hr, Matrix.rank_mul_eq_right_of_isUnit_det _ _ hN, Matrix.rank_transpose, + hp, hq] at h + simp at h + omega + +/-- `r ≤ rank X`: the column space of `X N Yᵀ` lies in that of `X`. -/ +theorem rank_le_left {ι : Type*} [Fintype ι] (X Y : Matrix ι (Fin 4) K) + (N : Matrix (Fin 4) (Fin 4) K) : (X * N * Yᵀ).rank ≤ X.rank := + (Matrix.rank_mul_le_left _ _).trans (Matrix.rank_mul_le_left _ _) + +theorem rank_le_right {ι : Type*} [Fintype ι] (X Y : Matrix ι (Fin 4) K) + (N : Matrix (Fin 4) (Fin 4) K) : (X * N * Yᵀ).rank ≤ Y.rank := by + exact (Matrix.rank_mul_le_right _ _).trans (le_of_eq (Matrix.rank_transpose Y)) + +/-- `Z = -1` on two coordinates `i5 ≠ i6`, `+1` elsewhere. -/ +def Zm (K : Type*) [Field K] {ι : Type*} [Fintype ι] [DecidableEq ι] (i5 i6 : ι) : Matrix ι ι K := + diagonal (fun i => if i = i5 ∨ i = i6 then (-1 : K) else 1) + +/-- `rank (1 - Z) = 2` (char ≠ 2). -/ +theorem rank_one_sub_Zm {ι : Type*} [Fintype ι] [DecidableEq ι] (h2 : (2 : K) ≠ 0) + (i5 i6 : ι) (h56 : i5 ≠ i6) : ((1 : Matrix ι ι K) - Zm K i5 i6).rank = 2 := by + classical + have e : (1 : Matrix ι ι K) - Zm K i5 i6 = + diagonal (fun i => if i = i5 ∨ i = i6 then (2 : K) else 0) := by + ext a b + by_cases hab : a = b + · subst hab + by_cases h : a = i5 ∨ a = i6 <;> simp [Zm, h] <;> norm_num + · simp [Zm, hab, Matrix.one_apply, diagonal_apply] + rw [e, Matrix.rank_diagonal] + have : (Finset.univ.filter fun i : ι => (if i = i5 ∨ i = i6 then (2 : K) else 0) ≠ 0) = {i5, i6} := by + ext i; simp only [Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_insert, Finset.mem_singleton] + by_cases h : i = i5 ∨ i = i6 <;> simp [h, h2] + rw [Fintype.card_subtype, this, Finset.card_pair h56] + +/-- **Step (2) of survivor #0.** If `P = 1 - X N Yᵀ = Z` (`P_ABCD = Z`), with `N` invertible, and +`rank X = 2 + p0`, `rank Y = 2 + q0`, then `p0 + q0 ≤ 2`. (`2 ≤ rank X, rank Y` is automatic by +`rank_le_left`/`rank_le_right`, so `p0, q0` are the natural-number excesses over `e56`.) -/ +theorem p0_q0_le_two {ι : Type*} [Fintype ι] [DecidableEq ι] (h2 : (2 : K) ≠ 0) + (i5 i6 : ι) (h56 : i5 ≠ i6) (X Y : Matrix ι (Fin 4) K) (N : Matrix (Fin 4) (Fin 4) K) + (hN : IsUnit N.det) (hP : (1 : Matrix ι ι K) - X * N * Yᵀ = Zm K i5 i6) (p0 q0 : ℕ) + (hp : X.rank = 2 + p0) (hq : Y.rank = 2 + q0) : p0 + q0 ≤ 2 := by + have e : X * N * Yᵀ = 1 - Zm K i5 i6 := by rw [← hP]; abel + have hr : (X * N * Yᵀ).rank = 2 := by rw [e]; exact rank_one_sub_Zm h2 i5 i6 h56 + have := sylvester_step X Y N hN 2 p0 q0 hr hp hq + omega + +end Syl + +/-! ## §4 The 3 × 3 core on `V = ` -/ +section Core +variable {K : Type*} [Field K] + +/-- rank `≤ 1` matrices are `a cᵀ`. -/ +theorem rank_le_one_decomp {m n : Type*} [Fintype m] [Fintype n] [DecidableEq n] + (M : Matrix m n K) (h : M.rank ≤ 1) : ∃ (a : m → K) (c : n → K), M = vecMulVec a c := by + have h1 : finrank K (range M.mulVecLin) ≤ 1 := h + obtain ⟨v, hv⟩ := finrank_le_one_iff.1 h1 + have : ∀ j, ∃ cj : K, ∀ i, M i j = cj * (v : m → K) i := by + intro j + obtain ⟨cj, hcj⟩ := hv ⟨M *ᵥ Pi.single j 1, ⟨Pi.single j 1, rfl⟩⟩ + refine ⟨cj, fun i => ?_⟩ + have := congrFun (congrArg Subtype.val hcj) i + simpa [Matrix.mulVec_single_one] using this.symm + choose c hc using this + exact ⟨v, c, by ext i j; simp [vecMulVec_apply, hc j i, mul_comm]⟩ + +/-- `rank (A + B) ≤ rank A + rank B`. -/ +theorem rank_add_le_mat {m n : Type*} [Fintype m] [Fintype n] (A B : Matrix m n K) : + (A + B).rank ≤ A.rank + B.rank := by + have h : range (A + B).mulVecLin ≤ range A.mulVecLin ⊔ range B.mulVecLin := by + rintro _ ⟨w, rfl⟩ + exact Submodule.mem_sup.2 ⟨A *ᵥ w, ⟨w, rfl⟩, B *ᵥ w, ⟨w, rfl⟩, by simp [add_mulVec]⟩ + exact (Submodule.finrank_mono h).trans (Submodule.finrank_add_le_finrank_add_finrank _ _) + +/-- `det P|_V = det (1 - G T)` for `P = 1 - Vt T Ytᵀ`, `G = Ytᵀ Vt` (Sylvester determinant identity). -/ +theorem det_core {ι : Type*} [Fintype ι] [DecidableEq ι] (Vt Yt : Matrix ι (Fin 3) K) + (T : Matrix (Fin 3) (Fin 3) K) : + ((1 : Matrix ι ι K) - Vt * T * Ytᵀ).det = (1 - T * (Ytᵀ * Vt)).det := by + rw [Matrix.det_one_sub_mul_comm, ← Matrix.mul_assoc, Matrix.det_one_sub_mul_comm, + ← Matrix.mul_assoc] + +/-- `diag(1,1,k)`. -/ +def Gm (k : K) : Matrix (Fin 3) (Fin 3) K := diagonal ![1, 1, k] +def Dq : Matrix (Fin 3) (Fin 3) K := diagonal ![2, 0, 2] +def Dp : Matrix (Fin 3) (Fin 3) K := diagonal ![0, 2, 0] + +/-- the 3×3 part of `Msys` in the "neither `u_E` nor `η_E`" case. -/ +def Mcore (T : Matrix (Fin 3) (Fin 3) K) (k : K) : Matrix (Fin 3) (Fin 3) K := T * Gm k - Dq + +/-- `Msys ≠ 0` for `k ≠ 0` (this is where `det P|_V = -1` is used; char ≠ 2). -/ +theorem core_neither_ne_zero (h2 : (2 : K) ≠ 0) (T : Matrix (Fin 3) (Fin 3) K) (k : K) + (hdet : (1 - T * Gm k).det = -1) : Mcore T k ≠ 0 := by + intro h0 + have : T * Gm k = Dq := sub_eq_zero.1 h0 + rw [this] at hdet + simp [Dq, Matrix.det_fin_three, Matrix.one_apply, diagonal_apply] at hdet + apply h2 + linear_combination hdet + +/-- `Msys ≠ 0` for `k = 0` (third column is `-2 e3`). -/ +theorem core_k0_ne_zero (h2 : (2 : K) ≠ 0) (T : Matrix (Fin 3) (Fin 3) K) : + Mcore T 0 ≠ 0 := by + intro h0 + have := congrFun (congrFun h0 2) 2 + simp [Mcore, Gm, Dq, Matrix.mul_apply, Fin.sum_univ_three, diagonal_apply] at this + exact h2 this + +/-- `diag(2,-2,2) = Dq - Dp`. -/ +def Dl3 : Matrix (Fin 3) (Fin 3) K := diagonal ![2, -2, 2] + +theorem rank_Dl3 (h2 : (2 : K) ≠ 0) : (Dl3 : Matrix (Fin 3) (Fin 3) K).rank = 3 := by + have hu : IsUnit (Dl3 : Matrix (Fin 3) (Fin 3) K).det := by + rw [Dl3, det_diagonal] + simp [Fin.prod_univ_three, h2] + have := Matrix.rank_of_isUnit (Dl3 : Matrix (Fin 3) (Fin 3) K) + ((Matrix.isUnit_iff_isUnit_det _).2 hu) + simpa using this + +theorem tg_eq (T : Matrix (Fin 3) (Fin 3) K) (k : K) : + (T - Dp) * Gm k = Mcore T k + Dl3 := by + ext i j + fin_cases i <;> fin_cases j <;> + simp [Mcore, Gm, Dq, Dp, Dl3, Matrix.mul_apply, Fin.sum_univ_three, diagonal_apply] <;> ring + +theorem rank_le_two_of_det_zero (R : Matrix (Fin 3) (Fin 3) K) (h : R.det = 0) : R.rank ≤ 2 := by + obtain ⟨v, hv0, hv⟩ := Matrix.exists_mulVec_eq_zero_iff.2 h + have h1 := LinearMap.finrank_range_add_finrank_ker R.mulVecLin + have h3 : 0 < finrank K (ker R.mulVecLin) := + Module.finrank_pos_iff_exists_ne_zero.2 + ⟨⟨v, LinearMap.mem_ker.2 hv⟩, fun h' => hv0 (congrArg Subtype.val h')⟩ + have h4 : finrank K (Fin 3 → K) = 3 := by simp + have : R.rank = finrank K (range R.mulVecLin) := rfl + omega + +/-- **3×3 core, "neither" case, `k ≠ 0`.** If `det (1 - T G) = -1` and `rank Msys ≤ 1` then +`rank (T - diag(0,2,0)) = 2`, i.e. `nullity = 1` (so `dim E_-1 = 3 + 1 = 4`). The proof is the +rank-one determinant identity `det(M + diag(2,-2,2)) = 4 s - 8 = 0`, `s = tr(S M)`. -/ +theorem core_neither_rank (h2 : (2 : K) ≠ 0) (T : Matrix (Fin 3) (Fin 3) K) (k : K) (hk : k ≠ 0) + (hdet : (1 - T * Gm k).det = -1) (hM : (Mcore T k).rank ≤ 1) : + (T - Dp).rank = 2 := by + obtain ⟨a, c, hM'⟩ := rank_le_one_decomp _ hM + have hG : IsUnit (Gm k).det := by + rw [Gm, det_diagonal]; simp [Fin.prod_univ_three]; exact hk + have hR : (T - Dp).rank = (Mcore T k + Dl3).rank := by + rw [← tg_eq, Matrix.rank_mul_eq_left_of_isUnit_det _ _ hG] + have hTG : T * Gm k = vecMulVec a c + Dq := by + rw [← hM']; simp [Mcore] + have hdet0 : (Mcore T k + Dl3).det = 0 := by + rw [hTG] at hdet + rw [hM'] + simp [Dq, Dl3, Matrix.det_fin_three, vecMulVec_apply, Matrix.one_apply, diagonal_apply] at hdet ⊢ + linear_combination (-4 : K) * hdet + have hle : (Mcore T k + Dl3).rank ≤ 2 := rank_le_two_of_det_zero _ hdet0 + have hge : 2 ≤ (Mcore T k + Dl3).rank := by + have h1 := rank_add_le_mat (Mcore T k + Dl3) (-(Mcore T k)) + have e : Mcore T k + Dl3 + -(Mcore T k) = Dl3 := by abel + rw [e, rank_Dl3 h2] at h1 + have h2' : (-(Mcore T k)).rank ≤ 1 := by + have : -(Mcore T k) = vecMulVec (-a) c := by rw [hM']; ext i j; simp [vecMulVec_apply] + rw [this]; exact Matrix.rank_vecMulVec_le _ _ + omega + omega + +theorem rank_pos_of_ne_zero {m n : Type*} [Fintype m] [Fintype n] [DecidableEq n] + (M : Matrix m n K) (h : M ≠ 0) : 0 < M.rank := by + by_contra hr + have h0 : finrank K (range M.mulVecLin) = 0 := by + have : M.rank = finrank K (range M.mulVecLin) := rfl + omega + have hb : range M.mulVecLin = ⊥ := Submodule.finrank_eq_zero.1 h0 + apply h; ext i j + have : M *ᵥ Pi.single j 1 = 0 := by + have hm : M *ᵥ Pi.single j 1 ∈ range M.mulVecLin := ⟨Pi.single j 1, rfl⟩ + rw [hb] at hm; simpa using hm + simpa [Matrix.mulVec_single_one] using congrFun this i + +/-- `dim ker(Λ-1) + dim ker(Λ+1) = dim W` (char ≠ 2) forces `Λ² = 1`. -/ +theorem invol_of_dims {W : Type*} [AddCommGroup W] [Module K W] [FiniteDimensional K W] + (h2 : (2 : K) ≠ 0) (Λ : W →ₗ[K] W) + (h : finrank K (ker (Λ - 1)) + finrank K (ker (Λ + 1)) = finrank K W) : ∀ w, Λ (Λ w) = w := by + have hd : ker (Λ - 1) ⊓ ker (Λ + 1) = ⊥ := by + rw [eq_bot_iff] + intro w ⟨h1, h3⟩ + have e1 : Λ w = w := sub_eq_zero.1 (by simpa using h1) + have e2 : Λ w = -w := eq_neg_of_add_eq_zero_left (by simpa using h3) + have : (2 : K) • w = 0 := by rw [two_smul]; nth_rewrite 1 [← e1]; rw [e2]; abel + simpa [h2] using this + have hfs := Submodule.finrank_sup_add_finrank_inf_eq (ker (Λ - 1)) (ker (Λ + 1)) + rw [hd, finrank_bot] at hfs + have htop : ker (Λ - 1) ⊔ ker (Λ + 1) = ⊤ := + Submodule.eq_top_of_finrank_eq (by omega) + intro w + have hw : w ∈ ker (Λ - 1) ⊔ ker (Λ + 1) := by rw [htop]; trivial + obtain ⟨x, hx, y, hy, rfl⟩ := Submodule.mem_sup.1 hw + have ex : Λ x = x := sub_eq_zero.1 (by simpa using hx) + have ey : Λ y = -y := eq_neg_of_add_eq_zero_left (by simpa using hy) + simp [ex, ey] + +/-- `det P|_V = -1` transported to the core (`P = 1 - Vt T Ytᵀ`, `Ytᵀ Vt = diag(1,1,k)`). -/ +theorem core_det_neg {ι : Type*} [Fintype ι] [DecidableEq ι] (Vt Yt : Matrix ι (Fin 3) K) + (T : Matrix (Fin 3) (Fin 3) K) (k : K) (hG : Ytᵀ * Vt = Gm k) + (hP : ((1 : Matrix ι ι K) - Vt * T * Ytᵀ).det = -1) : (1 - T * Gm k).det = -1 := by + rw [← hG, ← det_core, hP] + +/-- **3×3 core, "neither" case: rank ≥ 4, equality ⇒ involution.** Here `Λ` is the unit-character +operator; the two coordinate identities `hrk`, `hE` (`rank(D-P) = 3 + rank Msys`, +`dim E_-1(Λ) = 3 + nullity(T - diag(0,2,0))`) are the RB6 item-3 formulas, checked exactly over Q +by the audit (and numerically by chkT.py) but NOT re-derived here: they are named hypotheses. -/ +theorem core_neither_involution {W : Type*} [AddCommGroup W] [Module K W] [FiniteDimensional K W] + (h2 : (2 : K) ≠ 0) (T : Matrix (Fin 3) (Fin 3) K) (k : K) (hk : k ≠ 0) + (hdet : (1 - T * Gm k).det = -1) (Λ : W →ₗ[K] W) + (hrk : finrank K (range (Λ - 1)) = 3 + (Mcore T k).rank) + (hE : finrank K (ker (Λ + 1)) = 3 + (3 - (T - Dp).rank)) : + 4 ≤ finrank K (range (Λ - 1)) ∧ (finrank K (range (Λ - 1)) = 4 → ∀ w, Λ (Λ w) = w) := by + have hpos := rank_pos_of_ne_zero _ (core_neither_ne_zero h2 T k hdet) + refine ⟨by omega, fun h4 => ?_⟩ + have hM : (Mcore T k).rank ≤ 1 := by omega + have hr := core_neither_rank h2 T k hk hdet hM + have hrn := LinearMap.finrank_range_add_finrank_ker (Λ - 1) + apply invol_of_dims h2 Λ + omega + +/-- **3×3 core, `k = 0`: rank ≥ 4** (third column of `Msys` is `-2 e3`). -/ +theorem core_k0_rank_ge {W : Type*} [AddCommGroup W] [Module K W] [FiniteDimensional K W] + (h2 : (2 : K) ≠ 0) (T : Matrix (Fin 3) (Fin 3) K) (Λ : W →ₗ[K] W) + (hrk : finrank K (range (Λ - 1)) = 3 + (Mcore T 0).rank) : 4 ≤ finrank K (range (Λ - 1)) := by + have := rank_pos_of_ne_zero _ (core_k0_ne_zero h2 T) + omega + +end Core + +end SpecLemmaU + +#print axioms SpecLemmaU.lemmaU +#print axioms SpecLemmaU.lemmaU_mat +#print axioms SpecLemmaU.lemmaU_mat_T +#print axioms SpecLemmaU.sylvester +#print axioms SpecLemmaU.p0_q0_le_two +#print axioms SpecLemmaU.core_neither_rank +#print axioms SpecLemmaU.core_neither_involution +#print axioms SpecLemmaU.core_k0_rank_ge +#print axioms SpecLemmaU.core_det_neg diff --git a/research/p104-lean-premises/lean/Nov15/SpecLemmaU.md b/research/p104-lean-premises/lean/Nov15/SpecLemmaU.md new file mode 100644 index 0000000000..f01fee4dd4 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecLemmaU.md @@ -0,0 +1,17 @@ +# Nov15/SpecLemmaU.lean +Formalises survivor #0's kill steps (internal notes + AUDIT.md). Kernel-only: no sorry, no native_decide; 9 `#print axioms` all [propext, Classical.choice, Quot.sound]; 21 s / 2.05 GB. Paper statements are TRUE as written (no counterexample needed). + +## (1) LEMMA U (auditor's derivation, not RB4 `rank_ge`) +- `lemmaU` (abstract; field, 2 != 0, finite-dim W): V <= F1, codim F1 = c, im(P-1) in V, D = -1 mod F1 (D w + w in F1), P (Lam w) = D w (Lam = P^-1 D). Then rank(Lam-1) >= c, and rank = c => Lam^2 = 1. Uses neither dim V <= 4 nor invertibility of P (only Fix(Lam) <= F1 and Lam = -1 mod F1 at equality). `fix_le`, `lam_neg_mod` are the two steps. +- `lemmaU_mat` (RB6 coordinates Fin 4 + iota, C4 = e1..e4, F1 = {C4 coords = 0}; D = `Dm d` with d^2 = 1; P invertible; C4-coordinates of (P-1)w vanish "proj_C4 X0 = 0"): 4 <= rank(P^-1 D - 1), and rank = 4 => (P^-1 D)^2 = 1. +- `lemmaU_mat_T` (transpose case: C4-columns of P-1 vanish, "Y0 vanishes on C4"): same conclusions for P^-1 D, via rank(D-P^T) = rank(D-P) and (P^-T D)^2 = 1 <=> (P^-1 D)^2 = 1. +## (2) Sylvester step +- `sylvester` (general A B: rank A + rank B <= rank(AB) + card n; not in Mathlib). `sylvester_step`: X,Y : iota x 4, N invertible, rank(XNY^T) = r, rank X = r+p0, rank Y = r+q0 => p0+q0+r <= 4. `p0_q0_le_two`: P = 1 - XNY^T = Z (Z = -1 on i5 != i6, +1 elsewhere, `rank_one_sub_Zm` = 2) => p0+q0 <= 2. `rank_le_left/right` give r <= rank X, rank Y (p0, q0 are genuine naturals). Needs only det N != 0 (unitriangular suffices). +## (3) 3x3 core (partial, as allowed) +Proved on 3x3 matrices T, G = diag(1,1,k), Msys_core = T G - diag(2,0,2) (`Mcore`): +- `det_core`, `core_det_neg`: det(1 - Vt T Yt^T) = det(1 - T (Yt^T Vt)), so det P|_V = -1 transports to det(1 - T G) = -1. +- `core_neither_ne_zero` (k != 0): det(1-TG) = -1 => Mcore != 0 (so rank >= 4). `core_k0_ne_zero`: k = 0 => Mcore != 0 (column 3 = -2 e3). +- `core_neither_rank`: k != 0, det(1-TG) = -1, rank Mcore <= 1 => rank(T - diag(0,2,0)) = 2 (nullity 1). Proof: (T-Dp)G = Mcore + diag(2,-2,2); rank-one det identity det(M+diag(2,-2,2)) = 4s - 8 = 0 (from det = -1), rank >= 2 by subadditivity. This is a PROOF of the case the audit only checked numerically (297/297 random rank-1 M); it holds for all T over any field with 2 != 0. +- `core_neither_involution`, `core_k0_rank_ge`: rank(Lam-1) >= 4, equality => Lam^2 = 1 (via `invol_of_dims`: dim ker(Lam-1) + dim ker(Lam+1) = dim W => Lam^2 = 1). +NAMED HYPOTHESES (not re-derived in Lean): `hrk : rank(Lam-1) = 3 + rank Msys` and `hE : dim E_-1(Lam) = 3 + nullity(T - diag(0,2,0))` (RB6 item 3 coordinate formulas; audit re-verified exactly over Q, chkT.py numerically); the unit-char / P = product-of-three-reflections structure (det P = -1 enters via `core_det_neg`); RB5 structure (e56, x_E, x_F in e56); INV. +NOT formalised: Msys != 0 in the cases u_E != 0 or eta_E != 0 (trivial extra row / T e3 column; not needed for the k != 0 neither case), the hand cases u_E-only / eta_E-only / both nonzero at rank 4, and all of item 4 (k = 0 Singular radical checks: omega_mu in radical, (DD_mu U_mu)^2 - I in radical, 90 classes), RB5's 720-order symmetry reduction. diff --git a/research/p104-lean-premises/lean/Nov15/SpecLemmaU2.lean b/research/p104-lean-premises/lean/Nov15/SpecLemmaU2.lean new file mode 100644 index 0000000000..ee4b988359 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecLemmaU2.lean @@ -0,0 +1,841 @@ +/- +SPECBREAK RB6 survivor #0, part 2 . Extends SpecLemmaU.lean. +Discharges `hrk` / `hE` from block coordinates, proves the three E-part cases, composes `spec0_core_U4`. +See SpecLemmaU2.md. +-/ +import Nov15.SpecLemmaU + +open Module LinearMap Matrix + +set_option linter.unusedSectionVars false + +namespace SpecLemmaU2 +open SpecLemmaU + +/-! ## §1 generic kernel-bound lemma -/ +section KB +variable {K : Type*} [Field K] + +theorem kb {A : Type*} [AddCommGroup A] [Module K A] [FiniteDimensional K A] + {B : Type*} [AddCommGroup B] [Module K B] [FiniteDimensional K B] + {r c : Type*} [Fintype r] [Fintype c] + (f : A →ₗ[K] A) (S : Matrix r c K) (θ1 : A →ₗ[K] (c → K)) (θ2 : A →ₗ[K] B) + (Bs : Submodule K B) + (hθ : ∀ w ∈ ker f, S *ᵥ θ1 w = 0) + (hB : ∀ w ∈ ker f, θ2 w ∈ Bs) + (hinj : ∀ w ∈ ker f, θ1 w = 0 → θ2 w = 0 → w = 0) : + finrank K (ker f) + S.rank ≤ Fintype.card c + finrank K Bs := by + set θ1' : ker f →ₗ[K] (c → K) := θ1.domRestrict (ker f) with hθ1' + have h1 := LinearMap.finrank_range_add_finrank_ker θ1' + have hr : range θ1' ≤ ker S.mulVecLin := by + rintro _ ⟨⟨w, hw⟩, rfl⟩ + have := hθ w hw + simpa [θ1'] using this + have h2 : finrank K (range θ1') ≤ finrank K (ker S.mulVecLin) := Submodule.finrank_mono hr + have h3 := LinearMap.finrank_range_add_finrank_ker S.mulVecLin + have hc : finrank K (c → K) = Fintype.card c := by simp + have hSr : S.rank = finrank K (range S.mulVecLin) := rfl + let g0 : ker θ1' →ₗ[K] B := (θ2.domRestrict (ker f)).domRestrict (ker θ1') + let g : ker θ1' →ₗ[K] Bs := g0.codRestrict Bs (fun x => hB x.1.1 x.1.2) + have hg : Function.Injective g := by + rw [← LinearMap.ker_eq_bot, LinearMap.ker_eq_bot'] + intro x hx + have hx0 : θ2 x.1.1 = 0 := by + have : ((g x : Bs) : B) = 0 := by rw [hx]; rfl + exact this + have hx1 : θ1 x.1.1 = 0 := LinearMap.mem_ker.1 x.2 + have := hinj x.1.1 x.1.2 hx1 hx0 + apply Subtype.ext; apply Subtype.ext + simpa using this + have h4 := LinearMap.finrank_le_finrank_of_injective hg + omega + +end KB + + +/-! ## §2 the model: coordinates `Fin 4 ⊕ (Fin 2 ⊕ E)`, `C4 = inl`, `e5 = I5`, `e6 = I6`, `E' = inr inr` -/ +section Model +variable {K : Type*} [Field K] {E : Type*} [Fintype E] [DecidableEq E] + +abbrev Ix (E : Type*) := Fin 4 ⊕ (Fin 2 ⊕ E) + +local notation "I5" => Sum.inr (Sum.inl (0 : Fin 2)) +local notation "I6" => Sum.inr (Sum.inl (1 : Fin 2)) +local notation "cE " e:max => Sum.inr (Sum.inr e) + +/-- columns `e5, e6, v` (used for both `X = (e5, e6, u)` and `Y = (e5, e6, η)`). -/ +def vt (u : Ix E → K) : Matrix (Ix E) (Fin 3) K := + Matrix.of fun x j => ![if x = I5 then 1 else 0, if x = I6 then 1 else 0, u x] j + +/-- `D`: `-1` on `C4` and on `e5`, `+1` on `e6` and `E'`. -/ +def dm (K : Type*) [Field K] (E : Type*) : Fin 2 ⊕ E → K := Sum.elim ![-1, 1] (fun _ => 1) + +/-- `P = 1 - X T Yᵀ`. -/ +def Pm (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) : Matrix (Ix E) (Ix E) K := + 1 - vt u * T * (vt η)ᵀ + +theorem tvec_eq (η w : Ix E → K) : (vt η)ᵀ *ᵥ w = ![w I5, w I6, η ⬝ᵥ w] := by + ext j; fin_cases j <;> simp [vt, Matrix.mulVec, dotProduct, Matrix.transpose_apply] + +theorem vt_mulVec (u : Ix E → K) (s : Fin 3 → K) (x : Ix E) : + (vt u *ᵥ s) x = s 0 * (if x = I5 then 1 else 0) + s 1 * (if x = I6 then 1 else 0) + s 2 * u x := by + simp [vt, Matrix.mulVec, dotProduct, Fin.sum_univ_three]; ring + +/-- `σ = T t(w)`, `t(w) = (w_5, w_6, η·w)`. -/ +def sg (η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) (w : Ix E → K) : Fin 3 → K := + T *ᵥ ![w I5, w I6, η ⬝ᵥ w] + +theorem Pm_mulVec (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) (w : Ix E → K) (x : Ix E) : + (Pm u η T *ᵥ w) x = w x - (sg η T w 0 * (if x = I5 then 1 else 0) + + sg η T w 1 * (if x = I6 then 1 else 0) + sg η T w 2 * u x) := by + simp only [Pm, sub_mulVec, one_mulVec, Pi.sub_apply, ← Matrix.mulVec_mulVec, tvec_eq, + vt_mulVec, sg] + +theorem Dm_mulVec (w : Ix E → K) (x : Ix E) : + (Dm K (dm K E) *ᵥ w) x = Sum.elim (fun _ => (-1 : K)) (dm K E) x * w x := by + simp [Dm, Matrix.mulVec_diagonal] + +/-- equations for `D w = P w` (i.e. `Λ w = w`). -/ +theorem fix_eqs (h2 : (2 : K) ≠ 0) (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) + (hu5 : u I5 = 0) (hu6 : u I6 = 0) (w : Ix E → K) + (h : Dm K (dm K E) *ᵥ w = Pm u η T *ᵥ w) : + (∀ c : Fin 4, w (Sum.inl c) = sg η T w 2 / 2 * u (Sum.inl c)) ∧ sg η T w 0 = 2 * w I5 ∧ + sg η T w 1 = 0 ∧ (∀ e, sg η T w 2 * u (cE e) = 0) := by + have hx := fun x => congrFun h x + refine ⟨fun c => ?_, ?_, ?_, fun e => ?_⟩ + · have := hx (Sum.inl c) + rw [Dm_mulVec, Pm_mulVec] at this; simp [dm] at this + rw [div_mul_eq_mul_div, eq_div_iff h2] + linear_combination (-1 : K) * this + · have := hx I5 + rw [Dm_mulVec, Pm_mulVec] at this; simp [dm, hu5] at this + linear_combination this + · have := hx I6 + rw [Dm_mulVec, Pm_mulVec] at this; simp [dm, hu6] at this + linear_combination this + · have := hx (cE e) + rw [Dm_mulVec, Pm_mulVec] at this; simp [dm] at this + linear_combination this + + +/-- `Λ = P⁻¹ D`. -/ +noncomputable def Lam (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) : Matrix (Ix E) (Ix E) K := + (Pm u η T)⁻¹ * Dm K (dm K E) + +theorem mem_ker_iff (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) + (hdet : IsUnit (Pm u η T).det) (w : Ix E → K) : + w ∈ ker (Matrix.toLin' (Lam u η T) - 1) ↔ Dm K (dm K E) *ᵥ w = Pm u η T *ᵥ w := by + have hP : Pm u η T * (Pm u η T)⁻¹ = 1 := Matrix.mul_nonsing_inv _ hdet + have hP' : (Pm u η T)⁻¹ * Pm u η T = 1 := Matrix.nonsing_inv_mul _ hdet + rw [LinearMap.mem_ker] + simp only [LinearMap.sub_apply, Matrix.toLin'_apply, Lam, ← Matrix.mulVec_mulVec, + Module.End.one_apply, sub_eq_zero] + constructor + · intro h + have := congrArg (Matrix.mulVec (Pm u η T)) h + rw [Matrix.mulVec_mulVec, hP, Matrix.one_mulVec] at this + exact this + · intro h + rw [h, Matrix.mulVec_mulVec, hP', Matrix.one_mulVec] + +theorem mem_ker_add_iff (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) + (hdet : IsUnit (Pm u η T).det) (w : Ix E → K) : + w ∈ ker (Matrix.toLin' (Lam u η T) + 1) ↔ + Dm K (dm K E) *ᵥ w + Pm u η T *ᵥ w = 0 := by + have hP : Pm u η T * (Pm u η T)⁻¹ = 1 := Matrix.mul_nonsing_inv _ hdet + have hP' : (Pm u η T)⁻¹ * Pm u η T = 1 := Matrix.nonsing_inv_mul _ hdet + rw [LinearMap.mem_ker] + simp only [LinearMap.add_apply, Matrix.toLin'_apply, Lam, ← Matrix.mulVec_mulVec, + Module.End.one_apply] + constructor + · intro h + have := congrArg (Matrix.mulVec (Pm u η T)) h + rw [Matrix.mulVec_add, Matrix.mulVec_mulVec, hP, Matrix.one_mulVec, Matrix.mulVec_zero] at this + exact this + · intro h + have h' : Dm K (dm K E) *ᵥ w = -(Pm u η T *ᵥ w) := eq_neg_of_add_eq_zero_left h + rw [h', Matrix.mulVec_neg, Matrix.mulVec_mulVec, hP', Matrix.one_mulVec]; simp + +/-- `C4`-part of `k = η·u`. -/ +def kC (η u : Ix E → K) : K := ∑ c : Fin 4, η (Sum.inl c) * u (Sum.inl c) +/-- `E'`-part of `η·w`. -/ +def lam (η w : Ix E → K) : K := ∑ e : E, η (cE e) * w (cE e) + +theorem dot_split (η w : Ix E → K) (hη5 : η I5 = 0) (hη6 : η I6 = 0) : + η ⬝ᵥ w = ∑ c : Fin 4, η (Sum.inl c) * w (Sum.inl c) + lam η w := by + simp [dotProduct, Fintype.sum_sum_type, Fin.sum_univ_two, hη5, hη6, lam] + +theorem dot_ker (η u w : Ix E → K) (hη5 : η I5 = 0) (hη6 : η I6 = 0) (s : K) + (hC : ∀ c : Fin 4, w (Sum.inl c) = s * u (Sum.inl c)) : + η ⬝ᵥ w = kC η u * s + lam η w := by + rw [dot_split η w hη5 hη6] + congr 1 + simp only [hC, kC, Finset.sum_mul] + exact Finset.sum_congr rfl fun c _ => by ring + +theorem w_eq_zero (w : Ix E → K) (hC : ∀ c, w (Sum.inl c) = 0) (h5 : w I5 = 0) (h6 : w I6 = 0) + (hE : ∀ e, w (cE e) = 0) : w = 0 := by + ext x + rcases x with c | j | e + · exact hC c + · fin_cases j + · exact h5 + · exact h6 + · exact hE e + +/-- the 4-column system (η_E ≠ 0). -/ +def S4 (T : Matrix (Fin 3) (Fin 3) K) (κ δ : K) : Matrix (Fin 4) (Fin 4) K := + !![T 0 0 - 2, T 0 1, T 0 2 * κ, T 0 2; + T 1 0, T 1 1, T 1 2 * κ, T 1 2; + T 2 0, T 2 1, T 2 2 * κ - 2, T 2 2; + 0, 0, δ, 0] + +/-- the 3-column system (η_E = 0). -/ +def S3 (T : Matrix (Fin 3) (Fin 3) K) (κ δ : K) : Matrix (Fin 4) (Fin 3) K := + !![T 0 0 - 2, T 0 1, T 0 2 * κ; + T 1 0, T 1 1, T 1 2 * κ; + T 2 0, T 2 1, T 2 2 * κ - 2; + 0, 0, δ] + +/-- the three row equations, in the variables `(z0, z1, z2, λ)`. -/ +theorem rows_eq (h2 : (2 : K) ≠ 0) (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) + (hu5 : u I5 = 0) (hu6 : u I6 = 0) (hη5 : η I5 = 0) (hη6 : η I6 = 0) (w : Ix E → K) + (h : Dm K (dm K E) *ᵥ w = Pm u η T *ᵥ w) : + (T 0 0 - 2) * w I5 + T 0 1 * w I6 + T 0 2 * (kC η u * (sg η T w 2 / 2) + lam η w) = 0 ∧ + T 1 0 * w I5 + T 1 1 * w I6 + T 1 2 * (kC η u * (sg η T w 2 / 2) + lam η w) = 0 ∧ + T 2 0 * w I5 + T 2 1 * w I6 + T 2 2 * (kC η u * (sg η T w 2 / 2) + lam η w) + - 2 * (sg η T w 2 / 2) = 0 := by + obtain ⟨e1, e2, e3, e4⟩ := fix_eqs h2 u η T hu5 hu6 w h + have hd := dot_ker η u w hη5 hη6 (sg η T w 2 / 2) e1 + have s0 : sg η T w 0 = T 0 0 * w I5 + T 0 1 * w I6 + T 0 2 * (η ⬝ᵥ w) := by + simp [sg, Matrix.mulVec, dotProduct, Fin.sum_univ_three] + have s1 : sg η T w 1 = T 1 0 * w I5 + T 1 1 * w I6 + T 1 2 * (η ⬝ᵥ w) := by + simp [sg, Matrix.mulVec, dotProduct, Fin.sum_univ_three] + have s2 : sg η T w 2 = T 2 0 * w I5 + T 2 1 * w I6 + T 2 2 * (η ⬝ᵥ w) := by + simp [sg, Matrix.mulVec, dotProduct, Fin.sum_univ_three] + rw [hd] at s0 s1 s2 + have hz : sg η T w 2 / 2 * 2 = sg η T w 2 := div_mul_cancel₀ _ h2 + refine ⟨?_, ?_, ?_⟩ + · linear_combination e2 - s0 + · linear_combination e3 - s1 + · linear_combination (-1 : K) * s2 - hz + + +/-! ### linear maps for the kernel injections -/ +def prL (x : Ix E) : (Ix E → K) →ₗ[K] K := LinearMap.proj x + +def dotL (η : Ix E → K) : (Ix E → K) →ₗ[K] K where + toFun w := η ⬝ᵥ w + map_add' := dotProduct_add _ + map_smul' c w := by simp [dotProduct_smul] + +def lamL (η : Ix E → K) : (Ix E → K) →ₗ[K] K where + toFun w := lam η w + map_add' a b := by simp [lam, mul_add, Finset.sum_add_distrib] + map_smul' c w := by + simp only [lam, Pi.smul_apply, smul_eq_mul, RingHom.id_apply, Finset.mul_sum] + exact Finset.sum_congr rfl fun e _ => by ring + +/-- `lam` on functions of `E` alone. -/ +def lamF (η : Ix E → K) : (E → K) →ₗ[K] K where + toFun v := ∑ e, η (cE e) * v e + map_add' a b := by simp [mul_add, Finset.sum_add_distrib] + map_smul' c v := by + simp only [Pi.smul_apply, smul_eq_mul, RingHom.id_apply, Finset.mul_sum] + exact Finset.sum_congr rfl fun e _ => by ring + +theorem lamL_apply (η w : Ix E → K) : lamL η w = lam η w := rfl + +def tL (η : Ix E → K) : (Ix E → K) →ₗ[K] (Fin 3 → K) := LinearMap.pi ![prL I5, prL I6, dotL η] + +def sgL (η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) : (Ix E → K) →ₗ[K] (Fin 3 → K) := + (Matrix.mulVecLin T) ∘ₗ tL η + +theorem sgL_apply (η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) (w : Ix E → K) : + sgL η T w = sg η T w := by + have : tL η w = ![w I5, w I6, η ⬝ᵥ w] := by + ext j; fin_cases j <;> simp [tL, prL, dotL] + simp [sgL, this, sg] + +def th3 (η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) : (Ix E → K) →ₗ[K] (Fin 3 → K) := + LinearMap.pi ![prL I5, prL I6, (1 / 2 : K) • (LinearMap.proj (2 : Fin 3) ∘ₗ sgL η T)] + +def th4 (η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) : (Ix E → K) →ₗ[K] (Fin 4 → K) := + LinearMap.pi ![prL I5, prL I6, (1 / 2 : K) • (LinearMap.proj (2 : Fin 3) ∘ₗ sgL η T), lamL η] + +theorem th3_apply (η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) (w : Ix E → K) : + th3 η T w = ![w I5, w I6, sg η T w 2 / 2] := by + ext j; fin_cases j <;> simp [th3, prL, sgL_apply, div_eq_inv_mul] + +theorem th4_apply (η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) (w : Ix E → K) : + th4 η T w = ![w I5, w I6, sg η T w 2 / 2, lam η w] := by + ext j; fin_cases j <;> simp [th4, prL, sgL_apply, lamL_apply, div_eq_inv_mul] + +theorem finrank_ix (E : Type*) [Fintype E] : + finrank K (Ix E → K) = 6 + Fintype.card E := by + simp [Module.finrank_fintype_fun_eq_card, Fintype.card_sum]; omega + +theorem finrank_ker_lamF (η : Ix E → K) (e : E) (he : η (cE e) ≠ 0) : + finrank K (ker (lamF η)) + 1 ≤ Fintype.card E := by + have h1 := LinearMap.finrank_range_add_finrank_ker (lamF η) + have h3 : 0 < finrank K (range (lamF η)) := by + refine Module.finrank_pos_iff_exists_ne_zero.2 + ⟨⟨lamF η (Pi.single e (η (cE e))⁻¹), ⟨_, rfl⟩⟩, fun h' => ?_⟩ + have := congrArg Subtype.val h' + simp [lamF, Pi.single_apply, he] at this + have h4 : finrank K (E → K) = Fintype.card E := by simp + omega + +/-- If the `C4`-block, `e5`, `e6` data of `w` vanish, then `w = 0` (shared injectivity step). -/ +theorem key4 (h2 : (2 : K) ≠ 0) (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) + (hu5 : u I5 = 0) (hu6 : u I6 = 0) (hη5 : η I5 = 0) (hη6 : η I6 = 0) + (hdet : IsUnit (Pm u η T).det) (hηE : ∃ e, η (cE e) ≠ 0) (δ : K) + (hδ : δ = 0 ∨ ∃ e, u (cE e) ≠ 0) : + 3 + (S4 T (kC η u) δ).rank ≤ finrank K (range (Matrix.toLin' (Lam u η T) - 1)) := by + obtain ⟨e, he⟩ := hηE + set e0 : E → K := Pi.single e (η (cE e))⁻¹ with he0d + have he0 : lamF η e0 = 1 := by simp [lamF, e0, Pi.single_apply, he] + set f := Matrix.toLin' (Lam u η T) - 1 with hf + let θ2 : (Ix E → K) →ₗ[K] (E → K) := + LinearMap.funLeft K K (fun e : E => (cE e : Ix E)) - (lamL η).smulRight e0 + have hθ2 : ∀ w, θ2 w = fun e' => w (cE e') - lam η w * e0 e' := by + intro w; ext e'; simp [θ2, lamL_apply] + have hkb := kb f (S4 T (kC η u) δ) (th4 η T) θ2 (ker (lamF η)) + (fun w hw => by + have h := (mem_ker_iff u η T hdet w).1 hw + obtain ⟨r1, r2, r3⟩ := rows_eq h2 u η T hu5 hu6 hη5 hη6 w h + obtain ⟨e1, e2, e3, e4⟩ := fix_eqs h2 u η T hu5 hu6 w h + have hz : δ * (sg η T w 2 / 2) = 0 := by + rcases hδ with h0 | ⟨e', he'⟩ + · simp [h0] + · have := e4 e' + have : sg η T w 2 = 0 := by + rcases mul_eq_zero.1 this with h | h + · exact h + · exact absurd h he' + simp [this] + have hz' := hz + simp at hz' + rw [th4_apply] + ext i; fin_cases i <;> + simp [S4, Matrix.mulVec, dotProduct, Fin.sum_univ_four] <;> + first | linear_combination r1 | linear_combination r2 | linear_combination r3 | + exact hz') + (fun w _ => by + rw [LinearMap.mem_ker, hθ2] + show ∑ e', η (cE e') * (w (cE e') - lam η w * e0 e') = 0 + have : ∑ e', η (cE e') * (w (cE e') - lam η w * e0 e') = lam η w - lam η w * lamF η e0 := by + simp only [lam, lamF, LinearMap.coe_mk, AddHom.coe_mk, Finset.mul_sum, mul_sub, Finset.sum_sub_distrib] + congr 1 + exact Finset.sum_congr rfl fun e' _ => by ring + rw [this, he0]; ring) + (fun w hw h1 h2' => by + have h := (mem_ker_iff u η T hdet w).1 hw + obtain ⟨e1, e2, e3, e4⟩ := fix_eqs h2 u η T hu5 hu6 w h + rw [th4_apply] at h1 + have z0 : w I5 = 0 := by simpa using congrFun h1 0 + have z1 : w I6 = 0 := by simpa using congrFun h1 1 + have z2 : sg η T w 2 / 2 = 0 := by simpa using congrFun h1 2 + have z3 : lam η w = 0 := by simpa using congrFun h1 3 + have z2' : sg η T w 2 = 0 := by + rcases div_eq_zero_iff.1 z2 with h | h + · exact h + · exact absurd h h2 + rw [hθ2] at h2' + refine w_eq_zero w (fun c => by rw [e1, z2]; simp) z0 z1 (fun e' => ?_) + have := congrFun h2' e' + simpa [z3] using this) + have h1 := LinearMap.finrank_range_add_finrank_ker f + have h5 := finrank_ix (K := K) E + have h6 := finrank_ker_lamF η e he + rw [Fintype.card_fin] at hkb + omega + + +theorem lam_zero' (η w : Ix E → K) (hw : ∀ e, w (cE e) = 0) : lam η w = 0 := by + simp [lam, hw] + +theorem lam_zero (η w : Ix E → K) (hηE : ∀ e, η (cE e) = 0) : lam η w = 0 := by + simp [lam, hηE] + +theorem key3 (h2 : (2 : K) ≠ 0) (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) + (hu5 : u I5 = 0) (hu6 : u I6 = 0) (hη5 : η I5 = 0) (hη6 : η I6 = 0) + (hdet : IsUnit (Pm u η T).det) (hηE : ∀ e, η (cE e) = 0) (δ : K) + (hδ : δ = 0 ∨ ∃ e, u (cE e) ≠ 0) : + 3 + (S3 T (kC η u) δ).rank ≤ finrank K (range (Matrix.toLin' (Lam u η T) - 1)) := by + set f := Matrix.toLin' (Lam u η T) - 1 with hf + let θ2 : (Ix E → K) →ₗ[K] (E → K) := + LinearMap.funLeft K K (fun e : E => (cE e : Ix E)) + have hkb := kb f (S3 T (kC η u) δ) (th3 η T) θ2 ⊤ + (fun w hw => by + have h := (mem_ker_iff u η T hdet w).1 hw + obtain ⟨r1, r2, r3⟩ := rows_eq h2 u η T hu5 hu6 hη5 hη6 w h + obtain ⟨e1, e2, e3, e4⟩ := fix_eqs h2 u η T hu5 hu6 w h + rw [lam_zero η w hηE] at r1 r2 r3 + have hz : δ * (sg η T w 2 / 2) = 0 := by + rcases hδ with h0 | ⟨e', he'⟩ + · simp [h0] + · have := e4 e' + have : sg η T w 2 = 0 := by + rcases mul_eq_zero.1 this with h | h + · exact h + · exact absurd h he' + simp [this] + have hz' := hz + simp at hz' + rw [th3_apply] + ext i; fin_cases i <;> + simp [S3, Matrix.mulVec, dotProduct, Fin.sum_univ_three] <;> + first | linear_combination r1 | linear_combination r2 | linear_combination r3 | + exact hz') + (fun w _ => Submodule.mem_top) + (fun w hw h1 h2' => by + have h := (mem_ker_iff u η T hdet w).1 hw + obtain ⟨e1, e2, e3, e4⟩ := fix_eqs h2 u η T hu5 hu6 w h + rw [th3_apply] at h1 + have z0 : w I5 = 0 := by simpa using congrFun h1 0 + have z1 : w I6 = 0 := by simpa using congrFun h1 1 + have z2 : sg η T w 2 / 2 = 0 := by simpa using congrFun h1 2 + refine w_eq_zero w (fun c => by rw [e1, z2]; simp) z0 z1 (fun e' => ?_) + simpa [θ2] using congrFun h2' e') + have h1 := LinearMap.finrank_range_add_finrank_ker f + have h5 := finrank_ix (K := K) E + have h6 : finrank K (⊤ : Submodule K (E → K)) = Fintype.card E := by simp + rw [Fintype.card_fin] at hkb + omega + + +/-! ### the `E_{-1}` side -/ +def etaC (η : Ix E → K) : (Fin 4 → K) →ₗ[K] K where + toFun c := ∑ i, η (Sum.inl i) * c i + map_add' a b := by simp [mul_add, Finset.sum_add_distrib] + map_smul' c v := by + simp only [Pi.smul_apply, smul_eq_mul, RingHom.id_apply, Finset.mul_sum] + exact Finset.sum_congr rfl fun e _ => by ring + +theorem etaC_apply (η : Ix E → K) (c : Fin 4 → K) : etaC η c = ∑ i, η (Sum.inl i) * c i := rfl + +/-- the explicit `E_{-1}` vectors `w(t, c)`: `C4 = t₂ c₀ + c`, `e5 = t₀`, `e6 = t₁`, `E' = 0`. -/ +def mu (c0 : Fin 4 → K) : ((Fin 3 → K) × (Fin 4 → K)) →ₗ[K] (Ix E → K) where + toFun p := Sum.elim (fun i => (p.1 2 • c0 + p.2) i) (Sum.elim ![p.1 0, p.1 1] (fun _ => 0)) + map_add' a b := by + ext x; rcases x with i | j | e + · simp; ring + · fin_cases j <;> simp + · simp + map_smul' c a := by + ext x; rcases x with i | j | e + · simp; ring + · fin_cases j <;> simp + · simp + +theorem Em1_bound (h2 : (2 : K) ≠ 0) (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) + (hu5 : u I5 = 0) (hu6 : u I6 = 0) (hη5 : η I5 = 0) (hη6 : η I6 = 0) + (hdet : IsUnit (Pm u η T).det) (hηC : ∃ c, η (Sum.inl c) ≠ 0) + (hT : (T - Dp).rank ≤ 2) : + 4 ≤ finrank K (ker (Matrix.toLin' (Lam u η T) + 1)) := by + obtain ⟨c1, hc1⟩ := hηC + set c0 : Fin 4 → K := Pi.single c1 (η (Sum.inl c1))⁻¹ with hc0d + have hc0 : etaC η c0 = 1 := by simp [etaC_apply, c0, Pi.single_apply, hc1] + set K1 : Submodule K (Fin 3 → K) := ker (T - Dp).mulVecLin with hK1 + set K2 : Submodule K (Fin 4 → K) := ker (etaC η) with hK2 + let ν : (↥K1 × ↥K2) →ₗ[K] (Ix E → K) := + (mu (E := E) c0).comp (K1.subtype.prodMap K2.subtype) + have hν : ∀ p : ↥K1 × ↥K2, ν p = Sum.elim (fun i => (p.1.1 2 • c0 + p.2.1) i) + (Sum.elim ![p.1.1 0, p.1.1 1] (fun _ => 0)) := fun p => rfl + -- dimensions + have hd1 : 1 ≤ finrank K K1 := by + have h1 := LinearMap.finrank_range_add_finrank_ker (T - Dp).mulVecLin + have h3 : (T - Dp).rank = finrank K (range (T - Dp).mulVecLin) := rfl + have h4 : finrank K (Fin 3 → K) = 3 := by simp + have e1 : finrank K K1 = finrank K (ker (T - Dp).mulVecLin) := rfl + omega + have hd2 : 3 ≤ finrank K K2 := by + have h1 := LinearMap.finrank_range_add_finrank_ker (etaC η) + have h3 : finrank K (range (etaC η)) ≤ 1 := by + have := Submodule.finrank_le (range (etaC η)) + simpa using this + have h4 : finrank K (Fin 4 → K) = 4 := by simp + have e1 : finrank K K2 = finrank K (ker (etaC η)) := rfl + omega + have hinj : Function.Injective ν := by + rw [← LinearMap.ker_eq_bot, LinearMap.ker_eq_bot'] + intro p hp + have h5 := congrFun hp I5 + have h6 := congrFun hp I6 + simp [hν] at h5 h6 + have hC : ∀ i, p.1.1 2 * c0 i + p.2.1 i = 0 := fun i => by + have := congrFun hp (Sum.inl i) + simpa [hν] using this + have ht2 : p.1.1 2 = 0 := by + have := congrArg (fun v => ∑ i, η (Sum.inl i) * v i) (funext hC : (fun i => p.1.1 2 * c0 i + p.2.1 i) = 0) + have h7 : p.2.1 ∈ ker (etaC η) := p.2.2 + rw [LinearMap.mem_ker, etaC_apply] at h7 + have h8 : ∑ i, η (Sum.inl i) * c0 i = 1 := hc0 + simp only [mul_add, Finset.sum_add_distrib, mul_left_comm _ (p.1.1 2), ← Finset.mul_sum, h8, + h7] at this + simpa using this + have hp2 : p.2.1 = 0 := by + ext i; have := hC i; rw [ht2] at this; simpa using this + have hp1 : p.1.1 = 0 := by + ext j; fin_cases j + · simpa using h5 + · simpa using h6 + · simpa using ht2 + exact Prod.ext (Subtype.ext hp1) (Subtype.ext hp2) + have hrange : range ν ≤ ker (Matrix.toLin' (Lam u η T) + 1) := by + rintro _ ⟨p, rfl⟩ + rw [mem_ker_add_iff u η T hdet] + obtain ⟨⟨t, ht⟩, ⟨c, hc⟩⟩ := p + have htT : T *ᵥ t = Dp *ᵥ t := by + have : (T - Dp) *ᵥ t = 0 := ht + rw [Matrix.sub_mulVec] at this + exact sub_eq_zero.1 this + set w : Ix E → K := ν (⟨t, ht⟩, ⟨c, hc⟩) with hw + have hwv : w = Sum.elim (fun i => (t 2 • c0 + c) i) + (Sum.elim ![t 0, t 1] (fun _ => 0)) := rfl + have hw5 : w I5 = t 0 := by simp [hwv] + have hw6 : w I6 = t 1 := by simp [hwv] + have hwE : ∀ e, w (cE e) = 0 := by intro e; simp [hwv] + have hwC : ∀ i, w (Sum.inl i) = (t 2 • c0 + c) i := by intro i; simp [hwv] + have hdw : η ⬝ᵥ w = t 2 := by + rw [dot_split η w hη5 hη6, lam_zero' η w hwE] + have h7 : etaC η c = 0 := hc + simp only [hwC, etaC_apply] at h7 ⊢ + simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul, mul_add, Finset.sum_add_distrib, + mul_left_comm _ (t 2), ← Finset.mul_sum] at * + have h8 : ∑ i, η (Sum.inl i) * c0 i = 1 := hc0 + rw [h8, h7]; ring + have htv : ![w I5, w I6, η ⬝ᵥ w] = t := by + ext j; fin_cases j <;> simp [hw5, hw6, hdw] + have hsg : sg η T w = Dp *ᵥ t := by + rw [sg, htv, htT] + have s0 : sg η T w 0 = 0 := by rw [hsg]; simp [Dp, Matrix.mulVec_diagonal] + have s1 : sg η T w 1 = 2 * t 1 := by rw [hsg]; simp [Dp, Matrix.mulVec_diagonal] + have s2 : sg η T w 2 = 0 := by rw [hsg]; simp [Dp, Matrix.mulVec_diagonal] + ext x + rw [Pi.add_apply, Dm_mulVec, Pm_mulVec] + rcases x with i | j | e + · simp [s2] + · fin_cases j + · simp [s0, s2, hw5, dm, hu5] + · simp [s1, s2, hw6, dm, hu6]; ring + · simp [s2, hwE, dm] + have h9 := Submodule.finrank_mono hrange + rw [LinearMap.finrank_range_of_inj hinj, Module.finrank_prod] at h9 + omega + +end Model + + +/-! ## §3 the four E-part cases: `rank S ≤ 1` forces `rank (T - diag(0,2,0)) ≤ 2` -/ +section Cases +variable {K : Type*} [Field K] + +theorem rank_le_two_of_third_row (T : Matrix (Fin 3) (Fin 3) K) + (h0 : T 2 0 = 0) (h1 : T 2 1 = 0) (h2 : T 2 2 = 0) : (T - Dp).rank ≤ 2 := by + apply rank_le_two_of_det_zero + simp [Matrix.det_fin_three, Dp, diagonal_apply, h0, h1, h2] + +theorem rank_le_two_of_third_col (T : Matrix (Fin 3) (Fin 3) K) + (h0 : T 0 2 = 0) (h1 : T 1 2 = 0) (h2 : T 2 2 = 0) : (T - Dp).rank ≤ 2 := by + apply rank_le_two_of_det_zero + simp [Matrix.det_fin_three, Dp, diagonal_apply, h0, h1, h2] + +/-- case neither `u_E` nor `η_E` (`δ = 0`, 3 columns). -/ +theorem case1 (h2 : (2 : K) ≠ 0) (T : Matrix (Fin 3) (Fin 3) K) (κ : K) (hk : κ ≠ 0) + (hdet : (1 - T * Gm κ).det = -1) (hr : (S3 T κ 0).rank ≤ 1) : (T - Dp).rank ≤ 2 := by + obtain ⟨a, c, hS⟩ := rank_le_one_decomp _ hr + have e : ∀ i j, S3 T κ 0 i j = a i * c j := fun i j => by rw [hS]; simp [vecMulVec_apply] + have hM : (Mcore T κ).rank ≤ 1 := by + have : Mcore T κ = vecMulVec ![a 0, a 1, a 2] c := by + ext i j + have := e i.castSucc j + fin_cases i <;> fin_cases j <;> + simp [S3, Mcore, Gm, Dq, Matrix.mul_apply, Fin.sum_univ_three, diagonal_apply, + vecMulVec_apply] at this ⊢ <;> linear_combination this + rw [this]; exact Matrix.rank_vecMulVec_le _ _ + exact (core_neither_rank h2 T κ hk hdet hM).le + +/-- case `u_E ≠ 0` only (`δ = 1`, 3 columns). -/ +theorem case2 (T : Matrix (Fin 3) (Fin 3) K) (κ : K) (hk : κ ≠ 0) + (hdet : (1 - T * Gm κ).det = -1) (hr : (S3 T κ 1).rank ≤ 1) : (T - Dp).rank ≤ 2 := by + obtain ⟨a, c, hS⟩ := rank_le_one_decomp _ hr + have e : ∀ i j, S3 T κ 1 i j = a i * c j := fun i j => by rw [hS]; simp [vecMulVec_apply] + have e30 : (0 : K) = a 3 * c 0 := by simpa [S3] using e 3 0 + have e31 : (0 : K) = a 3 * c 1 := by simpa [S3] using e 3 1 + have e32 : (1 : K) = a 3 * c 2 := by simpa [S3] using e 3 2 + have e00 : T 0 0 - 2 = a 0 * c 0 := by simpa [S3] using e 0 0 + have e10 : T 1 0 = a 1 * c 0 := by simpa [S3] using e 1 0 + have e20 : T 2 0 = a 2 * c 0 := by simpa [S3] using e 2 0 + have e01 : T 0 1 = a 0 * c 1 := by simpa [S3] using e 0 1 + have e11 : T 1 1 = a 1 * c 1 := by simpa [S3] using e 1 1 + have e21 : T 2 1 = a 2 * c 1 := by simpa [S3] using e 2 1 + have ha3 : a 3 ≠ 0 := by intro h; rw [h] at e32; simp at e32 + have hc0 : c 0 = 0 := by + rcases mul_eq_zero.1 e30.symm with h | h + · exact absurd h ha3 + · exact h + have hc1 : c 1 = 0 := by + rcases mul_eq_zero.1 e31.symm with h | h + · exact absurd h ha3 + · exact h + rw [hc0] at e00 e10 e20 + rw [hc1] at e01 e11 e21 + have t00 : T 0 0 = 2 := by linear_combination e00 + have t10 : T 1 0 = 0 := by linear_combination e10 + have t20 : T 2 0 = 0 := by linear_combination e20 + have t01 : T 0 1 = 0 := by linear_combination e01 + have t11 : T 1 1 = 0 := by linear_combination e11 + have t21 : T 2 1 = 0 := by linear_combination e21 + simp [Matrix.det_fin_three, Gm, Matrix.one_apply, Matrix.mul_apply, Fin.sum_univ_three, + diagonal_apply, t00, t10, t20, t01, t11, t21] at hdet + have t22 : T 2 2 = 0 := by + have : κ * T 2 2 = 0 := by linear_combination hdet + rcases mul_eq_zero.1 this with h | h + · exact absurd h hk + · exact h + exact rank_le_two_of_third_row T t20 t21 t22 + +/-- case `η_E ≠ 0` only (`δ = 0`, 4 columns). -/ +theorem case3 (h2 : (2 : K) ≠ 0) (T : Matrix (Fin 3) (Fin 3) K) (κ : K) (hk : κ ≠ 0) + (hdet : (1 - T * Gm κ).det = -1) (hr : (S4 T κ 0).rank ≤ 1) : (T - Dp).rank ≤ 2 := by + obtain ⟨a, c, hS⟩ := rank_le_one_decomp _ hr + have e : ∀ i j, S4 T κ 0 i j = a i * c j := fun i j => by rw [hS]; simp [vecMulVec_apply] + have e00 : T 0 0 - 2 = a 0 * c 0 := by simpa [S4] using e 0 0 + have e01 : T 0 1 = a 0 * c 1 := by simpa [S4] using e 0 1 + have e02 : T 0 2 * κ = a 0 * c 2 := by simpa [S4] using e 0 2 + have e03 : T 0 2 = a 0 * c 3 := by simpa [S4] using e 0 3 + have e10 : T 1 0 = a 1 * c 0 := by simpa [S4] using e 1 0 + have e11 : T 1 1 = a 1 * c 1 := by simpa [S4] using e 1 1 + have e12 : T 1 2 * κ = a 1 * c 2 := by simpa [S4] using e 1 2 + have e13 : T 1 2 = a 1 * c 3 := by simpa [S4] using e 1 3 + have e22 : T 2 2 * κ - 2 = a 2 * c 2 := by simpa [S4] using e 2 2 + have e23 : T 2 2 = a 2 * c 3 := by simpa [S4] using e 2 3 + have hm0 : a 0 * (κ * c 3 - c 2) = 0 := by linear_combination (-κ) * e03 + e02 + have hm1 : a 1 * (κ * c 3 - c 2) = 0 := by linear_combination (-κ) * e13 + e12 + have hm2 : a 2 * (κ * c 3 - c 2) = 2 := by linear_combination (-κ) * e23 + e22 + have hm : κ * c 3 - c 2 ≠ 0 := by + intro h; rw [h, mul_zero] at hm2; exact h2 hm2.symm + have a0 : a 0 = 0 := by + rcases mul_eq_zero.1 hm0 with h | h + · exact h + · exact absurd h hm + have a1 : a 1 = 0 := by + rcases mul_eq_zero.1 hm1 with h | h + · exact h + · exact absurd h hm + rw [a0] at e00 e01 e03 + rw [a1] at e10 e11 e13 + have t00 : T 0 0 = 2 := by linear_combination e00 + have t01 : T 0 1 = 0 := by linear_combination e01 + have t02 : T 0 2 = 0 := by linear_combination e03 + have t10 : T 1 0 = 0 := by linear_combination e10 + have t11 : T 1 1 = 0 := by linear_combination e11 + have t12 : T 1 2 = 0 := by linear_combination e13 + simp [Matrix.det_fin_three, Gm, Matrix.one_apply, Matrix.mul_apply, Fin.sum_univ_three, + diagonal_apply, t00, t01, t02, t10, t11, t12] at hdet + have t22 : T 2 2 = 0 := by + have : κ * T 2 2 = 0 := by linear_combination hdet + rcases mul_eq_zero.1 this with h | h + · exact absurd h hk + · exact h + exact rank_le_two_of_third_col T t02 t12 t22 + +/-- case `u_E ≠ 0` and `η_E ≠ 0` (`δ = 1`, 4 columns): no `k` hypothesis needed. -/ +theorem case4 (T : Matrix (Fin 3) (Fin 3) K) (κ : K) (hr : (S4 T κ 1).rank ≤ 1) : + (T - Dp).rank ≤ 2 := by + obtain ⟨a, c, hS⟩ := rank_le_one_decomp _ hr + have e : ∀ i j, S4 T κ 1 i j = a i * c j := fun i j => by rw [hS]; simp [vecMulVec_apply] + have e30 : (0 : K) = a 3 * c 0 := by simpa [S4] using e 3 0 + have e32 : (1 : K) = a 3 * c 2 := by simpa [S4] using e 3 2 + have e33 : (0 : K) = a 3 * c 3 := by simpa [S4] using e 3 3 + have e03 : T 0 2 = a 0 * c 3 := by simpa [S4] using e 0 3 + have e13 : T 1 2 = a 1 * c 3 := by simpa [S4] using e 1 3 + have e23 : T 2 2 = a 2 * c 3 := by simpa [S4] using e 2 3 + have ha3 : a 3 ≠ 0 := by intro h; rw [h] at e32; simp at e32 + have hc3 : c 3 = 0 := by + rcases mul_eq_zero.1 e33.symm with h | h + · exact absurd h ha3 + · exact h + rw [hc3] at e03 e13 e23 + exact rank_le_two_of_third_col T (by linear_combination e03) (by linear_combination e13) + (by linear_combination e23) + +end Cases + + +/-! ## §4 composition: `spec0_core_U4` -/ +section Compose +variable {K : Type*} [Field K] {E : Type*} [Fintype E] [DecidableEq E] + +local notation "I5" => Sum.inr (Sum.inl (0 : Fin 2)) +local notation "I6" => Sum.inr (Sum.inl (1 : Fin 2)) +local notation "cE " e:max => Sum.inr (Sum.inr e) + +/-- `dim ker(Λ-1) + dim ker(Λ+1) ≥ dim W` (char ≠ 2) forces `Λ² = 1`. -/ +theorem invol_of_dims_ge {W : Type*} [AddCommGroup W] [Module K W] [FiniteDimensional K W] + (h2 : (2 : K) ≠ 0) (Λ : W →ₗ[K] W) + (h : finrank K W ≤ finrank K (ker (Λ - 1)) + finrank K (ker (Λ + 1))) : + ∀ w, Λ (Λ w) = w := by + have hd : ker (Λ - 1) ⊓ ker (Λ + 1) = ⊥ := by + rw [eq_bot_iff] + intro w ⟨h1, h3⟩ + have e1 : Λ w = w := sub_eq_zero.1 (by simpa using h1) + have e2 : Λ w = -w := eq_neg_of_add_eq_zero_left (by simpa using h3) + have : (2 : K) • w = 0 := by rw [two_smul]; nth_rewrite 1 [← e1]; rw [e2]; abel + simpa [h2] using this + have hfs := Submodule.finrank_sup_add_finrank_inf_eq (ker (Λ - 1)) (ker (Λ + 1)) + rw [hd, finrank_bot] at hfs + have hle := Submodule.finrank_le (ker (Λ - 1) ⊔ ker (Λ + 1)) + have htop : ker (Λ - 1) ⊔ ker (Λ + 1) = ⊤ := + Submodule.eq_top_of_finrank_eq (by omega) + intro w + have hw : w ∈ ker (Λ - 1) ⊔ ker (Λ + 1) := by rw [htop]; trivial + obtain ⟨x, hx, y, hy, rfl⟩ := Submodule.mem_sup.1 hw + have ex : Λ x = x := sub_eq_zero.1 (by simpa using hx) + have ey : Λ y = -y := eq_neg_of_add_eq_zero_left (by simpa using hy) + simp [ex, ey] + +theorem vt_gram (u η : Ix E → K) (hu5 : u I5 = 0) (hu6 : u I6 = 0) (hη5 : η I5 = 0) + (hη6 : η I6 = 0) : (vt η)ᵀ * vt u = Gm (η ⬝ᵥ u) := by + ext i j + fin_cases i <;> fin_cases j <;> + simp [vt, Gm, Matrix.mul_apply, dotProduct, diagonal_apply, hu5, hu6, hη5, hη6] + +theorem det_gm (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) (hu5 : u I5 = 0) (hu6 : u I6 = 0) + (hη5 : η I5 = 0) (hη6 : η I6 = 0) (hdet : (Pm u η T).det = -1) : + (1 - T * Gm (η ⬝ᵥ u)).det = -1 := + core_det_neg (vt u) (vt η) T _ (vt_gram u η hu5 hu6 hη5 hη6) hdet + +theorem dot_u (u η : Ix E → K) (hη5 : η I5 = 0) (hη6 : η I6 = 0) + (hu : u I5 = 0 ∧ u I6 = 0) : + η ⬝ᵥ u = kC η u + lam η u := by + rw [dot_split η u hη5 hη6]; rfl + +theorem S3_ne_zero (T : Matrix (Fin 3) (Fin 3) K) (κ δ : K) (h : Mcore T κ ≠ 0) : + S3 T κ δ ≠ 0 := by + intro hS; apply h + ext i j + have := congrFun (congrFun hS i.castSucc) j + fin_cases i <;> fin_cases j <;> + simp [S3, Mcore, Gm, Dq, Matrix.mul_apply, Fin.sum_univ_three, diagonal_apply] at this ⊢ <;> + first | linear_combination this | exact this + +theorem S4_ne_zero (T : Matrix (Fin 3) (Fin 3) K) (κ δ : K) (h : Mcore T κ ≠ 0) : + S4 T κ δ ≠ 0 := by + intro hS; apply h + ext i j + have := congrFun (congrFun hS i.castSucc) j.castSucc + fin_cases i <;> fin_cases j <;> + simp [S4, Mcore, Gm, Dq, Matrix.mul_apply, Fin.sum_univ_three, diagonal_apply] at this ⊢ <;> + first | linear_combination this | exact this + +theorem Mcore_ne_zero (h2 : (2 : K) ≠ 0) (T : Matrix (Fin 3) (Fin 3) K) (κ : K) + (hdet : (1 - T * Gm κ).det = -1) : Mcore T κ ≠ 0 := by + by_cases hk : κ = 0 + · subst hk; exact core_k0_ne_zero h2 T + · exact core_neither_ne_zero h2 T κ hdet + + +theorem rank_eq_finrank (M : Matrix (Ix E) (Ix E) K) : + (M - 1).rank = finrank K (range (Matrix.toLin' M - 1)) := by + have hsub : Matrix.toLin' M - 1 = Matrix.toLin' (M - 1) := by + rw [map_sub, Matrix.toLin'_one]; rfl + rw [hsub]; rfl + +/-- the core case `η_C ≠ 0` (E-part cases and neither), `k = 0` left as `hk0`. -/ +theorem core_main (h2 : (2 : K) ≠ 0) (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) + (hu5 : u I5 = 0) (hu6 : u I6 = 0) (hη5 : η I5 = 0) (hη6 : η I6 = 0) + (hdet : (Pm u η T).det = -1) (hηC : ∃ c, η (Sum.inl c) ≠ 0) + (hk0 : η ⬝ᵥ u = 0 → (Lam u η T - 1).rank = 4 → Lam u η T * Lam u η T = 1) : + 4 ≤ (Lam u η T - 1).rank ∧ + ((Lam u η T - 1).rank = 4 → Lam u η T * Lam u η T = 1) := by + have hU : IsUnit (Pm u η T).det := by rw [hdet]; exact isUnit_one.neg + have hdk : (1 - T * Gm (η ⬝ᵥ u)).det = -1 := det_gm u η T hu5 hu6 hη5 hη6 hdet + have hdu := dot_u u η hη5 hη6 ⟨hu5, hu6⟩ + have key : ∃ r : ℕ, 1 ≤ r ∧ + 3 + r ≤ finrank K (range (Matrix.toLin' (Lam u η T) - 1)) ∧ + (r ≤ 1 → η ⬝ᵥ u ≠ 0 → (T - Dp).rank ≤ 2) := by + by_cases hu : ∃ e, u (cE e) ≠ 0 <;> by_cases hη : ∃ e, η (cE e) ≠ 0 + · refine ⟨(S4 T (kC η u) 1).rank, ?_, + key4 h2 u η T hu5 hu6 hη5 hη6 hU hη 1 (Or.inr hu), fun hr _ => case4 T _ hr⟩ + refine rank_pos_of_ne_zero _ (fun h => ?_) + have := congrFun (congrFun h 3) 2 + simp [S4] at this + · push_neg at hη + have hk : η ⬝ᵥ u = kC η u := by rw [hdu, lam_zero η u hη]; ring + refine ⟨(S3 T (kC η u) 1).rank, ?_, + key3 h2 u η T hu5 hu6 hη5 hη6 hU hη 1 (Or.inr hu), + fun hr hk' => case2 T _ (by rwa [← hk]) (by rw [← hk]; exact hdk) hr⟩ + refine rank_pos_of_ne_zero _ (fun h => ?_) + have := congrFun (congrFun h 3) 2 + simp [S3] at this + · push_neg at hu + have hk : η ⬝ᵥ u = kC η u := by rw [hdu, lam_zero' η u hu]; ring + have hd' : (1 - T * Gm (kC η u)).det = -1 := by rw [← hk]; exact hdk + exact ⟨(S4 T (kC η u) 0).rank, + rank_pos_of_ne_zero _ (S4_ne_zero _ _ _ (Mcore_ne_zero h2 T _ hd')), + key4 h2 u η T hu5 hu6 hη5 hη6 hU hη 0 (Or.inl rfl), + fun hr hk' => case3 h2 T _ (by rwa [← hk]) hd' hr⟩ + · push_neg at hu hη + have hk : η ⬝ᵥ u = kC η u := by rw [hdu, lam_zero η u hη]; ring + have hd' : (1 - T * Gm (kC η u)).det = -1 := by rw [← hk]; exact hdk + exact ⟨(S3 T (kC η u) 0).rank, + rank_pos_of_ne_zero _ (S3_ne_zero _ _ _ (Mcore_ne_zero h2 T _ hd')), + key3 h2 u η T hu5 hu6 hη5 hη6 hU hη 0 (Or.inl rfl), + fun hr hk' => case1 h2 T _ (by rwa [← hk]) hd' hr⟩ + obtain ⟨r, hr1, hr3, hr2⟩ := key + have hR := rank_eq_finrank (Lam u η T) + refine ⟨by omega, fun h4 => ?_⟩ + by_cases hk : η ⬝ᵥ u = 0 + · exact hk0 hk h4 + have hT := hr2 (by omega) hk + have hE := Em1_bound h2 u η T hu5 hu6 hη5 hη6 hU hηC hT + have h1 := LinearMap.finrank_range_add_finrank_ker (Matrix.toLin' (Lam u η T) - 1) + have h5 := finrank_ix (K := K) E + have hinv := invol_of_dims_ge h2 (Matrix.toLin' (Lam u η T)) (by omega) + apply Matrix.toLin'.injective + rw [Matrix.toLin'_mul, Matrix.toLin'_one] + exact LinearMap.ext fun w => hinv w + +/-- **`spec0_core_U4`.** #0's model at `U = 4` (coordinates `Fin 4 ⊕ (Fin 2 ⊕ E)`; `D = -1` on `C4` +and `e5`, `+1` on `e6`, `E'`; `P = 1 - X T Yᵀ` with `X = (e5, e6, u)`, `Y = (e5, e6, η)`, `u, η` +vanishing on `e5, e6`; `det P = -1`; char ≠ 2). Then `rank(Λ - 1) ≥ 4` and rank `= 4 ⇒ Λ² = 1`, +for `Λ = P⁻¹ D`, EXCEPT on the locus `k = η·u = 0`, where the involution step is the hypothesis +`hk0` (certified separately by the Singular radical computation). The rank bound itself holds +with no `k` hypothesis. -/ +theorem spec0_core_U4 (h2 : (2 : K) ≠ 0) (u η : Ix E → K) (T : Matrix (Fin 3) (Fin 3) K) + (hu5 : u I5 = 0) (hu6 : u I6 = 0) (hη5 : η I5 = 0) (hη6 : η I6 = 0) + (hdet : (Pm u η T).det = -1) + (hk0 : η ⬝ᵥ u = 0 → (Lam u η T - 1).rank = 4 → Lam u η T * Lam u η T = 1) : + 4 ≤ (Lam u η T - 1).rank ∧ + ((Lam u η T - 1).rank = 4 → Lam u η T * Lam u η T = 1) := by + by_cases hηC : ∃ c, η (Sum.inl c) ≠ 0 + · exact core_main h2 u η T hu5 hu6 hη5 hη6 hdet hηC hk0 + · push_neg at hηC + have hU : IsUnit (Pm u η T).det := by rw [hdet]; exact isUnit_one.neg + have hd : ∀ j, dm K E j * dm K E j = 1 := by + intro j; rcases j with j | e + · fin_cases j <;> simp [dm] + · simp [dm] + have hPc : ∀ (j : Ix E) (i : Fin 4), Pm u η T j (Sum.inl i) = + (1 : Matrix (Ix E) (Ix E) K) j (Sum.inl i) := by + intro j i + simp [Pm, Matrix.mul_apply, Fin.sum_univ_three, vt, hηC i] + exact lemmaU_mat_T h2 (dm K E) hd (Pm u η T) hU hPc + +end Compose + +end SpecLemmaU2 + +#print axioms SpecLemmaU2.kb +#print axioms SpecLemmaU2.key3 +#print axioms SpecLemmaU2.key4 +#print axioms SpecLemmaU2.Em1_bound +#print axioms SpecLemmaU2.case1 +#print axioms SpecLemmaU2.case2 +#print axioms SpecLemmaU2.case3 +#print axioms SpecLemmaU2.case4 +#print axioms SpecLemmaU2.core_main +#print axioms SpecLemmaU2.spec0_core_U4 diff --git a/research/p104-lean-premises/lean/Nov15/SpecLemmaU2.md b/research/p104-lean-premises/lean/Nov15/SpecLemmaU2.md new file mode 100644 index 0000000000..d0abacc856 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecLemmaU2.md @@ -0,0 +1,15 @@ +# Nov15/SpecLemmaU2.lean +Extends SpecLemmaU.lean (import Nov15.SpecLemmaU). Kernel-only: no sorry, no native_decide; 10 `#print axioms` all [propext, Classical.choice, Quot.sound]; ~23 s / 2.1 GB. Paper statements are TRUE as written (no counterexample). + +Model (explicit coordinates `Ix E = Fin 4 ⊕ (Fin 2 ⊕ E)`: C4 = inl, e5 = I5, e6 = I6, E' = E): D = Dm (-1 on C4 and e5, +1 on e6, E'); P = 1 - X T Y^T, X = (e5,e6,u), Y = (e5,e6,η), u, η vanish on e5, e6 (RB6 normalisation); hypothesis det P = -1 (full matrix; the three-reflection fact stays a hypothesis); Λ = P⁻¹ D; char ≠ 2. + +## Discharge of hrk / hE (as the inequalities actually needed) +- `kb` (generic): injection ker f → ker S × B bounds `dim ker f + rank S ≤ #cols + dim B`. +- `key3` (η_E = 0), `key4` (η_E ≠ 0): `3 + rank S ≤ rank(Λ-1)` from the kernel equations (`fix_eqs`: w_C = (σ3/2) u_C, σ1 = 2 w5, σ2 = 0, σ3 u_E = 0, via `rows_eq`), with S = `S3`/`S4` = Msys (4x3 or 4x4: extra row (0,0,δ[,0]) iff u_E ≠ 0, extra column T e3 iff η_E ≠ 0). This replaces `hrk` (equality) by `≥`, which is all the argument uses; u_C ≠ 0 is not needed. +- `Em1_bound`: `rank(T - diag(0,2,0)) ≤ 2` (η_C ≠ 0) ⇒ `dim ker(Λ+1) ≥ 4` via the explicit injection (t, c) ↦ w with C4 = t_3 c0 + c (η_C·c0 = 1, η_C·c = 0), e5 = t_0, e6 = t_1, E' = 0. Replaces `hE`. +## The E-part cases (rank S ≤ 1 ⇒ rank(T - Dp) ≤ 2) +`case1` (neither; via SpecLemmaU.core_neither_rank), `case2` (u_E only: T = [2e1 | 0 | *], det ⇒ k·t33 = 0), `case3` (η_E only: a_i·(κc3 - c2) = 2δ_i3 ⇒ T e3 = 0 after det), `case4` (both: T e3 = 0; no k needed, T = diag(2,0,0)). Matches the audit's G-dependence argument (S depends on u_E, η_E only through the flags and κ_C). +## Composition +`spec0_core_U4`: 4 ≤ rank(Λ-1) (all k, all E-cases), and rank = 4 ⇒ Λ² = 1 for k = η·u ≠ 0; the k = 0 involution step is the named hypothesis `hk0` (parallel Singular run). Case η_C = 0 goes through `lemmaU_mat_T`. (u_C = 0 needs no separate branch.) +## Still named hypotheses +det P = -1, the RB5 structure (u, η normalisation, D shape), INV, k = 0 involution (`hk0`), the Singular k = 0 radical checks and the 720-order reduction. Not formalised: Sylvester ⇒ p0+q0 ≤ 2 is in SpecLemmaU; its link to this model (V = e56 ⊕ ) is by hypothesis. diff --git a/research/p104-lean-premises/lean/Nov15/SpecRankP.lean b/research/p104-lean-premises/lean/Nov15/SpecRankP.lean new file mode 100644 index 0000000000..ded997b6db --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecRankP.lean @@ -0,0 +1,239 @@ +/- +SPECBREAK RB4 general rank lemma (item 1), Source: internal notes item 1, RB1/RESULT.md (definitions of Delta, V, e1). +See SpecRankP.md for the exact statements. +-/ +import Mathlib.LinearAlgebra.Determinant +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +import Mathlib.LinearAlgebra.Matrix.Rank +import Mathlib.LinearAlgebra.Matrix.ToLin +import Mathlib.Tactic.LinearCombination +import Mathlib.Tactic.Abel + +open Module LinearMap + +set_option linter.unusedSectionVars false + +namespace SpecRankP + +variable {K W : Type*} [Field K] [AddCommGroup W] [Module K W] [FiniteDimensional K W] + +/-- If `P - 1` maps into `V`, `dim V ≤ 2`, `P s₀ = -s₀`, `P e₁ = e₁` with `s₀, e₁ ∈ V` independent, +then `det P = -1`. -/ +theorem det_neg_one (V : Submodule K W) (hV : finrank K V ≤ 2) (P : W →ₗ[K] W) + (hP : ∀ w, P w - w ∈ V) (s0 e1 : W) (hs0 : s0 ∈ V) (he1 : e1 ∈ V) + (hind : ∀ a b : K, a • s0 + b • e1 = 0 → a = 0 ∧ b = 0) + (hPs : P s0 = -s0) (hPe : P e1 = e1) : P.det = -1 := by + have hmap : ∀ v ∈ V, P v ∈ V := fun v hv => by + have := V.add_mem (hP v) hv + simpa using this + have he : V ≤ V.comap P := fun v hv => hmap v hv + rw [LinearMap.det_eq_det_mul_det V P he] + have hq : V.mapQ V P he = LinearMap.id := by + refine LinearMap.ext fun x => ?_ + obtain ⟨w, rfl⟩ := Submodule.Quotient.mk_surjective V x + simp only [Submodule.mapQ_apply, LinearMap.id_apply] + exact (Submodule.Quotient.eq V).2 (hP w) + rw [hq, LinearMap.det_id, mul_one] + let x0 : V := ⟨s0, hs0⟩ + let x1 : V := ⟨e1, he1⟩ + have hli : LinearIndependent K ![x0, x1] := by + rw [Fintype.linearIndependent_iff] + intro g hg + have h' : g 0 • s0 + g 1 • e1 = 0 := by + have := congrArg Subtype.val hg + simpa [Fin.sum_univ_two, x0, x1] using this + have := hind _ _ h' + intro i; fin_cases i + · exact this.1 + · exact this.2 + have hcard : Fintype.card (Fin 2) = finrank K V := by + have := hli.fintype_card_le_finrank + simp only [Fintype.card_fin] at this ⊢ + omega + let b := basisOfLinearIndependentOfCardEqFinrank hli hcard + have hb : ∀ i, b i = ![x0, x1] i := fun i => by + simp [b] + rw [← LinearMap.det_toMatrix b, Matrix.det_fin_two] + have e0 : (P.restrict he) (b 0) = -(b 0) := by + rw [hb]; exact Subtype.ext (by simpa [x0] using hPs) + have e1' : (P.restrict he) (b 1) = b 1 := by + rw [hb]; exact Subtype.ext (by simpa [x1] using hPe) + simp [LinearMap.toMatrix_apply, e0, e1'] + +/-- **RB4 general rank lemma, abstract form.** `S` a subspace on which `Δ = -1`, a vector `e₁ ∉ S` +with `Δ e₁ = e₁`, `V ∋ e₁` with `dim V ≤ 2`, `im(P - 1) ⊆ V`, `det P = 1`, char ≠ 2. +Then `dim S ≤ rank(Δ - P)`. -/ +theorem rank_ge (h2 : (2 : K) ≠ 0) (S V : Submodule K W) (Δ P : W →ₗ[K] W) + (hΔS : ∀ s ∈ S, Δ s = -s) (e1 : W) (hΔe : Δ e1 = e1) (heS : e1 ∉ S) + (hV : finrank K V ≤ 2) (heV : e1 ∈ V) (hP : ∀ w, P w - w ∈ V) (hdet : P.det = 1) : + finrank K S ≤ finrank K (range (Δ - P)) := by + set f := Δ - P with hf + have hfw : ∀ w, f w = Δ w - P w := fun w => rfl + have hfs : ∀ s ∈ S, f s = -((2 : K) • s) - (P s - s) := by + intro s hs + rw [hfw, hΔS s hs, two_smul]; abel + have hc : ∀ s ∈ S, f s ∈ V → s ∈ V := by + intro s hs hfv + have h2s : (2 : K) • s ∈ V := by + have : (2 : K) • s = -(f s) - (P s - s) := by rw [hfs s hs]; abel + rw [this]; exact V.sub_mem (V.neg_mem hfv) (hP s) + have := V.smul_mem (2 : K)⁻¹ h2s + rwa [smul_smul, inv_mul_cancel₀ h2, one_smul] at this + have hfe : f e1 ∈ V := by + have : f e1 = -(P e1 - e1) := by rw [hfw, hΔe]; abel + rw [this]; exact V.neg_mem (hP e1) + have hSV : finrank K (S ⊓ V : Submodule K W) ≤ 1 := by + have hlt : (S ⊓ V) < V := lt_of_le_of_ne inf_le_right (fun h => heS (by + have : e1 ∈ S ⊓ V := by rw [h]; exact heV + exact this.1)) + have := Submodule.finrank_lt_finrank_of_lt hlt + omega + let fS : S →ₗ[K] W := f.comp S.subtype + have hrn := LinearMap.finrank_range_add_finrank_ker fS + have hrangeS : range fS = Submodule.map f S := by + rw [LinearMap.range_comp, Submodule.range_subtype] + have hrange : Submodule.map f S ≤ range f := by + rw [← hrangeS]; exact LinearMap.range_comp_le_range _ _ + by_cases hk : ker fS = ⊥ + · have h0 : finrank K (ker fS) = 0 := by rw [hk]; simp + have : finrank K S ≤ finrank K (Submodule.map f S) := by rw [← hrangeS]; omega + exact this.trans (Submodule.finrank_mono hrange) + · obtain ⟨⟨s0, hs0S⟩, hs0k, hs0ne⟩ := (Submodule.ne_bot_iff _).1 hk + have hfs0 : f s0 = 0 := by simpa [fS] using hs0k + have hs0ne' : s0 ≠ 0 := fun h => hs0ne (Subtype.ext h) + have hs0V : s0 ∈ V := hc s0 hs0S (by rw [hfs0]; exact V.zero_mem) + -- kernel dimension ≤ 1 + have hkle : finrank K (ker fS) ≤ 1 := by + rw [← Submodule.finrank_map_subtype_eq S (ker fS)] + refine le_trans (Submodule.finrank_mono ?_) hSV + rintro w ⟨⟨s, hs⟩, hsk, rfl⟩ + refine ⟨hs, hc s hs ?_⟩ + have : f s = 0 := by simpa [fS] using hsk + rw [this]; exact V.zero_mem + -- S ⊓ V is spanned by s0 + have hspan : ∀ s ∈ S, s ∈ V → ∃ c : K, s = c • s0 := by + intro s hs hsV + let v0 : (S ⊓ V : Submodule K W) := ⟨s0, hs0S, hs0V⟩ + have hv0 : v0 ≠ 0 := fun h => hs0ne' (congrArg Subtype.val h) + have hpos : 0 < finrank K (S ⊓ V : Submodule K W) := + Module.finrank_pos_iff_exists_ne_zero.2 ⟨v0, hv0⟩ + have h1 : finrank K (S ⊓ V : Submodule K W) = 1 := by omega + obtain ⟨c, hc'⟩ := (finrank_eq_one_iff_of_nonzero' v0 hv0).1 h1 ⟨s, hs, hsV⟩ + exact ⟨c, (congrArg Subtype.val hc').symm⟩ + have hind : ∀ a b : K, a • s0 + b • e1 = 0 → a = 0 ∧ b = 0 := by + intro a b hab + have hb : b = 0 := by + by_contra hb + apply heS + have : e1 = (-(a / b)) • s0 := by + have : b • e1 = -(a • s0) := eq_neg_of_add_eq_zero_right hab + calc e1 = b⁻¹ • (b • e1) := by rw [smul_smul, inv_mul_cancel₀ hb, one_smul] + _ = (-(a / b)) • s0 := by rw [this, smul_neg, smul_smul]; simp [div_eq_inv_mul] + rw [this]; exact S.smul_mem _ hs0S + subst hb + simp only [zero_smul, add_zero, smul_eq_zero] at hab + exact ⟨hab.resolve_right hs0ne', rfl⟩ + have hfe0 : f e1 ≠ 0 := by + intro h0 + have hPe : P e1 = e1 := by + have : Δ e1 - P e1 = 0 := h0 + rw [hΔe] at this; exact (sub_eq_zero.1 this).symm + have hPs : P s0 = -s0 := by + have : Δ s0 - P s0 = 0 := hfs0 + rw [hΔS s0 hs0S] at this; exact (sub_eq_zero.1 this).symm + have := det_neg_one V hV P hP s0 e1 hs0V heV hind hPs hPe + rw [hdet] at this + apply h2 + have : (1 : K) + 1 = 0 := by linear_combination this + simpa [one_add_one_eq_two] using this + have hnot : f e1 ∉ Submodule.map f S := by + rintro ⟨s, hs, hse⟩ + obtain ⟨c, rfl⟩ := hspan s hs (hc s hs (by rw [hse]; exact hfe)) + apply hfe0 + rw [← hse, map_smul, hfs0, smul_zero] + have hdim := Submodule.finrank_sup_span_singleton hnot + have hle : (Submodule.map f S ⊔ Submodule.span K {f e1} : Submodule K W) ≤ range f := by + refine sup_le hrange ?_ + rw [Submodule.span_le]; rintro _ rfl; exact ⟨e1, rfl⟩ + have h1 := Submodule.finrank_mono hle + have h3 : finrank K S ≤ finrank K (Submodule.map f S) + 1 := by + rw [← hrangeS]; omega + omega + + +/-! ## Matrix form in the RB1 coordinates (e₁ | S = 4 coordinates | ancillas) -/ +section Mat +open Matrix + +/-- `Δ = -1` on the four `S`-coordinates, `+1` on `e₁` and the ancillas. -/ +def Dl (K : Type*) [Field K] (ι : Type*) [DecidableEq ι] : Matrix (Unit ⊕ Fin 4 ⊕ ι) (Unit ⊕ Fin 4 ⊕ ι) K := + Matrix.diagonal (Sum.elim (fun _ => 1) (Sum.elim (fun _ => -1) (fun _ => 1))) + +/-- **RB4 item 1, concrete form.** char ≠ 2, `V` a subspace of dimension ≤ 2 containing `e₁`, +`im(P - I) ⊆ V`, `det P = 1` ⇒ `rank(Δ - P) ≥ 4`. -/ +theorem rank_ge_four {K : Type*} [Field K] {ι : Type*} [Fintype ι] [DecidableEq ι] + (h2 : (2 : K) ≠ 0) (P : Matrix (Unit ⊕ Fin 4 ⊕ ι) (Unit ⊕ Fin 4 ⊕ ι) K) + (V : Submodule K (Unit ⊕ Fin 4 ⊕ ι → K)) (hV : finrank K V ≤ 2) + (he1 : (Pi.single (Sum.inl ()) 1 : Unit ⊕ Fin 4 ⊕ ι → K) ∈ V) + (hP : ∀ w, P *ᵥ w - w ∈ V) (hdet : P.det = 1) : + 4 ≤ (Dl K ι - P).rank := by + let S : Submodule K (Unit ⊕ Fin 4 ⊕ ι → K) := + Submodule.span K (Set.range fun i : Fin 4 => (Pi.single (Sum.inr (Sum.inl i)) 1 : Unit ⊕ Fin 4 ⊕ ι → K)) + have hli : LinearIndependent K (fun i : Fin 4 => (Pi.single (Sum.inr (Sum.inl i)) 1 : Unit ⊕ Fin 4 ⊕ ι → K)) := by + have := (Pi.basisFun K (Unit ⊕ Fin 4 ⊕ ι)).linearIndependent + have h := this.comp (fun i : Fin 4 => (Sum.inr (Sum.inl i) : Unit ⊕ Fin 4 ⊕ ι)) + (fun a b h => by simpa using h) + convert h using 1 + funext i + simp [Pi.basisFun_apply] + have hS : finrank K S = 4 := by + simpa using finrank_span_eq_card hli + have hΔS : ∀ s ∈ S, Matrix.toLin' (Dl K ι) s = -s := by + intro s hs + refine Submodule.span_induction ?_ ?_ ?_ ?_ hs + · rintro _ ⟨i, rfl⟩ + ext j + simp [Dl, Matrix.toLin'_apply, Matrix.mulVec_diagonal, Pi.single_apply] + aesop + · simp + · intro x y _ _ hx hy; rw [map_add, hx, hy]; abel + · intro a x _ hx; rw [map_smul, hx]; simp + have hΔe : Matrix.toLin' (Dl K ι) (Pi.single (Sum.inl ()) 1) = Pi.single (Sum.inl ()) 1 := by + ext j + simp only [Dl, Matrix.toLin'_apply, Matrix.mulVec_diagonal, Pi.single_apply] + split_ifs with h <;> simp [h] + have heS : (Pi.single (Sum.inl ()) 1 : Unit ⊕ Fin 4 ⊕ ι → K) ∉ S := by + intro hm + have hmem : ∀ x ∈ S, x (Sum.inl ()) = 0 := by + intro x hx + refine Submodule.span_induction ?_ ?_ ?_ ?_ hx + · rintro _ ⟨i, rfl⟩; simp [Pi.single_apply] + · simp + · intro x y _ _ hx hy; simp [hx, hy] + · intro a x _ hx; simp [hx] + have := hmem _ hm + simp at this + have := rank_ge h2 S V (Matrix.toLin' (Dl K ι)) (Matrix.toLin' P) hΔS _ hΔe heS hV he1 + (fun w => by simpa [Matrix.toLin'_apply] using hP w) (by rw [LinearMap.det_toLin']; exact hdet) + rw [hS] at this + have e : (Dl K ι - P).rank = finrank K (range (Matrix.toLin' (Dl K ι) - Matrix.toLin' P)) := by + rw [← map_sub]; rfl + rw [e]; exact this + +end Mat + +/-- Sharpness: the hypothesis `det P = 1` cannot be dropped (here `dim S = 1`, `P = Δ`, `det P = -1`, +`rank(Δ - P) = 0`). -/ +theorem det_needed : + ∃ (P Δ : Matrix (Fin 2) (Fin 2) ℚ), (∀ w, P.mulVec w - w ∈ (⊤ : Submodule ℚ (Fin 2 → ℚ))) ∧ + P.det = -1 ∧ (Δ - P).rank = 0 := by + refine ⟨Matrix.diagonal ![-1, 1], Matrix.diagonal ![-1, 1], fun _ => trivial, ?_, ?_⟩ + · simp [Matrix.det_fin_two] + · simp + +end SpecRankP + +#print axioms SpecRankP.det_neg_one +#print axioms SpecRankP.rank_ge +#print axioms SpecRankP.rank_ge_four +#print axioms SpecRankP.det_needed diff --git a/research/p104-lean-premises/lean/Nov15/SpecRankP.md b/research/p104-lean-premises/lean/Nov15/SpecRankP.md new file mode 100644 index 0000000000..ce24ed6d03 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecRankP.md @@ -0,0 +1,12 @@ +# Nov15/SpecRankP.lean +Formalises SPEC-B RB4 item 1 (internal notes), a general rank lemma. Kernel-only: no sorry, no native_decide; 4 `#print axioms` all [propext, Classical.choice, Quot.sound]. 11-22 s / 2.0 GB, Mathlib sub-imports only (`import Mathlib` hits the 3.5 GB guard). + +## Proved (paper statement TRUE as written; the proof matches RB4's) +- `rank_ge` (abstract, any field with 2 != 0, finite-dim W): S a subspace with Delta = -1 on S; e1 not in S with Delta e1 = e1; V contains e1, dim V <= 2; (P - 1) w in V for all w; det P = 1. Then dim S <= rank(Delta - P). Note: only "Delta = -1 on S, Delta e1 = e1, e1 not in S" is used (no complement T, no S+ structure needed); dim S arbitrary. +- `rank_ge_four` (matrix form in the RB1 coordinates, index Unit + Fin 4 + iota; Delta = `Dl` = diag(+1 on e1, -1 on the four S coordinates, +1 on ancillas); e1 = Pi.single (inl ()) 1): same hypotheses => 4 <= Matrix.rank (Dl - P). This is "U = 3 dead for any such P". +- `det_neg_one`: the d = 1 step (f|V = 0 forces P|V = diag(-1, 1), det P = -1) as a stand-alone lemma via `LinearMap.det_eq_det_mul_det` (P induces identity on W/V). +- `det_needed`: counterexample over Q (2x2, P = Delta = diag(-1,1), V = everything, det P = -1, rank(Delta - P) = 0 < dim S = 1) showing `det P = 1` cannot be dropped. +- Proof route (Lean): f = Delta - P; f s = -2s - (P s - s) on S, so f s in V => s in V (char != 2); f e1 in V; dim(S cap V) <= 1 (e1 in V \ S). Either f|S injective (rank >= dim S), or some s0 != 0 in S has f s0 = 0, then S cap V = , f(S) cap V = 0, f e1 != 0 (else det P = -1), f e1 not in f(S), so rank >= (dim S - 1) + 1. + +## NOT proved: Theorem B consequence at U = 4 (two reflections, rank <= 4 => P Delta P = Delta) +Not formalised. RB4 item 4 rests on Singular radical tests over GL-normalised n = 7 strata (and the RB3 perfect-pairing by-hand argument), and RB4 itself records that the statement is FALSE for the general (u1,u2,q) family in the degenerate stratum q(v) = 0 (rank-4 non-involutions gen10/gen11). A Lean proof would need the hypotheses: P = (I - x_a y_a^T)(I - x_b y_b^T), y_i . x_i = 2, x's in V (dim 2, e1 in V), y's in Y (e1* in Y), plus the pairing condition; the abstract rank lemma alone does not give involutivity (the two-reflection structure is essential). Equality-case facts from the proof that a future Theorem B proof can start from: rank = dim S forces, when S cap V = 0, f e1 = 0 (P e1 = e1) and f(V-component) = 0; when S cap V = , P s0 = -s0 and f e1 != 0. diff --git a/research/p104-lean-premises/lean/Nov15/SpecRankP2.lean b/research/p104-lean-premises/lean/Nov15/SpecRankP2.lean new file mode 100644 index 0000000000..448e943d65 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecRankP2.lean @@ -0,0 +1,273 @@ +/- +SPECBREAK RB4 item (c): the U = 4 step of #7's kill, in the form the AUDIT confirmed . +Source: internal notes,AUDIT}.md, LEDGER "#7 status". See SpecRankP2.md. +-/ +import Nov15.SpecRankP +import Nov15.SpecINV + +open Matrix Module SpecTSUR SpecRankP + +set_option linter.unusedSectionVars false + +namespace SpecRankP2 + +variable {K : Type*} [Field K] {ι : Type*} [Fintype ι] [DecidableEq ι] + +/-- RB1 coordinates: `e₁ | S = 4 coordinates | ancillas`. -/ +abbrev Nn (ι : Type*) := Unit ⊕ Fin 4 ⊕ ι + +/-- the reflection `ρ = I - e₁ (2 e₁*)ᵀ`: `-1` on `e₁`, `+1` elsewhere. -/ +def rho (K : Type*) [Field K] (ι : Type*) [Fintype ι] [DecidableEq ι] : Matrix (Nn ι) (Nn ι) K := + diagonal (Sum.elim (fun _ => -1) (fun _ => 1)) + +/-- `N = ρΔ`: `-1` on `e₁` and `S`, `+1` on the ancillas. -/ +def Nd (K : Type*) [Field K] (ι : Type*) [Fintype ι] [DecidableEq ι] : Matrix (Nn ι) (Nn ι) K := + diagonal (Sum.elim (fun _ => -1) (Sum.elim (fun _ => -1) (fun _ => 1))) + +/-- the vector `e₁`. -/ +def e1v (K : Type*) [Field K] (ι : Type*) [Fintype ι] [DecidableEq ι] : Nn ι → K := + Pi.single (Sum.inl ()) 1 + +theorem rho_eq_refl : rho K ι = SpecTSUR.refl (e1v K ι) ((2 : K) • e1v K ι) := by + ext a b + rcases a with a | a | a <;> rcases b with b | b | b <;> + simp [rho, SpecTSUR.refl, e1v, vecMulVec_apply, diagonal_apply, Pi.single_apply, Matrix.one_apply] <;> norm_num + +theorem rho_mul_rho : rho K ι * rho K ι = 1 := by + rw [rho, diagonal_mul_diagonal, ← diagonal_one]; congr 1; funext a + rcases a with a | a | a <;> simp + +theorem rho_mul_Nd : rho K ι * Nd K ι = Dl K ι := by + rw [rho, Nd, Dl, diagonal_mul_diagonal]; congr 1; funext a + rcases a with a | a | a <;> simp + +theorem Nd_mul_rho : Nd K ι * rho K ι = Dl K ι := by + rw [rho, Nd, Dl, diagonal_mul_diagonal]; congr 1; funext a + rcases a with a | a | a <;> simp + +theorem Dl_mul_rho : Dl K ι * rho K ι = Nd K ι := by + rw [rho, Nd, Dl, diagonal_mul_diagonal]; congr 1; funext a + rcases a with a | a | a <;> simp + +theorem rho_mul_Dl : rho K ι * Dl K ι = Nd K ι := by + rw [rho, Nd, Dl, diagonal_mul_diagonal]; congr 1; funext a + rcases a with a | a | a <;> simp + +theorem Dl_mul_Dl : Dl K ι * Dl K ι = 1 := by + rw [Dl, diagonal_mul_diagonal, ← diagonal_one]; congr 1; funext a + rcases a with a | a | a <;> simp + +theorem det_rho : (rho K ι).det = -1 := by + rw [rho, det_diagonal, Fintype.prod_sum_type] + simp + +/-! ## §1. rank ≤ 4 forces the reflection to live on `e₁, S` -/ + +/-- If `x` has a nonzero ancilla coordinate then `rank(N - I + x yᵀ) ≥ 5`. (No condition on `y`.) -/ +theorem anc_zero (h2 : (2 : K) ≠ 0) (x y : Nn ι → K) + (hr : (Nd K ι - 1 + vecMulVec x y).rank ≤ 4) : ∀ j, x (Sum.inr (Sum.inr j)) = 0 := by + by_contra hcon + push_neg at hcon + obtain ⟨j0, hj0⟩ := hcon + set A : Matrix (Nn ι) (Nn ι) K := Nd K ι - 1 + vecMulVec x y with hA + set f := A.mulVecLin with hf + have hrn := LinearMap.finrank_range_add_finrank_ker f + have hrank : Matrix.rank A = finrank K (LinearMap.range f) := rfl + have hdom : finrank K (Nn ι → K) = 5 + Fintype.card ι := by + simp [Module.finrank_fintype_fun_eq_card]; omega + let g : LinearMap.ker f →ₗ[K] (ι → K) := + (LinearMap.funLeft K K (fun j : ι => (Sum.inr (Sum.inr j) : Nn ι))).comp (LinearMap.ker f).subtype + have hinj : Function.Injective g := by + rw [← LinearMap.ker_eq_bot, LinearMap.ker_eq_bot'] + intro u hu + have hu' : ∀ j, (u : Nn ι → K) (Sum.inr (Sum.inr j)) = 0 := fun j => by + have := congrFun hu j + simpa [g, LinearMap.funLeft] using this + have hAu : A *ᵥ (u : Nn ι → K) = 0 := u.2 + have hcoord : ∀ i, (Nd K ι).mulVec (u : Nn ι → K) i - (u : Nn ι → K) i + x i * (y ⬝ᵥ (u : Nn ι → K)) = 0 := by + intro i + have := congrFun hAu i + simp [hA, add_mulVec, sub_mulVec, vecMulVec_mulVec, Matrix.one_mulVec] at this + linear_combination this + have hc : y ⬝ᵥ (u : Nn ι → K) = 0 := by + have := hcoord (Sum.inr (Sum.inr j0)) + simp [Nd, mulVec_diagonal, hu' j0] at this + rcases this with h | h + · exact absurd h hj0 + · exact h + apply Subtype.ext + funext i + have := hcoord i + rw [hc] at this + rcases i with i | i | i + · simp [Nd, mulVec_diagonal] at this + have : (2 : K) * (u : Nn ι → K) (Sum.inl i) = 0 := by linear_combination -this + simpa [h2] using this + · simp [Nd, mulVec_diagonal] at this + have : (2 : K) * (u : Nn ι → K) (Sum.inr (Sum.inl i)) = 0 := by linear_combination -this + simpa [h2] using this + · simpa using hu' i + have hker : finrank K (LinearMap.ker f) ≤ Fintype.card ι := by + have := LinearMap.finrank_le_finrank_of_injective hinj + simpa [Module.finrank_fintype_fun_eq_card] using this + omega + +/-- rank ≤ 4 ⇒ both `x` and `y` vanish on the ancillas (transpose for `y`). -/ +theorem anc_zero_both (h2 : (2 : K) ≠ 0) (x y : Nn ι → K) + (hr : (Nd K ι - 1 + vecMulVec x y).rank ≤ 4) : + (∀ j, x (Sum.inr (Sum.inr j)) = 0) ∧ (∀ j, y (Sum.inr (Sum.inr j)) = 0) := by + refine ⟨anc_zero h2 x y hr, anc_zero h2 y x ?_⟩ + have : (Nd K ι - 1 + vecMulVec x y)ᵀ = Nd K ι - 1 + vecMulVec y x := by + rw [transpose_add, transpose_sub, transpose_vecMulVec, Nd, transpose_one, diagonal_transpose] + rw [← this, rank_transpose]; exact hr + +/-! ## §2. supported reflection commutes with `N` -/ + +theorem JNJ (x y : Nn ι → K) (hxy : y ⬝ᵥ x = 2) + (hx : ∀ j, x (Sum.inr (Sum.inr j)) = 0) (hy : ∀ j, y (Sum.inr (Sum.inr j)) = 0) : + SpecTSUR.refl x y * Nd K ι * SpecTSUR.refl x y = Nd K ι := by + have hNx : Nd K ι *ᵥ x = -x := by + funext i; rcases i with i | i | i <;> simp [Nd, mulVec_diagonal, hx] + have hyN : y ᵥ* Nd K ι = -y := by + funext i; rcases i with i | i | i <;> simp [Nd, vecMul_diagonal, hy] + set M := vecMulVec x y with hM + have h1 : M * Nd K ι = -M := by + rw [hM, vecMulVec_mul, hyN, vecMulVec_neg] + have h2 : Nd K ι * M = -M := by + rw [hM, mul_vecMulVec, hNx, neg_vecMulVec] + have h3 : M * M = (2 : K) • M := by + rw [hM, vecMulVec_mul_vecMulVec, hxy]; ext a b; simp [vecMulVec_apply]; ring + have : SpecTSUR.refl x y * Nd K ι * SpecTSUR.refl x y = Nd K ι - M * Nd K ι - Nd K ι * M + M * (Nd K ι * M) := by + rw [SpecTSUR.refl, ← hM]; noncomm_ring + rw [this, h1, h2, mul_neg, h3]; module + +theorem refl_sq (x y : Nn ι → K) (hxy : y ⬝ᵥ x = 2) : SpecTSUR.refl x y * SpecTSUR.refl x y = 1 := by + have h3 : vecMulVec x y * vecMulVec x y = (2 : K) • vecMulVec x y := by + rw [vecMulVec_mul_vecMulVec, hxy]; ext a b; simp [vecMulVec_apply]; ring + rw [SpecTSUR.refl] + calc (1 - vecMulVec x y) * (1 - vecMulVec x y) + = 1 - (2 : K) • vecMulVec x y + vecMulVec x y * vecMulVec x y := by + rw [two_smul]; noncomm_ring + _ = 1 := by rw [h3]; abel + +/-! ## §3. the two orders: `rank(Δ - P) ≤ 4 ⇒ PΔP = Δ` -/ + +theorem unit_rho : IsUnit (rho K ι).det := by rw [det_rho]; exact isUnit_one.neg + +theorem rhoJ_invol (h2 : (2 : K) ≠ 0) (x y : Nn ι → K) (hxy : y ⬝ᵥ x = 2) + (hr : (Dl K ι - rho K ι * SpecTSUR.refl x y).rank ≤ 4) : + (rho K ι * SpecTSUR.refl x y) * Dl K ι * (rho K ι * SpecTSUR.refl x y) = Dl K ι := by + have e1 : Dl K ι - rho K ι * SpecTSUR.refl x y = rho K ι * (Nd K ι - 1 + vecMulVec x y) := by + conv_lhs => rw [← rho_mul_Nd] + rw [SpecTSUR.refl]; noncomm_ring + rw [e1, rank_mul_eq_right_of_isUnit_det _ _ unit_rho] at hr + obtain ⟨hx, hy⟩ := anc_zero_both h2 x y hr + calc (rho K ι * SpecTSUR.refl x y) * Dl K ι * (rho K ι * SpecTSUR.refl x y) + = rho K ι * (SpecTSUR.refl x y * (Dl K ι * rho K ι) * SpecTSUR.refl x y) := by simp only [Matrix.mul_assoc] + _ = Dl K ι := by rw [Dl_mul_rho, JNJ x y hxy hx hy, rho_mul_Nd] + +theorem Jrho_invol (h2 : (2 : K) ≠ 0) (x y : Nn ι → K) (hxy : y ⬝ᵥ x = 2) + (hr : (Dl K ι - SpecTSUR.refl x y * rho K ι).rank ≤ 4) : + (SpecTSUR.refl x y * rho K ι) * Dl K ι * (SpecTSUR.refl x y * rho K ι) = Dl K ι := by + have e1 : Dl K ι - SpecTSUR.refl x y * rho K ι = (Nd K ι - 1 + vecMulVec x y) * rho K ι := by + conv_lhs => rw [← Nd_mul_rho] + rw [SpecTSUR.refl]; noncomm_ring + rw [e1, rank_mul_eq_left_of_isUnit_det _ _ unit_rho] at hr + obtain ⟨hx, hy⟩ := anc_zero_both h2 x y hr + calc (SpecTSUR.refl x y * rho K ι) * Dl K ι * (SpecTSUR.refl x y * rho K ι) + = (SpecTSUR.refl x y * (rho K ι * Dl K ι) * SpecTSUR.refl x y) * rho K ι := by simp only [Matrix.mul_assoc] + _ = Dl K ι := by rw [rho_mul_Dl, JNJ x y hxy hx hy, Nd_mul_rho] + +/-! ## §4. composition with `SpecRankP.rank_ge_four` and `SpecINV.inv_rank` -/ + +theorem rho_mulVec (w : Nn ι → K) : + rho K ι *ᵥ w = w - (2 * w (Sum.inl ())) • e1v K ι := by + funext i; rcases i with i | i | i <;> simp [rho, mulVec_diagonal, e1v, Pi.single_apply] <;> ring + +theorem refl_mulVec (x y w : Nn ι → K) : SpecTSUR.refl x y *ᵥ w = w - (y ⬝ᵥ w) • x := by + rw [SpecTSUR.refl, sub_mulVec, one_mulVec, vecMulVec_mulVec, op_smul_eq_smul] + +theorem one_sub_pp_rank [DecidableEq K] (U : ℕ) (x y : ℕ → Nn ι → K) : + (1 - SpecTSUR.pp x y U).rank ≤ U := by + rw [SpecINV.one_sub_pp] + exact (rank_mul_le_left _ _).trans (by simpa using (SpecTSUR.Zm x y U).rank_le_card_width) + +/-- **`spec7_dead_U34`.** Model: char ≠ 2 (any field), `W = K^(1+4+a)` in the RB1 coordinates, +`Δ = Dl`, `ρ = I - e₁(2e₁*)ᵀ`, `J = I - x_J y_Jᵀ` a job reflection (`y_J·x_J = 2`) with +`x_J ∈ V ∋ e₁`, `dim V ≤ 2` (no condition on `y_J`, no pairing / stratum condition), and `P` one of +`ρJ`, `Jρ`. `Λ = P⁻¹Δ`, i.e. `P Λ = Δ`, is a product of `U` transvections (Theorem A). +Then `U ∉ {3, 4}`. (The reduction "for every one of the 720 job orders some unit-character +`P_μ` is `ρJ` or `Jρ`" is the 15-class reduction of RB3/RB4, a hypothesis here.) -/ +theorem spec7_dead_U34 [DecidableEq K] (h2 : (2 : K) ≠ 0) (U : ℕ) (hU : U = 3 ∨ U = 4) + (xt yt : ℕ → Nn ι → K) (hq : ∀ i < U, yt i ⬝ᵥ xt i = 0) + (xJ yJ : Nn ι → K) (hJ : yJ ⬝ᵥ xJ = 2) + (V : Submodule K (Nn ι → K)) (hV : finrank K V ≤ 2) (hxV : xJ ∈ V) (he1 : e1v K ι ∈ V) + (P : Matrix (Nn ι) (Nn ι) K) + (hP : P = rho K ι * SpecTSUR.refl xJ yJ ∨ P = SpecTSUR.refl xJ yJ * rho K ι) + (hΛ : P * SpecTSUR.pp xt yt U = Dl K ι) : False := by + have hPV : ∀ w, P *ᵥ w - w ∈ V := by + intro w + have hx : ∀ c : K, c • xJ ∈ V := fun c => V.smul_mem c hxV + have he : ∀ c : K, c • e1v K ι ∈ V := fun c => V.smul_mem c he1 + rcases hP with rfl | rfl + · rw [← mulVec_mulVec, refl_mulVec, rho_mulVec] + have : w - (yJ ⬝ᵥ w) • xJ - (2 * (w - (yJ ⬝ᵥ w) • xJ) (Sum.inl ())) • e1v K ι - w + = -((yJ ⬝ᵥ w) • xJ) - (2 * (w - (yJ ⬝ᵥ w) • xJ) (Sum.inl ())) • e1v K ι := by abel + rw [this]; exact V.sub_mem (V.neg_mem (hx _)) (he _) + · rw [← mulVec_mulVec, rho_mulVec, refl_mulVec] + have : w - (2 * w (Sum.inl ())) • e1v K ι - (yJ ⬝ᵥ (w - (2 * w (Sum.inl ())) • e1v K ι)) • xJ - w + = -((2 * w (Sum.inl ())) • e1v K ι) - (yJ ⬝ᵥ (w - (2 * w (Sum.inl ())) • e1v K ι)) • xJ := by abel + rw [this]; exact V.sub_mem (V.neg_mem (he _)) (hx _) + have hdet : P.det = 1 := by + rcases hP with rfl | rfl <;> + simp [det_mul, det_rho, SpecINV.det_refl, hJ] <;> norm_num + have hge : 4 ≤ (Dl K ι - P).rank := rank_ge_four h2 P V hV he1 hPV hdet + have hrk : (Dl K ι - P).rank ≤ (1 - SpecTSUR.pp xt yt U).rank := by + have : Dl K ι - P = (-P) * (1 - SpecTSUR.pp xt yt U) := by + simp only [mul_sub, mul_one, neg_mul, hΛ]; abel + rw [this]; exact rank_mul_le_right _ _ + have hle := one_sub_pp_rank U xt yt + rcases hU with rfl | rfl + · omega + · -- U = 4: rank = 4, involution, INV + have hr4 : (Dl K ι - P).rank ≤ 4 := hrk.trans hle + have hinv : P * Dl K ι * P = Dl K ι := by + rcases hP with rfl | rfl + · exact rhoJ_invol h2 xJ yJ hJ hr4 + · exact Jrho_invol h2 xJ yJ hJ hr4 + obtain ⟨P', hPP', hP'P⟩ : ∃ P' : Matrix (Nn ι) (Nn ι) K, P * P' = 1 ∧ P' * P = 1 := by + have hr := rho_mul_rho (K := K) (ι := ι) + have hj := refl_sq xJ yJ hJ + rcases hP with rfl | rfl + · exact ⟨SpecTSUR.refl xJ yJ * rho K ι, by + calc _ = rho K ι * (SpecTSUR.refl xJ yJ * SpecTSUR.refl xJ yJ) * rho K ι := by simp only [Matrix.mul_assoc] + _ = 1 := by rw [hj, mul_one, hr], + by calc _ = SpecTSUR.refl xJ yJ * (rho K ι * rho K ι) * SpecTSUR.refl xJ yJ := by simp only [Matrix.mul_assoc] + _ = 1 := by rw [hr, mul_one, hj]⟩ + · exact ⟨rho K ι * SpecTSUR.refl xJ yJ, by + calc _ = SpecTSUR.refl xJ yJ * (rho K ι * rho K ι) * SpecTSUR.refl xJ yJ := by simp only [Matrix.mul_assoc] + _ = 1 := by rw [hr, mul_one, hj], + by calc _ = rho K ι * (SpecTSUR.refl xJ yJ * SpecTSUR.refl xJ yJ) * rho K ι := by simp only [Matrix.mul_assoc] + _ = 1 := by rw [hj, mul_one, hr]⟩ + have hpp : SpecTSUR.pp xt yt 4 = P' * Dl K ι := by + rw [← hΛ, ← Matrix.mul_assoc, hP'P, Matrix.one_mul] + have hP'D : P' * Dl K ι * P' = Dl K ι := by + calc P' * Dl K ι * P' = P' * (P * Dl K ι * P) * P' := by rw [hinv] + _ = Dl K ι := by + calc P' * (P * Dl K ι * P) * P' = (P' * P) * Dl K ι * (P * P') := by simp only [Matrix.mul_assoc] + _ = Dl K ι := by rw [hP'P, hPP', Matrix.one_mul, Matrix.mul_one] + have hsq : SpecTSUR.pp xt yt 4 * SpecTSUR.pp xt yt 4 = 1 := by + rw [hpp] + calc P' * Dl K ι * (P' * Dl K ι) = (P' * Dl K ι * P') * Dl K ι := by simp only [Matrix.mul_assoc] + _ = 1 := by rw [hP'D, Dl_mul_Dl] + have := SpecINV.inv_rank h2 4 xt yt hq hsq + omega + +end SpecRankP2 + +#print axioms SpecRankP2.rhoJ_invol +#print axioms SpecRankP2.Jrho_invol +#print axioms SpecRankP2.spec7_dead_U34 +#print axioms SpecRankP2.anc_zero_both +#print axioms SpecRankP2.JNJ +#print axioms SpecRankP2.rho_eq_refl diff --git a/research/p104-lean-premises/lean/Nov15/SpecRankP2.md b/research/p104-lean-premises/lean/Nov15/SpecRankP2.md new file mode 100644 index 0000000000..749c69c53e --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecRankP2.md @@ -0,0 +1,13 @@ +# Nov15/SpecRankP2.lean +Formalises the U = 4 step of the #7 kill (RB4 item 4 / AUDIT item (c)), extends SpecRankP (`rank_ge_four`) and SpecINV (`inv_rank`). Kernel-only: no sorry, no native_decide; all 7 `#print axioms` = [propext, Classical.choice, Quot.sound]. 13 s / 2.1 GB (needs SpecRankP.olean built with -o first). + +## Result: the paper step is TRUE, and stronger than stated (no strata needed) +ρ = I - e1 (2 e1*)ᵀ = diag(-1 on e1, +1 elsewhere) (`rho`, `rho_eq_refl`), J = I - x yᵀ with y·x = 2 ARBITRARY x, y (no V, Y, pairing, q(v) hypothesis), N = ρΔ = diag(-1 on e1, S; +1 on ancillas). +- `anc_zero`/`anc_zero_both`: rank(N - I + x yᵀ) ≤ 4 ⇒ x and y vanish on every ancilla (kernel-dimension count: if x has an ancilla coordinate, ker ↪ K^ancillas, so rank ≥ 5; y by transpose). Any field with 2 ≠ 0. +- `JNJ`: x, y supported on {e1} ∪ S, y·x = 2 ⇒ J N J = N (so J commutes with N, J² = 1). +- `rhoJ_invol`, `Jrho_invol`: rank(Δ - ρJ) ≤ 4 ⇒ PΔP = Δ for P = ρJ; same for P = Jρ. (Δ - ρJ = ρ(N - J), Δ - Jρ = (N - J)ρ.) +Consequence: the whole Singular stratum analysis (st1/st00/st01, dim V = 1, A/B/C0/C1) is subsumed by a 1-page argument valid for ALL x, y, in every characteristic ≠ 2 (closes "char p > 2" for this step). +- `spec7_dead_U34`: char ≠ 2, U ∈ {3,4}, Λ = P⁻¹Δ i.e. P·pp(xt,yt,U) = Δ with transvection units (y_i·x_i = 0), P ∈ {ρJ, Jρ}, x_J ∈ V ∋ e1, dim V ≤ 2 ⇒ False. Proof: det P = 1, im(P - I) ⊆ V ⇒ rank(Δ - P) ≥ 4 (SpecRankP); Δ - P = -P(1 - Λ) so rank ≤ rank(1-Λ) ≤ U (kills U = 3); U = 4 ⇒ rank ≤ 4 ⇒ PΔP = Δ ⇒ Λ² = 1 ⇒ inv_rank gives rank(1-Λ) ≤ 3 < 4. + +## Not proved (hypotheses) +Theorem A (Λ_μ is a product of U transvections), and the 15-class / KB reduction that for every one of the 720 job orders some unit character has P_μ ∈ {ρJ_Y, J_Yρ} (RB3/RB4 3a/3b, Lemma CIL) are hypotheses (`hΛ`, `hP`). U ≥ 5 not covered. Note the Lean theorem needs no ancilla count, V-pairing or char-0 hypothesis. The RB4 general "two reflections with q(v)=0 ⇒ involution" claim remains unproved here (and the AUDIT found it false on a stratum); it is not needed. diff --git a/research/p104-lean-premises/lean/Nov15/SpecTS.lean b/research/p104-lean-premises/lean/Nov15/SpecTS.lean new file mode 100644 index 0000000000..a5bb6ef769 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecTS.lean @@ -0,0 +1,299 @@ +/- +SPECBREAK R42 Lemma TS = T1 (audited for J = 7 in internal notes), Model-setting version with explicit targets/ancillas, rank facts, and the corollaries. +Reuses SpecTSUR (product formula, lemmaTS). See SpecTS.md for the exact statements. +-/ +import Nov15.SpecTSUR +import Mathlib.LinearAlgebra.Matrix.Block +import Mathlib.Algebra.BigOperators.Group.List.Basic +import Mathlib.Data.List.FinRange + +open Matrix Finset SpecTSUR + +set_option linter.unusedSectionVars false + +namespace SpecTS + +variable {K : Type*} [Field K] + +/-! ## §1. General job lemmas (no model assumptions) -/ +section Jobs +variable {n : Type*} [Fintype n] [DecidableEq n] + +/-- two jobs with `y·x' = 0 = y'·x` commute -/ +theorem refl_comm (x y x' y' : n → K) (h1 : y ⬝ᵥ x' = 0) (h2 : y' ⬝ᵥ x = 0) : + SpecTSUR.refl x y * SpecTSUR.refl x' y' = SpecTSUR.refl x' y' * SpecTSUR.refl x y := by + have hAB : vecMulVec x y * vecMulVec x' y' = 0 := by + rw [vecMulVec_mul_vecMulVec, h1]; simp + have hBA : vecMulVec x' y' * vecMulVec x y = 0 := by + rw [vecMulVec_mul_vecMulVec, h2]; simp + simp only [SpecTSUR.refl, mul_sub, sub_mul, one_mul, mul_one, hAB, hBA, sub_zero] + abel + +/-- a job with `y·x = 2` is an involution -/ +theorem refl_sq (x y : n → K) (h : y ⬝ᵥ x = 2) : SpecTSUR.refl x y * SpecTSUR.refl x y = 1 := by + have hAA : vecMulVec x y * vecMulVec x y = (2 : K) • vecMulVec x y := by + rw [vecMulVec_mul_vecMulVec, h]; ext a b; simp [vecMulVec_apply]; ring + simp only [SpecTSUR.refl, mul_sub, sub_mul, one_mul, mul_one, hAA] + ext a b; simp [Matrix.sub_apply, Matrix.smul_apply]; ring + +/-- a job whose `x, y` vanish on the ancilla coordinates is block diagonal `(job, I)` -/ +theorem refl_blocks {τ α : Type*} [Fintype τ] [Fintype α] [DecidableEq τ] [DecidableEq α] + (x y : τ ⊕ α → K) (hx : ∀ a, x (Sum.inr a) = 0) (hy : ∀ a, y (Sum.inr a) = 0) : + SpecTSUR.refl x y = fromBlocks (SpecTSUR.refl (x ∘ Sum.inl) (y ∘ Sum.inl)) 0 0 1 := by + ext (a | a) (b | b) <;> + simp [SpecTSUR.refl, vecMulVec_apply, hx, hy, Matrix.one_apply, Matrix.fromBlocks] + +/-- ordered jobs as a function on `Fin k` -/ +def gJ (x y : ℕ → n → K) (k : ℕ) : Fin k → Matrix n n K := fun i => SpecTSUR.refl (x i) (y i) + +theorem pp_eq_prod (x y : ℕ → n → K) (k : ℕ) : pp x y k = (List.ofFn (gJ x y k)).prod := by + induction k with + | zero => simp [pp] + | succ k ih => + rw [List.ofFn_succ', List.prod_concat, pp, ih] + rfl + +/-- product of any order of pairwise commuting jobs equals the ordered product -/ +theorem prod_perm (x y : ℕ → n → K) (k : ℕ) (hc : ∀ i j, Commute (gJ x y k i) (gJ x y k j)) + (σ : Equiv.Perm (Fin k)) : (List.ofFn (gJ x y k ∘ σ)).prod = pp x y k := by + rw [pp_eq_prod] + refine ((σ.ofFn_comp_perm (gJ x y k)).prod_eq' ?_) + rw [List.pairwise_ofFn] + intro i j _; exact hc _ _ + +/-- product of two families of mutually commuting elements -/ +theorem prod_ofFn_mul {M : Type*} [Monoid M] (k : ℕ) (a b : Fin k → M) + (h : ∀ i j, Commute (a i) (b j)) : + (List.ofFn a).prod * (List.ofFn b).prod = (List.ofFn fun i => a i * b i).prod := by + induction k with + | zero => simp + | succ k ih => + rw [List.ofFn_succ, List.ofFn_succ, List.ofFn_succ, List.prod_cons, List.prod_cons, + List.prod_cons] + have hc : Commute (List.ofFn fun i : Fin k => a i.succ).prod (b 0) := + Commute.list_prod_left _ _ (by + intro u hu + obtain ⟨i, rfl⟩ := List.mem_ofFn.1 hu + exact h _ _) + have := ih (fun i => a i.succ) (fun i => b i.succ) (fun i j => h _ _) + calc a 0 * (List.ofFn fun i : Fin k => a i.succ).prod * (b 0 * (List.ofFn fun i : Fin k => b i.succ).prod) + = a 0 * ((List.ofFn fun i : Fin k => a i.succ).prod * b 0) * + (List.ofFn fun i : Fin k => b i.succ).prod := by simp only [mul_assoc] + _ = a 0 * (b 0 * (List.ofFn fun i : Fin k => a i.succ).prod) * + (List.ofFn fun i : Fin k => b i.succ).prod := by rw [hc.eq] + _ = a 0 * b 0 * ((List.ofFn fun i : Fin k => a i.succ).prod * + (List.ofFn fun i : Fin k => b i.succ).prod) := by simp only [mul_assoc] + _ = _ := by rw [this] + +/-- the sub-product of the jobs indexed by `T` (in index order, other letters replaced by `1`) -/ +noncomputable def gT (x y : ℕ → n → K) (k : ℕ) (T : Finset (Fin k)) : Matrix n n K := + open Classical in (List.ofFn fun i => if i ∈ T then gJ x y k i else 1).prod + +theorem gT_mul_compl (x y : ℕ → n → K) (k : ℕ) (hc : ∀ i j, Commute (gJ x y k i) (gJ x y k j)) + (T : Finset (Fin k)) : gT x y k T * gT x y k Tᶜ = pp x y k := by + classical + rw [pp_eq_prod, gT, gT, prod_ofFn_mul] + · congr 1 + refine congrArg List.ofFn (funext fun i => ?_) + by_cases hi : i ∈ T <;> simp [hi] + · intro i j + have : ∀ (S : Finset (Fin k)) (i : Fin k), ∀ j : Fin k, + Commute (if i ∈ T then gJ x y k i else 1) (if j ∈ Tᶜ then gJ x y k j else 1) := by + intro _ i j + by_cases hi : i ∈ T <;> by_cases hj : j ∈ Tᶜ <;> simp [hi, hj, hc i j] + exact this ∅ i j + +theorem gT_sq (x y : ℕ → n → K) (k : ℕ) (hc : ∀ i j, Commute (gJ x y k i) (gJ x y k j)) + (hs : ∀ i, gJ x y k i * gJ x y k i = 1) (T : Finset (Fin k)) : + gT x y k T * gT x y k T = 1 := by + classical + rw [gT, prod_ofFn_mul] + · have : (fun i : Fin k => (if i ∈ T then gJ x y k i else 1) * (if i ∈ T then gJ x y k i else 1)) + = fun _ => 1 := by + funext i; by_cases hi : i ∈ T <;> simp [hi, hs i] + rw [this]; simp + · intro i j + by_cases hi : i ∈ T <;> by_cases hj : j ∈ T <;> simp [hi, hj, hc i j] + +end Jobs + +/-! ## §2. The model setting and Lemma TS -/ +section Model +variable [DecidableEq K] +variable {τ α ι : Type*} [Fintype τ] [Fintype α] [Fintype ι] [DecidableEq τ] [DecidableEq α] + +/-- MODEL SETTING (inherited, unaudited): coordinates `τ ⊕ α` (targets, ancillas); a character `μ` +flips target `j` iff `μ·t_j = 1` (in `ZMod 2`); `D_μ = diag((-1)^(μ·t_j))` on targets, `+1` on ancillas. -/ +def sD (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) : τ ⊕ α → K := + Sum.elim (fun j => if μ ⬝ᵥ t j = 1 then -1 else 1) (fun _ => 1) + +def Dmod (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) : Matrix (τ ⊕ α) (τ ⊕ α) K := + diagonal (sD (K := K) (α := α) μ t) + +theorem sD_pm (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) (a : τ ⊕ α) : + sD (K := K) (α := α) μ t a = 1 ∨ sD (K := K) (α := α) μ t a = (-1 : K) := by + rcases a with j | a + · by_cases h : μ ⬝ᵥ t j = 1 <;> simp [sD, h] + · simp [sD] + +theorem card_flip (h2 : (2 : K) ≠ 0) (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) : + (univ.filter fun a : τ ⊕ α => sD (K := K) (α := α) μ t a = (-1 : K)).card + = (univ.filter fun j : τ => μ ⬝ᵥ t j = 1).card := by + have hne : (1 : K) ≠ -1 := by intro h; apply h2; linear_combination h + simp only [Finset.card_filter, Fintype.sum_sum_type] + have h0 : ∑ a : α, (if sD (K := K) (α := α) μ t (Sum.inr a) = (-1 : K) then 1 else 0) = 0 := by + simp [sD, hne] + rw [h0, add_zero] + refine Finset.sum_congr rfl fun j _ => ?_ + by_cases h : μ ⬝ᵥ t j = 1 <;> simp [sD, h, hne] + +/-- columns `y_i` as an `n × m` matrix -/ +def Ym {n : Type*} (y : ℕ → n → K) (m : ℕ) : Matrix n (Fin m) K := Matrix.of fun a i => y i a + +/-- **Lemma TS (T1 = R42), model setting.** Hypotheses (all explicit): char ≠ 2; unit-free character +`μ`: the ordered product of the `k` active jobs `1 - x_i y_iᵀ` equals `D_μ`; and tightness: the number +of flipped targets equals `k`. Nothing else (not `y_i·x_i = 2`, not the job order, not `J`, `N`, `U`). -/ +theorem lemmaTS_model (h2 : (2 : K) ≠ 0) (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) (k : ℕ) + (x y : ℕ → τ ⊕ α → K) (hprod : pp x y k = Dmod μ t) + (hcard : (univ.filter fun j : τ => μ ⬝ᵥ t j = 1).card = k) : + -- (G) Gram = 2 I (both orders, whatever the word order) + (∀ i j : Fin k, y i ⬝ᵥ x j = if i = j then 2 else 0) ∧ + -- (N) G = 2N, N = I (so N invertible, N = G/2 = I + strict-upper(G)) + (Ym y k)ᵀ * Xm x k = (2 : K) • Nm x y k ∧ Nm x y k = 1 ∧ IsUnit (Nm x y k) ∧ + -- (R) X, Y full rank + (Xm x k).rank = k ∧ (Ym y k).rank = k ∧ + -- (S) supports: vanish on ancillas and on every unflipped target + (∀ (i : Fin k) (a : α), x i (Sum.inr a) = 0 ∧ y i (Sum.inr a) = 0) ∧ + (∀ (i : Fin k) (j : τ), μ ⬝ᵥ t j ≠ 1 → x i (Sum.inl j) = 0 ∧ y i (Sum.inl j) = 0) ∧ + -- (I) image(I - D) = span(x_i) + LinearMap.range (1 - Dmod (K := K) (α := α) μ t).mulVecLin + = Submodule.span K (Set.range fun i : Fin k => x i) := by + have hcard' : (univ.filter fun a : τ ⊕ α => sD (K := K) (α := α) μ t a = (-1 : K)).card = k := by + rw [card_flip h2, hcard] + obtain ⟨hG, hS, hI⟩ := lemmaTS k x y (sD (K := K) (α := α) μ t) h2 (sD_pm μ t) hprod hcard' + have hGm : (Ym y k)ᵀ * Xm x k = (2 : K) • (1 : Matrix (Fin k) (Fin k) K) := by + ext i j + have := gram_apply x y k i j + simp only [Ym] at this ⊢ + rw [this, hG i j] + simp [Matrix.one_apply] + have hN : Nm x y k = 1 := by + ext i j + simp only [Nm, Matrix.add_apply, Matrix.of_apply] + by_cases hij : i < j + · simp [hij, hG i j, hij.ne] + · simp [hij] + have hrk : ((2 : K) • (1 : Matrix (Fin k) (Fin k) K)).rank = k := by + have : (2 : K) • (1 : Matrix (Fin k) (Fin k) K) = diagonal fun _ => (2 : K) := by + ext i j; by_cases h : i = j <;> simp [Matrix.one_apply, diagonal_apply, h] + rw [this, rank_diagonal]; simp [h2] + refine ⟨hG, ?_, hN, hN ▸ isUnit_one, ?_, ?_, ?_, ?_, ?_⟩ + · rw [hGm, hN] + · refine le_antisymm ((Matrix.rank_le_card_width _).trans (by simp)) ?_ + have := rank_mul_le_right (Ym y k)ᵀ (Xm x k) + rw [hGm, hrk] at this; exact this + · refine le_antisymm ((Matrix.rank_le_card_width _).trans (by simp)) ?_ + have := (rank_mul_le_left (Ym y k)ᵀ (Xm x k)).trans_eq (Matrix.rank_transpose (Ym y k)) + rw [hGm, hrk] at this; exact this + · intro i a; exact hS i (Sum.inr a) (by simp [sD]) + · intro i j hj; exact hS i (Sum.inl j) (by simp [sD, hj]) + · exact hI + +/-- COROLLARY: supports in target coordinates, jobs are `(job_R, I)` on targets ⊕ ancillas. -/ +theorem model_job_blocks (h2 : (2 : K) ≠ 0) (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) (k : ℕ) + (x y : ℕ → τ ⊕ α → K) (hprod : pp x y k = Dmod μ t) + (hcard : (univ.filter fun j : τ => μ ⬝ᵥ t j = 1).card = k) (i : Fin k) : + SpecTSUR.refl (x i) (y i) = fromBlocks (SpecTSUR.refl (x i ∘ Sum.inl) (y i ∘ Sum.inl)) 0 0 1 := by + obtain ⟨-, -, -, -, -, -, hanc, -, -⟩ := lemmaTS_model h2 μ t k x y hprod hcard + exact refl_blocks _ _ (fun a => (hanc i a).1) (fun a => (hanc i a).2) + +/-- COROLLARY: jobs fix ancillas: `(job v)_a = v_a` and the job fixes every ancilla-supported vector. -/ +theorem model_job_fix_anc (h2 : (2 : K) ≠ 0) (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) (k : ℕ) + (x y : ℕ → τ ⊕ α → K) (hprod : pp x y k = Dmod μ t) + (hcard : (univ.filter fun j : τ => μ ⬝ᵥ t j = 1).card = k) (i : Fin k) (v : τ ⊕ α → K) (a : α) : + (SpecTSUR.refl (x i) (y i) *ᵥ v) (Sum.inr a) = v (Sum.inr a) := by + rw [model_job_blocks h2 μ t k x y hprod hcard i] + simp [Matrix.mulVec, dotProduct, Fintype.sum_sum_type, Matrix.fromBlocks, Matrix.one_apply] + +/-- COROLLARY: jobs in the tight set pairwise commute. -/ +theorem model_commute (h2 : (2 : K) ≠ 0) (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) (k : ℕ) + (x y : ℕ → τ ⊕ α → K) (hprod : pp x y k = Dmod μ t) + (hcard : (univ.filter fun j : τ => μ ⬝ᵥ t j = 1).card = k) (i j : Fin k) : + Commute (gJ x y k i) (gJ x y k j) := by + obtain ⟨hG, -⟩ := lemmaTS_model h2 μ t k x y hprod hcard + by_cases hij : i = j + · subst hij; exact Commute.refl _ + · exact refl_comm _ _ _ _ (by simp [hG i j, hij]) (by simp [hG j i, Ne.symm hij]) + +/-- COROLLARY: every job is an involution. -/ +theorem model_invol (h2 : (2 : K) ≠ 0) (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) (k : ℕ) + (x y : ℕ → τ ⊕ α → K) (hprod : pp x y k = Dmod μ t) + (hcard : (univ.filter fun j : τ => μ ⬝ᵥ t j = 1).card = k) (i : Fin k) : + gJ x y k i * gJ x y k i = 1 := by + obtain ⟨hG, -⟩ := lemmaTS_model h2 μ t k x y hprod hcard + exact refl_sq _ _ (by simpa using hG i i) + +/-- COROLLARY: the product of the `k` jobs in ANY order is `D_μ`. -/ +theorem model_any_order (h2 : (2 : K) ≠ 0) (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) (k : ℕ) + (x y : ℕ → τ ⊕ α → K) (hprod : pp x y k = Dmod μ t) + (hcard : (univ.filter fun j : τ => μ ⬝ᵥ t j = 1).card = k) (σ : Equiv.Perm (Fin k)) : + (List.ofFn (gJ x y k ∘ σ)).prod = Dmod (K := K) (α := α) μ t := by + rw [prod_perm x y k (model_commute h2 μ t k x y hprod hcard) σ, hprod] + +/-- COROLLARY (`g_d = (∏_{S∖d} g) D_R`): for every subset `T` of the tight set, the sub-product +over `T` equals the sub-product over the complement times `D_μ` (`D_μ = D_R ⊕ I_ancillas`). -/ +theorem model_gd (h2 : (2 : K) ≠ 0) (μ : ι → ZMod 2) (t : τ → ι → ZMod 2) (k : ℕ) + (x y : ℕ → τ ⊕ α → K) (hprod : pp x y k = Dmod μ t) + (hcard : (univ.filter fun j : τ => μ ⬝ᵥ t j = 1).card = k) (T : Finset (Fin k)) : + gT x y k T = gT x y k Tᶜ * Dmod (K := K) (α := α) μ t := by + have hc := model_commute h2 μ t k x y hprod hcard + have hs := model_invol h2 μ t k x y hprod hcard + have h1 := gT_mul_compl x y k hc T + have h3 := gT_sq x y k hc hs Tᶜ + rw [← hprod, ← h1] + symm + have h1c := gT_mul_compl x y k hc Tᶜ + rw [compl_compl] at h1c + calc gT x y k Tᶜ * (gT x y k T * gT x y k Tᶜ) + = gT x y k Tᶜ * (gT x y k Tᶜ * gT x y k T) := by rw [h1, h1c] + _ = (gT x y k Tᶜ * gT x y k Tᶜ) * gT x y k T := by rw [Matrix.mul_assoc] + _ = gT x y k T := by rw [h3, Matrix.one_mul] + +end Model + +/-! ## §3. Non-vacuity: hypotheses are satisfiable (k = 1, one target flipped, one ancilla) over ℚ -/ +section Example +def ex_x : ℕ → Unit ⊕ Unit → ℚ := fun _ => Sum.elim (fun _ => 1) (fun _ => 0) +def ex_y : ℕ → Unit ⊕ Unit → ℚ := fun _ => Sum.elim (fun _ => 2) (fun _ => 0) + +theorem ex_prod : pp ex_x ex_y 1 = Dmod (K := ℚ) (α := Unit) (fun _ : Unit => (1 : ZMod 2)) + (fun _ _ => (1 : ZMod 2)) := by + ext (a | a) (b | b) <;> + simp [pp, SpecTSUR.refl, ex_x, ex_y, Dmod, sD, vecMulVec_apply, diagonal_apply, Matrix.one_apply] <;> norm_num + +theorem ex_card : (Finset.univ.filter fun j : Unit => + (fun _ : Unit => (1 : ZMod 2)) ⬝ᵥ (fun _ : Unit => (1 : ZMod 2)) = 1).card = 1 := by decide + +/-- the model theorem applies (so its hypotheses are not contradictory) -/ +example := lemmaTS_model (K := ℚ) (α := Unit) (by norm_num) (fun _ : Unit => (1 : ZMod 2)) + (fun _ _ => (1 : ZMod 2)) 1 ex_x ex_y ex_prod ex_card +end Example + +end SpecTS + +open SpecTS in +#print axioms lemmaTS_model +open SpecTS in +#print axioms model_job_blocks +open SpecTS in +#print axioms model_job_fix_anc +open SpecTS in +#print axioms model_commute +open SpecTS in +#print axioms model_invol +open SpecTS in +#print axioms model_any_order +open SpecTS in +#print axioms model_gd +open SpecTS in +#print axioms ex_prod diff --git a/research/p104-lean-premises/lean/Nov15/SpecTS.md b/research/p104-lean-premises/lean/Nov15/SpecTS.md new file mode 100644 index 0000000000..6ded5b20d9 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecTS.md @@ -0,0 +1,17 @@ +# Nov15/SpecTS.lean +Formalises T1 = R42 Lemma TS (internal notes section 2; hand re-derivation internal notes). Kernel-only: no sorry, no native_decide; `#print axioms` on all 8 headline theorems = [propext, Classical.choice, Quot.sound]. 6 s / 2.0 GB. Builds on `SpecTSUR` (product formula `pp_eq`, general `lemmaTS`, which already proved Gram = 2I; SpecTS adds the explicit model setting, rank facts, and corollaries). +**Verdict: paper statement TRUE as written (verbatim, any J; no counterexample).** + +## Model setting (INHERITED, UNAUDITED; taken as hypotheses/definitions, not proved) +Coordinates `tau + alpha` (targets, ancillas). Character `mu : iota -> ZMod 2`, target vectors `t j : iota -> ZMod 2`; `sD mu t` = `-1` on target j iff `mu . t_j = 1`, else `+1`, and `+1` on ancillas; `Dmod = diag (sD)`. Jobs `refl (x i) (y i) = I - x_i y_i^T` (y_i . x_i = 2 is NOT assumed). Unit-free character = the unit letters are inactive (mu . Q = 0), encoded as hypothesis `pp x y k = Dmod mu t` (ordered product of the k ACTIVE jobs equals D_mu, whatever the order). Not modelled: the relation lattice, why a character is unit-free, which jobs are active. Tightness `hcard`: #{targets j : mu . t_j = 1} = k. Also char != 2 (`(2:K) != 0`). + +## Proved (all under exactly those hypotheses) +- `lemmaTS_model` (conjunction): (G) `y_i . x_j = 2 delta_ij` for all i, j (both orders; any word order); (N) `Y^T X = 2 N`, `N = 1` (so `N = G/2 = I + strict-upper(G)`), `IsUnit N`; (R) `rank X = k`, `rank Y = k`; (S) `x_i, y_i` vanish on every ancilla and on every unflipped target; (I) `range(I - D) = span(x_i)`. +- Corollaries: `model_job_blocks` (each job = `fromBlocks job_R 0 0 1`, i.e. supports in target coordinates), `model_job_fix_anc` (a job fixes every ancilla coordinate), `model_commute` (all jobs of the tight set commute), `model_invol` (each job is an involution), `model_any_order` (the product in ANY permuted order = D_mu), `model_gd` (`g_T = g_{T^c} * D_mu` for every subset T of the tight set, `D_mu = D_R + I_ancillas`; i.e. g_d = (prod_{S-d} g) D_R). +- Proof route differs from the hand proof (hand: full rank => N invertible => N = G/2 => compare); Lean derives G = 2I first (via left inverses of Z = X N^-1 in `lemmaTS`) and then reads off rank X = rank Y = k, N = I = G/2 as consequences. Equivalent: all those facts hold. +- Non-vacuity: `ex_prod`/`ex_card` (Q, k = 1, one flipped target, one ancilla, x = (1,0), y = (2,0)) satisfy the hypotheses and `lemmaTS_model` is applied to them. +- Hypothesis necessity (already in SpecTSUR): `tight_needed` (r = k cannot be dropped: two equal jobs on Fin 1 over Q multiply to I, r = 0 < k = 2, Gram not 2I). + +## Caveats +- Commutation/any-order statements are about the k active jobs of ONE tight character; "jobs in a common tight set" in the notes = jobs active at the same tight mu. +- The model setting is not audited here (same residual caveat as AUDIT43/T1J7-AUDIT). diff --git a/research/p104-lean-premises/lean/Nov15/SpecTSUR.lean b/research/p104-lean-premises/lean/Nov15/SpecTSUR.lean new file mode 100644 index 0000000000..a7efa5cf8d --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecTSUR.lean @@ -0,0 +1,585 @@ +/- +SPECBREAK R42 Lemma TS (tight supports) + Lemma UR (unit rank), Source: internal notes §1-5, AUDIT42.md. See SpecTSUR.md. +Matrices over a field K; coordinates `n` (targets and ancillas); jobs are reflections +`refl x y = 1 - x yᵀ`, ordered products via the prefix function `pp`. +-/ +import Mathlib.LinearAlgebra.Matrix.Rank +import Mathlib.LinearAlgebra.Matrix.Diagonal +import Mathlib.LinearAlgebra.Matrix.ToLin +import Mathlib.LinearAlgebra.Matrix.Block +import Mathlib.LinearAlgebra.Matrix.Charpoly.Basic +import Mathlib.LinearAlgebra.Basis.VectorSpace +import Mathlib.Tactic.NoncommRing +import Mathlib.Tactic.LinearCombination +import Mathlib.Tactic.Ring +import Mathlib.Tactic.Abel + +open Matrix Finset + +set_option linter.unusedSectionVars false + +namespace SpecTSUR + +variable {K : Type*} [Field K] + +/-! ## §0. rank helpers -/ +section Rank +variable {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] + +theorem rank_add_le' (A B : Matrix m n K) : (A + B).rank ≤ A.rank + B.rank := by + unfold Matrix.rank + rw [Matrix.mulVecLin_add] + refine le_trans (Submodule.finrank_mono (LinearMap.range_add_le _ _)) ?_ + exact Submodule.finrank_add_le_finrank_add_finrank _ _ + +theorem rank_sub_le' (A B : Matrix m n K) : (A - B).rank ≤ A.rank + B.rank := by + have : A - B = A + (-1 : K) • B := by simp [sub_eq_add_neg] + rw [this] + refine (rank_add_le' _ _).trans ?_ + have h : ((-1 : K) • B).rank ≤ B.rank := by + have : (-1 : K) • B = (diagonal fun _ : m => (-1 : K)) * B := by + ext i j; simp [diagonal_mul] + rw [this]; exact rank_mul_le_right _ _ + omega + +/-- rank is subadditive, the form used: `rank A ≤ rank (A - B) + rank B`. -/ +theorem rank_le_sub_add (A B : Matrix m n K) : A.rank ≤ (A - B).rank + B.rank := by + have : A = (A - B) + B := by simp + conv_lhs => rw [this] + exact rank_add_le' _ _ + +/-- A full column rank matrix has a left inverse. -/ +theorem exists_left_inv {k : ℕ} (A : Matrix n (Fin k) K) (h : A.rank = k) : + ∃ L : Matrix (Fin k) n K, L * A = 1 := by + have hker : LinearMap.ker A.mulVecLin = ⊥ := by + have := LinearMap.finrank_range_add_finrank_ker A.mulVecLin + have h1 : Module.finrank K (LinearMap.range A.mulVecLin) = k := h + rw [h1, Module.finrank_fin_fun] at this + have h0 : Module.finrank K (LinearMap.ker A.mulVecLin) = 0 := by omega + exact Submodule.finrank_eq_zero.1 h0 + obtain ⟨g, hg⟩ := LinearMap.exists_leftInverse_of_injective A.mulVecLin hker + refine ⟨LinearMap.toMatrix' g, ?_⟩ + have := congrArg LinearMap.toMatrix' hg + rw [LinearMap.toMatrix'_comp, ← Matrix.toLin'_apply', LinearMap.toMatrix'_toLin'] at this + simpa using this + +/-- rank of a block-diagonal matrix is at least the sum of the block ranks. -/ +theorem rank_fromBlocks_diag_ge {m₁ m₂ n₁ n₂ : Type*} [Fintype m₁] [Fintype m₂] [Fintype n₁] + [Fintype n₂] [DecidableEq m₁] [DecidableEq m₂] [DecidableEq n₁] [DecidableEq n₂] + (A : Matrix m₁ n₁ K) (B : Matrix m₂ n₂ K) : + A.rank + B.rank ≤ (fromBlocks A 0 0 B).rank := by + let e := (LinearEquiv.sumArrowLequivProdArrow m₁ m₂ K K).symm + let φ : (LinearMap.range A.mulVecLin × LinearMap.range B.mulVecLin) →ₗ[K] ((m₁ ⊕ m₂) → K) := + e.toLinearMap ∘ₗ LinearMap.prodMap (LinearMap.range A.mulVecLin).subtype + (LinearMap.range B.mulVecLin).subtype + have hinj : Function.Injective φ := by + intro p q h + have := e.injective h + have h1 : (p.1 : m₁ → K) = q.1 := congrArg Prod.fst this + have h2 : (p.2 : m₂ → K) = q.2 := congrArg Prod.snd this + exact Prod.ext (Subtype.ext h1) (Subtype.ext h2) + have hS : LinearMap.range φ ≤ LinearMap.range (fromBlocks A 0 0 B).mulVecLin := by + rintro _ ⟨⟨⟨_, ⟨a, rfl⟩⟩, ⟨_, ⟨b, rfl⟩⟩⟩, rfl⟩ + refine ⟨Sum.elim a b, ?_⟩ + ext (i | i) <;> simp [φ, e, fromBlocks_mulVec] + have h1 := LinearMap.finrank_range_of_inj hinj + rw [Module.finrank_prod] at h1 + have := Submodule.finrank_mono hS + unfold Matrix.rank + omega + +end Rank + + +/-! ## §1. Jobs and the product formula -/ +section Jobs +variable {n : Type*} [Fintype n] [DecidableEq n] + +/-- a job (reflection) `I - x yᵀ` -/ +def refl (x y : n → K) : Matrix n n K := 1 - vecMulVec x y + +/-- ordered product of the first `i` jobs `refl (x 0) (y 0) * ... * refl (x (i-1)) (y (i-1))` -/ +def pp (x y : ℕ → n → K) : ℕ → Matrix n n K + | 0 => 1 + | i + 1 => pp x y i * refl (x i) (y i) + +/-- `z i = (product of the jobs before i) x_i` -/ +def zv (x y : ℕ → n → K) (i : ℕ) : n → K := pp x y i *ᵥ x i + +/-- telescoping: product = I - sum_i z_i y_iᵀ -/ +theorem pp_eq (x y : ℕ → n → K) (m : ℕ) : + pp x y m = 1 - ∑ i ∈ range m, vecMulVec (zv x y i) (y i) := by + induction m with + | zero => simp [pp] + | succ m ih => + have h : pp x y (m + 1) = pp x y m - vecMulVec (zv x y m) (y m) := by + rw [pp, refl, mul_sub, mul_one, mul_vecMulVec]; rfl + rw [h, ih, sum_range_succ] + abel + +/-- product formula, coordinates: `z_i + sum_{j ?_ + rw [vecMulVec_mulVec, op_smul_eq_smul] + +end Jobs + + +/-! ## §2. Lemma TS (tight supports) -/ +section TS +variable {n : Type*} [Fintype n] [DecidableEq n] + +/-- columns `x_i`, `y_i`, `z_i` as `n × m` matrices -/ +def Xm (x : ℕ → n → K) (m : ℕ) : Matrix n (Fin m) K := Matrix.of fun a i => x i a +def Zm (x y : ℕ → n → K) (m : ℕ) : Matrix n (Fin m) K := Matrix.of fun a i => zv x y i a +/-- `N = I + strict-upper(G)`, `G_ij = y_i · x_j` -/ +def Nm (x y : ℕ → n → K) (m : ℕ) : Matrix (Fin m) (Fin m) K := + 1 + (Matrix.of fun (j i : Fin m) => if j < i then y j ⬝ᵥ x i else 0 : Matrix (Fin m) (Fin m) K) + +theorem sum_fin_lt {m : ℕ} (F : ℕ → K) (i : Fin m) : + ∑ j : Fin m, (if j < i then F j else 0) = ∑ j ∈ range i, F j := by + have := Fin.sum_univ_eq_sum_range (fun j : ℕ => if j < (i : ℕ) then F j else 0) m + simp only [Fin.lt_def] + rw [this, ← sum_filter] + congr 1 + ext j + simp only [mem_filter, mem_range] + have := i.2 + omega + +/-- the product formula `Z N = X` -/ +theorem ZN_eq (x y : ℕ → n → K) (m : ℕ) : Zm x y m * Nm x y m = Xm x m := by + ext a i + have h := congrFun (zv_rec x y i) a + simp only [Finset.sum_apply, Pi.sub_apply, Pi.smul_apply, smul_eq_mul] at h + have h2 : ∑ j : Fin m, zv x y j a * (if j < i then y j ⬝ᵥ x i else 0) = + ∑ j ∈ range i, (y j ⬝ᵥ x i) * zv x y j a := by + rw [← sum_fin_lt (fun j => (y j ⬝ᵥ x i) * zv x y j a) i] + refine sum_congr rfl fun j _ => ?_ + split_ifs <;> simp [mul_comm] + have h1 : ∑ j : Fin m, zv x y j a * (if j = i then 1 else 0) = zv x y i a := by simp + simp only [Zm, Nm, Xm, Matrix.mul_apply, Matrix.add_apply, Matrix.one_apply, Matrix.of_apply, + mul_add, sum_add_distrib] + rw [h1, h2, h]; ring + +theorem sum_ZY (x y : ℕ → n → K) (m : ℕ) : + ∑ i ∈ range m, vecMulVec (zv x y i) (y i) = Zm x y m * (Matrix.of fun a (i : Fin m) => y i a)ᵀ := by + ext a b + rw [Matrix.sum_apply] + simp only [vecMulVec_apply, Matrix.mul_apply, Zm, Matrix.of_apply, Matrix.transpose_apply] + exact (Fin.sum_univ_eq_sum_range (fun j => zv x y j a * y j b) m).symm + +theorem gram_apply (x y : ℕ → n → K) (m : ℕ) (i j : Fin m) : + ((Matrix.of fun a (i : Fin m) => y i a)ᵀ * Xm x m) i j = y i ⬝ᵥ x j := by + simp [Matrix.mul_apply, Xm, dotProduct] + +theorem range_mul_right_inv {l o : Type*} [Fintype l] [Fintype o] [DecidableEq l] [DecidableEq o] + {k : Type*} [Fintype k] [DecidableEq k] + (A : Matrix l o K) (B : Matrix o k K) (C : Matrix k o K) (h : B * C = 1) : + LinearMap.range (A * B).mulVecLin = LinearMap.range A.mulVecLin := by + apply le_antisymm + · rw [Matrix.mulVecLin_mul]; exact LinearMap.range_comp_le_range _ _ + · have : A = (A * B) * C := by rw [Matrix.mul_assoc, h, Matrix.mul_one] + conv_lhs => rw [this] + rw [Matrix.mulVecLin_mul]; exact LinearMap.range_comp_le_range _ _ + +theorem Nm_isUnit (x y : ℕ → n → K) (m : ℕ) : IsUnit (Nm x y m) := by + rw [Matrix.isUnit_iff_isUnit_det] + have hb : (Nm x y m).BlockTriangular id := by + intro i j hij + have hij' : j < i := hij + simp [Nm, Matrix.add_apply, Matrix.one_apply, hij'.ne', not_lt.2 hij'.le] + rw [Matrix.det_of_upperTriangular hb] + simp [Nm] + +variable [DecidableEq K] + +/-- rank of `I - diag s` (`s = ±1`, char ≠ 2) = number of flipped coordinates -/ +theorem rank_one_sub_diag (h2 : (2 : K) ≠ 0) (s : n → K) (hs : ∀ a, s a = 1 ∨ s a = -1) : + (1 - diagonal s).rank = (univ.filter fun a => s a = -1).card := by + have : (1 - diagonal s) = diagonal fun a => 1 - s a := by + ext a b; by_cases h : a = b <;> simp [diagonal_apply, Matrix.one_apply, h] + have hne : (1 : K) ≠ -1 := by intro h; apply h2; linear_combination h + rw [this, rank_diagonal, Fintype.card_subtype] + congr 1 + apply filter_congr + intro a _ + rcases hs a with h | h + · simp [h, hne] + · simp [h, sub_neg_eq_add, one_add_one_eq_two, h2] + +/-- **Lemma TS (tight supports).** char ≠ 2. A unit-free character: the ordered product of the `m` +jobs `1 - x_i y_iᵀ` is `D = diag s` (`s = ±1`), and the number `r` of flipped coordinates equals the +number `m` of active jobs. Then (i) the Gram matrix is `y_i·x_j = 2 δ_ij`; (ii) every job vanishes +(x and y) on every unflipped coordinate (so never touches a dark target); (iii) +`image (I - D) = span (x_i)`. -/ +theorem lemmaTS (m : ℕ) (x y : ℕ → n → K) (s : n → K) (h2 : (2 : K) ≠ 0) + (hs : ∀ a, s a = 1 ∨ s a = -1) + (hprod : pp x y m = diagonal s) (hcard : (univ.filter fun a => s a = -1).card = m) : + (∀ i j : Fin m, y i ⬝ᵥ x j = if i = j then 2 else 0) ∧ + (∀ (i : Fin m) a, s a = 1 → x i a = 0 ∧ y i a = 0) ∧ + LinearMap.range (1 - diagonal s).mulVecLin = + Submodule.span K (Set.range fun i : Fin m => x i) := by + set X := Xm x m with hX + set Y : Matrix n (Fin m) K := Matrix.of fun a i => y i a with hY + set Z := Zm x y m with hZ + set N := Nm x y m with hN + have hZN : Z * N = X := ZN_eq x y m + have hP : 1 - diagonal s = Z * Yᵀ := by + have := pp_eq x y m + rw [hprod, sum_ZY] at this + rw [this]; abel + have hDD : diagonal s * diagonal s = 1 := by + rw [diagonal_mul_diagonal, ← diagonal_one] + congr 1; funext a; rcases hs a with h | h <;> simp [h] + have hrP : (1 - diagonal s).rank = m := by rw [rank_one_sub_diag h2 s hs, hcard] + have hrZ : Z.rank = m := by + refine le_antisymm ?_ ?_ + · exact (Matrix.rank_le_card_width Z).trans (by simp) + · have := rank_mul_le_left Z Yᵀ; rw [← hP, hrP] at this; exact this + have hrY : Y.rank = m := by + refine le_antisymm ?_ ?_ + · exact (Matrix.rank_le_card_width Y).trans (by simp) + · have := (rank_mul_le_right Z Yᵀ).trans_eq (Matrix.rank_transpose Y); rw [← hP, hrP] at this; exact this + obtain ⟨L, hL⟩ := exists_left_inv Z hrZ + obtain ⟨L', hL'⟩ := exists_left_inv Y hrY + have hR : Yᵀ * L'ᵀ = 1 := by rw [← Matrix.transpose_mul, hL', Matrix.transpose_one] + have hsq : (Z * Yᵀ) * (Z * Yᵀ) = (2 : K) • (Z * Yᵀ) := by + rw [← hP] + have : (1 - diagonal s) * (1 - diagonal s) = 1 - diagonal s - diagonal s + diagonal s * diagonal s := by + noncomm_ring + rw [this, hDD] + ext a b; simp [Matrix.sub_apply, Matrix.add_apply]; ring + have hYZ : Yᵀ * Z = (2 : K) • 1 := by + calc Yᵀ * Z = (L * Z) * (Yᵀ * Z) * (Yᵀ * L'ᵀ) := by rw [hL, hR]; simp + _ = L * ((Z * Yᵀ) * (Z * Yᵀ)) * L'ᵀ := by simp only [Matrix.mul_assoc] + _ = L * ((2 : K) • (Z * Yᵀ)) * L'ᵀ := by rw [hsq] + _ = (2 : K) • ((L * Z) * (Yᵀ * L'ᵀ)) := by + simp only [Matrix.mul_smul, Matrix.smul_mul, Matrix.mul_assoc] + _ = (2 : K) • 1 := by rw [hL, hR]; simp + have hG : Yᵀ * X = (2 : K) • N := by + rw [← hZN, ← Matrix.mul_assoc, hYZ, Matrix.smul_mul, Matrix.one_mul] + refine ⟨?_, ?_, ?_⟩ + · intro i j + have h := congrFun (congrFun hG i) j + rw [gram_apply] at h + simp only [Matrix.smul_apply, hN, Nm, Matrix.add_apply, Matrix.one_apply, Matrix.of_apply, + smul_eq_mul] at h + rcases lt_trichotomy i j with hij | hij | hij + · simp only [hij, if_true, hij.ne, if_false, zero_add] at h + have : y i ⬝ᵥ x j = 0 := by linear_combination (-1 : K) * h + simp [hij.ne, this] + · subst hij; simp at h; rw [h]; simp + · simp only [not_lt.2 hij.le, if_false, hij.ne', add_zero] at h + simp [hij.ne', h] + · intro i a ha + have hP0 : ∀ b, (Z * Yᵀ) a b = 0 ∧ (Z * Yᵀ) b a = 0 := by + intro b; rw [← hP] + by_cases h : a = b + · subst h; simp [Matrix.sub_apply, Matrix.one_apply, diagonal_apply, ha] + · simp [Matrix.sub_apply, Matrix.one_apply, diagonal_apply, h, Ne.symm h] + constructor + · -- row `a` of Z vanishes + have hrow : (fun j => Z a j) ᵥ* Yᵀ = 0 := by + funext b; simpa [Matrix.mul_apply, Matrix.vecMul, dotProduct] using (hP0 b).1 + have hw : (fun j => Z a j) = 0 := by + calc (fun j => Z a j) = (fun j => Z a j) ᵥ* (Yᵀ * L'ᵀ) := by rw [hR]; simp + _ = 0 := by rw [← Matrix.vecMul_vecMul, hrow]; simp + have : X a i = 0 := by + rw [← hZN]; simp [Matrix.mul_apply, congrFun hw] + simpa [hX, Xm] using this + · have hcol : Z *ᵥ (fun j => Y a j) = 0 := by + funext c; simpa [Matrix.mul_apply, Matrix.mulVec, dotProduct] using (hP0 c).2 + have hw : (fun j => Y a j) = 0 := by + calc (fun j => Y a j) = (L * Z) *ᵥ (fun j => Y a j) := by rw [hL]; simp + _ = 0 := by rw [← Matrix.mulVec_mulVec, hcol]; simp + exact congrFun hw i + · obtain ⟨C, hC⟩ : ∃ C, N * C = 1 := ⟨N⁻¹, Matrix.mul_nonsing_inv _ + ((Matrix.isUnit_iff_isUnit_det _).1 (Nm_isUnit x y m))⟩ + rw [hP, range_mul_right_inv Z (Yᵀ) L'ᵀ hR, ← range_mul_right_inv Z N C hC, hZN, + Matrix.range_mulVecLin] + rfl + +end TS + + +/-! ## §3. Lemma UR (unit rank) -/ +section UR + +/-- `neg` does not change rank -/ +theorem rank_neg_le {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] + (A : Matrix m n K) : (-A).rank ≤ A.rank := by + have : -A = (diagonal fun _ : m => (-1 : K)) * A := by ext i j; simp [diagonal_mul] + rw [this]; exact rank_mul_le_right _ _ + +theorem rank_neg_eq {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] + (A : Matrix m n K) : (-A).rank = A.rank := + le_antisymm (rank_neg_le A) (by simpa using rank_neg_le (-A)) + +/-! ### Upper bound: words, units moved left past the jobs. +Convention (mirror of `R25Kill.ev_eq`): a word is a list of letters in a group `G`, `inl` = a unit +(transvection), `inr` = a job. The jobs are moved RIGHT, so each unit is conjugated by the product of +the jobs to its left. -/ +section Word +variable {G : Type*} [Group G] + +def ev : List (G ⊕ G) → G + | [] => 1 + | .inl a :: w => a * ev w + | .inr b :: w => b * ev w + +/-- ordered product of the job letters -/ +def jobsP : List (G ⊕ G) → G + | [] => 1 + | .inl _ :: w => jobsP w + | .inr b :: w => b * jobsP w + +/-- the unit letters, each conjugated by the jobs before it (`pre` = product of jobs so far) -/ +def uconj : List (G ⊕ G) → G → List G + | [], _ => [] + | .inl t :: w, pre => (pre * t * pre⁻¹) :: uconj w pre + | .inr j :: w, pre => uconj w (pre * j) + +def ucount : List (G ⊕ G) → ℕ + | [] => 0 + | .inl _ :: w => ucount w + 1 + | .inr _ :: w => ucount w + +theorem ev_move : ∀ (w : List (G ⊕ G)) (pre : G), + pre * ev w = (uconj w pre).prod * (pre * jobsP w) + | [], pre => by simp [ev, uconj, jobsP] + | .inl t :: w, pre => by + have ih := ev_move w pre + simp only [ev, uconj, jobsP, List.prod_cons] + calc pre * (t * ev w) = (pre * t * pre⁻¹) * (pre * ev w) := by group + _ = _ := by rw [ih]; group + | .inr j :: w, pre => by + have ih := ev_move w (pre * j) + simp only [ev, uconj, jobsP] + rw [← mul_assoc, ih]; group + +theorem length_uconj : ∀ (w : List (G ⊕ G)) (pre : G), (uconj w pre).length = ucount w + | [], _ => rfl + | .inl _ :: w, pre => by simp [uconj, ucount, length_uconj w pre] + | .inr j :: w, pre => by simp [uconj, ucount, length_uconj w (pre * j)] + +end Word + +section Upper +variable {n : Type*} [Fintype n] [DecidableEq n] + +theorem rank_prod_sub_one_le (l : List (Matrix n n K)ˣ) + (h : ∀ a ∈ l, ((a : Matrix n n K) - 1).rank ≤ 1) : + (((l.prod : (Matrix n n K)ˣ) : Matrix n n K) - 1).rank ≤ l.length := by + induction l with + | nil => simp + | cons a l ih => + have h1 := h a (by simp) + have h2 := ih fun b hb => h b (by simp [hb]) + have e : (((a :: l).prod : (Matrix n n K)ˣ) : Matrix n n K) - 1 = + (a : Matrix n n K) * (((l.prod : (Matrix n n K)ˣ) : Matrix n n K) - 1) + + ((a : Matrix n n K) - 1) := by + simp only [List.prod_cons, Units.val_mul]; noncomm_ring + rw [e] + refine (rank_add_le' _ _).trans ?_ + have := rank_mul_le_right (a : Matrix n n K) (((l.prod : (Matrix n n K)ˣ) : Matrix n n K) - 1) + simp only [List.length_cons] + omega + +theorem uconj_rank : ∀ (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) (pre : (Matrix n n K)ˣ), + (∀ t, Sum.inl t ∈ w → ((t : Matrix n n K) - 1).rank ≤ 1) → + ∀ c ∈ uconj w pre, ((c : Matrix n n K) - 1).rank ≤ 1 + | [], _, _ => by simp [uconj] + | .inl t :: w, pre, h => by + intro c hc + simp only [uconj, List.mem_cons] at hc + rcases hc with rfl | hc + · have e : ((pre * t * pre⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) - 1 = + (pre : Matrix n n K) * ((t : Matrix n n K) - 1) * ((pre⁻¹ : (Matrix n n K)ˣ) : Matrix n n K) := by + have := pre.mul_inv + simp only [Units.val_mul, mul_sub, sub_mul, mul_one] + rw [Matrix.mul_assoc (pre : Matrix n n K) (t : Matrix n n K), this] + rw [e] + exact (rank_mul_le_left _ _).trans ((rank_mul_le_right _ _).trans (h t (by simp))) + · exact uconj_rank w pre (fun t ht => h t (by simp [ht])) c hc + | .inr j :: w, pre, h => by + exact uconj_rank w (pre * j) (fun t ht => h t (by simp [ht])) + +/-- **Lemma UR, upper bound.** In a word whose unit letters have rank(t - 1) ≤ 1, with the jobs moved +to the right, `rank(ev w - J) ≤ #units`, `J` = ordered product of the job letters. -/ +theorem UR_upper (w : List ((Matrix n n K)ˣ ⊕ (Matrix n n K)ˣ)) + (h : ∀ t, Sum.inl t ∈ w → ((t : Matrix n n K) - 1).rank ≤ 1) : + (((ev w : (Matrix n n K)ˣ) : Matrix n n K) - ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K)).rank + ≤ ucount w := by + have h1 := ev_move w 1 + simp only [one_mul] at h1 + have h2 := rank_prod_sub_one_le (uconj w 1) (uconj_rank w 1 h) + rw [length_uconj] at h2 + have e : ((ev w : (Matrix n n K)ˣ) : Matrix n n K) - ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) = + ((((uconj w 1).prod : (Matrix n n K)ˣ) : Matrix n n K) - 1) * + ((jobsP w : (Matrix n n K)ˣ) : Matrix n n K) := by + rw [h1]; simp [sub_mul] + rw [e] + exact (rank_mul_le_left _ _).trans h2 + +end Upper + +end UR + +section Lower +variable {n₁ nd : Type*} [Fintype n₁] [Fintype nd] [DecidableEq n₁] [DecidableEq nd] [DecidableEq K] + +/-- a Gram-`2I` clique has ordered product `I - X Yᵀ` -/ +theorem pp_clique (k : ℕ) (x y : ℕ → n₁ → K) + (hg : ∀ i < k, ∀ j < k, y i ⬝ᵥ x j = if i = j then 2 else 0) : + pp x y k = 1 - Xm x k * (Matrix.of fun a (i : Fin k) => y i a)ᵀ := by + have hz : ∀ i < k, zv x y i = x i := by + intro i hi + rw [zv_rec] + have : ∑ j ∈ range i, (y j ⬝ᵥ x i) • zv x y j = 0 := by + refine sum_eq_zero fun j hj => ?_ + have := mem_range.1 hj + rw [hg j (by omega) i hi, if_neg (by omega)]; simp + rw [this, sub_zero] + have hZ : Zm x y k = Xm x k := by + ext a i; simp [Zm, Xm, hz i i.2] + rw [pp_eq, sum_ZY, hZ] + +/-- `rank (X Yᵀ) = k` for a Gram-`2I` clique (char ≠ 2) -/ +theorem rank_clique (h2 : (2 : K) ≠ 0) (k : ℕ) (x y : ℕ → n₁ → K) + (hg : ∀ i < k, ∀ j < k, y i ⬝ᵥ x j = if i = j then 2 else 0) : + (Xm x k * (Matrix.of fun a (i : Fin k) => y i a)ᵀ).rank = k := by + set X := Xm x k + set Y : Matrix n₁ (Fin k) K := Matrix.of fun a i => y i a + have hYX : Yᵀ * X = (2 : K) • 1 := by + ext i j + rw [gram_apply] + simp [hg i i.2 j j.2, Matrix.one_apply, Fin.val_inj] + have h4 : (4 : K) ≠ 0 := by + have : (4 : K) = 2 * 2 := by norm_num + rw [this]; exact mul_ne_zero h2 h2 + have e : Yᵀ * (X * Yᵀ) * X = (diagonal fun _ : Fin k => (4 : K)) := by + have : Yᵀ * (X * Yᵀ) * X = (Yᵀ * X) * (Yᵀ * X) := by simp only [Matrix.mul_assoc] + rw [this, hYX] + ext i j + by_cases h : i = j <;> simp [Matrix.smul_apply, Matrix.one_apply, diagonal_apply, h]; norm_num + refine le_antisymm ?_ ?_ + · exact (rank_mul_le_left X Yᵀ).trans ((Matrix.rank_le_card_width X).trans (by simp)) + · have h1 : (Yᵀ * (X * Yᵀ) * X).rank ≤ (X * Yᵀ).rank := + (rank_mul_le_left _ _).trans (rank_mul_le_right _ _) + rw [e, rank_diagonal] at h1 + simpa [h4] using h1 + +/-- **Lemma UR, lower bound.** char ≠ 2. `V = V₁ ⊕ V_dark` (coordinates `n₁ ⊕ nd`). The jobs are the +`k` jobs of a Gram-`2I` clique on `V₁` that are ALL the active jobs of μ, so `J = (ordered product) ⊕ I`; +`D = diag s₁ ⊕ diag sd` (signs). With `r₁` flipped targets in `V₁` and `d` flipped dark targets, +`rank (D - J) ≥ d + |k - r₁|` (written with truncated subtraction; one of the two terms is 0). -/ +theorem UR_lower (h2 : (2 : K) ≠ 0) (k : ℕ) (x y : ℕ → n₁ → K) + (hg : ∀ i < k, ∀ j < k, y i ⬝ᵥ x j = if i = j then 2 else 0) + (s₁ : n₁ → K) (sd : nd → K) (hs₁ : ∀ a, s₁ a = 1 ∨ s₁ a = -1) (hsd : ∀ a, sd a = 1 ∨ sd a = -1) : + (univ.filter fun a => sd a = -1).card + + ((k - (univ.filter fun a => s₁ a = -1).card) + ((univ.filter fun a => s₁ a = -1).card - k)) + ≤ (fromBlocks (diagonal s₁) 0 0 (diagonal sd) - fromBlocks (pp x y k) 0 0 1).rank := by + set M := Xm x k * (Matrix.of fun a (i : Fin k) => y i a)ᵀ with hM + set E : Matrix n₁ n₁ K := 1 - diagonal s₁ with hE + have hMk : M.rank = k := rank_clique h2 k x y hg + have hEr : E.rank = (univ.filter fun a => s₁ a = -1).card := rank_one_sub_diag h2 s₁ hs₁ + have hBr : ((diagonal sd : Matrix nd nd K) - 1).rank = (univ.filter fun a => sd a = -1).card := by + rw [← neg_sub, rank_neg_eq]; exact rank_one_sub_diag h2 sd hsd + have eD : fromBlocks (diagonal s₁) 0 0 (diagonal sd) - fromBlocks (pp x y k) 0 0 1 = + fromBlocks (M - E) 0 0 (diagonal sd - 1) := by + rw [pp_clique k x y hg] + ext (i | i) (j | j) <;> simp [hM, hE, diagonal_apply, Matrix.sub_apply, Matrix.one_apply] <;> ring + have h1 := rank_le_sub_add M E + have h3 : E.rank ≤ (M - E).rank + M.rank := by + have := rank_le_sub_add E M + rw [← neg_sub, rank_neg_eq] at this + exact this + have h4 := rank_fromBlocks_diag_ge (M - E) ((diagonal sd : Matrix nd nd K) - 1) + rw [eD] + omega + +end Lower + +section Combined +variable {n₁ nd : Type*} [Fintype n₁] [Fintype nd] [DecidableEq n₁] [DecidableEq nd] [DecidableEq K] + +/-- **Lemma UR (combined).** A word in `GL(V₁ ⊕ V_dark)` of `U` unit letters (rank(t - 1) ≤ 1) and the +job letters whose ordered product `J = (Gram-2I clique product) ⊕ I` is ALL the active jobs. If the word +multiplies to `D = diag s₁ ⊕ diag sd`, then `U ≥ d + |k - r₁|`. -/ +theorem UR_combined (h2 : (2 : K) ≠ 0) (k : ℕ) (x y : ℕ → n₁ → K) + (hg : ∀ i < k, ∀ j < k, y i ⬝ᵥ x j = if i = j then 2 else 0) + (s₁ : n₁ → K) (sd : nd → K) (hs₁ : ∀ a, s₁ a = 1 ∨ s₁ a = -1) (hsd : ∀ a, sd a = 1 ∨ sd a = -1) + (w : List ((Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ ⊕ (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ)) + (hunits : ∀ t, Sum.inl t ∈ w → ((t : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) - 1).rank ≤ 1) + (hD : ((ev w : (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ) : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) = + fromBlocks (diagonal s₁) 0 0 (diagonal sd)) + (hJ : ((jobsP w : (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ) : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) = + fromBlocks (pp x y k) 0 0 1) : + (univ.filter fun a => sd a = -1).card + + ((k - (univ.filter fun a => s₁ a = -1).card) + ((univ.filter fun a => s₁ a = -1).card - k)) + ≤ ucount w := by + have hu := UR_upper w hunits + rw [hD, hJ] at hu + exact (UR_lower h2 k x y hg s₁ sd hs₁ hsd).trans hu + +end Combined + +/-! ## §4. R26#10 as a worked instance, and sanity checks -/ +section Instance + +/-- **R26#10**: d = 1 (target 4 dark), r₁ = 0, k = 3 (clique A, C, E at μ = 13, all active jobs). +Character data as hypotheses; conclusion `U ≥ 4`, in particular `U = 3` is impossible. -/ +theorem r26_10 {n₁ nd : Type*} [Fintype n₁] [Fintype nd] [DecidableEq n₁] [DecidableEq nd] + [DecidableEq K] (h2 : (2 : K) ≠ 0) (x y : ℕ → n₁ → K) + (hg : ∀ i < 3, ∀ j < 3, y i ⬝ᵥ x j = if i = j then 2 else 0) + (s₁ : n₁ → K) (sd : nd → K) (hs₁ : ∀ a, s₁ a = 1 ∨ s₁ a = -1) (hsd : ∀ a, sd a = 1 ∨ sd a = -1) + (hd : (univ.filter fun a => sd a = -1).card = 1) + (hr1 : (univ.filter fun a => s₁ a = -1).card = 0) + (w : List ((Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ ⊕ (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ)) + (hunits : ∀ t, Sum.inl t ∈ w → ((t : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) - 1).rank ≤ 1) + (hD : ((ev w : (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ) : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) = + fromBlocks (diagonal s₁) 0 0 (diagonal sd)) + (hJ : ((jobsP w : (Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K)ˣ) : Matrix (n₁ ⊕ nd) (n₁ ⊕ nd) K) = + fromBlocks (pp x y 3) 0 0 1) : + 4 ≤ ucount w ∧ ucount w ≠ 3 := by + have := UR_combined h2 3 x y hg s₁ sd hs₁ hsd w hunits hD hJ + rw [hd, hr1] at this + omega + +/-- the pure arithmetic: `d + |k - r₁|` for the six R42 kills, all `4 > 3`. -/ +theorem r26_arith : + (1 + ((3 - 0) + (0 - 3)) = 4) ∧ (2 + ((3 - 1) + (1 - 3)) = 4) := by decide + +/-- sanity (non-vacuity of TS): one job `1 - x yᵀ`, `x = e₀`, `y = 2 e₀` on `Fin 2` over ℚ, product +`diag(-1, 1)`, one flipped coordinate; conclusion Gram = 2 holds and the dark coordinate 1 is untouched. -/ +example : ∃ (x y : ℕ → Fin 2 → ℚ) (s : Fin 2 → ℚ), + pp x y 1 = diagonal s ∧ (∀ a, s a = 1 ∨ s a = -1) ∧ + (univ.filter fun a => s a = -1).card = 1 := by + refine ⟨fun _ => ![1, 0], fun _ => ![2, 0], ![-1, 1], ?_, ?_, ?_⟩ + · ext i j; fin_cases i <;> fin_cases j <;> simp [pp, refl, vecMulVec_apply, diagonal_apply] <;> norm_num + · intro a; fin_cases a <;> simp + · decide + +/-- the tightness hypothesis `r = k` cannot be dropped: two identical jobs on `Fin 1` multiply to `I` +(`r = 0 < k = 2`), yet the Gram matrix is not `2I` (`y₀·x₁ = 2`). -/ +theorem tight_needed : ∃ (x y : ℕ → Fin 1 → ℚ), + pp x y 2 = diagonal (fun _ => (1 : ℚ)) ∧ y 0 ⬝ᵥ x 1 ≠ 0 := by + refine ⟨fun _ => ![1], fun _ => ![2], ?_, ?_⟩ + · ext i j; fin_cases i; fin_cases j + simp [pp, refl, Matrix.mul_apply, Matrix.sub_apply, vecMulVec_apply, Fin.sum_univ_one]; norm_num + · simp [dotProduct] + +end Instance + +end SpecTSUR + +#print axioms SpecTSUR.lemmaTS +#print axioms SpecTSUR.UR_upper +#print axioms SpecTSUR.UR_lower +#print axioms SpecTSUR.UR_combined +#print axioms SpecTSUR.r26_10 +#print axioms SpecTSUR.tight_needed diff --git a/research/p104-lean-premises/lean/Nov15/SpecTSUR.md b/research/p104-lean-premises/lean/Nov15/SpecTSUR.md new file mode 100644 index 0000000000..fb429cd67e --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/SpecTSUR.md @@ -0,0 +1,19 @@ +# SpecTSUR.lean: spec-break R42 Lemma TS + Lemma UR, kernel-only +No sorry, no native_decide, ~8 s, 2.1 GB RSS. Axioms (all headline theorems): [propext, Classical.choice, Quot.sound]. +Source: internal notes §1-5 + AUDIT42.md. Matrices over a field K, coordinates `n`; jobs `refl x y = 1 - x yᵀ`; ordered product `pp x y m` (prefix product). + +**Product formula** (`pp_eq`, `zv_rec`, `ZN_eq`): `pp m = I - Z Yᵀ`, `Z N = X`, `N = I + strict-upper(G)`, `G_ij = y_i·x_j`. Proved by telescoping, any ordering. + +**Lemma TS (`lemmaTS`).** char ≠ 2 (2 ≠ 0), product of m jobs = diag s (s = ±1), #flipped = m (tight). Then +(i) Gram y_i·x_j = 2 δ_ij (G = 2N, N unitriangular => G = 2I); (ii) x_i, y_i vanish on every unflipped coordinate (so jobs never touch a dark target); (iii) range(I - D) = span(x_i). +Paper true as written. Remarks: y_i·x_i = 2 is NOT a hypothesis, it is a conclusion; `tight_needed`: r = k cannot be dropped (two equal jobs on Fin 1 over ℚ multiply to I, r = 0 < k = 2, Gram not 2I). + +**Lemma UR.** +- Upper (`UR_upper`): word in the unit group of matrices, letters inl = unit (rank(t-1) ≤ 1), inr = job; moving jobs right conjugates each unit by the jobs to its left (`ev_move`, mirror of R25Kill.ev_eq) => rank(ev w - J) ≤ #units, J = ordered product of ALL job letters. +- Lower (`UR_lower`): V = V₁ ⊕ V_dark (index `n₁ ⊕ nd`), J = (Gram-2I clique product) ⊕ I, D = diag s₁ ⊕ diag sd: rank(D - J) ≥ d + |k - r₁| (truncated subtraction, one term is 0). Uses rank(XYᵀ) = k (`rank_clique`, needs 2 ≠ 0), rank(I - diag s) = #flips (needs 2 ≠ 0), block-diagonal rank additivity (`rank_fromBlocks_diag_ge`, proved here, not in Mathlib). +- Combined (`UR_combined`): both with the SAME J, which is exactly the audit's hypothesis "the clique = ALL active jobs of μ" (UR_upper needs J = all active jobs, UR_lower needs J Gram-2I); D = word product. Conclusion U ≥ d + |k - r₁|. +- Not formalised as a theorem: the paper's "D₁ - J₁ = -2Π_R + 2Π_W" form (only the rank-subadditivity consequence is used, as in the audit); the "every job in some tight set => V = V₁ ⊕ V_dark" bookkeeping (taken as the block hypothesis). + +**R26#10 (`r26_10`).** d = 1, r₁ = 0, k = 3 (ACE clique at μ = 13) as hypotheses => ucount w ≥ 4, so U = 3 impossible. `r26_arith`: the other five kills have the same arithmetic (#11-#14: (1,0,3); #8: (2,1,3) => 2+2 = 4). + +**Verdict: no paper slip found** in TS or UR as audited (AUDIT42's fixes = the two hypotheses, now explicit). Hypotheses are exactly: char ≠ 2; tightness r = k for TS; clique = all active jobs (same J) for UR. diff --git a/research/p104-lean-premises/lean/Nov15/SwapNull.lean b/research/p104-lean-premises/lean/Nov15/SwapNull.lean new file mode 100644 index 0000000000..c106f29bce --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/SwapNull.md b/research/p104-lean-premises/lean/Nov15/SwapNull.md new file mode 100644 index 0000000000..c8950480ee --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/SwapWord.lean b/research/p104-lean-premises/lean/Nov15/SwapWord.lean new file mode 100644 index 0000000000..49dfdcbae8 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/TokenCancel.lean b/research/p104-lean-premises/lean/Nov15/TokenCancel.lean new file mode 100644 index 0000000000..5686668ec3 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/WholeFloor.md b/research/p104-lean-premises/lean/Nov15/WholeFloor.md new file mode 100644 index 0000000000..3a3c741ac5 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/WholeFloor.md @@ -0,0 +1,29 @@ +# WholeFloor*.lean: whole-floor R3 in Lean +Files: WholeFloorModel (model + CS), WholeFloorSlack (slack-rank), WholeFloorPrice (pricing, lateral counterexample, F floor, fixed-caller point), WholeFloorLogs (generated by internal notes: log brackets, caller D0), WholeFloorEnd (D0 floor). Kernel-only: all #print axioms within [propext, Classical.choice, Quot.sound]; no sorry, no native_decide. Each file 6-13 s, <= 2.9 GB (the memory-guarded build script). + +## 1. Proved (R3 §1-2) +- Model: ghosted run state `St`, events `Step` (birth, gate = any same-chart linear combination (ADD/SCALE/COPY), public MOVE strictly ascending, owned MOVE any chart, owned CLEAR). Owned birth row 0 (R5), public e_r. Ghosts B/A/eRow/O = generators of I_C. +- `reach_inv`: invariants (CS; stayer was born or entered; B, A disjoint; ascent; B,A public) hold on every run. `cs_final`: every row that sits at c at any moment lies in I_c of the END state (so every exit row, every final row of a register ending at c). +- `slack_rank`: with hypothesis `Indep` (final rows of stayers + unit rows of c-born leavers independent: R3 "checked"), I_c = F_stay (+) E_BL (+) K_c, `finrank K_c <= sigma_c = s_c + o_c` (passers = public entrants not ending at c = enter-then-leave, since public never CLEARed), and `finrank (F+E) + s_c = |B_c| + |A_c|`. `count_id`, `gens_finrank_le` (dim I_c <= |B|+|A|+o). +- Paper statements TRUE as written for §1-2. Not formalised: independence (data hypothesis), the port lemma / Theorem Y (sum sigma >= 104 over C != V; it uses F2^9 structure, odd ports, X/Y endpoints) = hypothesis `h_Y`. + +## 2. Pricing (R3 §3) +- `d0_floor`: with FloorD0.helperD0_ge_fL (hyp h_help), main price (h_main), owned D0 = -sum f(k_i), k_i in 1..9, mass <= 112, >= 16 paid owned moves, h_Y: D0_nat >= -400 f 8 - 12 f 9 + 2 ln 2 * max 0 (88 - lat). Chord bound f(k) <= (f 9/8)(k-1) replaces the DP; slope f 9/8 >= 2 ln 2 (`two_ln2_le`) gives the argmin m = 16. +- `WholeFloorLogs.key` (kernel): D0(#7113 caller C(8|9)) >= 270,812.8 (exact 270,812.817) and caller - 17(400 f8 + 12 f9 - 176 ln 2) >= 155,730.9 (exact 155,730.9896); 11 prime-log brackets (series, 1e-13) + log 2 from Mathlib. +- `WholeFloorEnd.d0_whole_floor`: priced word with lat = 0 => 17-call invoice D0 >= 155,730.9 (R3: 155,730.99). `d0_whole_floor_any_lat`: ANY lat => D0 >= 153,656.9 (R2's value). +- `F_floor`: s in [0,1] => F_nat <= -NflL lat s, with NflL 0 = JointCeiling.Nfl (`NflL_zero`): JointCeiling's hypothesis hN is derived from the F-currency decomposition + h_Y, for lat = 0. +- `fixed_caller_point`: lat-free floor native hN => F(t = .0205) < 0 on invoice(C(8|9), n, 17) (JointCeiling.control_bracket transferred). The full ceiling .0204110964 (F' < 0 on [hi,.1], F < 0 on [.1,1], 40-digit interval covers) is NOT in the kernel; control_pos (JointCeiling) shows F(.0204) > 0 for natFloor itself, so the floor native cannot beat .0204. + +## 3. STATEMENT FALSE AS WRITTEN: R3 §3 "forced stops >= 88 at m = 16, argmin m = 16 (monotone)" +R3 prices owned MOVEs with k_i in 1..9 only (r3f.py DP `for k in range(1,10)`), but Theorem Y counts ALL owned MOVEs in m. A LATERAL owned MOVE (distinct charts, equal dim; pricekit `rk = |dim b - dim a| = 0`, P[0] unused by Dsum, f(0) = 0, mass 0, not excluded by l.51 which only constrains public) enters sigma_C for free. +Lean counterexample `cex` / `cex_priced` / `r3_stops_not_forced`: 12 owned rank-9 MOVEs + 4 rank-1 (mass 112, 16 paid), 88 lateral owned MOVEs, no stops: satisfies every hypothesis (h_Y: 0 + 0 + 16 + 88 = 104), D0 = -400 f 8 - 12 f 9 < R3's -400 f 8 - 12 f 9 + 88 * 2 ln 2 (`cex_attains`). +Corrected statement: D0 >= -400 f 8 - 12 f 9 + 2 ln 2 * max 0 (88 - lat) (`d0_floor`); R3's 155,730.99 / kappa <= .0204110964 hold on words with no lateral owned MOVE (all four R3 soundness words: #7630 has 47 owned MOVEs, |dim| histogram {1:20,2:9,3:2,4:13,5:2,6:1}); the all-words floor is R2's 153,657.09 / kappa <= .0207160184 until lateral owned MOVEs are priced or excluded. Fix options: count only owned MOVEs with Delta >= 1 in h_Y's m, or prove lateral owned moves cannot be sigma-useful (a rank argument on the chart pair), or add a per-MOVE cost to the verifier model. + +## 4. NESTING rule added; all-words floors : WholeFloorNest / WholeFloorCover / WholeFloorCoverData{1,} +Section 3's counterexample (`cex`, `cex_priced`, `r3_stops_not_forced`, kept as documentation that the rule is NECESSARY) uses lateral owned MOVEs. LAT.md (internal notes) settled that they are ILLEGAL: verifier local.py:66 `need(frames[b] < frames[a] if private else frames[a] < frames[b], 'Nested chronological transport')` (frozenset `<` = PROPER subset; LAT.md item 1); owned-ascent relaxation only adds `or frames[a] < frames[b]` (pr6902-OWNED-ASCENT.md, item 2); SPEC 03-motifs.tex "On every edge one label will contain the other" (item 3); local.py:67 `paid[abs(len(frames[b])-len(frames[a]))] += 1`, so every legal MOVE has rank >= 1 (item 4). +- `WholeFloorNest`: `Geo` (dim + proper nesting `sub`, `sub_dim`), `rank`, `NestOwn` (owned: either direction), `StepL`/`RunL` = WholeFloorModel.Step with the guard (public: c < d and sub c d; owned: NestOwn) and a log of owned MOVE chart pairs; `StepL.toStep`, `RunL.toRun` (a nested run is a model run: reach_inv, cs_final apply); `nest_rank_pos`; `nest_lat_zero` (nesting => latCount = 0); `NestedWord` (w.lat = latCount of the log, log nested) with `lat_zero`. +- `d0_whole_floor_nested`: every priced word obeying nesting: D0 of the 17-call invoice >= 155,730.9 (R3 155,730.99). No lat hypothesis (derived). +- `hN_nested`: JointCeiling's native floor hN (F <= -Nfl) derived for nested words from F_floor + NflL_zero. +- `kappa_whole_floor_nested`: for nested priced words, F(1-t) < 0 on the invoice (caller 6 7) + 17 native for every t in [.0204110965, 1], NO numeric hypothesis: the cover is `WholeFloorCover.cover`, discharged in the kernel with NumCertK : `cfW` = merged F of caller + 17 natFloor (20 ranks), 11 negative pieces on [0, .93] + monotone piece [.93, .9795889035] (`decide +kernel`, split over WholeFloorCoverData1/Data for memory, 3.1/3.3 GB). Remaining hypotheses: `Priced w` (h_Y, h_help, h_main, owned pricing) and the F-currency pricing `hF`; Indep (slack_rank) and the port lemma stay upstream. +- DIGIT NOTE: R3's .0204110964 is the root rounded DOWN; exact root .02041109645 (F(s=.9795889036) = +6.7e-6 > 0). The kernel statement uses .0204110965 (rounded up); the 10th-digit difference is 1e-10. +Axioms of every new theorem: [propext, Classical.choice, Quot.sound]; no sorry, no native_decide. diff --git a/research/p104-lean-premises/lean/Nov15/WholeFloorCover.lean b/research/p104-lean-premises/lean/Nov15/WholeFloorCover.lean new file mode 100644 index 0000000000..7c04dd9336 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/WholeFloorCoverData.lean b/research/p104-lean-premises/lean/Nov15/WholeFloorCoverData.lean new file mode 100644 index 0000000000..8d59602eab --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/WholeFloorCoverData1.lean b/research/p104-lean-premises/lean/Nov15/WholeFloorCoverData1.lean new file mode 100644 index 0000000000..097aac7ee4 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/WholeFloorEnd.lean b/research/p104-lean-premises/lean/Nov15/WholeFloorEnd.lean new file mode 100644 index 0000000000..8cd3f03252 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/WholeFloorEnd.lean @@ -0,0 +1,44 @@ +/- +WholeFloorEnd : R3's whole-word D0 floor 155,730.99 on the 17-call invoice +(caller #7113 = C(8|9) fixed), assembled from WholeFloorPrice.d0_floor (pricing step) and +WholeFloorLogs.key (kernel-checked caller D0 and numerics), with the owned-LATERAL correction. +-/ +import Nov15.WholeFloorLogs + +set_option linter.unusedSectionVars false + +namespace WholeFloorEnd +open CallerCost WholeFloorPrice + +/-- **R3 floor**: for every priced native word WITHOUT lateral owned MOVEs (lat = 0), the 17-call invoice D0 +is >= 155,730.9 (R3: 155,730.99). -/ +theorem d0_whole_floor (w : Word) (hP : Priced w) (hlat : w.lat = 0) (n : Inv) + (hn : Dinv n = w.hD0 + w.mD0 + w.oD0) : + (155730.9 : ℝ) ≤ Dinv (invoice (caller 6 7) n 17) := by + have h1 := d0_floor w hP + rw [hlat] at h1 + have hmax : max 0 (88 - ((0 : ℕ) : ℝ)) = 88 := by norm_num + rw [hmax] at h1 + have h2 := WholeFloorLogs.floor_ge + rw [invoice_D0, hn] + push_cast + nlinarith + +/-- **corrected unconditional floor** (any number of lateral owned MOVEs): D0 >= 153,656.9, R2's value. +The extra 2,073.9 of R3 is available only when lat = 0 (see r3_stops_not_forced). -/ +theorem d0_whole_floor_any_lat (w : Word) (hP : Priced w) (n : Inv) + (hn : Dinv n = w.hD0 + w.mD0 + w.oD0) : + (153656.9 : ℝ) ≤ Dinv (invoice (caller 6 7) n 17) := by + have h1 := d0_floor w hP + have hM : (0 : ℝ) ≤ 2 * Real.log 2 * max 0 (88 - (w.lat : ℝ)) := + mul_nonneg (by have := Real.log_pos (show (1 : ℝ) < 2 by norm_num); linarith) (le_max_left _ _) + have h2 := WholeFloorLogs.floor_ge + have h3 := Real.log_two_lt_d9 + rw [invoice_D0, hn] + nlinarith + +end WholeFloorEnd + +#print axioms WholeFloorEnd.d0_whole_floor +#print axioms WholeFloorEnd.d0_whole_floor_any_lat +#print axioms WholeFloorLogs.key diff --git a/research/p104-lean-premises/lean/Nov15/WholeFloorLogs.lean b/research/p104-lean-premises/lean/Nov15/WholeFloorLogs.lean new file mode 100644 index 0000000000..7950708ed4 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/WholeFloorLogs.lean @@ -0,0 +1,257 @@ +/- +WholeFloorLogs : kernel-checked brackets for log p, p in {2,3,5,7,11,13,17,19,41,73,137}, +via Real.abs_log_sub_add_sum_range_le on log(1 - 1/q) = log((q-1)/q) with (q-1) smooth over earlier primes. +Generated by internal notes Then D0(#7113 caller) >= 270812.8 and the whole-word floor. +-/ +import Nov15.WholeFloorPrice +import Mathlib.Analysis.SpecialFunctions.Log.Deriv +import Mathlib.Analysis.Complex.ExponentialBounds + +set_option linter.unusedSectionVars false + +namespace WholeFloorLogs +open Finset Real + +theorem lg8 : Real.log (8:ℝ) = 3 * Real.log 2 := by + rw [show (8:ℝ) = (2:ℝ)^3 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg9 : Real.log (9:ℝ) = 2 * Real.log 3 := by + rw [show (9:ℝ) = (3:ℝ)^2 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg16 : Real.log (16:ℝ) = 4 * Real.log 2 := by + rw [show (16:ℝ) = (2:ℝ)^4 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg24 : Real.log (24:ℝ) = 3 * Real.log 2 + Real.log 3 := by + rw [show (24:ℝ) = (2:ℝ)^3 * (3:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg25 : Real.log (25:ℝ) = 2 * Real.log 5 := by + rw [show (25:ℝ) = (5:ℝ)^2 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg32 : Real.log (32:ℝ) = 5 * Real.log 2 := by + rw [show (32:ℝ) = (2:ℝ)^5 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg33 : Real.log (33:ℝ) = Real.log 3 + Real.log 11 := by + rw [show (33:ℝ) = (3:ℝ) * (11:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg40 : Real.log (40:ℝ) = 3 * Real.log 2 + Real.log 5 := by + rw [show (40:ℝ) = (2:ℝ)^3 * (5:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg48 : Real.log (48:ℝ) = 4 * Real.log 2 + Real.log 3 := by + rw [show (48:ℝ) = (2:ℝ)^4 * (3:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg49 : Real.log (49:ℝ) = 2 * Real.log 7 := by + rw [show (49:ℝ) = (7:ℝ)^2 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg56 : Real.log (56:ℝ) = 3 * Real.log 2 + Real.log 7 := by + rw [show (56:ℝ) = (2:ℝ)^3 * (7:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg57 : Real.log (57:ℝ) = Real.log 3 + Real.log 19 := by + rw [show (57:ℝ) = (3:ℝ) * (19:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg64 : Real.log (64:ℝ) = 6 * Real.log 2 := by + rw [show (64:ℝ) = (2:ℝ)^6 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg65 : Real.log (65:ℝ) = Real.log 5 + Real.log 13 := by + rw [show (65:ℝ) = (5:ℝ) * (13:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg72 : Real.log (72:ℝ) = 3 * Real.log 2 + 2 * Real.log 3 := by + rw [show (72:ℝ) = (2:ℝ)^3 * (3:ℝ)^2 by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg120 : Real.log (120:ℝ) = 3 * Real.log 2 + Real.log 3 + Real.log 5 := by + rw [show (120:ℝ) = (2:ℝ)^3 * (3:ℝ) * (5:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg121 : Real.log (121:ℝ) = 2 * Real.log 11 := by + rw [show (121:ℝ) = (11:ℝ)^2 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg136 : Real.log (136:ℝ) = 3 * Real.log 2 + Real.log 17 := by + rw [show (136:ℝ) = (2:ℝ)^3 * (17:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg168 : Real.log (168:ℝ) = 3 * Real.log 2 + Real.log 3 + Real.log 7 := by + rw [show (168:ℝ) = (2:ℝ)^3 * (3:ℝ) * (7:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg169 : Real.log (169:ℝ) = 2 * Real.log 13 := by + rw [show (169:ℝ) = (13:ℝ)^2 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg288 : Real.log (288:ℝ) = 5 * Real.log 2 + 2 * Real.log 3 := by + rw [show (288:ℝ) = (2:ℝ)^5 * (3:ℝ)^2 by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg289 : Real.log (289:ℝ) = 2 * Real.log 17 := by + rw [show (289:ℝ) = (17:ℝ)^2 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg360 : Real.log (360:ℝ) = 3 * Real.log 2 + 2 * Real.log 3 + Real.log 5 := by + rw [show (360:ℝ) = (2:ℝ)^3 * (3:ℝ)^2 * (5:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg361 : Real.log (361:ℝ) = 2 * Real.log 19 := by + rw [show (361:ℝ) = (19:ℝ)^2 by norm_num, Real.log_pow]; try push_cast + try ring +theorem lg1680 : Real.log (1680:ℝ) = 4 * Real.log 2 + Real.log 3 + Real.log 5 + Real.log 7 := by + rw [show (1680:ℝ) = (2:ℝ)^4 * (3:ℝ) * (5:ℝ) * (7:ℝ) by norm_num] + repeat rw [Real.log_mul (by positivity) (by positivity)] + try simp only [Real.log_pow] + try push_cast + try ring +theorem lg1681 : Real.log (1681:ℝ) = 2 * Real.log 41 := by + rw [show (1681:ℝ) = (41:ℝ)^2 by norm_num, Real.log_pow]; try push_cast + try ring +theorem sum9 : (∑ i ∈ range 13, ((1 : ℝ) / 9) ^ (i + 1) / (i + 1)) = 11987522486612009 / 101776307766293160 := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero]; norm_num + +theorem brk9 : |(11987522486612009 / 101776307766293160 : ℝ) + (Real.log 8 - Real.log 9)| ≤ 1 / 20334926626632 := by + have h := Real.abs_log_sub_add_sum_range_le (x := (1 : ℝ) / 9) (by rw [abs_of_pos (by norm_num)]; norm_num) 13 + rw [sum9, show (1 : ℝ) - 1 / 9 = (8 : ℝ) / 9 by norm_num, Real.log_div (by norm_num) (by norm_num), abs_of_pos (show (0 : ℝ) < 1 / 9 by norm_num)] at h + refine le_trans h ?_; norm_num +theorem sum25 : (∑ i ∈ range 9, ((1 : ℝ) / 25) ^ (i + 1) / (i + 1)) = 78484669640381 / 1922607421875000 := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero]; norm_num + +theorem brk25 : |(78484669640381 / 1922607421875000 : ℝ) + (Real.log 24 - Real.log 25)| ≤ 1 / 91552734375000 := by + have h := Real.abs_log_sub_add_sum_range_le (x := (1 : ℝ) / 25) (by rw [abs_of_pos (by norm_num)]; norm_num) 9 + rw [sum25, show (1 : ℝ) - 1 / 25 = (24 : ℝ) / 25 by norm_num, Real.log_div (by norm_num) (by norm_num), abs_of_pos (show (0 : ℝ) < 1 / 25 by norm_num)] at h + refine le_trans h ?_; norm_num +theorem sum49 : (∑ i ∈ range 7, ((1 : ℝ) / 49) ^ (i + 1) / (i + 1)) = 1957826685723 / 94951230198860 := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero]; norm_num + +theorem brk49 : |(1957826685723 / 94951230198860 : ℝ) + (Real.log 48 - Real.log 49)| ≤ 1 / 32554707496752 := by + have h := Real.abs_log_sub_add_sum_range_le (x := (1 : ℝ) / 49) (by rw [abs_of_pos (by norm_num)]; norm_num) 7 + rw [sum49, show (1 : ℝ) - 1 / 49 = (48 : ℝ) / 49 by norm_num, Real.log_div (by norm_num) (by norm_num), abs_of_pos (show (0 : ℝ) < 1 / 49 by norm_num)] at h + refine le_trans h ?_; norm_num +theorem sum121 : (∑ i ∈ range 6, ((1 : ℝ) / 121) ^ (i + 1) / (i + 1)) = 520903964929 / 62768567534420 := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero]; norm_num + +theorem brk121 : |(520903964929 / 62768567534420 : ℝ) + (Real.log 120 - Real.log 121)| ≤ 1 / 376611405206520 := by + have h := Real.abs_log_sub_add_sum_range_le (x := (1 : ℝ) / 121) (by rw [abs_of_pos (by norm_num)]; norm_num) 6 + rw [sum121, show (1 : ℝ) - 1 / 121 = (120 : ℝ) / 121 by norm_num, Real.log_div (by norm_num) (by norm_num), abs_of_pos (show (0 : ℝ) < 1 / 121 by norm_num)] at h + refine le_trans h ?_; norm_num +theorem sum169 : (∑ i ∈ range 5, ((1 : ℝ) / 169) ^ (i + 1) / (i + 1)) = 49089221297 / 8271509510940 := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero]; norm_num + +theorem brk169 : |(49089221297 / 8271509510940 : ℝ) + (Real.log 168 - Real.log 169)| ≤ 1 / 23160226630632 := by + have h := Real.abs_log_sub_add_sum_range_le (x := (1 : ℝ) / 169) (by rw [abs_of_pos (by norm_num)]; norm_num) 5 + rw [sum169, show (1 : ℝ) - 1 / 169 = (168 : ℝ) / 169 by norm_num, Real.log_div (by norm_num) (by norm_num), abs_of_pos (show (0 : ℝ) < 1 / 169 by norm_num)] at h + refine le_trans h ?_; norm_num +theorem sum289 : (∑ i ∈ range 5, ((1 : ℝ) / 289) ^ (i + 1) / (i + 1)) = 419271248297 / 120959634026940 := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero]; norm_num + +theorem brk289 : |(419271248297 / 120959634026940 : ℝ) + (Real.log 288 - Real.log 289)| ≤ 1 / 580606243329312 := by + have h := Real.abs_log_sub_add_sum_range_le (x := (1 : ℝ) / 289) (by rw [abs_of_pos (by norm_num)]; norm_num) 5 + rw [sum289, show (1 : ℝ) - 1 / 289 = (288 : ℝ) / 289 by norm_num, Real.log_div (by norm_num) (by norm_num), abs_of_pos (show (0 : ℝ) < 1 / 289 by norm_num)] at h + refine le_trans h ?_; norm_num +theorem sum361 : (∑ i ∈ range 5, ((1 : ℝ) / 361) ^ (i + 1) / (i + 1)) = 1020427770737 / 367863975468060 := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero]; norm_num + +theorem brk361 : |(1020427770737 / 367863975468060 : ℝ) + (Real.log 360 - Real.log 361)| ≤ 1 / 2207183852808360 := by + have h := Real.abs_log_sub_add_sum_range_le (x := (1 : ℝ) / 361) (by rw [abs_of_pos (by norm_num)]; norm_num) 5 + rw [sum361, show (1 : ℝ) - 1 / 361 = (360 : ℝ) / 361 by norm_num, Real.log_div (by norm_num) (by norm_num), abs_of_pos (show (0 : ℝ) < 1 / 361 by norm_num)] at h + refine le_trans h ?_; norm_num +theorem sum1681 : (∑ i ∈ range 4, ((1 : ℝ) / 1681) ^ (i + 1) / (i + 1)) = 57018212185 / 95819102749452 := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero]; norm_num + +theorem brk1681 : |(57018212185 / 95819102749452 : ℝ) + (Real.log 1680 - Real.log 1681)| ≤ 1 / 13414674384923280 := by + have h := Real.abs_log_sub_add_sum_range_le (x := (1 : ℝ) / 1681) (by rw [abs_of_pos (by norm_num)]; norm_num) 4 + rw [sum1681, show (1 : ℝ) - 1 / 1681 = (1680 : ℝ) / 1681 by norm_num, Real.log_div (by norm_num) (by norm_num), abs_of_pos (show (0 : ℝ) < 1 / 1681 by norm_num)] at h + refine le_trans h ?_; norm_num +theorem sum73 : (∑ i ∈ range 6, ((1 : ℝ) / 73) ^ (i + 1) / (i + 1)) = 41748034657 / 3026684525780 := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero]; norm_num + +theorem brk73 : |(41748034657 / 3026684525780 : ℝ) + (Real.log 72 - Real.log 73)| ≤ 1 / 10896064292808 := by + have h := Real.abs_log_sub_add_sum_range_le (x := (1 : ℝ) / 73) (by rw [abs_of_pos (by norm_num)]; norm_num) 6 + rw [sum73, show (1 : ℝ) - 1 / 73 = (72 : ℝ) / 73 by norm_num, Real.log_div (by norm_num) (by norm_num), abs_of_pos (show (0 : ℝ) < 1 / 73 by norm_num)] at h + refine le_trans h ?_; norm_num +theorem sum137 : (∑ i ∈ range 6, ((1 : ℝ) / 137) ^ (i + 1) / (i + 1)) = 2906323438499 / 396711375036540 := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero]; norm_num + +theorem brk137 : |(2906323438499 / 396711375036540 : ℝ) + (Real.log 136 - Real.log 137)| ≤ 1 / 899212450082824 := by + have h := Real.abs_log_sub_add_sum_range_le (x := (1 : ℝ) / 137) (by rw [abs_of_pos (by norm_num)]; norm_num) 6 + rw [sum137, show (1 : ℝ) - 1 / 137 = (136 : ℝ) / 137 by norm_num, Real.log_div (by norm_num) (by norm_num), abs_of_pos (show (0 : ℝ) < 1 / 137 by norm_num)] at h + refine le_trans h ?_; norm_num + +theorem D0c_eq : CallerCost.Dinv (CallerCost.caller 6 7) = (-418432:ℝ) * Real.log 2 + (14400:ℝ) * Real.log 3 + (31200:ℝ) * Real.log 5 + (17472:ℝ) * Real.log 7 + (13728:ℝ) * Real.log 11 + (27040:ℝ) * Real.log 13 + (7072:ℝ) * Real.log 17 + (23712:ℝ) * Real.log 19 + (17056:ℝ) * Real.log 41 + (15184:ℝ) * Real.log 73 + (28496:ℝ) * Real.log 137 := by + rw [CallerCost.reproduction.2.2.2] + simp only [CallerCost.Dh, CallerCost.dataT, CallerCost.dataP, CallerCost.fL, List.map_cons, List.map_nil, + List.sum_cons, List.sum_nil] + push_cast + simp only [Real.log_one, lg8, lg9, lg16, lg24, lg25, lg32, lg33, lg40, lg48, lg49, lg56, lg57, lg64, lg65, lg72, lg120, lg121, lg136, lg168, lg169, lg288, lg289, lg360, lg361, lg1680, lg1681] + ring + +theorem key : (270812.8 : ℝ) ≤ CallerCost.Dinv (CallerCost.caller 6 7) ∧ + (155730.9 : ℝ) ≤ CallerCost.Dinv (CallerCost.caller 6 7) - + 17 * (400 * WholeFloorPrice.f 8 + 12 * WholeFloorPrice.f 9 - 88 * (2 * Real.log 2)) := by + rw [D0c_eq, WholeFloorPrice.f8, WholeFloorPrice.f9] + have h2a := Real.log_two_gt_d9 + have h2b := Real.log_two_lt_d9 + have b3 := brk9 + simp only [lg8, lg9] at b3 + rw [abs_le] at b3 + have b5 := brk25 + simp only [lg24, lg25] at b5 + rw [abs_le] at b5 + have b7 := brk49 + simp only [lg48, lg49] at b7 + rw [abs_le] at b7 + have b11 := brk121 + simp only [lg120, lg121] at b11 + rw [abs_le] at b11 + have b13 := brk169 + simp only [lg168, lg169] at b13 + rw [abs_le] at b13 + have b17 := brk289 + simp only [lg288, lg289] at b17 + rw [abs_le] at b17 + have b19 := brk361 + simp only [lg360, lg361] at b19 + rw [abs_le] at b19 + have b41 := brk1681 + simp only [lg1680, lg1681] at b41 + rw [abs_le] at b41 + have b73 := brk73 + simp only [lg72] at b73 + rw [abs_le] at b73 + have b137 := brk137 + simp only [lg136] at b137 + rw [abs_le] at b137 + constructor <;> linarith [b3.1, b3.2, b5.1, b5.2, b7.1, b7.2, b11.1, b11.2, b13.1, b13.2, b17.1, b17.2, b19.1, b19.2, b41.1, b41.2, b73.1, b73.2, b137.1, b137.2] + +theorem d0c_ge : (270812.8 : ℝ) ≤ CallerCost.Dinv (CallerCost.caller 6 7) := key.1 + +theorem floor_ge : (155730.9 : ℝ) ≤ CallerCost.Dinv (CallerCost.caller 6 7) - + 17 * (400 * WholeFloorPrice.f 8 + 12 * WholeFloorPrice.f 9 - 88 * (2 * Real.log 2)) := key.2 + +end WholeFloorLogs diff --git a/research/p104-lean-premises/lean/Nov15/WholeFloorModel.lean b/research/p104-lean-premises/lean/Nov15/WholeFloorModel.lean new file mode 100644 index 0000000000..19af36be57 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/WholeFloorModel.lean @@ -0,0 +1,406 @@ +/- +WholeFloorModel : WHOLEFLOOR R3 §1-2 in Lean. +The time-ordered model M, CS (chart span), and the SLACK-RANK lemma. See WholeFloor.md. + +Model (R3 §1, R2 §1): registers `Reg` with rows in `W = Reg → K` (initial-row coordinates), charts `C` +(partial order = proper inclusion of spans). Public registers are born with the unit row e_r; owned +registers are INITed with row 0 (R5 "owned INIT rows are 0"). Public MOVEs strictly ascend, owned +MOVEs go anywhere; an owned register may be CLEARed, a public one never is. Gates (ADD / SCALE / COPY +are all special cases) set a register's row to a linear combination of rows of registers at the SAME +chart. Ghost data record the generators of I_C: B C = public registers born at C, A C = public +entrants (with eRow = row at entry), O C = rows of owned MOVEs into C. +-/ +import Mathlib.LinearAlgebra.Span.Basic +import Mathlib.LinearAlgebra.Dimension.Finrank +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +import Mathlib.LinearAlgebra.LinearIndependent.Lemmas +import Mathlib.LinearAlgebra.Pi +import Mathlib.Algebra.BigOperators.Fin + +set_option linter.unusedSectionVars false + +namespace WholeFloor + +open Module Finset + +inductive Loc (C : Type*) + | unborn + | sit (c : C) + | cleared + +variable {K Reg C : Type*} + +/-- the ghosted run state. -/ +structure St (K Reg C : Type*) where + loc : Reg → Loc C + row : Reg → Reg → K + B : C → Finset Reg + A : C → Finset Reg + eRow : Reg → C → Reg → K + O : C → List (Reg → K) + +section Model +variable [Field K] [Fintype Reg] [DecidableEq Reg] [DecidableEq C] [PartialOrder C] + (pub : Reg → Prop) + +open Classical in +/-- the initial state: nothing born. -/ +def init : St K Reg C := ⟨fun _ => .unborn, fun _ => 0, fun _ => ∅, fun _ => ∅, fun _ _ => 0, fun _ => []⟩ + +open Classical in +/-- one event of the model. -/ +inductive Step : St K Reg C → St K Reg C → Prop + | birthPub (s : St K Reg C) (r : Reg) (c : C) : s.loc r = .unborn → pub r → + Step s { s with loc := Function.update s.loc r (.sit c), + row := Function.update s.row r (Pi.single r 1), + B := Function.update s.B c (insert r (s.B c)) } + | birthOwn (s : St K Reg C) (r : Reg) (c : C) : s.loc r = .unborn → ¬ pub r → + Step s { s with loc := Function.update s.loc r (.sit c), + row := Function.update s.row r 0 } + | gate (s : St K Reg C) (r : Reg) (c : C) (coef : Reg → K) : s.loc r = .sit c → + Step s { s with row := Function.update s.row r (∑ t ∈ univ.filter (fun t => s.loc t = .sit c), coef t • s.row t) } + | movePub (s : St K Reg C) (r : Reg) (c d : C) : s.loc r = .sit c → pub r → c < d → + Step s { s with loc := Function.update s.loc r (.sit d), + A := Function.update s.A d (insert r (s.A d)), + eRow := fun r' c' => if r' = r ∧ c' = d then s.row r else s.eRow r' c' } + | moveOwn (s : St K Reg C) (r : Reg) (c d : C) : s.loc r = .sit c → ¬ pub r → + Step s { s with loc := Function.update s.loc r (.sit d), + O := Function.update s.O d (s.row r :: s.O d) } + | clearOwn (s : St K Reg C) (r : Reg) (c : C) : s.loc r = .sit c → ¬ pub r → + Step s { s with loc := Function.update s.loc r .cleared, + row := Function.update s.row r 0 } + +/-- reachable states. -/ +def Reach (s : St K Reg C) : Prop := Relation.ReflTransGen (Step pub) init s + +/-- generators of I_C: unit rows of public births at C, rows of public entrants at their entry, +rows of owned MOVEs into C. -/ +def gens (s : St K Reg C) (c : C) : Set (Reg → K) := + (fun r => (Pi.single r (1 : K) : Reg → K)) '' ↑(s.B c) ∪ (fun r => s.eRow r c) '' ↑(s.A c) + ∪ {v | v ∈ s.O c} + +/-- I_C of R3 §1. -/ +def I (s : St K Reg C) (c : C) : Submodule K (Reg → K) := Submodule.span K (gens s c) + +/-- the invariants carried along every run. -/ +structure Inv (s : St K Reg C) : Prop where + cs : ∀ r c, s.loc r = .sit c → s.row r ∈ I s c + stay : ∀ r c, pub r → s.loc r = .sit c → r ∈ s.B c ∨ r ∈ s.A c + disj : ∀ c, Disjoint (s.B c) (s.A c) + asc : ∀ r c, (r ∈ s.B c ∨ r ∈ s.A c) → ∃ d, c ≤ d ∧ s.loc r = .sit d + pubBA : ∀ r c, (r ∈ s.B c ∨ r ∈ s.A c) → pub r + +omit [Fintype Reg] in +theorem inv_init : Inv pub (init : St K Reg C) where + cs := by intro r c h; simp [init] at h + stay := by intro r c _ h; simp [init] at h + disj := by intro c; simp [init] + asc := by intro r c h; simp [init] at h + pubBA := by intro r c h; simp [init] at h + +theorem I_mono {s s' : St K Reg C} (h : ∀ c, gens s c ⊆ gens s' c) (c : C) : I s c ≤ I s' c := + Submodule.span_mono (h c) + +theorem step_inv {s s' : St K Reg C} (hs : Inv pub s) (h : Step pub s s') : Inv pub s' := by + cases h with + | birthPub r c hu hp => + have hsub : ∀ c', gens s c' ⊆ gens + ({ s with loc := Function.update s.loc r (.sit c), + row := Function.update s.row r (Pi.single r 1), + B := Function.update s.B c (insert r (s.B c)) } : St K Reg C) c' := by + intro c' x hx + simp only [gens, Set.mem_union, Set.mem_image, Finset.mem_coe, Set.mem_setOf_eq] at hx ⊢ + rcases hx with (⟨y, hy, rfl⟩ | ⟨y, hy, rfl⟩) | hx + · left; left; refine ⟨y, ?_, rfl⟩ + by_cases hc : c' = c + · subst hc; simp [hy] + · simp [hc, hy] + · left; right; exact ⟨y, hy, rfl⟩ + · right; exact hx + have hnb : ∀ c', r ∉ s.B c' ∧ r ∉ s.A c' := by + intro c'; constructor <;> intro hm + · obtain ⟨d, _, hd⟩ := hs.asc r c' (Or.inl hm); rw [hu] at hd; cases hd + · obtain ⟨d, _, hd⟩ := hs.asc r c' (Or.inr hm); rw [hu] at hd; cases hd + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · intro r' c' hl + by_cases hr : r' = r + · subst hr + simp only [Function.update_self, Loc.sit.injEq] at hl + subst hl + simp only [Function.update_self] + exact Submodule.subset_span (Or.inl (Or.inl ⟨r', by simp, by simp⟩)) + · simp only [Function.update_of_ne hr] at hl ⊢ + exact I_mono hsub c' (hs.cs r' c' hl) + · intro r' c' hp' hl + by_cases hr : r' = r + · subst hr + simp only [Function.update_self, Loc.sit.injEq] at hl + subst hl; left; simp + · simp only [Function.update_of_ne hr] at hl + rcases hs.stay r' c' hp' hl with h | h + · left; by_cases hc : c' = c + · subst hc; simp [h] + · simp [Function.update_of_ne hc, h] + · right; exact h + · intro c' + by_cases hc : c' = c + · subst hc + simp only [Function.update_self] + rw [Finset.disjoint_insert_left] + exact ⟨(hnb c').2, hs.disj c'⟩ + · simpa [Function.update_of_ne hc] using hs.disj c' + · intro r' c' h + by_cases hr : r' = r + · subst hr + by_cases hc : c' = c + · subst hc; exact ⟨c', le_rfl, by simp⟩ + · simp only [Function.update_of_ne hc] at h + rcases h with h | h + · exact ((hnb c').1 h).elim + · exact ((hnb c').2 h).elim + · have h' : r' ∈ s.B c' ∨ r' ∈ s.A c' := by + by_cases hc : c' = c + · subst hc; simpa [hr] using h + · simpa [Function.update_of_ne hc] using h + obtain ⟨d, hd, hl⟩ := hs.asc r' c' h' + exact ⟨d, hd, by simpa [Function.update_of_ne hr] using hl⟩ + · intro r' c' h + by_cases hr : r' = r + · subst hr; exact hp + · have h' : r' ∈ s.B c' ∨ r' ∈ s.A c' := by + by_cases hc : c' = c + · subst hc; simpa [hr] using h + · simpa [Function.update_of_ne hc] using h + exact hs.pubBA r' c' h' + | birthOwn r c hu hp => + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · intro r' c' hl + by_cases hr : r' = r + · subst hr; simp only [Function.update_self]; exact Submodule.zero_mem _ + · simp only [Function.update_of_ne hr] at hl ⊢ + exact hs.cs r' c' hl + · intro r' c' hp' hl + by_cases hr : r' = r + · subst hr; exact (hp hp').elim + · simp only [Function.update_of_ne hr] at hl + exact hs.stay r' c' hp' hl + · exact hs.disj + · intro r' c' h + obtain ⟨d, hd, hl⟩ := hs.asc r' c' h + have hr : r' ≠ r := by rintro rfl; rw [hu] at hl; cases hl + exact ⟨d, hd, by simpa [Function.update_of_ne hr] using hl⟩ + · exact hs.pubBA + | gate r c coef hl => + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · intro r' c' hl' + by_cases hr : r' = r + · subst hr + have hc : c' = c := by + have := hl'.symm.trans hl; simpa using this + subst hc + simp only [Function.update_self] + refine Submodule.sum_mem _ fun t ht => Submodule.smul_mem _ _ ?_ + exact hs.cs t c' (by simpa using ht) + · simp only [Function.update_of_ne hr] at hl' ⊢ + exact hs.cs r' c' hl' + · exact hs.stay + · exact hs.disj + · exact hs.asc + · exact hs.pubBA + | movePub r c d hl hp hlt => + have hnB : r ∉ s.B d := by + intro hm + obtain ⟨d', hd, hl'⟩ := hs.asc r d (Or.inl hm) + rw [hl] at hl'; cases hl'; exact absurd hlt (not_lt_of_ge hd) + have hnA : r ∉ s.A d := by + intro hm + obtain ⟨d', hd, hl'⟩ := hs.asc r d (Or.inr hm) + rw [hl] at hl'; cases hl'; exact absurd hlt (not_lt_of_ge hd) + have hsub : ∀ c', gens s c' ⊆ gens + ({ s with loc := Function.update s.loc r (.sit d), + A := Function.update s.A d (insert r (s.A d)), + eRow := fun r' c' => if r' = r ∧ c' = d then s.row r else s.eRow r' c' } : St K Reg C) c' := by + intro c' x hx + simp only [gens, Set.mem_union, Set.mem_image, Finset.mem_coe, Set.mem_setOf_eq] at hx ⊢ + rcases hx with (⟨y, hy, rfl⟩ | ⟨y, hy, rfl⟩) | hx + · left; left; exact ⟨y, hy, rfl⟩ + · left; right + refine ⟨y, ?_, ?_⟩ + · by_cases hc : c' = d + · subst hc; simp [hy] + · simp [hc, hy] + · have : ¬ (y = r ∧ c' = d) := by + rintro ⟨rfl, rfl⟩; exact hnA hy + simp [this] + · right; exact hx + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · intro r' c' hl' + by_cases hr : r' = r + · subst hr + simp only [Function.update_self, Loc.sit.injEq] at hl' + subst hl' + refine Submodule.subset_span (Or.inl (Or.inr ⟨r', by simp, by simp⟩)) + · simp only [Function.update_of_ne hr] at hl' ⊢ + exact I_mono hsub c' (hs.cs r' c' hl') + · intro r' c' hp' hl' + by_cases hr : r' = r + · subst hr + simp only [Function.update_self, Loc.sit.injEq] at hl' + subst hl'; right; simp + · simp only [Function.update_of_ne hr] at hl' + rcases hs.stay r' c' hp' hl' with h | h + · left; exact h + · right; by_cases hc : c' = d + · subst hc; simp [h] + · simp [Function.update_of_ne hc, h] + · intro c' + by_cases hc : c' = d + · subst hc + simp only [Function.update_self] + rw [Finset.disjoint_insert_right] + exact ⟨hnB, hs.disj c'⟩ + · simpa [Function.update_of_ne hc] using hs.disj c' + · intro r' c' h + by_cases hr : r' = r + · subst hr + refine ⟨d, ?_, by simp⟩ + by_cases hc : c' = d + · subst hc; exact le_rfl + · have h' : r' ∈ s.B c' ∨ r' ∈ s.A c' := by simpa [Function.update_of_ne hc] using h + obtain ⟨d', hd', hl'⟩ := hs.asc r' c' h' + rw [hl] at hl'; cases hl'; exact le_of_lt (lt_of_le_of_lt hd' hlt) + · have h' : r' ∈ s.B c' ∨ r' ∈ s.A c' := by + by_cases hc : c' = d + · subst hc; simpa [hr] using h + · simpa [Function.update_of_ne hc] using h + obtain ⟨d', hd', hl'⟩ := hs.asc r' c' h' + exact ⟨d', hd', by simpa [Function.update_of_ne hr] using hl'⟩ + · intro r' c' h + by_cases hr : r' = r + · subst hr; exact hp + · have h' : r' ∈ s.B c' ∨ r' ∈ s.A c' := by + by_cases hc : c' = d + · subst hc; simpa [hr] using h + · simpa [Function.update_of_ne hc] using h + exact hs.pubBA r' c' h' + | moveOwn r c d hl hp => + have hsub : ∀ c', gens s c' ⊆ gens + ({ s with loc := Function.update s.loc r (.sit d), + O := Function.update s.O d (s.row r :: s.O d) } : St K Reg C) c' := by + intro c' x hx + simp only [gens, Set.mem_union, Set.mem_image, Finset.mem_coe, Set.mem_setOf_eq] at hx ⊢ + rcases hx with (⟨y, hy, rfl⟩ | ⟨y, hy, rfl⟩) | hx + · left; left; exact ⟨y, hy, rfl⟩ + · left; right; exact ⟨y, hy, rfl⟩ + · right + by_cases hc : c' = d + · subst hc; simp [hx] + · simp [hc, hx] + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · intro r' c' hl' + by_cases hr : r' = r + · subst hr + simp only [Function.update_self, Loc.sit.injEq] at hl' + subst hl' + exact Submodule.subset_span (Or.inr (by simp)) + · simp only [Function.update_of_ne hr] at hl' ⊢ + exact I_mono hsub c' (hs.cs r' c' hl') + · intro r' c' hp' hl' + by_cases hr : r' = r + · subst hr; exact (hp hp').elim + · simp only [Function.update_of_ne hr] at hl' + exact hs.stay r' c' hp' hl' + · exact hs.disj + · intro r' c' h + have hr : r' ≠ r := by rintro rfl; exact hp (hs.pubBA r' c' h) + obtain ⟨d', hd', hl'⟩ := hs.asc r' c' h + exact ⟨d', hd', by simpa [Function.update_of_ne hr] using hl'⟩ + · exact hs.pubBA + | clearOwn r c hl hp => + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · intro r' c' hl' + by_cases hr : r' = r + · subst hr; simp at hl' + · simp only [Function.update_of_ne hr] at hl' ⊢ + exact hs.cs r' c' hl' + · intro r' c' hp' hl' + by_cases hr : r' = r + · subst hr; exact (hp hp').elim + · simp only [Function.update_of_ne hr] at hl' + exact hs.stay r' c' hp' hl' + · exact hs.disj + · intro r' c' h + have hr : r' ≠ r := by rintro rfl; exact hp (hs.pubBA r' c' h) + obtain ⟨d', hd', hl'⟩ := hs.asc r' c' h + exact ⟨d', hd', by simpa [Function.update_of_ne hr] using hl'⟩ + · exact hs.pubBA + +theorem reach_inv {s : St K Reg C} (h : Reach pub s) : Inv pub s := by + induction h with + | refl => exact inv_init pub + | tail _ hst ih => exact step_inv pub ih hst + +/-- generators only grow along a run (the overwritten `eRow r d` is a fresh entry, by `asc`). -/ +theorem step_gens_mono {s s' : St K Reg C} (hs : Inv pub s) (h : Step pub s s') : + ∀ c, gens s c ⊆ gens s' c := by + intro c' x hx + simp only [gens, Set.mem_union, Set.mem_image, Finset.mem_coe, Set.mem_ofPred_eq] at hx ⊢ + cases h with + | birthPub r c hu hp => + rcases hx with (⟨y, hy, rfl⟩ | ⟨y, hy, rfl⟩) | hx + · left; left; refine ⟨y, ?_, rfl⟩ + by_cases hc : c' = c + · subst hc; simp [hy] + · simp [hc, hy] + · left; right; exact ⟨y, hy, rfl⟩ + · right; exact hx + | birthOwn r c hu hp => exact hx + | gate r c coef hl => exact hx + | movePub r c d hl hp hlt => + have hnA : r ∉ s.A d := by + intro hm + obtain ⟨d', hd, hl'⟩ := hs.asc r d (Or.inr hm) + rw [hl] at hl'; cases hl'; exact absurd hlt (not_lt_of_ge hd) + rcases hx with (⟨y, hy, rfl⟩ | ⟨y, hy, rfl⟩) | hx + · left; left; exact ⟨y, hy, rfl⟩ + · left; right + refine ⟨y, ?_, ?_⟩ + · by_cases hc : c' = d + · subst hc; simp [hy] + · simp [hc, hy] + · have : ¬ (y = r ∧ c' = d) := by + rintro ⟨rfl, rfl⟩; exact hnA hy + simp [this] + · right; exact hx + | moveOwn r c d hl hp => + rcases hx with (⟨y, hy, rfl⟩ | ⟨y, hy, rfl⟩) | hx + · left; left; exact ⟨y, hy, rfl⟩ + · left; right; exact ⟨y, hy, rfl⟩ + · right + by_cases hc : c' = d + · subst hc; simp [hx] + · simp [hc, hx] + | clearOwn r c hl hp => exact hx + +/-- along any run from an invariant state, invariants persist and every I_C grows. -/ +theorem run_inv_mono {s sF : St K Reg C} (hs : Inv pub s) + (h : Relation.ReflTransGen (Step pub) s sF) : Inv pub sF ∧ ∀ c, I s c ≤ I sF c := by + induction h with + | refl => exact ⟨hs, fun _ => le_rfl⟩ + | tail hab hbc ih => + exact ⟨step_inv pub ih.1 hbc, fun c => (ih.2 c).trans (I_mono (step_gens_mono pub ih.1 hbc) c)⟩ + +/-- **CS (chart span), timed form**: a row that sits at chart c at ANY moment of a run (in particular +every row leaving c, and every final row of a register ending at c) lies in I_c of the end state. -/ +theorem cs_final {s sF : St K Reg C} (hr : Reach pub s) + (h : Relation.ReflTransGen (Step pub) s sF) {r : Reg} {c : C} (hl : s.loc r = .sit c) : + s.row r ∈ I sF c := + ((run_inv_mono pub (reach_inv pub hr) h).2 c) ((reach_inv pub hr).cs r c hl) + +end Model + +end WholeFloor + +#print axioms WholeFloor.step_inv +#print axioms WholeFloor.reach_inv +#print axioms WholeFloor.cs_final diff --git a/research/p104-lean-premises/lean/Nov15/WholeFloorNest.lean b/research/p104-lean-premises/lean/Nov15/WholeFloorNest.lean new file mode 100644 index 0000000000..ce5ba722b9 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/WholeFloorNest.lean @@ -0,0 +1,192 @@ +/- +WholeFloorNest : the NESTING rule of the verifier added to the WHOLEFLOOR model, and +the unconditional-in-lat versions of R3's floor. +LAT.md (internal notes) settled from primary sources that lateral MOVEs are ILLEGAL: + local.py:66 need(frames[b] < frames[a] if private else frames[a] < frames[b], 'Nested chronological transport') + (frames are frozensets, `<` is PROPER subset), owned-ascent relaxation = `or frames[a] < frames[b]` + (pr6902-OWNED-ASCENT.md), SPEC 03-motifs.tex "On every edge one label will contain the other", + local.py:67 paid[abs(len(frames[b]) - len(frames[a]))] += 1. +Here: `Geo` = chart dims + proper nesting; `StepL`/`RunL` = WholeFloorModel.Step with the guard (public MOVE: c < d AND +c nested in d; owned MOVE: nested either way) and a log of the owned MOVE chart pairs; `nest_lat_zero`; then +`d0_whole_floor_nested` and `kappa_whole_floor_nested`. +-/ +import Nov15.WholeFloorModel +import Nov15.WholeFloorEnd +import Nov15.WholeFloorCover + +set_option linter.unusedSectionVars false + +namespace WholeFloorNest +open WholeFloor Finset + +/-- chart geometry: dimension and PROPER nesting (`sub a b` = frames[a] < frames[b], a proper subset). -/ +structure Geo (C : Type*) where + dim : C → ℕ + sub : C → C → Prop + sub_dim : ∀ {a b}, sub a b → dim a < dim b + +variable {K Reg C : Type*} + +/-- paid rank of a MOVE a -> b (local.py:67, pricekit rk): |dim b - dim a|. -/ +def rank (G : Geo C) (a b : C) : ℕ := Int.natAbs ((G.dim b : ℤ) - G.dim a) + +/-- the verifier's nesting rule for an OWNED MOVE (A6 relaxation: either direction, never sideways). -/ +def NestOwn (G : Geo C) (a b : C) : Prop := G.sub a b ∨ G.sub b a + +/-- number of lateral (rank 0) MOVEs in a log. -/ +def latCount (G : Geo C) (ms : List (C × C)) : ℕ := (ms.filter fun m => rank G m.1 m.2 = 0).length + +/-- a legal MOVE changes the dimension, so its paid rank is >= 1. -/ +theorem nest_rank_pos (G : Geo C) {a b : C} (h : NestOwn G a b) : 1 ≤ rank G a b := by + unfold rank + rcases h with h | h <;> have := G.sub_dim h <;> omega + +/-- **nest_lat_zero**: under the nesting rule there is no lateral MOVE: lat = 0. -/ +theorem nest_lat_zero (G : Geo C) (ms : List (C × C)) (h : ∀ m ∈ ms, NestOwn G m.1 m.2) : + latCount G ms = 0 := by + unfold latCount + rw [List.length_eq_zero_iff, List.filter_eq_nil_iff] + intro m hm + have := nest_rank_pos G (h m hm) + simp; omega + +section Model +variable [Field K] [Fintype Reg] [DecidableEq Reg] [DecidableEq C] [PartialOrder C] (pub : Reg → Prop) + +open Classical in +/-- WholeFloorModel.Step with the NESTING guard; the label is the chart pair of an owned MOVE. -/ +inductive StepL (G : Geo C) : St K Reg C → Option (C × C) → St K Reg C → Prop + | birthPub (s : St K Reg C) (r : Reg) (c : C) : s.loc r = .unborn → pub r → + StepL G s Option.none + { s with loc := Function.update s.loc r (.sit c), + row := Function.update s.row r (Pi.single r 1), + B := Function.update s.B c (insert r (s.B c)) } + | birthOwn (s : St K Reg C) (r : Reg) (c : C) : s.loc r = .unborn → ¬ pub r → + StepL G s Option.none + { s with loc := Function.update s.loc r (.sit c), + row := Function.update s.row r 0 } + | gate (s : St K Reg C) (r : Reg) (c : C) (coef : Reg → K) : s.loc r = .sit c → + StepL G s Option.none + { s with row := Function.update s.row r (∑ t ∈ Finset.univ.filter (fun t => s.loc t = .sit c), coef t • s.row t) } + | movePub (s : St K Reg C) (r : Reg) (c d : C) : s.loc r = .sit c → pub r → c < d → G.sub c d → + StepL G s Option.none + { s with loc := Function.update s.loc r (.sit d), + A := Function.update s.A d (insert r (s.A d)), + eRow := fun r' c' => if r' = r ∧ c' = d then s.row r else s.eRow r' c' } + | moveOwn (s : St K Reg C) (r : Reg) (c d : C) : s.loc r = .sit c → ¬ pub r → NestOwn G c d → + StepL G s (Option.some (c, d)) + { s with loc := Function.update s.loc r (.sit d), + O := Function.update s.O d (s.row r :: s.O d) } + | clearOwn (s : St K Reg C) (r : Reg) (c : C) : s.loc r = .sit c → ¬ pub r → + StepL G s Option.none + { s with loc := Function.update s.loc r .cleared, + row := Function.update s.row r 0 } + +/-- every nested step is a model step. -/ +theorem StepL.toStep {G : Geo C} {s s' : St K Reg C} {o : Option (C × C)} (h : StepL pub G s o s') : + Step pub s s' := by + cases h with + | birthPub r c h1 h2 => exact Step.birthPub s r c h1 h2 + | birthOwn r c h1 h2 => exact Step.birthOwn s r c h1 h2 + | gate r c coef h1 => exact Step.gate s r c coef h1 + | movePub r c d h1 h2 h3 _ => exact Step.movePub s r c d h1 h2 h3 + | moveOwn r c d h1 h2 _ => exact Step.moveOwn s r c d h1 h2 + | clearOwn r c h1 h2 => exact Step.clearOwn s r c h1 h2 + +/-- a run with the log of its owned MOVE chart pairs. -/ +inductive RunL (G : Geo C) : St K Reg C → List (C × C) → St K Reg C → Prop + | refl (s : St K Reg C) : RunL G s [] s + | none {s s' s'' : St K Reg C} {l : List (C × C)} : StepL pub G s none s' → RunL G s' l s'' → RunL G s l s'' + | some {s s' s'' : St K Reg C} {l : List (C × C)} (m : C × C) : + StepL pub G s (some m) s' → RunL G s' l s'' → RunL G s (m :: l) s'' + +theorem RunL.toRun {G : Geo C} {s s' : St K Reg C} {l : List (C × C)} (h : RunL pub G s l s') : + Relation.ReflTransGen (Step pub) s s' := by + induction h with + | refl => exact Relation.ReflTransGen.refl + | none h _ ih => exact Relation.ReflTransGen.head h.toStep ih + | some m h _ ih => exact Relation.ReflTransGen.head h.toStep ih + +/-- every owned MOVE in the log of a nested run is nested. -/ +theorem RunL.nested {G : Geo C} {s s' : St K Reg C} {l : List (C × C)} (h : RunL pub G s l s') : + ∀ m ∈ l, NestOwn G m.1 m.2 := by + induction h with + | refl => simp + | none _ _ ih => exact ih + | some m h _ ih => + intro x hx + rcases List.mem_cons.mp hx with rfl | hx + · cases h with | moveOwn r c d _ _ hn => exact hn + · exact ih x hx + +/-- a nested run from `init` is reachable, so `reach_inv`, `cs_final` etc. apply, and its lateral count is 0. -/ +theorem runL_reach_lat {G : Geo C} {s : St K Reg C} {l : List (C × C)} (h : RunL pub G init l s) : + Reach pub s ∧ latCount G l = 0 := + ⟨h.toRun, nest_lat_zero G l (h.nested pub)⟩ + +end Model + +/-! ### the floors, unconditional in lat -/ + +open WholeFloorPrice WholeFloorEnd CallerCost JointCeiling + +/-- the pricing summary `w` is that of a nested run: its lateral count is the number of rank-0 owned MOVEs of +the log, and all owned MOVEs of the log are nested (the verifier rule). -/ +structure NestedWord {C : Type*} (G : Geo C) (w : Word) (log : List (C × C)) : Prop where + lat_def : w.lat = latCount G log + nested : ∀ m ∈ log, NestOwn G m.1 m.2 + +theorem NestedWord.lat_zero {C : Type*} {G : Geo C} {w : Word} {log : List (C × C)} + (h : NestedWord G w log) : w.lat = 0 := by + rw [h.lat_def]; exact nest_lat_zero G log h.nested + +/-- **R3's all-words D0 floor, nested words**: every priced word obeying the nesting rule has the 17-call invoice +D0 >= 155,730.9 (R3: 155,730.99). No lat hypothesis: lat = 0 is a consequence. -/ +theorem d0_whole_floor_nested {C : Type*} (G : Geo C) (w : Word) (hP : Priced w) (log : List (C × C)) + (hw : NestedWord G w log) (n : Inv) (hn : Dinv n = w.hD0 + w.mD0 + w.oD0) : + (155730.9 : ℝ) ≤ Dinv (invoice (caller 6 7) n 17) := + d0_whole_floor w hP hw.lat_zero n hn + +/-- the native floor `F <= -Nfl` (JointCeiling's hN), DERIVED for nested words. -/ +theorem hN_nested {C : Type*} (G : Geo C) (w : Word) (hP : Priced w) (log : List (C × C)) + (hw : NestedWord G w log) (n : Inv) + (hF : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - (2 - (2 : ℝ) ^ s) * ((w.sH + w.sM : ℕ) : ℝ) + - (w.ow.length : ℕ)) : + ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s n ≤ -Nfl s := by + intro s h0 h1 + have h := F_floor s h0 h1 (w.sH + w.sM) w.ow.length w.lat (Finv s n) (hF s h0 h1) hP.h_m16 + (by have := hP.h_Y; omega) + rwa [hw.lat_zero, NflL_zero] at h + +/-- **kappa <= .0204110965 for nested words, NO numeric hypothesis** (R3 §3). The interval cover (F < 0 on [t0, 1] for the +floor-native invoice of the #7113 caller C(8|9), 17 calls) is `WholeFloorCover.cover`, kernel-checked with NumCertK +. t0 = .0204110965 is R3's .0204110964 rounded UP in the 10th digit: the exact root is +.02041109645 (F at s = .9795889036 is +6.7e-6), so the 10-digit .0204110964 itself is 5e-11 below the root. +Remaining hypotheses: `Priced w` (includes h_Y and the named upstream pricing facts) and the F-currency pricing `hF`. -/ +theorem kappa_whole_floor_nested {C : Type*} (G : Geo C) (w : Word) (hP : Priced w) (log : List (C × C)) + (hw : NestedWord G w log) (n : Inv) + (hF : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s n ≤ -400 * (8 : ℝ) ^ s - (2 - (2 : ℝ) ^ s) * ((w.sH + w.sM : ℕ) : ℝ) + - (w.ow.length : ℕ)) : + ∀ t : ℝ, (204110965 : ℝ) / 10 ^ 10 ≤ t → t ≤ 1 → Finv (1 - t) (invoice (caller 6 7) n 17) < 0 := by + intro t ht ht1 + have hN := hN_nested G w hP log hw n hF + have hs0 : (0 : ℝ) ≤ 1 - t := by linarith + have hs1 : 1 - t ≤ 1 := by + have : (0 : ℝ) ≤ (204110965 : ℝ) / 10 ^ 10 := by norm_num + linarith + have h1 := hN _ hs0 hs1 + 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 ht ht1 + push_cast at h2 h3 + nlinarith + +end WholeFloorNest + +#print axioms WholeFloorNest.nest_lat_zero +#print axioms WholeFloorNest.StepL.toStep +#print axioms WholeFloorNest.runL_reach_lat +#print axioms WholeFloorNest.d0_whole_floor_nested +#print axioms WholeFloorNest.hN_nested +#print axioms WholeFloorNest.kappa_whole_floor_nested diff --git a/research/p104-lean-premises/lean/Nov15/WholeFloorPrice.lean b/research/p104-lean-premises/lean/Nov15/WholeFloorPrice.lean new file mode 100644 index 0000000000..1db44e5273 --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/WholeFloorPrice.lean @@ -0,0 +1,226 @@ +/- +WholeFloorPrice : the pricing step of WHOLEFLOOR R3 §3, in D0 and F currency, +with the owned-LATERAL correction. +Inputs (named hypotheses, each proved or quoted elsewhere): + h_Y : 104 <= (#helper stops) + (#main stops) + (#owned MOVEs) [slack-rank + port lemma, R3 Thm Y] + h_help : 2 ln 2 * sH <= helper D0 [FloorD0.helperD0_ge_fL] + h_main : -400 f(8) + 2 ln 2 * sM <= main D0 [R1 superadditivity + R3 stop price] + owned : D0 = -sum f(k_i), k_i in 1..9 paid; mass sum k_i <= 112 (S >= 1424); >= 16 paid moves (R1+R2). +R3 counts m = ALL owned MOVEs in h_Y but prices them with k_i >= 1 only: a LATERAL owned MOVE +(|dim b - dim a| = 0, pricekit rk = 0, cost f(0) = 0, mass 0) satisfies h_Y for free. `lat` below. +-/ +import Nov15.JointCeiling +import Nov15.JunkLB2 + +set_option linter.unusedSectionVars false + +namespace WholeFloorPrice +open JunkLB2 Real + +noncomputable abbrev f (x : ℝ) : ℝ := fL x + +lemma f1 : f 1 = 0 := by simp [f, fL] +lemma f8 : f 8 = 24 * Real.log 2 := by + have : Real.log 8 = 3 * Real.log 2 := by + rw [show (8 : ℝ) = 2 ^ 3 by norm_num, Real.log_pow]; norm_num + simp [f, fL, this]; ring +lemma f9 : f 9 = 18 * Real.log 3 := by + have : Real.log 9 = 2 * Real.log 3 := by + rw [show (9 : ℝ) = 3 ^ 2 by norm_num, Real.log_pow]; norm_num + simp [f, fL, this]; ring + +/-- chord bound: f(k) <= (f 9 / 8) (k - 1) on [1, 9]. -/ +lemma chord {k : ℝ} (h1 : 1 ≤ k) (h9 : k ≤ 9) : f k ≤ f 9 / 8 * (k - 1) := by + have cvx := fL_convex + have ha : (0 : ℝ) ≤ (9 - k) / 8 := by linarith + have hb : (0 : ℝ) ≤ (k - 1) / 8 := by linarith + have hab : (9 - k) / 8 + (k - 1) / 8 = (1 : ℝ) := by ring + have := cvx.2 (show (1 : ℝ) ∈ Set.Ici (0 : ℝ) by norm_num) (show (9 : ℝ) ∈ Set.Ici (0 : ℝ) by norm_num) + ha hb hab + have e : ((9 - k) / 8) • (1 : ℝ) + ((k - 1) / 8) • (9 : ℝ) = k := by simp only [smul_eq_mul]; ring + rw [e] at this + simp only [smul_eq_mul] at this + have h0 : fL 1 = 0 := f1 + show fL k ≤ fL 9 / 8 * (k - 1) + rw [h0] at this; linarith + +lemma two_ln2_le : 2 * Real.log 2 ≤ f 9 / 8 := by + have h : Real.log 256 ≤ Real.log 19683 := Real.log_le_log (by norm_num) (by norm_num) + have h1 : Real.log 256 = 8 * Real.log 2 := by + rw [show (256 : ℝ) = 2 ^ 8 by norm_num, Real.log_pow]; norm_num + have h2 : Real.log 19683 = 9 * Real.log 3 := by + rw [show (19683 : ℝ) = 3 ^ 9 by norm_num, Real.log_pow]; norm_num + rw [f9]; linarith + +/-- a word's pricing summary: stops, paid owned moves, lateral owned moves, D0 parts. -/ +structure Word where + sH : ℕ + sM : ℕ + ow : List ℕ + lat : ℕ + hD0 : ℝ + mD0 : ℝ + oD0 : ℝ + +/-- the named upstream facts. -/ +structure Priced (w : Word) : Prop where + h_help : 2 * Real.log 2 * w.sH ≤ w.hD0 + h_main : -400 * f 8 + 2 * Real.log 2 * w.sM ≤ w.mD0 + h_own : w.oD0 = -(w.ow.map fun k : ℕ => f k).sum + h_rng : ∀ k ∈ w.ow, 1 ≤ k ∧ k ≤ 9 + h_mass : w.ow.sum ≤ 112 + h_m16 : 16 ≤ w.ow.length + h_Y : 104 ≤ w.sH + w.sM + w.ow.length + w.lat + +lemma owned_le (w : Word) (h : Priced w) : + (w.ow.map fun k : ℕ => f k).sum ≤ f 9 / 8 * (112 - w.ow.length) := by + have key : ∀ l : List ℕ, (∀ k ∈ l, 1 ≤ k ∧ k ≤ 9) → + (l.map fun k : ℕ => f k).sum ≤ f 9 / 8 * ((l.sum : ℝ) - l.length) := by + intro l + induction l with + | nil => intro _; simp + | cons a l ih => + intro hl + have ha := hl a List.mem_cons_self + have := ih fun k hk => hl k (List.mem_cons_of_mem _ hk) + have hc := chord (k := (a : ℝ)) (by exact_mod_cast ha.1) (by exact_mod_cast ha.2) + simp only [List.map_cons, List.sum_cons, List.length_cons, Nat.cast_add, Nat.cast_one] + nlinarith + have := key w.ow h.h_rng + have hm : (w.ow.sum : ℝ) ≤ 112 := by exact_mod_cast h.h_mass + have hf9 : 0 ≤ f 9 / 8 := by rw [f9]; have := Real.log_pos (by norm_num : (1 : ℝ) < 3); positivity + nlinarith + +/-- **R3 pricing step with the lateral correction**: D0 of the native >= -400 f 8 - 12 f 9 + +2 ln 2 * max 0 (88 - lat). With `lat = 0` this is R3's -115.31 per word (+ mains). -/ +theorem d0_floor (w : Word) (h : Priced w) : + -400 * f 8 - 12 * f 9 + 2 * Real.log 2 * max 0 (88 - (w.lat : ℝ)) ≤ w.hD0 + w.mD0 + w.oD0 := by + have ho := owned_le w h + have hb := two_ln2_le + have hl2 : 0 < Real.log 2 := Real.log_pos (by norm_num) + have hm : (16 : ℝ) ≤ w.ow.length := by exact_mod_cast h.h_m16 + have hY : (104 : ℝ) ≤ w.sH + w.sM + w.ow.length + w.lat := by exact_mod_cast h.h_Y + have hH := h.h_help + have hM := h.h_main + have hown := h.h_own + set m : ℝ := (w.ow.length : ℝ) + set a := f 9 / 8 + set b := 2 * Real.log 2 + have hb0 : 0 ≤ b := by show 0 ≤ 2 * Real.log 2; linarith + have hsH : (0 : ℝ) ≤ w.sH := Nat.cast_nonneg _ + have hsM : (0 : ℝ) ≤ w.sM := Nat.cast_nonneg _ + have e96 : 12 * f 9 = 96 * a := by simp only [a]; ring + rw [e96] + have hbm : 0 ≤ (a - b) * (m - 16) := mul_nonneg (by linarith) (by linarith) + rcases le_or_gt 0 (104 - m - w.lat) with hc | hc + · have : max 0 (88 - (w.lat : ℝ)) = 88 - w.lat := max_eq_right (by linarith) + rw [this] + have hst : b * ((w.sH : ℝ) + w.sM) ≥ b * (104 - m - w.lat) := + mul_le_mul_of_nonneg_left (by linarith) (by linarith) + nlinarith + · have hmx : max 0 (88 - (w.lat : ℝ)) ≤ m - 16 := max_le (by linarith) (by linarith) + have h1 : b * max 0 (88 - (w.lat : ℝ)) ≤ b * (m - 16) := mul_le_mul_of_nonneg_left hmx hb0 + have : 0 ≤ b * ((w.sH : ℝ) + w.sM) := by positivity + nlinarith + +/-! ### the lateral counterexample to R3's reading -/ + +/-- 12 owned MOVEs of rank 9 and 4 of rank 1 (mass 112), no stops, and 88 LATERAL owned MOVEs. -/ +noncomputable def cex : Word where + sH := 0 + sM := 0 + ow := List.replicate 12 9 ++ List.replicate 4 1 + lat := 88 + hD0 := 0 + mD0 := -400 * f 8 + oD0 := -(12 * f 9) + +theorem cex_priced : Priced cex := by + refine ⟨?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · simp [cex] + · simp [cex] + · simp [cex, f1, List.sum_replicate]; ring + · intro k hk + simp only [cex, List.mem_append, List.mem_replicate] at hk + omega + · simp [cex] + · simp [cex] + · simp [cex] + +/-- R3's claimed per-word value (-115.31 = -12 f 9 + 88 * 2 ln 2) is NOT a floor for admissible +words once lateral owned MOVEs are allowed. -/ +theorem r3_stops_not_forced : + ¬ (-400 * f 8 - 12 * f 9 + 2 * Real.log 2 * 88 ≤ cex.hD0 + cex.mD0 + cex.oD0) := by + have hl2 : 0 < Real.log 2 := Real.log_pos (by norm_num) + simp only [cex] + intro h; linarith + +/-- and the corrected floor (lat = 88) is exactly the R2 value -400 f 8 - 12 f 9, attained. -/ +theorem cex_attains : cex.hD0 + cex.mD0 + cex.oD0 = -400 * f 8 - 12 * f 9 := by + simp [cex]; ring + +/-! ### F currency: the native floor Nfl of JointCeiling, derived, with the lateral correction -/ + +open JointCeiling CallerCost in +/-- corrected native floor: `lat` lateral owned MOVEs remove `lat` forced stops. `lat = 0` is JointCeiling.Nfl. -/ +noncomputable def NflL (lat : ℕ) (s : ℝ) : ℝ := + 400 * (8 : ℝ) ^ s + 16 + max 0 (88 - (lat : ℝ)) * (2 - (2 : ℝ) ^ s) + +open JointCeiling in +theorem NflL_zero (s : ℝ) : NflL 0 s = Nfl s := by + simp [NflL, Nfl] + +/-- **F-currency pricing**: for s in [0,1], if the native's F obeys +`F <= -400 8^s - (2 - 2^s)(stops) - (#paid owned)` (mains subadditivity, owned rank >= 1, stop price +2^s - 2 = F-charge of a convex-gap stop) and R1/R2 (>= 16 paid) and Thm Y, then F <= -NflL lat s. -/ +theorem F_floor (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (st mp lat : ℕ) (Fn : ℝ) + (hF : Fn ≤ -400 * (8 : ℝ) ^ s - (2 - (2 : ℝ) ^ s) * st - mp) + (hm : 16 ≤ mp) (hY : 104 ≤ st + mp + lat) : Fn ≤ -NflL lat s := 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 hm + have hY' : (104 : ℝ) ≤ st + mp + lat := by exact_mod_cast hY + have hst : (0 : ℝ) ≤ st := Nat.cast_nonneg _ + simp only [NflL] + rw [← hc] + rcases le_or_gt 0 (104 - (mp : ℝ) - lat) with h | h + · have hmx : max 0 (88 - (lat : ℝ)) = 88 - lat := max_eq_right (by linarith) + rw [hmx] + have h1 : c * (104 - mp - lat) ≤ c * st := mul_le_mul_of_nonneg_left (by linarith) hc0 + have h2 : (1 - c) * (mp - 16) ≥ 0 := mul_nonneg (by linarith) (by linarith) + nlinarith + · have hmx : max 0 (88 - (lat : ℝ)) ≤ mp - 16 := max_le (by linarith) (by linarith) + have hM0 : 0 ≤ max 0 (88 - (lat : ℝ)) := le_max_left _ _ + have h1 : c * max 0 (88 - (lat : ℝ)) ≤ 1 * max 0 (88 - (lat : ℝ)) := + mul_le_mul_of_nonneg_right hc1 hM0 + have : 0 ≤ c * st := mul_nonneg hc0 hst + nlinarith + +open JointCeiling CallerCost in +/-- the fixed #7113 caller C(8|9) at 17 calls: any native meeting the (lateral-free) floor has F < 0 +at t = .0205, i.e. the `control_neg` bracket of JointCeiling transfers to every priced native. -/ +theorem fixed_caller_point (n : Inv) (hN : ∀ s : ℝ, 0 ≤ s → s ≤ 1 → Finv s n ≤ -Nfl s) : + Finv (1 - (205 : ℝ) / 10000) (invoice (caller 6 7) n 17) < 0 := by + have hs0 : (0 : ℝ) ≤ 1 - 205 / 10000 := by norm_num + have hs1 : (1 : ℝ) - 205 / 10000 ≤ 1 := by norm_num + have h1 := hN _ hs0 hs1 + have h2 := invoice_F (1 - 205 / 10000) (caller 6 7) n 17 + have h3 := invoice_F (1 - 205 / 10000) (caller 6 7) natFloor 17 + have h4 := natFloor_F (1 - 205 / 10000) + have h5 := control_bracket.2 + have h6 : Finv (1 - (205 : ℝ) / 10000) I89 = Finv (1 - 205 / 10000) (invoice (caller 6 7) natFloor 17) := rfl + push_cast at h2 h3 + nlinarith + +end WholeFloorPrice + +#print axioms WholeFloorPrice.d0_floor +#print axioms WholeFloorPrice.cex_priced +#print axioms WholeFloorPrice.r3_stops_not_forced +#print axioms WholeFloorPrice.F_floor +#print axioms WholeFloorPrice.fixed_caller_point diff --git a/research/p104-lean-premises/lean/Nov15/WholeFloorSlack.lean b/research/p104-lean-premises/lean/Nov15/WholeFloorSlack.lean new file mode 100644 index 0000000000..cbce0b9abe --- /dev/null +++ b/research/p104-lean-premises/lean/Nov15/WholeFloorSlack.lean @@ -0,0 +1,228 @@ +/- +WholeFloorSlack : the SLACK-RANK lemma of WHOLEFLOOR R3 §2. +For a run reaching s and a chart c: + stay c = public registers ending at c (F_stay: their final rows) + BL c = public registers born at c that leave (E_BL: their unit rows) + passers = public entrants into c that end elsewhere (= enter, then leave: public never CLEARed) + o_c = owned MOVEs into c +Hypothesis `Indep c` (R3: "independent ... checked"): the final rows of stay c together with the unit +rows of BL c are linearly independent. Then + dim I_c ≤ |B| + |A| + o , |stay| + |BL| = |B| + |A| − s_c , + I_c = F_stay ⊕ E_BL ⊕ K_c with dim K_c ≤ s_c + o_c. +-/ +import Nov15.WholeFloorModel + +set_option linter.unusedSectionVars false + +namespace WholeFloor + +open Module Finset + +variable {K Reg C : Type*} [Field K] [Fintype Reg] [DecidableEq Reg] [DecidableEq C] [PartialOrder C] + (pub : Reg → Prop) + +open Classical in +/-- public registers ending at c. -/ +noncomputable def stayS (s : St K Reg C) (c : C) : Finset Reg := + univ.filter fun r => pub r ∧ s.loc r = .sit c + +open Classical in +/-- public registers born at c that end elsewhere ("C-born leavers"). -/ +noncomputable def blS (s : St K Reg C) (c : C) : Finset Reg := + (s.B c).filter fun r => s.loc r ≠ .sit c + +open Classical in +/-- passers: public entrants into c that do not end at c. -/ +noncomputable def passS (s : St K Reg C) (c : C) : Finset Reg := + (s.A c).filter fun r => s.loc r ≠ .sit c + +/-- slack σ_c = s_c + o_c. -/ +noncomputable def sigma (s : St K Reg C) (c : C) : ℕ := (passS s c).card + (s.O c).length + +open Classical in +/-- F_stay(c): span of the final rows of the registers ending at c. -/ +noncomputable def Fstay (s : St K Reg C) (c : C) : Submodule K (Reg → K) := + Submodule.span K ((fun r => s.row r) '' ↑(stayS pub s c)) + +/-- E_BL(c): span of the unit rows of c-born leavers. -/ +noncomputable def EBL (s : St K Reg C) (c : C) : Submodule K (Reg → K) := + Submodule.span K ((fun r => (Pi.single r (1 : K) : Reg → K)) '' ↑(blS s c)) + +open Classical in +/-- the "target" family: final row of a stayer, unit row of a born leaver. -/ +noncomputable def tv (s : St K Reg C) (c : C) (r : Reg) : Reg → K := + if s.loc r = .sit c then s.row r else Pi.single r 1 + +/-- the data hypothesis of R3 §2 (checked on words). -/ +def Indep (s : St K Reg C) (c : C) : Prop := + LinearIndependent K (fun r : ↥(stayS pub s c ∪ blS s c) => tv s c r) + +theorem gens_finrank_le (s : St K Reg C) (c : C) : + finrank K (I s c) ≤ (s.B c).card + (s.A c).card + (s.O c).length := by + classical + have : gens s c = ↑(((s.B c).image fun r => (Pi.single r (1 : K) : Reg → K)) ∪ + ((s.A c).image fun r => s.eRow r c) ∪ (s.O c).toFinset) := by + ext x; simp [gens, or_assoc] + unfold I; rw [this] + refine (finrank_span_finset_le_card _).trans ?_ + refine (Finset.card_union_le _ _).trans ?_ + exact add_le_add ((Finset.card_union_le _ _).trans (add_le_add Finset.card_image_le Finset.card_image_le)) + (List.toFinset_card_le _) + +/-- **counting identity**: |stay| + |BL| + |passers| = |B| + |A| (needs disjointness of B, A and +that a public register at c was born at c or entered c: the model invariants). -/ +theorem count_id {s : St K Reg C} (hs : Inv pub s) (c : C) : + (stayS pub s c).card + (blS s c).card + (passS s c).card = (s.B c).card + (s.A c).card := by + classical + have e1 : stayS pub s c = (s.B c).filter (fun r => s.loc r = .sit c) ∪ + (s.A c).filter (fun r => s.loc r = .sit c) := by + ext r + simp only [stayS, mem_filter, mem_univ, true_and, mem_union] + constructor + · rintro ⟨hp, hl⟩ + rcases hs.stay r c hp hl with h | h + · exact Or.inl ⟨h, hl⟩ + · exact Or.inr ⟨h, hl⟩ + · rintro (⟨h, hl⟩ | ⟨h, hl⟩) + · exact ⟨hs.pubBA r c (Or.inl h), hl⟩ + · exact ⟨hs.pubBA r c (Or.inr h), hl⟩ + have hd : Disjoint ((s.B c).filter (fun r => s.loc r = .sit c)) + ((s.A c).filter (fun r => s.loc r = .sit c)) := + Finset.disjoint_filter_filter (hs.disj c) + have h1 : ((s.B c).filter (fun r => s.loc r = .sit c)).card + (blS s c).card = (s.B c).card := by + convert Finset.card_filter_add_card_filter_not (s := s.B c) (fun r => s.loc r = .sit c) + unfold blS; congr + have h2 : ((s.A c).filter (fun r => s.loc r = .sit c)).card + (passS s c).card = (s.A c).card := by + convert Finset.card_filter_add_card_filter_not (s := s.A c) (fun r => s.loc r = .sit c) + unfold passS; congr + rw [e1, Finset.card_union_of_disjoint hd] + omega + +theorem fstay_le_I {s : St K Reg C} (hs : Inv pub s) (c : C) : Fstay pub s c ≤ I s c := by + classical + refine Submodule.span_le.2 ?_ + rintro _ ⟨r, hr, rfl⟩ + simp only [stayS, Finset.coe_filter, mem_univ, true_and, Set.mem_ofPred_eq] at hr + exact hs.cs r c hr.2 + +theorem ebl_le_I (s : St K Reg C) (c : C) : EBL s c ≤ I s c := by + classical + refine Submodule.span_le.2 ?_ + rintro _ ⟨r, hr, rfl⟩ + simp only [blS, Finset.coe_filter, Set.mem_ofPred_eq] at hr + exact Submodule.subset_span (Or.inl (Or.inl ⟨r, hr.1, rfl⟩)) + +theorem finrank_Fstay_le (s : St K Reg C) (c : C) : finrank K (Fstay pub s c) ≤ (stayS pub s c).card := by + classical + have : Fstay pub s c = Submodule.span K (↑((stayS pub s c).image fun r => s.row r) : Set (Reg → K)) := by + simp [Fstay, Finset.coe_image] + rw [this] + exact (finrank_span_finset_le_card _).trans Finset.card_image_le + +theorem finrank_EBL_le (s : St K Reg C) (c : C) : finrank K (EBL s c) ≤ (blS s c).card := by + classical + have : EBL s c = Submodule.span K (↑((blS s c).image fun r => (Pi.single r (1 : K) : Reg → K)) : Set (Reg → K)) := by + simp [EBL, Finset.coe_image] + rw [this] + exact (finrank_span_finset_le_card _).trans Finset.card_image_le + +theorem stay_bl_disjoint (s : St K Reg C) (c : C) : Disjoint (stayS pub s c) (blS s c) := by + classical + rw [Finset.disjoint_left] + intro r h1 h2 + simp only [stayS, mem_filter, mem_univ, true_and] at h1 + simp only [blS, mem_filter] at h2 + exact h2.2 h1.2 + +theorem span_range_tv (s : St K Reg C) (c : C) : + Submodule.span K (Set.range fun r : ↥(stayS pub s c ∪ blS s c) => tv s c r) = + Fstay pub s c ⊔ EBL s c := by + classical + unfold Fstay EBL + rw [← Submodule.span_union] + congr 1 + ext x + simp only [Set.mem_range, Set.mem_union, Set.mem_image, Finset.mem_coe, Subtype.exists, + Finset.mem_union] + constructor + · rintro ⟨r, hr, rfl⟩ + rcases hr with hr | hr + · left; refine ⟨r, hr, ?_⟩ + have : s.loc r = .sit c := by simpa [stayS] using (by simpa [stayS] using hr : pub r ∧ s.loc r = .sit c).2 + simp [tv, this] + · right; refine ⟨r, hr, ?_⟩ + have : s.loc r ≠ .sit c := by simpa [blS] using (Finset.mem_filter.1 hr).2 + simp [tv, this] + · rintro (⟨r, hr, rfl⟩ | ⟨r, hr, rfl⟩) + · refine ⟨r, Or.inl hr, ?_⟩ + have : s.loc r = .sit c := by simpa [stayS] using (by simpa [stayS] using hr : pub r ∧ s.loc r = .sit c).2 + simp [tv, this] + · refine ⟨r, Or.inr hr, ?_⟩ + have : s.loc r ≠ .sit c := (Finset.mem_filter.1 hr).2 + simp [tv, this] + +/-- **SLACK-RANK lemma** (R3 §2). On every reachable state, for every chart c where the data +hypothesis `Indep` holds: I_c = F_stay ⊕ E_BL ⊕ K_c with dim K_c ≤ σ_c = s_c + o_c, and +dim(F_stay ⊕ E_BL) = |B_c| + |A_c| − s_c. -/ +theorem slack_rank {s : St K Reg C} (hr : Reach pub s) (c : C) (hind : Indep pub s c) : + ∃ Kc : Submodule K (Reg → K), + Fstay pub s c ≤ I s c ∧ EBL s c ≤ I s c ∧ Disjoint (Fstay pub s c) (EBL s c) ∧ + Disjoint (Fstay pub s c ⊔ EBL s c) Kc ∧ Fstay pub s c ⊔ EBL s c ⊔ Kc = I s c ∧ + finrank K Kc ≤ sigma s c ∧ + finrank K ↥(Fstay pub s c ⊔ EBL s c) + (passS s c).card = (s.B c).card + (s.A c).card := by + classical + have hs := reach_inv pub hr + have hF := fstay_le_I pub hs c + have hE := ebl_le_I s c + set M := Fstay pub s c ⊔ EBL s c with hM + have hMI : M ≤ I s c := sup_le hF hE + have hfM : finrank K ↥M = (stayS pub s c).card + (blS s c).card := by + have := finrank_span_eq_card hind + rw [span_range_tv pub s c] at this + rw [this, Fintype.card_coe, Finset.card_union_of_disjoint (stay_bl_disjoint pub s c)] + have hcnt := count_id pub hs c + have hdisj : Disjoint (Fstay pub s c) (EBL s c) := by + have h := Submodule.finrank_sup_add_finrank_inf_eq (Fstay pub s c) (EBL s c) + rw [← hM] at h + have h1 := finrank_Fstay_le pub s c + have h2 := finrank_EBL_le s c + have h0 : finrank K ↥(Fstay pub s c ⊓ EBL s c) = 0 := by omega + rw [Submodule.disjoint_def] + intro x hx1 hx2 + have : Fstay pub s c ⊓ EBL s c = ⊥ := Submodule.finrank_eq_zero.1 h0 + have hx : x ∈ Fstay pub s c ⊓ EBL s c := ⟨hx1, hx2⟩ + rw [this] at hx; simpa using hx + -- complement of M inside I + obtain ⟨N, hN⟩ := Submodule.exists_isCompl (M.comap (I s c).subtype) + refine ⟨N.map (I s c).subtype, hF, hE, hdisj, ?_, ?_, ?_, by omega⟩ + · rw [Submodule.disjoint_def] + rintro x hxM ⟨n, hn, rfl⟩ + have hmem : n ∈ M.comap (I s c).subtype := hxM + have : n = 0 := by + have := hN.disjoint + rw [Submodule.disjoint_def] at this + exact this n hmem hn + simp [this] + · apply le_antisymm + · exact sup_le hMI (by rintro _ ⟨n, _, rfl⟩; exact n.2) + · intro x hx + have hx' : (⟨x, hx⟩ : ↥(I s c)) ∈ (M.comap (I s c).subtype) ⊔ N := by + rw [hN.sup_eq_top]; trivial + obtain ⟨y, hy, z, hz, hyz⟩ := Submodule.mem_sup.1 hx' + have : x = y.1 + z.1 := by simpa using congrArg Subtype.val hyz.symm + rw [this] + exact Submodule.mem_sup.2 ⟨y.1, hy, z.1, ⟨z, hz, rfl⟩, rfl⟩ + · -- dimension count + have h1 := Submodule.finrank_add_eq_of_isCompl hN + have h2 : finrank K ↥(N.map (I s c).subtype) = finrank K ↥N := Submodule.finrank_map_subtype_eq _ _ + have h3 : finrank K ↥(M.comap (I s c).subtype) = finrank K ↥M := by + rw [← Submodule.finrank_map_subtype_eq (I s c) (M.comap (I s c).subtype), + Submodule.map_comap_subtype, inf_eq_right.2 hMI] + have h4 := gens_finrank_le s c + simp only [sigma] + omega + +end WholeFloor + +#print axioms WholeFloor.count_id +#print axioms WholeFloor.slack_rank diff --git a/research/p104-lean-premises/lean/Nov15/WordDuality.lean b/research/p104-lean-premises/lean/Nov15/WordDuality.lean new file mode 100644 index 0000000000..166ddb4d93 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/Nov15/WordDuality.md b/research/p104-lean-premises/lean/Nov15/WordDuality.md new file mode 100644 index 0000000000..4459df8d1c --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/lake-manifest.json b/research/p104-lean-premises/lean/lake-manifest.json new file mode 100644 index 0000000000..e4290db056 --- /dev/null +++ b/research/p104-lean-premises/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-lean-premises/lean/lakefile.toml b/research/p104-lean-premises/lean/lakefile.toml new file mode 100644 index 0000000000..f73f2b3893 --- /dev/null +++ b/research/p104-lean-premises/lean/lakefile.toml @@ -0,0 +1,12 @@ +name = "LeanRelease3" +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-lean-premises/lean/lean-toolchain b/research/p104-lean-premises/lean/lean-toolchain new file mode 100644 index 0000000000..fd85b262bf --- /dev/null +++ b/research/p104-lean-premises/lean/lean-toolchain @@ -0,0 +1 @@ +leanprover/lean4:v4.33.0-rc1 From 2637027a9397757eab7ba8da1335c75e55141268 Mon Sep 17 00:00:00 2001 From: DreamingOfClouds <173691639+DreamingOfClouds@users.noreply.github.com> Date: Tue, 17 Nov 2026 19:18:19 -0600 Subject: [PATCH 2/2] Correct package descriptions after an independent review PROVED.md, README.md and the PR body now state each theorem's exact Lean hypotheses and scope; CORRECTIONS.md lists every change. No Lean statement or proof changed; comments in six files edited (rounding 1,081.31 -> ~1,081.3096, internal labels removed) and rebuilt. DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. Co-Authored-By: Claude Opus 5.5 --- research/p104-lean-premises/CORRECTIONS.md | 45 +++++++++++++++++ research/p104-lean-premises/FALSE.md | 2 +- research/p104-lean-premises/PROVED.md | 50 ++++++++++--------- research/p104-lean-premises/PR_BODY.md | 22 ++++---- research/p104-lean-premises/README.md | 17 ++++--- .../lean/Nov15/DescentPrice.lean | 2 +- .../p104-lean-premises/lean/Nov15/Floor.lean | 2 +- .../lean/Nov15/FloorCert.lean | 4 +- .../lean/Nov15/FloorCert.md | 2 +- .../p104-lean-premises/lean/Nov15/FloorD0.md | 2 +- .../lean/Nov15/HubSettle.lean | 2 +- .../p104-lean-premises/lean/Nov15/PsiLaw.lean | 2 +- .../lean/Nov15/RankLaw.lean | 2 +- 13 files changed, 101 insertions(+), 53 deletions(-) create mode 100644 research/p104-lean-premises/CORRECTIONS.md diff --git a/research/p104-lean-premises/CORRECTIONS.md b/research/p104-lean-premises/CORRECTIONS.md new file mode 100644 index 0000000000..4472e6d5cf --- /dev/null +++ b/research/p104-lean-premises/CORRECTIONS.md @@ -0,0 +1,45 @@ +# Corrections after an independent review + +An independent review compared the package's prose (PR body, README.md, PROVED.md) with the Lean statements. Every item below was checked against the Lean source. The Lean theorems are unchanged and still compile; the prose overstated scope or misstated hypotheses. None of the three ceiling theorems is false, but each covers less, or assumes more, than the prose said. One number was false as written (item 13). + +Format: **said** / **Lean proves** / **corrected statement**. + +## Ceilings +1. **M_V class hypotheses.** Said: hypotheses MV, Rank8C56, PlaneSep / Prov define the restricted class. Lean: `ceiling_A`, `ceiling_C` take `MV Rank8C56 PlaneSep : Prop` (resp. `Prov`) as uninterpreted propositions that only guard `hI3`; any propositions, `True` included, can be supplied. Corrected: M_V is not formalised; the class restriction rests on the reading of the I3 hypothesis. +2. **M_V junk count.** Said: the ceilings use the flag-DP minima. Lean: both take `hJ : 1936 ≤ J.card` directly; `forced_junk_ge` (with `hDP`) is a separate theorem, not invoked. Corrected: |J| ≥ 1936 is a hypothesis of the ceilings; its derivation from the flag-DP minima is a separate, unlinked result. +3. **`ceiling_A` hypothesis list.** Said (PR body): I3, flag-DP minima, rank-8 C = 56, public provenance. Lean: also `PlaneSep`, `hF` (native F bound), `hmp : 16 ≤ mp`, `hY : 104 ≤ st + mp`, `hst`, `hdist`; fixed caller C(8|9), 17 calls; `Prov` is not a hypothesis of `ceiling_A`. Corrected: full list now in PROVED.md §F. +4. **`ceiling_C` hypothesis list.** Lean also needs `hk` (ranks 1..9), `hmd : 8 ≤ ks.length`, `hmr : 8 ≤ mr` (owned rises), `hcorr0`, `hF`, `hst`, `hLc`. Corrected: listed in PROVED.md §F. +5. **Whole-word scope.** Said: "κ ≤ .0204110965 over legal (nested) words". Lean: `kappa_whole_floor_nested` needs `Priced w`, which includes `h_m16 : 16 ≤ ow.length` and `h_mass : ow.sum ≤ 112`, plus `hF`; without `h_m16` the derived native floor fails (e.g. 0 owned MOVEs, 104 stops). Corrected: κ ≤ .0204110965 for nested words satisfying `Priced` (at least 16 paid owned MOVEs, owned mass ≤ 112, ranks 1..9, helper/main price floors, Theorem Y) and `hF`. +6. **Whole-word `Indep`.** Said: `Indep` is a hypothesis. Lean: `WholeFloorNest` does not import `WholeFloorSlack`; `Indep` does not occur in the theorem; `Word` is a pricing summary and `NestedWord` links only its lateral count to a MOVE log. Corrected: `Indep` is upstream of `h_Y` and not linked to the theorem. +7. **Whole-word caller.** PR body omitted that the statement is for the #7113 caller C(8|9) at 17 calls. Corrected: stated. +8. **K(S22) endpoint.** Said: F(1−t) < 0 on [t0, 1]. Lean: `0 < s`, so t in [.0060197405, 1). Corrected: stated. +9. **K(S22) hypotheses.** Said: `rank_ge`, `hnat`/`hF`, `CallerD0Input`. Lean: `ceiling22_unconditional` takes `hdim`, `ClassK22` (fields `kc`, `kfin_all`, `rank_ge`, `count_le`, `oa_le`, `keptP`) and `hF`; `hnat` and `CallerD0Input` belong to `D0_K22` only. Corrected: listed. +10. **K(S22) class.** Said: "helpers free and verifier-accepted". Lean: `Accepted` is the model's (legality, helpers public, helper finals unit vectors); no word, S22 included, is shown to lie in `ClassK22`. Corrected: stated. +11. **JointCeiling .0419.** [H-centre] and [H-odd] were called "conditions on the class"; they are not fields of `InClass` or hypotheses of any theorem. `hrho : 2 ≤ rho` is unused. `NumCert` (not kernel-checked) was not named in the PR body. Corrected: stated. +12. **2|2 and 1|1 "fully kernel-checked".** Lean: the numerics (`split22_ceiling`, `split11_ceiling`) are for the fixed invoices I22, I11 at the floor native; the class forms still take `hB`, `hth`, `hN`. Corrected: "numerics kernel-checked; class hypotheses remain". +13. **`cost_ge_real` "≥ 1,081.31".** False as written: 780 · 2 ln 2 = 1,081.3096 < 1,081.31. Lean proves 2 ln 2 · 780 ≤ cost (and `floor_D0_classK` ≥ 1,081.309). Corrected: ≥ 780 · 2 ln 2 ≈ 1,081.3096. The same rounding appears in `FloorCert.md` and a `FloorCert.lean` docstring. +14. **FloorCert / FloorD0.** The LP certificate is checked standalone and reaches class-K words only through hypothesis H2; `helperD0_ge_fL` needs `hdim` and `Accepted`. Corrected: stated. + +## Premise narrowing +15. **PROVED.md "every theorem with its exact hypotheses".** Not so, by items 1-14 and 16-30. Corrected: "the theorems with their hypotheses; the Lean statements are authoritative". +16. **ClearCert.** `checker_complete` also needs `rowSpan s ≤ U`, `DeadZero s` and non-birth events; "every CLEAR is lossless" holds for birth-free, endpoint-exact words. Corrected. +17. **OwnedAscent.** `price_symm` is |dim b − dim a| = |dim a − dim b| with no hypothesis; symmetric pricing and zero owned credit are definitions (`mvCost`, `credit`). Corrected: "priced symmetrically, no credit" described as model definitions; the |Δdim| = compiled-rank assumption is built into them. +18. **NativeColumns.** `all_columns_of_exact_rows` concludes for data `evalRows s.row x`; the statement "the word applied to x gives T x" is `word_computes`, which needs `s.row = 1`. Corrected. +19. **CensusComplete.** The kernel checks list inclusion on extracted lists; correctness of all used pairs follows only from two input hypotheses. PR body corrected. +20. **OwnedSkeleton / OwnedTree.** The skeleton is extracted, not derived; the tree model runs the same word in every child; `caller_tree` models 17 atomic calls without reading the op list. Corrected. +21. **`caller_alphabet`.** Lean checks that every op code is ≤ 7; the meaning of the codes is a comment. Corrected. + +## Word structure and kills +22. **SwapNull.** README said "zero cost change in exactly those cases"; Lean gives zero change whenever ends or births agree (undoable or not) and undoable ⇒ zero, not the converse. `undo_one_iff` assumes final matrix F = 1 on all registers. Corrected. +23. **FibreK `tail_F_null`.** Also needs σ fixing non-helpers, V-enders = helpers ending at one chart, G0 born at 0, shifted gauge `Undo (V ∘ σ) G0`. Corrected. +24. **Shadow.** PR body omitted the `Sym` hypothesis; S follows from the net histogram (no separate theorem). Corrected. +25. **Annihilator.** `sparse_serves_le` needs an injection ι with identity Gram block. Corrected. +26. **Delivery `three_hop_cost`.** Exactly three hops, climb = sum of gaps. Corrected. +27. **WordDuality.** `selfdual_boundary` contains no P104 data: boundaries, σ and ⊥ are hypotheses. "Legal" is `LegalL` (locations only). `word_invoice` needs climbing registers and `hR`. Corrected. +28. **PlaneLaws.** `tok_t''` needs n odd; QUARTER counts are checked for one block of E7; `e7_totals` is arithmetic. Corrected. +29. **SpecGC.** `gc_h0`, `gc_h1`, `gc_dead_h0/h1` take 0 < U. Corrected. +30. **Spec6.** `spec6_dead` is conditional on `R58_PL`, `R58_ALLX`, `R58_ALLY`. Corrected. + +Also recommended outside the three corrected files: FALSE.md item 11 ("restores the floor for every legal word") should read "for every nested word satisfying `Priced`"; `FloorCert.md` "1,081.31" should read "≈ 1,081.3096". + +Reviewed and not changed: `DescentPrice` "paid − credit = 2·descent ranks". `helper_identity` holds for any integer path with credit = end − start, with no hub or legality hypothesis. diff --git a/research/p104-lean-premises/FALSE.md b/research/p104-lean-premises/FALSE.md index 3b750e8b1e..f58ddb243a 100644 --- a/research/p104-lean-premises/FALSE.md +++ b/research/p104-lean-premises/FALSE.md @@ -17,7 +17,7 @@ Each item is a Lean theorem or a documented correction in `lean/Nov15/`. None of 9. **OwnedAscent: floors that "owned registers only descend" rest on** (owned-paid-56, eight-unit relay, reader-497, surplus, H6 notes) do not transfer to the relaxed class (`W1_not_strict`, `W1_relaxed`, `W1_charge`). Not a false statement; the scope those notes already declared, now with a Lean witness. 10. **JunkLB2, the "public arrivals only" form of T4.** FALSE as written (`JunkLB2.T4_public_only_false`): a public helper h arrives with e_h + e_x and an owned register o arrives with −e_x; then h += o makes h its own token while the public span has dimension 1 > 0. The gap is the first step of the prose proof. Corrected: T4 with owned arrivals counted (`T4_departer` when there are none). -11. **Whole-word floor, "forced stops ≥ 88 at m = 16, argmin m = 16 (monotone)".** FALSE as written: the pricing only allowed owned MOVEs of rank 1..9, but Theorem Y counts all owned MOVEs, and a lateral owned MOVE (distinct charts, equal dimension, rank 0) enters σ_C for free. Counterexample `WholeFloorPrice.cex`, `cex_priced`, `r3_stops_not_forced` (12 rank-9 and 4 rank-1 paid owned MOVEs plus 88 lateral ones, no stops: D0 = −400 f 8 − 12 f 9, below the claimed floor by 88 · 2 ln 2). Corrected: `d0_floor` carries max 0 (88 − lat); the claimed floor (155,730.99; κ ≤ .0204110964) holds for words with no lateral owned MOVE. The verifier's nesting rule makes lateral MOVEs illegal (`WholeFloorNest.nest_rank_pos`, `nest_lat_zero`), which restores the floor for every legal word (`d0_whole_floor_nested`, `kappa_whole_floor_nested`). The cheaper all-words figure without nesting is 153,657.09 / κ ≤ .0207160184. Also a digit note: the root is .02041109645, so .0204110964 is rounded down and the kernel statement uses .0204110965. +11. **Whole-word floor, "forced stops ≥ 88 at m = 16, argmin m = 16 (monotone)".** FALSE as written: the pricing only allowed owned MOVEs of rank 1..9, but Theorem Y counts all owned MOVEs, and a lateral owned MOVE (distinct charts, equal dimension, rank 0) enters σ_C for free. Counterexample `WholeFloorPrice.cex`, `cex_priced`, `r3_stops_not_forced` (12 rank-9 and 4 rank-1 paid owned MOVEs plus 88 lateral ones, no stops: D0 = −400 f 8 − 12 f 9, below the claimed floor by 88 · 2 ln 2). Corrected: `d0_floor` carries max 0 (88 − lat); the claimed floor (155,730.99; κ ≤ .0204110964) holds for words with no lateral owned MOVE. The verifier's nesting rule makes lateral MOVEs illegal (`WholeFloorNest.nest_rank_pos`, `nest_lat_zero`), which restores the floor for every nested word satisfying `Priced` (`d0_whole_floor_nested`, `kappa_whole_floor_nested`). The cheaper all-words figure without nesting is 153,657.09 / κ ≤ .0207160184. Also a digit note: the root is .02041109645, so .0204110964 is rounded down and the kernel statement uses .0204110965. 12. **Delivery, TWO-STOP: "K-cost ≥ f(d) − max over three-way splits of Σ f, which is ≥ f(3) = 3.30".** FALSE as written. The "max over splits" is f(d) itself (split (d,0,0)), cost 0. Counterexample `Delivery.zero_gap_counterexample`: courier 0 → 8 → 9 → 9, D0 = f(9) − f(8) = 3.139 < f(3) = 3.296 (5 ln 3 < 8 ln 2). Corrected: with three genuine hops (all gaps ≥ 1) D0 ≥ f(d) − f(d−2) ≥ f(3) (`three_hop_cost`, `fL_three_gt`). The value 3.30 is numeric; Lean proves > 3. 13. **DesignLaws, ONE-READ: "a register reads at most one chart per owned lineage".** FALSE with owned ascent allowed (`DesignLaws.one_read_needs_descent`: a legal run in which owned register and reader both go 0 → 1 and read at charts 0 and 1). True with the DESCENT hypothesis on the owned lineage (`one_read`). Corrected: at most one chart per DESCENDING owned lineage. 14. **PsiLaw, the two span/obstruction statements.** (a) "A repair exists iff w lies in the row span" is only necessary: `span_law_not_sufficient` (one end row (1), w = (1): w in the span, stripped row 0, no V settle). Corrected: iff w is in the old span and in the stripped span (`span_strip_iff`). (b) "A relocated op is a pure G0-column operation only if neither register is read in between": reads of the source register are harmless (`add_swap` allows them); the obstruction is reads of the target and writes to the source (`exposed_read_no_prefix`, `move_early`). diff --git a/research/p104-lean-premises/PROVED.md b/research/p104-lean-premises/PROVED.md index 71b95b20ef..66096da862 100644 --- a/research/p104-lean-premises/PROVED.md +++ b/research/p104-lean-premises/PROVED.md @@ -2,7 +2,7 @@ Authors: DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. Nothing here is a κ claim. Every theorem below is kernel-checked in `lean/` (no `sorry`, no `axiom` declaration, no `native_decide`; the word `sorry` occurs only in comments). Every file's axioms are within {propext, Classical.choice, Quot.sound} (CHECK.txt). -"Input" means the Lean statement takes it as a hypothesis or as data; Lean proves nothing about it. Files already in #7632/#7634 are listed in `SHIPPED.txt`. Premise-level status (fact vs assumed) is in `PREMISES.md`. +"Input" means the Lean statement takes it as a hypothesis or as data; Lean proves nothing about it. This file was corrected after an independent review (CORRECTIONS.md); where it and a Lean statement differ, the Lean statement is authoritative. Files already in #7632/#7634 are listed in `SHIPPED.txt`. Premise-level status (fact vs assumed) is in `PREMISES.md`. ## A. Premise narrowing for #7620 @@ -10,7 +10,7 @@ Every theorem below is kernel-checked in `lean/` (no `sorry`, no `axiom` declara Model: TokenCancel rows over a field K in initial-row coordinates; `Good` = what the #7630 checker enforces besides legality (no birth in the tail, SCALE unit, ADD between distinct registers, COPY/INIT into a zero row). - `span_step_le`: any non-birth event only shrinks the row span. `span_step_ge`: any Good non-CLEAR event preserves it. `lossless_iff`, `finrank_clear_le` (a CLEAR lowers the rank by at most 1). - `every_clear_lossless`: hypotheses `rowSpan s ≤ U`, all events non-birth, `FullEnd U s es` (final rows span U); conclusion: every CLEAR acts on a row in the span of the others. No legality hypothesis. -- `checker_sound`: hypotheses `rowSpan s ≤ U`, `U ≤ rowSpan s`, `GoodRun s es`, `Certified s es cs`; conclusion `FullEnd U s es` and every CLEAR lossless. `certOK_lossless`, `lossless_certOK`; `checker_complete`: an endpoint-exact legal word has certificates at all CLEARs. +- `checker_sound`: hypotheses `rowSpan s ≤ U`, `U ≤ rowSpan s`, `GoodRun s es`, `Certified s es cs`; conclusion `FullEnd U s es` and every CLEAR lossless. `certOK_lossless`, `lossless_certOK`; `checker_complete`: hypotheses `rowSpan s ≤ U`, `DeadZero s` (unlocated registers hold zero rows), legality, all events non-birth, `FullEnd U s es`; conclusion: certificates exist at all CLEARs. - `legal_congr`: legality reads only `loc`, never rows. `clearform`: for an arbitrary predicate `Sk` of the owned-event skeleton, two endpoint-exact words with equal owned events satisfy `ErasureOK Sk` together or not at all. - `copy_nonzero_loses_rank` (counterexample, see FALSE.md); `toy_end`: a 4-register word in the real certificate shape. **Inputs:** `Sk` (arbitrary); the 180 real certificates and the 208,738-event word are NOT replayed (hypothesis `Certified W0 W certs`). @@ -18,10 +18,11 @@ Model: TokenCancel rows over a field K in initial-row coordinates; `Good` = what - `rc_inv`: the rank of the residual of a chart change is inverse-invariant; `back_cost`; `rc_comp` (subadditive). `cost_split`, `ownedCost_nonneg`, `owned_ascent_charged` (≥ 1, given strictly monotone dim). `owned_no_credit`, `invoice_eq`. - `legal_of_S`, `AcceptedS.toAccepted`, `public_unchanged`, `legal_diff`: strict legality implies relaxed legality, differing only on owned ascents. `hOnce_strict`: the FloorEndToEnd hOnce bound holds for strict-accepted words (hence every FloorEndToEnd theorem does). - `strict_no_owned_asc`; `W1_relaxed`, `W1_not_strict`, `W1_charge`: a 2-event word that is relaxed-legal, strict-illegal, charge 1. -- **Inputs:** compiled rank = |Δdim| for each chart pair (hypothesis of `price_symm`), dim and nesting, and the admission of owned ascent by the contract. `rc` is a generic rank-of-(T−1) proxy, not the Pauli/Fourier rank. +- The pricing is a definition, not a theorem: `mvCost` charges |Δdim| for every MOVE, owned or public, in either direction, and `credit` is 0 for owned registers. `price_symm` is the identity |dim b − dim a| = |dim a − dim b| and takes no hypothesis. +- **Inputs:** that the compiled rank of a chart change equals |Δdim| (built into the definitions above, not a hypothesis of any theorem), dim and nesting, and the admission of owned ascent by the contract. `rc` is a generic rank-of-(T−1) proxy, not the Pauli/Fourier rank. ### NativeColumns.lean (imports TokenCancel) -- `all_columns_of_exact_rows`: if `(run s es).row = T`, the word applied to data `x` in ANY K-module gives `T x`. `exact_rows_iff_columns`: exact rows ⇔ correct on every unit column. +- `all_columns_of_exact_rows`: if `(run s es).row = T`, the word run on data `evalRows s.row x` in ANY K-module gives `T x`; `word_computes`: with identity initial rows (`s.row = 1`) the word applied to `x` gives `T x`. `exact_rows_iff_columns`: exact rows ⇔ correct on every unit column. - `matrix_ext_cols`, `linear_ext_span`, `partial_columns_insufficient` (2×2 over ℚ), `adjoint_iff_forward`, `phase_visible`, `census_coverage` (logic only). - **Not modelled:** Pauli frames, complex phase, the Fourier recipe; the checker script. @@ -40,7 +41,7 @@ Skeleton = time-ordered owned INIT / MOVE / CLEAR events of #7630's word (407 ev ### OwnedTreeData.lean, OwnedTree.lean, OwnedTreeCheck.lean Model: the unit tree comes from the contract's execution model (a child unit is a complete call made at a paid round, atomic from the parent's view, with its own bank tag); the word carries no unit tags. - `go_frame`: E1 of one unit transports to the tagged run in any context with nothing live at or below the unit. `execU_id`: from `e1run [] skel = some []`, by induction on depth, running a unit returns the context unchanged. -- `e3_tree sites d : execU sites d [] [] = some []` for ALL depths and ALL call-site lists. `e3_tree_real`: at the 6,250 real MOVE sites (`n_sites`). `caller_tree`: the 17 sequential native calls of the #7113 caller each run to completion from the empty state and end empty; `caller_alphabet`: the caller's op alphabet has no owned-storage op. +- `e3_tree sites d : execU sites d [] [] = some []` for ALL depths and ALL call-site lists. `e3_tree_real`: at the 6,250 real MOVE sites (`n_sites`). `caller_tree`: in the model where the caller is 17 sequential atomic native calls (`callerRun`; it does not read the op list), each call runs to completion from the empty state and ends empty; `caller_alphabet`: every code in the extracted caller op list is ≤ 7 (that codes 0..7 are non-owned ops is stated in a comment, not defined in Lean). - `concrete_d1_owned` (root plus the first 4 owned-MOVE sites as children, kernel-evaluated); negative controls `c_child_leak`, `c_child_steals`, `c_clear_with_desc`, `c_caller_leak`, `c_real_child_leak`, with accepting twins. - **Inputs:** atomic calls, "child = same word", the extracted sites and caller alphabet (from a local copy of the #7113 caller, sha 255d89f3). @@ -58,7 +59,7 @@ Histograms of (rank, count); S = Σ r·(T−P) (`Sinv`), D0 = Σ (T−P)·r ln r Convention F(s) = Σ (T−P) r^s with s = 1 − t. `invoice_F`, `natFloor_F` (native floor Nfl(s) = 400·8^s + 16 + 88(2 − 2^s)), `FB_eq` (bridge to `CallerCost.caller` for a,b ≥ 2). - **Correction:** `FBc a b th s = FB a b th s + 208·8^s·(#arms of 1)`; `callerG_F`, `callerG_S : S(callerG a b 4) = 3408(a+b) − 208` for all a,b ≥ 1; `FBc_two`, `callerG_eq_caller_F`. - **`ceiling`, `ceiling4`, `ceiling3` (conditional):** for `c : InClass th0`, native `n` with `hN : ∀ s ∈ [0,1], F_nat(s) ≤ −Nfl(s)`, and `hnum : NumCert th0 tbar`: `F(1−t)` of the invoice is < 0 for tbar ≤ t ≤ 1. With th0 = 4, tbar = tbar4 = .0419448764 (rounded up from the certified root .041944876391, peak at 1|1, k = 2); th0 = 3: tbar3 = .0681203280, certified only for the th3 B-form-A class under hB. - Named hypotheses: `InClass.hB` (B-form per-split optimality pointwise in F on [0,1]), `hth` (th ≥ th0: A ports use th0 QUERY sign units), `hrho` (ρ ≥ 2, i.e. Theorem H plus the t = −1 closure; recorded only), `hN` (native floor; not re-proved), `NumCert` (a finite list of interval inequalities, ~1,800 pairs of 40-digit covers plus the tail step; NOT in the kernel; the tail step "U ≥ F by Jensen/MVT" is unaudited), plus [H-centre] (no line crosses the centre at h ≤ 4) and [H-odd] (a B sign unit costs ≥ ψ(1)) as conditions on the class, and realisability of arms of 1 / k = 2 (no root built). + Named hypotheses: `InClass.hB` (B-form per-split optimality pointwise in F on [0,1]), `hth` (th ≥ th0: A ports use th0 QUERY sign units), `hrho` (ρ ≥ 2, i.e. Theorem H plus the t = −1 closure; recorded only), `hN` (native floor; not re-proved), `NumCert` (a finite list of interval inequalities, ~1,800 pairs of 40-digit covers plus the tail step; NOT in the kernel; the tail step "U ≥ F by Jensen/MVT" is unaudited), plus [H-centre] (no line crosses the centre at h ≤ 4) and [H-odd] (a B sign unit costs ≥ ψ(1)), which are not fields of `InClass` or hypotheses of any Lean theorem (prose conditions behind `hB`), and realisability of arms of 1 / k = 2 (no root built). `hrho` is `2 ≤ rho` and is not used in any proof; ρ = 2 enters only through the two-arm form of FB. - **Fully kernel-checked numerics (no NumCert):** `split22_ceiling`: `F(1−t) < 0` for t ≥ 141/4096 (= .034424) for the invoice `I22` of the 2|2 caller and the floor native (28 rational cells); `split11_ceiling`: t ≥ 176/4096 (= .04297) for `I11` (36 rational cells). The class-level forms `ceiling_split22` (`c.a = c.b = 2`) and `ceiling_split11` (`c.a = c.b = 1`) still take `hB`, `hth` (via `InClass 4`) and `hN` as hypotheses. The sharp root is not reachable on the 4096 grid; it is in NumCert. - `control_bracket`: for the #7113 caller at the floor native with k = 17, F(.0204) > 0 > F(.0205); `I89_F`. - **Outside the class:** trees, multi-centre callers, shared own roles. The .0336 / .0400 statement is withdrawn (FALSE.md item 5). @@ -67,19 +68,19 @@ Convention F(s) = Σ (T−P) r^s with s = 1 − t. `invoice_F`, `natFloor_F` (na Included: see section C below. ## C. SWAP-NULL (SwapNull) -4-op swap gadget at a shared chart (`add h1 h2 +1; add h2 h1 −1; add h1 h2 +1; scale h2 −1`) swaps two helper rows. `undo_one_iff`: with identity finals the swap is hub-undoable iff both helpers end in V or both are born in G0. `stays_multiset`, `delta_eq`, `swap_null`: the stay multiset is unchanged and the cost change is f(e2−b1)+f(e1−b2)−f(e1−b1)−f(e2−b2), zero when ends or births agree. `nonzero_not_undoable`, `converse_witness`: a swap with nonzero cost change cannot be undone by the hubs. +4-op swap gadget at a shared chart (`add h1 h2 +1; add h2 h1 −1; add h1 h2 +1; scale h2 −1`) swaps two helper rows. `undo_one_iff`: when the final matrix is the identity on all registers (F = 1), the swap is hub-undoable iff both helpers end in V or both are born in G0. `stays_multiset`, `delta_eq`: the stay multiset is unchanged and the cost change is f(e2−b1)+f(e1−b2)−f(e1−b1)−f(e2−b2), zero whenever the two ends or the two births agree (`delta_zero_end`, `delta_zero_birth`), hub-undoable or not; `swap_null`: every hub-undoable swap is cost-null (given V-enders end at one dim and G0 members are born at 0). The converse (zero change ⇒ undoable) is not claimed. `nonzero_not_undoable`, `converse_witness`: a swap with nonzero cost change cannot be undone by the hubs. ## D. B-form optimality (BFormOpt) Pointwise in s, for all arm lengths a, b and parameters h, e: `bill_lb` (any feasible schedule), `CB_closed` (arms of 1 included), `own_abel`, `hub_nonpos`, `bform_optimal` (F ≤ F(B form) on B ports), `port_total` (96 A + 8 B ports reproduce the caller cost). `hB_discharge` / `ceiling_of_ports` discharge JointCeiling's hB for B ports, with A ports of the built type. `A_drop_*`: on A ports the B form is NOT optimal (dropping a last-stage own role gains 1 − ψ(1)), which is why A ports are fixed to the built type. Still hypotheses: H-odd, the native floor, NumCert. ## E. Fibre structure, first pieces (FibreK) -`K_word`, `K_invoice`, `kappa_depends_only`: with the cost table P0 as an explicit parameter, the invoice F(t) depends only on the ends E, the timed helper step multiset S and the climb multiset Π = {e_h − b_h}. `tail_pairs` / `head_pairs` (proved directly), `tail_F_null`, `head_F_null`: with helpers ending as identity, any hub-undoable pure relabel preserves the (birth, end) multiset, hence Π and F(t). `c3_not_undoable`. NOT covered: relabel combined with an interior gauge, loops, mixed head+tail relabels, and any "native is optimal over its fibre" statement (open). +`K_word`, `K_invoice`, `kappa_depends_only`: with the cost table P0 as an explicit parameter, the invoice F(t) depends only on the ends E, the timed helper step multiset S and the climb multiset Π = {e_h − b_h}. `tail_pairs` / `head_pairs` (proved directly), `tail_F_null`, `head_F_null`: with helpers ending as identity, σ fixing every non-helper, the V-enders being exactly the helpers ending at one chart d, G0 members born at 0, and hub-undoability in the shifted gauge (`Undo (V ∘ σ) G0`), the relabel preserves the (birth, end) multiset, hence Π and F(t). `c3_not_undoable`. NOT covered: relabel combined with an interior gauge, loops, mixed head+tail relabels, and any "native is optimal over its fibre" statement (open). # Added in the combined package (ceilings, word structure, spec-break kills, small lemmas) Each file has a `.md` note in `lean/Nov15/` with the full statement list. Hypotheses are named in the theorems; "input" means Lean takes it as a hypothesis or as data and proves nothing about it. Labels such as R3, R5, RB4, AUDIT5 in the notes refer to internal working notes that are not part of this package. ## F. Whole-word ceilings (WholeFloor*, NumCertK*, FloorK22*, CongestionI3*) -Convention as in JointCeiling: F(s) = Σ (T−P) r^s, s = 1 − t; "κ ≤ t0" means F(1−t) < 0 for all t in [t0, 1]. +Convention as in JointCeiling: F(s) = Σ (T−P) r^s, s = 1 − t; "κ ≤ t0" means F(1−t) < 0 for all t in [t0, 1] (for K(S22): t in [t0, 1), since those theorems take 0 < s). All ceilings in this section are for the 17-call invoice of the #7113 caller (`caller 6 7`, 17 calls). ### WholeFloorModel, WholeFloorSlack (Mathlib only) Ghosted run state, events (birth, same-chart gate, public MOVE strictly ascending, owned MOVE any chart, owned CLEAR). `reach_inv`, `cs_final` (every row that sits at c at any moment lies in I_c of the end state). `slack_rank`: under hypothesis `Indep` (final rows of stayers plus unit rows of c-born leavers independent) I_c = F_stay ⊕ E_BL ⊕ K_c with dim K_c ≤ σ_c = s_c + o_c; `count_id`, `gens_finrank_le`. **Inputs:** `Indep`; the port lemma (Theorem Y: Σσ ≥ 104 over C ≠ V) is the hypothesis `h_Y`. @@ -89,43 +90,44 @@ Ghosted run state, events (birth, same-chart gate, public MOVE strictly ascendin ### WholeFloorNest, WholeFloorCover, WholeFloorCoverData(1) (import NumCertK, JointCeiling) `Geo`/`NestOwn`/`RunL`: the verifier's nesting rule (public MOVE: proper nested ascent; owned: nested either direction) added to the model; `nest_rank_pos` (every legal MOVE has rank ≥ 1), `nest_lat_zero`. `d0_whole_floor_nested`: priced words obeying nesting have 17-call invoice D0 ≥ 155,730.9 (no lat hypothesis). `hN_nested`. -- **`kappa_whole_floor_nested`:** for nested priced words, F(1−t) < 0 on the invoice (caller 6 7) + 17 native for every t in [.0204110965, 1]. **κ ≤ .0204110965 over legal (nested) words.** Hypotheses: `Priced w` (h_Y = Theorem Y, h_help, h_main, owned pricing), `Indep`, and the F-currency pricing link `hF`. The numeric cover is discharged in the kernel (`WholeFloorCover.cover`: 11 negative pieces on [0, .93] and one monotone piece on [.93, .9795889035], `decide +kernel`, split across the Data files for memory); no numeric hypothesis remains. Digit note: the exact root is .02041109645; the kernel statement uses the 10th-digit round-up. -- **Not in the kernel:** Theorem Y itself, `Indep`, the cost-model link `hF`, and the verifier-nesting reading of the SPEC (a statement about the verifier source, recorded in the note). +- **`kappa_whole_floor_nested`:** for nested priced words, F(1−t) < 0 on the invoice (caller 6 7) + 17 native for every t in [.0204110965, 1]. **κ ≤ .0204110965 over nested words satisfying `Priced`.** Hypotheses: `Priced w` (h_Y = Theorem Y, h_help, h_main, owned pricing with ranks 1..9, owned mass ≤ 112 (`h_mass`) and at least 16 paid owned MOVEs (`h_m16`)) and the F-currency pricing link `hF`. Words with fewer than 16 paid owned MOVEs or owned mass above 112 are outside the statement (without `h_m16` the derived native floor fails, e.g. at 0 owned MOVEs and 104 stops). `Indep` is not a hypothesis of this theorem: it is the upstream justification of h_Y (`WholeFloorSlack`, not imported here). `Word` is a pricing summary; `NestedWord` ties only its lateral count to a MOVE log, not to a run. The numeric cover is discharged in the kernel (`WholeFloorCover.cover`: 11 negative pieces on [0, .93] and one monotone piece on [.93, .9795889035], `decide +kernel`, split across the Data files for memory); no numeric hypothesis remains. Digit note: the exact root is .02041109645; the kernel statement uses the 10th-digit round-up. +- **Not in the kernel:** Theorem Y itself (and `Indep` behind it), the cost-model link `hF`, and the verifier-nesting reading of the SPEC (a statement about the verifier source, recorded in the note). ### NumCertK, NumCertKData, NumCertK22 (kernel interval arithmetic) Library: `lnLo ≤ ln ≤ lnHi` (36-term atanh chain, ~1e-28), exp enclosure, `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), `Fc_le`, `dFc_ge`, `Fc_hasDerivAt`, `Fc_mono`. `cfK_neg`: F(s) < 0 on [0, 1 − .0060197405] for the K(S22) invoice histogram (24 ranks). `numCert22 : NumCert22 tbar22`, `ceiling22_unconditional`. ### FloorK22, FloorK22Data (import FloorD0, JointCeiling) -`ClassK22` = class K(S22): kept data fixed, helpers free and verifier-accepted. `R1Y_row`, `forced_sum` (kernel: Σ over 978 charts of max(0, rk − ab − oa) = 748), `stays_ge_748`, `helperD0_ge_748` (helper D0 ≥ 748 · 2 ln 2 ≥ 1,036.948), `D0_K22` (invoice D0 ≥ 240,134.84; input `CallerD0Input`, the ~70 caller logs), `helperF_le` (F-form native floor derived for every s), `entries_are_registers`, `reentry_two_events`. -- **`ceiling22` / `ceiling22_unconditional`: κ ≤ .0060197405 for class K(S22).** Hypotheses: `ClassK22.rank_ge` (rank of the kept rows at each chart ≥ rk; the 378-coordinate rows are not exported), the cost-model links `hnat`/`hF`, and `CallerD0Input`. `NumCert22` is discharged (NumCertK22). Not formalised: the 845-stop dual (`D0_K22_R6` is conditional on it). +`ClassK22` = class K(S22): a word `Accepted` in the model (legal, helpers public, helper final rows unit vectors) with the kept data of S22 fixed (fields `kc`, `kfin_all`, `rank_ge`, `count_le`, `oa_le`, `keptP`). No word, S22 included, is shown in Lean to lie in the class. `R1Y_row`, `forced_sum` (kernel: Σ over 978 charts of max(0, rk − ab − oa) = 748), `stays_ge_748`, `helperD0_ge_748` (helper D0 ≥ 748 · 2 ln 2 ≥ 1,036.948), `D0_K22` (invoice D0 ≥ 240,134.84; input `CallerD0Input`, the ~70 caller logs), `helperF_le` (F-form native floor derived for every s), `entries_are_registers`, `reentry_two_events`. +- **`ceiling22` / `ceiling22_unconditional`: κ ≤ .0060197405 for class K(S22)**, i.e. F(s) < 0 for 0 < s ≤ 1 − .0060197405 (t in [.0060197405, 1)). Hypotheses: `hdim` (dim strictly monotone on the chart order), `ClassK22` (including `rank_ge`: rank of the kept rows at each chart ≥ rk; the 378-coordinate rows are not exported), and the cost-model link `hF` (F of the native equals helper minus kept cost, 0 < s ≤ 1). `hnat` and `CallerD0Input` are hypotheses of the D0 statement `D0_K22` only, not of the ceiling. `NumCert22` is discharged (NumCertK22). Not formalised: the 845-stop dual (`D0_K22_R6` is conditional on it). ### CongestionI3, CongestionI3Cfg/Data/Mu/NumA/NumC1–C4 (import WholeFloorCover) `pair_bound`, `i3_D0_per_call` (0.541495 per pair, |J| ≥ 1936 ⇒ ≥ 1048.33 D0/call). `cfgs_ok`, `cfg_uniq0..7`, `uniqCells_disjoint` (the 8 rank-8 C = 56 configurations, 330 unique cells per chain recomputed from the labels), `mu_sum`, `forced_junk_ge` (|J| ≥ 1936). `f1_floor` (max, not sum: `sum_not_implied`), `Fc_mono`, `nine_chord`, `own56_floor`, `dprice_ge`. -- **`ceiling_A`: κ ≤ .0183952347** on the 8|9 invoice, for the restricted class M_V (every public register except Y mains ends at V, owned code fixed, X_q born at A_q). -- **`ceiling_C`: κ ≤ .0134769139**, same class, with descent mass ≥ 56 (rank-8 decoder, C = 56). -- **Hypotheses (named in the theorems):** `MV` (class M_V); I3 as `I3Path` (path-distance telescoping bound, not formalised); `Rank8C56` (exactly the C = 56 rank-8 decoders on P104 labels; exhaustiveness over the 12,870 subsets and rigidity are quoted, C ≥ 58 is not covered); `hDP` (flag-DP minima, python data, not kernel-checked); `hdist`, `hLc` (per-pair lower bounds, numerical); `Prov`/`I3Cap` (public-provenance direction law, open cases listed in the note); `PlaneSep` (ceiling_A only); `hY` (Theorem Y under nesting). **No known native lies in M_V** (224 of 1,501 public registers end at dim ≤ 7), so these are ceilings for the restricted class, not floors on the native class. +- **`ceiling_A`: κ ≤ .0183952347** on the 8|9 invoice, intended for the restricted class M_V (every public register except Y mains ends at V, owned code fixed, X_q born at A_q). Lean statement: for a native `n` and naturals mp, st with `hmp : 16 ≤ mp`, `hY : 104 ≤ st + mp`, a public excess E with `hst : (2 − 2^s)·st ≤ E(s)`, `hF : F_n(s) ≤ −400·8^s − mp − E(s)` on [0,1], a junk set J with `hJ : 1936 ≤ |J|`, per-pair minima `hdist`, and `hI3 : MV → Rank8C56 → PlaneSep → I3Path`, F(1−t) < 0 for t in [.0183952347, 1]. +- **`ceiling_C`: κ ≤ .0134769139**, same intended class, with descent mass ≥ 56 (rank-8 decoder, C = 56). Lean statement: as `ceiling_A` with `Prov` in place of `PlaneSep`, the capped lift `I3Cap` in `hI3`, the native bound `hF : F_n(s) ≤ −400·8^s − dprice ks s − mr − E(s)`, descent ranks `ks` with every k in 1..9 (`hk`), `8 ≤ ks.length` (`hmd`), `56 ≤ ks.sum` (`hmass`), `hmr : 8 ≤ mr` owned rises, `hY : 104 ≤ st + ks.length + mr`, `hst`, `hcorr0 : 0 ≤ corr`, `hdist`, `hLc`, `hJ : 1936 ≤ |J|`. +- **How the class enters:** `MV`, `Rank8C56`, `PlaneSep`, `Prov` are uninterpreted propositions (theorem parameters of type `Prop`, with no Lean definition on words); they only guard `hI3`, so any propositions, `True` included, can be supplied, and the class restriction rests entirely on the reading of `hI3`. The theorems take `hJ` directly; `forced_junk_ge` (which derives |J| ≥ 1936 from the 8 configurations and the flag-DP minima `hDP`) is a separate theorem and is not invoked by either ceiling. +- **What the hypotheses stand for (reading, not Lean):** `MV` (class M_V); I3 as `I3Path` (path-distance telescoping bound, not formalised); `Rank8C56` (exactly the C = 56 rank-8 decoders on P104 labels; exhaustiveness over the 12,870 subsets and rigidity are quoted, C ≥ 58 is not covered); `hJ` (junk count; its derivation via `forced_junk_ge` needs the flag-DP minima `hDP`, python data, not kernel-checked); `hdist`, `hLc` (per-pair lower bounds, numerical); `Prov`/`I3Cap` (public-provenance direction law, open cases listed in the note); `PlaneSep` (ceiling_A only; without it the junk bound collapses to 0); `hY` (Theorem Y under nesting); `hF`, `hst` (cost-model links). **No known native lies in M_V** (224 of 1,501 public registers end at dim ≤ 7), so these are ceilings for the restricted class, not floors on the native class. ### Supporting files for the ceilings -`FloorCertDefs/Data/Check`, `FloorCert` (class-K LP certificate: the support sub-LP of 892 rows × 18,868 columns, `len_ok`, `Y_nonneg_ok`, `bDot_ok`, `cols_ok` by `decide +kernel` with no axioms; `lp_floor`, `stops_ge_780`, `cost_ge_780`, `cost_ge_real`: 780 stays, ≥ 1,081.31 D0/call); `DescentPrice` (paid − credit = 2·descent ranks); `FloorD0` (helper D0 ≥ 2 ln 2 · #paid stays, `floor_D0_classK`: ≥ 780·2 ln 2 under ClassK + H2); `JunkLB2` (g9 pricing and the corrected T4 with owned arrivals, `T4_public_only_false`). Their notes list hypotheses. +`FloorCertDefs/Data/Check`, `FloorCert` (class-K LP certificate: the support sub-LP of 892 rows × 18,868 columns, `len_ok`, `Y_nonneg_ok`, `bDot_ok`, `cols_ok` by `decide +kernel` with no axioms; `lp_floor`, `stops_ge_780`, `cost_ge_780`, `cost_ge_real`: any nonnegative x satisfying the 892 rows has objective ≥ 780, hence ≥ 780 stays and cost ≥ 780 · 2 ln 2 ≈ 1,081.3096 D0/call (`floor_D0_classK` states ≥ 1,081.309); the LP reaches class-K words only through the hypothesis H2); `DescentPrice` (paid − credit = 2·descent ranks); `FloorD0` (helper D0 ≥ 2 ln 2 · #paid stays on `Accepted` words with strictly monotone dim (`helperD0_ge_fL`), `floor_D0_classK`: ≥ 780·2 ln 2 under ClassK + H2); `JunkLB2` (g9 pricing and the corrected T4 with owned arrivals, `T4_public_only_false`). Their notes list hypotheses. ## G. Word structure (Shadow, Annihilator, Delivery, DesignLaws, SharedCourier, PsiLaw, WordDuality, PlaneLaws; supporting HubSettle, RankLaw, RankLawC, FrameSep) -- **Shadow** (imports FibreK): the 4-gate birth swap and swap-back are exact swaps (`swapIn_eq`, `swapOut_eq`); `shadow` replaces each main by a single-jump main plus a twin helper; `shadow_net`, `shadow_F`, `shadow_D0`: the NET histogram T − P, hence S, F(t), D0 and κ, are unchanged, under hypothesis `Sym` (P0 symmetry on mains) and the model-membership hypothesis `hM` (replay legality of the twin). The raw T and P counts are not equal (FALSE.md item 15). Not covered: laws that read raw T or P counts, or the gated verifier. -- **Annihilator:** `modular_le`, `step_bound`, `run_bound`, `annihilator`, `sparse_serves_le`: along a nested lineage, served ports ≤ descending owned rank. Model: functionals with support vectors in the start chart, vanishing on a leaf chart. -- **Delivery** (imports TokenCancel, FibreK, Annihilator): `single_contact_null`, `two_contacts_needed`, `const_rows_null`, `two_contacts_suffice` (net delivery needs ≥ 2 contacts with different courier rows); `three_hop_cost`, `ctype_cost`, `fL_three_gt` (three genuine hops cost ≥ f(3)); `zero_gap_counterexample` (FALSE.md item 12); `direct_read_capacity`, `entry_rank_multihop`, `dense_needed`; `never_meet_after_read`, `carrier_before_read`. R = 56 is an input. +- **Shadow** (imports FibreK): the 4-gate birth swap and swap-back are exact swaps (`swapIn_eq`, `swapOut_eq`); `shadow` replaces each main by a single-jump main plus a twin helper; `shadow_net`, `shadow_F`, `shadow_D0`: the NET histogram T − P, hence S (a function of the net histogram; no separate S theorem), F(t), D0 and κ, are unchanged, under hypothesis `Sym` (P0 symmetry on mains) and the model-membership hypothesis `hM` (replay legality of the twin). The raw T and P counts are not equal (FALSE.md item 15). Not covered: laws that read raw T or P counts, or the gated verifier. +- **Annihilator:** `modular_le`, `step_bound`, `run_bound`, `annihilator`, `sparse_serves_le`: along a nested lineage, served ports ≤ descending owned rank, for ports P with an injection ι : P → S such that the Gram block is the identity, φ_a(u_{ι a'}) = δ_{a a'}. Model: functionals with support vectors in the start chart, vanishing on a leaf chart. +- **Delivery** (imports TokenCancel, FibreK, Annihilator): `single_contact_null`, `two_contacts_needed`, `const_rows_null`, `two_contacts_suffice` (net delivery needs ≥ 2 contacts with different courier rows); `three_hop_cost`, `ctype_cost`, `fL_three_gt` (a courier with exactly three hops, all genuine (gaps a+1, b+1, c+1), whose climb e − b equals a + b + c + 3, costs ≥ f(3)); `zero_gap_counterexample` (FALSE.md item 12); `direct_read_capacity`, `entry_rank_multihop`, `dense_needed`; `never_meet_after_read`, `carrier_before_read`. R = 56 is an input. - **DesignLaws:** `pcl`, `pcl_orth`, `one_read` (needs the DESCENT hypothesis on the owned lineage; `one_read_needs_descent`), `one_stop_per_dim`, `hyperplane_dedicated`, `rank_feed`, `matrix_rank_le`, `rank_feed_st1` (N = 104, s = 96 ⇒ ≥ 8 ports), `xclose_add`, `xclose_exact`. Not covered: multiplicity, floor numbers. - **SharedCourier** (imports TokenCancel, FibreK): `shared_row`, `sep_row`, `exact_mod_tokens`, `tc_cleanup`, `legal_tail_iff`. Hypotheses: snapshot row constant during the chain, consumers are never couriers, couriers distinct. - **PsiLaw** (imports HubSettle): `mapRows_comp`, `psi_two_conditions`, `span_strip_iff`, `span_law_necessary`, `span_law_prefix(_necessary)`, `span_law_not_sufficient`, `unshed_forces_span`, `three_meetings`, `relation_obstruction`, `exposed_read_no_prefix`, `add_swap`, `move_early`. Not formalised: the census counts and the G0-column-operation claim. - Supporting: `HubSettle` (`solve_inGL`, `iff_false_example`), `RankLaw`/`RankLawC` (`copy_lossy_example`, `rank_law_proj`), `FrameSep` (`X_Y_never_share`, `reader_never_meets_Y_after`, `meet_before_read_possible`). -- **WordDuality** (imports FibreK; model data as hypotheses: charts with an involution ⊥, dim ⊥c = N − dim c, hubs z, V with ⊥z = V): `dual_run`, `dual_legal`, `dual_boundary`, `dual_dim_boundary` (legal words map to legal words; boundaries (b,e) ↦ (N−e, N−b); hub rules swap; ascent stays ascent, descent stays descent); `Mrec_dual` (for MOVE/ADD/SCALE words the matrix is the σ-relabelled transpose); `helperOf_dual`, `dualH_invoice`, `dualH_root`, `word_invoice` (the Theorem-K invoice and the roots of the caller invoice are unchanged; hyps b ≤ e ≤ N, step dims ≤ N); `selfdual_boundary` (P104's X_p/Y_p boundaries are self-dual, g = id); `hosted_block`; `nonhosted_block` (the non-hosted F block is reconstructed as data from the dual block). `copy_not_add`: COPY does not dualise to ADD as matrices (FALSE.md item 22). Not formalised: the P104 chart/physical check, the missing ⊥ frames, the palindromic construction. -- **PlaneLaws** (Mathlib only; Vec n = Fin n → ZMod 2, odd tokens/ports): SPLIT holds for any n (`split_xor`, `split_lemma`, `split_partition`); the claim that t'' is a port holds only on the full odd set when t ≠ t' (`tok_t''`, `t''_eq_one`), not for an arbitrary odd-port set; E7 counts (`e7_split`, 63×62 pairs, kernel `decide`). QUARTER is an exact partition for any n and any subspace B ∋ 1 (`QHyp`, `qhyp_Hs`, `qhyp_unique`, `quarter_partition`, `qtok_junk`, `readers_see_all`). The counts (2^(d−2) quarters × 2^(n−d) tokens each, 4 readers each at n = 7, d = 4) are kernel-checked on E7 only (`e7_block`, `e7_quarter`, `e7_totals`), in a 7-bit-mask encoding whose bridge to `Vec 7` is not proved; the general-n counts are formulas, not formalised. +- **WordDuality** (imports FibreK; model data as hypotheses: charts with an involution ⊥, dim ⊥c = N − dim c, hubs z, V with ⊥z = V): `dual_run`, `dual_legal`, `dual_boundary`, `dual_dim_boundary` (location-legal words (`LegalL`, which reads locations only, not rows) map to location-legal words; boundaries (b,e) ↦ (N−e, N−b); hub rules swap; ascent stays ascent, descent stays descent); `Mrec_dual` (for MOVE/ADD/SCALE words the matrix is the σ-relabelled transpose); `helperOf_dual`, `dualH_invoice`, `dualH_root`, `word_invoice` (the Theorem-K invoice and the roots of the caller invoice are unchanged; hyps: the listed registers climb, dim init ≤ dim fin; R symmetric under ⊥ (`hR`); b ≤ e ≤ N, step dims ≤ N); `selfdual_boundary` (abstract, no P104 data: given registers X_p, Y_p with X_p running line p → V, Y_p running z → hyp p, σ swapping them and ⊥(line p) = hyp p, all as hypotheses, the dual word has the same boundaries, g = id); `hosted_block`; `nonhosted_block` (the non-hosted F block is reconstructed as data from the dual block). `copy_not_add`: COPY does not dualise to ADD as matrices (FALSE.md item 22). Not formalised: the P104 chart/physical check, the missing ⊥ frames, the palindromic construction. +- **PlaneLaws** (Mathlib only; Vec n = Fin n → ZMod 2, odd tokens/ports): SPLIT holds for any n (`split_xor`, `split_lemma`, `split_partition`); the claim that t'' is a port holds only on the full odd set when t ≠ t' and n is odd (`tok_t''` takes 1·1 = 1; `t''_eq_one`), not for an arbitrary odd-port set; E7 counts (`e7_split`, 63×62 pairs, kernel `decide`). QUARTER is an exact partition for any n and any subspace B ∋ 1 (`QHyp`, `qhyp_Hs`, `qhyp_unique`, `quarter_partition`, `qtok_junk`, `readers_see_all`). The counts (2^(d−2) quarters × 2^(n−d) tokens each, 4 readers each at n = 7, d = 4) are kernel-checked for one 4-dim block B of E7 only (`e7_block`, `e7_quarter`; `e7_totals` is the arithmetic 9·7·4 = 252, 9·7·8 = 504), in a 7-bit-mask encoding whose bridge to `Vec 7` is not proved; the general-n counts are formulas, not formalised. ## H. Spec-break kills (SpecTS, SpecGC, SpecRankP, SpecRankP2, SpecLemmaU, SpecLemmaU2, Spec6, PadLift, Spec0Sym; supporting SpecTSUR, SpecINV, CallerBorrow, Spec0K0Core) Setting throughout: reflection jobs 1 − x yᵀ, characteristic ≠ 2 where stated; each file's model hypotheses are stated in its note and are inherited, not re-derived. - **SpecTSUR / SpecTS:** product formula `pp_eq`, `lemmaTS` / `lemmaTS_model`: product of k jobs = a ±1 diagonal flipping exactly k coordinates ⇒ Gram y_i·x_j = 2δ_ij, rank X = rank Y = k, range(I−D) = span(x_i). `tight_needed` (r = k cannot be dropped). -- **SpecINV / SpecGC:** `inv_word`, `det_refl`; `jobs_commute`, `twin_rule`, `twin_empty`, `split_word`, `K_data`, `gap_le`, `gc_strict`, `gc_h0`, `gc_h1` and the word versions `gc_dead_h0/h1/strict`. +- **SpecINV / SpecGC:** `inv_word`, `det_refl`; `jobs_commute`, `twin_rule`, `twin_empty`, `split_word`, `K_data`, `gap_le`, `gc_strict`, `gc_h0`, `gc_h1` and the word versions `gc_dead_h0/h1/strict` (`gc_h0`, `gc_h1`, `gc_dead_h0/h1` take 0 < U). - **SpecRankP / PadLift / SpecRankP2:** `rank_ge`, `rank_ge_four` (hyps: Δ = −1 on S, Δ e1 = e1 with e1 ∉ S, im(P−1) ⊆ V with dim V ≤ 2, det P = 1; `det_needed` shows det P = 1 cannot be dropped); `rank_blockdiag`, `pad_rank` (char ≠ 2; `pad_rank_char2_fails`), `pad_sq`, `lift_kill`, `lift_budget`, `job_dark`; `anc_zero`, `JNJ`, `rhoJ_invol`, `Jrho_invol`, `spec7_dead_U34` (U ∈ {3,4}; hypotheses hΛ, hP: Theorem A and the class reduction; U ≥ 5 not covered). - **SpecLemmaU / SpecLemmaU2:** `lemmaU`, `lemmaU_mat(_T)`, `sylvester`, `sylvester_step`, `p0_q0_le_two`; `kb`, `key3`, `key4`, `Em1_bound`, `spec0_core_U4`. Open hypothesis: the k = 0 involution step `hk0`. -- **Spec6:** the group-theoretic kill L1–L4, F1 and the case split (`GX`, `job_of_GX`, …), n-free and order-free, char ≠ 2. +- **Spec6:** the group-theoretic lemmas L1–L4, F1 and the case split (`GX`, `job_of_GX`, …, `spec6_trichotomy`: every case ends in PL, ALLX or ALLY), n-free and order-free, char ≠ 2. The kill `spec6_dead` is conditional on three named hypotheses `R58_PL`, `R58_ALLX`, `R58_ALLY` excluding those end cases (not formalised). - **Spec0Sym + Spec0K0Core:** `Gl_closed`, `cover`, `distinct` (90 orbit representatives of the 720 orders under a group of order 8), `step_F`, `step_T`, `reduction`. Named gaps: wp vs explicit-word bridge, the model definition (`ModelOK`/`Rel`), k = 0 statements only. - **PARTIAL: Spec0K0_ABCEDF_s0 … s6** (radical certificates, class ABCEDF): of 68 targets, 28 are identically zero (`ring`), 32 are certified by `linear_combination` certificates, **8 are NOT certified** (ω1, ω2, ω5, ω6 and the four (1,4) entries); that is 60 of 68 targets of this one class. Needs CharZero (denominators 2^k). No kill claim is made from these files. - **CallerBorrow:** BORROW lemmas R/OS/GS in an abstract caller model (`commute_of_line`, `RebaseData.lemmaR`, `not_both`; the GS block identities are checked numerically outside Lean). diff --git a/research/p104-lean-premises/PR_BODY.md b/research/p104-lean-premises/PR_BODY.md index 488ff8dcd7..8d3bedffdc 100644 --- a/research/p104-lean-premises/PR_BODY.md +++ b/research/p104-lean-premises/PR_BODY.md @@ -1,21 +1,21 @@ Lean-only package, part 3 (combined). No κ claim. -Kernel-checked Lean (Lean 4.33.0-rc1, pinned Mathlib; propext, Classical.choice, Quot.sound only; no `sorry`, no `native_decide`) with named hypotheses, in four groups. +Kernel-checked Lean (Lean 4.33.0-rc1, pinned Mathlib; propext, Classical.choice, Quot.sound only; no `sorry`, no `native_decide`) with named hypotheses, in four groups. The descriptions below were corrected after an independent review (`CORRECTIONS.md`); where a description and a Lean statement differ, the Lean statement is authoritative. -**1. Premise narrowing for #7620** (the premises on which our #7623/#7630 κ is conditional). CLEAR certificates are sound and complete and every CLEAR is lossless (`ClearCert`); owned ascent is priced symmetrically, earns no credit, and relaxed-class floors imply strict-class floors (`OwnedAscent`); exact rows are equivalent to all columns (`NativeColumns`); the 981-pair census is a delta census, with kernel-checked inheritance from #7623 (`CensusComplete`); E1, E2 and E3 (flat and tree, under atomic calls) hold for the real owned skeleton of #7630 (`OwnedSkeleton`, `OwnedTree`). `PREMISES.md` lists per premise what is now a kernel fact and what is still assumed. +**1. Premise narrowing for #7620** (the premises on which our #7623/#7630 κ is conditional). In a birth-free, endpoint-exact word every CLEAR is lossless, and the certificate checker is sound and complete for such words (`ClearCert`; the 180 real certificates are not replayed). In the pricing model every MOVE, owned or public, is charged |Δdim| in either direction and owned registers earn no credit; these are definitions, and `OwnedAscent` proves their consequences, including that relaxed-class floors imply strict-class floors. Exact rows are equivalent to all columns (`NativeColumns`). The MOVE pairs used by #7630 lie in #7623's used pairs plus the 981-pair census (kernel-checked inclusion of extracted lists), so all used pairs are correct if the census pairs and #7623's pairs are; both are inputs (`CensusComplete`). E1, E2 and E3 (flat, and tree under atomic calls with every child unit running the same word) hold for the owned skeleton extracted from #7630 (`OwnedSkeleton`, `OwnedTree`; the extraction is not verified). `PREMISES.md` lists per premise what is now a kernel fact and what is still assumed. -**2. Ceilings.** -- Caller side: cost closed form and the #7113 caller invoice (`CallerCost`); κ ≤ .0419448764 for rho = 2 two-arm callers under named hypotheses, with fully kernel-checked 2|2 (t ≥ 141/4096) and 1|1 (t ≥ 176/4096) bounds (`JointCeiling`). -- Whole word: **κ ≤ .0204110965 over legal (nested) words** (`WholeFloorNest.kappa_whole_floor_nested`). Hypotheses: Theorem Y (`h_Y`), slack-rank independence (`Indep`), the F-currency pricing link (`hF`) and `Priced`; the numeric cover is discharged in the kernel (`WholeFloorCover`, `NumCertK`). The verifier's nesting rule is what rules out lateral owned MOVEs (see FALSE.md item 11). -- **κ ≤ .0060197405 for class K(S22)** (`FloorK22`, `NumCertK22`), hypotheses: the rank input `ClassK22.rank_ge`, the cost-model links, and the caller-log input. -- **κ ≤ .0183952347 and κ ≤ .0134769139 for the restricted class M_V** (`CongestionI3*`), the second with descent mass ≥ 56. Hypotheses: the I3 path bound, the flag-DP minima, rank-8 decoders with C = 56 (exactly), and the public-provenance law. No known native lies in M_V, so these bound the restricted class, not the native class. -- Supporting: the 780-stop class-K LP certificate checked by `decide +kernel` (`FloorCert*`), descent pricing, helper D0 ≥ 2 ln 2 per paid stay (`FloorD0`). +**2. Ceilings.** All are statements about the 17-call invoice of the #7113 caller C(8|9) unless stated otherwise. +- Caller side: cost closed form and the #7113 caller invoice (`CallerCost`). κ ≤ .0419448764 for two-arm callers in `InClass 4`, conditional on the B-form hypothesis `hB`, the native floor `hN` and the numeric certificate `NumCert` (not kernel-checked; its tail step is unaudited). For the 2|2 split (t ≥ 141/4096) and the 1|1 split (t ≥ 176/4096) the numerics are kernel-checked; `hB`, `hth` and `hN` remain hypotheses (`JointCeiling`). +- Whole word: **κ ≤ .0204110965 for nested words satisfying `Priced`** (`WholeFloorNest.kappa_whole_floor_nested`). Hypotheses: `Priced w` (Theorem Y `h_Y`; helper and main price floors `h_help`, `h_main`; owned pricing with ranks 1..9, owned mass ≤ 112 and at least 16 paid owned MOVEs) and the F-currency pricing link `hF`. Words with fewer than 16 paid owned MOVEs or owned mass above 112 are outside the statement. Nesting enters through the lateral count of a MOVE log (`NestedWord`); the pricing summary is not derived from a run. Slack-rank independence (`Indep`) is not a hypothesis of this theorem; it sits upstream of `h_Y` and is not linked. The numeric cover is discharged in the kernel (`WholeFloorCover`, `NumCertK`). The verifier's nesting rule is what rules out lateral owned MOVEs (see FALSE.md item 11). +- **κ ≤ .0060197405 for class K(S22)** (`FloorK22`, `NumCertK22`): F(1−t) < 0 for t in [.0060197405, 1). Hypotheses: strictly monotone `dim` (`hdim`), membership in `ClassK22` (a model-`Accepted` word with the kept data of S22, including the rank input `rank_ge`), and the cost-model link `hF`. No word, S22 included, is shown in Lean to lie in `ClassK22`. +- **κ ≤ .0183952347 and κ ≤ .0134769139 for the restricted class M_V** (`CongestionI3`), the second with descent mass ≥ 56. M_V is not defined in Lean: `MV`, `Rank8C56`, `PlaneSep` (first ceiling) and `Prov` (second) are uninterpreted propositions that only guard the I3 hypothesis, so the class restriction rests on the reading of that hypothesis. Both theorems assume the junk count |J| ≥ 1936 directly; its derivation from the flag-DP minima (`forced_junk_ge`) is a separate theorem and is not invoked. Further hypotheses are listed in `PROVED.md` §F (native bound `hF`, Theorem Y, stop bound `hst`, per-pair minima, at least 16 paid owned MOVEs for the first; descent ranks and at least 8 owned rises for the second). No known native lies in M_V, so these bound the restricted class, not the native class. +- Supporting: a dual certificate for an 892 × 18,868 LP checked by `decide +kernel` (`FloorCert*`; it reaches class-K words only through the hypothesis H2), descent pricing (`DescentPrice`), helper D0 ≥ 2 ln 2 per paid stay on accepted words with strictly monotone `dim` (`FloorD0`). -**3. Word structure.** `Shadow` (the twin has the same net invoice, hence the same S, F, D0, κ), `Annihilator` (served ports ≤ descending owned rank), `Delivery` (net delivery needs two contacts with different courier rows; three genuine hops cost ≥ f(3); direct-read capacity), `DesignLaws`, `SharedCourier`, `PsiLaw`, `WordDuality` (legal words map to legal words, the Theorem-K invoice and roots are unchanged, P104 boundaries are self-dual), `PlaneLaws` (SPLIT for any n; QUARTER an exact partition for any n and block B containing 1; counts kernel-checked on E7 only), with `HubSettle`, `RankLaw`, `RankLawC`, `FrameSep`. +**3. Word structure.** `Shadow` (under main-table symmetry `Sym`, the twin has the same net histogram T − P, hence the same S, F, D0, κ), `Annihilator` (served ports ≤ descending owned rank, for a lineage whose Gram block over the served ports is an identity block), `Delivery` (net delivery needs two contacts with different courier rows; a courier with exactly three genuine hops whose climb is their sum costs ≥ f(3); direct-read capacity), `DesignLaws`, `SharedCourier`, `PsiLaw`, `WordDuality` (location-legal words map to location-legal words; the Theorem-K invoice and roots are unchanged for climbing registers; the X_p/Y_p boundary pattern, given as hypotheses, is self-dual), `PlaneLaws` (SPLIT for any n; t'' is a token only for odd n; QUARTER an exact partition for any n and block B containing 1; counts kernel-checked for one block of E7 only), with `HubSettle`, `RankLaw`, `RankLawC`, `FrameSep`. -**4. Spec-break kills and small lemmas.** The rank, Gram and involution lemmas behind the kill arguments (`SpecTS`, `SpecGC`, `SpecRankP`, `SpecRankP2`, `SpecLemmaU`, `SpecLemmaU2`, `Spec6`, `PadLift`, `Spec0Sym`, with `SpecTSUR`, `SpecINV`, `CallerBorrow`), `LemmaW`, and `SmallRoots` (kernel checks of three small-caller roots). `Spec0K0_ABCEDF_s0..s6` are PARTIAL: certificates for 60 of 68 targets of one class; 8 targets are not certified. +**4. Spec-break kills and small lemmas.** The rank, Gram and involution lemmas behind the kill arguments (`SpecTS`, `SpecGC`, `SpecRankP`, `SpecRankP2`, `SpecLemmaU`, `SpecLemmaU2`, `Spec6`, `PadLift`, `Spec0Sym`, with `SpecTSUR`, `SpecINV`, `CallerBorrow`), `LemmaW`, and `SmallRoots` (kernel checks of three small-caller roots). `Spec6`'s kill is conditional on three named hypotheses excluding the PL / ALLX / ALLY end cases. `Spec0K0_ABCEDF_s0..s6` are PARTIAL: certificates for 60 of 68 targets of one class; 8 targets are not certified. -`PROVED.md` gives every theorem with its exact hypotheses. `FALSE.md` lists the statements Lean refuted or corrected, among them: the lateral-move floor (a counterexample, repaired by the nesting rule), the three-genuine-hop bound 3.30 (needs genuine hops), ONE-READ (needs descent), two span/obstruction statements, the "same invoice" claim for the twin (only the net is equal), a rounded recipe (off by 0.13), an arm-of-1 overcharge that withdrew an earlier ceiling, a false composition law for caller cost, and "COPY becomes ADD" under the duality (false as matrices). `CHECK.txt` has the compile table and axioms. +`PROVED.md` lists the theorems with their hypotheses. `FALSE.md` lists the statements Lean refuted or corrected, among them: the lateral-move floor (a counterexample, repaired by the nesting rule), the three-genuine-hop bound 3.30 (needs genuine hops), ONE-READ (needs descent), two span/obstruction statements, the "same invoice" claim for the twin (only the net is equal), a rounded recipe (off by 0.13), an arm-of-1 overcharge that withdrew an earlier ceiling, a false composition law for caller cost, and "COPY becomes ADD" under the duality (false as matrices). `CHECK.txt` has the compile table and axioms. Not wired into any build or verifier (unregistered, like the other Lean packages). Not included: scripts, generators and source data; the generated Lean data files are included and their fidelity rests on reading. diff --git a/research/p104-lean-premises/README.md b/research/p104-lean-premises/README.md index dc1e6ff692..ab2c3a0207 100644 --- a/research/p104-lean-premises/README.md +++ b/research/p104-lean-premises/README.md @@ -5,21 +5,21 @@ This is the third Lean-only package. It follows the floors/bridge package (#7632 ## What is in it **A. Premise narrowing for #7620.** Our #7623/#7630 κ is conditional on #7620's premises. Six Lean files shrink what is merely assumed: -`ClearCert` (every CLEAR is lossless; checker sound and complete), `OwnedAscent` (owned ascent is priced symmetrically, earns no credit, and relaxed-class floors imply strict-class floors), +`ClearCert` (in a birth-free, endpoint-exact word every CLEAR is lossless; checker sound and complete for such words; the real certificates are not replayed), `OwnedAscent` (in the pricing model every MOVE is charged |Δdim| in either direction and owned registers earn no credit, by definition; relaxed-class floors imply strict-class floors), `NativeColumns` (exact rows ⇔ all columns), `CensusComplete` (+ `CensusData`: the 981-pair census is a DELTA census; all used pairs are correct if the census and #7623's used pairs are), -`OwnedSkeleton` (+ `OwnedSkeletonData`: E1, E2, E3-flat for the real owned skeleton), `OwnedTree` (+ `OwnedTreeData`, `OwnedTreeCheck`: E3-tree for every depth and call-site set under atomic calls). +`OwnedSkeleton` (+ `OwnedSkeletonData`: E1, E2, E3-flat for the extracted owned skeleton), `OwnedTree` (+ `OwnedTreeData`, `OwnedTreeCheck`: E3-tree for every depth and call-site set under atomic calls, every child unit running the same word). `PREMISES.md` lists, premise by premise, what is now a kernel fact and what is still assumed. **B. Caller-tied ceiling.** `CallerCost` (caller cost closed form, reproduction of the #7113 caller invoice, single crossing, composition) and `JointCeiling` -(ceiling κ ≤ .0419448764 conditional on named hypotheses; kernel-checked 2|2 bound t ≥ 141/4096 and 1|1 bound t ≥ 176/4096; the earlier .0336 is withdrawn). +(ceiling κ ≤ .0419448764 conditional on named hypotheses, including the numeric certificate `NumCert`, which is not kernel-checked; for the 2|2 split (t ≥ 141/4096) and the 1|1 split (t ≥ 176/4096) the numerics are kernel-checked, the class hypotheses `hB`, `hth` and the native floor `hN` remain; the earlier .0336 is withdrawn). -**C. SWAP-NULL law.** `SwapNull.lean`: the swap gadget, hub-undoability iff both helpers end in V or both are born in G0, zero cost change in exactly those cases, and a witness that cost-changing swaps cannot be undone (see PROVED.md §C). +**C. SWAP-NULL law.** `SwapNull.lean`: the swap gadget; with final matrix the identity, hub-undoability iff both helpers end in V or both are born in G0; zero cost change whenever the two ends or the two births agree, hence for every hub-undoable swap; and a witness that cost-changing swaps cannot be undone (see PROVED.md §C). -**D. Whole-word and restricted-class ceilings.** `WholeFloor*` (model, slack rank, pricing, the nesting rule, kernel interval cover) with `NumCertK*` (kernel interval arithmetic), `FloorK22*` (class K(S22)), `CongestionI3*` (the I3 congestion bound and rank-8, C = 56 junk count), with the supporting `FloorCert*` (780-stop LP certificate), `DescentPrice`, `FloorD0`, `JunkLB2`. Results: κ ≤ .0204110965 over legal (nested) words, hypotheses Theorem Y, `Indep`, `hF`, `Priced`; κ ≤ .0060197405 for class K(S22); κ ≤ .0183952347 and .0134769139 for the restricted class M_V, with I3, the flag-DP minima, rank-8 C = 56 and public provenance as hypotheses. The M_V ceilings are not floors on the native class: no known native lies in M_V. +**D. Whole-word and restricted-class ceilings.** `WholeFloor*` (model, slack rank, pricing, the nesting rule, kernel interval cover) with `NumCertK*` (kernel interval arithmetic), `FloorK22*` (class K(S22)), `CongestionI3*` (the I3 congestion bound and rank-8, C = 56 junk count), with the supporting `FloorCert*` (780-stop LP certificate), `DescentPrice`, `FloorD0`, `JunkLB2`. Results, all on the 17-call invoice of the #7113 caller: κ ≤ .0204110965 for nested words satisfying `Priced` (Theorem Y, helper and main price floors, owned ranks 1..9, owned mass ≤ 112, at least 16 paid owned MOVEs) and the pricing link `hF` (`Indep` is not a hypothesis of this theorem); κ ≤ .0060197405 for class K(S22) on t in [.0060197405, 1), under `hdim`, `ClassK22` and `hF` (no word is shown in Lean to lie in the class); κ ≤ .0183952347 and .0134769139 for the restricted class M_V, where M_V, rank-8 C = 56, plane separation and public provenance are uninterpreted propositions guarding the I3 hypothesis, and the junk count |J| ≥ 1936 is assumed directly (the flag-DP derivation `forced_junk_ge` is not invoked); full lists in PROVED.md §F. The M_V ceilings are not floors on the native class: no known native lies in M_V. -**E. Word structure.** `Shadow` (twin invoice has the same net), `Annihilator` (served ports ≤ descending owned rank), `Delivery` (two contacts, three-hop cost, direct-read capacity), `DesignLaws` (port/chart laws, rank-feed, XCLOSE), `SharedCourier` (shared-snapshot courier), `PsiLaw` (span law and exposed reads), `WordDuality` (legal words dualise; the invoice and roots are unchanged), `PlaneLaws` (SPLIT for any n, QUARTER exact partition; counts on E7 only), with `HubSettle`, `RankLaw`, `RankLawC`, `FrameSep`. +**E. Word structure.** `Shadow` (under main-table symmetry, the twin invoice has the same net), `Annihilator` (served ports ≤ descending owned rank, for an identity Gram block), `Delivery` (two contacts, exactly-three-hop cost, direct-read capacity), `DesignLaws` (port/chart laws, rank-feed, XCLOSE), `SharedCourier` (shared-snapshot courier), `PsiLaw` (span law and exposed reads), `WordDuality` (location-legal words dualise; the invoice and roots are unchanged for climbing registers; boundary self-duality from boundary hypotheses), `PlaneLaws` (SPLIT for any n, t'' a token for odd n, QUARTER exact partition; counts on one block of E7 only), with `HubSettle`, `RankLaw`, `RankLawC`, `FrameSep`. -**F. Spec-break kills.** `SpecTSUR`, `SpecTS`, `SpecINV`, `SpecGC`, `SpecRankP`, `SpecRankP2`, `SpecLemmaU`, `SpecLemmaU2`, `Spec6`, `PadLift`, `Spec0Sym` (+ `Spec0K0Core`), `CallerBorrow`: rank, Gram and involution lemmas used by the kill arguments, with their model hypotheses stated. `Spec0K0_ABCEDF_s0` to `s6` are PARTIAL: radical certificates for 60 of the 68 targets of one class; 8 targets are not certified. +**F. Spec-break kills.** `SpecTSUR`, `SpecTS`, `SpecINV`, `SpecGC`, `SpecRankP`, `SpecRankP2`, `SpecLemmaU`, `SpecLemmaU2`, `Spec6`, `PadLift`, `Spec0Sym` (+ `Spec0K0Core`), `CallerBorrow`: rank, Gram and involution lemmas used by the kill arguments, with their model hypotheses stated (`Spec6`'s kill takes three named end-case hypotheses). `Spec0K0_ABCEDF_s0` to `s6` are PARTIAL: radical certificates for 60 of the 68 targets of one class; 8 targets are not certified. **G. Smaller lemmas.** `LemmaW` (borrow lemma W), `SmallRoots` (+ Defs, Data, A22Corners; kernel checks of three small-caller roots). @@ -28,7 +28,8 @@ Labels such as R3, RB4 and AUDIT5 in the per-file notes refer to internal workin | file | content | |---|---| | PREMISES.md | per premise: kernel FACT vs still ASSUMED | -| PROVED.md | every theorem with its exact hypotheses | +| PROVED.md | the theorems with their hypotheses (corrected after an independent review; the Lean statements are authoritative) | +| CORRECTIONS.md | statements corrected after the review | | FALSE.md | prose statements Lean refuted or corrected | | CHECK.txt | compile table (one file at a time, 3.5 GB guard) and axioms | | SHIPPED.txt | files already in #7632/#7634 (byte-identical) | diff --git a/research/p104-lean-premises/lean/Nov15/DescentPrice.lean b/research/p104-lean-premises/lean/Nov15/DescentPrice.lean index 79409ebc8f..7f17e86d8d 100644 --- a/research/p104-lean-premises/lean/Nov15/DescentPrice.lean +++ b/research/p104-lean-premises/lean/Nov15/DescentPrice.lean @@ -1,5 +1,5 @@ /- -REBUILD-V2 r6 descent price, Source: internal notes §2. +Descent price. Source: internal notes. See DescentPrice.md. Invoice model (abstract): a register's path is the list of chart dimensions it visits; each MOVE is diff --git a/research/p104-lean-premises/lean/Nov15/Floor.lean b/research/p104-lean-premises/lean/Nov15/Floor.lean index c8b615e92a..c47f612595 100644 --- a/research/p104-lean-premises/lean/Nov15/Floor.lean +++ b/research/p104-lean-premises/lean/Nov15/Floor.lean @@ -1,5 +1,5 @@ /- -Class-K junk floor (780 stops = 1,081.31 D0/call), Sources: internal notes (F1, F2, F3 certificate, F4), +Class-K junk floor (780 stops ≈ 1,081.3096 D0/call), Sources: internal notes (F1, F2, F3 certificate, F4), internal notes (R0(a,b,c), R1, R2, R3, R4 certificate). Everything is stated per chart / per build over an arbitrary field, with the op-model facts diff --git a/research/p104-lean-premises/lean/Nov15/FloorCert.lean b/research/p104-lean-premises/lean/Nov15/FloorCert.lean index 801d56c026..374aa5c104 100644 --- a/research/p104-lean-premises/lean/Nov15/FloorCert.lean +++ b/research/p104-lean-premises/lean/Nov15/FloorCert.lean @@ -1,6 +1,6 @@ /- FloorCert : the RANKSTEINER R4 dual certificate for the class-K junk floor -(780 paid stops = 1,081.31 D0/call), checked in Lean by kernel evaluation (`decide +kernel`, no +(780 paid stops = 780 · 2 ln 2 ≈ 1,081.3096 D0/call), checked in Lean by kernel evaluation (`decide +kernel`, no `native_decide`, so no `Lean.ofReduceBool`). See FloorCert.md. The LP is the support sub-LP of rslp.py's LP (only rows with positive dual: 892 rows, 18,868 @@ -127,7 +127,7 @@ theorem stops_ge_780 {σ : Type*} (x : Fin nCols → 𝕜) (hx : ∀ j, 0 ≤ x (lp_floor x hx hAx).trans hobj /-- **Cost form** (FloorGlue.global_floor_of_certificate with the checked certificate): per-stop -cost ≥ κ gives total cost ≥ 780 κ. With 𝕜 = ℝ and κ = 2 ln 2 this is 1,081.31 D0/call. -/ +cost ≥ κ gives total cost ≥ 780 κ. With 𝕜 = ℝ and κ = 2 ln 2 this is ≈ 1,081.3096 D0/call. -/ theorem cost_ge_780 {σ : Type*} (x : Fin nCols → 𝕜) (hx : ∀ j, 0 ≤ x j) (hAx : ∀ i, b i ≤ ∑ j, A i j * x j) (stays : Finset σ) (cost : σ → 𝕜) (κ : 𝕜) (hκ0 : 0 ≤ κ) (hκ : ∀ s ∈ stays, κ ≤ cost s) (hobj : ∑ j, c j * x j ≤ stays.card) : diff --git a/research/p104-lean-premises/lean/Nov15/FloorCert.md b/research/p104-lean-premises/lean/Nov15/FloorCert.md index 391d9dc7ac..e5a25e0417 100644 --- a/research/p104-lean-premises/lean/Nov15/FloorCert.md +++ b/research/p104-lean-premises/lean/Nov15/FloorCert.md @@ -18,7 +18,7 @@ Axioms: the four checks in FloorCertCheck use **no axioms at all**; every theore - `lp_floor`: Floor.weak_duality gives 780 ≤ cᵀx; - `stops_ge_780`: 780 ≤ #stays when cᵀx ≤ #stays; - `cost_ge_780`: FloorGlue.global_floor_of_certificate gives cost ≥ 780κ; - - `cost_ge_real`: κ = 2 ln 2, i.e. 1,081.31 D0/call. + - `cost_ge_real`: κ = 2 ln 2, i.e. ≈ 1,081.3096 D0/call. ## Native feasibility in Lean (NOTE: the NativeFeas files are NOT part of this package; this section is kept for context only) Files: NativeFeasData.lean (generated by floorcert/export_native.py), NativeFeasCheck.lean (kernel checks, core only), NativeFeas.lean (bridge). diff --git a/research/p104-lean-premises/lean/Nov15/FloorD0.md b/research/p104-lean-premises/lean/Nov15/FloorD0.md index e5e0726685..c08f744fe5 100644 --- a/research/p104-lean-premises/lean/Nov15/FloorD0.md +++ b/research/p104-lean-premises/lean/Nov15/FloorD0.md @@ -8,7 +8,7 @@ Axioms: the 13 printed theorems use exactly [propext, Classical.choice, Quot.sou - Native word: helper r (public, not a main) gives T[dim final(r) − dim initial(r)]; every MOVE a → b gives P[|dim b − dim a|]. - D0 = Σ_r (T_r − P_r)·f(r), f(r) = r ln r (`Dsum`; it sums r > 1 only, which is the same since f(0) = f(1) = 0). - **÷17.** `histD0_invoice`: D0(invoice) = D0(caller) + L·D0(native), exactly. So "D0/call" of the helper layer is the word's own helper D0: - `helperD0 = Σ_{h∈H} [f(dim fin h − dim ini h) − Σ_{MOVEs of h} f(|Δ dim|)]` (`regD0`, `helperD0`). This is the gap map's "helpers 9,946.29 D0/call" quantity, and FloorCert's 1,081.31 is in the same unit. + `helperD0 = Σ_{h∈H} [f(dim fin h − dim ini h) − Σ_{MOVEs of h} f(|Δ dim|)]` (`regD0`, `helperD0`). This is the gap map's "helpers 9,946.29 D0/call" quantity, and FloorCert's ≈ 1,081.3096 is in the same unit. - Model data beyond FloorEndToEnd: `dim : C → ℕ` with a < b ⇒ dim a < dim b. For the verifier's chart order (a < b iff span a ⊊ span b, frames = bases) this is a fact, not data. - the price checker's T uses W['final']; `regD0` uses the run's final location. They agree whenever the exit-frame check passes (replay `exit-frames`). - The official repo has no D0. Its figure of merit is the κ crossing, and the price checker reproduces those crossings bit-exactly (the price checker/RESULT §1). D0 is the lab's first-order unit. diff --git a/research/p104-lean-premises/lean/Nov15/HubSettle.lean b/research/p104-lean-premises/lean/Nov15/HubSettle.lean index 8133032794..211d9594d0 100644 --- a/research/p104-lean-premises/lean/Nov15/HubSettle.lean +++ b/research/p104-lean-premises/lean/Nov15/HubSettle.lean @@ -1,5 +1,5 @@ /- -REBUILD-ALT joint-hub derivation (alt/r2, ROUNDLOG ALT r1/r2), See HubSettle.md. +Joint-hub derivation (internal notes). See HubSettle.md. Build: imports the olean of RankLaw (which imports TokenCancel): lake env lean -o .lake/build/lib/lean/Nov15/TokenCancel.olean Nov15/TokenCancel.lean diff --git a/research/p104-lean-premises/lean/Nov15/PsiLaw.lean b/research/p104-lean-premises/lean/Nov15/PsiLaw.lean index 501f98751d..0ee3d396fa 100644 --- a/research/p104-lean-premises/lean/Nov15/PsiLaw.lean +++ b/research/p104-lean-premises/lean/Nov15/PsiLaw.lean @@ -1,5 +1,5 @@ /- -REBUILD-CORE psi findings (RC8, RC9) formalised, See PsiLaw.md. +Psi findings (internal notes) formalised. See PsiLaw.md. Kernel only: no sorry, no native_decide. Build: lake env lean Nov15/PsiLaw.lean (imports the HubSettle olean) -/ diff --git a/research/p104-lean-premises/lean/Nov15/RankLaw.lean b/research/p104-lean-premises/lean/Nov15/RankLaw.lean index c39250228b..fd4ec249d3 100644 --- a/research/p104-lean-premises/lean/Nov15/RankLaw.lean +++ b/research/p104-lean-premises/lean/Nov15/RankLaw.lean @@ -489,7 +489,7 @@ theorem range_restrict (f : Reg → Reg → K) (G1 : Finset Reg) : 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 (REBUILD-CORE, RESULT §7).** Run a legal word (V-hub ops deleted, SCALE factors +/-- **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